/* ═══════════════════════════════════════════════════════════
   TradingBot — AllCloudNoBreaks
   Design System: Dark Trading Terminal
   Fonts: Syne (headings) · DM Mono (numbers) · DM Sans (body)
═══════════════════════════════════════════════════════════ */

:root {
  --bg:         #080b10;
  --surface:    #0d1117;
  --card:       #111820;
  --card-hover: #151e2a;
  --border:     #1c2333;
  --border-mid: #253040;

  --cyan:       #00d4ff;
  --cyan-dim:   rgba(0,212,255,0.12);
  --green:      #00e676;
  --green-dim:  rgba(0,230,118,0.10);
  --red:        #ff4060;
  --red-dim:    rgba(255,64,96,0.10);
  --yellow:     #ffc107;
  --yellow-dim: rgba(255,193,7,0.10);
  --purple:     #b388ff;

  --text:       #dde3ee;
  --text-sec:   #8a96a8;
  --text-muted: #4a5568;

  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono { font-family: 'DM Mono', monospace; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

/* ══════════════════════════════════════════
   STATUS BAR
══════════════════════════════════════════ */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 20px;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 200;
}

.status-bar-left, .status-bar-right { display: flex; align-items: center; gap: 10px; }
.status-bar-center { flex: 1; display: flex; justify-content: center; }

.status-label { font-size: 12px; color: var(--text-sec); }
.status-divider { color: var(--border-mid); font-size: 12px; }

.status-dot-wrap { display: flex; align-items: center; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.status-dot.live { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.status-dot.loading { background: var(--yellow); animation: pulse 1s infinite; }
.status-dot.offline { background: var(--red); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* P&L Tracker */
.pnl-tracker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 12px;
}
.pnl-label { color: var(--text-muted); }
.pnl-value { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--text); }
.pnl-value.negative { color: var(--red); }
.pnl-value.positive { color: var(--green); }
.pnl-limit { color: var(--text-muted); }
.pnl-bar-wrap { width: 60px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pnl-bar { height: 100%; background: var(--green); border-radius: 2px; transition: all .3s; }
.pnl-bar.warn { background: var(--yellow); }
.pnl-bar.danger { background: var(--red); }
.pnl-status { font-size: 11px; font-weight: 600; }

/* Mode Toggle */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.mode-toggle:hover { background: rgba(0,212,255,0.2); }
.mode-toggle.standard { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); }

.settings-btn, .notif-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-sec);
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.settings-btn:hover, .notif-btn:hover { border-color: var(--cyan); color: var(--cyan); }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  height: 56px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  font-size: 20px;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px var(--cyan));
  animation: logoPulse 3s ease infinite;
}
@keyframes logoPulse { 0%,100%{filter:drop-shadow(0 0 8px var(--cyan))} 50%{filter:drop-shadow(0 0 16px var(--cyan))} }
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; color: var(--text); }
.logo-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 0.05em; }

.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-btn {
  background: none;
  border: none;
  color: var(--text-sec);
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
  position: relative;
}
.nav-btn:hover { color: var(--text); background: var(--card); }
.nav-btn.active { color: var(--cyan); background: var(--cyan-dim); }
.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px 2px 0 0;
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  margin-left: auto;
}

/* ══════════════════════════════════════════
   MARKET PULSE STRIP
══════════════════════════════════════════ */
.market-pulse {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.market-pulse::-webkit-scrollbar { display: none; }
.pulse-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.pulse-tickers { display: flex; gap: 8px; }
.pulse-ticker {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--card);
  white-space: nowrap;
  border: 1px solid var(--border);
}
.pulse-ticker .pt-symbol { color: var(--text-sec); font-size: 11px; }
.pulse-ticker .pt-val { font-weight: 500; }
.pulse-ticker.up { border-color: rgba(0,230,118,0.2); }
.pulse-ticker.up .pt-val { color: var(--green); }
.pulse-ticker.down { border-color: rgba(255,64,96,0.2); }
.pulse-ticker.down .pt-val { color: var(--red); }
.pulse-ticker.flat .pt-val { color: var(--text-muted); }
.pulse-loading { font-size: 12px; color: var(--text-muted); }
.pulse-time { font-size: 10px; color: var(--text-muted); flex-shrink: 0; margin-left: auto; }

/* ══════════════════════════════════════════
   MAIN & TAB SYSTEM
══════════════════════════════════════════ */
.main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
  width: 100%;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.tab-title { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; color: var(--text); }
.tab-subtitle { font-size: 13px; color: var(--text-muted); }
.tab-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════
   BRIEFING TAB
══════════════════════════════════════════ */
.briefing-hero {
  margin-bottom: 24px;
}
.briefing-date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.briefing-greeting {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.briefing-subtitle { font-size: 14px; color: var(--text-sec); margin-top: 4px; }

/* Checklist */
.checklist-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.checklist-title { font-weight: 600; font-size: 14px; color: var(--text); }
.checklist-progress {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-sec);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.checklist-items { display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--text-sec);
  font-size: 13px;
  transition: color var(--transition);
}
.check-item input[type="checkbox"] {
  accent-color: var(--green);
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}
.check-item:has(input:checked) { color: var(--text); }
.check-item:has(input:checked) span { text-decoration: line-through; opacity: .6; }
.checklist-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.checklist-incomplete { font-size: 12px; color: var(--yellow); }
.checklist-complete { font-size: 12px; color: var(--green); font-weight: 600; }

.briefing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.briefing-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.briefing-section-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.briefing-candidate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: border-color var(--transition);
}
.briefing-candidate:hover { border-color: var(--cyan); }
.bc-rank {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  width: 16px;
  flex-shrink: 0;
}
.bc-symbol {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 14px;
  color: var(--cyan);
  min-width: 50px;
}
.bc-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bc-price { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--text); }
.bc-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-sec);
  font-family: 'DM Mono', monospace;
}
.bc-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.bc-badge.prime { background: rgba(255,193,7,0.15); color: var(--yellow); border: 1px solid rgba(255,193,7,0.3); }
.bc-badge.quality { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,230,118,0.3); }
.bc-badge.borderline { background: var(--yellow-dim); color: var(--yellow); }

.cal-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cal-event:last-child { border-bottom: none; }
.cal-time { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-muted); min-width: 55px; }
.cal-name { flex: 1; color: var(--text-sec); }
.cal-impact {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}
.cal-impact.high { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,64,96,.3); }
.cal-impact.med  { background: var(--yellow-dim); color: var(--yellow); }
.cal-impact.low  { background: var(--border); color: var(--text-muted); }
.cal-event-none { font-size: 13px; color: var(--text-muted); line-height: 1.8; }

.briefing-market-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.briefing-market-row:last-child { border-bottom: none; }
.bm-symbol { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--text-sec); }
.bm-price { font-family: 'DM Mono', monospace; color: var(--text); }
.bm-chg { font-family: 'DM Mono', monospace; font-size: 12px; }
.bm-chg.up { color: var(--green); }
.bm-chg.down { color: var(--red); }

.briefing-status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.bsc-title {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.bsc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bsc-item { display: flex; flex-direction: column; gap: 4px; }
.bsc-label { font-size: 11px; color: var(--text-muted); }
.bsc-val { font-family: 'DM Mono', monospace; font-size: 16px; font-weight: 500; color: var(--text); }

/* ══════════════════════════════════════════
   FILTERS
══════════════════════════════════════════ */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-sec);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.filter-btn.active { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }
.filter-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-sec);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}
.filter-select:hover, .filter-select:focus { border-color: var(--cyan); }

/* Plain English Toggle */
.plain-english-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-sec);
  white-space: nowrap;
}
.plain-english-toggle input { display: none; }
.toggle-track {
  width: 32px; height: 18px;
  background: var(--border-mid);
  border-radius: 9px;
  position: relative;
  transition: background var(--transition);
}
.toggle-thumb {
  width: 14px; height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: all var(--transition);
}
.plain-english-toggle input:checked ~ .toggle-track { background: var(--cyan); }
.plain-english-toggle input:checked ~ .toggle-track .toggle-thumb { left: 16px; background: #fff; }
.toggle-label { font-size: 12px; color: var(--text-sec); }

/* Summary Pills */
.summary-pills { display: flex; gap: 6px; }
.pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-sec);
}
.pill strong { color: var(--text); font-weight: 600; }
.pill.buy strong { color: var(--green); }
.pill.sell strong { color: var(--red); }

/* ══════════════════════════════════════════
   SIGNAL CARDS
══════════════════════════════════════════ */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.signal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.signal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: 3px 0 0 3px;
}
.signal-card.buy { border-color: rgba(0,230,118,0.15); }
.signal-card.buy::before { background: var(--green); }
.signal-card.sell { border-color: rgba(255,64,96,0.15); }
.signal-card.sell::before { background: var(--red); }
.signal-card:hover { transform: translateY(-2px); border-color: rgba(0,212,255,0.3); box-shadow: var(--shadow); }

.signal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.signal-symbol {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}
.signal-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.08em;
}
.signal-badge.buy { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,230,118,0.3); }
.signal-badge.sell { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,64,96,0.3); }

.signal-confidence { margin-bottom: 14px; }
.confidence-bar-bg {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}
.confidence-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.confidence-bar.high { background: var(--green); }
.confidence-bar.medium { background: var(--yellow); }
.confidence-bar.low { background: var(--red); }
.confidence-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.confidence-label span:last-child { font-family: 'DM Mono', monospace; font-weight: 500; }

.signal-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.signal-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.signal-meta-label { color: var(--text-muted); }
.signal-meta-value { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--text); }
.signal-meta-value.green { color: var(--green); }
.signal-meta-value.red { color: var(--red); }

.signal-strategy {
  font-size: 11px;
  color: var(--cyan);
  font-weight: 500;
  margin-bottom: 6px;
  font-family: 'DM Mono', monospace;
}

.signal-reasoning {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.5;
}

/* Plain English card additions */
.signal-plain-why {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.6;
  border-left: 2px solid var(--cyan);
}
.signal-plain-why strong { color: var(--text); }

/* Position sizing */
.signal-sizing {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 10px;
  border: 1px solid var(--border);
}
.sizing-title {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-family: 'DM Mono', monospace;
}
.sizing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sizing-item { display: flex; justify-content: space-between; font-size: 11px; }
.sizing-label { color: var(--text-muted); }
.sizing-val { font-family: 'DM Mono', monospace; color: var(--text); }

/* Warning badges */
.signal-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-dim);
  border: 1px solid rgba(255,64,96,.3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--red);
  line-height: 1.4;
}
.signal-info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 4px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}
.signal-tags { margin-bottom: 8px; }

/* SAC2024 quality badge */
.sac-quality {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.sac-quality.prime { background: rgba(255,193,7,.15); color: var(--yellow); border: 1px solid rgba(255,193,7,.3); }
.sac-quality.quality { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,230,118,.3); }
.sac-quality.borderline { background: var(--yellow-dim); color: var(--yellow); }

/* ══════════════════════════════════════════
   SAC2024 TAB
══════════════════════════════════════════ */
.sac-hero {
  text-align: center;
  padding: 28px 0 20px;
  margin-bottom: 20px;
}
.sac-badge {
  display: inline-block;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.sac-title {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.sac-subtitle { font-size: 14px; color: var(--text-sec); }

.sac-criteria-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: center;
}
.crit-pill {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-sec);
  font-weight: 500;
}

/* ══════════════════════════════════════════
   PERFORMANCE TAB
══════════════════════════════════════════ */
.perf-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.perf-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perf-stat-val {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.perf-stat-label { font-size: 12px; color: var(--text-muted); }

/* Strategy Leaderboard */
.strategy-leaderboard { display: flex; flex-direction: column; gap: 8px; }
.strat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: border-color var(--transition);
}
.strat-row:hover { border-color: var(--border-mid); }
.strat-rank { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-muted); min-width: 20px; }
.strat-name { flex: 1; font-weight: 500; font-size: 13px; color: var(--text); }
.strat-stats { display: flex; gap: 20px; align-items: center; }
.strat-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.strat-stat-val { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; }
.strat-stat-label { font-size: 10px; color: var(--text-muted); }
.strat-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  min-width: 52px;
  text-align: center;
}
.strat-trend.hot { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,230,118,.3); }
.strat-trend.ok { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(255,193,7,.3); }
.strat-trend.cold { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,64,96,.3); }
.strat-trend.few { background: var(--card); color: var(--text-muted); border: 1px solid var(--border); }

/* History */
.history-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.history-search {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}
.history-search:focus { border-color: var(--cyan); }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(28,35,51,0.5);
  color: var(--text-sec);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}
.data-table tr:hover td { background: var(--card); }
.data-table td.win { color: var(--green); }
.data-table td.loss { color: var(--red); }
.data-table td.stopped { color: var(--yellow); }
.data-table td.pending { color: var(--text-muted); }
.empty-state { color: var(--text-muted); text-align: center; padding: 40px !important; font-family: 'DM Sans', sans-serif; font-size: 13px; }

/* ══════════════════════════════════════════
   JOURNAL TAB
══════════════════════════════════════════ */
.journal-analytics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.ja-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ja-val { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 700; color: var(--text); }
.ja-label { font-size: 12px; color: var(--text-muted); }

.emotion-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.emotion-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}
.emotion-icon { font-size: 20px; }
.emotion-name { font-size: 11px; color: var(--text-muted); }
.emotion-stats { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; color: var(--text); }
.emotion-winrate { font-size: 10px; }
.emotion-winrate.good { color: var(--green); }
.emotion-winrate.bad { color: var(--red); }
.emotion-winrate.ok { color: var(--yellow); }

.journal-entries { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.journal-entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color var(--transition);
}
.journal-entry:hover { border-color: var(--border-mid); }
.je-result {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 52px;
  text-align: center;
  flex-shrink: 0;
}
.je-result.WIN { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,230,118,.3); }
.je-result.LOSS { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,64,96,.3); }
.je-result.SCRATCH { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(255,193,7,.3); }
.je-body { flex: 1; }
.je-header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.je-ticker { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); }
.je-pnl { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; }
.je-pnl.pos { color: var(--green); }
.je-pnl.neg { color: var(--red); }
.je-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.je-emotion { font-size: 12px; }
.je-notes { font-size: 12px; color: var(--text-sec); margin-top: 6px; font-style: italic; line-height: 1.5; }
.je-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.je-delete:hover { color: var(--red); }

.empty-journal { text-align: center; padding: 40px; color: var(--text-sec); line-height: 2; }
.journal-footer { display: flex; gap: 10px; }

/* ══════════════════════════════════════════
   WATCHLIST TAB
══════════════════════════════════════════ */
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.watchlist-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: border-color var(--transition), transform var(--transition);
  cursor: default;
}
.watchlist-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.watchlist-symbol { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.watchlist-signals { font-size: 11px; color: var(--text-muted); }
.watchlist-signals.active { color: var(--cyan); }

/* ══════════════════════════════════════════
   HOW IT WORKS TAB
══════════════════════════════════════════ */
.hiw-hero { text-align: center; padding: 28px 0 24px; }
.hiw-hero h2 { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.hiw-subtitle { font-size: 14px; color: var(--text-sec); }

.hiw-body { max-width: 900px; margin: 0 auto; }
.hiw-section { margin-bottom: 32px; }
.hiw-section h3 { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.hiw-section p { font-size: 14px; color: var(--text-sec); line-height: 1.7; margin-bottom: 12px; }

.hiw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hiw-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.hiw-card-title { font-weight: 600; font-size: 13px; color: var(--cyan); margin-bottom: 6px; }
.hiw-card-body { font-size: 13px; color: var(--text-sec); line-height: 1.6; }

.hiw-callout {
  background: var(--cyan-dim);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 12px;
}
.hiw-callout strong { color: var(--text); }

.hiw-list { padding-left: 20px; }
.hiw-list li { font-size: 13px; color: var(--text-sec); line-height: 1.8; }
.hiw-list li strong { color: var(--text); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn-primary {
  background: var(--cyan);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover { opacity: .85; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-sec);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-danger {
  background: var(--red-dim);
  border: 1px solid rgba(255,64,96,.3);
  color: var(--red);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover { background: rgba(255,64,96,.2); }

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .15s ease; }
.modal {
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal-wide { max-width: 580px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }

.setting-group { margin-bottom: 16px; }
.setting-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-sec); margin-bottom: 6px; }
.setting-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
.setting-input:focus { border-color: var(--cyan); }
.setting-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.setting-input-wrap { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color var(--transition); }
.setting-input-wrap:focus-within { border-color: var(--cyan); }
.setting-input-wrap .setting-input { border: none; background: transparent; }
.input-prefix { padding: 8px 10px; color: var(--text-muted); font-family: 'DM Mono', monospace; font-size: 13px; border-right: 1px solid var(--border); flex-shrink: 0; }

.trade-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trade-pnl-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text-sec);
  text-align: center;
  margin-top: 12px;
}

/* ══════════════════════════════════════════
   STOP OVERLAY
══════════════════════════════════════════ */
.stop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,64,96,.08);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.stop-card {
  background: var(--card);
  border: 2px solid var(--red);
  border-radius: 14px;
  padding: 40px 32px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,64,96,.3);
}
.stop-icon { font-size: 48px; margin-bottom: 16px; }
.stop-title {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.stop-reason { font-size: 14px; color: var(--text); margin-bottom: 12px; font-weight: 500; }
.stop-text { font-size: 13px; color: var(--text-sec); line-height: 1.7; margin-bottom: 24px; }

/* ══════════════════════════════════════════
   LOADING STATES
══════════════════════════════════════════ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
  grid-column: 1 / -1;
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-disclaimer { font-size: 11px; }

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .status-bar { padding: 6px 14px; gap: 8px; }
  .status-bar-center { order: 3; width: 100%; justify-content: flex-start; }
  .pnl-tracker { width: 100%; }

  .header-inner { height: 48px; gap: 12px; }
  .logo-name { font-size: 14px; }
  .nav { display: none; }
  .nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 104px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px;
    z-index: 150;
    box-shadow: var(--shadow);
  }
  .hamburger { display: flex; align-items: center; justify-content: center; }

  .main { padding: 16px 14px; }

  .briefing-grid { grid-template-columns: 1fr; }
  .bsc-grid { grid-template-columns: repeat(2, 1fr); }

  .signal-grid { grid-template-columns: 1fr; }

  .perf-overview { grid-template-columns: repeat(2, 1fr); }
  .journal-analytics { grid-template-columns: repeat(2, 1fr); }

  .trade-form-grid { grid-template-columns: 1fr; }

  .strat-stats { gap: 12px; }
  .strat-stat-label { display: none; }

  .data-table th:nth-child(4),
  .data-table td:nth-child(4) { display: none; }

  .hiw-grid { grid-template-columns: 1fr; }

  .watchlist-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

  .footer { flex-direction: column; gap: 4px; text-align: center; }
}

@media (max-width: 480px) {
  .perf-overview { grid-template-columns: 1fr 1fr; }
  .journal-analytics { grid-template-columns: 1fr 1fr; }
  .sac-criteria-bar { gap: 6px; }
  .crit-pill { font-size: 11px; padding: 4px 8px; }
}
