/* ============================================
   PS Statistics — Custom overrides on top of Tabler
   ============================================ */

/* No primary color override — use Tabler's native palette */


/* ---- Status dots ---- */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
}
.status-dot--ok {
    background: var(--tblr-success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: pulse-glow-green 2s infinite;
}
.status-dot--error {
    background: var(--tblr-danger);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    animation: pulse-glow-red 2s infinite;
}
.status-dot--warning {
    background: var(--tblr-warning);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    animation: pulse-glow-warning 2s infinite;
}
.status-dot--unknown {
    background: #94A3B8;
}

@keyframes pulse-glow-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes pulse-glow-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes pulse-glow-warning {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ---- KPI cards ---- */
.card-kpi {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--tblr-shadow-lg, 0 10px 15px rgba(0,0,0,0.1));
}

/* ---- Store logo in tables ---- */
.store-logo-sm {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--tblr-border-color);
    padding: 2px;
    background: white;
}

/* ---- Auth pages ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
[data-bs-theme="light"] .auth-page {
    background: radial-gradient(ellipse at 30% 20%, #F1F5F9, #F8FAFC 50%, #FFFFFF);
}
[data-bs-theme="dark"] .auth-page {
    background: radial-gradient(ellipse at 30% 20%, #1E293B, #0F172A 50%, #020617);
}

.glass-card {
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    text-align: center;
}
[data-bs-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
[data-bs-theme="dark"] .glass-card {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.5);
}
@supports (backdrop-filter: blur(10px)) {
    .glass-card {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    [data-bs-theme="light"] .glass-card { background: rgba(255, 255, 255, 0.6); }
    [data-bs-theme="dark"] .glass-card { background: rgba(30, 41, 59, 0.65); }
}

.auth-logo {
    display: block;
    margin: 0 auto 24px;
    height: 64px;
    width: auto;
}

/* Nexlit inline brand logo (wordmark). currentColor drives the text colour:
   white on dark surfaces, navy when the page is toggled to light. Red dot fixed. */
.nexlit-brand {
    height: 26px;
    width: auto;
    color: #FCFCFC; /* header/sidebar are always dark */
}
.nexlit-auth-logo {
    display: block;
    margin: 0 auto 22px;
    height: 34px;
    width: auto;
    color: #FCFCFC;
}
[data-bs-theme="light"] .nexlit-auth-logo {
    color: #0F172A;
}

.glass-card form { text-align: left; width: 100%; }
.auth-page .btn-primary {
    display: block;
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
}

.auth-sparkle {
    position: absolute;
    opacity: 0.1;
    z-index: 0;
}
.auth-sparkle i { font-size: 80px; }
.auth-sparkle--br { bottom: 40px; right: 60px; }

.auth-link-muted {
    font-size: 13px;
    color: var(--tblr-secondary);
    text-decoration: none;
}
.auth-link-muted:hover { color: var(--tblr-primary); }

/* ---- 2FA boxes ---- */
.twofa-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 24px 0;
}
.twofa-box {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--tblr-border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: transparent;
    color: var(--tblr-body-color);
}
.twofa-box:focus {
    border-color: var(--tblr-primary);
    box-shadow: 0 0 0 3px rgba(var(--tblr-primary-rgb), 0.15);
}

/* ---- Password requirements ---- */
.password-requirements {
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    padding: 14px 18px;
}
.password-requirements-title {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 8px 0;
}
.password-requirements-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: var(--tblr-secondary);
    line-height: 1.8;
}

/* ---- Store panel floating header ---- */
.floating-header {
    margin: -1rem -1rem 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--tblr-bg-surface);
    border-bottom: 1px solid var(--tblr-border-color);
}
@supports (backdrop-filter: blur(10px)) {
    .floating-header {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        position: sticky;
        top: 0;
        z-index: 10;
    }
    [data-bs-theme="light"] .floating-header { background: rgba(255, 255, 255, 0.8); }
    [data-bs-theme="dark"] .floating-header { background: rgba(15, 23, 42, 0.85); }
}

.branding-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.powered-by {
    font-size: 11px;
    color: var(--tblr-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.powered-by img {
    height: 16px;
    opacity: 0.5;
}

/* ---- Period selector ---- */
.period-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.period-selector .btn {
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
}
.period-selector .btn.active {
    background: var(--tblr-primary);
    border-color: var(--tblr-primary);
    color: #fff;
}

/* ---- KPI comparison indicator ---- */
.kpi-compare-indicator {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

/* ---- Report icon boxes ---- */
.report-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(var(--tblr-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.report-icon-box i { font-size: 24px; color: var(--tblr-primary); }

/* ---- Utilities panel ---- */
.utilities-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(var(--tblr-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.utilities-icon-box i { font-size: 16px; color: var(--tblr-primary); }

.utilities-badge--ok { background: rgba(34, 197, 94, 0.15); color: #22C55E; }
.utilities-badge--warning { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.utilities-badge--critical { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.utilities-badge--unknown { background: rgba(148, 163, 184, 0.15); color: #94A3B8; }

/* ---- Utilities link ---- */
.utilities-link { color: var(--tblr-secondary); text-decoration: none; }
.utilities-link:hover { color: var(--tblr-primary); }

/* ---- Admin form horizontal layout ---- */
.admin-form .card-body .mb-3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0 !important;
}
.admin-form .card-body .mb-3 + .mb-3 {
    margin-top: 15px !important;
}
.admin-form .card-body .form-label {
    min-width: 150px;
    width: 150px;
    flex-shrink: 0;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 600;
}
.admin-form .card-body .form-control,
.admin-form .card-body .form-select {
    flex: 1;
}
@media (max-width: 767.98px) {
    .admin-form .card-body .mb-3 {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-form .card-body .form-label {
        width: auto;
        min-width: auto;
    }
}

/* ---- Profile page ---- */
.profile-field-group {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.profile-field-group .form-label {
    min-width: 130px;
    width: 130px;
    flex-shrink: 0;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 600;
}
.profile-field-input { flex: 1; }
@media (max-width: 767.98px) {
    .profile-field-group {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .profile-field-group .form-label { width: auto; min-width: auto; }
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(var(--tblr-primary-rgb), 0.08);
    color: var(--tblr-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--tblr-border-color);
}
.profile-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.profile-info-label { font-size: 13px; color: var(--tblr-secondary); }
.profile-info-value { font-size: 13px; font-weight: 500; }

/* ---- Log tab buttons ---- */
.log-tab-btn {
    background: var(--tblr-primary);
    color: #fff;
    border: none;
    opacity: 0.55;
    transition: opacity 0.2s;
}
.log-tab-btn:hover { opacity: 0.75; color: #fff; }
.log-tab-btn.active { opacity: 1; }

/* ---- Navbar brand link ---- */
.navbar-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* ---- Theme toggle in auth (floating) ---- */
.auth-page .theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: 9999px;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
    cursor: pointer;
}
.auth-page .theme-toggle:hover { color: var(--tblr-body-color); }
.auth-page .theme-toggle .nav-link-title { display: none; }
.auth-page .theme-toggle .nav-link-icon { margin: 0; }

.auth-locale-switch {
    position: fixed;
    top: 20px;
    right: 70px;
    display: flex;
    gap: 4px;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: 9999px;
    padding: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
}
.auth-locale-switch a {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tblr-secondary);
    text-decoration: none;
    border-radius: 9999px;
    transition: all 0.15s ease;
}
.auth-locale-switch a:hover { color: var(--tblr-body-color); }
.auth-locale-switch a.active {
    background: var(--tblr-primary);
    color: #fff;
}

/* ---- Text accent ---- */
.text-accent { color: var(--tblr-primary) !important; }

/* ---- Uptime monitor bars ---- */
.uptime-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 28px;
}
.uptime-bar {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    transition: opacity 0.15s;
    cursor: pointer;
    min-width: 0;
}
.uptime-bar:hover { opacity: 0.7; }
.uptime-bar--ok { background: var(--tblr-success); }
.uptime-bar--warning { background: var(--tblr-warning); }
.uptime-bar--critical { background: var(--tblr-danger); }
.uptime-bar--none { background: var(--tblr-border-color); opacity: 0.4; }
.uptime-bar--unknown { background: var(--tblr-border-color); opacity: 0.4; }

/* ---- KPI Skeleton Loading ---- */
/* ---- KPI info icon + popover ---- */
.kpi-info-icon {
    font-size: 13px;
    color: var(--tblr-secondary);
    cursor: help;
    opacity: 0.5;
    transition: opacity 0.2s;
    outline: none;
}
.kpi-info-icon:hover,
.kpi-info-icon:focus {
    opacity: 1;
    color: var(--tblr-primary);
}
.kpi-info-popover {
    max-width: 320px;
    font-size: 12.5px;
    line-height: 1.5;
}
.kpi-info-popover .popover-body {
    padding: 12px 14px;
    color: var(--tblr-body-color);
}

.kpi-skeleton {
    position: relative;
    color: transparent !important;
    overflow: hidden;
    border-radius: 4px;
}
.kpi-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--tblr-border-color) 25%, rgba(226,232,240,0.4) 50%, var(--tblr-border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   FILTERS OFFCANVAS — softer backdrop (30% + blur)
   ============================================ */
.offcanvas-backdrop.show {
    opacity: 0.3;
    backdrop-filter: blur(2px);
}

/* ============================================
   VERTICAL SIDEBAR (full-width header on top,
   sidebar column starts below it)
   ============================================ */
:root {
    --app-header-height: 3.5rem;
}
.app-header {
    min-height: var(--app-header-height);
}
@media (min-width: 992px) {
    /* Sidebar sits below the full-width header */
    .navbar-vertical.navbar-expand-lg {
        top: var(--app-header-height);
    }
}
@media (max-width: 991.98px) {
    /* On mobile the aside is just the collapsible menu container:
       no visible strip when closed */
    .navbar-vertical {
        padding: 0;
        min-height: 0;
    }
}

/* Collapsible nav groups */
.navbar-vertical .nav-group-toggle {
    width: 100%;
    text-align: left;
}
.navbar-vertical .nav-group-chevron {
    margin-left: auto;
    font-size: 14px;
    display: inline-flex;
    transition: transform 0.2s ease;
}
.navbar-vertical .nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
    transform: rotate(180deg);
}
.navbar-vertical .nav-group-items {
    flex-grow: 0;
}
.navbar-vertical.navbar-expand-lg .navbar-collapse .nav-group-items .nav-link {
    padding-left: 2.75rem;
}

/* Footer block (help/contact/collapse) must not share the grow space */
.navbar-vertical .navbar-nav.sidebar-footer {
    flex-grow: 0;
}
.navbar-vertical .sidebar-collapse-toggle {
    color: var(--tblr-navbar-color);
}
.navbar-vertical .sidebar-collapse-toggle:hover {
    color: var(--tblr-navbar-hover-color);
}

/* Collapsed (icon-only) mode — desktop only */
@media (min-width: 992px) {
    .navbar-vertical.navbar-expand-lg {
        transition: width 0.2s ease;
    }
    .navbar-vertical.navbar-expand-lg ~ .navbar,
    .navbar-vertical.navbar-expand-lg ~ .page-wrapper {
        transition: margin-left 0.2s ease;
    }
    body.sidebar-collapsed .navbar-vertical.navbar-expand-lg {
        width: 4.25rem;
    }
    body.sidebar-collapsed .navbar-vertical.navbar-expand-lg ~ .navbar,
    body.sidebar-collapsed .navbar-vertical.navbar-expand-lg ~ .page-wrapper {
        margin-left: 4.25rem;
    }
    body.sidebar-collapsed .navbar-vertical .nav-link-title,
    body.sidebar-collapsed .navbar-vertical .nav-group-chevron,
    body.sidebar-collapsed .navbar-vertical .dropdown-header {
        display: none;
    }
    body.sidebar-collapsed .navbar-vertical .navbar-collapse .navbar-nav .nav-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    body.sidebar-collapsed .navbar-vertical .nav-link-icon {
        margin: 0;
    }
    body.sidebar-collapsed .navbar-vertical .dropdown-toggle::after {
        display: none;
    }
    body.sidebar-collapsed .navbar-vertical .navbar-collapse .dropdown-menu .dropdown-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    body.sidebar-collapsed .navbar-vertical .navbar-collapse .dropdown-menu .dropdown-item .ti {
        margin-right: 0 !important;
    }
}

/* ============================================
   WIDER GLOBAL CONTAINER — homogeneous app-wide
   (loaded after Tabler, overrides its breakpoint
   max-widths; navbar and content stay aligned)
   ============================================ */
.container-xl {
    max-width: min(1800px, 96vw);
}
