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

/* ══════════════════════════════════════════════════════════
   STRUCTURAL VARIABLES (unchanged across themes)
   ══════════════════════════════════════════════════════════ */
:root {
    --sidebar-width: 220px;
    --radius: 8px;
}

/* ══════════════════════════════════════════════════════════
   THEME 1: Bloomberg Terminal
   ══════════════════════════════════════════════════════════ */
html[data-theme="bloomberg"][data-mode="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #141414;
    --bg-input: #1e1e1e;
    --text-primary: #33ff33;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --accent: #ff8c00;
    --accent-hover: #ffa333;
    --accent-rgb: 255, 140, 0;
    --green: #33ff33;
    --green-rgb: 51, 255, 51;
    --red: #ff4444;
    --red-rgb: 255, 68, 68;
    --yellow: #ffcc00;
    --yellow-rgb: 255, 204, 0;
    --border: #2a2a2a;
    --bg-login-gradient-1: #0a0a0a;
    --bg-login-gradient-2: #1a1a00;
    --chart-grid: rgba(51, 255, 51, 0.08);
    --chart-tick: #666666;
    --font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --logo-bg: #ff8c00;
    --logo-color: #000000;
    --sidebar-bg: #111111;
}

html[data-theme="bloomberg"][data-mode="light"] {
    --bg-primary: #f5f5f0;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #e8e8e0;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent: #d47200;
    --accent-hover: #ff8c00;
    --accent-rgb: 212, 114, 0;
    --green: #006600;
    --green-rgb: 0, 102, 0;
    --red: #cc0000;
    --red-rgb: 204, 0, 0;
    --yellow: #cc8800;
    --yellow-rgb: 204, 136, 0;
    --border: #d0d0c8;
    --bg-login-gradient-1: #f5f5f0;
    --bg-login-gradient-2: #e8e8d8;
    --chart-grid: rgba(0, 0, 0, 0.06);
    --chart-tick: #888888;
    --font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --logo-bg: #d47200;
    --logo-color: #ffffff;
    --sidebar-bg: #ffffff;
}

/* ══════════════════════════════════════════════════════════
   THEME 2: Trading Desk
   ══════════════════════════════════════════════════════════ */
html[data-theme="trading-desk"][data-mode="dark"] {
    --bg-primary: #0c1929;
    --bg-secondary: #142238;
    --bg-card: #162640;
    --bg-input: #1e3354;
    --text-primary: #e8edf4;
    --text-secondary: #8899b0;
    --text-muted: #5a6d85;
    --accent: #2196f3;
    --accent-hover: #42a5f5;
    --accent-rgb: 33, 150, 243;
    --green: #4caf50;
    --green-rgb: 76, 175, 80;
    --red: #f44336;
    --red-rgb: 244, 67, 54;
    --yellow: #ffc107;
    --yellow-rgb: 255, 193, 7;
    --border: #253b56;
    --bg-login-gradient-1: #0c1929;
    --bg-login-gradient-2: #0d2847;
    --chart-grid: rgba(33, 150, 243, 0.08);
    --chart-tick: #5a6d85;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #2196f3;
    --logo-color: #ffffff;
    --sidebar-bg: #142238;
}

html[data-theme="trading-desk"][data-mode="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #e3eaf2;
    --text-primary: #1a2332;
    --text-secondary: #4a5b6e;
    --text-muted: #7a8b9e;
    --accent: #1976d2;
    --accent-hover: #2196f3;
    --accent-rgb: 25, 118, 210;
    --green: #2e7d32;
    --green-rgb: 46, 125, 50;
    --red: #c62828;
    --red-rgb: 198, 40, 40;
    --yellow: #f9a825;
    --yellow-rgb: 249, 168, 37;
    --border: #c8d6e5;
    --bg-login-gradient-1: #f0f4f8;
    --bg-login-gradient-2: #dce6f0;
    --chart-grid: rgba(0, 0, 0, 0.06);
    --chart-tick: #7a8b9e;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #1976d2;
    --logo-color: #ffffff;
    --sidebar-bg: #ffffff;
}

/* ══════════════════════════════════════════════════════════
   THEME 3: Wealth Manager
   ══════════════════════════════════════════════════════════ */
html[data-theme="wealth-manager"][data-mode="dark"] {
    --bg-primary: #1a1814;
    --bg-secondary: #242019;
    --bg-card: #2a2620;
    --bg-input: #3a3528;
    --text-primary: #f0e8d8;
    --text-secondary: #b8a88c;
    --text-muted: #7a6f5c;
    --accent: #c8a85c;
    --accent-hover: #dabb6f;
    --accent-rgb: 200, 168, 92;
    --green: #5ca85c;
    --green-rgb: 92, 168, 92;
    --red: #c85c5c;
    --red-rgb: 200, 92, 92;
    --yellow: #c8a85c;
    --yellow-rgb: 200, 168, 92;
    --border: #3e3a30;
    --bg-login-gradient-1: #1a1814;
    --bg-login-gradient-2: #2a2210;
    --chart-grid: rgba(200, 168, 92, 0.08);
    --chart-tick: #7a6f5c;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #c8a85c;
    --logo-color: #1a1814;
    --sidebar-bg: #242019;
}

html[data-theme="wealth-manager"][data-mode="light"] {
    --bg-primary: #faf8f4;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0ece2;
    --text-primary: #2c261c;
    --text-secondary: #6b5f48;
    --text-muted: #9a8e78;
    --accent: #a67c00;
    --accent-hover: #c89200;
    --accent-rgb: 166, 124, 0;
    --green: #2e6b2e;
    --green-rgb: 46, 107, 46;
    --red: #9b2020;
    --red-rgb: 155, 32, 32;
    --yellow: #a67c00;
    --yellow-rgb: 166, 124, 0;
    --border: #ddd6c8;
    --bg-login-gradient-1: #faf8f4;
    --bg-login-gradient-2: #f0e8d0;
    --chart-grid: rgba(0, 0, 0, 0.06);
    --chart-tick: #9a8e78;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #a67c00;
    --logo-color: #ffffff;
    --sidebar-bg: #ffffff;
}

/* ══════════════════════════════════════════════════════════
   THEME 4: Hedge Fund
   ══════════════════════════════════════════════════════════ */
html[data-theme="hedge-fund"][data-mode="dark"] {
    --bg-primary: #0e0e0e;
    --bg-secondary: #161616;
    --bg-card: #1a1a1a;
    --bg-input: #262626;
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --text-muted: #555555;
    --accent: #a0a0a0;
    --accent-hover: #c0c0c0;
    --accent-rgb: 160, 160, 160;
    --green: #4ade80;
    --green-rgb: 74, 222, 128;
    --red: #f87171;
    --red-rgb: 248, 113, 113;
    --yellow: #fbbf24;
    --yellow-rgb: 251, 191, 36;
    --border: #2a2a2a;
    --bg-login-gradient-1: #0e0e0e;
    --bg-login-gradient-2: #141414;
    --chart-grid: rgba(255, 255, 255, 0.04);
    --chart-tick: #555555;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #2a2a2a;
    --logo-color: #e0e0e0;
    --sidebar-bg: #161616;
}

html[data-theme="hedge-fund"][data-mode="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0f0f0;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #999999;
    --accent: #444444;
    --accent-hover: #222222;
    --accent-rgb: 68, 68, 68;
    --green: #16a34a;
    --green-rgb: 22, 163, 74;
    --red: #dc2626;
    --red-rgb: 220, 38, 38;
    --yellow: #ca8a04;
    --yellow-rgb: 202, 138, 4;
    --border: #e0e0e0;
    --bg-login-gradient-1: #fafafa;
    --bg-login-gradient-2: #f0f0f0;
    --chart-grid: rgba(0, 0, 0, 0.05);
    --chart-tick: #999999;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #f0f0f0;
    --logo-color: #111111;
    --sidebar-bg: #ffffff;
}

/* ══════════════════════════════════════════════════════════
   THEME 5: Market Floor
   ══════════════════════════════════════════════════════════ */
html[data-theme="market-floor"][data-mode="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-input: #2a2a2a;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #e53935;
    --accent-hover: #ef5350;
    --accent-rgb: 229, 57, 53;
    --green: #00e676;
    --green-rgb: 0, 230, 118;
    --red: #ff1744;
    --red-rgb: 255, 23, 68;
    --yellow: #ffea00;
    --yellow-rgb: 255, 234, 0;
    --border: #333333;
    --bg-login-gradient-1: #121212;
    --bg-login-gradient-2: #1a0000;
    --chart-grid: rgba(255, 255, 255, 0.05);
    --chart-tick: #666666;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #e53935;
    --logo-color: #ffffff;
    --sidebar-bg: #1a1a1a;
}

html[data-theme="market-floor"][data-mode="light"] {
    --bg-primary: #f8f8f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent: #c62828;
    --accent-hover: #e53935;
    --accent-rgb: 198, 40, 40;
    --green: #2e7d32;
    --green-rgb: 46, 125, 50;
    --red: #c62828;
    --red-rgb: 198, 40, 40;
    --yellow: #f9a825;
    --yellow-rgb: 249, 168, 37;
    --border: #e0e0e0;
    --bg-login-gradient-1: #f8f8f8;
    --bg-login-gradient-2: #ffe8e8;
    --chart-grid: rgba(0, 0, 0, 0.06);
    --chart-tick: #888888;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --logo-bg: #c62828;
    --logo-color: #ffffff;
    --sidebar-bg: #ffffff;
}

/* ══════════════════════════════════════════════════════════
   BASE STYLES
   ══════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-login-gradient-1) 0%, var(--bg-login-gradient-2) 100%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: var(--logo-bg);
    color: var(--logo-color);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.login-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-card .subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.875rem; }

.form-group {
    text-align: left;
    margin-bottom: 1rem;
}

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

input[type="text"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; background: var(--bg-input); color: var(--text-secondary); }
.btn-danger { background: var(--red); color: white; }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { opacity: 0.9; }

.error-msg { color: var(--red); font-size: 0.8rem; margin-top: 0.75rem; }

/* Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    width: 36px;
    height: 36px;
    background: var(--logo-bg);
    color: var(--logo-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.logo svg { display: block; }

.logo-text { font-weight: 600; font-size: 1rem; }

.nav-links {
    list-style: none;
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.nav-link {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover { color: var(--text-primary); background: rgba(var(--accent-rgb), 0.08); }
.nav-link.active { color: var(--accent); border-left-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-tour {
    padding: 0.3rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-tour:hover {
    background: var(--accent);
    color: #fff;
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-warning { background: rgba(var(--yellow-rgb), 0.15); color: var(--yellow); }
.badge-success { background: rgba(var(--green-rgb), 0.15); color: var(--green); }
.badge-danger { background: rgba(var(--red-rgb), 0.15); color: var(--red); }
.badge-info { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }

.content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h2 { font-size: 1.35rem; font-weight: 600; }
.equity-badge { font-size: 1.1rem; font-weight: 600; color: var(--green); }

/* Simple v7 shadow-status banner */
.v7-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(var(--yellow-rgb), 0.15);
    border: 1px solid rgba(var(--yellow-rgb), 0.45);
    border-left: 4px solid var(--yellow);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text);
}
.v7-banner-label { color: var(--yellow); letter-spacing: 0.02em; }
.v7-banner-day {
    padding: 0.12rem 0.55rem;
    border-radius: 3px;
    background: rgba(var(--yellow-rgb), 0.22);
    color: var(--text);
    font-weight: 600;
    font-size: 0.78rem;
}
.v7-banner-note { color: var(--text-muted); font-size: 0.78rem; flex: 1 1 auto; }
@media (max-width: 640px) {
    .v7-banner { flex-direction: column; align-items: flex-start; }
    .v7-banner-note { font-size: 0.75rem; }
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.card-value { font-size: 1.5rem; font-weight: 700; }
.card-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

.value-positive { color: var(--green); }
.value-negative { color: var(--red); }
.value-neutral { color: var(--text-secondary); }

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tr:last-child td { border-bottom: none; }
tr:hover { background: rgba(var(--accent-rgb), 0.04); }

/* Charts */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-container canvas { max-height: 300px; }

/* Two-column layout */
.split-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Loading */
.loading { color: var(--text-muted); padding: 2rem; text-align: center; }

/* Training Manual */
.manual-toc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.manual-toc a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.manual-toc a:hover {
    background: rgba(var(--accent-rgb), 0.08);
}

.manual-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 1rem;
}

.manual-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.manual-section p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.manual-section ul, .manual-section ol {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.manual-section li { margin-bottom: 0.25rem; }

.manual-section strong { color: var(--text-primary); }

.manual-section code {
    background: var(--bg-input);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--accent);
}

.manual-section .info-box {
    background: rgba(var(--accent-rgb), 0.08);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.manual-section .warning-box {
    background: rgba(var(--yellow-rgb), 0.08);
    border-left: 3px solid var(--yellow);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.manual-back-top {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}

.manual-back-top:hover { color: var(--accent); }

/* Range Selector */
.range-selector {
    display: flex;
    gap: 0.2rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 0.2rem;
}

.range-btn {
    padding: 0.3rem 0.65rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.range-btn:hover { color: var(--text-primary); }
.range-btn.active { background: var(--accent); color: white; }

/* P&L Summary */
.pnl-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pnl-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pnl-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

/* Position Progress Bar */
.position-progress {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.progress-track {
    position: relative;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    margin: 0.5rem 0 0.35rem;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.progress-marker {
    position: absolute;
    top: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    transform: translateX(-50%);
}

/* Theme Picker */
.theme-picker-container {
    position: relative;
    width: 100%;
}

.theme-picker-toggle {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.theme-picker-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.theme-picker-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
    z-index: 200;
    display: none;
}

.theme-picker-dropdown.open {
    display: block;
    animation: tourFadeIn 0.2s ease-out;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.theme-option:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-primary);
}

.theme-option.active {
    color: var(--accent);
    font-weight: 600;
}

.theme-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.theme-divider {
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0;
}

.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.mode-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--bg-input);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.mode-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.2s;
}

html[data-mode="light"] .mode-toggle-switch {
    background: var(--accent);
}

html[data-mode="light"] .mode-toggle-switch::after {
    transform: translateX(16px);
    background: #ffffff;
}

/* Timezone Picker */
.tz-picker-container {
    position: relative;
    width: 100%;
}

.tz-picker-toggle {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    font-family: inherit;
}

.tz-picker-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.tz-picker-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.3rem;
    margin-bottom: 0.3rem;
    display: none;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.tz-picker-dropdown.open {
    display: block;
    animation: tourFadeIn 0.2s ease-out;
}

.tz-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
}

.tz-option:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-primary);
}

.tz-option.active {
    color: var(--accent);
    font-weight: 600;
}

/* Guided Tour */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    transition: opacity 0.3s;
}

.tour-spotlight {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px var(--accent), 0 0 20px rgba(var(--accent-rgb), 0.4);
    border-radius: var(--radius);
    transition: box-shadow 0.3s;
}

.tour-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: 12px;
    width: 380px;
    max-width: calc(100vw - 2rem);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: tourFadeIn 0.25s ease-out;
    overflow: hidden;
}

.tour-tooltip-progress {
    height: 3px;
    background: var(--bg-input);
}

.tour-tooltip-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
    border-radius: 0 3px 3px 0;
}

.tour-tooltip-header {
    padding: 1rem 1.25rem 0.5rem;
}

.tour-tooltip-step {
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.tour-tooltip-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tour-tooltip-body {
    padding: 0.25rem 1.25rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tour-tooltip-footer {
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
}

.tour-btn {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tour-btn-next {
    background: var(--accent);
    color: white;
}

.tour-btn-next:hover { background: var(--accent-hover); }

.tour-btn-prev {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.tour-btn-prev:hover { color: var(--text-primary); }

.tour-btn-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
}

.tour-btn-skip:hover { color: var(--text-secondary); }

@keyframes tourFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hamburger menu button — hidden on desktop, shown on mobile */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Sidebar overlay — dim background when sidebar is open on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}
.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger-btn { display: flex; align-items: center; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 1rem; }
    .split-row { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .range-selector { flex-wrap: wrap; }
    .pnl-summary { gap: 1rem; }
    .tour-tooltip {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        top: auto !important;
    }
}
