/* =================================================================
   Report Master Design System — Premium Dark Mode
   ================================================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Custom Properties --- */
:root {
    /* Color Palette */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1e2642;
    --bg-elevated: #232d45;
    --bg-input: #151d30;
    --bg-glass: rgba(26, 32, 53, 0.85);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #fb923c;

    --accent-orange: #fb923c;
    --accent-orange-glow: rgba(251, 146, 60, 0.25);
    --accent-amber: #fbbf24;
    --accent-teal: #2dd4bf;
    --accent-teal-deep: #0891b2;
    --accent-teal-glow: rgba(45, 212, 191, 0.2);
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
    --accent-rose: #fb7185;
    --accent-green: #34d399;
    --accent-red: #ef4444;

    --gradient-primary: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    --gradient-dark: linear-gradient(180deg, #111827 0%, #0a0e17 100%);
    --gradient-card: linear-gradient(145deg, rgba(26, 32, 53, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);

    --border-default: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(251, 146, 60, 0.3);
    --border-focus: rgba(251, 146, 60, 0.5);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(251, 146, 60, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* --- Archive Mode (Ocean Theme) --- */
body.archive-mode {
    --bg-primary: #050a1a;
    --bg-secondary: #08112b;
    --bg-card: #0c1a3d;
    --bg-card-hover: #122452;
    --bg-elevated: #162d66;
    --bg-input: #0a1733;
    --text-accent: #60a5fa;
    --accent-orange: #60a5fa;
    --accent-orange-glow: rgba(96, 165, 250, 0.25);
    --border-hover: rgba(96, 165, 250, 0.3);
    --border-focus: rgba(96, 165, 250, 0.5);
    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    --shadow-glow: 0 0 40px rgba(96, 165, 250, 0.15);
}

body.archive-mode::before {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ambient background glow */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -300px;
    left: -200px;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* =================================================================
   LAYOUT COMPONENTS
   ================================================================= */

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--gradient-card);
    border-right: 1px solid var(--border-default);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sticky);
    transition: transform var(--transition-normal);
}

.sidebar-logo {
    padding: var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: #0b1220;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--shadow-glow), inset 0 0 0 1px rgba(8,145,178,0.4);
    overflow: hidden;
}
.sidebar-logo .logo-icon svg { width: 100%; height: 100%; display: block; }

.sidebar-logo h1 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--font-mono);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cyberpunk logo mark — shared inline SVG component */
.rm-mark { display: inline-block; line-height: 0; }
.rm-mark svg { display: block; }

/* Techy wordmark: condensed, mono, dual-tone glitch underline */
.rm-wordmark {
    font-family: var(--font-mono);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-logo .badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--accent-orange-glow);
    color: var(--accent-orange);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-lg) var(--space-sm);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: var(--space-lg);
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 0 var(--space-md);
    margin-bottom: var(--space-sm);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--accent-orange-glow);
    color: var(--accent-orange);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-orange);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.sidebar-link .icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-default);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* --- Main Content --- */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page-header {
    padding: var(--space-xl) var(--space-2xl);
    border-bottom: 1px solid var(--border-default);
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.page-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.page-body {
    padding: var(--space-2xl);
}

/* =================================================================
   CARD COMPONENTS
   ================================================================= */

.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    transform: translateY(-1px);
}

.card-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-xl);
}

.card-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-default);
    background: rgba(0, 0, 0, 0.15);
}

/* --- Stat Cards --- */
.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
}

.stat-card .stat-icon.orange { background: var(--accent-orange-glow); color: var(--accent-orange); }
.stat-card .stat-icon.teal { background: var(--accent-teal-glow); color: var(--accent-teal); }
.stat-card .stat-icon.blue { background: rgba(96, 165, 250, 0.15); color: var(--accent-blue); }
.stat-card .stat-icon.purple { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }
.stat-card .stat-icon.rose { background: rgba(251, 113, 133, 0.15); color: var(--accent-rose); }
.stat-card .stat-icon.green { background: rgba(52, 211, 153, 0.15); color: var(--accent-green); }

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: var(--space-sm);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stat-change.up { background: rgba(52, 211, 153, 0.12); color: var(--accent-green); }
.stat-change.down { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-lg); }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile Layout ( < 768px ) */
@media (max-width: 768px) {
    :root {
        --space-xl: 1.25rem;
        --space-2xl: 1.5rem;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content { margin-left: 0; }

    .grid-2, .grid-3, .grid-4, .grid-5 {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .page-header {
        padding: var(--space-lg) var(--space-md);
        margin-top: 60px;
        position: static;
    }
    .page-body { padding: var(--space-md); }

    .filter-bar { padding: var(--space-md); gap: var(--space-sm); }
    .filter-bar .filter-group { width: 100%; }
    .filter-bar .form-input, .filter-bar .form-select { flex: 1; min-width: 0; }
    .filter-bar .rest-dd { width: 100%; }
    .filter-bar .rest-dd-trigger { width: 100%; }

    /* Day label: don't force a minimum width — let it fill the available flex space */
    .day-label { min-width: 0 !important; font-size: 0.82rem; }

    /* Range date inputs: flex instead of fixed width */
    .filter-date { width: auto !important; flex: 1; min-width: 72px; }

    /* Filter range group: allow wrapping so From/To inputs don't overflow */
    #filterRangeNav { flex-wrap: wrap; flex-shrink: 1; gap: 6px; }

    .stat-card { padding: var(--space-md); }
    .stat-card .stat-value { font-size: 1.4rem; }

    .card-header { padding: var(--space-md) var(--space-lg); }
    .card-body { padding: var(--space-lg); }

    /* Chart containers: explicit height so maintainAspectRatio:false has a fixed target.
       Without this, Chart.js reads offsetHeight=0 and collapses the canvas. */
    .chart-container { height: 260px; min-height: 260px; padding: 0; }

    /* Horizontal bar charts (products) need more vertical space */
    .chart-container--tall { height: 420px; min-height: 420px; }

    /* DRC revenue number: slightly smaller on phones */
    .drc-gross { font-size: 1.4rem; }

    /* Revenue block: allow chips to wrap below the gross number */
    .drc-revenue-block { flex-wrap: wrap; gap: 6px; }

    /* Comparison grid: always horizontally scrollable on mobile */
    .compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .compare-scroll .comparison-grid { min-width: 480px; }

    /* Settings container: ensure it doesn't exceed viewport */
    .settings-wrap { max-width: 100% !important; }
}

/* Mobile Nav Bar — Hidden by default, shown on mobile */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-default);
    z-index: var(--z-sticky);
    align-items: center;
    padding: 0 var(--space-md);
    justify-content: space-between;
    scroll-padding-top: 80px;
}

/* --- Status Indicators --- */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    animation: status-pulse 2s infinite;
}

.status-dot.online { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.status-dot.online::after { background: var(--accent-green); }

.status-dot.offline { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
.status-dot.offline::after { background: var(--accent-red); }

.status-dot.warning { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }
.status-dot.warning::after { background: var(--accent-amber); }

@keyframes status-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

@media (max-width: 768px) {
    .mobile-nav { display: flex; }
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.05);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: calc(var(--z-sticky) - 1);
}

.sidebar-overlay.active {
    display: block;
}

/* Fix for wide tables on mobile */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}


/* =================================================================
   FORM COMPONENTS
   ================================================================= */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input, .form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-orange-glow);
}

/* Dropdown option lists: the closed <select> controls are themed dark, but the
   native <option> popup otherwise renders white-on-white against the dark
   theme. Force readable dark text on a white background for every dropdown. */
option,
select option {
    background-color: #ffffff;
    color: #111827;
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* =================================================================
   BUTTON COMPONENTS
   ================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 10px rgba(251, 146, 60, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(251, 146, 60, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm { padding: 4px var(--space-md); font-size: 0.78rem; }
.btn-lg { padding: var(--space-md) var(--space-xl); font-size: 1rem; }
.btn-block { width: 100%; }

/* =================================================================
   TABLE COMPONENTS
   ================================================================= */

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.data-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-default);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* =================================================================
   BADGE / TAG COMPONENTS
   ================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-admin { background: rgba(251, 146, 60, 0.15); color: var(--accent-orange); }
.badge-user { background: rgba(96, 165, 250, 0.15); color: var(--accent-blue); }
.badge-active { background: rgba(52, 211, 153, 0.12); color: var(--accent-green); }
.badge-inactive { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }

/* =================================================================
   CHART CONTAINERS
   ================================================================= */

.chart-container {
    position: relative;
    width: 100%;
    height: 320px;
    min-height: 280px;
    padding: var(--space-md);
}

/* Horizontal bar charts (products) need more vertical room */
.chart-container--tall {
    height: 480px;
    min-height: 400px;
}

.chart-container canvas {
    max-width: 100%;
}

/* =================================================================
   FILTER BAR
   ================================================================= */

.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-2xl);
    background: rgba(17, 24, 39, 0.4);
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
}

.filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-bar .filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
    padding: 6px 10px;
    font-size: 0.82rem;
    min-width: 140px;
}

/* Date range inputs in filter bar */
.filter-date {
    padding: 5px 8px;
    font-size: 0.83rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    width: 138px;
}
.filter-date:focus { outline: none; border-color: var(--accent-orange); }

.rest-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.rest-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-default);
    background: var(--bg-input);
    color: var(--text-muted);
    transition: all 0.15s ease;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.rest-pill.active {
    background: var(--accent-orange-glow);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.rest-pill-all {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.rest-pill-all.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
}

.rest-pill:hover:not(.active) {
    border-color: rgba(251,146,60,0.4);
    color: var(--text-secondary);
}

.day-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.day-nav-btn:hover:not(:disabled) {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
}
.day-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* =================================================================
   MODAL / DIALOG
   ================================================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1.1rem; font-weight: 600; }

.modal-body { padding: var(--space-xl); }

.modal-footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* =================================================================
   TOAST / NOTIFICATION
   ================================================================= */

.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
    max-width: 380px;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =================================================================
   LOGIN PAGE SPECIFIC
   ================================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(251, 146, 60, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(45, 212, 191, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(167, 139, 250, 0.03) 0%, transparent 50%);
    animation: ambientMove 20s ease-in-out infinite alternate;
}

@keyframes ambientMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, 2%) rotate(1deg); }
}

.login-card {
    position: relative;
    z-index: 1;
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    padding: var(--space-3xl);
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
}

.login-card .logo-section {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.login-card .logo-section .logo-circle {
    width: 64px;
    height: 64px;
    background: #0b1220;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-glow), inset 0 0 0 1px rgba(8,145,178,0.45);
    animation: logoFloat 3s ease-in-out infinite;
    overflow: hidden;
}
.login-card .logo-section .logo-circle svg { width: 100%; height: 100%; display: block; }

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.login-card .logo-section h1 {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.login-card .logo-section p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--accent-red);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    margin-bottom: var(--space-lg);
    display: none;
}

.login-error.show { display: block; }

/* =================================================================
   EMPTY STATE
   ================================================================= */

.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 400px;
    margin: 0 auto;
}

/* =================================================================
   LOADING / SKELETON
   ================================================================= */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: var(--space-xl) auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== TOP LOADING BAR ===== */
#loading-bar {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 9px;
    z-index: 99999;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa, #06b6d4, #6366f1);
    background-size: 300% 100%;
    border-radius: 0 9px 9px 0;
    opacity: 0;
    pointer-events: none;
    transition: width 0.4s cubic-bezier(.4,0,.2,1), opacity 0.3s ease;
}
#loading-bar.lb-active {
    opacity: 1;
    animation: lb-flow 1.4s linear infinite;
}
#loading-bar.lb-done {
    width: 100% !important;
    opacity: 0;
    animation: none;
    transition: width 0.15s ease, opacity 0.35s ease 0.1s;
}
@keyframes lb-flow {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ===== SPINNERS ===== */
.spinner-sm {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    opacity: 0.75;
}
.spinner-lg {
    display: block;
    width: 40px; height: 40px;
    border: 3px solid var(--border-default, #e5e7eb);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 32px auto;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =================================================================
   RESTAURANT DROPDOWN SELECTOR
   ================================================================= */

.rest-dd {
    position: relative;
}

.rest-dd-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 160px;
}
.rest-dd-trigger:hover {
    border-color: var(--border-hover);
}
.rest-dd-trigger:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-orange-glow);
}
.rest-dd-icon { font-size: 0.9rem; }
.rest-dd-caret {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-muted);
    padding-left: 6px;
}

/* Floating panel — desktop */
.rest-dd-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 260px;
    max-width: 340px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    z-index: 200;
    overflow: hidden;
}
.rest-dd-panel.open { display: flex; flex-direction: column; }

.rest-dd-search-wrap {
    padding: 10px 12px 6px;
    border-bottom: 1px solid var(--border-subtle);
}
.rest-dd-search {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.82rem;
}
.rest-dd-search:focus { outline: none; border-color: var(--accent-orange); }

.rest-dd-bulk {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-subtle);
}
.rest-dd-bulk button {
    background: none;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 10px;
    cursor: pointer;
    transition: all 0.12s;
}
.rest-dd-bulk button:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.rest-dd-list {
    overflow-y: auto;
    max-height: 260px;
    padding: 6px 0;
}
.rest-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
}
.rest-dd-item:hover { background: var(--bg-card); }
.rest-dd-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-orange);
    cursor: pointer;
    flex-shrink: 0;
}
.rest-dd-item-name {
    font-size: 0.83rem;
    color: var(--text-primary);
    line-height: 1.3;
}
.rest-dd-empty {
    padding: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

/* Backdrop — closes dropdown on mobile tap outside */
.rest-dd-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
}
.rest-dd-backdrop.open { display: block; }

/* Mobile: bottom sheet */
@media (max-width: 768px) {
    .rest-dd-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        min-width: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 65vh;
        z-index: 300;
    }
    .rest-dd-backdrop.open { z-index: 299; background: rgba(0,0,0,0.45); }
    .rest-dd-list { max-height: calc(65vh - 100px); }
    .rest-dd-trigger { min-width: 0; width: 100%; }
}

/* =================================================================
   RESPONSIVE UTILITIES
   ================================================================= */

/* =================================================================
   RESTAURANT SECTION WRAPPERS — sticky headers on overview
   ================================================================= */

.rest-sections-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.rest-sticky-hdr {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    background: rgba(16, 16, 20, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-top: 2px solid rgba(251, 146, 60, 0.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    position: sticky;
    top: 116px; /* clears the sticky .page-header (~113px) */
    z-index: 201; /* above --z-sticky (200) so it floats over content */
}

.rsh-body {
    flex: 1;
    min-width: 0;
}

.rsh-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-orange);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsh-total-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.rsh-total {
    font-size: 1.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1.15;
}

.rsh-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drc-nav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    padding: 0;
}
.drc-nav-btn:hover:not(:disabled) {
    background: var(--accent-orange);
    color: #fff;
    border-color: var(--accent-orange);
    transform: scale(1.08);
}
.drc-nav-btn:disabled {
    opacity: 0.18;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .rest-sticky-hdr {
        position: sticky;
        top: 60px; /* sit directly below the 60px fixed mobile nav */
        z-index: 201; /* above mobile-nav (200) */
        gap: 8px;
        padding: 8px 12px;
        border-radius: var(--radius-md);
        margin-bottom: var(--space-md);
    }
    .rsh-name { font-size: 0.88rem; }
    .rsh-total { font-size: 1.15rem; }
    .rsh-meta { display: none; } /* too narrow on mobile — all key info is in name+total */
    .drc-nav-btn { width: 32px; height: 32px; font-size: 1.1rem; }
}

/* =================================================================
   YOY (YEAR-OVER-YEAR) COMPARISON
   ================================================================= */

/* ── Badge in sticky header ──────────────────────────────────── */
.yoy-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.yoy-badge.yoy-up   { background: rgba(34,197,94,0.13);   color: #22c55e; border: 1px solid rgba(34,197,94,0.28);   }
.yoy-badge.yoy-down { background: rgba(239,68,68,0.13);   color: #ef4444; border: 1px solid rgba(239,68,68,0.28);   }
.yoy-badge.yoy-flat { background: rgba(148,163,184,0.10); color: #94a3b8; border: 1px solid rgba(148,163,184,0.22); }

/* ── Comparison strip inside the day card ───────────────────── */
.yoy-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 9px 20px;
    background: rgba(255,255,255,0.018);
    border-bottom: 1px dashed rgba(255,255,255,0.07);
}
.yoy-strip-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.65;
    white-space: nowrap;
}
.yoy-strip-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.74rem;
    color: var(--text-muted);
}
.yoy-strip-total {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}
.yoy-sep { opacity: 0.3; font-size: 0.7rem; }
.yoy-delta {
    font-weight: 700;
    font-size: 0.69rem;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}
.yoy-delta.yoy-up   { color: #22c55e; background: rgba(34,197,94,0.10);   }
.yoy-delta.yoy-down { color: #ef4444; background: rgba(239,68,68,0.10);   }
.yoy-delta.yoy-flat { color: #94a3b8; background: rgba(148,163,184,0.08); }

/* Strip inside sticky header: flush horizontal, larger, high-contrast */
.rsh-body .yoy-strip {
    padding: 6px 0 5px;
    background: transparent;
    border-bottom: none;
    border-top: 1px dashed rgba(255,255,255,0.12);
    margin-top: 5px;
}
.rsh-body .yoy-strip-label {
    font-size: 1.2rem;
    opacity: 1;
    color: var(--text-secondary);
}
.rsh-body .yoy-strip-right {
    font-size: 1.4rem;
    color: var(--text-secondary);
    gap: 8px;
}
.rsh-body .yoy-strip-total {
    font-size: 1.5rem;
    color: var(--text-primary);
}
.rsh-body .yoy-sep {
    font-size: 1.2rem;
    opacity: 0.5;
}
.rsh-body .yoy-delta {
    font-size: 1.25rem;
    padding: 3px 11px;
}
.rsh-body .yoy-delta.yoy-up   { background: rgba(34,197,94,0.20);  }
.rsh-body .yoy-delta.yoy-down { background: rgba(239,68,68,0.20);  }
.rsh-body .yoy-delta.yoy-flat { background: rgba(148,163,184,0.16); }

@media (max-width: 768px) {
    .yoy-badge { font-size: 0.65rem; padding: 2px 7px; }
    .rsh-body .yoy-strip { display: none; } /* badge already carries the signal */
}

/* =================================================================
   RESPONSIVE UTILITIES
   ================================================================= */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mt-lg { margin-top: var(--space-lg); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Archive Toggle Card --- */
.archive-toggle-card {
    background: rgba(96, 165, 250, 0.05);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
}

/* --- Health Grid --- */
.health-grid {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    max-width: 150px;
}

.health-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.health-dot.filled { background: var(--accent-green); box-shadow: 0 0 5px var(--accent-green); }
.health-dot.empty { background: rgba(255, 255, 255, 0.1); }

/* Pulse Dot */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(96, 165, 250, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}

/* --- Dynamic Status Animations --- */
.badge-primary {
    background: var(--accent-orange-glow);
    color: var(--accent-orange);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

body.archive-mode .badge-primary {
    background: var(--accent-orange-glow);
    color: var(--accent-orange);
}

.status-indicator .badge-primary {
    animation: status-pulse 1.5s infinite alternate;
}

@keyframes status-pulse {
    from { opacity: 0.7; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); box-shadow: 0 0 10px var(--accent-orange-glow); }
}
