/* ===== THEME SYSTEM ===== */
:root {
  --font-ui: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --card-radius: 12px;
  --radius: var(--card-radius);
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --transition: 200ms ease;
  --card-opacity: 0.7;
  --card-blur: 12px;
  --card-border-style: 1px solid var(--border);
  --card-shadow: none;
}

/* Midnight (default) */
[data-theme="midnight"] {
  --bg-base: #0a0a14;
  --bg-surface: #0e0e1a;
  --bg-card: rgba(15, 15, 42, var(--card-opacity));
  --bg-card-hover: rgba(20, 20, 55, 0.8);
  --bg-elevated: rgba(25, 25, 65, 0.6);
  --border: rgba(99, 102, 241, 0.15);
  --border-bright: rgba(99, 102, 241, 0.3);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-bright: #f8fafc;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-secondary: #818cf8;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --sidebar-bg: rgba(8, 8, 24, 0.95);
  --logo-filter: invert(1);
  --card-radius: 12px;
  --theme-base-color: #0a0a1a;
  --theme-accent-color: #6366f1;
}

[data-theme="aurora"] {
  --bg-base: #0a1a14;
  --bg-surface: #0f2a1e;
  --bg-card: rgba(15, 42, 30, var(--card-opacity));
  --bg-card-hover: rgba(20, 55, 38, 0.8);
  --bg-elevated: rgba(25, 65, 45, 0.6);
  --border: rgba(16, 185, 129, 0.15);
  --border-bright: rgba(16, 185, 129, 0.3);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-bright: #f8fafc;
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent-secondary: #34d399;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --sidebar-bg: rgba(8, 24, 16, 0.95);
  --logo-filter: invert(1);
  --card-radius: 12px;
  --theme-base-color: #0a1a14;
  --theme-accent-color: #10b981;
}

[data-theme="ember"] {
  --bg-base: #1a0f0a;
  --bg-surface: #2a1a0f;
  --bg-card: rgba(42, 26, 15, var(--card-opacity));
  --bg-card-hover: rgba(55, 33, 18, 0.8);
  --bg-elevated: rgba(65, 40, 22, 0.6);
  --border: rgba(249, 115, 22, 0.15);
  --border-bright: rgba(249, 115, 22, 0.3);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-bright: #f8fafc;
  --accent: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.25);
  --accent-secondary: #fb923c;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --sidebar-bg: rgba(24, 12, 8, 0.95);
  --logo-filter: invert(1);
  --card-radius: 12px;
  --theme-base-color: #1a0f0a;
  --theme-accent-color: #f97316;
}

[data-theme="void"] {
  --bg-base: #0f0a1a;
  --bg-surface: #1a0f2a;
  --bg-card: rgba(26, 15, 42, var(--card-opacity));
  --bg-card-hover: rgba(35, 20, 55, 0.8);
  --bg-elevated: rgba(42, 25, 65, 0.6);
  --border: rgba(168, 85, 247, 0.15);
  --border-bright: rgba(168, 85, 247, 0.3);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-bright: #f8fafc;
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.25);
  --accent-secondary: #c084fc;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --sidebar-bg: rgba(12, 8, 24, 0.95);
  --logo-filter: invert(1);
  --card-radius: 12px;
  --theme-base-color: #0f0a1a;
  --theme-accent-color: #a855f7;
}

[data-theme="frost"] {
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(248, 250, 252, 0.9);
  --bg-elevated: rgba(241, 245, 249, 0.8);
  --border: rgba(148, 163, 184, 0.2);
  --border-bright: rgba(148, 163, 184, 0.4);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-bright: #0f172a;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-secondary: #818cf8;
  --green: #16a34a;
  --green-dim: rgba(22, 163, 74, 0.1);
  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.1);
  --yellow: #ca8a04;
  --sidebar-bg: rgba(255, 255, 255, 0.95);
  --logo-filter: none;
  --card-radius: 14px;
  --theme-base-color: #f1f5f9;
  --theme-accent-color: #6366f1;
}

/* ===== TWO-TONE THEMES ===== */
[data-theme="obsidian-gold"] {
  --bg-base: #0a0a0f;
  --bg-surface: #111118;
  --bg-card: rgba(17, 17, 24, 0.8);
  --bg-card-hover: rgba(22, 22, 30, 0.85);
  --bg-elevated: rgba(30, 28, 22, 0.5);
  --border: rgba(212, 168, 83, 0.12);
  --border-bright: rgba(212, 168, 83, 0.3);
  --text-primary: #e2ddd4;
  --text-secondary: #9e9589;
  --text-muted: #5c5549;
  --text-bright: #f5f0e8;
  --accent: #d4a853;
  --accent-glow: rgba(212, 168, 83, 0.2);
  --accent-secondary: #e8c278;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --sidebar-bg: rgba(8, 8, 12, 0.97);
  --logo-filter: invert(1) sepia(0.3) saturate(2) hue-rotate(15deg);
  --theme-gradient: linear-gradient(135deg, #0a0a0f 0%, #14120a 50%, #0a0a0f 100%);
  --card-radius: 10px;
  --theme-base-color: #0a0a0f;
  --theme-accent-color: #d4a853;
}

[data-theme="carbon-neon"] {
  --bg-base: #080808;
  --bg-surface: #0e0e0e;
  --bg-card: rgba(14, 14, 14, 0.85);
  --bg-card-hover: rgba(18, 18, 18, 0.9);
  --bg-elevated: rgba(20, 20, 20, 0.6);
  --border: rgba(0, 255, 213, 0.1);
  --border-bright: rgba(0, 255, 213, 0.3);
  --text-primary: #d0d0d0;
  --text-secondary: #888;
  --text-muted: #555;
  --text-bright: #f0f0f0;
  --accent: #00ffd5;
  --accent-glow: rgba(0, 255, 213, 0.15);
  --accent-secondary: #33ffe0;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ff3355;
  --red-dim: rgba(255, 51, 85, 0.12);
  --yellow: #ffaa00;
  --sidebar-bg: rgba(6, 6, 6, 0.97);
  --logo-filter: invert(1) brightness(1.2);
  --theme-gradient: linear-gradient(160deg, #080808 0%, #081210 50%, #080808 100%);
  --card-radius: 8px;
  --theme-base-color: #080808;
  --theme-accent-color: #00ffd5;
}

[data-theme="deep-sea"] {
  --bg-base: #051a1a;
  --bg-surface: #0a2626;
  --bg-card: rgba(10, 38, 38, 0.8);
  --bg-card-hover: rgba(14, 48, 48, 0.85);
  --bg-elevated: rgba(18, 55, 50, 0.5);
  --border: rgba(245, 166, 35, 0.12);
  --border-bright: rgba(245, 166, 35, 0.3);
  --text-primary: #c8ddd8;
  --text-secondary: #7a9e96;
  --text-muted: #4a6e64;
  --text-bright: #e8f5f0;
  --accent: #f5a623;
  --accent-glow: rgba(245, 166, 35, 0.2);
  --accent-secondary: #f7bc5a;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --sidebar-bg: rgba(3, 18, 18, 0.97);
  --logo-filter: invert(1) sepia(0.2) hue-rotate(140deg);
  --theme-gradient: linear-gradient(135deg, #051a1a 0%, #0a2020 40%, #061818 100%);
  --card-radius: 16px;
  --theme-base-color: #051a1a;
  --theme-accent-color: #f5a623;
}

[data-theme="slate-rose"] {
  --bg-base: #1a1e2e;
  --bg-surface: #222840;
  --bg-card: rgba(34, 40, 64, 0.7);
  --bg-card-hover: rgba(40, 48, 72, 0.8);
  --bg-elevated: rgba(48, 54, 80, 0.5);
  --border: rgba(232, 120, 138, 0.12);
  --border-bright: rgba(232, 120, 138, 0.3);
  --text-primary: #d8d4e0;
  --text-secondary: #9490a8;
  --text-muted: #5c587a;
  --text-bright: #f0ecf8;
  --accent: #e8788a;
  --accent-glow: rgba(232, 120, 138, 0.2);
  --accent-secondary: #f09aaa;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --sidebar-bg: rgba(22, 26, 40, 0.97);
  --logo-filter: invert(1) sepia(0.1) hue-rotate(280deg);
  --theme-gradient: linear-gradient(135deg, #1a1e2e 0%, #24203a 50%, #1a1e2e 100%);
  --card-radius: 14px;
  --theme-base-color: #1a1e2e;
  --theme-accent-color: #e8788a;
}

/* ===== NEW VARIANT THEMES ===== */

/* Sharp Midnight — angular/boxy */
[data-theme="sharp-midnight"] {
  --bg-base: #08080f;
  --bg-surface: #0c0c1e;
  --bg-card: rgba(12, 12, 30, 0.9);
  --bg-card-hover: rgba(16, 16, 40, 0.95);
  --bg-elevated: rgba(20, 20, 50, 0.7);
  --border: rgba(99, 102, 241, 0.2);
  --border-bright: rgba(99, 102, 241, 0.4);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-bright: #f8fafc;
  --accent: #818cf8;
  --accent-glow: rgba(129, 140, 248, 0.25);
  --accent-secondary: #a5b4fc;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --sidebar-bg: rgba(6, 6, 14, 0.98);
  --logo-filter: invert(1);
  --card-radius: 3px;
  --card-opacity: 0.9;
  --card-border-style: 1px solid var(--border);
  --card-shadow: 0 2px 8px rgba(0,0,0,0.4);
  --theme-base-color: #08080f;
  --theme-accent-color: #818cf8;
}

/* Glass — ultra transparent with strong blur */
[data-theme="glass"] {
  --bg-base: #0a0a18;
  --bg-surface: #0e0e24;
  --bg-card: rgba(14, 14, 36, 0.35);
  --bg-card-hover: rgba(20, 20, 48, 0.45);
  --bg-elevated: rgba(24, 24, 56, 0.25);
  --border: rgba(148, 163, 184, 0.1);
  --border-bright: rgba(148, 163, 184, 0.25);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-bright: #f8fafc;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.2);
  --accent-secondary: #7dd3fc;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --sidebar-bg: rgba(8, 8, 20, 0.6);
  --logo-filter: invert(1);
  --card-radius: 16px;
  --card-opacity: 0.35;
  --card-blur: 24px;
  --card-border-style: 1px solid rgba(255,255,255,0.06);
  --card-shadow: 0 4px 30px rgba(0,0,0,0.15);
  --theme-base-color: #0a0a18;
  --theme-accent-color: #38bdf8;
  --theme-gradient: linear-gradient(135deg, #0a0a18, #0e1428, #0a0a18);
}

/* Solid — no transparency, strong backgrounds */
[data-theme="solid"] {
  --bg-base: #111827;
  --bg-surface: #1f2937;
  --bg-card: #1f2937;
  --bg-card-hover: #283548;
  --bg-elevated: #374151;
  --border: rgba(75, 85, 99, 0.5);
  --border-bright: rgba(107, 114, 128, 0.7);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-bright: #ffffff;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.2);
  --accent-secondary: #fbbf24;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --sidebar-bg: #111827;
  --logo-filter: invert(1);
  --card-radius: 8px;
  --card-opacity: 1;
  --card-blur: 0px;
  --card-border-style: none;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.15);
  --theme-base-color: #111827;
  --theme-accent-color: #f59e0b;
}

/* ===== PURE BLACK / OLED ===== */
[data-theme="pure-black"] {
  --bg-base: #000000;
  --bg-surface: #0a0a0a;
  --bg-card: rgba(10, 10, 10, var(--card-opacity));
  --bg-card-hover: rgba(18, 18, 18, 0.9);
  --bg-elevated: rgba(20, 20, 20, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.15);
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --text-bright: #ffffff;
  --accent: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.1);
  --accent-secondary: #cccccc;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --sidebar-bg: #000000;
  --logo-filter: invert(1);
  --card-radius: 8px;
  --theme-base-color: #000000;
  --theme-accent-color: #ffffff;
}

/* ===== SNOW WHITE / LIGHT ===== */
[data-theme="snow-white"] {
  --bg-base: #ffffff;
  --bg-surface: #f8f9fa;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(248, 249, 250, 0.95);
  --bg-elevated: rgba(241, 243, 245, 0.8);
  --border: rgba(0, 0, 0, 0.08);
  --border-bright: rgba(0, 0, 0, 0.15);
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  --text-bright: #000000;
  --accent: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.12);
  --accent-secondary: #3b82f6;
  --green: #16a34a;
  --green-dim: rgba(22, 163, 74, 0.1);
  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.1);
  --yellow: #ca8a04;
  --sidebar-bg: rgba(255, 255, 255, 0.98);
  --logo-filter: none;
  --card-radius: 12px;
  --theme-base-color: #ffffff;
  --theme-accent-color: #2563eb;
}

/* ===== CYBERPUNK ===== */
[data-theme="cyberpunk"] {
  --bg-base: #0a0014;
  --bg-surface: #120020;
  --bg-card: rgba(18, 0, 32, 0.8);
  --bg-card-hover: rgba(25, 0, 45, 0.85);
  --bg-elevated: rgba(30, 0, 55, 0.5);
  --border: rgba(255, 45, 149, 0.15);
  --border-bright: rgba(255, 45, 149, 0.35);
  --text-primary: #e0d0f0;
  --text-secondary: #9080a8;
  --text-muted: #5a4878;
  --text-bright: #fff0ff;
  --accent: #ff2d95;
  --accent-glow: rgba(255, 45, 149, 0.25);
  --accent-secondary: #ff66b8;
  --green: #00ff88;
  --green-dim: rgba(0, 255, 136, 0.12);
  --red: #ff3355;
  --red-dim: rgba(255, 51, 85, 0.12);
  --yellow: #ffdd00;
  --sidebar-bg: rgba(6, 0, 16, 0.97);
  --logo-filter: invert(1) hue-rotate(300deg);
  --theme-gradient: linear-gradient(135deg, #0a0014 0%, #14002a 50%, #0a0014 100%);
  --card-radius: 4px;
  --theme-base-color: #0a0014;
  --theme-accent-color: #ff2d95;
}

/* ===== TERMINAL / HACKER ===== */
[data-theme="terminal"] {
  --bg-base: #000000;
  --bg-surface: #0a0a0a;
  --bg-card: rgba(0, 10, 0, var(--card-opacity));
  --bg-card-hover: rgba(0, 18, 0, 0.9);
  --bg-elevated: rgba(0, 20, 0, 0.5);
  --border: rgba(0, 255, 65, 0.12);
  --border-bright: rgba(0, 255, 65, 0.25);
  --text-primary: #00ff41;
  --text-secondary: #00cc33;
  --text-muted: #006622;
  --text-bright: #33ff66;
  --accent: #00ff41;
  --accent-glow: rgba(0, 255, 65, 0.15);
  --accent-secondary: #33ff66;
  --green: #00ff41;
  --green-dim: rgba(0, 255, 65, 0.12);
  --red: #ff3333;
  --red-dim: rgba(255, 51, 51, 0.12);
  --yellow: #ffff00;
  --sidebar-bg: rgba(0, 0, 0, 0.98);
  --logo-filter: invert(1) hue-rotate(90deg) brightness(1.5);
  --card-radius: 0px;
  --theme-base-color: #000000;
  --theme-accent-color: #00ff41;
}

/* ===== WARM DARK ===== */
[data-theme="warm-dark"] {
  --bg-base: #1a1008;
  --bg-surface: #241a0e;
  --bg-card: rgba(36, 26, 14, var(--card-opacity));
  --bg-card-hover: rgba(44, 32, 18, 0.85);
  --bg-elevated: rgba(50, 38, 22, 0.6);
  --border: rgba(212, 148, 58, 0.12);
  --border-bright: rgba(212, 148, 58, 0.25);
  --text-primary: #e8d8c4;
  --text-secondary: #a89478;
  --text-muted: #6e5a42;
  --text-bright: #fff0d8;
  --accent: #d4943a;
  --accent-glow: rgba(212, 148, 58, 0.2);
  --accent-secondary: #e8b05c;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --sidebar-bg: rgba(18, 12, 6, 0.97);
  --logo-filter: invert(1) sepia(0.4) saturate(1.5) hue-rotate(10deg);
  --card-radius: 10px;
  --theme-base-color: #1a1008;
  --theme-accent-color: #d4943a;
}

/* ===== GROK MIDNIGHT ===== */
[data-theme="grok-midnight"] {
  --bg-base: #030d4a;
  --bg-surface: #07165f;
  --bg-card: rgba(10, 29, 110, var(--card-opacity));
  --bg-card-hover: rgba(14, 37, 132, 0.9);
  --bg-elevated: rgba(18, 46, 148, 0.62);
  --border: rgba(130, 150, 255, 0.16);
  --border-bright: rgba(150, 170, 255, 0.30);
  --text-primary: #d8e2ff;
  --text-secondary: #9fb2ef;
  --text-muted: #6e85cc;
  --text-bright: #f2f6ff;
  --accent: #7f93ff;
  --accent-glow: rgba(127, 147, 255, 0.30);
  --accent-secondary: #a7b7ff;
  --green: #66d1ff;
  --green-dim: rgba(102, 209, 255, 0.15);
  --red: #ff6b9d;
  --red-dim: rgba(255, 107, 157, 0.13);
  --yellow: #d9e4ff;
  --sidebar-bg: rgba(3, 11, 58, 0.97);
  --logo-filter: invert(1) hue-rotate(185deg) saturate(1.15);
  --theme-gradient: linear-gradient(180deg, #030d4a 0%, #03124f 45%, #041860 100%);
  --card-radius: 16px;
  --theme-base-color: #030d4a;
  --theme-accent-color: #7f93ff;
}

/* Cyberpunk gradient bg */
[data-theme="cyberpunk"] body { background: var(--theme-gradient, var(--bg-base)); }
[data-theme="grok-midnight"] body { background: var(--theme-gradient, var(--bg-base)); }

/* Terminal monospace override */
[data-theme="terminal"] body { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* Project accent overrides — ONLY on overview */
[data-project="espn"] { --project-accent: #f97316; --project-glow: rgba(249, 115, 22, 0.2); }
[data-project="tweetbot"] { --project-accent: #06b6d4; --project-glow: rgba(6, 182, 212, 0.2); }
[data-project="polyfund"] { --project-accent: #10b981; --project-glow: rgba(16, 185, 129, 0.2); }
[data-project="overview"] { --project-accent: var(--accent); --project-glow: var(--accent-glow); }

/* On individual project pages, use theme accent instead */
.use-theme-accent { --project-accent: var(--accent); --project-glow: var(--accent-glow); }

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

#app {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  will-change: transform;
}

.sidebar .nav-item,
.sidebar .project-btn {
  color: var(--sidebar-text-secondary, var(--text-secondary));
}

.sidebar .nav-section-label {
  color: var(--sidebar-text-muted, var(--text-muted));
}

.sidebar .sidebar-brand,
.sidebar .brand-text {
  color: var(--sidebar-text-bright, var(--text-bright));
}

.sidebar-header {
  padding: 16px 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.logo {
  width: 36px;
  height: 18px;
  background-image: url('yxanadu-logo-cropped.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: var(--logo-filter);
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-bright);
}

/* Project Switcher */
.project-switcher {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.project-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
  position: relative;
}

.project-btn:hover {
  background: var(--bg-elevated);
  color: var(--sidebar-text-primary, var(--text-primary));
}

.project-btn.active {
  background: var(--bg-card);
  border-color: var(--project-accent, var(--accent));
  color: var(--sidebar-text-bright, var(--text-bright));
  box-shadow: 0 0 12px var(--project-glow, var(--accent-glow));
  border-left: 3px solid var(--project-accent, var(--accent));
  padding-left: 10px;
}

.project-btn .project-status {
  font-size: 8px;
  font-family: var(--font-mono);
  margin-left: auto;
  opacity: 0.7;
}

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--sidebar-text-muted, var(--text-muted));
  text-transform: uppercase;
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg-elevated); color: var(--sidebar-text-primary, var(--text-primary)); }
.nav-item.active {
  background: var(--bg-card);
  color: var(--accent);
  border-left: 2px solid var(--accent);
}

.nav-item svg { opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
}

.theme-switcher {
  display: flex;
  gap: 6px;
  padding: 6px 0;
  justify-content: center;
}

.sidebar-brand {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
  letter-spacing: 0.5px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 20px 24px;
  height: 100vh;
  max-height: 100vh;
  max-width: calc(100vw - var(--sidebar-w));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  /* contain: layout style removed to allow dropdown overflow */
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 20px;
  animation: slideDown 0.4s ease;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 16px;
  transition: border-color var(--transition);
  box-shadow: var(--card-shadow);
  position: relative;
}

.card, .stat-card, .position-card, .game-card, .project-overview-card,
.hero-card-asymmetric, .podium-card, .docker-card {
  color: var(--card-text, var(--text-primary));
}

.card:hover {
  border-color: var(--border-bright);
}

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

.card-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--card-text-muted, var(--text-muted));
}

.card-glow {
  box-shadow: 0 0 20px var(--project-glow, var(--accent-glow));
}

/* ===== STAT CARDS — RESPONSIVE ===== */
.stat-grid {
  display: grid;
  gap: 12px;
}
.stat-grid-2 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat-grid-3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-grid-5 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat-grid-6 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: border-color 50ms ease, transform 50ms ease;
}

.stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--card-text-muted, var(--text-muted));
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--card-text, var(--text-bright));
}

.stat-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ===== SPARKLINE in stat cards — FULL WIDTH BOTTOM ===== */
.stat-sparkline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0.25;
  pointer-events: none;
}

.stat-sparkline svg,
.stat-sparkline .mini-sparkline {
  width: 100% !important;
  height: 28px !important;
  display: block;
}

/* ===== Sparkline in overview project cards ===== */
.project-sparkline-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  opacity: 0.15;
  pointer-events: none;
  overflow: hidden;
}

.project-sparkline-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== GRIDS — RESPONSIVE ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ===== TABLES ===== */
.table-container {
  overflow-x: auto;
  border-radius: var(--card-radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  padding: 8px 10px;
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--transition);
}

th:hover { color: var(--text-primary); }
th.sorted { color: var(--accent); }

th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
  vertical-align: middle;
}
th.sorted .sort-arrow { opacity: 1; }

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

tr:hover td { background: var(--bg-elevated); }

.text-right { text-align: right; }
.text-center { text-align: center; }

/* ===== TEXT UTILITIES ===== */
.mono { font-family: var(--font-mono); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-accent { color: var(--accent); }
.text-bright { color: var(--text-bright); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 10px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 26px; }
.text-3xl { font-size: 32px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-accent { background: var(--accent-glow); color: var(--accent); }
.badge-yellow { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.badge-muted { background: var(--bg-elevated); color: var(--text-muted); }

.badge-live {
  background: var(--green-dim);
  color: var(--green);
}
.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

/* ===== STATUS DOTS ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.warning { background: var(--yellow); }
.status-dot.offline { background: var(--red); }
.status-dot.pulse { animation: pulse 2s infinite; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--border-bright); }
.btn-accent { background: var(--accent); color: var(--accent-text, #fff); border-color: transparent; }
.btn-accent:hover { opacity: 0.9; box-shadow: 0 0 12px var(--accent-glow); }
.btn-sm { padding: 4px 10px; font-size: 10px; }
.btn-danger { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-green { background: var(--green-dim); color: var(--green); border-color: rgba(34,197,94,0.3); }

.btn:active {
  transform: scale(0.97);
  box-shadow: 0 0 8px var(--accent-glow);
}

.btn-accent:active {
  transform: scale(0.97);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== FILTERS ===== */
.filter-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }
.filter-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.search-input {
  padding: 5px 10px 5px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  outline: none;
  transition: border-color var(--transition);
  width: 180px;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.search-wrapper {
  position: relative;
}
.search-wrapper svg {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ===== CUSTOM DROPDOWN ===== */
.custom-dropdown {
  position: relative;
  display: inline-block;
}

.custom-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 120px;
  justify-content: space-between;
}

.custom-dropdown-btn:hover {
  border-color: var(--border-bright);
}

.custom-dropdown-btn.open {
  border-color: var(--accent);
}

.custom-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  padding: 4px;
  opacity: 1;
}

.custom-dropdown-panel.open {
  display: block;
}

.custom-dropdown-search {
  width: calc(100% - 8px);
  margin: 4px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 10px;
  outline: none;
}

.custom-dropdown-search:focus { border-color: var(--accent); }

.custom-dropdown-item {
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.custom-dropdown-item:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

.custom-dropdown-item.selected {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

/* ===== CHARTS ===== */
.chart-container {
  padding: 0;
  width: 100%;
  min-height: 200px;
}

.chart-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Equity curves fill their parent card fully */
.chart-container-fill {
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 200px;
  flex: 1;
}

.chart-container-fill svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-time-selector {
  display: flex;
  gap: 4px;
}

.chart-time-btn {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.chart-time-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }
.chart-time-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0;
  font-size: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
}

.gauge-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.prob-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.prob-bar > div { height: 100%; transition: width 0.5s ease; }

/* ===== GAME CARDS — BROADCAST STYLE ===== */
.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 0;
  transition: all var(--transition);
  overflow: hidden;
  position: relative;
  box-shadow: var(--card-shadow);
}

.game-card:hover { border-color: var(--border-bright); transform: translate3d(0, -2px, 0); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

.game-card.game-live {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.sport-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
}

.game-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px 10px;
  gap: 8px;
}

.game-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.game-team-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.game-team-abbr {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 1px;
}

.game-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 80px;
}

.game-score-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-score-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.game-score-divider {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 300;
}

.game-clock {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.game-time-display {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
}

.badge-live-red {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-live-red::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s infinite;
}

.game-final-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 900;
  color: var(--text-muted);
  opacity: 0.08;
  letter-spacing: 4px;
  pointer-events: none;
  z-index: 2;
}

.tug-of-war {
  height: 8px;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 12px 8px;
}

.tug-of-war-left { height: 100%; transition: width 0.6s ease; }
.tug-of-war-right { height: 100%; transition: width 0.6s ease; }

.edge-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.edge-badge.significant {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.edge-badge.minor {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.game-card-footer {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* ===== POSITION CARDS ===== */
.position-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 16px;
  border-top: 3px solid var(--accent);
  box-shadow: var(--card-shadow);
}

.position-pnl-hero {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  padding: 6px 0;
}

.pnl-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-elevated);
  margin: 6px 0;
  overflow: hidden;
}
.pnl-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ===== HIGH WATERMARK VISUALIZATION ===== */
.hwm-bar {
  position: relative;
  height: 28px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: visible;
  margin: 10px 0;
}

.hwm-bar-track {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 12px;
  background: var(--bg-elevated);
  border-radius: 6px;
}

.hwm-bar-range {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 6px;
  transition: all 0.5s ease;
}

.hwm-marker {
  position: absolute;
  top: -2px;
  width: 3px;
  height: 16px;
  border-radius: 1.5px;
  transform: translateX(-50%);
  z-index: 2;
}

.hwm-marker-entry {
  background: var(--text-muted);
}

.hwm-marker-current {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.hwm-marker-high {
  background: var(--green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.hwm-trigger-line {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 2px dashed var(--red);
  transform: translateX(-50%);
  z-index: 1;
  opacity: 0.7;
}

.hwm-trigger-line.warning {
  opacity: 1;
  border-left-width: 3px;
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.hwm-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== P&L GLOW EFFECT ===== */
.pnl-glow-green { text-shadow: 0 0 12px rgba(34, 197, 94, 0.4); }
.pnl-glow-red { text-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }

/* ===== TOGGLE ===== */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}

.toggle-track.on {
  background: var(--green-dim);
  border-color: var(--green);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.toggle-track.on .toggle-thumb {
  transform: translateX(20px);
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ===== PODIUM ===== */
.podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.podium-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.podium-card.gold { border-color: #fbbf24; box-shadow: 0 0 20px rgba(251, 191, 36, 0.15); order: 2; }
.podium-card.silver { border-color: #94a3b8; order: 1; }
.podium-card.bronze { border-color: #cd7f32; order: 3; }

.podium-rank {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.podium-card.gold .podium-rank { color: #fbbf24; }
.podium-card.silver .podium-rank { color: #94a3b8; }
.podium-card.bronze .podium-rank { color: #cd7f32; }

/* ===== REGIME BADGES ===== */
.regime-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== DISTRIBUTION BAR ===== */
.dist-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.dist-bar:hover { background: var(--bg-elevated); }
.dist-bar.active { background: var(--bg-card-hover); border: 1px solid var(--border-bright); }

.dist-bar-fill {
  height: 8px;
  border-radius: 4px;
  flex: 1;
  background: var(--bg-elevated);
  overflow: hidden;
}

.dist-bar-inner {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.dist-bar-animated .dist-bar-inner {
  animation: fillBar 1s ease forwards;
}

@keyframes fillBar {
  from { width: 0 !important; }
}

/* ===== COLLAPSIBLE ===== */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
}

.collapsible-content {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.3s ease;
}
.collapsible-content.open { grid-template-rows: 1fr; }
.collapsible-content > * { overflow: hidden; min-height: 0; }

/* ===== CSS CONTAINMENT ===== */
/* NOTE: contain:content removed from .card to allow dropdown overflow */
.stat-card, .game-card, .position-card, .podium-card, .docker-card,
.project-overview-card { contain: content; }
.table-container { contain: content; }

/* Cards must allow dropdowns to overflow */
.card { overflow: visible; position: relative; z-index: 1; }
.card:has(.custom-dropdown), .card:has(.multi-select-dropdown), .card:has(.date-picker-wrapper) { z-index: 100; }
.custom-dropdown-panel, .date-picker-dropdown { z-index: 9999 !important; position: absolute; }
/* Use fixed positioning to escape backdrop-filter stacking contexts */
.multi-select-panel { z-index: 9999 !important; position: fixed !important; }

/* Cards with open dropdowns must sit above sibling cards */
.card:has(.custom-dropdown-panel.open),
.card:has(.date-picker-dropdown[style*="block"]),
.card:has(.multi-select-panel[style*="block"]),
.card:has(.color-picker-panel[style*="block"]) {
  z-index: 100;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translate3d(0, -10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translate3d(0, 15px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes floatUp {
  0% { opacity: 0.8; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.5); }
}

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

.animate-in {
  animation: slideUp 0.4s ease both;
  will-change: transform, opacity;
}

.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.12s; }
.stagger-4 { animation-delay: 0.16s; }
.stagger-5 { animation-delay: 0.20s; }
.stagger-6 { animation-delay: 0.24s; }
.stagger-7 { animation-delay: 0.28s; }
.stagger-8 { animation-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-in { animation: none; opacity: 1; transform: none; }
  .status-dot.pulse { animation: none; }
}

/* ===== OVERVIEW PROJECT CARDS ===== */
.project-overview-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  border-top: 3px solid;
  overflow: hidden;
  position: relative;
  box-shadow: var(--card-shadow);
}

.project-overview-card:hover {
  transform: translate3d(0, -3px, 0);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ===== INPUTS ===== */
input[type="number"], input[type="text"], input[type="date"], select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  transition: border-color var(--transition);
}
input:focus, select:focus { border-color: var(--accent); }

/* ===== STRATEGY CHIPS ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
}
.chip:hover { border-color: var(--border-bright); }
.chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  background: var(--accent);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== FLEX UTILITIES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }

/* ===== PAGE FOOTER ===== */
.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 8px;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.page-footer .logo {
  width: 20px;
  height: 10px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* ===== EDITABLE CELL ===== */
.editable-cell {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--transition);
}
.editable-cell:hover { background: var(--bg-elevated); }

/* ===== CHART EMPTY ===== */
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== DOCKER STATUS ===== */
.docker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.docker-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

/* ===== NOISE TEXTURE OVERLAY ===== */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

[data-theme="frost"] body::after { opacity: 0.015; }

/* Theme gradient backgrounds */
[data-theme="obsidian-gold"] body,
[data-theme="carbon-neon"] body,
[data-theme="deep-sea"] body,
[data-theme="slate-rose"] body,
[data-theme="glass"] body {
  background: var(--theme-gradient, var(--bg-base));
}

/* ===== SCROLLING TICKER ===== */
#global-ticker {
  overflow: hidden;
  white-space: nowrap;
  margin: -20px -24px 12px;
  padding: 5px 0;
  background: var(--ticker-bg, var(--bg-base));
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  position: relative;
  z-index: 2;
}

.ticker-track {
  display: inline-block;
  animation: ticker-scroll 40s linear infinite;
}

.ticker-item { padding: 0 14px; }
.ticker-sep { color: var(--text-muted); padding: 0 6px; }

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== PAGE TRANSITION ===== */
@keyframes pageColorWash {
  0% { opacity: 0.3; transform: scaleX(0); }
  50% { opacity: 0.15; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

.page-transition-wash {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 50;
  pointer-events: none;
  transform-origin: left;
  animation: pageColorWash 0.4s ease-out forwards;
}

.main-content.page-entering {
  animation: slideUp 0.35s ease both;
}

/* ===== HERO NUMBERS ===== */
.hero-equity {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-bright);
}

.gradient-text {
  color: var(--accent);
}

/* ===== CARD ENHANCEMENTS ===== */
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--card-radius);
  padding: 1px;
  background: linear-gradient(var(--border), var(--border));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover::before {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary, var(--accent)), transparent);
  opacity: 1;
}

.card-elevated {
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.04);
}

.card-holo {
  position: relative;
  overflow: hidden;
}

.card-holo::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255,255,255,0.03) 40%,
    rgba(255,200,200,0.04) 42%,
    rgba(200,255,200,0.04) 44%,
    rgba(200,200,255,0.04) 46%,
    rgba(255,255,255,0.03) 48%,
    transparent 58%
  );
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.card-holo:hover::after {
  transform: translateX(50%) rotate(45deg);
}

/* ===== ACCENT DIVIDERS ===== */
.accent-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
  margin: 20px 0;
}

/* ===== ASYMMETRIC HERO CARD ===== */
.hero-card-asymmetric {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.hero-card-asymmetric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ===== LOADING PULSE ===== */
@keyframes logoPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 16px;
}

.loading-state .logo {
  width: 48px;
  height: 24px;
  animation: logoPulse 1.5s ease infinite;
}

/* ===== GAUGE ARC ANIMATION ===== */
.gauge-arc-fill {
  transition: stroke-dashoffset 1s ease;
}

/* ===== PROGRESS RING ===== */
.progress-ring {
  display: inline-flex;
  position: relative;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ===== VU METER ===== */
.vu-meter {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}

.vu-bar {
  width: 4px;
  border-radius: 2px;
  transition: height 0.3s ease;
  min-height: 3px;
}

/* ===== MINI SPARKLINE ===== */
.mini-sparkline {
  display: inline-block;
  vertical-align: middle;
}

/* ===== COUNTDOWN DISPLAY ===== */
.countdown-display {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-bright);
  text-shadow: 0 0 20px var(--accent-glow);
  letter-spacing: 2px;
}

/* ===== DIRECTION ARROWS ===== */
.direction-long {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-weight: 700;
  font-size: 11px;
}

.direction-short {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--red);
  font-weight: 700;
  font-size: 11px;
}

/* ===== REGIME ICON CHIP ===== */
.regime-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.regime-chip:hover {
  border-color: currentColor;
  transform: scale(1.05);
}

/* ===== VISUAL P&L BAR ===== */
.pnl-visual-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  overflow: hidden;
  position: relative;
}

.pnl-visual-bar-fill {
  height: 100%;
  border-radius: 4px;
  position: absolute;
  top: 0;
  transition: width 0.6s ease;
}

.pnl-visual-bar-center {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: var(--text-muted);
  opacity: 0.5;
}

/* ===== PRICE RANGE SLIDER ===== */
.price-range {
  position: relative;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  margin: 8px 0;
}

.price-range-fill {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  top: 0;
}

.price-range-marker {
  position: absolute;
  top: -4px;
  width: 12px;
  height: 14px;
  border-radius: 7px;
  border: 2px solid;
  transform: translateX(-50%);
}

/* ===== SYSTEM STATUS CARD ===== */
.system-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.system-status-row:hover {
  background: var(--bg-card-hover);
}

.system-status-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-bright);
  min-width: 110px;
}

.system-status-metrics {
  display: flex;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.system-status-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.system-status-metric-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.system-status-metric-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

/* ===== THEME PREVIEW SWATCH ===== */
.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  margin: 0 auto 8px;
  border: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}

.theme-swatch.active {
  border-color: var(--text-bright);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: scale(1.1);
}

.theme-swatch-half-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
}

.theme-swatch-half-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
}

.theme-mini-preview {
  width: 100%;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

.theme-mini-preview-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  width: 20%;
  height: 100%;
}

.theme-mini-preview-content {
  position: absolute;
  left: 20%;
  top: 0;
  right: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
}

.theme-mini-preview-card {
  flex: 1;
  border-radius: 2px;
  opacity: 0.6;
}

/* ===== COLOR PRESET GRID ===== */
.color-preset-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.color-preset {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.color-preset:hover {
  transform: scale(1.15);
}

.color-preset.active {
  border-color: var(--text-bright);
  box-shadow: 0 0 8px currentColor;
}

/* ===== MODEL VS MARKET COMPARISON ===== */
.model-vs-market {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.projection-number {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
}

.projection-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.projection-vs {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .stat-grid-5, .stat-grid-6 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

@media (max-width: 768px) {
  /* Extend into status bar / notch area */
  html { background: var(--bg-base); }
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .sidebar { transform: translateX(-100%); position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000; width: 260px; transition: transform 0.3s ease; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999; }
  .sidebar-backdrop.visible { display: block; }
  .main-content { margin-left: 0; padding: 12px; padding-top: calc(env(safe-area-inset-top, 0px) + 12px); max-width: 100vw; }
  #global-ticker { display: none; }
  .stat-grid-4, .stat-grid-5, .stat-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; }
  .podium-card { order: unset !important; }
  .docker-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-equity { font-size: 36px; }

  /* Hamburger button */
  .hamburger-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 12px) + 8px);
    left: 12px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    color: #e2e8f0;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .hamburger-btn:active { background: rgba(0, 0, 0, 0.7); }

  /* Mobile bottom tab bar */
  .mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 4px calc(env(safe-area-inset-bottom, 8px) + 4px);
  }
  .mobile-tab-bar .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tab-bar .tab-item.active { color: var(--text-bright); }
  .mobile-tab-bar .tab-item .tab-dot { width: 6px; height: 6px; border-radius: 50%; margin-bottom: 2px; }
  .mobile-tab-bar .tab-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
}

/* ===== OVERVIEW MINI PREVIEWS ===== */
.mini-game-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 10px;
}

.mini-game-preview img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.mini-regime-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.mini-regime-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.8;
}

/* ============================================================
   EXTENDED COMPONENT STYLES
   ============================================================ */

/* ===== 1. CUSTOM DATE PICKER ===== */
.date-picker-wrapper {
  position: relative;
  display: inline-block;
}

.date-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
  min-width: 150px;
  justify-content: space-between;
}

.date-picker-trigger:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}

.date-picker-trigger.open {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.date-picker-trigger svg {
  opacity: 0.5;
  flex-shrink: 0;
}

.date-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-bright);
  border-radius: var(--card-radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.05) inset;
  padding: 16px;
  min-width: 280px;
  display: none;
  animation: slideDown 0.2s ease;
  opacity: 1;
}

.date-picker-dropdown.open {
  display: block;
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.date-picker-header .month-year {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.3px;
}

.date-picker-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 12px;
}

.date-picker-nav-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-bright);
}

.date-picker-nav-btn:active {
  transform: scale(0.92);
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.date-picker-grid .day-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0 8px;
}

.date-picker-day {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.date-picker-day:hover {
  background: var(--bg-elevated);
  color: var(--text-bright);
  border-color: var(--border);
}

.date-picker-day.today {
  color: var(--accent);
  font-weight: 700;
  border-color: var(--accent);
  background: var(--accent-glow);
}

.date-picker-day.selected {
  background: var(--accent);
  color: var(--accent-text, #fff);
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 10px var(--accent-glow);
}

.date-picker-day.in-range {
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 0;
}

.date-picker-day.in-range:first-child,
.date-picker-day.in-range.range-start {
  border-radius: 6px 0 0 6px;
}

.date-picker-day.in-range:last-child,
.date-picker-day.in-range.range-end {
  border-radius: 0 6px 6px 0;
}

.date-picker-day.other-month {
  color: var(--text-muted);
  opacity: 0.35;
}

.date-picker-day.other-month:hover {
  opacity: 0.6;
}

/* ===== 2. CHART CONTAINER FIX ===== */
.chart-container {
  min-height: 200px;
}

.chart-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== 3. SEGMENTED CONTROL / PILL FILTER ===== */
.segmented-control,
.pill-tab-bar {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.segmented-control-item,
.pill-tab-bar .tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: none;
  background: transparent;
  white-space: nowrap;
  position: relative;
}

.segmented-control-item:last-child,
.pill-tab-bar .tab:last-child {
  border-right: none;
}

.segmented-control-item:hover,
.pill-tab-bar .tab:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.segmented-control-item.active,
.pill-tab-bar .tab.active {
  background: var(--accent);
  color: var(--accent-text, #fff);
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-glow);
  border-right-color: transparent;
}

.segmented-control-item.active + .segmented-control-item,
.pill-tab-bar .tab.active + .tab {
  border-left-color: transparent;
}

/* ===== 4. SIDEBAR ACTIVE STATE — GEOMETRIC / ANGULAR ===== */
.nav-item {
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  opacity: 0;
  transition: all var(--transition);
  pointer-events: none;
  z-index: -1;
}

.nav-item:hover::before {
  background: radial-gradient(ellipse at left center, var(--accent-glow), transparent 70%);
  opacity: 0.5;
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent), transparent 85%);
  color: var(--text-bright);
  border-left: 4px solid var(--accent);
  border-radius: 0;
  padding-left: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 11px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
  box-shadow: none;
  position: relative;
}

.nav-item.active::before {
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.2;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 0 8px var(--accent);
}

.nav-item.active:hover {
  background: linear-gradient(90deg, var(--accent), transparent 90%);
}

/* ===== 5. CARD SHAPE OPTIONS ===== */
[data-card-style="sharp"] {
  --card-radius: 2px;
  --card-opacity: 0.9;
  --card-blur: 8px;
  --card-border-style: 1px solid var(--border-bright);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-card-style="pill"] {
  --card-radius: 24px;
  --card-opacity: 0.65;
  --card-blur: 16px;
  --card-border-style: 1px solid var(--border);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-card-style="glass"] {
  --card-radius: 16px;
  --card-opacity: 0.3;
  --card-blur: 24px;
  --card-border-style: 1px solid rgba(255, 255, 255, 0.06);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-card-style="beveled"] {
  --card-radius: 0;
  --card-opacity: 0.85;
  --card-blur: 8px;
  --card-border-style: 1px solid var(--border-bright);
  --card-shadow: 2px 2px 0 var(--border), -1px -1px 0 rgba(255,255,255,0.03);
}

/* Beveled cut-corner effect */
[data-card-style="beveled"] .card,
[data-card-style="beveled"] .stat-card,
[data-card-style="beveled"] .game-card,
[data-card-style="beveled"] .position-card,
[data-card-style="beveled"] .project-overview-card {
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

/* ===== 6. CUSTOM THEME EDITOR ===== */
.theme-editor {
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  border: var(--card-border-style);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theme-editor .section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.color-picker-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.color-picker-custom:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}

.color-picker-custom .color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-picker-custom .color-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
}

.color-picker-custom .color-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.color-picker-hue-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    hsl(0, 100%, 50%),
    hsl(30, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(90, 100%, 50%),
    hsl(120, 100%, 50%),
    hsl(150, 100%, 50%),
    hsl(180, 100%, 50%),
    hsl(210, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(270, 100%, 50%),
    hsl(300, 100%, 50%),
    hsl(330, 100%, 50%),
    hsl(360, 100%, 50%)
  );
  outline: none;
  cursor: pointer;
  border: 1px solid var(--border);
}

.color-picker-hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: grab;
}

.color-picker-hue-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

.color-picker-hue-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: grab;
}

/* ===== 7. MULTI-SELECT DROPDOWN ===== */
.multi-select-dropdown {
  position: relative;
  display: inline-block;
}

.multi-select-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--card-blur));
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 160px;
  justify-content: space-between;
}

.multi-select-header:hover {
  border-color: var(--border-bright);
}

.multi-select-header.open {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.multi-select-header .selected-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-text, #fff);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.multi-select-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  padding: 6px;
  opacity: 1;
}

.multi-select-panel.open {
  display: block;
  animation: slideDown 0.15s ease;
}

.multi-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 11px;
  color: var(--text-secondary);
}

.multi-select-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.multi-select-item.selected {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.multi-select-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-bright);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  background: transparent;
}

.multi-select-item.selected .multi-select-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.multi-select-item.selected .multi-select-checkbox::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.multi-select-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.multi-select-actions button {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.multi-select-actions button:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ===== 8. PAGINATION COMPONENT ===== */
.pagination-component {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
}

.pagination-info {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.pagination-info .highlight {
  color: var(--text-primary);
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.pagination-controls button:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.pagination-controls button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text, #fff);
  font-weight: 700;
  box-shadow: 0 0 10px var(--accent-glow);
}

.pagination-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-controls .page-ellipsis {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 0 4px;
  user-select: none;
}

.page-size-select {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.page-size-select select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.page-size-select select:focus {
  border-color: var(--accent);
}

/* ===== 9. CUSTOM COLOR PICKER (NON-NATIVE) ===== */
.styled-color-picker {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 10;
}

.color-picker-gradient {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  position: relative;
  cursor: crosshair;
  overflow: hidden;
  border: 1px solid var(--border);
}

.color-picker-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #fff, transparent);
}

.color-picker-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, #000);
}

.color-picker-hue {
  width: 100%;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(
    to right,
    hsl(0, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(120, 100%, 50%),
    hsl(180, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(300, 100%, 50%),
    hsl(360, 100%, 50%)
  );
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
}

.color-picker-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.15);
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: grab;
  pointer-events: none;
  z-index: 5;
}

.color-picker-thumb:active {
  cursor: grabbing;
}

.color-picker-thumb.hue-thumb {
  top: 50%;
  width: 14px;
  height: 20px;
  border-radius: 4px;
}

/* ===== DROPDOWN SOLID BACKGROUNDS (no parent opacity inheritance) ===== */
.custom-dropdown-panel,
.date-picker-dropdown,
.multi-select-panel,
.color-picker-panel {
  opacity: 1 !important;
  isolation: isolate;
  z-index: 9999 !important;
  position: absolute;
}

/* ===== 10. DATE PICKER OVERLAY / BACKDROP ===== */
.date-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.date-picker-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===== PREMIUM PROGRESS BAR ANIMATIONS ===== */
@keyframes progressGlow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.2); }
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.premium-progress {
  transition: all 0.3s ease;
}

.premium-progress:hover .premium-progress-fill {
  filter: brightness(1.3);
}

/* ===== SORTABLE TABLE HEADER INDICATORS ===== */
th {
  position: relative;
}

th .sort-arrow {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  opacity: 0.5;
  vertical-align: middle;
  transition: opacity var(--transition);
}

th.sorted .sort-arrow {
  opacity: 1;
  color: var(--accent);
}

th:hover .sort-arrow {
  opacity: 0.8;
}

/* Sort hover hint */
th:not(.sorted):hover::after {
  content: '↕';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ===== MARKETS TAB CONTAINER ===== */
.markets-tab-content {
  animation: slideUp 0.3s ease both;
}

/* ===== BACKGROUND PATTERNS ===== */
body.pattern-grid {
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

body.pattern-dots {
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}

body.pattern-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

body.pattern-circuit {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 2px, transparent 2px),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}

/* Pattern previews in settings */
.pattern-preview-none { background: var(--bg-base) !important; }
.pattern-preview-grid {
  background-image: linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px) !important;
  background-size: 10px 10px !important;
}
.pattern-preview-dots {
  background-image: radial-gradient(circle, rgba(255,255,255,0.15) 1px, transparent 1px) !important;
  background-size: 6px 6px !important;
}
.pattern-preview-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E") !important;
  background-size: 100px 100px !important;
}
.pattern-preview-circuit {
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) !important;
  background-size: 24px 24px, 24px 24px, 6px 6px, 6px 6px !important;
}

/* Pattern option active state */
.pattern-option-btn.active {
  border-color: var(--accent) !important;
}

/* ===== CARD TEXTURE OVERLAYS ===== */
[data-card-texture="grain"] .card::after,
[data-card-texture="grain"] .stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  mix-blend-mode: overlay;
}

[data-card-texture="linen"] .card::after,
[data-card-texture="linen"] .stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px);
  background-size: 4px 4px;
  mix-blend-mode: overlay;
}

[data-card-texture="brushed"] .card::after,
[data-card-texture="brushed"] .stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,0.06) 1px, rgba(255,255,255,0.06) 2px);
  background-size: 3px 100%;
  mix-blend-mode: overlay;
}

[data-card-texture="frosted"] .card::after,
[data-card-texture="frosted"] .stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.02' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: soft-light;
}

/* Texture option active state */
.texture-option-btn.active {
  border-color: var(--accent) !important;
}

/* Chart hover tooltips */
.chart-hover-point { cursor: crosshair; }
.chart-hover-point:hover + .chart-hover-dot { opacity: 1 !important; }
.chart-tooltip {
  position: fixed; pointer-events: none; z-index: 9999;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-primary); box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  white-space: nowrap; transition: opacity 0.1s;
}

/* Clickable table rows */
tr.clickable-row:hover { background: var(--bg-elevated, rgba(255,255,255,0.03)) !important; }
tr.clickable-row:active { background: var(--bg-elevated, rgba(255,255,255,0.06)) !important; }


/* Spinner */
.spinner { display:inline-block;width:16px;height:16px;border:2px solid var(--text-muted);border-top-color:var(--accent);border-radius:50%;animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

