/* ═══════════════════════════════════════════════════════════
   TRADE LOGGER — PREMIUM UI SYSTEM
═══════════════════════════════════════════════════════════ */

/* Inter is loaded via <link> in index.html (non-blocking) */

:root {
  /* Backgrounds — layered deep navy-black */
  --bg:          #07090f;
  --sidebar-bg:  #04050b;
  --surface:     #0b0d18;
  --surface2:    #10131f;
  --surface3:    #161928;
  --surface-hi:  rgba(255,255,255,0.028);

  /* Borders — subtle blue-tinted */
  --border:      #171b2c;
  --border2:     #21253a;
  --border3:     #2d3150;

  /* Accent — themeable. Only these few need to change per theme; everything
     else derives from --accent / --accent-rgb (set at runtime by the theme picker). */
  --accent:        #f97316;
  --accent-rgb:    249,115,22;   /* accent as r,g,b so rgba(var(--accent-rgb), α) themes too */
  --accent-deep:   #ea6c0a;      /* darker accent — gradient depth on the logo & buttons */
  --accent-dim:    rgba(var(--accent-rgb),0.1);
  --accent-glow:   rgba(var(--accent-rgb),0.22);
  --accent-hover:  #fb923c;

  /* Status */
  --green:         #22c55e;
  --green-bright:  #4ade80;
  --green-dim:     rgba(34,197,94,0.08);
  --green-border:  rgba(34,197,94,0.18);
  --red:           #ef4444;
  --red-bright:    #f87171;
  --red-dim:       rgba(239,68,68,0.08);
  --red-border:    rgba(239,68,68,0.2);
  --yellow:        #f59e0b;
  --yellow-dim:    rgba(245,158,11,0.08);
  --yellow-border: rgba(245,158,11,0.2);
  --gold:          #f5c451;
  --gold-glow:     rgba(245,196,81,0.45);
  --indigo:        #818cf8;
  --indigo-dim:    rgba(129,140,248,0.1);

  /* Text */
  --text:       #eef0fc;
  --text-dim:   #9aa3c8;
  --text-muted: #5a628c;

  /* Layout */
  --sidebar-w: 240px;
  --mono:      'Cascadia Code','Fira Code','Consolas',monospace;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Elevation */
  --shadow:    0 2px 10px rgba(0,0,0,0.28);
  --shadow-lg: 0 16px 44px rgba(0,0,0,0.5);
}

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

body {
  font-family: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 560px at 84% -10%, rgba(var(--accent-rgb),0.06), transparent 60%),
    radial-gradient(820px 480px at -6% 110%, rgba(129,140,248,0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 13px;
  display: flex;
  font-feature-settings: 'cv02','cv03','cv04','cv11','ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* subtle ambient glow from top */
.sidebar::before {
  content: '';
  position: absolute;
  top: -60px; left: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(var(--accent-rgb),0.06) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 14px;
  position: relative;
}

.brand-mark { width: 36px; height: 36px; flex-shrink: 0; }

.brand-name {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(130deg, var(--accent) 0%, var(--accent-hover) 60%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  margin-top: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: color 0.15s, background 0.15s;
  letter-spacing: -0.1px;
}

.nav-item:hover {
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: var(--text);
  background: rgba(var(--accent-rgb),0.12);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item { position: relative; }

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.5; transition: opacity 0.15s; }
.nav-item.active .nav-icon { opacity: 1; color: var(--accent); }
.nav-item:hover .nav-icon { opacity: 0.85; }

.sidebar-footer {
  padding: 8px 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-footer .nav-item { flex: 1; }
.footer-ver { margin-top: 0; padding-right: 4px; white-space: nowrap; flex-shrink: 0; }

/* ── Strategy switcher (part of the header, above the nav) ── */
.strat-selector { position: relative; padding: 2px 12px 14px; border-bottom: 1px solid var(--border); }
.strat-box {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 7px 9px; cursor: pointer; font-family: inherit; text-align: left;
  transition: background .15s, border-color .15s;
}
.strat-box:hover { background: rgba(255,255,255,0.045); }
.strat-selector.open .strat-box { background: rgba(255,255,255,0.06); border-color: var(--border2); }
.strat-box-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; flex: 1; }
.strat-box-label { font-size: 9px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-muted); }
.strat-box-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.strat-box-arrow { color: var(--text-muted); font-size: 10px; flex-shrink: 0; transition: transform .2s; }
.strat-selector.open .strat-box-arrow { transform: rotate(180deg); }
.strat-menu {
  position: absolute; left: 10px; right: 10px; top: calc(100% - 4px); z-index: 60;
  background: var(--surface2); border: 1px solid var(--border3); border-radius: 11px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 62vh; overflow-y: auto;
}
.strat-menu.hidden { display: none; }
.strat-menu-head { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); padding: 8px 8px 4px; }
.strat-opt { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-dim); }
.strat-opt:hover { background: var(--surface3); color: var(--text); }
.strat-opt.sel { color: var(--accent); font-weight: 600; }
.strat-opt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strat-opt-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.strat-check { font-size: 12px; }
.strat-del { background: none; border: 0; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: 0; border-radius: 4px; }
.strat-opt:hover .strat-del { opacity: .55; }
.strat-del:hover { opacity: 1 !important; color: var(--red); background: var(--red-dim); }
.strat-menu-create { display: block; width: 100%; text-align: left; margin-top: 6px; padding: 9px 8px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.strat-menu-create:hover { background: rgba(var(--accent-rgb), .12); }
.cs-tpl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-tpl { text-align: left; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); padding: 10px; cursor: pointer; transition: border-color .15s; }
.cs-tpl:hover { border-color: var(--border3); }
.cs-tpl.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cs-tpl-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.cs-tpl-sub { font-size: 10.5px; color: var(--text-muted); line-height: 1.35; }

/* ── Trades table pager ── */
.trade-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 2px 4px; }
.trade-pagination:empty { display: none; }
.pg-info { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pg-controls { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pg-btn { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border2); background: var(--surface2); color: var(--text-dim); border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .12s, border-color .12s, color .12s; }
.pg-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border3); background: var(--surface3); }
.pg-btn.active { background: rgba(var(--accent-rgb),0.14); border-color: var(--accent); color: var(--accent); }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-arrow { font-size: 16px; line-height: 1; }
.pg-ellipsis { color: var(--text-muted); padding: 0 2px; font-size: 12px; }

/* ═══════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════ */
.content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 34px 40px 56px;
  scroll-behavior: smooth;
}

.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--border3); }

/* Global dark scrollbars — anything not styled above falls back to this (no more light bars) */
:root { color-scheme: dark; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 6px; border: 2px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-corner { background: var(--surface); }

/* ═══════════════════════════════════════════
   PAGES
═══════════════════════════════════════════ */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 30px;
}

/* Hover tooltips (definition boxes) */
[data-tip] { cursor: help; }
.hover-tip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  max-width: 270px;
  padding: 10px 13px;
  background: var(--surface2);
  color: var(--text-dim);
  border: 1px solid var(--border2);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

/* Dashboard live clock */
.dash-clock {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  padding: 11px 17px;
  background: linear-gradient(160deg, var(--surface2) 0%, var(--surface) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 var(--surface-hi);
  line-height: 1;
  white-space: nowrap;
}
.dash-clock .dc-time {
  font-family: var(--mono);
  font-size: 31px;
  font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-dim) 135%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dash-clock .dc-zone {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.dash-clock .dc-zone::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 7px var(--green-bright);
  animation: clockPulse 2.4s ease-in-out infinite;
}
@keyframes clockPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Cohesive elevation on the main surface cards */
.calendar-card,
.equity-card,
.an-card { box-shadow: var(--shadow); }

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.page-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.1px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent-glow);
}

.sub-nav {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  margin-top: 6px;
}

.sub-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
}

.sub-btn:hover { color: var(--text-dim); }
.sub-btn.active { background: var(--surface3); color: var(--text); font-weight: 600; }

.sub-page { display: none; }
.sub-page.active { display: block; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: -0.1px;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: 0 4px 18px rgba(var(--accent-rgb),0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(var(--accent-rgb),0.25); }

/* Orange action button — used for "Add Expense" (money out) */
.btn-orange {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: -0.1px;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.28), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-orange:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: 0 4px 18px rgba(var(--accent-rgb),0.4), inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
.btn-orange:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(var(--accent-rgb),0.25); }

/* ═══════════════════════════════════════════
   SETTINGS LINK ROW  +  THEME PICKER
═══════════════════════════════════════════ */
.settings-link-row {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer; color: var(--text);
  font-family: inherit; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.settings-link-row:hover { border-color: var(--accent); background: var(--surface3); }
.settings-link-left  { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.settings-link-arrow { color: var(--text-muted); font-size: 18px; line-height: 1; }
.s-theme-swatch {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.th-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.th-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted); margin: 18px 0 10px;
}
.th-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.th-card {
  position: relative; cursor: pointer;
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 9px; background: var(--surface2);
  display: flex; flex-direction: column; gap: 7px;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.th-card:hover { transform: translateY(-2px); border-color: var(--border3); }
.th-card.active { border-color: var(--th-c); box-shadow: 0 0 0 1px var(--th-c), 0 6px 18px -8px var(--th-c); }
.th-card-swatch {
  height: 36px; border-radius: 7px;
  background: linear-gradient(135deg, var(--th-c) 0%, var(--th-c-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), inset 0 0 0 1px rgba(0,0,0,0.18);
}
.th-card-name { font-size: 11px; font-weight: 600; color: var(--text-dim); text-align: center; }
.th-card.active .th-card-name { color: var(--text); }
.th-card-check {
  position: absolute; top: 13px; right: 13px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--th-c); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.th-card-del {
  position: absolute; top: 5px; left: 5px;
  width: 17px; height: 17px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; border: none;
  font-size: 11px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.th-card:hover .th-card-del { display: flex; }
.th-card-del:hover { background: var(--red); }
.th-empty { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); padding: 2px; }
.th-create { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.th-create-row { display: flex; align-items: center; gap: 10px; }
.th-color-pick { position: relative; width: 38px; height: 38px; flex-shrink: 0; cursor: pointer; }
.th-color-pick input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: none; padding: 0; background: none; cursor: pointer; opacity: 0;
}
.th-color-ring {
  position: absolute; inset: 0; border-radius: 9px; pointer-events: none;
  background: var(--th-new, var(--accent));
  border: 2px solid var(--border3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.th-name-input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 9px 12px; color: var(--text);
  font-family: inherit; font-size: 13px;
}
.th-name-input:focus { outline: none; border-color: var(--accent); }
.th-create-hint { font-size: 11px; color: var(--text-muted); margin-top: 9px; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border2);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover {
  color: var(--text-dim);
  border-color: var(--border3);
  background: rgba(255,255,255,0.03);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: 7px;
  transition: all 0.15s;
  font-size: 14px;
  line-height: 1;
}

.btn-icon:hover { color: var(--text-dim); background: var(--surface3); }

/* Clean edit/duplicate/delete row icons */
.btn-icon.icon-edit svg, .btn-icon.icon-del svg { display: block; }
.btn-icon.icon-edit:hover { color: var(--accent); background: var(--accent-dim); }
.btn-icon.icon-del:hover  { color: var(--red-bright); background: var(--red-dim); }

/* ═══════════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));   /* one clean row of six */
  gap: 12px;
  margin-bottom: 22px;
}

.kpi-card {
  background: linear-gradient(168deg, var(--surface2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)) 0%, transparent 100%);
  opacity: 0.85;
}

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

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: -1.2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════
   ACCOUNT / GOAL CARDS
═══════════════════════════════════════════ */
.acct-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.acct-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.acct-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)) 0%, transparent 70%);
}

.acct-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.acct-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.acct-value {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.acct-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 12px;
  color: var(--text-muted);
}

.acct-row:last-of-type { border-bottom: none; }
.acct-row-val { font-family: var(--mono); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Progress bar */
.progress-wrap { margin-top: 14px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 5px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green), var(--green-bright));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  max-width: 100%;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 8px; height: 100%;
  background: rgba(255,255,255,0.35);
  border-radius: 4px;
  filter: blur(3px);
}

.progress-fill.fill-warn    { background: linear-gradient(90deg, var(--yellow), #fbbf24); }
.progress-fill.fill-danger  { background: linear-gradient(90deg, var(--red), var(--red-bright)); }
.progress-fill.fill-accent  { background: linear-gradient(90deg, var(--accent), var(--accent-hover)); }

/* ═══════════════════════════════════════════
   CALENDAR
═══════════════════════════════════════════ */
.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
}

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

.cal-month-info { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.15; }
.cal-month-pnl { font-size: 14px; font-weight: 800; font-family: var(--mono); letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.cal-month-label { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }

.cal-nav {
  width: 30px; height: 30px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}

.cal-nav:hover { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb),0.06); }

.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 1.7fr;
  gap: 5px;
  margin-bottom: 6px;
}

.cal-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: inline-block;
}

.cal-dow-row > div {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding-bottom: 8px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 1.7fr;
  gap: 5px;
}

/* Weekly summary cell — sits at the end of each calendar week row */
.cal-week-cell {
  min-height: 76px;
  border-radius: 10px;
  padding: 8px 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.cal-week-cell .wk-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted);
}
.cal-week-cell .wk-pnl  { font-size: 16px; font-weight: 800; font-family: var(--mono); line-height: 1.1; }
.cal-week-cell .wk-meta { font-size: 10px; color: var(--text-dim); }
.cal-week-cell.wk-win  { border-left-color: var(--green); }
.cal-week-cell.wk-loss { border-left-color: var(--red); }
.cal-week-cell.wk-be   { border-left-color: var(--text-muted); }
.cal-week-cell.wk-empty { opacity: 0.5; }

.cal-cell {
  min-height: 76px;
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  transition: opacity 0.15s, transform 0.12s;
  cursor: default;
}

.cal-cell.empty { background: transparent; pointer-events: none; }

.cal-cell.win-day {
  background: linear-gradient(145deg, rgba(34,197,94,0.1), rgba(34,197,94,0.04));
  border-color: rgba(34,197,94,0.2);
}

.cal-cell.loss-day {
  background: linear-gradient(145deg, rgba(239,68,68,0.1), rgba(239,68,68,0.04));
  border-color: rgba(239,68,68,0.2);
}

.cal-cell.be-day {
  background: linear-gradient(145deg, rgba(245,158,11,0.1), rgba(245,158,11,0.04));
  border-color: rgba(245,158,11,0.2);
}

.cal-cell.today { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }
.cal-cell:not(.empty):hover { opacity: 0.72; transform: scale(0.98); }

/* Important / study day — gold flag (set from the day-detail panel) */
.cal-cell { position: relative; }
.cal-cell.important-day {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 1px var(--gold-glow), 0 0 12px rgba(245,196,81,0.18);
  background: linear-gradient(145deg, rgba(245,196,81,0.14), rgba(245,196,81,0.04));
}
.cal-cell.important-day .cal-day-num { color: var(--gold); }
.cal-star {
  position: absolute; top: 6px; right: 8px;
  font-size: 11px; color: var(--gold); line-height: 1;
  text-shadow: 0 0 6px var(--gold-glow); pointer-events: none;
}

.cal-day-num { font-size: 11px; font-weight: 600; color: var(--text-muted); line-height: 1; }
.cal-cell.today .cal-day-num { color: var(--accent); }

.cal-pnl-val {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; font-family: var(--mono);
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}

.win-day  .cal-pnl-val { color: var(--green); }
.loss-day .cal-pnl-val { color: var(--red); }
.be-day   .cal-pnl-val { color: var(--yellow); }

.cal-trade-cnt { font-size: 10px; color: var(--text-muted); text-align: right; line-height: 1; }

/* ═══════════════════════════════════════════
   PERIOD CARDS
═══════════════════════════════════════════ */
.period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.period-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px;
  text-align: center;
  transition: border-color 0.15s, transform 0.2s;
}

.period-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.period-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 10px;
}

.period-pnl {
  font-size: 22px; font-weight: 800; font-family: var(--mono);
  letter-spacing: -0.8px; margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.period-meta { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════
   TRADE TABLE
═══════════════════════════════════════════ */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.strip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color 0.15s, transform 0.2s;
}

.strip-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.strip-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  flex-shrink: 0;
  border: 1px solid rgba(var(--accent-rgb),0.15);
  box-shadow: 0 0 10px rgba(var(--accent-rgb),0.08);
}

.strip-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.strip-value { font-size: 18px; font-weight: 800; font-family: var(--mono); line-height: 1.2; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }

.table-outer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

/* Horizontal scrollbar mirrored at the TOP of the trades table (synced with .table-outer via JS) */
.table-topscroll { display: none; overflow-x: auto; overflow-y: hidden; margin-bottom: 6px; }
.table-topscroll > div { height: 1px; }
.table-outer::-webkit-scrollbar, .table-topscroll::-webkit-scrollbar { height: 12px; }
.table-outer::-webkit-scrollbar-track, .table-topscroll::-webkit-scrollbar-track { background: var(--surface2); border-radius: 6px; }
.table-outer::-webkit-scrollbar-thumb, .table-topscroll::-webkit-scrollbar-thumb {
  background: var(--border3);
  border-radius: 6px;
  border: 2px solid var(--surface2);
}
.table-outer::-webkit-scrollbar-thumb:hover, .table-topscroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.main-table { width: 100%; border-collapse: collapse; }

.main-table thead th {
  background: var(--surface2);
  padding: 11px 12px;
  text-align: left;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.main-table thead th.th-click {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.main-table thead th.th-click:hover { color: var(--text); }
.main-table thead th.th-active { color: var(--accent) !important; }

.main-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.main-table tbody tr:last-child { border-bottom: none; }
.main-table tbody tr:hover td { background: rgba(255,255,255,0.022); }
.main-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.008); }
.main-table tbody tr:nth-child(even):hover td { background: rgba(255,255,255,0.022); }
.main-table tbody tr.row-win  td:first-child { border-left: 2px solid var(--green); }
.main-table tbody tr.row-loss td:first-child { border-left: 2px solid var(--red); }
.main-table tbody tr.row-be   td:first-child { border-left: 2px solid var(--yellow); }

.main-table td {
  padding: 9px 12px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.badge-win   { background: rgba(34,197,94,0.1);   color: var(--green);   border: 1px solid rgba(34,197,94,0.2); }
.badge-loss  { background: rgba(239,68,68,0.1);   color: var(--red);     border: 1px solid rgba(239,68,68,0.2); }
.badge-be    { background: rgba(245,158,11,0.1);  color: var(--yellow);  border: 1px solid rgba(245,158,11,0.2); }
.badge-long  { background: rgba(var(--accent-rgb),0.1);  color: var(--accent);  border: 1px solid rgba(var(--accent-rgb),0.2); }
.badge-short { background: rgba(239,68,68,0.08);  color: var(--red);     border: 1px solid rgba(239,68,68,0.18); }

/* P&L colors */
.c-green  { color: var(--green);  font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.c-red    { color: var(--red);    font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.c-muted  { color: var(--text-muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.c-yellow { color: var(--yellow); font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.c-accent { color: var(--accent); }
.c-mono   { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* empty state */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); }
.empty-state .ei { font-size: 28px; margin-bottom: 14px; opacity: 0.3; display: block; }
.empty-state p { font-size: 13px; }

/* ═══════════════════════════════════════════
   ANALYTICS GRID
═══════════════════════════════════════════ */
.an-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 14px; }
.an-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; margin-bottom: 14px; }
.an-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 14px; }

.an-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s;
}

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

.an-card-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

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

.st th {
  font-size: 10px; color: var(--text-muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 4px 6px; text-align: right; white-space: nowrap;
}

.st th:first-child { text-align: left; }

.st td {
  padding: 7px 6px;
  border-top: 1px solid rgba(255,255,255,0.03);
  text-align: right;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.st td:first-child { text-align: left; color: var(--text); }
.st tbody tr:hover td { background: rgba(255,255,255,0.022); }

.ov-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ov-row:last-child { border-bottom: none; }
.ov-label { color: var(--text-muted); font-size: 12px; }
.ov-value { font-weight: 600; font-size: 12px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ov-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }

.edge-pos { color: var(--green); font-weight: 600; }
.edge-neg { color: var(--red);   font-weight: 600; }

/* ═══════════════════════════════════════════
   PAYOUTS PAGE
═══════════════════════════════════════════ */
.tax-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.tax-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px;
  text-align: center;
  transition: border-color 0.15s, transform 0.2s;
}

.tax-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.tax-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 10px;
}

.tax-value { font-size: 20px; font-weight: 800; font-family: var(--mono); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }

.payout-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
}

.filter-select {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  height: 28px;
  transition: border-color 0.15s;
}

.filter-select:focus { outline: none; border-color: var(--accent); }

.filter-tag {
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(var(--accent-rgb),0.22);
  padding: 2px 9px;
  border-radius: 5px;
}

/* ═══════════════════════════════════════════
   MODALS
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,5,11,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 580px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.04), 0 0 60px rgba(var(--accent-rgb),0.04);
}

.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Day-detail modal (calendar drill-down) ── */
.modal-lg { width: 720px; }
.dayd-box { padding: 22px 24px; }
.dayd-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border); padding-bottom: 14px;
}
.dayd-header .modal-title { margin: 0; }
.dayd-actions { display: flex; align-items: center; gap: 10px; }
.dayd-imp-btn {
  background: var(--surface2); border: 1px solid var(--border3);
  color: var(--text-dim); font-size: 12px; font-weight: 700;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s; white-space: nowrap;
}
.dayd-imp-btn:hover { border-color: var(--gold); color: var(--gold); }
.dayd-imp-btn.active {
  background: rgba(245,196,81,0.14); border-color: var(--gold);
  color: var(--gold); box-shadow: 0 0 10px rgba(245,196,81,0.18);
}
.dayd-close {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; width: 28px; height: 28px;
  border-radius: 6px; transition: background 0.14s, color 0.14s;
}
.dayd-close:hover { background: var(--surface2); color: var(--text); }

.dayd-trade-card {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 12px;
}
.dayd-tc-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.dayd-tc-time { font-size: 12px; color: var(--text-dim); min-width: 58px; }
.dayd-tc-spacer { flex: 1; }
.dayd-tc-pnl { font-weight: 800; font-family: var(--mono); font-size: 14px; }
.dayd-tc-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 7px; }
.dayd-tc-notes {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.5;
  margin-top: 9px; padding: 9px 11px;
  background: var(--surface); border-radius: 8px;
  border-left: 2px solid var(--border3); white-space: pre-wrap;
}
.dayd-tc-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dayd-shot {
  width: 96px; height: 64px; object-fit: cover; border-radius: 7px;
  border: 1px solid var(--border2); cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.dayd-shot:hover { transform: scale(1.04); border-color: var(--accent); }

.dayd-empty { text-align: center; padding: 36px 20px; }
.dayd-empty-icon { font-size: 34px; margin-bottom: 12px; opacity: 0.85; }
.dayd-empty-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.dayd-empty-sub { font-size: 12.5px; color: var(--text-muted); max-width: 380px; margin: 0 auto; line-height: 1.5; }

/* Compact-card indicators — the actual note/shots live in the section below */
.dayd-tc-ind { font-size: 11px; opacity: 0.85; margin-left: 2px; }

/* Compiled Journal & Screenshots section (all of the day's, in one place) */
.dayd-journal-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border2); }
.dayd-section-title {
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.dayd-jr-block { margin-bottom: 16px; }
.dayd-jr-block:last-child { margin-bottom: 0; }
.dayd-jr-label {
  font-size: 12px; font-weight: 700; color: var(--text-dim);
  margin-bottom: 8px; display: flex; align-items: center; gap: 7px;
}
.dayd-jr-count {
  background: var(--accent-dim); color: var(--accent);
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 10px;
}
.dayd-jr-entry {
  position: relative;
  background: var(--surface2); border: 1px solid var(--border2);
  border-left: 2px solid var(--accent); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px;
}
.dayd-jr-tag {
  font-size: 11px; color: var(--text-muted); font-family: var(--mono);
  margin-bottom: 5px; display: flex; align-items: center; gap: 7px;
}
.dayd-jr-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; white-space: pre-wrap; }

/* Section subtitle, clickable entry cards, edit pencil, thumbnails, view link */
.dayd-sub { font-weight: 400; font-size: 11px; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.dayd-recap-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border2); }
.dayd-clickable { cursor: pointer; transition: border-color 0.14s, background 0.14s; padding-right: 40px; }
.dayd-clickable:hover { border-color: var(--accent); background: var(--surface3); }
.dayd-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dayd-entry-edit {
  position: absolute; top: 9px; right: 9px;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--surface3); border: 1px solid var(--border3); color: var(--text-dim);
  font-size: 13px; cursor: pointer; transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.dayd-entry-edit:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.dayd-jr-thumbs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; align-items: center; }
.dayd-jr-thumb {
  width: 66px; height: 44px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border2);
}
.dayd-jr-more { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.dayd-jr-open { font-size: 11px; font-weight: 700; color: var(--accent); margin-top: 9px; }

/* Entry view "tab" (read-only note + pictures) */
.ev-body { margin-top: 4px; }
.ev-note {
  font-size: 13.5px; color: var(--text); line-height: 1.6; white-space: pre-wrap;
  background: var(--surface2); border: 1px solid var(--border2);
  border-left: 2px solid var(--accent); border-radius: 10px; padding: 14px 16px;
}
.ev-empty { font-size: 13px; color: var(--text-muted); padding: 6px 2px 14px; }
.ev-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.ev-gallery img {
  max-width: 320px; max-height: 220px; object-fit: contain; border-radius: 10px;
  border: 1px solid var(--border2); cursor: pointer; background: var(--bg);
  transition: transform 0.12s, border-color 0.12s;
}
.ev-gallery img:hover { transform: scale(1.02); border-color: var(--accent); }
.dayd-jr-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dayd-jr-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px; background: var(--surface2);
  border: 1px dashed var(--border3); border-radius: 10px; text-align: center;
}
.dayd-jr-empty-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; max-width: 360px; }
.dayd-jr-add-big {
  background: var(--accent); color: #fff; border: none;
  font-size: 13px; font-weight: 700; padding: 9px 28px; border-radius: 9px;
  cursor: pointer; transition: background 0.14s, box-shadow 0.14s;
  box-shadow: 0 0 0 1px var(--accent), 0 6px 18px var(--accent-glow);
}
.dayd-jr-add-big:hover { background: var(--accent-hover); }
.dayd-jr-add {
  background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent);
  font-size: 11.5px; font-weight: 700; padding: 5px 14px; border-radius: 7px;
  cursor: pointer; transition: background 0.14s; white-space: nowrap;
}
.dayd-jr-add:hover { background: var(--accent); color: #fff; }
.dayd-jr-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.dayd-jr-shot { margin: 0; }
.dayd-jr-shot img {
  width: 132px; height: 88px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border2); cursor: pointer; display: block;
  transition: transform 0.12s, border-color 0.12s;
}
.dayd-jr-shot img:hover { transform: scale(1.04); border-color: var(--accent); }
.dayd-jr-shot figcaption {
  font-size: 10px; color: var(--text-muted); text-align: center;
  margin-top: 4px; font-family: var(--mono);
}

.modal-sm { width: 420px; }

.modal-title {
  font-size: 17px; font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-full { grid-column: 1 / -1; }
/* Analysis built-ins (HTF / Top-Bottom / SMT / M-W) lay out 2-up like the rest of the form */
#analysis-builtins { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.modal-sect {
  grid-column: 1 / -1;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent);
  padding-top: 14px; margin-top: 4px;
  border-top: 1px solid var(--border);
}

.modal-sect:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.modal-stack { display: flex; flex-direction: column; gap: 16px; }

/* Settings ▸ Account row + grouped sections (clean, modern) */
#s-account-group { display: flex; flex-direction: column; gap: 12px; }
#s-account-group.hidden + .modal-sect { border-top: none; padding-top: 0; margin-top: 0; }
.settings-account { display: flex; align-items: center; gap: 13px; }
.settings-avatar {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 4px 14px var(--accent-glow);
}
.settings-account-info { flex: 1 1 auto; min-width: 0; }
.settings-account-email { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-account-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.btn-signout {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; font-family: inherit;
  color: #f0828c; background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.32);
  transition: background .15s, border-color .15s, color .15s;
}
.btn-signout:hover { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.6); color: #f6a0a8; }

.mf label {
  display: block;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mf input,
.mf select,
.mf textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  font-variant-numeric: tabular-nums;
}

.mf input:focus,
.mf select:focus,
.mf textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.08);
}

.mf textarea { resize: vertical; min-height: 60px; }
#f-notes, #journal-note { min-height: 290px; line-height: 1.6; }
.mf select option { background: var(--surface2); }

.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* Time in / out — custom themed picker */
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.time-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.time-cap { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.tp-box {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px; font-weight: 600; font-family: inherit;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.tp-box:hover { border-color: var(--border3); }
.tp-val { font-variant-numeric: tabular-nums; }
.tp-val.tp-empty { color: var(--text-muted); font-weight: 400; }
.tp-clock { color: var(--text-muted); flex-shrink: 0; }
.time-popup {
  position: fixed; z-index: 10000;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.time-popup.hidden { display: none; }
.tp-cols { display: flex; gap: 4px; }
.tp-col { display: flex; flex-direction: column; gap: 2px; max-height: 184px; overflow-y: auto; }
.tp-col::-webkit-scrollbar { width: 6px; }
.tp-col::-webkit-scrollbar-track { background: transparent; }
.tp-col::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 3px; }
.tp-col::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.tp-item {
  background: transparent; border: none;
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  padding: 6px 16px; border-radius: 6px; cursor: pointer; text-align: center;
  transition: background 0.1s, color 0.1s;
}
.tp-item:hover { background: var(--surface3); color: var(--text); }
.tp-item.sel { background: var(--accent); color: #fff; }

.et-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.et-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border3);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.et-chip:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
.et-chip.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.et-chip-add {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px dashed var(--border3);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
}
.et-chip-add:hover { border-color: var(--accent); color: var(--accent); }

.et-chip-input {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  width: 140px;
  outline: none;
}
.et-chip-input::placeholder { color: var(--text-muted); font-weight: 500; }

/* Custom (one-off) entry chips are deletable via the × */
.et-chip-custom { display: inline-flex; align-items: center; gap: 6px; }
.et-chip-x {
  font-size: 14px;
  line-height: 1;
  opacity: 0.55;
  margin-left: 1px;
}
.et-chip-x:hover { opacity: 1; color: var(--red-bright); }

/* Custom confluence Yes/No boxes — laid out like the fixed Analysis fields */
.conf-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.conf-item label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conf-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 6px; }
.conf-del:hover { color: var(--red-bright); }
.conf-empty { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); padding: 2px; }

/* ── Trades tab: toolbar, search, bulk bar ── */
.trade-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.trade-search {
  flex: 1; min-width: 220px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.trade-search:focus { border-color: var(--accent); }
.trade-search::placeholder { color: var(--text-muted); }
.trade-bulk-bar { display: none; align-items: center; gap: 10px; }
.bulk-count { font-size: 12px; font-weight: 700; color: var(--accent); }
.btn-ghost.bulk-del { color: var(--red-bright); border-color: var(--red-border); }
.btn-ghost.bulk-del:hover { background: var(--red-dim); border-color: var(--red); }

/* row selection + thumbnails */
.th-check, .td-check { width: 32px; text-align: center; padding-left: 6px !important; }
.trade-check, #trade-check-all { cursor: pointer; accent-color: var(--accent); width: 14px; height: 14px; }
.trade-thumb {
  width: 26px; height: 26px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border2);
  cursor: pointer;
  vertical-align: middle;
}
.td-notes { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* entry-type manager rows */
.et-manage-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.et-manage-row:last-child { border-bottom: none; }
.et-manage-input {
  flex: 1; min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12px;
  outline: none;
}
.et-manage-input:focus { border-color: var(--accent); }
.et-manage-count { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.et-manage-save { font-size: 11px; padding: 5px 12px; }

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.save-flash { font-size: 12px; color: var(--green); margin-left: 4px; }
.save-flash.hidden { display: none; }

/* ═══════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════ */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* ═══════════════════════════════════════════
   EQUITY CURVE CARD
═══════════════════════════════════════════ */
.equity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px 16px;
  margin-bottom: 22px;
  transition: border-color 0.15s;
}
.equity-card:hover { border-color: var(--border2); }

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

.equity-stats { display: flex; gap: 28px; }
.eq-stat { text-align: right; }
.eq-stat-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); margin-bottom: 2px;
}
.eq-stat-val {
  font-size: 13px; font-weight: 600;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

.equity-chart-wrap { position: relative; height: 180px; }

/* ═══════════════════════════════════════════
   FILTER BAR (inner)
═══════════════════════════════════════════ */
.filter-bar { margin-bottom: 14px; }

.filter-bar-inner {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

.filter-field { display: flex; flex-direction: column; gap: 4px; }

.filter-field label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted);
}

.filter-field input,
.filter-field select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 9px;
  height: 30px;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.filter-field input { width: 130px; }
.filter-field select { width: 100px; padding-right: 20px; }

.filter-field input:focus,
.filter-field select:focus { outline: none; border-color: var(--accent); }

.filter-active { border-color: var(--accent) !important; }

.filter-sep { width: 1px; height: 30px; background: var(--border); align-self: flex-end; margin: 0 2px; }

.filter-clear {
  height: 30px; padding: 0 12px; font-size: 12px;
  align-self: flex-end; color: var(--text-muted); border-color: var(--border);
}
.filter-clear:hover { color: var(--red); border-color: rgba(239,68,68,0.4); }

.filter-count {
  align-self: flex-end; font-size: 11px; color: var(--text-muted);
  padding: 0 4px; height: 30px; line-height: 30px; white-space: nowrap;
}
.filter-count span { color: var(--accent); font-weight: 700; }

/* ═══════════════════════════════════════════
   PROP ACCOUNT SETTINGS ROWS
═══════════════════════════════════════════ */
.prop-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px 100px 28px;
  gap: 6px; align-items: center; margin-bottom: 6px;
}
.prop-row input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 12px;
  font-family: inherit; padding: 5px 8px; height: 30px;
  width: 100%; transition: border-color 0.15s;
}
.prop-row input:focus { outline: none; border-color: var(--accent); }
.prop-row-header { display: grid; grid-template-columns: 1fr 90px 90px 100px 28px; gap: 6px; margin-bottom: 4px; }
.prop-row-header span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 0 4px; }

/* ═══════════════════════════════════════════
   BY-HOUR TABLE
═══════════════════════════════════════════ */
.hour-bar {
  display: inline-block; height: 8px; border-radius: 2px;
  background: var(--accent); min-width: 2px; vertical-align: middle;
  margin-right: 6px; opacity: 0.8;
}
.hour-bar.bar-red { background: var(--red); }
.hour-bar.bar-green { background: var(--green); }

/* ═══════════════════════════════════════════
   TYPE TOGGLE (Eval / Express / DD)
═══════════════════════════════════════════ */
.type-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.type-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.type-btn.active {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border3);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.type-btn:hover:not(.active) { color: var(--text-dim); background: rgba(255,255,255,0.03); }

/* ═══════════════════════════════════════════
   PROP ACCOUNTS PAGE
═══════════════════════════════════════════ */
.pa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.pa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.pa-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.pa-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  background: linear-gradient(180deg, var(--surface2) 0%, transparent 100%);
}

.pa-card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.pa-type-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.pa-type-eval {
  background: rgba(245,158,11,0.12);
  color: var(--yellow);
  border: 1px solid rgba(245,158,11,0.24);
}

.pa-type-express {
  background: rgba(34,197,94,0.1);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.2);
}

.pa-card-body { padding: 16px 18px; flex: 1; }

.pa-status {
  display: flex; align-items: center; gap: 7px; margin-bottom: 14px;
}
.pa-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.pa-prog-section { margin-bottom: 14px; }

.pa-prog-label-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-muted); margin-bottom: 6px;
}
.pa-prog-label-row span:last-child { font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }

.pa-metric {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.pa-metric:last-child { border-bottom: none; }

.pa-metric-label { font-size: 12px; color: var(--text-dim); }
.pa-metric-val   { font-size: 13px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.pa-divider { height: 1px; background: var(--border); margin: 12px 0; }

.pa-above-buf {
  font-size: 22px; font-weight: 800; font-family: var(--mono);
  letter-spacing: -0.5px; margin: 4px 0 10px;
  font-variant-numeric: tabular-nums;
}

.pa-card-footer {
  display: flex; gap: 8px; padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, var(--surface2) 0%, transparent 100%);
}

.pa-empty {
  text-align: center; padding: 80px 24px; color: var(--text-muted);
}
.pa-empty-icon { font-size: 36px; margin-bottom: 16px; opacity: .2; display: block; filter: grayscale(1); }
.pa-empty-title { font-size: 16px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px; }
.pa-empty-sub { font-size: 13px; margin-bottom: 24px; }

.dd-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 4px; text-transform: uppercase;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  color: var(--text-muted); flex-shrink: 0;
}
.dd-badge-intraday {
  background: rgba(129,140,248,0.1);
  border-color: rgba(129,140,248,0.24);
  color: var(--indigo);
}

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page.active { animation: fade-in 0.22s ease; }

/* Brand mark glow */
.brand-mark svg {
  filter: drop-shadow(0 2px 8px rgba(var(--accent-rgb),0.35));
  transition: filter 0.2s;
}
.sidebar-brand:hover .brand-mark svg {
  filter: drop-shadow(0 2px 14px rgba(var(--accent-rgb),0.55));
}

/* Green P&L glow on win values */
.c-green { text-shadow: 0 0 12px rgba(34,197,94,0.25); }
.c-red   { text-shadow: 0 0 12px rgba(239,68,68,0.2); }

/* Accent line glow on section labels */
.section-label::before { animation: pulse-glow 3s ease-in-out infinite; }

/* KPI card value size */
.kpi-value { font-size: 23px; }

/* ── Responsive: keep every card readable and uncramped as the window shrinks ──
   Six-in-a-row at normal widths; shrink the number to fit when it gets tight,
   then drop to an even 3-up (and 2-up) grid instead of a cramped single row. */
@media (max-width: 1140px) {
  .kpi-value { font-size: 20px; letter-spacing: -0.7px; }
  .kpi-sub   { font-size: 10px; }
  .kpi-card  { padding: 14px 14px 13px; }
}
@media (max-width: 1080px) {
  .kpi-grid  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-value { font-size: 22px; letter-spacing: -1px; }
  .kpi-sub   { font-size: 11px; }
  .kpi-card  { padding: 16px 16px 14px; }
}
@media (max-width: 720px) {
  .kpi-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Smooth table row transitions */
.main-table tbody tr { transition: background 0.08s; }

/* Modal entrance */
.modal-overlay:not(.hidden) .modal-box {
  animation: fade-in 0.18s ease;
}

/* Strip icon subtle pulse on hover */
.strip-card:hover .strip-icon {
  box-shadow: 0 0 16px rgba(var(--accent-rgb),0.18);
}

/* Progress bar track subtle inner shadow */
.progress-track {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}

/* Better number rendering */
.kpi-value, .acct-value, .period-pnl, .tax-value, .pa-above-buf,
.strip-value, .pa-metric-val, .eq-stat-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Sidebar nav active accent pulse */
.nav-item.active::before {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* Calendar today cell glow */
.cal-cell.today {
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(var(--accent-rgb),0.15);
}

/* Table header sticky shadow */
.main-table thead th {
  box-shadow: 0 1px 0 var(--border);
}

/* Scrollbar refinement for main content */
.content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--border2), var(--border3));
}

/* Payout/tax card top accent */
.tax-card {
  position: relative;
  overflow: hidden;
}
.tax-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)) 0%, transparent 100%);
}

/* Period card top accent */
.period-card {
  position: relative;
  overflow: hidden;
}
.period-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--card-accent, var(--border3)) 0%, transparent 100%);
}

/* Equity card section label */
.equity-card .an-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ghost button danger variant */
.btn-ghost.btn-danger {
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.btn-ghost.btn-danger:hover {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.5);
}

/* Input date picker icon color */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(0.75);
}

/* ═══════════════════════════════════════════
   ACCOUNT PICKER MODAL CARDS
═══════════════════════════════════════════ */
.picker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 18px 22px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  text-align: center;
  user-select: none;
}

.picker-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb),0.12);
}

.picker-card-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.picker-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.picker-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════
   TAX FORM
═══════════════════════════════════════════ */
.tax-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 14px;
}
.tax-report-header .section-label { margin: 0; }
.tax-report-header-controls { display: flex; align-items: center; gap: 8px; }

/* The tax form is a paged WHITE document so the on-screen preview and the
   exported PDF look identical. Each .tf-page is one US-Letter sheet. */
.tf-doc { margin: 0 auto 40px; }
.tf-viewer { overflow-x: auto; }
.tf-page {
  box-sizing: border-box;
  width: 816px;            /* 8.5in @ 96dpi */
  min-height: 1056px;      /* 11in */
  margin: 0 auto;
  padding: 56px 64px;
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  display: none;
}
.tf-page.active { display: block; }
.tf-runhdr {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 9px; letter-spacing: 0.5px; color: #9ca3af;
  border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; margin-bottom: 18px;
}
.tf-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 16px; }
.tf-nav-ind { font-size: 12px; font-weight: 600; color: var(--text-dim); min-width: 96px; text-align: center; }

/* Print layout — printToPDF ignores @media print in this Electron, so a real
   body class arranges the document as printable pages (one .tf-page per sheet).
   Resetting ancestor overflow is what lets Chromium paginate. */
body.tf-printing,
body.tf-printing .app-layout,
body.tf-printing .content-area,
body.tf-printing .content,
body.tf-printing #page-payouts,
body.tf-printing #tax-section,
body.tf-printing #tax-section .pe-collapsible-body,
body.tf-printing .tf-doc,
body.tf-printing .tf-viewer {
  overflow: visible !important; height: auto !important; max-height: none !important;
}
body.tf-printing #page-payouts { display: block !important; }
body.tf-printing .sidebar,
body.tf-printing .page:not(#page-payouts),
body.tf-printing #page-payouts > .page-header,
body.tf-printing #pe-stats-dashboard,
body.tf-printing #payout-filter-bar,
body.tf-printing #payout-section,
body.tf-printing #expense-section,
body.tf-printing #tax-section .pe-collapsible-hdr,
body.tf-printing .tf-nav { display: none !important; }
body.tf-printing #tax-section { display: block !important; border: none !important; background: none !important; margin: 0 !important; padding: 0 !important; }
body.tf-printing #tax-section .pe-collapsible-body { display: block !important; padding: 0 !important; }
body.tf-printing .tf-page {
  display: block !important;
  width: 816px !important; min-height: 0 !important;
  margin: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  padding: 44px 56px !important;
  page-break-after: always;
}
body.tf-printing .tf-page:last-child { page-break-after: auto; }

.tf-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.tf-form-title { font-size: 18px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #111827; }
.tf-form-subtitle { font-size: 10px; color: #6b7280; margin-top: 3px; letter-spacing: 0.5px; }
.tf-year-badge { font-size: 30px; font-weight: 900; color: #ea580c; letter-spacing: -1px; font-family: var(--mono); }

.tf-rule-thick { border: none; border-top: 3px solid #ea580c; margin: 8px 0 20px; }
.tf-rule { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0; }

.tf-meta-row { display: flex; gap: 40px; margin-bottom: 24px; flex-wrap: wrap; }
.tf-meta-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: #6b7280; margin-bottom: 3px; }
.tf-meta-val { font-size: 12px; font-weight: 600; color: #111827; font-family: var(--mono); }

.tf-part-title {
  font-size: 9px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: #c2410c;
  background: #fff7ed;
  border-left: 3px solid #ea580c;
  padding: 6px 10px;
  margin: 22px 0 10px;
}

.tf-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tf-table th {
  text-align: left; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #6b7280;
  border-bottom: 1px solid #e5e7eb; padding: 6px 10px;
}
.tf-table th.tf-r { text-align: right; }
.tf-table td { padding: 7px 10px; border-bottom: 1px solid #f3f4f6; color: #1f2937; vertical-align: middle; }
.tf-table tbody tr:last-child td { border-bottom: none; }
.tf-table tfoot td { border-top: 2px solid #d1d5db; font-weight: 700; padding-top: 9px; border-bottom: none; }
.tf-table .tf-r { text-align: right; font-family: var(--mono); }
.tf-table .tf-muted { color: #6b7280; font-size: 11px; }
.tf-table .tf-empty { color: #9ca3af; font-style: italic; text-align: center; padding: 14px; }
.tf-line-num { color: #9ca3af; font-size: 10px; min-width: 20px; }

/* Money colors fixed for the white document (screen + print identical) */
.tf-page .c-green { color: #15803d !important; }
.tf-page .c-red   { color: #b91c1c !important; }
.tf-page .c-muted { color: #6b7280 !important; }

.tf-disclaimer {
  margin-top: 24px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 10px;
  color: #6b7280;
  line-height: 1.6;
}

.tf-sig-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid #d1d5db; }
.tf-sig-note { font-size: 10px; color: #6b7280; font-style: italic; margin-bottom: 22px; }
.tf-sig-row { display: flex; gap: 32px; }
.tf-sig-item { flex: 1; }
.tf-sig-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; margin-bottom: 20px; }
.tf-sig-line { border-bottom: 1px solid #9ca3af; height: 1px; }

.tf-footer { margin-top: 24px; font-size: 10px; color: #9ca3af; text-align: center; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════
   PRINT (Tax PDF export)
═══════════════════════════════════════════ */
@media print {
  /* Hide everything except the tax form */
  .no-print, .sidebar { display: none !important; }
  .app-layout { display: block !important; }
  .content-area { padding: 0 !important; margin: 0 !important; overflow: visible !important; }
  body, .content-area { background: #fff !important; }
  .page { display: none !important; padding: 0 !important; }
  #page-payouts { display: block !important; }

  /* Show only the tax form — strip the collapsible chrome around it */
  #tax-section { display: block !important; border: none !important; background: none !important; margin: 0 !important; padding: 0 !important; }
  #tax-section .pe-collapsible-body { display: block !important; padding: 0 !important; }

  /* One .tf-page == one printed sheet */
  .tf-doc, .tf-viewer { display: block !important; overflow: visible !important; margin: 0 !important; }
  .tf-nav { display: none !important; }
  .tf-page {
    display: block !important;
    width: 100% !important; min-height: 0 !important;
    box-shadow: none !important; border-radius: 0 !important;
    margin: 0 !important;
    page-break-after: always;
  }
  .tf-page:last-child { page-break-after: auto; }

  /* Keep rows and blocks from splitting awkwardly */
  .tf-header, .tf-meta-row, .tf-sig-section { break-inside: avoid; page-break-inside: avoid; }
  .tf-part-title { break-after: avoid; page-break-after: avoid; }
  .tf-table tr { break-inside: avoid; page-break-inside: avoid; }
  .tf-table thead { display: table-header-group; }   /* repeat column headers if a table spills */
}

/* ═══════════════════════════════════════════
   HABITS PAGE
═══════════════════════════════════════════ */
.habits-checkin {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.habits-checkin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.habits-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.habit-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 24px;
  border: 1px solid var(--border3);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.habit-chip:hover { border-color: var(--border3); color: var(--text); background: var(--surface2); }
.habit-chip-done {
  border-color: var(--green-border);
  background: var(--green-dim);
  color: var(--green);
}
.habit-chip-done:hover { border-color: var(--green); }
.habit-chip-check { font-size: 14px; line-height: 1; }

/* ═══════════════════════════════════════════
   ACCOUNTS DROPDOWN (trade form)
═══════════════════════════════════════════ */
.acct-dropdown { position: relative; }

.acct-dropdown-toggle {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: border-color 0.15s, color 0.15s;
}
.acct-dropdown-toggle:hover { border-color: var(--accent); }
.acct-dropdown-toggle.has-selection { color: var(--text); border-color: var(--accent); }

.acct-dropdown-arrow {
  font-size: 11px;
  opacity: 0.5;
  transition: transform 0.15s;
  flex-shrink: 0;
  margin-left: 8px;
}
.acct-dropdown.open .acct-dropdown-arrow { transform: rotate(180deg); }

.acct-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 300;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}
.acct-dropdown-menu.hidden { display: none; }

label.acct-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s, color 0.1s;
  user-select: none;
}
.acct-check-item:last-child { border-bottom: none; }
.acct-check-item:hover { background: var(--surface3); color: var(--text); }
.acct-check-item.checked { color: var(--accent); background: var(--accent-dim); }
.acct-check-item input[type="checkbox"] {
  display: none;
}
.acct-check-item::before {
  content: '';
  display: block;
  width: 12px; height: 12px;
  min-width: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border3);
  background: var(--surface);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.acct-check-item.checked::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.acct-no-accounts {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.acct-select-all {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.3px;
  transition: background 0.1s;
  user-select: none;
}
.acct-select-all:hover { background: var(--accent-dim); }

.payout-acct-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  max-height: 190px;
  overflow-y: auto;
}
.payout-acct-box .acct-select-all { position: sticky; top: 0; background: var(--surface2); z-index: 1; }
.payout-acct-box::-webkit-scrollbar { width: 6px; }
.payout-acct-box::-webkit-scrollbar-track { background: transparent; }
.payout-acct-box::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 3px; }
.payout-acct-box::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Blown accounts section */
.pa-blown-section { margin-top: 36px; }
.pa-blown-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--red-border);
}
.pa-blown-count {
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  color: var(--red);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
}
.pa-section-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  padding-bottom: 10px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.pa-section-count {
  background: var(--surface3); color: var(--text-dim);
  border-radius: 10px; padding: 1px 8px; font-size: 11px;
}
.pa-empty-inline { color: var(--text-muted); font-size: 13px; padding: 4px 0 2px; }
.pa-blown-header { cursor: pointer; user-select: none; }
.pa-collapse-arrow { font-size: 9px; color: var(--red); transition: transform 0.15s; }
.pa-blown-section.open .pa-collapse-arrow { transform: rotate(90deg); }
.pa-blown-body { display: none; }
.pa-blown-section.open .pa-blown-body { display: block; }

.pa-card-blown {
  opacity: 0.72;
  border-color: var(--red-border) !important;
}
.pa-blown-badge {
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  color: var(--red);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}


/* ═══════════════════════════════════════════
   GRADUATION SETUP BANNER
═══════════════════════════════════════════ */
.pa-setup-banner {
  background: var(--yellow-dim);
  border-bottom: 1px solid var(--yellow-border);
  border-left: 3px solid var(--yellow);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ═══════════════════════════════════════════
   DANGER BUTTON
═══════════════════════════════════════════ */
.btn-danger {
  margin-right: auto;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--red-border);
  background: var(--red-dim);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background: rgba(239,68,68,0.16); border-color: var(--red); }

/* ═══════════════════════════════════════════
   COLLAPSIBLE SECTIONS (Payouts & Expenses)
═══════════════════════════════════════════ */
.pe-collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface);
}
.pe-collapsible-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background: var(--surface2);
  user-select: none;
  transition: background 0.15s;
  letter-spacing: -0.1px;
}
.pe-collapsible-hdr:hover { background: var(--surface3); }
.pe-chevron { font-size: 12px; color: var(--text-muted); transition: color 0.15s; }
.pe-collapsible-hdr:hover .pe-chevron { color: var(--accent); }
.pe-collapsible-body { padding: 14px 16px 16px; }

/* ═══════════════════════════════════════════
   P&E STATS DASHBOARD
═══════════════════════════════════════════ */
.pe-dash-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  width: fit-content;
  margin-bottom: 16px;
}
.pe-dash-tab {
  padding: 5px 16px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.pe-dash-tab:hover { color: var(--text-dim); }
.pe-dash-tab.active { background: var(--surface3); color: var(--text); font-weight: 600; }

.pe-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.pe-stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.15s;
}
.pe-stat-card:hover { border-color: var(--border2); }
.pe-stat-card-accent {
  border-color: var(--accent-glow);
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--surface2) 70%);
}
.pe-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 7px;
}
.pe-stat-val { font-size: 19px; font-weight: 800; font-family: var(--mono); margin-bottom: 4px; letter-spacing: -0.5px; }
.pe-stat-sub { font-size: 11px; color: var(--text-muted); }

.pe-withdraw-box {
  max-width: 340px;
  margin: 0 auto 22px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--surface2) 75%);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-lg);
  padding: 13px 20px;
}
.pe-withdraw-box .pe-stat-label { margin-bottom: 6px; }
.pe-withdraw-val {
  font-size: 23px;
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.pe-withdraw-action { margin-top: 12px; padding-left: 22px; padding-right: 22px; }

/* Per-account payout amounts (2+ accounts selected) */
.p-pa-setall { margin-bottom: 10px; }
.p-pa-setall input { width: 100%; }
.p-peraccount-list { display: flex; flex-direction: column; gap: 7px; }
.p-pa-row {
  display: grid;
  grid-template-columns: 1fr auto 116px;
  align-items: center;
  gap: 10px;
}
.p-pa-name  { font-size: 13px; color: var(--text); }
.p-pa-avail { font-size: 11px; color: var(--text-muted); font-family: var(--mono); white-space: nowrap; }
.p-pa-row input { width: 100%; }
.p-peraccount-total {
  margin-top: 10px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
}

.pe-advanced { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 22px; }
.pe-adv-section {
  flex: 1 1 300px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.pe-adv-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.pe-adv-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; }
.pe-adv-bar-label { flex: 0 0 110px; color: var(--text-dim); }
.pe-adv-bar-track { flex: 1; height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.pe-adv-bar-fill { height: 100%; background: var(--red); border-radius: 3px; transition: width 0.3s; opacity: 0.75; }
.pe-adv-bar-val { flex: 0 0 78px; text-align: right; font-family: var(--mono); font-weight: 600; }

/* Edit button used in payout/expense/habit rows */
.pe-edit-btn {
  padding: 4px 14px;
  border-radius: 7px;
  border: 1px solid var(--border2);
  background: var(--surface3);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.pe-edit-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }

/* ═══════════════════════════════════════════
   HABITS — DAILY CHECK-IN CAROUSEL
═══════════════════════════════════════════ */
.hc-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 8px 0 32px;
}

.hc-greeting {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.6px;
  margin-bottom: 20px;
  text-align: center;
}

.hc-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 30px 30px 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

/* Saturday rest-day card (no habit prompt) */
.hc-restday { text-align: center; }
.hc-rest-icon { font-size: 40px; margin-bottom: 10px; line-height: 1; }
.hc-rest-sub { font-size: 13px; color: var(--text-dim); margin: 8px auto 18px; max-width: 340px; line-height: 1.5; }
.hc-restday-anyway {
  background: transparent; border: 1px solid var(--border3); color: var(--text-muted);
  font-size: 12px; font-weight: 600; padding: 7px 16px; border-radius: 8px;
  cursor: pointer; transition: border-color 0.14s, color 0.14s;
}
.hc-restday-anyway:hover { border-color: var(--accent); color: var(--accent); }

.hc-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.hc-dots { display: flex; gap: 7px; align-items: center; }
.hc-dot {
  width: 9px; height: 9px; border-radius: 50%;
  transition: background 0.2s, transform 0.2s;
}
.dot-yes   { background: var(--green); }
.dot-no    { background: var(--red); }
.dot-cur   { background: var(--accent); transform: scale(1.35); box-shadow: 0 0 8px var(--accent-glow); }
.dot-empty { background: var(--surface3); border: 1.5px solid var(--border2); }
.hc-step-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px; }

.hc-habit-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 26px;
  text-align: center;
  display: block;
}

.hc-yn-row { display: flex; gap: 12px; margin-bottom: 26px; }
.hc-yn-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border2);
  background: var(--surface3);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-dim);
}
.hc-yn-btn:hover { border-color: var(--border3); color: var(--text); transform: translateY(-1px); }
.hc-yes.hc-active {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green-bright);
}
.hc-no.hc-active {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red-bright);
}

.hc-nav { display: flex; justify-content: space-between; align-items: center; }
.hc-nav-btn {
  padding: 7px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.hc-nav-btn:hover { color: var(--text); border-color: var(--border3); }
.hc-nav-hidden { visibility: hidden; pointer-events: none; }
.hc-clear { color: var(--text-muted); }
.hc-clear:hover { color: var(--red); border-color: var(--red); }
.hc-finish {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.3);
}
.hc-finish:hover { box-shadow: 0 4px 18px rgba(var(--accent-rgb),0.4); color: #fff; }
.hc-finish:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ═══════════════════════════════════════════
   HABITS — THANK YOU
═══════════════════════════════════════════ */
.habits-thankyou {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 46px 24px;
  background: var(--surface2);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  gap: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.habits-ty-check {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--green-bright);
  margin-bottom: 8px;
}
.habits-ty-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.4px; }

/* ═══════════════════════════════════════════
   HABITS — MANAGE MODAL
═══════════════════════════════════════════ */
.hm-empty {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 18px 0 6px;
}
.hm-list { display: flex; flex-direction: column; gap: 5px; }
.hm-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface3);
  transition: border-color 0.15s;
}
.hm-list-row:hover { border-color: var(--border2); }
.hm-row-editing { border-color: var(--accent); background: var(--accent-dim); }
.hm-list-name { font-size: 13px; color: var(--text); font-weight: 500; }
.hm-inline-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 6px 10px;
  outline: none;
}
.hm-inline-input:focus { border-color: var(--accent); }
.hm-row-save { padding: 5px 14px; font-size: 12px; }
.hm-add-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px dashed var(--border3);
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.hm-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ═══════════════════════════════════════════
   HABITS — PERFORMANCE CARDS
═══════════════════════════════════════════ */
.habit-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.habit-stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color 0.15s;
}
.habit-stat-card:hover { border-color: var(--border2); }
.habit-stat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.habit-stat-comp { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.habit-stat-edge {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  margin-bottom: 13px;
}
.habit-stat-cols { display: flex; gap: 14px; }
.habit-stat-col { flex: 1; }
.habit-stat-col-hdr {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.habit-col-done { color: var(--green); }
.habit-col-skip { color: var(--red); opacity: 0.8; }
.habit-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}
.habit-stat-row span:first-child { color: var(--text-muted); }
.habit-stat-row span:last-child { font-family: var(--mono); font-weight: 600; color: var(--text-dim); }
.habit-stat-row span.c-green { color: var(--green-bright); }
.habit-stat-row span.c-red { color: var(--red-bright); }

/* Inline delete button in habit edit row */
.hm-row-del {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--red-border);
  background: var(--red-dim);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.hm-row-del:hover { background: rgba(239,68,68,0.16); border-color: var(--red); }

/* ═══════════════════════════════════════════
   EDIT DAY — CALENDAR PICKER
═══════════════════════════════════════════ */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dp-month-label { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.dp-nav {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--surface3);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.dp-nav:hover { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}
.dp-dow {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 4px 0;
}
.dp-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--text-dim);
}
.dp-blank { visibility: hidden; pointer-events: none; }
.dp-cell:disabled { opacity: 0.25; cursor: not-allowed; }
.dp-cell:not(:disabled):not(.dp-blank):hover { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.dp-full {
  background: var(--green-dim);
  border-color: var(--green-border);
  color: var(--green-bright);
}
.dp-partial {
  background: var(--yellow-dim);
  border-color: var(--yellow-border);
  color: var(--yellow);
}
.dp-today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--text); }

.dp-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding-bottom: 4px;
}
.dp-leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
}
.dp-dot { width: 9px; height: 9px; border-radius: 50%; }
.dp-dot-full    { background: var(--green); }
.dp-dot-partial { background: var(--yellow); }
.dp-dot-none    { background: var(--surface3); border: 1px solid var(--border2); }

/* ═══════════════════════════════════════════
   HABITS — BEST ROUTINE
═══════════════════════════════════════════ */
.best-routine-card {
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--surface2) 60%);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 8px;
}
.br-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.br-chip {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  color: var(--green-bright);
  font-size: 12px;
  font-weight: 600;
}
.br-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 10px; }
.br-stat { display: flex; flex-direction: column; gap: 3px; }
.br-stat-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.br-stat-val { font-size: 15px; font-weight: 800; font-family: var(--mono); color: var(--text); }
.br-note { font-size: 11px; color: var(--text-dim); }

/* ═══════════════════════════════════════════
   PER-ACCOUNT FILLS
═══════════════════════════════════════════ */
.fill-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 10px 0 6px;
}
.fill-title span { font-weight: 400; color: var(--text-muted); }
.fill-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 13px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
}
.fill-q { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.fill-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
.fill-toggle button {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 22px;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.fill-toggle button.on { background: var(--accent); color: #fff; }
.fill-toggle button:not(.on):hover { color: var(--text); }
.fill-hint { font-size: 10px; color: var(--text-muted); margin: 8px 0 0; }
.fill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 6px;
  max-height: 176px;
  overflow-y: auto;
  padding-right: 2px;
}
.fill-grid::-webkit-scrollbar { width: 4px; }
.fill-grid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.fill-cell {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 9px 6px;
  transition: border-color 0.12s, background 0.12s;
}
.fill-cell:focus-within { border-color: var(--accent); }
.fill-cell:has(.fill-input:not(:placeholder-shown)) { border-color: var(--accent-glow); background: var(--accent-dim); }
.fill-name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.fill-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  padding: 0;
  outline: none;
}
.fill-input::placeholder { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* ═══════════════════════════════════════════
   TRADE SCREENSHOTS
═══════════════════════════════════════════ */
.shot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shot-thumb {
  position: relative;
  width: 86px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border2);
}
.shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.shot-new { border-color: var(--accent-glow); }
.shot-del {
  position: absolute;
  top: 3px; right: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shot-del:hover { background: var(--red); }
.shot-add {
  width: 86px;
  height: 60px;
  border-radius: 8px;
  border: 1px dashed var(--border3);
  background: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.shot-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* Position adjustments (scale in / out) — one box per add/shave */
.adj-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.adj-card { display: flex; flex-direction: column; gap: 11px; background: var(--surface2); border: 1px solid var(--border2); border-left-width: 3px; border-radius: 10px; padding: 12px 13px; }
.adj-card.adj-add   { border-left-color: var(--accent); }
.adj-card.adj-shave { border-left-color: var(--accent); }
.adj-card-head { display: flex; align-items: flex-end; gap: 14px; }
.adj-tag { font-size: 12px; font-weight: 700; white-space: nowrap; padding-bottom: 7px; color: var(--accent); }
.adj-fld { display: flex; flex-direction: column; gap: 5px; }
.adj-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); }
.adj-tp { flex: 0 0 auto; }
.adj-size, .adj-contracts { width: 90px; padding: 7px 9px; font-size: 12px; background: var(--surface3); border: 1px solid var(--border2); border-radius: 7px; color: var(--text); }
.adj-card-row { display: flex; gap: 12px; align-items: flex-end; }
.adj-card-row .adj-fld-qty { flex: 1; }
.adj-card-row .adj-size { width: 100%; }
.adj-result { padding: 7px 9px; font-size: 12px; background: var(--surface3); border: 1px solid var(--border2); border-radius: 7px; color: var(--text); cursor: pointer; }
.adj-del { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 2px 6px 8px; border-radius: 5px; }
.adj-del:hover { color: var(--red); }
.adj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adj-chip { font-size: 11px; font-weight: 600; color: var(--text-dim); background: var(--surface3); border: 1px solid var(--border2); border-radius: 7px; padding: 5px 11px; cursor: pointer; transition: all 0.12s; }
.adj-chip:hover { border-color: var(--border3); color: var(--text); }
.adj-chip.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.adj-noacct { font-size: 11px; color: var(--text-muted); }
.adj-diff { margin-top: 1px; }
.adj-btns { display: flex; gap: 8px; margin-top: 10px; }
.adj-add-btn { flex: 1; padding: 8px; font-size: 12px; font-weight: 600; background: none; border: 1px dashed var(--border3); border-radius: 7px; cursor: pointer; }
.adj-add-btn.adj-in  { color: var(--accent); }
.adj-add-btn.adj-out { color: var(--accent); }
.adj-add-btn.adj-in:hover  { border-color: var(--accent); background: var(--accent-dim); }
.adj-add-btn.adj-out:hover { border-color: var(--accent); background: var(--accent-dim); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 600;                 /* above all modals (z-index 500) */
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-out;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 96vw;
  max-height: 94vh;
  transform-origin: center center;
  will-change: transform;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;        /* smooth high-quality scaling */
}
.lb-close {
  position: fixed; top: 16px; right: 20px; z-index: 2;
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(20,22,34,0.8); border: 1px solid var(--border3); color: var(--text);
  font-size: 17px; cursor: pointer; transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.lb-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.lb-hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 11.5px; color: var(--text-dim);
  background: rgba(20,22,34,0.75); border: 1px solid var(--border2);
  padding: 6px 14px; border-radius: 20px; pointer-events: none; white-space: nowrap;
}
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,22,34,0.8); border: 1px solid var(--border3); color: var(--text);
  font-size: 30px; line-height: 1; padding-bottom: 4px; cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.lb-nav:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.lb-prev { left: 22px; }
.lb-next { right: 22px; }
.lb-counter {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 12.5px; color: var(--text);
  background: rgba(20,22,34,0.8); border: 1px solid var(--border2);
  padding: 5px 13px; border-radius: 20px; pointer-events: none;
}

/* ═══════════════════════════════════════════
   STATS RANGE PRESETS
═══════════════════════════════════════════ */
.sr-preset { font-size: 11px; padding: 4px 12px; height: 28px; }
.sr-active {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-dim) !important;
}

/* Calendar clickable days */
.cal-clickable { cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; }
.cal-clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }

/* Range picker additions */
.rp-hint {
  color: var(--text-dim);
  font-size: 12px;
  margin: -10px 0 16px;
}
/* Definition / explainer callout — subtle orange accent panel */
.def-box {
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 11px 13px;
  margin: -4px 0 16px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}
.def-box strong { color: var(--text); font-weight: 700; }
.def-box .def-title {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.def-box ul { margin: 6px 0 0; padding-left: 16px; }
.def-box li { margin: 2px 0; }

/* Sweet-spot highlighted row in the Trades-Per-Day table */
.st tr.row-sweet { background: var(--accent-dim); }
.st tr.row-sweet td { font-weight: 700; }

/* Trading-rhythm stat tiles */
.rhythm-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.rhythm-tile { background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; padding: 12px 14px; }
.rhythm-val { font-size: 20px; font-weight: 800; color: var(--text); font-family: var(--mono); line-height: 1.1; }
.rhythm-lbl { font-size: 11px; color: var(--text-dim); margin-top: 5px; text-transform: uppercase; letter-spacing: .03em; }
.rhythm-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 900px) { .rhythm-row { grid-template-columns: repeat(2, 1fr); } }

/* ═══════════════════════════════════════════════════════════
   MOBILE — phones & small tablets: drawer nav + full-width
═══════════════════════════════════════════════════════════ */
.mobile-topbar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 760px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 150; height: 54px; padding: 0 12px;
    background: rgba(6,8,15,0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .mt-burger {
    background: none; border: 0; color: var(--text); cursor: pointer; flex-shrink: 0;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px;
  }
  .mt-burger:active { background: rgba(255,255,255,0.07); }
  .mt-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text); }
  .mt-brand svg { width: 24px; height: 24px; display: block; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; height: 100%;
    width: 248px; min-width: 248px;
    transform: translateX(-100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 50px rgba(0,0,0,0.7);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 180;
    background: rgba(2,3,8,0.55); opacity: 0; pointer-events: none; transition: opacity .26s;
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  .content { height: 100dvh; padding-top: 54px; }
  .page { padding: 16px 14px 72px; }
  .page-header { flex-wrap: wrap; gap: 12px; }
  .page-title { font-size: 22px; }

  .kpi-grid, .kpi-row, .acct-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 10px; }
  .kpi-value { font-size: 18px; letter-spacing: -0.5px; }
  .kpi-card { padding: 13px 12px; }

  .table-outer { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-topscroll { display: none; }

  .modal-overlay { align-items: flex-end; }
  .modal-box, .modal-lg { width: 100%; max-width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; padding: 22px 18px 26px; }
}

/* First-run onboarding gate (cloud): name your first strategy */
.onboard-gate { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(900px 520px at 50% -8%, rgba(var(--accent-rgb), 0.10), transparent 60%), var(--bg); }
.onboard-gate.hidden { display: none; }
.onboard-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border2); border-radius: 18px;
  padding: 40px 34px; text-align: center; box-shadow: 0 30px 90px -24px rgba(0,0,0,0.8); }
.onboard-brand { display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 24px; }
.onboard-leaf { width: 30px; height: 30px; fill: var(--accent); filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.4)); }
.onboard-card h1 { font-size: 23px; letter-spacing: -.5px; margin: 0 0 10px; color: var(--text); }
.onboard-card > p { color: var(--text-dim); font-size: 14.5px; line-height: 1.55; margin: 0 auto 24px; max-width: 340px; }
#onboard-name { width: 100%; background: var(--bg); border: 1px solid var(--border2); color: var(--text); padding: 13px 15px;
  border-radius: 11px; font-size: 15px; font-family: inherit; text-align: center; }
#onboard-name:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
.onboard-btn { width: 100%; margin-top: 16px; padding: 13px; font-size: 15px; justify-content: center; }
.onboard-err { color: var(--red); font-size: 13.5px; min-height: 18px; margin-top: 12px; }
.onboard-hint { color: var(--text-muted); font-size: 12.5px; margin: 18px 0 0; }

/* Win-rate mini-bar inside category tables */
.wrb { display: flex; align-items: center; gap: 8px; min-width: 78px; }
.wrb-track { flex: 1; height: 5px; min-width: 34px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.wrb-fill { height: 100%; border-radius: 3px; }
.wrb-fill.wrb-green { background: var(--green); }
.wrb-fill.wrb-red   { background: var(--red); }
.wrb-txt { font-size: 11px; font-variant-numeric: tabular-nums; min-width: 30px; color: var(--text-dim); }
.dp-sel {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 800;
}
