/* ============================================================
   FX Monitor — portal.css
   Unified design system · v1.0
   Sections:
     1.  Design Tokens (CSS variables)
     2.  Base & Reset
     3.  Layout (topnav, megamenu, breadcrumb, main)
     4.  User Menu & Theme Toggle
     5.  More Menu (kebab / overflow)
     6.  Card Shell
     7.  Buttons & Icon Buttons
     8.  Chips & Badges
     9.  Status Bar
    10.  KPI Strip
    11.  Account Header Card
    12.  Tabs Row (universal: ta-card / anal-card / eff-card)
    13.  Trading Table (tt)
    14.  Analytics Panel (monthly matrix, charts)
    15.  Advanced Stats (collapsible sections)
    16.  Trade Efficiency
    17.  Symbol Chart Modal
    18.  Forms & Settings fields
    19.  Strategies: BT/FW tokens + sstat-pair + verdict
    20.  Animations & Utilities
    21.  Responsive
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
  /* ── Surfaces ── */
  --bg:           #fbfbfa;
  --surface:      #ffffff;
  --surface-2:    #f5f4f1;
  --surface-3:    #eeede9;

  /* ── Borders ── */
  --border:       rgba(17, 24, 28, 0.08);
  --border-str:   rgba(17, 24, 28, 0.14);

  /* ── Text ── */
  --text:         #0e1116;
  --muted:        #6b6e76;
  --dim:          #9ca0a8;
  --very-dim:     #c5c7cd;

  /* ── Brand accent (indigo) ── */
  --accent:       #5e6ad2;
  --accent-dk:    #4c56bd;
  --accent-lt:    #7c5cff;
  --accent-sft:   #eeeffb;
  --accent-strong: rgba(94, 106, 210, 0.28);

  /* ── Semantic ── */
  --pos:          #067a57;  --pos-sft:   #e7f6f0;
  --neg:          #b42318;  --neg-sft:   #fdecea;
  --amber:        #b45309;  --amber-sft: #fef3c7;
  --blue:         #0ea5e9;  --blue-sft:  rgba(14, 165, 233, 0.10);
  --sky:          #0ea5e9;  --sky-sft:   rgba(14, 165, 233, 0.10);
  --gold:         #b45309;  --gold-sft:  rgba(180, 83, 9, 0.10);

  /* ── Multi-series palette (for portfolio / summary charts) ── */
  --a1: #5e6ad2;
  --a2: #0ea5e9;
  --a3: #f59e0b;
  --a4: #ec4899;
  --a5: #10b981;
  --a6: #8b5cf6;

  /* ── Strategies: BT vs FW ── */
  --bt-color:     #7c84ff;  --bt-sft:  rgba(124, 132, 255, 0.13);
  --fw-color:     #22c55e;  --fw-sft:  rgba(34,  197,  94, 0.13);
  --bt-fill:      rgba(124, 132, 255, 0.04);

  /* ── Chart tokens ── */
  --chart-grid:          rgba(17, 24, 28, 0.05);
  --chart-tick:          #8a8a93;
  --chart-pos:           #067a57;
  --chart-pos-sft-0:     rgba(6, 122, 87, 0.22);
  --chart-pos-sft-1:     rgba(6, 122, 87, 0);
  --chart-neg:           #b42318;
  --chart-neg-sft-0:     rgba(180, 35, 24, 0.18);
  --chart-neg-sft-1:     rgba(180, 35, 24, 0);
  --chart-accent:        #5e6ad2;
  --chart-point-border:  #ffffff;

  /* ── Topnav ── */
  --topnav-bg:    rgba(251, 251, 250, 0.78);

  /* ── Shadows ── */
  --shadow-popover: 0 8px 28px rgba(17, 24, 28, 0.12), 0 1px 2px rgba(17, 24, 28, 0.06);
  --shadow-modal:   0 40px 80px rgba(17, 24, 28, 0.18), 0 2px 4px rgba(17, 24, 28, 0.06);

  /* ── Avatars ── */
  --orange-grad-from: #f6b17a;
  --orange-grad-to:   #e08e5a;

  /* ── Stagnation zone (strategies equity chart) ── */
  --stag-color:   #b45309;
  --stag-sft:     rgba(180, 83, 9, 0.10);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:           #0a0a0c;
  --surface:      #131317;
  --surface-2:    #1c1c21;
  --surface-3:    #25252c;

  --border:       rgba(255, 255, 255, 0.06);
  --border-str:   rgba(255, 255, 255, 0.12);

  --text:         #ededef;
  --muted:        #8a8a93;
  --dim:          #5d5d66;
  --very-dim:     #3d3d44;

  --accent:       #7c84ff;
  --accent-dk:    #a18bff;
  --accent-lt:    #a18bff;
  --accent-sft:   rgba(124, 132, 255, 0.13);
  --accent-strong: rgba(124, 132, 255, 0.28);

  --pos:          #22c55e;  --pos-sft:   rgba(34, 197, 94, 0.14);
  --neg:          #ef4444;  --neg-sft:   rgba(239, 68, 68, 0.14);
  --amber:        #f59e0b;  --amber-sft: rgba(245, 158, 11, 0.13);
  --blue:         #38bdf8;  --blue-sft:  rgba(56, 189, 248, 0.12);
  --sky:          #38bdf8;  --sky-sft:   rgba(56, 189, 248, 0.12);
  --gold:         #fbbf24;  --gold-sft:  rgba(251, 191, 36, 0.13);

  --a1: #7c84ff;
  --a2: #38bdf8;
  --a3: #fbbf24;
  --a4: #f472b6;
  --a5: #34d399;
  --a6: #a78bfa;

  --bt-color:     #7c84ff;  --bt-sft:  rgba(124, 132, 255, 0.16);
  --fw-color:     #22c55e;  --fw-sft:  rgba(34,  197,  94, 0.16);
  --bt-fill:      rgba(124, 132, 255, 0.06);

  --chart-grid:          rgba(255, 255, 255, 0.07);
  --chart-tick:          #8a8a93;
  --chart-pos:           #22c55e;
  --chart-pos-sft-0:     rgba(34, 197, 94, 0.28);
  --chart-pos-sft-1:     rgba(34, 197, 94, 0);
  --chart-neg:           #ef4444;
  --chart-neg-sft-0:     rgba(239, 68, 68, 0.22);
  --chart-neg-sft-1:     rgba(239, 68, 68, 0);
  --chart-accent:        #7c84ff;
  --chart-point-border:  #0a0a0c;

  --topnav-bg:    rgba(10, 10, 12, 0.72);

  --shadow-popover: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-modal:   0 40px 120px rgba(0, 0, 0, 0.8);

  color-scheme: dark;
}

/* Remove number input spinners globally */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

/* ============================================================
   2. BASE & RESET
   ============================================================ */

/* Smooth theme transitions */
.topnav, .card, .acc-card, .pf-card, .stat-card, .megamenu,
.user-menu, .modal-bg .modal, .modal-overlay .modal-inner,
.btn-ghost, .btn-icon-nav, .btn-icon, .searchbox,
.acc-list-row, .pf-list-row, .more-menu {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
html { transition: color 180ms ease; }
body { transition: background-color 180ms ease; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button  { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Utility classes ── */
.num   { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pos   { color: var(--pos);     font-family: 'Geist Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    letter-spacing: -0.01em; }
.neg   { color: var(--neg); font-family: 'Geist Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    letter-spacing: -0.01em;}
.warn  { color: var(--amber); font-family: 'Geist Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    letter-spacing: -0.01em;}
.good  { color: var(--pos); }
.muted { color: var(--muted); }
.dim   { color: var(--dim); }
.muted-sm { color: var(--muted); font-size: 12px; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }


/* ============================================================
   3. LAYOUT — TOPNAV, MEGAMENU, BREADCRUMB, MAIN
   ============================================================ */

/* ── Top navigation bar ── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--topnav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 28px;
  max-width: 1600px; margin: 0 auto;
}

/* Brand */
.brand-row {
  display: flex; align-items: center; gap: 9px;
  padding-right: 14px; margin-right: 6px;
  border-right: 1px solid var(--border);
}
.brand-logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-lt));
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px;
  box-shadow: 0 0 18px rgba(124, 132, 255, 0.25);
}
.brand-name { font-weight: 600; font-size: 14px; }

/* Nav items */
.nav-main { display: flex; gap: 1px; position: relative; }
.nav-trig {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 7px;
  font-size: 13px; color: var(--muted);
  transition: all 140ms; position: relative;
}
.nav-trig:hover { background: var(--surface-2); color: var(--text); }
.nav-trig.active { color: var(--text); font-weight: 500; }
.nav-trig.active::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: -11px;
  height: 2px; background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.nav-trig.open { background: var(--surface-2); color: var(--text); }
.nav-trig [data-lucide] { width: 14px; height: 14px; color: var(--muted); }
.nav-trig.active [data-lucide] { color: var(--accent); }
.nav-trig .chev { width: 11px !important; height: 11px !important; transition: transform 200ms; }
.nav-trig.open .chev { transform: rotate(180deg); }

/* Simple nav-item (pages without megamenu) */
.nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 7px;
  font-size: 13px; color: var(--muted);
  transition: all 120ms;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  color: var(--text); font-weight: 500;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}
.nav-item [data-lucide] { width: 14px; height: 14px; color: var(--muted); }
.nav-item.active [data-lucide] { color: var(--accent); }

.nav-spacer { flex: 1; }

/* Search box */
.searchbox {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; color: var(--muted); min-width: 220px;
  cursor: pointer;
}
.searchbox .placeholder { flex: 1; }
.searchbox [data-lucide] { width: 13px; height: 13px; }
.kbd {
  font-family: 'Geist Mono', monospace; font-size: 10px;
  padding: 2px 5px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; color: var(--muted);
}

/* Notification bell */
.btn-icon-nav {
  padding: 7px; border-radius: 7px; color: var(--muted);
  display: grid; place-items: center; transition: all 120ms;
}
.btn-icon-nav:hover { background: var(--surface-2); color: var(--text); }
.btn-icon-nav [data-lucide] { width: 16px; height: 16px; }

/* Avatar button */
.avatar-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-grad-from), var(--orange-grad-to));
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 12px;
  cursor: pointer; border: none;
  transition: box-shadow 140ms;
}
.avatar-btn:hover { box-shadow: 0 0 0 3px var(--accent-sft); }

/* ── Megamenu ── */
.megamenu {
  position: absolute; top: 100%; left: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border-str);
  border-radius: 12px;
  box-shadow: var(--shadow-popover);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  z-index: 99;
}
.megamenu.open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 0s;
}
.mm-header {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 16px 8px;
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.mm-header [data-lucide] { width: 11px; height: 11px; }
.mm-grid { padding: 10px; display: grid; gap: 4px; }
.mm-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.mm-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  transition: background 120ms; cursor: pointer; text-align: left;
}
.mm-item:hover { background: var(--surface-2); }
.mm-item-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--border); transition: all 140ms;
}
.mm-item:hover .mm-item-icon {
  background: var(--accent-sft); color: var(--accent);
  border-color: var(--accent-strong);
}
.mm-item-icon [data-lucide] { width: 14px; height: 14px; }
.mm-item-body { flex: 1; min-width: 0; }
.mm-item-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.25; }
.mm-item-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.mm-accounts  { min-width: 440px; }
.mm-analytics { min-width: 500px; }
.mm-strategies { width: 480px; }
.mm-more       { width: 300px; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 28px;
  max-width: 1600px; margin: 0 auto;
  font-size: 12.5px; color: var(--muted);
}
.breadcrumb a { color: var(--muted); transition: color 120ms; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [data-lucide] { width: 12px; height: 12px; color: var(--dim); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ── Main page wrapper ── */
main {
  padding: 20px 28px 80px;
  max-width: 1600px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
}

/* Section label (grey divider with text) */
.sec-lbl {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  padding: 6px 0; margin-top: 4px;
}
.sec-lbl [data-lucide] { width: 11px; height: 11px; }
.sec-lbl::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border); margin-left: 4px;
}


/* ============================================================
   4. USER MENU & THEME TOGGLE
   ============================================================ */

.user-wrap { position: relative; }

.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 280px;
  background: var(--surface); border: 1px solid var(--border-str); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(17, 24, 28, 0.12), 0 1px 2px rgba(17, 24, 28, 0.06);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
  z-index: 110; overflow: hidden;
}
:root[data-theme="dark"] .user-menu {
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02);
}
.user-menu.open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 0s;
}

.user-menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px; border-bottom: 1px solid var(--border);
}
.user-menu-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-grad-from), var(--orange-grad-to));
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.user-menu-info { flex: 1; min-width: 0; }
.user-menu-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.user-menu-email { font-size: 11px; color: var(--muted); font-family: 'Geist Mono', monospace; margin-top: 2px; }

.user-menu-section { padding: 5px 6px; border-bottom: 1px solid var(--border); }
.user-menu-section:last-child { border-bottom: none; }
.user-menu-prefs { padding: 10px; }

.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 12.5px; color: var(--text);
  cursor: pointer; transition: background 100ms;
}
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item [data-lucide] { width: 14px; height: 14px; color: var(--muted); }
.user-menu-item.danger { color: var(--neg); }
.user-menu-item.danger [data-lucide] { color: var(--neg); }
.user-menu-item.danger:hover { background: var(--neg-sft); }

.user-menu-pref-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 4px;
}
.user-menu-pref-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text);
}
.user-menu-pref-label [data-lucide] { width: 13px; height: 13px; color: var(--muted); }

/* Theme toggle (sun / moon / system) */
.theme-toggle {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px; gap: 1px;
}
.theme-toggle button {
  width: 26px; height: 24px; display: grid; place-items: center;
  background: transparent; color: var(--muted);
  border-radius: 4px; transition: all 140ms;
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button.active {
  background: var(--surface); color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 0.5px var(--border);
}
.theme-toggle button [data-lucide] { width: 13px !important; height: 13px !important; }


/* ============================================================
   5. MORE MENU (kebab / overflow dropdown)
   ============================================================ */

.icon-btn {
  position: relative;
  width: 34px; height: 34px; border-radius: 7px;
  background: transparent; border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--muted); transition: all 120ms;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-str); color: var(--text); }
.icon-btn [data-lucide] { width: 14px; height: 14px; }

.more-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 200px;
  background: var(--surface); border: 1px solid var(--border-str);
  border-radius: 10px; box-shadow: var(--shadow-popover);
  padding: 4px; z-index: 100;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}
.more-menu.open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 0s;
}
.more-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-size: 12.5px; color: var(--text);
  text-decoration: none; transition: background 100ms;
}
.more-item:hover { background: var(--surface-2); }
.more-item [data-lucide] { width: 13px; height: 13px; color: var(--muted); }
.more-item.danger { color: var(--neg); }
.more-item.danger [data-lucide] { color: var(--neg); }
.more-item.danger:hover { background: var(--neg-sft); }
.more-sep { height: 1px; background: var(--border); margin: 4px 6px; }


/* ============================================================
   6. CARD SHELL
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.card-title { font-size: 13.5px; font-weight: 500; }
.card-title-meta { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-sub   { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-head-actions {
  margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

/* Collapsible card */
.card.collapsible .card-head { cursor: pointer; user-select: none; }
.card-collapse-chev {
  display: grid; place-items: center;
  width: 22px; height: 22px; color: var(--muted);
  transition: transform 200ms, color 120ms;
}
.card-collapse-chev.open { transform: rotate(180deg); color: var(--accent); }
.card-collapse-chev [data-lucide] { width: 14px; height: 14px; }
.card-body { padding: 16px 18px; }
.card-body.collapsed { display: none; }

/* Chart wrapper inside card */
.chart-wrap {
  position: relative; padding: 14px 18px 16px; height: 340px;
}

/* Legend toggle items */
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text);
  padding: 3px 8px; border-radius: 5px;
  cursor: pointer; transition: opacity 120ms;
}
.legend-item:hover { background: var(--surface-2); }
.legend-item.off { opacity: 0.35; }
.legend-item .sw { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-item.balance .sw { background: var(--pos); }
.legend-item.equity  .sw { background: var(--blue); }

/* Segment button group */
.seg-btn-group {
  display: flex; background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px; padding: 2px;
}
.seg-btn-group button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 5px;
  font-size: 12px; color: var(--muted); font-weight: 500; transition: all 120ms;
}
.seg-btn-group button.active { background: var(--surface-2); color: var(--text); }
.seg-btn-group button [data-lucide] { width: 11px; height: 11px; }
.seg-divider { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }


/* ============================================================
   7. BUTTONS & ICON BUTTONS
   ============================================================ */

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: white;
  border: none; padding: 7px 13px; border-radius: 7px;
  font-size: 13px; font-weight: 500; transition: background 120ms;
}
.btn-primary:hover { background: var(--accent-dk); }
.btn-primary [data-lucide] { width: 13px; height: 13px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 7px;
  font-size: 13px; color: var(--text); transition: all 120ms;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-str); }
.btn-ghost [data-lucide] { width: 13px; height: 13px; color: var(--muted); }
/* AI variant */
.btn-ghost.ai {
  background: linear-gradient(135deg, var(--accent), var(--accent-lt));
  color: white; border-color: transparent;
  box-shadow: 0 1px 3px rgba(94, 106, 210, 0.2);
}
.btn-ghost.ai:hover { filter: brightness(1.06); }
.btn-ghost.ai [data-lucide] { color: white; }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--neg); color: white;
  border: none; padding: 7px 13px; border-radius: 7px;
  font-size: 13px; font-weight: 500; transition: filter 120ms;
}
.btn-danger:hover { filter: brightness(1.08); }

.btn-danger-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--neg);
  padding: 7px 12px; border-radius: 7px;
  font-size: 13px; color: var(--neg); transition: all 120ms;
}
.btn-danger-outline:hover { background: var(--neg-sft); }


/* ============================================================
   8. CHIPS & BADGES
   ============================================================ */

/* Side chip (BUY / SELL) */
.side-chip {
  display: inline-block;
  font-size: 10.5px; font-weight: 500;
  padding: 1px 6px; border-radius: 3px;
  font-family: 'Geist', sans-serif;
  letter-spacing: 0.03em;
}
.side-chip.buy  { background: var(--pos-sft); color: var(--pos); }
.side-chip.sell { background: var(--neg-sft); color: var(--neg); }

/* Source chip (BT / LIVE) */
.src-chip {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  font-family: 'Geist Mono', monospace;
}
.src-chip.bt { background: var(--bt-sft); color: var(--bt-color); }
.src-chip.fw { background: var(--fw-sft); color: var(--fw-color); }

/* Account tags */
.acc-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.acc-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  font-family: 'Geist Mono', monospace;
}
.acc-tag.real     { background: var(--pos-sft);    color: var(--pos); }
.acc-tag.demo     { background: var(--amber-sft);   color: var(--amber); }
.acc-tag.contest  { background: var(--accent-sft);  color: var(--accent-dk); }
.acc-tag.cent     { background: var(--amber-sft);   color: var(--amber); }
.acc-tag.leverage { background: var(--surface-2);   color: var(--muted); }
.acc-tag.currency { background: var(--blue-sft);    color: var(--blue); }
.acc-tag.public   { background: var(--accent-sft);  color: var(--accent-dk); }
.acc-tag.offline  { background: var(--surface-2);   color: var(--muted); }
.acc-tag.live     { background: var(--pos-sft);     color: var(--pos); }
.acc-tag.live::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--pos); animation: livePulse 2s ease-in-out infinite;
}

/* Generic chip */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; border: 1px solid transparent;
}

/* Acc dot (colored dot for account identification) */
.acc-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}

/* Live dot (pulsing) */
.live-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos); margin-left: 4px;
  animation: livePulse 1.8s ease-in-out infinite;
  vertical-align: 2px;
}

/* Filter chip */
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; color: var(--muted); cursor: pointer;
  transition: all 120ms;
}
.filter-chip:hover { border-color: var(--border-str); color: var(--text); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-sft); }
.filter-chip [data-lucide] { width: 12px; height: 12px; }


/* ============================================================
   9. STATUS BAR
   ============================================================ */

.status-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  font-size: 12px;
}
.status-bar .s-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pos); box-shadow: 0 0 0 3px rgba(6, 122, 87, 0.14);
  flex-shrink: 0;
}
.status-bar .s-dot.off { background: var(--dim); box-shadow: none; }
.status-bar .s-txt { color: var(--text); font-weight: 500; }
.status-bar .s-sep { width: 1px; height: 12px; background: var(--border); }
.status-bar .s-meta { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.status-bar .s-meta [data-lucide] { width: 12px; height: 12px; color: var(--dim); }
.status-bar .s-right {
  margin-left: auto; font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--muted);
}


/* ============================================================
   10. KPI STRIP
   ============================================================ */

.kpi-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.kpi {
  padding: 16px 20px; border-right: 1px solid var(--border); position: relative;
}
.kpi:last-child { border-right: none; }
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.kpi.balance::before { background: var(--pos); }
.kpi.equity::before  { background: var(--blue); }
.kpi.pnl::before     { background: var(--accent); }
.kpi.rf::before      { background: var(--amber); }
.kpi.dd::before      { background: var(--neg); }

.kpi-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
  margin-bottom: 8px;
}
.kpi-label [data-lucide] { width: 12px; height: 12px; color: var(--dim); }
.kpi-value {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
}
.kpi-value.pos  { color: var(--pos); }
.kpi-value.neg  { color: var(--neg); }
.kpi-value.warn { color: var(--amber); }
.kpi-sub {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  font-family: 'Geist Mono', monospace;
}
.kpi-sub .hl { color: var(--text); font-weight: 500; }
.kpi-sub .hl.warn { color: var(--amber); }
.kpi-converted { font-size: 11px; color: var(--dim); margin-top: 2px; font-family: 'Geist Mono', monospace; }

/* BT/FW pair variant (strategies-dashboard) */
.kpi-pair { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.kpi-pair-slot {
  display: flex; align-items: baseline; gap: 6px;
}
.kpi-pair-slot .kpi-value { font-size: 16px; }
.kpi-pair-slot .tag {
  font-size: 8.5px; font-weight: 600; letter-spacing: 0.05em;
  padding: 1px 4px; border-radius: 3px;
  font-family: 'Geist Mono', monospace;
}
.kpi-pair-slot.bt .tag { background: var(--bt-sft); color: var(--bt-color); }
.kpi-pair-slot.fw .tag { background: var(--fw-sft); color: var(--fw-color); }


/* ============================================================
   11. ACCOUNT HEADER CARD
   ============================================================ */

.acc-header {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 22px; display: flex; align-items: flex-start; gap: 16px;
}
.acc-avatar {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-lt));
  color: white; display: grid; place-items: center; flex-shrink: 0;
  font-family: 'Geist Mono', monospace; font-weight: 600; font-size: 18px;
  position: relative;
}
.acc-avatar .acc-online-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--pos); border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--pos-sft);
}
.acc-avatar .acc-online-dot.off { background: var(--dim); }
.acc-info { flex: 1; min-width: 0; }
.acc-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.acc-title { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.acc-login-num { font-family: 'Geist Mono', monospace; font-size: 14px; color: var(--muted); font-weight: 400; }
.acc-sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.acc-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Account switcher dropdown */
.acc-switcher { position: relative; display: flex; align-items: center; }
.acc-switcher-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px 7px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; color: var(--text); transition: all 120ms;
}
.acc-switcher-btn:hover { background: var(--surface-2); border-color: var(--border-str); }
.acc-switcher-chev { width: 12px !important; height: 12px !important; transition: transform 200ms; color: var(--muted); }
.acc-switcher-btn.open .acc-switcher-chev { transform: rotate(180deg); color: var(--accent); }

.acc-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 320px; background: var(--surface);
  border: 1px solid var(--border-str); border-radius: 10px;
  box-shadow: var(--shadow-popover); z-index: 50; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}
.acc-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 0s;
}
.acc-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; transition: background 100ms;
}
.acc-dropdown-item:hover { background: var(--surface-2); }
.acc-drop-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.acc-drop-name { font-size: 13px; font-weight: 500; }
.acc-drop-info { font-size: 11px; color: var(--muted); font-family: 'Geist Mono', monospace; }
.acc-drop-bal  { margin-left: auto; font-family: 'Geist Mono', monospace; font-size: 12px; }
.acc-drop-meta { font-size: 11px; color: var(--muted); }


/* ============================================================
   12. TABS ROW — universal for ta-card / anal-card / eff-card
   ============================================================ */

.tabs-row {
  display: flex; align-items: center; gap: 4px;
  padding: 0 16px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; overflow-x: auto; scrollbar-width: none;
}
.tabs-row::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 14px; font-size: 12.5px; color: var(--muted); font-weight: 500;
  position: relative; transition: color 120ms;
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.tab-btn .count {
  font-family: 'Geist Mono', monospace; font-size: 10.5px;
  padding: 1px 5px; background: var(--surface-2); border-radius: 3px; color: var(--muted);
}
.tab-btn.active .count { background: var(--accent-sft); color: var(--accent); }

.tabs-right { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 0; }

/* Panels */
.ta-panel   { display: none; }
.ta-panel.active   { display: block; }
.anal-panel { display: none; }
.anal-panel.active { display: block; }
.eff-panel  { display: none; }
.eff-panel.active  { display: block; }

/* Unit toggle (% / $) */
.unit-toggle {
  display: flex; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px;
}
.unit-toggle button {
  padding: 3px 11px; border-radius: 4px;
  font-family: 'Geist Mono', monospace; font-size: 11px;
  color: var(--muted); font-weight: 600; transition: all 140ms;
  background: transparent; border: none; cursor: pointer;
}
.unit-toggle button:hover { color: var(--text); }
.unit-toggle button.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 0.5px var(--border);
}

/* Mini select inside tabs-right */
.mini-select {
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; color: var(--text);
  font-family: 'Geist', sans-serif;
}


/* ============================================================
   13. TRADING TABLE (tt)
   ============================================================ */

.trades-scroll { overflow-x: auto; max-height: 520px; overflow-y: auto; }

.tt {
  width: 100%; font-size: 11.5px;
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  border-collapse: collapse;
}
.tt thead th {
  padding: 8px 10px; text-align: right;
  font-size: 9.5px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-family: 'Geist', sans-serif;
  background: var(--bg); position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  cursor: default; user-select: none;
}
.tt thead th:first-child { text-align: left; padding-left: 16px; }
.tt thead th.th-left { text-align: left; }

/* Sortable column headers */
.tt thead th.sortable { cursor: pointer; transition: color 120ms; }
.tt thead th.sortable:hover { color: var(--text); }
.tt thead th.sortable::after {
  content: '↕'; margin-left: 5px; font-size: 10px;
  font-family: 'Geist Mono', monospace; color: var(--very-dim); transition: color 120ms;
}
.tt thead th.sortable:hover::after { color: var(--muted); }
.tt thead th.sortable.sort-desc,
.tt thead th.sortable.sort-asc  { color: var(--accent); }
.tt thead th.sortable.sort-desc::after { content: '↓'; color: var(--accent); }
.tt thead th.sortable.sort-asc::after  { content: '↑'; color: var(--accent); }

/* Table body */
.tt tbody td {
  padding: 7px 10px; text-align: right;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tt tbody tr:last-child td { border-bottom: none; }
.tt tbody tr:hover { background: var(--surface-2); }
.tt tbody td:first-child { padding-left: 16px; text-align: left; color: var(--muted); }
.tt thead th.th-left + td { text-align: left; }

/* Sym cell (clickable → opens symbol chart modal) */
.tt .sym-cell {
  font-family: 'Geist', sans-serif; font-weight: 500;
  color: var(--text); text-align: left; cursor: pointer; transition: color 120ms;
}
.tt .sym-cell:hover { color: var(--accent); }

/* Side & source chips inside table */
.tt .side-chip { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.03em; }
.tt .side-chip.buy  { background: var(--pos-sft); color: var(--pos); }
.tt .side-chip.sell { background: var(--neg-sft); color: var(--neg); }
.tt .src-chip  { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 9px; font-weight: 600; letter-spacing: 0.04em; font-family: 'Geist Mono', monospace; }
.tt .src-chip.bt { background: var(--bt-sft);  color: var(--bt-color); }
.tt .src-chip.fw { background: var(--fw-sft);  color: var(--fw-color); }

/* Order chip (pending) */
.tt .order-chip {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  background: var(--amber-sft); color: var(--amber);
}

/* Table footer / totals */
.tt tfoot tr.tt-totals td {
  padding: 10px; border-top: 2px solid var(--border-str);
  background: var(--bg); text-align: right;
  font-weight: 500; font-family: 'Geist Mono', monospace;
  white-space: nowrap; color: var(--text);
  position: sticky; bottom: 0; z-index: 1;
}
.tt tfoot tr.tt-totals td:first-child,
.tt tfoot tr.tt-totals td.totals-label {
  padding-left: 16px; text-align: right;
  font-family: 'Geist', sans-serif; font-weight: 600;
}

/* Deprecated / withdrawal row highlight */
.dep-row td { background: rgba(180, 83, 9, 0.04) !important; color: var(--amber) !important; font-style: italic; }

/* BT divider row (strategies history) */
.divider-row td {
  padding: 5px 14px !important;
  background: var(--bt-fill) !important;
  border-top: 1px solid rgba(180, 83, 9, 0.2);
  border-bottom: 1px solid rgba(180, 83, 9, 0.2);
  font-family: 'Geist', sans-serif; font-size: 10.5px;
}

/* Empty state */
.no-data {
  padding: 48px 20px; text-align: center;
  color: var(--muted); font-size: 12.5px;
}
.no-data [data-lucide] {
  width: 28px; height: 28px; color: var(--dim);
  display: block; margin: 0 auto 10px;
}

/* Pagination */
.tbl-footer {
  padding: 10px 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted); background: var(--bg); flex-wrap: wrap;
}
.tbl-footer .pg-info { margin-right: auto; }
.pg-btns { display: flex; gap: 2px; }
.pg-btn {
  padding: 4px 9px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--muted); transition: all 120ms;
}
.pg-btn:hover { background: var(--surface-2); color: var(--text); }
.pg-btn.active { background: var(--accent-sft); color: var(--accent); border-color: rgba(94, 106, 210, 0.3); }
.pg-btn:disabled { opacity: 0.4; cursor: default; }


/* ============================================================
   14. ANALYTICS PANEL
   ============================================================ */

.anal-chart-wrap { position: relative; height: 300px; padding: 14px 16px; }

/* Monthly matrix */
.mon-table {
  width: 100%; font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  border-collapse: separate; border-spacing: 3px; padding: 10px 14px 14px;
}
.mon-table thead th {
  padding: 6px 0 10px; font-size: 10px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-family: 'Geist', sans-serif; text-align: center; min-width: 52px;
}
.mon-table thead th.year-col { text-align: left; padding-left: 6px; min-width: 58px; }
.mon-table thead th.ytd-col  { color: var(--accent); min-width: 76px; }
.mon-table tbody td {
  padding: 0; text-align: center; font-size: 12px; vertical-align: middle;
}
.mon-table tbody td.year-cell {
  font-family: 'Geist', sans-serif; font-weight: 500; color: var(--text);
  text-align: left; padding-left: 6px; font-size: 12.5px;
}

/* Monthly cell heatmap */
.mon-cell {
  display: block; padding: 9px 4px; border-radius: 6px;
  font-weight: 500; transition: all 120ms; line-height: 1.1; position: relative;
}
.mon-cell:hover { transform: scale(1.04); box-shadow: 0 2px 6px rgba(17, 24, 28, 0.1); z-index: 1; }

.mon-cell.empty { color: var(--dim); }
.mon-cell.ytd { border-radius: 6px; font-weight: 600; border: 1px solid transparent; }
.mon-cell.ytd.pos { background: var(--pos-sft); color: var(--pos); border-color: rgba(6, 122, 87, 0.22); }
.mon-cell.ytd.neg { background: var(--neg-sft); color: var(--neg); border-color: rgba(180, 35, 24, 0.22); }

/* BT→FW merge month indicator (strategies) */
.mon-cell.merge-month {
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(94, 106, 210, 0.32);
  z-index: 2;
}
:root[data-theme="dark"] .mon-cell.merge-month {
  box-shadow: 0 0 0 2px var(--accent), 0 2px 10px rgba(124, 132, 255, 0.35);
}
.mon-cell.merge-month::before {
  content: '◆'; position: absolute; top: 1px; right: 3px;
  font-size: 8px; color: var(--accent); line-height: 1;
}

/* By-hour stat tiles */
.hod-stat-row { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); }
.hod-stat {
  flex: 1; padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.hod-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin-bottom: 4px; }
.hod-stat-val { font-family: 'Geist Mono', monospace; font-size: 15px; font-weight: 500; }


/* ============================================================
   15. ADVANCED STATS — collapsible sections
   ============================================================ */

.stats-section-shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.stats-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; transition: background 120ms;
}
.stats-section-head:hover { background: var(--surface-2); }
.stats-section-head.collapsed { border-bottom: none; }

.ss-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; flex-shrink: 0;
}
.ss-icon.perf { background: var(--accent-sft); color: var(--accent); }
.ss-icon.risk { background: var(--amber-sft);  color: var(--amber); }
.ss-icon.dist { background: var(--pos-sft);    color: var(--pos); }
.ss-icon [data-lucide] { width: 13px; height: 13px; }
.ss-title { font-size: 13.5px; font-weight: 500; }
.ss-sub   { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.ss-chev  { margin-left: auto; color: var(--dim); transition: transform 180ms; }
.ss-chev.collapsed { transform: rotate(-90deg); }
.ss-chev [data-lucide] { width: 14px; height: 14px; }
.ss-body { padding: 14px 18px; }
.ss-body.collapsed { display: none; }

/* Stats grid */
.adv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px; background: var(--border); border-radius: 9px; overflow: hidden;
}
.adv-item {
  background: var(--surface); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.adv-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
  display: flex; align-items: center; gap: 4px; min-height: 16px;
}
.adv-label [data-lucide] { width: 11px; height: 11px; opacity: 0.7; }
.adv-val {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 16px; font-weight: 500; letter-spacing: -0.02em;
}
.adv-val.pos  { color: var(--pos); }
.adv-val.neg  { color: var(--neg); }
.adv-val.warn { color: var(--amber); }

/* BT/FW pair inside stats (strategies) */
.sstat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sstat-slot { display: flex; flex-direction: column; gap: 2px; }
.sstat-slot .tag {
  display: inline-flex; align-items: center;
  font-size: 8.5px; font-weight: 600; letter-spacing: 0.05em;
  padding: 1px 4px; border-radius: 3px; width: fit-content;
  font-family: 'Geist Mono', monospace;
}
.sstat-slot .tag.fw { background: var(--fw-sft); color: var(--fw-color); }
.sstat-slot .tag.bt { background: var(--bt-sft); color: var(--bt-color); }
.sstat-slot .val {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 500; letter-spacing: -0.015em;
}
.sstat-slot .val.pos  { color: var(--pos); }
.sstat-slot .val.neg  { color: var(--neg); }
.sstat-slot .val.warn { color: var(--amber); }
.sstat-slot .val.dim  { color: var(--dim); }


/* ============================================================
   16. TRADE EFFICIENCY
   ============================================================ */

.eff-kpi-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.eff-kpi {
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; transition: all 140ms;
}
.eff-kpi:hover { border-color: var(--border-str); background: var(--surface-3); }
.eff-kpi-lbl {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin-bottom: 5px;
}
.eff-kpi-val {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 18px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15;
}
.eff-kpi-val.pos  { color: var(--pos); }
.eff-kpi-val.neg  { color: var(--neg); }
.eff-kpi-val.warn { color: var(--amber); }
.eff-kpi-sub { font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.eff-hint {
  padding: 11px 16px 14px; font-size: 11.5px; color: var(--muted);
  line-height: 1.55; border-top: 1px solid var(--border); background: var(--bg);
}
.eff-hint b { color: var(--text); font-weight: 500; }

.eff-view-switch {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg); flex-wrap: wrap;
}
.seg-btn-group-eff {
  display: flex; background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px; padding: 2px;
}
.seg-btn-group-eff button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 5px;
  font-size: 12px; color: var(--muted); font-weight: 500; transition: all 120ms;
  background: transparent; border: none; cursor: pointer;
}
.seg-btn-group-eff button.active { background: var(--surface-2); color: var(--text); }
.seg-btn-group-eff button [data-lucide] { width: 12px; height: 12px; }

.mae-view { display: none; }
.mae-view.active { display: block; }

/* Exit efficiency bars */
.exit-eff-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 16px;
  border-bottom: 1px solid var(--border);
}
.exit-eff-label { font-size: 11.5px; color: var(--muted); min-width: 80px; }
.exit-eff-bar   { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.exit-eff-fill  { height: 100%; border-radius: 3px; background: var(--accent); transition: width 400ms; }
.exit-eff-count { font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--muted); min-width: 30px; text-align: right; }

/* Overlay toggle buttons (dd / stagnation) */
.chart-overlay-btns { display: flex; gap: 4px; }
.overlay-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--border);
  font-size: 11px; color: var(--muted); font-weight: 500;
  cursor: pointer; transition: all 140ms;
}
.overlay-btn:hover { border-color: var(--border-str); color: var(--text); }
.overlay-btn.dd.active   { color: var(--neg);        border-color: var(--neg);        background: var(--neg-sft); }
.overlay-btn.stag.active { color: var(--stag-color); border-color: var(--stag-color); background: var(--stag-sft); }


/* ============================================================
   17. SYMBOL CHART MODAL
   ============================================================ */

.modal-bg {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(17, 24, 28, 0.45); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
}
.modal-bg.open { display: flex; }

.modal {
  background: var(--surface); border: 1px solid var(--border-str); border-radius: 14px;
  width: 100%; max-width: 880px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-modal); overflow: hidden;
  animation: modalIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Settings / embed — full-screen overlay variant */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(17, 24, 28, 0.45); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-overlay .modal-inner {
  background: var(--surface); border: 1px solid var(--border-str); border-radius: 14px;
  width: 100%; max-width: 600px;
  box-shadow: var(--shadow-modal); overflow: hidden;
  animation: modalIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.modal-sym-name {
  font-family: 'Geist Mono', monospace; font-size: 18px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--text);
}
.modal-sym-side {
  font-size: 10px; font-weight: 600; padding: 3px 7px; border-radius: 4px; letter-spacing: 0.04em;
}
.modal-sym-side.buy  { background: var(--pos-sft); color: var(--pos); }
.modal-sym-side.sell { background: var(--neg-sft); color: var(--neg); }
.modal-sym-price {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 500; color: var(--text);
}
.modal-sym-delta {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 12.5px; font-weight: 500; padding: 2px 7px; border-radius: 4px;
}
.modal-sym-delta.pos { background: var(--pos-sft); color: var(--pos); }
.modal-sym-delta.neg { background: var(--neg-sft); color: var(--neg); }

.modal-close {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 6px; color: var(--muted); transition: all 120ms;
  background: none; border: none; cursor: pointer; margin-left: auto;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close [data-lucide] { width: 16px; height: 16px; }

.modal-tf-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.modal-tf-lbl {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
}
.modal-tf-info { margin-left: auto; font-size: 11.5px; color: var(--muted); font-family: 'Geist Mono', monospace; }
.modal-tf-info b { color: var(--text); font-weight: 500; }

.modal-body { padding: 20px; }
.modal-chart-wrap { position: relative; height: 380px; }

/* Symbol stats footer (4 tiles) */
.modal-sym-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); }
.modal-sym-stat  { padding: 12px 20px; border-right: 1px solid var(--border); }
.modal-sym-stat:last-child { border-right: none; }
.modal-sym-stat-lbl {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-bottom: 3px;
}
.modal-sym-stat-val {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 14px; font-weight: 500;
}
.modal-sym-stat-val.pos { color: var(--pos); }
.modal-sym-stat-val.neg { color: var(--neg); }

body.modal-open { overflow: hidden; }

/* Timeframe pills (inside modal) */
.tf-pill {
  padding: 4px 10px; border-radius: 5px;
  font-family: 'Geist Mono', monospace; font-size: 11px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: all 120ms;
}
.tf-pill:hover { border-color: var(--border-str); color: var(--text); }
.tf-pill.active { background: var(--accent-sft); border-color: var(--accent); color: var(--accent); }


/* ============================================================
   18. FORMS & SETTINGS FIELDS
   ============================================================ */

.settings-layout {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start;
}
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 7px;
  font-size: 13px; color: var(--muted); cursor: pointer; transition: all 120ms;
}
.settings-nav-item:hover { background: var(--surface-2); color: var(--text); }
.settings-nav-item.active { background: var(--accent-sft); color: var(--accent); font-weight: 500; }
.settings-nav-item [data-lucide] { width: 14px; height: 14px; }

/* Field row (label + control) */
.field {
  display: grid; grid-template-columns: 180px 1fr; gap: 12px;
  align-items: flex-start; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.field:last-child { border-bottom: none; }
.field-label { font-size: 13px; font-weight: 500; padding-top: 7px; }
.field-desc  { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.field-control { display: flex; flex-direction: column; gap: 6px; }

/* Text inputs */
.input-text {
  padding: 8px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 13px; color: var(--text); width: 100%;
  transition: border-color 120ms;
}
.input-text:focus { outline: none; border-color: var(--accent); }

/* Fancy select */
.fancy-select {
  position: relative;
}
.fancy-select select {
  width: 100%; padding: 8px 32px 8px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 13px; color: var(--text);
  appearance: none; cursor: pointer; transition: border-color 120ms;
}
.fancy-select select:focus { outline: none; border-color: var(--accent); }
.fancy-select::after {
  content: '↕'; position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); font-size: 11px; color: var(--muted); pointer-events: none;
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 20px;
  background: var(--surface-3); border: 1px solid var(--border);
  cursor: pointer; transition: all 200ms;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 14px; height: 14px;
  left: 2px; top: 2px; border-radius: 50%;
  background: var(--muted); transition: all 200ms;
}
.toggle-switch input:checked + .toggle-slider { background: var(--pos); border-color: var(--pos); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: white; }

/* Form note / hint */
.form-note { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.55; }

/* Danger section */
.danger-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border); gap: 16px;
}
.danger-row:last-child { border-bottom: none; }
.danger-text { font-size: 13px; }
.danger-text .danger-title { font-weight: 500; color: var(--neg); margin-bottom: 2px; }
.danger-text .danger-desc  { font-size: 11.5px; color: var(--muted); }


/* ============================================================
   19. STRATEGIES — BT/FW tokens, verdict banner, cstat grid
   ============================================================ */

/* Dashboard header */
.dash-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.dash-head-main { flex: 1; min-width: 0; }
.dash-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dash-meta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.dash-meta-item { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.dash-meta-item [data-lucide] { width: 12px; height: 12px; color: var(--dim); }

/* Verdict banner */
.verdict-banner {
  display: flex; align-items: stretch; gap: 0;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
}
.verdict-main {
  flex: 1; padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
.verdict-main.beating {
  background: linear-gradient(135deg, rgba(6, 122, 87, 0.05), rgba(6, 122, 87, 0.01));
  border-right: 1px solid rgba(6, 122, 87, 0.15);
}
.verdict-main.lagging {
  background: linear-gradient(135deg, rgba(180, 35, 24, 0.05), rgba(180, 35, 24, 0.01));
  border-right: 1px solid rgba(180, 35, 24, 0.15);
}
.verdict-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.verdict-icon.beating { background: var(--pos-sft); color: var(--pos); }
.verdict-icon.lagging { background: var(--neg-sft); color: var(--neg); }
.verdict-icon [data-lucide] { width: 18px; height: 18px; }
.verdict-body { flex: 1; min-width: 0; }
.verdict-title { font-size: 14px; font-weight: 500; }
.verdict-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.verdict-kpis  { display: flex; }
.verdict-kpi   {
  padding: 14px 20px; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.verdict-kpi .vk-lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.verdict-kpi .vk-val { font-family: 'Geist Mono', monospace; font-size: 18px; font-weight: 500; }

/* Core stats comparison grid (strategies-dashboard top) */
.core-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.cstat {
  padding: 16px 18px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.cstat:last-child { border-right: none; }
.cstat-head  { display: flex; align-items: center; gap: 6px; }
.cstat-label {
  font-size: 11px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.cstat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cstat-slot { display: flex; flex-direction: column; gap: 2px; }
.cstat-slot .tag { display: inline-flex; align-items: center; font-size: 8.5px; font-weight: 600; padding: 1px 4px; border-radius: 3px; width: fit-content; font-family: 'Geist Mono', monospace; }
.cstat-slot .tag.fw { background: var(--fw-sft); color: var(--fw-color); }
.cstat-slot .tag.bt { background: var(--bt-sft); color: var(--bt-color); }
.cstat-val {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 18px; font-weight: 500; letter-spacing: -0.02em;
}
.cstat-val.pos  { color: var(--pos); }
.cstat-val.neg  { color: var(--neg); }
.cstat-val.warn { color: var(--amber); }
.cstat-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500; padding: 1px 5px;
  border-radius: 4px; width: fit-content;
}
.cstat-delta.pos { background: var(--pos-sft); color: var(--pos); }
.cstat-delta.neg { background: var(--neg-sft); color: var(--neg); }

/* Status badge (LIVE / COMPLETED / RUNNING) */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
  font-family: 'Geist Mono', monospace;
}
.status-badge.live      { background: var(--pos-sft);    color: var(--pos); }
.status-badge.completed { background: var(--surface-2);  color: var(--muted); }
.status-badge.running   { background: var(--accent-sft); color: var(--accent); }
.status-badge.archived  { background: var(--surface-2);  color: var(--dim); }


/* ============================================================
   20. ANIMATIONS & UTILITIES
   ============================================================ */

@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes modalIn   { from { opacity: 0; transform: translateY(-12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin      { to { transform: rotate(360deg); } }

.spin { animation: spin 800ms linear infinite; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Tooltip */
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: 5px;
  background: var(--text); color: var(--bg); font-size: 11px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 120ms;
}
.tooltip:hover::after { opacity: 1; }


/* ============================================================
   21. RESPONSIVE
   ============================================================ */

@media (max-width: 1280px) {
  .core-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1100px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: none; }
  .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: 1px solid var(--border); }
  .eff-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .modal-sym-stats { grid-template-columns: repeat(2, 1fr); }
  .modal-sym-stat:nth-child(2) { border-right: none; }
  .modal-sym-stat:nth-child(3), .modal-sym-stat:nth-child(4) { border-top: 1px solid var(--border); }
  .cstat { border-right: none !important; border-bottom: 1px solid var(--border); }
  .cstat:last-child { border-bottom: none; }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topnav-inner { padding: 10px 16px; gap: 4px; }
  .nav-item span, .nav-trig span { display: none; }
  .searchbox { display: none; }
  main { padding: 14px 16px 60px; }
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi { border-right: none !important; border-bottom: 1px solid var(--border); }
  .kpi:last-child { border-bottom: none; }
  .acc-header { flex-direction: column; }
  .acc-header-actions { width: 100%; flex-wrap: wrap; }
  .megamenu { left: 0 !important; right: 0; min-width: auto !important; width: calc(100vw - 28px); margin: 6px 14px 0; }
  .mm-accounts, .mm-analytics { min-width: auto; }
  .user-menu { right: 0; width: calc(100vw - 28px); max-width: 320px; }
  .verdict-banner { flex-direction: column; }
  .verdict-kpis { flex-direction: column; }
  .verdict-kpi { border-left: none; border-top: 1px solid var(--border); }
  .adv-grid { grid-template-columns: repeat(2, 1fr); }
  .sstat-pair { grid-template-columns: 1fr; gap: 6px; }
  .eff-kpi-strip { grid-template-columns: 1fr 1fr; }
  .dash-head { flex-direction: column; }
  .dash-head-actions { width: 100%; }
}

@media (max-width: 480px) {
  .kpi-value { font-size: 18px; }
  .modal { border-radius: 10px; }
  .modal-sym-stats { grid-template-columns: repeat(2, 1fr); }
  .tabs-row { padding: 0 8px; }
  .tab-btn { padding: 10px 8px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRADING ACTIVITY + ANALYTICS + EFFICIENCY — FINAL CSS
   
   Этот файл ПОКРЫВАЕТ ВСЕ классы, которые реально выводит текущий
   dashboard.js, включая те что не было в макете (.muted-cell, .pnl-pos,
   .sl-hit, .won-cell, .sum-group-header, .mon-*, .exit-eff-*, .pg-select).
   
   Использует существующие CSS-переменные: --pos, --neg, --muted, --dim,
   --amber, --text, --bg, --surface, --surface-2, --border, --border-str,
   --accent, --accent-sft, --pos-sft, --neg-sft.
   Если нет --very-dim — безопасный fallback на --dim.
   =══════════════════════════════════════════════════════════════════════════ */

/* ── SECTION LABEL + COLLAPSIBLE CARD ─────────────────────────────────── */
.sec-lbl {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  margin-top: 10px; padding: 6px 0;
}
.sec-lbl [data-lucide] { width: 11px; height: 11px; }
.sec-lbl::after {
  content: ''; flex: 1; height: 1px; background: var(--border); margin-left: 4px;
}

.card.collapsible .card-head { cursor: pointer; user-select: none; }
.card-collapse-chev {
  display: grid; place-items: center;
  width: 22px; height: 22px; color: var(--muted);
  transition: transform 200ms, color 120ms;
}
.card-collapse-chev.open { transform: rotate(180deg); color: var(--accent); }
.card-collapse-chev [data-lucide] { width: 14px; height: 14px; }
.card-body.collapsed { display: none; }

/* ── ADVANCED STATS GRID ──────────────────────────────────────────────── */
.adv-grid-flat { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.adv-row {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.adv-row:nth-child(5n) { border-right: none; }
.adv-row:nth-last-child(-n+5) { border-bottom: none; }
.adv-lbl {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
  margin-bottom: 4px;
}
.adv-val {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 14px; font-weight: 500;
}
.adv-val.pos { color: var(--pos); }
.adv-val.neg { color: var(--neg); }
.adv-val.warn { color: var(--amber); }

/* ── TABS ROW ─────────────────────────────────────────────────────────── */
.tabs-row {
  display: flex; align-items: center; gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 14px;
  font-size: 12.5px; color: var(--muted); font-weight: 500;
  position: relative; transition: color 120ms;
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after {
  content: '';
  position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.tab-btn .count {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px; padding: 1px 5px;
  background: var(--surface-2); border-radius: 3px; color: var(--muted);
}
.tab-btn.active .count { background: var(--accent-sft); color: var(--accent); }
.tabs-right {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
}
.ta-panel   { display: none; }
.ta-panel.active   { display: block; }
.anal-panel { display: none; }
.anal-panel.active { display: block; }

/* ── TRADING TABLE (.tt) ──────────────────────────────────────────────── */
.trades-scroll { overflow-x: auto; max-height: 520px; overflow-y: auto; }

.tt {
  width: 100%; font-size: 11.5px;
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  border-collapse: collapse;
}
.tt thead th {
  padding: 8px 10px;
  text-align: right;
  font-size: 9.5px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-family: 'Geist', sans-serif;
  background: var(--bg);
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; cursor: default; user-select: none;
}
.tt thead th:first-child { text-align: left; padding-left: 16px; }
.tt thead th.th-left { text-align: left; }
.tt thead th.sortable { cursor: pointer; transition: color 120ms; }
.tt thead th.sortable:hover { color: var(--text); }
.tt thead th.sortable::after {
  content: '↕'; margin-left: 5px; font-size: 10px;
  font-family: 'Geist Mono', monospace;
  color: var(--very-dim, var(--dim)); transition: color 120ms;
}
.tt thead th.sortable:hover::after { color: var(--muted); }
.tt thead th.sortable.sort-desc,
.tt thead th.sortable.sort-asc  { color: var(--accent); }
.tt thead th.sortable.sort-desc::after { content: '↓'; color: var(--accent); }
.tt thead th.sortable.sort-asc::after  { content: '↑'; color: var(--accent); }

.tt tbody td {
  padding: 7px 10px; text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tt tbody tr:hover { background: var(--surface-2); }
.tt tbody td:first-child { padding-left: 16px; text-align: left; color: var(--muted); }
.tt tbody td.pos  { color: var(--pos); }
.tt tbody td.neg  { color: var(--neg); }
.tt tbody td.warn { color: var(--amber); }
.tt tbody td.dim  { color: var(--muted); }

.tt tfoot tr.tt-totals td {
  padding: 10px 10px;
  border-top: 2px solid var(--border-str);
  border-bottom: none;
  background: var(--bg);
  text-align: right;
  font-weight: 500;
  font-family: 'Geist Mono', monospace;
  white-space: nowrap;
  color: var(--text);
  position: sticky; bottom: 0; z-index: 1;
}
.tt tfoot tr.tt-totals td:first-child {
  padding-left: 16px; text-align: left;
  font-family: 'Geist', sans-serif; font-weight: 600;
}
.tt tfoot tr.tt-totals td.totals-label {
  text-align: right; font-family: 'Geist', sans-serif; font-weight: 600;
}

/* ── CELL HELPERS (JS-rendered) ──────────────────────────────────────── */
td.muted-cell, .tt .muted-cell { color: var(--muted); }

td.pnl-pos, .tt .pnl-pos { color: var(--pos); font-weight: 500; }
td.pnl-neg, .tt .pnl-neg { color: var(--neg); font-weight: 500; }

td.sl-hit,  .tt .sl-hit  { color: var(--neg); opacity: .85; }

td.won-cell,  .tt .won-cell  { color: var(--pos); }
td.lost-cell, .tt .lost-cell { color: var(--neg); }

td.sum-group-header, .tt .sum-group-header {
  background: var(--surface-2);
  font-family: 'Geist', sans-serif;
  font-weight: 600; font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 6px 10px !important;
}

td.eff-cell, .tt .eff-cell { text-align: center !important; }
td.dim, .tt .dim { color: var(--dim); }
.muted-sm { color: var(--muted); font-size: 10.5px; }

/* ── SIDE CHIP (BUY / SELL) ──────────────────────────────────────────── */
.side-chip {
  display: inline-block;
  font-size: 10.5px; font-weight: 500;
  padding: 1px 6px; border-radius: 3px;
  font-family: 'Geist', sans-serif;
}
.side-chip.buy  { background: var(--pos-sft); color: var(--pos); }
.side-chip.sell { background: var(--neg-sft); color: var(--neg); }
.tt .side-chip {
  padding: 1px 6px; border-radius: 3px;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.03em;
}
.tt .side-chip.buy  { background: var(--pos-sft); color: var(--pos); }
.tt .side-chip.sell { background: var(--neg-sft); color: var(--neg); }

.tt .order-chip {
  display: inline-block;
  padding: 1px 6px; border-radius: 3px;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.03em;
  font-family: 'Geist Mono', monospace;
  white-space: nowrap; background: transparent;
}
.tt .order-chip.buy-limit  { color: var(--pos); border: 1px dashed var(--pos); }
.tt .order-chip.sell-limit { color: var(--neg); border: 1px dashed var(--neg); }
.tt .order-chip.buy-stop   { color: var(--pos); border: 1px dotted var(--pos); }
.tt .order-chip.sell-stop  { color: var(--neg); border: 1px dotted var(--neg); }

/* ── SYMBOL CELL + MAGIC CELL ────────────────────────────────────────── */
.tt .sym-cell, .tt .symbol-cell {
  font-family: 'Geist', sans-serif; font-weight: 500;
  color: var(--text); text-align: left;
  cursor: pointer; transition: color 120ms;
  position: relative;
  padding-right: 16px !important;
}
.tt .sym-cell:hover,
.tt .symbol-cell.clickable:hover { color: var(--accent); }
.tt .sym-cell:hover::after,
.tt .symbol-cell.clickable:hover::after {
  content: '↗';
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  font-size: 11px; color: var(--accent); opacity: 0.8;
}

.tt .magic-cell {
  font-family: 'Geist', sans-serif;
  text-align: left;
  display: flex; align-items: center; gap: 6px;
}
.tt .magic-cell-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.magic-filter-select {
  padding: 5px 24px 5px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px; color: var(--text);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238a8a93' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 7px center;
  cursor: pointer;
}

/* ── DEPOSIT / WITHDRAWAL ROW ─────────────────────────────────────────── */
.dep-row td {
  background: rgba(180, 83, 9, 0.04) !important;
  color: var(--amber) !important;
  font-style: italic;
}

/* ── LIVE DOT / LIVE PRICE ───────────────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos);
  margin-left: 4px;
  animation: live-pulse 1.8s ease-in-out infinite;
  vertical-align: 2px;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.2); }
}
.live-px { font-weight: 500; color: var(--text); }

/* ── PAGINATION BAR ──────────────────────────────────────────────────── */
.pager-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px; flex-wrap: wrap;
}
.pager-info   { color: var(--muted); font-family: 'Geist Mono', monospace; margin-right: auto; }
.pager-info b { color: var(--text); font-weight: 500; }

.pg-btn {
  padding: 4px 9px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--muted);
  transition: all 120ms; cursor: pointer;
}
.pg-btn:hover { background: var(--surface-2); color: var(--text); }
.pg-btn.active {
  background: var(--accent-sft); color: var(--accent);
  border-color: rgba(94, 106, 210, 0.3);
}
.pg-btn:disabled { opacity: 0.4; cursor: default; }

.pg-select {
  padding: 4px 22px 4px 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--text);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238a8a93' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 6px center;
  cursor: pointer;
}

/* ── RANGE PILLS ─────────────────────────────────────────────────────── */
.range-pills {
  display: flex; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px;
}
.range-pills button {
  padding: 3px 9px; border-radius: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--muted); font-weight: 500;
  transition: all 140ms;
  background: transparent; border: none; cursor: pointer;
}
.range-pills button:hover { color: var(--text); }
.range-pills button.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 0.5px var(--border);
}

.mae-pg-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg); flex-wrap: wrap;
}
.mae-pg-lbl {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
}
.mae-pg-info {
  margin-left: auto;
  font-size: 11.5px; color: var(--muted);
  font-family: 'Geist Mono', monospace;
}
.mae-pg-info b { color: var(--text); font-weight: 500; }

/* ── NO DATA ─────────────────────────────────────────────────────────── */
.no-data {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.no-data [data-lucide] {
  width: 28px; height: 28px;
  color: var(--dim);
  display: block; margin: 0 auto 10px;
}

/* ── MONTHLY MATRIX (analytics) ───────────────────────────────────────── */
.mon-table {
  width: 100%; border-collapse: collapse;
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.mon-table thead th {
  padding: 8px 4px;
  font-size: 9.5px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-family: 'Geist', sans-serif;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.mon-table thead th.year-col { text-align: left;  padding-left: 14px; }
.mon-table thead th.ytd-col  { text-align: right; padding-right: 14px; color: var(--text); }
.mon-table tbody td {
  padding: 2px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.mon-table tbody td.year-cell {
  text-align: left; padding-left: 14px;
  font-family: 'Geist', sans-serif; font-weight: 600;
  font-size: 11px; color: var(--text); width: 60px;
}
.mon-table tbody td.ytd {
  text-align: right; padding-right: 14px; font-weight: 500;
}
.mon-cell {
  display: block; padding: 6px 2px;
  border-radius: 3px; font-size: 10.5px;
  min-width: 42px;
}
.mon-cell.empty { color: var(--very-dim, var(--dim)); }
.mon-cell.p1 { background: rgba(6,122,87,0.06);  color: var(--pos); }
.mon-cell.p2 { background: rgba(6,122,87,0.12);  color: var(--pos); }
.mon-cell.p3 { background: rgba(6,122,87,0.22);  color: var(--pos); font-weight: 500; }
.mon-cell.p4 { background: rgba(6,122,87,0.38);  color: var(--pos); font-weight: 500; }
.mon-cell.p5 { background: rgba(6,122,87,0.60);  color: var(--pos); font-weight: 600; }
.mon-cell.n1 { background: rgba(180,35,24,0.06); color: var(--neg); }
.mon-cell.n2 { background: rgba(180,35,24,0.15); color: var(--neg); }
.mon-cell.n3 { background: rgba(180,35,24,0.30); color: var(--neg); font-weight: 500; }
.mon-cell.n4 { background: rgba(180,35,24,0.50); color: var(--neg); font-weight: 600; }
.mon-cell.pos { color: var(--pos); }
.mon-cell.neg { color: var(--neg); }

/* ── EXIT EFFICIENCY BARS ─────────────────────────────────────────────── */
.exit-eff-row {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  align-items: center; gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}
.exit-eff-row:last-child { border-bottom: none; }
.exit-eff-row > :first-child {
  color: var(--muted); font-size: 11px; font-weight: 500;
}
.exit-eff-bar {
  height: 14px; border-radius: 3px;
  background: var(--accent-sft);
  transition: width 240ms ease-out;
  min-width: 2px;
}
.exit-eff-count {
  font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
  color: var(--text); text-align: right; font-size: 11px;
}

/* ── TV MODAL trade-item ─────────────────────────────────────────────── */
.tv-trade-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}
.tv-trade-item:last-child { border-bottom: none; }
.tv-trade-lbl { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.tv-trade-val { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; color: var(--text); }
.tv-trade-val.pos { color: var(--pos); }
.tv-trade-val.neg { color: var(--neg); }

