/* ═══════════════════════════════════════════════════════════
   MarketSentinel AI — Dashboard CSS
   Aesthetic: Precision Dark Terminal × Editorial Finance
   Font: Syne (display) + JetBrains Mono (data/numbers)
═══════════════════════════════════════════════════════════ */

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

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:        #09090B;
  --surface:   #111114;
  --surface2:  #18181C;
  --surface3:  #1F1F25;
  --border:    #27272D;
  --border2:   #3A3A44;
  --gold:      #F5A623;
  --gold2:     #FFBB4A;
  --green:     #00E5A0;
  --red:       #FF4560;
  --blue:      #3D9AFF;
  --teal:      #00C9B1;
  --purple:    #9B6DFF;
  --text:      #E8E8F0;
  --text2:     #9999AA;
  --text3:     #555566;
  --sidebar-w: 220px;
  --topbar-h:  52px;
  --mono:      'JetBrains Mono', monospace;
  --display:   'Syne', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  display: flex;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.25s ease;
}

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

.logo-mark {
  width: 32px; height: 32px;
  background: var(--gold);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.5px;
}
.logo-tag {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Nav ────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border2); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text2);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.3px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; }
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(245, 166, 35, 0.06);
}
.nav-item.active svg { stroke: var(--gold); }

.nav-badge {
  font-size: 8px;
  padding: 2px 6px;
  background: var(--red);
  color: white;
  border-radius: 2px;
  letter-spacing: 1px;
  font-weight: 600;
}
.nav-badge.pulse { background: var(--green); color: var(--bg); animation: badge-pulse 2s infinite; }
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Sidebar Footer ─────────────────────────────────────── */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.market-status { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text2); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
  transition: background 0.3s;
}
.status-dot.open { background: var(--green); box-shadow: 0 0 8px var(--green); animation: badge-pulse 2s infinite; }
.status-dot.closed { background: var(--red); }
.sidebar-time { font-size: 10px; color: var(--text3); letter-spacing: 1px; }

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Top Bar ───────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.menu-btn {
  background: none; border: none; color: var(--text2); cursor: pointer;
  display: flex; align-items: center;
}
.menu-btn svg { width: 18px; height: 18px; }
.topbar-title { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--text); }

/* ── Ticker Bar ─────────────────────────────────────────── */
.ticker-bar {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.ticker-track {
  display: flex;
  gap: 0;
  animation: ticker-scroll 45s linear infinite;
  white-space: nowrap;
}
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-size: 11px;
  color: var(--text2);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.ticker-item .t-sym { font-weight: 600; color: var(--text); }
.ticker-item .t-ltp { color: var(--text); }
.ticker-item .t-chg { }
.ticker-item.up .t-chg { color: var(--green); }
.ticker-item.dn .t-chg { color: var(--red); }

/* ── Topbar Right ───────────────────────────────────────── */
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-btn {
  background: none; border: none; color: var(--text2); cursor: pointer;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: all 0.15s;
}
.topbar-btn:hover { color: var(--text); background: var(--surface2); }
.topbar-btn svg { width: 16px; height: 16px; }
.topbar-alert {
  position: relative; cursor: pointer; display: flex; align-items: center;
  color: var(--text2);
}
.topbar-alert svg { width: 18px; height: 18px; }
.topbar-alert span {
  position: absolute; top: -4px; right: -6px;
  background: var(--red); color: white;
  font-size: 9px; width: 14px; height: 14px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   VIEWS
══════════════════════════════════════════════════════════ */
.view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.view.active { display: flex; flex-direction: column; gap: 16px; }
.view::-webkit-scrollbar { width: 4px; }
.view::-webkit-scrollbar-thumb { background: var(--border2); }

/* ══════════════════════════════════════════════════════════
   SIGNAL BANNER
══════════════════════════════════════════════════════════ */
.signal-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.sb-left { min-width: 110px; }
.sb-label { font-size: 9px; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; }
.sb-symbol { font-family: var(--display); font-size: 18px; font-weight: 700; }

.sb-score-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 100px; }
.sb-score {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
}
.sb-bar { height: 4px; background: var(--border2); border-radius: 2px; overflow: hidden; }
.sb-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width 0.5s ease; }

.sb-direction {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  min-width: 150px;
}
.sb-direction.STRONG_BUY { color: var(--green); }
.sb-direction.BUY { color: #80FFD4; }
.sb-direction.NEUTRAL { color: var(--text2); }
.sb-direction.SELL { color: #FF9999; }
.sb-direction.STRONG_SELL { color: var(--red); }

.sb-levels { display: flex; gap: 20px; }
.sb-level { display: flex; flex-direction: column; gap: 2px; }
.sb-level span { font-size: 9px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; }
.sb-level strong { font-size: 15px; font-family: var(--mono); font-weight: 500; }
.up { color: var(--green); }
.dn { color: var(--red); }

.sb-components { display: flex; gap: 16px; margin-left: auto; }
.sb-comp { display: flex; flex-direction: column; gap: 4px; }
.sb-comp span { font-size: 9px; letter-spacing: 2px; color: var(--text3); }
.sb-mini-bar { width: 60px; height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden; }
.sb-mini-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width 0.4s ease; }

/* ══════════════════════════════════════════════════════════
   WATCHLIST STRIP
══════════════════════════════════════════════════════════ */
.watchlist-strip {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.watchlist-strip::-webkit-scrollbar { height: 3px; }
.watchlist-strip::-webkit-scrollbar-thumb { background: var(--border2); }

.wl-item {
  background: var(--surface);
  padding: 10px 16px;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 120px;
  transition: background 0.15s;
}
.wl-item:hover { background: var(--surface2); }
.wl-item.active { border-top: 2px solid var(--gold); }
.wl-sym { font-size: 10px; letter-spacing: 1px; color: var(--text2); margin-bottom: 4px; }
.wl-ltp { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--text); line-height: 1; }
.wl-chg { font-size: 11px; margin-top: 4px; }
.wl-item.up-item .wl-chg { color: var(--green); }
.wl-item.dn-item .wl-chg { color: var(--red); }

/* ══════════════════════════════════════════════════════════
   DASHBOARD GRID / CARDS
══════════════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1px;
  background: var(--border);
  flex: 1;
  min-height: 0;
}

.card {
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-chart    { grid-column: 1 / 3; }
.card-macro    { grid-column: 3 / 4; }
.card-fno      { grid-column: 1 / 2; }
.card-news     { grid-column: 2 / 4; }
.card-fii      { grid-column: 1 / 2; }
.card-india-signals { grid-column: 2 / 4; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.card-title { font-size: 10px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; }

/* ─ Chart card ──────────────────────────────────────────── */
.chart-controls { display: flex; gap: 4px; }
.cc-btn {
  font-size: 10px; padding: 3px 8px; border: 1px solid var(--border2);
  background: none; color: var(--text2); cursor: pointer; font-family: var(--mono);
  transition: all 0.15s;
}
.cc-btn:hover { color: var(--text); border-color: var(--text3); }
.cc-btn.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }

.mini-chart-container { flex: 1; min-height: 180px; }

/* ─ Macro card ──────────────────────────────────────────── */
.macro-sentiment {
  font-size: 10px; padding: 3px 8px;
  background: var(--surface3); color: var(--text2);
  letter-spacing: 1px;
}
.macro-sentiment.RISK_ON { background: rgba(0,229,160,0.15); color: var(--green); }
.macro-sentiment.RISK_OFF { background: rgba(255,69,96,0.15); color: var(--red); }

.macro-grid {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}
.macro-row {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.macro-row:last-child { border-bottom: none; }
.mr-flag { font-size: 14px; flex-shrink: 0; }
.mr-name { font-size: 11px; color: var(--text2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-ltp { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text); min-width: 70px; text-align: right; }
.mr-pct { font-size: 11px; min-width: 60px; text-align: right; font-family: var(--mono); }
.mr-pct.up { color: var(--green); }
.mr-pct.dn { color: var(--red); }

/* ─ F&O card ─────────────────────────────────────────────── */
.fno-tabs { display: flex; gap: 4px; }
.fno-tab {
  font-size: 10px; padding: 3px 8px; border: 1px solid var(--border2);
  background: none; color: var(--text2); cursor: pointer; font-family: var(--mono);
}
.fno-tab.active { background: var(--teal); color: var(--bg); border-color: var(--teal); }

.fno-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow-y: auto;
}
.fno-metric {
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.fno-metric.full { grid-column: 1 / -1; }
.fno-metric:nth-child(even) { border-right: none; }
.fm-label { font-size: 9px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; margin-bottom: 4px; }
.fm-value { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--text); }
.fm-value-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fv-chip {
  font-size: 11px; padding: 2px 8px;
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text);
}
.fv-chip.support { border-color: var(--green); color: var(--green); }
.fv-chip.resistance { border-color: var(--red); color: var(--red); }

/* ─ News card ────────────────────────────────────────────── */
.news-sentiment-badge {
  font-size: 10px; padding: 3px 8px; letter-spacing: 1px;
}
.news-sentiment-badge.BULLISH { background: rgba(0,229,160,0.15); color: var(--green); }
.news-sentiment-badge.BEARISH { background: rgba(255,69,96,0.15); color: var(--red); }
.news-sentiment-badge.NEUTRAL { background: var(--surface3); color: var(--text2); }

.news-list { flex: 1; overflow-y: auto; }
.news-loading { padding: 20px; color: var(--text3); font-size: 12px; text-align: center; }

.news-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.news-item:hover { background: var(--surface2); }
.news-item-header { display: flex; align-items: flex-start; gap: 8px; }
.news-impact { width: 4px; flex-shrink: 0; border-radius: 2px; margin-top: 2px; align-self: stretch; }
.news-title { font-size: 12px; color: var(--text); line-height: 1.4; flex: 1; }
.news-meta { display: flex; gap: 8px; align-items: center; padding-left: 12px; }
.news-source { font-size: 10px; color: var(--text3); }
.news-time { font-size: 10px; color: var(--text3); }
.news-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.news-tag {
  font-size: 9px; padding: 1px 5px;
  background: var(--surface3); color: var(--text2);
  border-radius: 2px; letter-spacing: 0.5px;
}
.news-tag.BULLISH { background: rgba(0,229,160,0.1); color: var(--green); }
.news-tag.BEARISH { background: rgba(255,69,96,0.1); color: var(--red); }

/* ─ FII/DII card ─────────────────────────────────────────── */
.fii-grid { display: flex; flex-direction: column; flex: 1; }
.fii-block { padding: 16px 14px; flex: 1; border-bottom: 1px solid var(--border); }
.fii-block:last-child { border-bottom: none; }
.fii-label { font-size: 9px; letter-spacing: 3px; color: var(--text3); text-transform: uppercase; margin-bottom: 8px; }
.fii-value {
  font-family: var(--display);
  font-size: 24px; font-weight: 800;
  line-height: 1; margin-bottom: 8px;
}
.fii-block.fii .fii-value { color: var(--green); }
.fii-block.dii .fii-value { color: var(--blue); }
.fii-sub { display: flex; gap: 16px; font-size: 11px; color: var(--text2); }
.fii-sub strong { color: var(--text); }
.card-date { font-size: 10px; color: var(--text3); }

/* ─ India Signals card ────────────────────────────────────── */
.india-signals-list { display: flex; flex-direction: column; overflow-y: auto; flex: 1; }
.india-signal-item {
  display: flex; align-items: center;
  padding: 9px 14px; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.is-name { font-size: 11px; color: var(--text2); flex: 1; }
.is-move { font-family: var(--mono); font-size: 12px; font-weight: 500; min-width: 60px; }
.is-impact {
  font-size: 10px; padding: 2px 8px; letter-spacing: 1px;
}
.is-impact.BULLISH { background: rgba(0,229,160,0.15); color: var(--green); }
.is-impact.BEARISH { background: rgba(255,69,96,0.15); color: var(--red); }
.is-note { font-size: 10px; color: var(--text3); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════
   LIVE CHARTS VIEW
══════════════════════════════════════════════════════════ */
#view-chart { gap: 0; padding: 0; }

.chart-view-header {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chart-symbol-selector, .chart-interval-selector { display: flex; gap: 4px; }
.chart-symbol-selector { flex: 1; flex-wrap: wrap; }
.css-btn, .cis-btn {
  font-size: 11px; padding: 4px 10px;
  border: 1px solid var(--border2);
  background: none; color: var(--text2);
  cursor: pointer; font-family: var(--mono);
  transition: all 0.15s;
}
.css-btn:hover, .cis-btn:hover { color: var(--text); border-color: var(--text3); }
.css-btn.active { background: rgba(245,166,35,0.15); color: var(--gold); border-color: var(--gold); }
.cis-btn.active { background: rgba(61,154,255,0.15); color: var(--blue); border-color: var(--blue); }

.chart-stats-bar {
  display: flex; gap: 20px; align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.csb-item { font-size: 11px; color: var(--text2); }
.csb-item strong { color: var(--text); font-weight: 500; }

.main-chart-container {
  flex: 1;
  min-height: 0;
  background: var(--surface);
}
.indicator-strip {
  display: flex; gap: 1px;
  background: var(--border);
  height: 120px; flex-shrink: 0;
}
.indicator-row { flex: 1; background: var(--surface); }

/* ══════════════════════════════════════════════════════════
   F&O VIEW — OPTION CHAIN
══════════════════════════════════════════════════════════ */
#view-fno { padding: 0; gap: 0; }

.fno-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fno-symbol-tabs { display: flex; border-bottom: 1px solid var(--border); }
.fst {
  padding: 10px 24px; font-size: 12px; font-family: var(--mono);
  background: none; border: none; color: var(--text2); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
.fst.active { color: var(--teal); border-bottom-color: var(--teal); }
.fno-summary-bar {
  display: flex; gap: 0; padding: 10px 0;
}
.fsb-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 20px; border-right: 1px solid var(--border);
  font-size: 9px; color: var(--text3); letter-spacing: 1px; text-transform: uppercase;
}
.fsb-item strong { font-size: 15px; font-family: var(--display); font-weight: 700; color: var(--text); letter-spacing: 0; }

.option-chain-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.oc-legend {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  background: var(--surface3);
  text-align: center;
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  padding: 4px 0; flex-shrink: 0;
}
.oc-call-leg { color: var(--blue); }
.oc-put-leg  { color: var(--red); }
.oc-leg-strike { color: var(--text3); }

.option-chain-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr) 80px repeat(5, 1fr);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.oc-hdr {
  padding: 8px 4px;
  font-size: 9px; letter-spacing: 1px; color: var(--text3); text-transform: uppercase;
  text-align: center;
}
.oc-hdr.oc-call { border-right: 1px solid var(--border); }
.strike-hdr { color: var(--gold); text-align: center; background: rgba(245,166,35,0.05); }

.option-chain-body { flex: 1; overflow-y: auto; }
.oc-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr) 80px repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.oc-row:hover { background: var(--surface2); }
.oc-row.atm { background: rgba(245,166,35,0.06); }
.oc-row.atm .oc-strike { color: var(--gold); font-weight: 600; }

.oc-cell {
  padding: 6px 4px;
  font-size: 11px; font-family: var(--mono);
  text-align: center; color: var(--text2);
  border-right: 1px solid var(--border);
}
.oc-cell:last-child { border-right: none; }
.oc-strike {
  background: rgba(245,166,35,0.04);
  font-weight: 600; color: var(--text);
  border-right: 1px solid var(--border2);
}
.oc-cell.ltp-ce { color: var(--blue); }
.oc-cell.ltp-pe { color: var(--red); }
.oc-cell.oi-high { color: var(--gold); font-weight: 600; }
.oc-loading { padding: 40px; text-align: center; color: var(--text3); }

/* ══════════════════════════════════════════════════════════
   GLOBAL MACRO VIEW
══════════════════════════════════════════════════════════ */
.macro-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  align-content: start;
}
.macro-category-card {
  background: var(--surface);
  padding: 0;
}
.mcc-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 9px; letter-spacing: 3px; color: var(--text3); text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.mcc-body { display: flex; flex-direction: column; }
.mcc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
}
.mcc-row:last-child { border-bottom: none; }
.mcc-flag { font-size: 16px; }
.mcc-name { flex: 1; font-size: 12px; color: var(--text2); }
.mcc-val { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--text); min-width: 80px; text-align: right; }
.mcc-pct { font-family: var(--mono); font-size: 12px; min-width: 65px; text-align: right; }
.mcc-pct.up { color: var(--green); }
.mcc-pct.dn { color: var(--red); }
.mcc-impact-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.mcc-impact-dot.BULLISH { background: var(--green); }
.mcc-impact-dot.BEARISH { background: var(--red); }
.mcc-impact-dot.NEUTRAL { background: var(--text3); }

/* ══════════════════════════════════════════════════════════
   NEWS VIEW
══════════════════════════════════════════════════════════ */
.news-view-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: 0;
}
.news-sentiment-summary {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
}
.nsb-item {
  flex: 1; padding: 12px 16px; text-align: center;
  font-size: 9px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase;
  border-right: 1px solid var(--border);
}
.nsb-item:last-child { border-right: none; }
.nsb-item strong { display: block; font-size: 22px; font-family: var(--display); font-weight: 800; letter-spacing: 0; margin-top: 4px; color: var(--text); }
.news-filter-row {
  display: flex; gap: 0; overflow-x: auto;
  border-bottom: none;
}
.nf-btn {
  padding: 8px 14px; font-size: 11px;
  background: none; border: none; border-right: 1px solid var(--border);
  color: var(--text2); cursor: pointer; font-family: var(--mono);
  white-space: nowrap; transition: all 0.15s;
}
.nf-btn:hover { color: var(--text); background: var(--surface2); }
.nf-btn.active { color: var(--gold); background: rgba(245,166,35,0.08); }

.news-view-list { flex: 1; overflow-y: auto; }
.news-view-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: background 0.15s;
}
.news-view-item:hover { background: var(--surface2); }
.nvi-header { display: flex; gap: 12px; align-items: flex-start; }
.nvi-sentiment {
  font-size: 9px; padding: 3px 8px; letter-spacing: 1px; flex-shrink: 0;
  margin-top: 2px;
}
.nvi-sentiment.BULLISH { background: rgba(0,229,160,0.15); color: var(--green); }
.nvi-sentiment.BEARISH { background: rgba(255,69,96,0.15); color: var(--red); }
.nvi-sentiment.NEUTRAL { background: var(--surface3); color: var(--text2); }
.nvi-title { font-size: 13px; color: var(--text); line-height: 1.5; flex: 1; }
.nvi-meta { display: flex; gap: 16px; font-size: 11px; color: var(--text3); align-items: center; }
.nvi-source { color: var(--gold); }
.nvi-tags { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nvi-tag {
  font-size: 9px; padding: 2px 6px;
  background: var(--surface3); color: var(--text2);
}
.nvi-impact-bar {
  display: flex; gap: 2px; align-items: center;
}
.nvi-impact-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ══════════════════════════════════════════════════════════
   SIGNALS VIEW
══════════════════════════════════════════════════════════ */
.signals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.signal-card {
  background: var(--surface);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sc-header { display: flex; align-items: center; justify-content: space-between; }
.sc-symbol { font-family: var(--display); font-size: 20px; font-weight: 700; }
.sc-time { font-size: 10px; color: var(--text3); }

.sc-score-display { display: flex; align-items: center; gap: 24px; }
.sc-gauge {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0%, var(--surface3) 0%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.sc-gauge::before {
  content: '';
  width: 60px; height: 60px;
  background: var(--surface);
  border-radius: 50%;
  position: absolute;
}
.sc-score-num {
  font-family: var(--display);
  font-size: 42px; font-weight: 800;
  line-height: 1; color: var(--gold);
}
.sc-direction {
  font-family: var(--display);
  font-size: 18px; font-weight: 700;
}
.sc-direction.STRONG_BUY { color: var(--green); }
.sc-direction.BUY { color: #80FFD4; }
.sc-direction.NEUTRAL { color: var(--text2); }
.sc-direction.SELL { color: #FF9999; }
.sc-direction.STRONG_SELL { color: var(--red); }

.sc-breakdown { display: flex; flex-direction: column; gap: 8px; }
.scb-row { display: flex; align-items: center; gap: 10px; }
.scb-label { font-size: 10px; color: var(--text3); width: 60px; text-transform: uppercase; letter-spacing: 1px; }
.scb-bar { flex: 1; height: 6px; background: var(--border2); border-radius: 3px; overflow: hidden; }
.scb-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width 0.6s ease; }
.scb-val { font-size: 11px; color: var(--text2); width: 30px; text-align: right; }

.sc-levels {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px; background: var(--border);
}
.scl-item {
  background: var(--surface2);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.scl-label { font-size: 9px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; }
.scl-value { font-family: var(--display); font-size: 18px; font-weight: 700; }
.scl-value.entry { color: var(--text); }
.scl-value.target { color: var(--green); }
.scl-value.stop { color: var(--red); }

.signal-explanation {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 24px;
}
.se-title { font-size: 11px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; margin-bottom: 16px; }
.se-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); }
.se-item { background: var(--surface2); padding: 16px; }
.se-pct { font-family: var(--display); font-size: 28px; font-weight: 800; color: var(--gold); }
.se-label { font-size: 11px; font-weight: 600; color: var(--text); margin: 6px 0 4px; }
.se-desc { font-size: 11px; color: var(--text2); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════
   SCREENER VIEW
══════════════════════════════════════════════════════════ */
.screener-header { flex-shrink: 0; }
.screener-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.screener-preset-row { display: flex; gap: 4px; flex-wrap: wrap; }
.sp-btn {
  font-size: 11px; padding: 6px 14px;
  border: 1px solid var(--border2);
  background: none; color: var(--text2); cursor: pointer; font-family: var(--mono);
  transition: all 0.15s;
}
.sp-btn:hover { color: var(--text); }
.sp-btn.active { background: rgba(245,166,35,0.1); color: var(--gold); border-color: var(--gold); }

.screener-table-wrap { flex: 1; overflow: auto; border: 1px solid var(--border); }
.screener-table { width: 100%; border-collapse: collapse; }
.screener-table th {
  background: var(--surface2); color: var(--text3);
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
  cursor: pointer;
  position: sticky; top: 0;
}
.screener-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-family: var(--mono);
}
.screener-table tr:hover td { background: var(--surface2); }
.sc-loading { text-align: center; color: var(--text3); }
.st-sym { font-weight: 600; color: var(--text); font-family: var(--mono); }
.st-signal {
  font-size: 10px; padding: 3px 8px; letter-spacing: 1px;
  display: inline-block;
}
.st-signal.BUY, .st-signal.STRONG_BUY { background: rgba(0,229,160,0.15); color: var(--green); }
.st-signal.SELL, .st-signal.STRONG_SELL { background: rgba(255,69,96,0.15); color: var(--red); }
.st-signal.NEUTRAL { background: var(--surface3); color: var(--text2); }
.long-buildup { color: var(--green); }
.short-buildup { color: var(--red); }
.short-covering { color: var(--teal); }
.long-unwinding { color: #FF9999; }

/* ══════════════════════════════════════════════════════════
   PORTFOLIO VIEW
══════════════════════════════════════════════════════════ */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: auto auto;
  gap: 1px;
  background: var(--border);
  flex: 1;
  align-content: start;
}
.port-card {
  background: var(--surface); padding: 20px;
}
.port-summary { grid-row: 1 / 2; }
.port-positions { grid-column: 2; grid-row: 1 / 3; }
.port-risk { grid-column: 1; }
.port-journal { grid-column: 1 / -1; }
.pc-title { font-size: 10px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; margin-bottom: 16px; }

.port-pnl-display { margin-bottom: 16px; }
.ppd-label { font-size: 9px; letter-spacing: 3px; color: var(--text3); text-transform: uppercase; margin-bottom: 8px; }
.ppd-value { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1; }
.ppd-pct { font-size: 16px; font-family: var(--mono); margin-top: 4px; }
.port-metrics { display: flex; flex-direction: column; gap: 10px; }
.pm-item { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.pm-item span { color: var(--text2); }
.pm-item strong { color: var(--text); font-weight: 500; }

.positions-table { width: 100%; border-collapse: collapse; }
.positions-table th {
  font-size: 10px; color: var(--text3); letter-spacing: 1px; text-transform: uppercase;
  padding: 8px; border-bottom: 1px solid var(--border); text-align: left;
}
.positions-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
.pc-empty { text-align: center; color: var(--text3); padding: 24px !important; }

.risk-meters { display: flex; flex-direction: column; gap: 16px; }
.risk-meter { display: flex; flex-direction: column; gap: 6px; }
.rm-label { font-size: 11px; color: var(--text2); }
.rm-bar { height: 6px; background: var(--border2); border-radius: 3px; overflow: hidden; }
.rm-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.rm-value { font-size: 11px; color: var(--text2); }

.journal-add { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.j-input {
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); padding: 6px 10px; font-family: var(--mono); font-size: 12px;
  flex: 1; min-width: 120px;
}
.j-input.j-small { flex: 0; min-width: 80px; max-width: 100px; }
select.j-input { cursor: pointer; }
.j-add-btn {
  background: var(--gold); color: var(--bg); border: none;
  padding: 6px 16px; font-family: var(--mono); font-size: 12px;
  cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: opacity 0.15s;
}
.j-add-btn:hover { opacity: 0.85; }
.journal-list { display: flex; flex-direction: column; gap: 4px; }
.jl-empty { font-size: 12px; color: var(--text3); }
.journal-item {
  display: flex; gap: 12px; align-items: center;
  padding: 8px 10px; background: var(--surface2); font-size: 12px;
}
.ji-sym { font-weight: 600; min-width: 150px; }
.ji-type { font-size: 10px; padding: 2px 8px; letter-spacing: 1px; }
.ji-type.BUY { background: rgba(0,229,160,0.15); color: var(--green); }
.ji-type.SELL { background: rgba(255,69,96,0.15); color: var(--red); }
.ji-pnl { margin-left: auto; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface2); border: 1px solid var(--border2);
  border-left: 3px solid var(--gold);
  padding: 12px 16px; min-width: 260px;
  display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in 0.3s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast-title { font-size: 12px; font-weight: 600; color: var(--text); }
.toast-msg   { font-size: 11px; color: var(--text2); margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ══════════════════════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.lo-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lo-logo {
  width: 60px; height: 60px;
  background: var(--gold); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 24px;
  animation: lo-pulse 1.5s ease infinite;
}
@keyframes lo-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.lo-text { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: 2px; }
.lo-bar { width: 200px; height: 2px; background: var(--border2); overflow: hidden; }
.lo-fill { height: 100%; background: var(--gold); transition: width 0.4s ease; }
.lo-status { font-size: 11px; letter-spacing: 2px; color: var(--text3); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
  .card-chart { grid-column: 1 / -1; }
  .card-macro { grid-column: 1; }
  .card-fno   { grid-column: 2; }
  .card-news  { grid-column: 1 / -1; }
  .card-fii   { grid-column: 1; }
  .card-india-signals { grid-column: 2; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { position: fixed; width: 220px; height: 100%; transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .signals-grid { grid-template-columns: 1fr; }
  .se-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .port-positions { grid-column: 1; grid-row: auto; }
  .port-risk { grid-column: 1; }
  .port-journal { grid-column: 1; }
}

@media (max-width: 600px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-chart, .card-macro, .card-fno, .card-news, .card-fii, .card-india-signals {
    grid-column: 1;
  }
  .signal-banner { flex-direction: column; align-items: flex-start; }
  .sb-components { margin-left: 0; }
  .se-grid { grid-template-columns: 1fr; }
}
