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

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

/* Wider container */
.container-xl { max-width: 1600px; }

/* ---- 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;
}

.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; }
}
