/* ═══════════════════════════════════════════════════════
   Monitor GLOBAL STYLES
   ═══════════════════════════════════════════════════════ */

/*  Brand & Logo  */
.navbar-brand-image {
    width: 34px;
    height: 34px;
    object-fit: contain;
}
.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

[data-bs-theme="dark"] .navbar-brand-autodark .navbar-brand-image{
	filter: brightness(1) invert(0) !important;
}

/*  Sidebar nav links  */
.navbar-vertical .nav-link {
    border-radius: 8px;
    margin-bottom: 3px;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.navbar-vertical .nav-link:hover {
    background: rgba(255,255,255,0.08) !important;
}
.navbar-vertical .nav-link.active {
    background: rgba(255,255,255,0.14) !important;
}
.navbar-vertical .nav-link-icon {
    width: 1.15rem;
    font-size: 1.1rem;
}

/*  Buttons — more padding  */
.btn {
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 7px;
    transition: all 0.15s ease;
}
.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8125rem;
    border-radius: 6px;
}
.btn-lg {
    padding: 0.65rem 1.4rem;
    font-size: 0.975rem;
}

/*  Button group — match rounded corners  */
.btn-group > .btn {
    border-radius: 0;
}
.btn-group > .btn:first-child  { border-radius: 7px 0 0 7px; }
.btn-group > .btn:last-child   { border-radius: 0 7px 7px 0; }
.btn-group > .btn-sm:first-child { border-radius: 6px 0 0 6px; }
.btn-group > .btn-sm:last-child  { border-radius: 0 6px 6px 0; }

/*  btn-ghost-secondary — show a subtle outline so it looks like a button  */
.btn-ghost-secondary {
    border: 1px solid rgba(0, 0, 0, 0.18);
    color: #5c6066;
}
.btn-ghost-secondary:hover {
    border-color: rgba(0, 0, 0, 0.28);
    background: rgba(0, 0, 0, 0.05);
    color: #343a40;
}
[data-bs-theme="dark"] .btn-ghost-secondary {
    border-color: rgba(255, 255, 255, 0.18);
    color: #adb5bd;
}
[data-bs-theme="dark"] .btn-ghost-secondary:hover {
    border-color: rgba(255, 255, 255, 0.30);
    background: rgba(255, 255, 255, 0.07);
    color: #dee2e6;
}

/*  Cards  */
.card {
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.card-body {
    padding: 1.25rem;
}
.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

/*  Tables  */
.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #868e96;
    padding: 0.65rem 1rem;
}
.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
}
.table-vcenter td { vertical-align: middle; }

/*  Badges  */
.badge {
    padding: 0.25em 0.45em;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 5px;
}

/*  Form controls  */
.form-control, .form-select {
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    border-radius: 7px;
}
.form-control-sm, .form-select-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
    border-radius: 6px;
}
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}
.input-group-text {
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
}
.input-group-sm .input-group-text {
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
}

/*  Modals  */
.modal-content {
    border-radius: 12px;
}
.modal-header {
    padding: 1.1rem 1.4rem 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}
.modal-body {
    padding: 1.25rem 1.4rem;
}
.modal-footer {
    padding: 0.9rem 1.4rem;
    border-top: 1px solid rgba(0,0,0,0.07);
}

/*  Page header  */
.page-header {
    padding: 1.25rem 0 1rem;
}
.page-title {
    font-size: 1.35rem;
    font-weight: 700;
}
.page-pretitle {
    font-size: 0.8rem;
    color: #868e96;
    margin-top: 0.2rem;
    text-transform: none !important;  /* override Tabler's uppercase */
    letter-spacing: 0 !important;
}

/*  Status dots  */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.online  { background: #2fb344; }
.status-dot.offline { background: #d63939; }
.status-dot.warning { background: #f76707; }
.status-dot.unknown { background: #868e96; }

/*  Theme toggle  */
#theme-toggle {
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
#theme-toggle:hover {
    background: rgba(255,255,255,0.12);
    transform: scale(1.1);
}

/*  Agent key  */
.agent-key-masked {
    font-family: monospace;
    letter-spacing: 0.05em;
}

/*  Metric / range tab buttons  */
.metric-tab-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.8125rem;
    border-radius: 7px;
}
.range-preset {
    min-width: 36px;
}

/*  Chart cards  */
.chart-card .card-header {
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.chart-card [data-stat]:empty {
    display: none;
}
.chart-card .card-options {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.chart-card .card-body {
    padding: 0.75rem;
}

/*  Stat summary widgets (metrics page)  */
#stats-row .card {
    padding: 0.75rem;
}
#stats-row .fs-4 {
    font-size: 1.4rem !important;
}

/*  Empty state  */
.empty {
    padding: 2.5rem 1rem;
}
.empty-icon {
    margin-bottom: 1rem;
    color: #adb5bd;
}

/*  Toast container z-index  */
#toast-container {
    z-index: 9999;
}

/*  Dark mode refinements  */
[data-bs-theme="dark"] .card {
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
}
[data-bs-theme="dark"] .card-header {
    border-bottom-color: rgba(255,255,255,0.07);
}
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: rgba(255,255,255,0.07);
}
[data-bs-theme="dark"] .table th {
    color: #6c757d;
}

/*  Dashboard table footer row  */
td.table-footer-row {
    border-top: 1px solid rgba(0,0,0,0.06) !important;
}
[data-bs-theme="dark"] td.table-footer-row {
    border-top-color: rgba(255,255,255,0.07) !important;
}

/*  Bulk action toolbar  */
#bulk-toolbar {
    background: rgba(32, 107, 196, 0.05);
    border-bottom: 1px solid rgba(32, 107, 196, 0.12) !important;
    animation: slideDown 0.15s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
[data-bs-theme="dark"] #bulk-toolbar {
    background: rgba(66, 153, 225, 0.08);
    border-bottom-color: rgba(66, 153, 225, 0.15) !important;
}
/* Highlight checked rows */
.table tbody tr:has(.row-chk:checked) {
    background: rgba(32, 107, 196, 0.04);
}
[data-bs-theme="dark"] .table tbody tr:has(.row-chk:checked) {
    background: rgba(66, 153, 225, 0.07);
}

/* Override Tabler's defaults */
.footer {
    padding: 0 !important;
}

.page-header {
    padding: 0 !important;
	margin-top: 0.7rem;
}

[data-bs-theme="dark"] .footer{
	background-color: transparent !important;
}

.footer .container-xl {
    padding-top: .75rem;
    padding-bottom: .75rem;
}
 
/* Stick footer to bottom on short pages */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.page-body {
    flex: 1 0 auto;
}

/*  Tags  */
.tag-input-wrap {
    min-height: 38px;
    cursor: text;
    flex-wrap: wrap;
    row-gap: 4px;
}
.tag-raw-input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    min-width: 100px;
    font-size: .875rem;
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    user-select: none;
}
.tag-pill-remove {
    font-size: .65rem;
    cursor: pointer;
    opacity: .7;
}
.tag-pill-remove:hover { opacity: 1; }

/* Suggestions dropdown */
.tag-suggestions {
    position: absolute;
    z-index: 1055;
    background: var(--tblr-bg-surface);
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    max-width: 300px;
    overflow: hidden;
    margin-top: 2px;
}
[data-bs-theme="dark"] .tag-suggestions {
    border-color: rgba(255,255,255,.12);
}
.tag-suggestion-item {
    display: block;
    padding: .35rem .75rem;
    font-size: .8125rem;
    cursor: pointer;
    color: var(--tblr-body-color);
}
.tag-suggestion-item:hover {
    background: rgba(32,107,196,.08);
    color: #206bc4;
}

/* Entity tag badges in tables */
.entity-tag-badge {
    font-size: .62rem !important;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
}

/*  Responsive: metrics page date picker  */
@media (max-width: 768px) {
    #custom-range-wrap {
        flex-wrap: wrap;
    }
    #custom-range-wrap .input-group {
        width: 100% !important;
    }
    #custom-range-wrap input[type="datetime-local"] {
        width: 100% !important;
    }
}

/* ── Collapsible sidebar (desktop only) ──────────────────────────────────── */
@media (min-width: 992px) {
    #sidebar { transition: width .18s ease; overflow: hidden; }
    html.sidebar-collapsed #sidebar { width: 3.5rem !important; overflow: visible !important; }
    html.sidebar-collapsed #sidebar ~ .page-wrapper { margin-left: 3.5rem !important; transition: margin-left .18s ease; }
    html:not(.sidebar-collapsed) #sidebar ~ .page-wrapper { transition: margin-left .18s ease; }

    html.sidebar-collapsed .page-body .container-xl,
    html.sidebar-collapsed .page-header .container-xl { max-width: none; }

    html.sidebar-collapsed #sidebar .brand-text,
    html.sidebar-collapsed #sidebar .nav-link-title,
    html.sidebar-collapsed #sidebar .sidebar-user-info,
    html.sidebar-collapsed #sidebar .sidebar-toggle-label { display: none !important; }

    html.sidebar-collapsed #sidebar .nav-link { justify-content: center !important; }
    html.sidebar-collapsed #sidebar .nav-link-icon { display: inline-block !important; margin-right: 0 !important; }

    html.sidebar-collapsed #sidebar .sidebar-footer-user { display: none !important; }
    html.sidebar-collapsed #sidebar .sidebar-footer-actions { justify-content: center !important; }
    html.sidebar-collapsed #sidebar .sidebar-toggle-row { justify-content: center !important; }

    #sidebar-toggle-icon { transition: transform .18s ease; display: inline-block; }
    html.sidebar-collapsed #sidebar-toggle-icon { transform: rotate(180deg); }
    html:not(.sidebar-collapsed) #sidebar-toggle-icon { transform: rotate(0deg); }
}
#sidebar-toggle-btn { cursor: pointer; }
@media (max-width: 991.98px) { #sidebar-toggle-btn { display: none !important; } }

#sidebar-flyout {
    position: fixed;
    z-index: 1060;
    padding: .3rem .8rem;
    border-radius: .375rem;
    background: #1e293b;
    color: #fff;
    font-size: .875rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
    pointer-events: none;
    display: none;
}
[data-bs-theme="light"] #sidebar-flyout { background: #334155; }

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #206bc4;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
}
.sidebar-user-info div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 10.5rem;
}

[data-bs-theme="light"] #theme-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

pre {
    overflow: auto;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    background: var(--tblr-bg-surface-secondary, #f6f8fb);
    color: inherit;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.page-pretitle a {
    color: inherit;
    text-decoration: none;
}
.page-pretitle a:hover {
    color: #206bc4;
}

#ranges .btn.active {
    background: #206bc4;
    border-color: #206bc4;
    color: #fff;
}
