/* ============================================================
   THEME SYSTEM — PSX Market Data Platform
   Structure: dark-slate (default) · sapphire-navy · midnight-violet
             light-paper · natural-green (existing)
             forest-dusk · warm-stone · ocean-depth (new)
   ============================================================ */

/* ── Theme 1 (Default): Dark Slate ─────────────────────────── */
:root,
[data-theme="dark-slate"] {
    --bg-main: #060a14;
    --bg-card: rgba(14, 22, 42, 0.70);
    --bg-card-hover: rgba(22, 34, 62, 0.88);
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.45);
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.40);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --text-main: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #7c90a8;
    --border-color: rgba(56, 78, 120, 0.45);
    --glass-bg: rgba(10, 16, 35, 0.80);
    --glass-blur: blur(18px);
    --sidebar-width: 260px;
    --shadow-card: 0 4px 6px rgba(0,0,0,0.2), 0 12px 40px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04) inset;
    --shadow-btn-primary: 0 4px 14px rgba(37, 99, 235, 0.30);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ── Theme 2: Sapphire Navy ─────────────────────────────────── */
[data-theme="sapphire-navy"] {
    --bg-main: #07102a;
    --bg-card: rgba(12, 22, 55, 0.78);
    --bg-card-hover: rgba(22, 38, 82, 0.88);
    --primary: #1d4ed8;
    --primary-glow: rgba(29, 78, 216, 0.42);
    --accent: #60a5fa;
    --accent-glow: rgba(96, 165, 250, 0.40);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #fb7185;
    --text-main: #eef2ff;
    --text-muted: #c7d2fe;
    --text-subtle: #7b93c8;
    --border-color: rgba(30, 58, 138, 0.50);
    --glass-bg: rgba(10, 20, 55, 0.82);
    --glass-blur: blur(18px);
    --shadow-card: 0 4px 6px rgba(0,0,0,0.25), 0 14px 42px rgba(0,0,0,0.4), 0 1px 0 rgba(99,141,255,0.06) inset;
    --shadow-btn-primary: 0 4px 14px rgba(29, 78, 216, 0.32);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ── Theme 3: Midnight Violet ───────────────────────────────── */
[data-theme="midnight-violet"] {
    --bg-main: #09051a;
    --bg-card: rgba(20, 12, 42, 0.78);
    --bg-card-hover: rgba(38, 22, 68, 0.88);
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.42);
    --accent: #c084fc;
    --accent-glow: rgba(192, 132, 252, 0.40);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --text-main: #faf5ff;
    --text-muted: #ddd6fe;
    --text-subtle: #a582e0;
    --border-color: rgba(88, 28, 135, 0.48);
    --glass-bg: rgba(20, 10, 46, 0.86);
    --glass-blur: blur(18px);
    --shadow-card: 0 4px 6px rgba(0,0,0,0.25), 0 14px 42px rgba(0,0,0,0.4), 0 1px 0 rgba(192,132,252,0.08) inset;
    --shadow-btn-primary: 0 4px 14px rgba(139, 92, 246, 0.32);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ── Theme 4: Light Paper ───────────────────────────────────── */
[data-theme="light-paper"] {
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f4f8;
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.18);
    --accent: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.18);
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --text-main: #0f172a;
    --text-muted: #334155;
    --text-subtle: #64748b;
    --border-color: #dce3ee;
    --glass-bg: rgba(255, 255, 255, 0.94);
    --glass-blur: blur(16px);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.05), 0 4px 18px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    --shadow-btn-primary: 0 4px 12px rgba(37, 99, 235, 0.22);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ── Theme 5: Natural Green (Emerald Breeze) ────────────────── */
[data-theme="natural-green"] {
    --bg-main: #f0fdf5;
    --bg-card: #ffffff;
    --bg-card-hover: #e8f5ee;
    --primary: #059669;
    --primary-glow: rgba(5, 150, 105, 0.22);
    --accent: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.22);
    --success: #047857;
    --warning: #d97706;
    --danger: #e11d48;
    --text-main: #064e3b;
    --text-muted: #14532d;
    --text-subtle: #0369a1;
    --border-color: #bbf7d0;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-blur: blur(16px);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 4px 18px rgba(5,150,105,0.08), 0 0 0 1px rgba(5,150,105,0.06);
    --shadow-btn-primary: 0 4px 12px rgba(5, 150, 105, 0.24);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ══════════════════════════════════════════════════════════════
   NEW THEME 6: Forest Dusk
   Mood: a dark woodland evening — deep mossy greens warmed by
   amber lantern light. Rich, earthy, and unmistakably organic.
   ══════════════════════════════════════════════════════════════ */
[data-theme="forest-dusk"] {
    --bg-main: #080e06;
    --bg-card: rgba(14, 24, 10, 0.76);
    --bg-card-hover: rgba(24, 38, 16, 0.88);
    --primary: #4a7c59;                       /* forest pine */
    --primary-glow: rgba(74, 124, 89, 0.42);
    --accent: #c8a258;                        /* warm amber lantern */
    --accent-glow: rgba(200, 162, 88, 0.38);
    --success: #5ba87a;                       /* fresh leaf */
    --warning: #e8a427;                       /* golden bark */
    --danger: #d95f52;                        /* wild berry red */
    --text-main: #e8e6d8;                     /* warm parchment */
    --text-muted: #b0bc96;                    /* sage moss */
    --text-subtle: #7a8c6a;                   /* lichen grey-green */
    --border-color: rgba(58, 88, 44, 0.48);
    --glass-bg: rgba(10, 18, 8, 0.84);
    --glass-blur: blur(18px);
    --shadow-card: 0 4px 6px rgba(0,0,0,0.30), 0 14px 42px rgba(0,0,0,0.45), 0 1px 0 rgba(200,162,88,0.07) inset;
    --shadow-btn-primary: 0 4px 14px rgba(74, 124, 89, 0.35);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ══════════════════════════════════════════════════════════════
   NEW THEME 7: Warm Stone
   Mood: a sunlit terracotta courtyard — warm sandy neutrals,
   burnished clay accents, and crisp dry-air contrast. Light,
   airy, and grounded without feeling sterile.
   ══════════════════════════════════════════════════════════════ */
[data-theme="warm-stone"] {
    --bg-main: #faf7f2;
    --bg-card: #ffffff;
    --bg-card-hover: #f5ede4;
    --primary: #9a6428;                       /* burnished ochre */
    --primary-glow: rgba(154, 100, 40, 0.18);
    --accent: #c26830;                        /* terracotta clay */
    --accent-glow: rgba(194, 104, 48, 0.20);
    --success: #5a8a4e;                       /* olive grove */
    --warning: #c88b18;                       /* turmeric gold */
    --danger: #c0392b;                        /* fired clay red */
    --text-main: #2c1a0e;                     /* dark espresso */
    --text-muted: #6b4226;                    /* warm chestnut */
    --text-subtle: #9a7458;                   /* sandstone */
    --border-color: #e8d8c8;
    --glass-bg: rgba(255, 250, 244, 0.95);
    --glass-blur: blur(16px);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.05), 0 4px 18px rgba(154,100,40,0.08), 0 0 0 1px rgba(154,100,40,0.06);
    --shadow-btn-primary: 0 4px 12px rgba(194, 104, 48, 0.28);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ══════════════════════════════════════════════════════════════
   NEW THEME 8: Ocean Depth
   Mood: the deep sea at dusk — ink-blue abyssal background,
   bioluminescent cyan accents, and seawater teal midtones.
   Calm, deep, and strikingly vivid.
   ══════════════════════════════════════════════════════════════ */
[data-theme="ocean-depth"] {
    --bg-main: #03101e;
    --bg-card: rgba(5, 22, 42, 0.78);
    --bg-card-hover: rgba(8, 34, 62, 0.88);
    --primary: #0e7490;                       /* deep teal */
    --primary-glow: rgba(14, 116, 144, 0.42);
    --accent: #22d3ee;                        /* bioluminescent cyan */
    --accent-glow: rgba(34, 211, 238, 0.36);
    --success: #14b8a6;                       /* sea-glass teal */
    --warning: #f5a623;                       /* sunbeam from above */
    --danger: #f4617f;                        /* coral reef */
    --text-main: #e0f7fa;                     /* seafoam white */
    --text-muted: #80cfdb;                    /* pale lagoon */
    --text-subtle: #4a94a8;                   /* deep water mist */
    --border-color: rgba(14, 116, 144, 0.38);
    --glass-bg: rgba(4, 18, 36, 0.84);
    --glass-blur: blur(18px);
    --shadow-card: 0 4px 6px rgba(0,0,0,0.28), 0 14px 42px rgba(0,0,0,0.42), 0 1px 0 rgba(34,211,238,0.07) inset;
    --shadow-btn-primary: 0 4px 14px rgba(14, 116, 144, 0.36);
    --radius-card: 14px;
    --radius-btn: 9px;
}

/* ──────────────────────────────────────────────────────────────
   GLOBAL RESETS & BODY
   ────────────────────────────────────────────────────────────── */
body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(37, 99, 235, 0.16) 0%, transparent 42%),
        radial-gradient(ellipse at 92% 82%,  rgba(56, 189, 248, 0.10) 0%, transparent 42%),
        radial-gradient(ellipse at 50% 50%,  rgba(37, 99, 235, 0.04) 0%, transparent 70%);
    background-attachment: fixed;
    transition: background-color 0.35s ease, color 0.35s ease;
}

[data-theme="sapphire-navy"] body {
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(29, 78, 216, 0.24) 0%, transparent 42%),
        radial-gradient(ellipse at 92% 82%,  rgba(96, 165, 250, 0.14) 0%, transparent 42%),
        radial-gradient(ellipse at 50% 50%,  rgba(29, 78, 216, 0.05) 0%, transparent 70%);
}

[data-theme="midnight-violet"] body {
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(139, 92, 246, 0.26) 0%, transparent 42%),
        radial-gradient(ellipse at 92% 82%,  rgba(236, 72, 153, 0.14) 0%, transparent 42%),
        radial-gradient(ellipse at 50% 50%,  rgba(139, 92, 246, 0.05) 0%, transparent 70%);
}

[data-theme="light-paper"] body {
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(37, 99, 235, 0.05) 0%, transparent 42%),
        radial-gradient(ellipse at 92% 82%,  rgba(2, 132, 199, 0.04) 0%, transparent 42%);
}

[data-theme="natural-green"] body {
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(5, 150, 105, 0.12) 0%, transparent 46%),
        radial-gradient(ellipse at 92% 82%,  rgba(2, 132, 199, 0.10) 0%, transparent 46%);
}

[data-theme="forest-dusk"] body {
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(74, 124, 89, 0.22) 0%, transparent 46%),
        radial-gradient(ellipse at 92% 82%,  rgba(200, 162, 88, 0.12) 0%, transparent 46%),
        radial-gradient(ellipse at 50% 90%,  rgba(74, 124, 89, 0.06) 0%, transparent 60%);
}

[data-theme="warm-stone"] body {
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(194, 104, 48, 0.07) 0%, transparent 46%),
        radial-gradient(ellipse at 92% 82%,  rgba(154, 100, 40, 0.05) 0%, transparent 46%);
}

[data-theme="ocean-depth"] body {
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(14, 116, 144, 0.28) 0%, transparent 46%),
        radial-gradient(ellipse at 92% 82%,  rgba(34, 211, 238, 0.12) 0%, transparent 46%),
        radial-gradient(ellipse at 50% 50%,  rgba(14, 116, 144, 0.05) 0%, transparent 70%);
}

body.admin-body {
    display: flex;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 8% 18%,  rgba(31, 73, 125, 0.22) 0%, transparent 42%),
        radial-gradient(ellipse at 92% 82%,  rgba(58, 134, 255, 0.13) 0%, transparent 42%);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}

/* ──────────────────────────────────────────────────────────────
   NAVBAR
   ────────────────────────────────────────────────────────────── */
.navbar {
    height: 70px;
    background-color: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-wrap: nowrap;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    flex-shrink: 0;
}

.nav-logo h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.nav-menu li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    white-space: nowrap;
    display: inline-block;
}

.nav-menu li a:hover {
    color: var(--text-main);
    background-color: rgba(58, 134, 255, 0.08);
    border-color: rgba(58, 134, 255, 0.16);
    transform: translateY(-1px);
}

.nav-menu li.active a {
    color: var(--text-main);
    background-color: rgba(58, 134, 255, 0.14);
    border-color: rgba(58, 134, 255, 0.28);
    box-shadow: 0 4px 14px rgba(58, 134, 255, 0.14);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(58, 134, 255, 0.20);
    background-color: rgba(58, 134, 255, 0.05);
    position: relative;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.user-dropdown:hover {
    background-color: rgba(58, 134, 255, 0.10);
    border-color: rgba(58, 134, 255, 0.38);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(58, 134, 255, 0.16);
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    right: 0;
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 165px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14);
    list-style: none;
    padding: 6px 0;
    margin: 0;
    display: none;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.dropdown-menu li a:hover {
    color: var(--text-main);
    background-color: var(--bg-card-hover);
}

/* ──────────────────────────────────────────────────────────────
   CONTAINER & PAGE HEADER
   ────────────────────────────────────────────────────────────── */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 40px;
    box-sizing: border-box;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-title {
    margin: 0;
}

.page-header-title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.page-header-title p {
    margin: 6px 0 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.page-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.segmented-control {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.55);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    gap: 4px;
}

.segmented-control .btn,
.segmented-control a,
.segmented-control .c-tab {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    box-sizing: border-box;
    margin: 0;
}

.segmented-control .active,
.segmented-control a.active,
.segmented-control .btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ──────────────────────────────────────────────────────────────
   CARDS
   ────────────────────────────────────────────────────────────── */
.card {
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card, 14px);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card, 0 4px 6px rgba(0,0,0,0.2), 0 12px 40px rgba(0,0,0,0.32));
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.card:hover {
    border-color: rgba(58, 189, 248, 0.18);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ──────────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-btn, 9px);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-btn-primary, 0 4px 14px rgba(37,99,235,0.28));
}

.btn-primary:hover {
    box-shadow: 0 6px 22px var(--primary-glow, rgba(37,99,235,0.40));
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.09);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22);
}

.btn-success:hover {
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.38);
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #be123c 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22);
}

.btn-danger:hover {
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.38);
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.btn-xs {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

/* ──────────────────────────────────────────────────────────────
   TABLES & LISTS
   ────────────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

table th {
    color: var(--text-subtle);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: 0.80px;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
}

table tbody tr:nth-child(even) {
    background-color: rgba(128, 128, 128, 0.02);
}

table tbody tr:hover {
    background-color: rgba(56, 189, 248, 0.05);
}

.text-green { color: var(--success); font-weight: 600; }
.text-red   { color: var(--danger);  font-weight: 600; }
.text-gray  { color: var(--text-subtle); }

/* ──────────────────────────────────────────────────────────────
   BADGES
   ────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-success { background-color: rgba(16, 185, 129, 0.14); color: var(--success); border: 1px solid rgba(16,185,129,0.35); }
.badge-warning { background-color: rgba(245, 158, 11, 0.14); color: var(--warning); border: 1px solid rgba(245,158,11,0.35); }
.badge-danger  { background-color: rgba(239, 68, 68,  0.14); color: var(--danger);  border: 1px solid rgba(239,68,68,0.35);  }
.badge-info    { background-color: rgba(58, 134, 255, 0.14); color: var(--accent);  border: 1px solid rgba(58,134,255,0.30); }

/* ──────────────────────────────────────────────────────────────
   FORMS
   ────────────────────────────────────────────────────────────── */
.form-control {
    width: 100%;
    padding: 10px 13px;
    background-color: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ──────────────────────────────────────────────────────────────
   ALERT BANNERS
   ────────────────────────────────────────────────────────────── */
.alert-banner {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-banner-success { background-color: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16,185,129,0.40); color: #a7f3d0; }
.alert-banner-error   { background-color: rgba(239, 68,  68,  0.12); border: 1px solid rgba(239,68,68,0.40);  color: #fca5a5; }

/* ──────────────────────────────────────────────────────────────
   CLIENT MOBILE NAVIGATION
   ────────────────────────────────────────────────────────────── */
.nav-mobile-toggle {
    display: none;
    font-size: 22px;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: #0b1120;
    border-left: 1px solid var(--border-color);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.60);
    z-index: 2000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

.mobile-drawer.open {
    right: 0;
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.open {
    display: block;
    opacity: 1;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.drawer-close {
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.drawer-close:hover {
    color: #fff;
}

.drawer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.drawer-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.drawer-menu li a:hover,
.drawer-menu li.active a {
    color: #fff;
    background-color: rgba(58, 134, 255, 0.10);
    border-left: 3px solid var(--accent);
}

.drawer-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--accent);
}

/* ──────────────────────────────────────────────────────────────
   ADMIN SIDEBAR
   ────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar       { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-header img {
    width: 32px;
    height: 32px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 9px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu li a:hover {
    color: var(--text-main);
    background-color: rgba(58, 134, 255, 0.08);
    border-color: rgba(58, 134, 255, 0.16);
    transform: translateX(3px);
}

.sidebar-menu li.active a {
    color: var(--text-main);
    background-color: rgba(58, 134, 255, 0.14);
    border-color: rgba(58, 134, 255, 0.28);
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(58, 134, 255, 0.10);
}

.sidebar-menu li a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: transform 0.25s ease;
}

.sidebar-menu li a:hover i {
    transform: scale(1.12);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-footer .user-info    { flex: 1; overflow: hidden; }

.sidebar-footer .user-name {
    font-size: 14px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sidebar-footer .logout-btn {
    color: var(--text-muted);
    font-size: 16px;
    transition: color 0.2s;
}

.sidebar-footer .logout-btn:hover {
    color: var(--danger);
}

/* ──────────────────────────────────────────────────────────────
   ADMIN PANELS
   ────────────────────────────────────────────────────────────── */
.main-panel {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-navbar {
    height: 70px;
    background-color: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.06);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.20);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.05);
    transition: all 0.3s ease;
}

.status-indicator:hover {
    border-color: rgba(16, 185, 129, 0.40);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.16);
    transform: scale(1.03);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0.42); }
    70%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);    }
    100% { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0);    }
}

.content-body {
    padding: 30px;
    flex: 1;
    box-sizing: border-box;
}

/* ──────────────────────────────────────────────────────────────
   SIDEBAR MOBILE TOGGLE
   ────────────────────────────────────────────────────────────── */
.sidebar-toggle {
    display: none;
    font-size: 20px;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

/* ──────────────────────────────────────────────────────────────
   MEDIA QUERIES — 4-tier responsive system
   1024px: nav collapses (tablet landscape + below)
   768px:  tablet portrait adjustments
   480px:  phone adjustments
   360px:  small phone edge cases
   ────────────────────────────────────────────────────────────── */

/* ── ≤ 1024px: Collapse navbar to hamburger ─────────────────── */
@media (max-width: 1024px) {
    /* Client — hide desktop nav, show hamburger */
    .navbar               { padding: 0 16px; }
    .nav-menu             { display: none; }
    .nav-auth             { display: none; }
    .nav-mobile-toggle    { display: block; }
    .container            { padding: 20px 20px; }
    .card                 { padding: 18px; margin-bottom: 18px; }
    table th, table td    { padding: 10px 12px; }

    /* Admin sidebar — slide off-canvas */
    .sidebar              { left: -260px; z-index: 1000; }
    .sidebar.open         { left: 0; }
    .main-panel           { margin-left: 0; }
    .sidebar-toggle       { display: block; }
    .top-navbar           { padding: 0 15px; }
    .content-body         { padding: 18px; }
}

/* ── ≤ 768px: Tablet portrait layout ────────────────────────── */
@media (max-width: 768px) {
    /* Container tighter padding */
    .container            { padding: 16px 14px; }

    /* Card compact */
    .card                 { padding: 14px; margin-bottom: 14px; }
    .card-title           { font-size: 15px; }
    .card-header          { flex-direction: column; align-items: flex-start; gap: 10px; }

    /* Page header stacks vertically */
    .page-header          { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header-title h1 { font-size: 20px; }
    .page-header-actions  { width: 100%; flex-wrap: wrap; }

    /* Segmented controls tighter */
    .segmented-control    { flex-wrap: wrap; border-radius: 12px; }
    .segmented-control .btn,
    .segmented-control a,
    .segmented-control .c-tab { padding: 5px 12px; font-size: 12px; height: 30px; }

    /* Table cells slightly smaller */
    table th              { font-size: 10.5px; padding: 9px 10px; }
    table td              { font-size: 13px;   padding: 10px 10px; }

    /* Buttons slightly smaller */
    .btn                  { font-size: 13px; padding: 9px 16px; }
    .btn-xs               { font-size: 11px; padding: 5px 10px; }

    /* Admin */
    .content-body         { padding: 14px; }
    .top-navbar           { padding: 0 12px; }
}

/* ── ≤ 480px: Phone layout ───────────────────────────────────── */
@media (max-width: 480px) {
    /* Tight container */
    .container            { padding: 12px 10px; }

    /* Cards more compact */
    .card                 { padding: 12px; margin-bottom: 12px; }
    .card-title           { font-size: 14px; }

    /* Tables smallest readable size */
    table th              { font-size: 10px;  padding: 7px 8px; letter-spacing: 0.4px; }
    table td              { font-size: 12px;  padding: 8px 8px; }

    /* Page header */
    .page-header-title h1 { font-size: 17px; }
    .page-header-title p  { font-size: 12px; }

    /* Buttons shrink */
    .btn                  { font-size: 12px; padding: 8px 13px; gap: 6px; }
    .btn-xs               { font-size: 10px; padding: 4px 8px; }

    /* Touch-friendly table scroll */
    .table-responsive     { -webkit-overflow-scrolling: touch; }

    /* Admin layout */
    .content-body         { padding: 10px; }
    .page-title           { font-size: 14px; }
    .status-indicator     { display: none; }
}

/* ── ≤ 360px: Very small phones ──────────────────────────────── */
@media (max-width: 360px) {
    .container            { padding: 10px 8px; }
    .card                 { padding: 10px; }
    table th              { font-size: 9.5px; padding: 6px 6px; }
    table td              { font-size: 11.5px; padding: 7px 6px; }
    .page-header-title h1 { font-size: 15px; }
    .btn                  { font-size: 11px; padding: 7px 10px; }
    .nav-logo h1          { font-size: 14px; }
}

/* ──────────────────────────────────────────────────────────────
   FRESHNESS BADGE
   ────────────────────────────────────────────────────────────── */
.freshness-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid transparent;
    vertical-align: middle;
    margin-left: 10px;
    line-height: 1;
}

.freshness-badge.fresh   { background-color: rgba(16, 185, 129, 0.14); color: var(--success); border-color: rgba(16,185,129,0.32); }
.freshness-badge.stale   { background-color: rgba(245, 158, 11, 0.14); color: var(--warning); border-color: rgba(245,158,11,0.32); }
.freshness-badge.offline { background-color: rgba(239, 68,  68, 0.14); color: var(--danger);  border-color: rgba(239,68,68,0.32);  }

.freshness-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

/* ──────────────────────────────────────────────────────────────
   SKELETON LOADING SHIMMER
   ────────────────────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.skeleton-text {
    display: inline-block;
    height: 14px;
    width: 80%;
    min-width: 50px;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.12) 50%,
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
    vertical-align: middle;
}

.skeleton-badge {
    display: inline-block;
    height: 20px;
    width: 60px;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.12) 50%,
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 20px;
}

/* ──────────────────────────────────────────────────────────────
   FLASH ANIMATIONS
   ────────────────────────────────────────────────────────────── */
@keyframes flash-highlight-green {
    0%   { background-color: rgba(16, 185, 129, 0.34); }
    100% { background-color: transparent; }
}

@keyframes flash-highlight-red {
    0%   { background-color: rgba(239, 68, 68, 0.34); }
    100% { background-color: transparent; }
}

@keyframes flash-highlight-blue {
    0%   { background-color: rgba(58, 134, 255, 0.24); }
    100% { background-color: transparent; }
}

.flash-green td { animation: flash-highlight-green 1.2s ease-out; }
.flash-red   td { animation: flash-highlight-red   1.2s ease-out; }
.flash-blue  td { animation: flash-highlight-blue  1.5s ease-out; }

/* ──────────────────────────────────────────────────────────────
   TABULAR NUMBERS
   ────────────────────────────────────────────────────────────── */
.tabular-nums,
table td[style*="text-align: right"],
table td[style*="text-align:right"],
.price-cell,
.change-cell,
.current-value,
.pl-value,
.col-price,
.col-day-high,
.col-day-low,
.col-month-low,
.col-month-high,
.col-three-month-low,
.col-three-month-high,
.col-fifty-two-week-low,
.col-fifty-two-week-high {
    font-variant-numeric: tabular-nums;
    -moz-font-feature-settings: "tnum";
    -webkit-font-feature-settings: "tnum";
    font-feature-settings: "tnum";
}

/* ──────────────────────────────────────────────────────────────
   LIGHT / NATURAL THEME CONTRAST FIXES
   ────────────────────────────────────────────────────────────── */
[data-theme="light-paper"],
[data-theme="natural-green"],
[data-theme="warm-stone"] {
    --text-main:   #0f172a;
    --text-muted:  #334155;
    --text-subtle: #475569;
}

[data-theme="natural-green"] {
    --text-main:   #064e3b;
    --text-muted:  #14532d;
    --text-subtle: #0369a1;
}

[data-theme="warm-stone"] {
    --text-main:   #2c1a0e;
    --text-muted:  #6b4226;
    --text-subtle: #9a7458;
}

/* Logo / Header gradients for light themes */
[data-theme="light-paper"]   .nav-logo h1,
[data-theme="natural-green"] .nav-logo h1,
[data-theme="warm-stone"]    .nav-logo h1,
[data-theme="light-paper"]   .sidebar-header h2,
[data-theme="natural-green"] .sidebar-header h2,
[data-theme="warm-stone"]    .sidebar-header h2 {
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light-paper"]   .drawer-title,
[data-theme="natural-green"] .drawer-title,
[data-theme="warm-stone"]    .drawer-title,
[data-theme="light-paper"]   .drawer-close,
[data-theme="natural-green"] .drawer-close,
[data-theme="warm-stone"]    .drawer-close {
    color: var(--text-main) !important;
}

[data-theme="light-paper"]   .dropdown-menu,
[data-theme="natural-green"] .dropdown-menu,
[data-theme="warm-stone"]    .dropdown-menu,
[data-theme="light-paper"]   .mobile-drawer,
[data-theme="natural-green"] .mobile-drawer,
[data-theme="warm-stone"]    .mobile-drawer {
    background-color: var(--bg-card)    !important;
    color:            var(--text-main)  !important;
    border-color:     var(--border-color) !important;
}

[data-theme="light-paper"]   .form-control,
[data-theme="natural-green"] .form-control,
[data-theme="warm-stone"]    .form-control,
[data-theme="light-paper"]   input:not([type="submit"]):not([type="button"]):not([type="reset"]),
[data-theme="natural-green"] input:not([type="submit"]):not([type="button"]):not([type="reset"]),
[data-theme="warm-stone"]    input:not([type="submit"]):not([type="button"]):not([type="reset"]),
[data-theme="light-paper"]   select,
[data-theme="natural-green"] select,
[data-theme="warm-stone"]    select,
[data-theme="light-paper"]   textarea,
[data-theme="natural-green"] textarea,
[data-theme="warm-stone"]    textarea {
    background-color: var(--bg-card)      !important;
    color:            var(--text-main)    !important;
    border-color:     var(--border-color) !important;
}

[data-theme="light-paper"]   input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="natural-green"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="warm-stone"]    input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none !important;
    opacity: 0.80;
}

[data-theme="light-paper"]   strong[style*="color: #fff"],
[data-theme="natural-green"] strong[style*="color: #fff"],
[data-theme="warm-stone"]    strong[style*="color: #fff"],
[data-theme="light-paper"]   span[style*="color: #fff"],
[data-theme="natural-green"] span[style*="color: #fff"],
[data-theme="warm-stone"]    span[style*="color: #fff"],
[data-theme="light-paper"]   strong[style*="color:#fff"],
[data-theme="natural-green"] strong[style*="color:#fff"],
[data-theme="warm-stone"]    strong[style*="color:#fff"],
[data-theme="light-paper"]   span[style*="color:#fff"],
[data-theme="natural-green"] span[style*="color:#fff"],
[data-theme="warm-stone"]    span[style*="color:#fff"],
[data-theme="light-paper"]   h2[style*="color: #ffffff"],
[data-theme="natural-green"] h2[style*="color: #ffffff"],
[data-theme="warm-stone"]    h2[style*="color: #ffffff"],
[data-theme="light-paper"]   h3[style*="color: #ffffff"],
[data-theme="natural-green"] h3[style*="color: #ffffff"],
[data-theme="warm-stone"]    h3[style*="color: #ffffff"] {
    color: var(--text-main) !important;
}

/* Segmented control in light themes */
[data-theme="light-paper"]   .segmented-control,
[data-theme="natural-green"] .segmented-control,
[data-theme="warm-stone"]    .segmented-control {
    background: rgba(0, 0, 0, 0.04);
}

/* Button secondary in light themes */
[data-theme="light-paper"]   .btn-secondary,
[data-theme="natural-green"] .btn-secondary,
[data-theme="warm-stone"]    .btn-secondary {
    background-color: rgba(0, 0, 0, 0.04);
    border-color:     rgba(0, 0, 0, 0.12);
    color: var(--text-main);
}

[data-theme="light-paper"]   .btn-secondary:hover,
[data-theme="natural-green"] .btn-secondary:hover,
[data-theme="warm-stone"]    .btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.08);
    border-color:     rgba(0, 0, 0, 0.18);
}

/* Forest Dusk — accent-coloured sidebar active states */
[data-theme="forest-dusk"] .sidebar-menu li a:hover,
[data-theme="forest-dusk"] .nav-menu li a:hover {
    background-color: rgba(74, 124, 89, 0.14);
    border-color: rgba(74, 124, 89, 0.28);
}

[data-theme="forest-dusk"] .sidebar-menu li.active a,
[data-theme="forest-dusk"] .nav-menu li.active a {
    background-color: rgba(74, 124, 89, 0.22);
    border-color: rgba(74, 124, 89, 0.42);
    box-shadow: 0 3px 12px rgba(74, 124, 89, 0.18);
}

/* Ocean Depth — cyan active states */
[data-theme="ocean-depth"] .sidebar-menu li a:hover,
[data-theme="ocean-depth"] .nav-menu li a:hover {
    background-color: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.20);
}

[data-theme="ocean-depth"] .sidebar-menu li.active a,
[data-theme="ocean-depth"] .nav-menu li.active a {
    background-color: rgba(34, 211, 238, 0.14);
    border-color: rgba(34, 211, 238, 0.32);
    box-shadow: 0 3px 12px rgba(34, 211, 238, 0.12);
}

/* ============================================================
   REPORT ANALYSIS SYSTEM — PSX Portal
   Status badges, param panel, toast, modal, history table
   ============================================================ */

/* --- Status Badges --- */
.rpt-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.rpt-badge-submitted  { background: rgba(99,179,237,0.15); color: #63b3ed; border: 1px solid rgba(99,179,237,0.3); }
.rpt-badge-processing { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.rpt-badge-completed  { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.rpt-badge-failed     { background: rgba(251,113,133,0.12); color: #fb7185; border: 1px solid rgba(251,113,133,0.3); }

/* --- Processing Pulse Dot --- */
.rpt-pulse {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    animation: rpt-pulse-anim 1.2s ease-in-out infinite;
}
@keyframes rpt-pulse-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* --- Parameter Panel Slide-in --- */
.rpt-param-panel { animation: rpt-slide-in 0.22s ease-out; }
@keyframes rpt-slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Parameter Form Grid --- */
.rpt-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.rpt-param-field label {
    display: block;
    font-size: 12px; font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.rpt-param-field input,
.rpt-param-field select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 13px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.rpt-param-field input:focus,
.rpt-param-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,134,255,0.12);
}
.rpt-param-field select option { background: var(--bg-card); color: var(--text-main); }

/* --- Checkbox Toggle --- */
.rpt-checkbox-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.rpt-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.rpt-checkbox-row label { font-size: 13px; color: var(--text-main); cursor: pointer; user-select: none; margin: 0; text-transform: none; letter-spacing: 0; }

/* --- Shimmer Loading --- */
.rpt-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: rpt-shimmer-move 1.2s linear infinite;
    border-radius: 8px; height: 80px;
}
@keyframes rpt-shimmer-move {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Report History Table --- */
.rpt-ref-no { font-family: 'Courier New', monospace; font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }
.rpt-action-btns { display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; }

/* --- Toast Notifications --- */
.rpt-toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.rpt-toast {
    pointer-events: all;
    min-width: 280px; max-width: 360px;
    padding: 12px 16px;
    border-radius: 10px; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    animation: rpt-toast-in 0.25s ease-out;
    backdrop-filter: blur(12px);
}
.rpt-toast.success { background: rgba(16,185,129,0.18); border: 1px solid rgba(52,211,153,0.35); color: #34d399; }
.rpt-toast.error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(251,113,133,0.35); color: #fb7185; }
.rpt-toast.info    { background: rgba(58,134,255,0.12); border: 1px solid rgba(99,179,237,0.3);  color: #63b3ed; }
.rpt-toast-out { animation: rpt-toast-out 0.2s ease-in forwards; }
@keyframes rpt-toast-in  { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
@keyframes rpt-toast-out { from { opacity:1; transform:translateX(0); }   to { opacity:0; transform:translateX(30px); } }

/* --- Report View Modal --- */
.rpt-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.72); backdrop-filter: blur(6px);
    z-index: 8000; display: flex; align-items: flex-start; justify-content: center;
    padding: 20px; overflow-y: auto;
}
.rpt-modal {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px;
    width: 100%; max-width: 1200px; margin: auto;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: rpt-modal-in 0.22s ease-out;
}
@keyframes rpt-modal-in {
    from { opacity:0; transform:scale(0.96) translateY(-20px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
}
.rpt-modal-header {
    padding: 18px 22px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.rpt-modal-title { font-size: 15px; font-weight: 600; color: var(--text-main); margin: 0; }
.rpt-modal-meta  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.rpt-modal-body  { padding: 16px 22px; overflow-x: auto; max-height: 65vh; overflow-y: auto; }
.rpt-modal-footer { padding: 14px 22px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rpt-modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
    transition: color 0.15s, background 0.15s; line-height: 1;
}
.rpt-modal-close:hover { color: var(--text-main); background: rgba(255,255,255,0.06); }

/* --- Report View Table --- */
.rpt-view-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rpt-view-table th {
    background: rgba(255,255,255,0.05); color: var(--text-muted);
    font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 8px 12px; text-align: left; white-space: nowrap;
    position: sticky; top: 0; border-bottom: 1px solid var(--border-color);
}
.rpt-view-table td { padding: 7px 12px; color: var(--text-main); border-bottom: 1px solid rgba(255,255,255,0.04); white-space: nowrap; }
.rpt-view-table tr:hover td { background: rgba(255,255,255,0.03); }

/* --- Step Number Badge --- */
.rpt-step-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 12px; font-weight: 700; margin-right: 8px; flex-shrink: 0;
}

/* --- Empty State --- */
.rpt-empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.rpt-empty-state i { font-size: 36px; margin-bottom: 12px; opacity: 0.4; display: block; }
.rpt-empty-state p { margin: 0; font-size: 13px; }

/* --- Admin Stats Cards --- */
.rpt-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.rpt-stat-card  { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 18px 20px; }
.rpt-stat-value { font-size: 26px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.rpt-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .rpt-params-grid { grid-template-columns: 1fr; }
    .rpt-action-btns { flex-wrap: wrap; }
    .rpt-modal-overlay { padding: 10px; }
    .rpt-toast-container { bottom: 12px; right: 12px; left: 12px; }
    .rpt-toast { min-width: unset; max-width: 100%; }
}

/* --- Print / PDF output pages --- */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .rpt-view-table th { background: #f0f0f0 !important; color: #000 !important; }
    .rpt-view-table td { color: #000 !important; border-bottom: 1px solid #ddd; }
    .no-print { display: none !important; }
}
