/* ═══════════════════════════════════════════════════════════════
   AI TRADING AGENT — Premium Dark Dashboard
   by Omesh Patel
   ═══════════════════════════════════════════════════════════════ */

/* ── Root Design Tokens ──────────────────────────────────────── */
:root {
  --bg:            #060b14;
  --bg2:           #0a1020;
  --surface:       rgba(13, 20, 40, 0.80);
  --border:        rgba(255, 255, 255, 0.07);
  --border-hover:  rgba(255, 255, 255, 0.14);
  --accent-blue:   #3b82f6;
  --accent-green:  #10b981;
  --accent-red:    #ef4444;
  --accent-yellow: #f59e0b;
  --accent-purple: #a855f7;
  --accent-orange: #f97316;
  --text-1:        #f8fafc;
  --text-2:        #94a3b8;
  --text-3:        #64748b;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-sm:     0 4px 16px rgba(0, 0, 0, 0.3);
  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:          'JetBrains Mono', 'Fira Code', monospace;
  --header-h:      60px;
  --nav-h:         64px;
  --transition:    0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.5;
  overflow: hidden;
  height: 100dvh;
}

/* Animated background blobs */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(59,130,246,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 80%, rgba(168,85,247,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(16,185,129,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── App Shell ───────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
  z-index: 1;
}

/* ── Glass Utility ───────────────────────────────────────────── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.glass:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

/* ── Top Header ──────────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(6, 11, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 14px; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.logo-sub { font-size: 10px; color: var(--text-3); font-weight: 400; }

.header-ticker {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.ticker-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}
.t-label { font-size: 10px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.t-val { font-size: 13px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Connection Badge */
.conn-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-weight: 500;
  background: rgba(255,255,255,0.03);
}
.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: pulse-dot 2s infinite;
}
.conn-badge.connected .conn-dot { background: var(--accent-green); animation: none; }
.conn-badge.connected { border-color: rgba(16,185,129,0.3); color: var(--accent-green); }
.conn-badge.disconnected .conn-dot { background: var(--accent-red); animation: none; }
.conn-badge.disconnected { border-color: rgba(239,68,68,0.3); color: var(--accent-red); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Scan Button */
.scan-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-blue), #6366f1);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.scan-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.5); }
.scan-btn:active { transform: translateY(0); }
.scan-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(var(--nav-h) + 16px);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.main-content::-webkit-scrollbar { width: 4px; }
.main-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Bottom Nav ──────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(6,11,20,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 10px;
  transition: all var(--transition);
  flex: 1;
  max-width: 64px;
}
.nav-item i { font-size: 18px; transition: all var(--transition); }
.nav-item:hover { color: var(--text-2); }
.nav-item.active {
  color: var(--accent-blue);
  background: rgba(59,130,246,0.1);
}
.nav-item.active i { text-shadow: 0 0 12px rgba(59,130,246,0.5); }

/* ── Tab Panels ──────────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Section Header ──────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header h2 i { color: var(--accent-blue); }
.sub-text { font-size: 11px; color: var(--text-3); }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-3);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state i { font-size: 28px; opacity: 0.4; }

/* ── Mode Row ────────────────────────────────────────────────── */
.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mode-toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}
.mt-btn {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  letter-spacing: 0.3px;
}
.mt-btn.active {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}
.mt-btn.live.active {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

.session-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.session-badge.open { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--accent-green); }
.session-badge.premarket { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: var(--accent-yellow); }
.session-badge.closed { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.2); color: var(--accent-red); }

/* ── Stats Row ───────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.stat-icon.green  { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.stat-icon.blue   { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.stat-icon.purple { background: rgba(168,85,247,0.15); color: var(--accent-purple); }
.stat-icon.orange { background: rgba(249,115,22,0.15); color: var(--accent-orange); }
.stat-label { font-size: 10px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-1); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ── Gauge / Sentiment ───────────────────────────────────────── */
.gauge-section {
  padding: 20px;
  margin-bottom: 16px;
}
.gauge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gauge-header h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
}
.gauge-header h3 i { color: var(--accent-blue); }
.gauge-last { font-size: 10px; color: var(--text-3); }

.sentiment-bars { display: flex; flex-direction: column; gap: 12px; }
.sbar-row { display: flex; align-items: center; gap: 10px; }
.sbar-label { font-size: 11px; color: var(--text-2); font-weight: 500; width: 80px; flex-shrink: 0; }
.sbar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.sbar-fill {
  height: 100%;
  border-radius: 4px;
  width: 50%;
  background: var(--accent-blue);
  transition: width 0.5s ease, background 0.3s ease;
}
.sbar-val { font-size: 11px; font-weight: 600; width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.overall-bias {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 18px;
  padding: 8px;
  border-radius: 8px;
}
.overall-bias.bull { color: var(--accent-green); text-shadow: 0 0 20px rgba(16,185,129,0.4); }
.overall-bias.bear { color: var(--accent-red); text-shadow: 0 0 20px rgba(239,68,68,0.4); }
.overall-bias.neutral { color: var(--text-2); }

/* ── Quick Signals (Dashboard Preview) ───────────────────────── */
.quick-signals { margin-bottom: 16px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qsig-card {
  padding: 14px;
  cursor: pointer;
  border-radius: var(--radius);
}
.qsig-card.call { border-color: rgba(16,185,129,0.3); }
.qsig-card.put  { border-color: rgba(239,68,68,0.3); }
.qsig-inst { font-size: 10px; color: var(--text-3); font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; }
.qsig-dir { font-size: 16px; font-weight: 800; margin-bottom: 2px; }
.qsig-card.call .qsig-dir { color: var(--accent-green); }
.qsig-card.put  .qsig-dir { color: var(--accent-red); }
.qsig-strike { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.qsig-tgt { font-size: 10px; color: var(--text-3); font-weight: 500; }

/* Emergency Button */
.emergency-btn {
  width: 100%;
  padding: 14px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.4);
  color: var(--accent-red);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  font-family: var(--font);
  transition: all var(--transition);
  margin-top: 8px;
  animation: pulse-red 3s infinite;
}
.emergency-btn:hover {
  background: rgba(239,68,68,0.2);
  animation: none;
  transform: scale(1.01);
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.1); }
}

/* ── ML Banner ───────────────────────────────────────────────── */
.ml-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.ml-banner.active {
  border-color: rgba(59,130,246,0.4);
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(168,85,247,0.05));
}
.ml-banner.warming { border-color: rgba(245,158,11,0.3); }
.ml-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.ml-banner-info { flex: 1; }
.ml-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.ml-sub { font-size: 11px; color: var(--text-2); line-height: 1.4; }
.ml-metrics { display: flex; gap: 16px; flex-shrink: 0; }
.ml-metric { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ml-m-label { font-size: 9px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.ml-m-val { font-size: 15px; font-weight: 700; color: var(--accent-blue); }

/* ── Signal Cards ────────────────────────────────────────────── */
.signals-container { display: flex; flex-direction: column; gap: 16px; }
.signal-card {
  padding: 18px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.signal-card.call { border-left: 3px solid var(--accent-green); }
.signal-card.put  { border-left: 3px solid var(--accent-red); }

.sc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sc-inst {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sc-dir {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}
.sc-dir.call { background: rgba(16,185,129,0.15); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.3); }
.sc-dir.put  { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.3); }

.valid-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: rgba(16,185,129,0.15); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.3); margin-left: auto; }
.watch-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: rgba(245,158,11,0.1); color: var(--accent-yellow); border: 1px solid rgba(245,158,11,0.3); margin-left: auto; }

.sc-strike {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
  line-height: 1;
}
.sc-otype { font-size: 16px; font-weight: 600; color: var(--text-2); }

.sc-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
}
.sc-data-item { display: flex; flex-direction: column; gap: 3px; }
.sc-d-label { font-size: 9px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.sc-d-val { font-size: 13px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }

.sc-conditions { margin-bottom: 10px; }
.sc-cond-label { font-size: 10px; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.sc-cond-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.cond-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
  cursor: help;
}
.cond-dot.met { background: var(--accent-green); border-color: var(--accent-green); box-shadow: 0 0 6px rgba(16,185,129,0.4); }

.sc-score-bar {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.sc-score-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.sc-score-text { font-size: 10px; color: var(--text-3); margin-bottom: 10px; }
.sc-reason { font-size: 11px; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; font-style: italic; }
.sc-news-flow { display: flex; gap: 12px; flex-wrap: wrap; }
.sc-nf-item { font-size: 11px; color: var(--text-3); }
.sc-nf-item b { font-weight: 700; }

/* Colour utilities */
.text-green { color: var(--accent-green) !important; }
.text-red   { color: var(--accent-red) !important; }
.text-blue  { color: var(--accent-blue) !important; }
.text-yellow{ color: var(--accent-yellow) !important; }

/* ── Analysis Grid ───────────────────────────────────────────── */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.analysis-card {
  border-radius: var(--radius);
  overflow: hidden;
}
.ac-head {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
  background: rgba(255,255,255,0.02);
}
.ac-head i { color: var(--accent-blue); }
.ac-body { padding: 4px 0; }
.analysis-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background var(--transition);
}
.analysis-data-row:last-child { border-bottom: none; }
.analysis-data-row:hover { background: rgba(255,255,255,0.02); }
.adr-label { font-size: 12px; color: var(--text-2); }
.adr-val { font-size: 12px; font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; }

/* ── Intel Cards ─────────────────────────────────────────────── */
.intel-card {
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.ic-head {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255,255,255,0.02);
}
.ic-head > span:first-child { display: flex; align-items: center; gap: 6px; }
.ic-head i { color: var(--accent-blue); }

/* AI-Scored pill */
.ic-ai-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(168,85,247,0.2));
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* Article count badge */
.ic-count {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  color: var(--text-3);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Score legend bar below header */
.ic-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.01);
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}
.leg-bar {
  display: inline-block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  opacity: 0.85;
}
.fii-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
}
.fii-row:last-child { border-bottom: none; }
.global-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.global-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  border-right: 1px solid rgba(255,255,255,0.03);
}
.global-item:nth-child(even) { border-right: none; }
.gi-name { font-size: 11px; color: var(--text-2); font-weight: 500; }
.gi-val { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* ── News Cards ──────────────────────────────────────────────── */
.news-card {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
  position: relative;
}
.news-card:last-child { border-bottom: none; }
.news-card:hover { background: rgba(255,255,255,0.025); }
.news-card.high-impact {
  border-left: 3px solid var(--accent-red);
  background: rgba(239,68,68,0.04);
  animation: hpulse 3s ease-in-out infinite;
}
@keyframes hpulse {
  0%,100% { border-left-color: var(--accent-red); }
  50% { border-left-color: rgba(239,68,68,0.4); }
}

.nc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 4px;
}
.nc-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nc-source {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 5px;
}
.nc-summary {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Impact / direction / new badges */
.ni-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ni-badge.high { background: rgba(239,68,68,0.18); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.4); }
.ni-badge.med  { background: rgba(249,115,22,0.15); color: var(--accent-orange); border: 1px solid rgba(249,115,22,0.3); }
.ni-badge.low  { background: rgba(255,255,255,0.06); color: var(--text-3); border: 1px solid rgba(255,255,255,0.1); }
.ni-badge.bull { background: rgba(16,185,129,0.15); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.3); }
.ni-badge.bear { background: rgba(239,68,68,0.12); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.25); }
.ni-badge.neu  { background: rgba(255,255,255,0.06); color: var(--text-2); border: 1px solid rgba(255,255,255,0.1); }
.ni-badge.new  { background: rgba(251,191,36,0.18); color: var(--accent-yellow); border: 1px solid rgba(251,191,36,0.35); animation: newflash 2s infinite; }
@keyframes newflash { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

.ni-sector {
  display: inline-flex;
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,0.25);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Score bars inside each card */
.nc-meta { margin-top: 8px; }
.nc-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.nc-score-item { display: flex; align-items: center; gap: 6px; }
.nc-score-label {
  font-size: 9px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  width: 64px;
  flex-shrink: 0;
}
.nc-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  min-width: 40px;
}
.nc-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}
.nc-score-val {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

.nc-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nc-time {
  font-size: 9px;
  color: var(--text-3);
  margin-left: auto;
}
.nc-link {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  color: var(--accent-blue);
  text-decoration: none;
  margin-top: 6px;
  font-weight: 600;
  transition: color var(--transition);
  gap: 3px;
}
.nc-link:hover { color: #93c5fd; text-decoration: underline; }

/* Legacy dot support */
.news-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.news-dot.pos { background: var(--accent-green); }
.news-dot.neg { background: var(--accent-red); }
.news-dot.neu { background: var(--text-3); }


/* ── Positions ───────────────────────────────────────────────── */
.circuit-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  animation: pulse-red 2s infinite;
}
.positions-list { display: flex; flex-direction: column; gap: 10px; }
.position-card {
  padding: 16px;
  border-radius: var(--radius);
}
.position-card.call { border-left: 3px solid var(--accent-green); }
.position-card.put  { border-left: 3px solid var(--accent-red); }
.pc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pc-symbol { font-size: 14px; font-weight: 700; color: var(--text-1); }
.pc-dir { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.pc-dir.call { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.pc-dir.put  { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.pc-details { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-bottom: 10px; }
.pc-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.pc-row span:last-child { font-weight: 600; color: var(--text-1); }
.pc-pnl { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

/* ── Log Viewer ──────────────────────────────────────────────── */
.log-viewer {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-green);
  background: rgba(0,0,0,0.5);
  padding: 16px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 62vh;
  overflow-y: auto;
  border: 1px solid rgba(16,185,129,0.15);
  line-height: 1.6;
}

/* ── Small Button ────────────────────────────────────────────── */
.small-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--accent-blue);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}
.small-btn:hover { background: rgba(59,130,246,0.2); }

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}
.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: auto;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16,185,129,0.4); color: var(--accent-green); }
.toast.error   { border-color: rgba(239,68,68,0.4); color: var(--accent-red); }
.toast.info    { border-color: rgba(59,130,246,0.4); color: var(--accent-blue); }

/* ── OTP Step styles ─────────────────────────────────────────── */
.otp-icon {
  background: linear-gradient(135deg, #0088cc, #00aff0) !important;
  animation: pulse-otp 2s infinite;
}
@keyframes pulse-otp {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,136,204,0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(0,136,204,0); }
}
.otp-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 20px;
  padding: 4px 14px;
  margin: -6px 0 14px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.otp-input {
  font-size: 22px !important;
  font-family: var(--mono) !important;
  letter-spacing: 10px !important;
  text-align: center !important;
  font-weight: 700 !important;
}


/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 640px) {
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .sc-data-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
  .header-ticker { display: none; }
  .logo-title { font-size: 13px; }
  .scan-btn span { display: none; }
  .scan-btn { padding: 7px 12px; }
  .sc-data-grid { grid-template-columns: 1fr 1fr; }
  .ml-metrics { display: none; }
  .sc-strike { font-size: 26px; }
}

/* ── Spinner ─────────────────────────────────────────────────── */
.fa-spin { animation: fa-spin 1s infinite linear; }
@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Lock Icons on Protected Buttons ─────────────────────────── */
.lock-icon {
  font-size: 10px;
  opacity: 0.7;
  margin-right: 2px;
}

/* ── Admin Badge (shown when logged in) ──────────────────────── */
.admin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: 20px;
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 600;
}
.admin-badge i { font-size: 12px; }
.logout-btn {
  background: none;
  border: none;
  color: var(--accent-green);
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.logout-btn:hover { opacity: 1; }

/* ── Login Modal Overlay ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  width: 100%;
  max-width: 360px;
  padding: 32px 28px;
  text-align: center;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(59,130,246,0.4);
}
.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 24px;
}
.modal-field {
  text-align: left;
  margin-bottom: 14px;
}
.modal-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal-field label i { color: var(--accent-blue); margin-right: 4px; }
.modal-field input,
.pass-wrap input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.modal-field input:focus,
.pass-wrap input:focus { border-color: var(--accent-blue); }
.pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pass-wrap input { padding-right: 40px; }
.toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: color var(--transition);
}
.toggle-pass:hover { color: var(--text-1); }
.modal-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--accent-red);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  text-align: left;
}
.modal-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-blue), #6366f1);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: 0.3px;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.modal-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.5); }
.modal-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.modal-cancel {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}
.modal-cancel:hover { border-color: var(--border-hover); color: var(--text-2); }

