/* ============================================================
   TradeMax PRO — Dark Trading Platform Styles
   ============================================================ */

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

:root {
  --bg:        #080c14;
  --bg2:       #0d1220;
  --bg3:       #111827;
  --card:      #141d2e;
  --card2:     #1a2540;
  --border:    #1e2d45;
  --border2:   #263556;
  --teal:      #14bcbd;
  --teal-dim:  rgba(20,188,189,0.12);
  --teal-glow: rgba(20,188,189,0.25);
  --blue:      #1197d4;
  --blue-dim:  rgba(17,151,212,0.12);
  --green:     #00d395;
  --green-dim: rgba(0,211,149,0.12);
  --red:       #ff4560;
  --red-dim:   rgba(255,69,96,0.12);
  --gold:      #f59e0b;
  --purple:    #8b5cf6;
  --txt:       #e2e8f0;
  --txt2:      #94a3b8;
  --txt3:      #64748b;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --font:      'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ── Light Mode ── */
body.light {
  --bg:        #f0f4f8;
  --bg2:       #ffffff;
  --bg3:       #e8edf4;
  --card:      #ffffff;
  --card2:     #f5f8fc;
  --border:    #d1dce9;
  --border2:   #b8c9dc;
  --teal:      #0d9fa0;
  --teal-dim:  rgba(13,159,160,0.10);
  --teal-glow: rgba(13,159,160,0.22);
  --blue:      #0f7ab8;
  --blue-dim:  rgba(15,122,184,0.10);
  --green:     #00a372;
  --green-dim: rgba(0,163,114,0.10);
  --red:       #e0293e;
  --red-dim:   rgba(224,41,62,0.10);
  --gold:      #c47d00;
  --purple:    #6d40cc;
  --txt:       #0f1923;
  --txt2:      #3d5268;
  --txt3:      #6b84a0;
  --shadow:    0 4px 24px rgba(0,0,0,0.12);
}

html { font-size: 14px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--txt); font-family: var(--font); line-height: 1.5; overflow-x: hidden; transition: background 0.25s, color 0.25s; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ── Utilities ── */
.hidden { display: none !important; }
.green  { color: var(--green); }
.red    { color: var(--red); }
.gold   { color: var(--gold); }
.muted  { color: var(--txt3); }
.mono   { font-family: var(--font-mono); }
.flex   { display: flex; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }

/* ============================================================
   TICKER BAR
   ============================================================ */
#ticker-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 30px;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 200;
}

.ticker-track {
  display: flex;
  height: 100%;
  white-space: nowrap;
}

.ticker-content {
  display: inline-flex;
  align-items: center;
  gap: 0;
  animation: ticker-scroll 80s linear infinite;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-right: 1px solid var(--border);
  font-size: 11.5px;
  font-family: var(--font-mono);
  height: 30px;
  cursor: pointer;
  transition: background 0.2s;
}
.ticker-item:hover { background: var(--card); }
.ticker-sym { color: var(--txt2); font-weight: 600; }
.ticker-price { color: var(--txt); }
.ticker-chg.up { color: var(--green); }
.ticker-chg.dn { color: var(--red); }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
#ticker-bar:hover .ticker-content { animation-play-state: paused; }

/* ============================================================
   HEADER
   ============================================================ */
#main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 54px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 30px;
  z-index: 150;
  gap: 12px;
}

.header-left { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.header-center { flex: 1; max-width: 480px; }
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Logo */
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-icon { width: 28px; height: 28px; }
.logo-text { font-size: 16px; font-weight: 800; letter-spacing: 1px; color: var(--txt); }
.logo-pro { color: var(--teal); font-size: 10px; vertical-align: super; margin-left: 2px; font-weight: 700; }

/* Nav Tabs */
.main-nav { display: flex; gap: 2px; }
.nav-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--txt2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.nav-tab:hover { background: var(--card); color: var(--txt); }
.nav-tab.active { background: var(--teal-dim); color: var(--teal); border: 1px solid var(--teal-glow); }
.tab-icon { font-style: normal; }

/* Search */
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; padding: 7px 12px 7px 34px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; color: var(--txt); font-size: 13px;
  outline: none; transition: border 0.2s;
}
.search-wrap input:focus { border-color: var(--teal); }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; }

.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 300; max-height: 320px; overflow-y: auto;
}
.search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer; transition: background 0.15s;
}
.search-item:hover { background: var(--card); }
.search-item img { width: 22px; height: 22px; border-radius: 50%; }
.si-name { font-weight: 600; font-size: 13px; }
.si-sym { font-size: 11px; color: var(--txt3); }
.si-price { margin-left: auto; font-family: var(--font-mono); font-size: 12px; }
.search-section-label { padding: 5px 14px 3px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--txt3); background: var(--bg3); border-bottom: 1px solid var(--border); }

/* Clock */
.clock-wrap { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 12px; color: var(--txt2); }
.clock-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }
.clock-tz { font-size: 10px; color: var(--txt3); }

/* Icon Btn */
.icon-btn {
  position: relative; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--txt2); cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.icon-btn svg { width: 16px; height: 16px; }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: 9px;
  font-weight: 700; border-radius: 10px; padding: 1px 4px;
  min-width: 16px; text-align: center;
}

/* WS Indicator */
.ws-indicator { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--txt3); }
.ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ============================================================
   DASHBOARD SWITCHER
   ============================================================ */
.dashboard { display: none; }
.dashboard.active { display: block; }

/* ============================================================
   GLOBAL STATS BAR
   ============================================================ */
.global-stats {
  display: flex; align-items: center; flex-wrap: wrap;
  padding: 8px 16px; gap: 0;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.gstat { display: flex; align-items: center; gap: 6px; padding: 4px 14px; flex-shrink: 0; }
.gstat-label { font-size: 11px; color: var(--txt3); white-space: nowrap; }
.gstat-val { font-size: 12px; font-weight: 700; font-family: var(--font-mono); white-space: nowrap; }
.gstat-chg { font-size: 11px; font-weight: 600; }
.gstat-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

/* Fear & Greed Mini */
.fg-wrap { display: flex; align-items: center; gap: 6px; }
.fg-meter { width: 60px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.fg-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.fg-val { font-size: 12px; font-weight: 700; font-family: var(--font-mono); }
.fg-text { font-size: 10px; color: var(--txt3); }

/* ============================================================
   MAIN DASHBOARD GRID
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  grid-template-rows: 1fr;
  gap: 0;
  height: calc(100vh - 30px - 54px - 45px);
  min-height: 580px;
  overflow: hidden;
}

/* ============================================================
   LEFT PANEL (Sidebar)
   ============================================================ */
.left-panel {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.panel-section {
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.panel-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--txt2);
  background: var(--bg3);
}
.spread-label { font-size: 11px; color: var(--txt3); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Tab Bar */
.tab-bar { display: flex; border-bottom: 1px solid var(--border); }
.stab {
  flex: 1; padding: 8px 4px; font-size: 11px; font-weight: 600;
  color: var(--txt3); border: none; background: none;
  cursor: pointer; transition: all 0.2s; border-bottom: 2px solid transparent;
}
.stab:hover { color: var(--txt); }
.stab.active { color: var(--teal); border-bottom-color: var(--teal); }

/* Watchlist */
.watchlist-list { overflow-y: auto; }
.wl-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}
.wl-item:hover { background: var(--card); }
.wl-item.active { background: var(--teal-dim); border-left: 2px solid var(--teal); }
.wl-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.wl-img { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.wl-sym { font-size: 12px; font-weight: 700; }
.wl-name { font-size: 10px; color: var(--txt3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-right { text-align: right; flex-shrink: 0; }
.wl-price { font-size: 12px; font-weight: 600; font-family: var(--font-mono); }
.wl-chg { font-size: 10px; font-weight: 600; }
.wl-spark { opacity: 0.8; }

/* Mover List */
.mover-list { overflow-y: auto; max-height: 200px; }
.mover-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background 0.15s; gap: 6px;
}
.mover-item:hover { background: var(--card); }
.mv-left { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.mv-img { width: 18px; height: 18px; border-radius: 50%; }
.mv-sym { font-size: 12px; font-weight: 700; }
.mv-price { font-size: 11px; font-family: var(--font-mono); }
.mv-chg { font-size: 11px; font-weight: 700; }

/* ============================================================
   CENTER PANEL
   ============================================================ */
.center-panel {
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

/* Coin Header */
.coin-hdr {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 12px 16px; flex-shrink: 0;
}
.coin-id { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.coin-icon-wrap { width: 40px; height: 40px; flex-shrink: 0; }
.coin-icon-wrap img { width: 40px; height: 40px; border-radius: 50%; }
.coin-id h1 { font-size: 18px; font-weight: 800; line-height: 1.2; }
.coin-pair { font-size: 12px; color: var(--txt3); }
.price-block { margin-left: auto; text-align: right; }
.big-price { font-size: 22px; font-weight: 800; font-family: var(--font-mono); line-height: 1.2; }
.price-chg { font-size: 13px; font-weight: 700; }

.coin-metrics { display: flex; flex-wrap: wrap; gap: 0; }
.cm { flex: 1; min-width: 100px; padding: 6px 10px; border-right: 1px solid var(--border); }
.cm:last-child { border-right: none; }
.cm span { display: block; font-size: 10px; color: var(--txt3); margin-bottom: 2px; }
.cm b { font-size: 12px; font-weight: 700; font-family: var(--font-mono); color: var(--txt); }

/* Stock Badge */
.stock-badge {
  width: 50px; height: 40px; border-radius: 8px;
  background: var(--blue-dim); border: 1px solid var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--blue); letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Chart Controls */
.chart-ctrl-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--bg2); border-bottom: 1px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap; gap: 8px;
}
.tf-group { display: flex; gap: 2px; }
.tf-btn {
  padding: 4px 10px; border: 1px solid transparent; border-radius: 5px;
  background: none; color: var(--txt3); font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.tf-btn:hover { color: var(--txt); background: var(--card); }
.tf-btn.active { background: var(--teal-dim); color: var(--teal); border-color: var(--teal-glow); }

.chart-actions { display: flex; gap: 6px; }
.act-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px;
  background: none; color: var(--txt2); font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.act-btn:hover { border-color: var(--teal); color: var(--teal); }
.act-btn svg { width: 13px; height: 13px; }

/* Chart Container */
.chart-outer { flex: 1; min-height: 380px; position: relative; background: var(--bg); }
.tv-chart { width: 100%; height: 100%; min-height: 380px; }

/* CoinTrader Pro Panel */
.cointrader-panel {
  flex-shrink: 0; background: var(--bg2); border-top: 1px solid var(--border);
}
.ct-panel-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--txt2);
}
.ct-hdr-actions { display: flex; align-items: center; gap: 10px; }
.ext-link { font-size: 11px; color: var(--teal); text-decoration: none; }
.ext-link:hover { text-decoration: underline; }
.close-btn { width: 22px; height: 22px; border: none; background: var(--border); color: var(--txt3); border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.ct-iframe-wrap { position: relative; height: 340px; }
.ct-iframe-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.ct-fallback {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--bg3); text-align: center;
}
.ct-fallback.show { display: flex; }

/* TA Bar */
.ta-bar {
  display: flex; align-items: center; flex-wrap: wrap;
  padding: 8px 14px; background: var(--bg2); border-top: 1px solid var(--border);
  gap: 0; flex-shrink: 0; overflow-x: auto;
}
.ta-item { display: flex; align-items: center; gap: 6px; padding: 3px 12px; flex-shrink: 0; }
.ta-label { font-size: 10px; color: var(--txt3); white-space: nowrap; }
.ta-val { font-size: 12px; font-weight: 700; font-family: var(--font-mono); }
.ta-signal { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.ta-signal.buy  { background: var(--green-dim); color: var(--green); }
.ta-signal.sell { background: var(--red-dim); color: var(--red); }
.ta-signal.neutral { background: rgba(148,163,184,0.1); color: var(--txt3); }
.ta-sep { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }

/* ============================================================
   RIGHT PANEL
   ============================================================ */
.right-panel {
  background: var(--bg2); overflow-y: auto;
  display: flex; flex-direction: column; gap: 0;
}

/* Order Book */
.ob-section { flex: 0 0 auto; }
.ob-cols-hdr {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 5px 10px; font-size: 9.5px; color: var(--txt3);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.asks-list, .bids-list { overflow-y: auto; max-height: 160px; }
.ob-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 3px 10px; font-size: 11px; font-family: var(--font-mono);
  position: relative; overflow: hidden; cursor: pointer; transition: background 0.1s;
}
.ob-row:hover { background: var(--card); }
.ob-row .ob-depth-bar {
  position: absolute; top: 0; bottom: 0; right: 0;
  opacity: 0.12; pointer-events: none;
}
.ask-row .ob-depth-bar { background: var(--red); }
.bid-row .ob-depth-bar { background: var(--green); }
.ask-row span:first-child { color: var(--red); font-weight: 600; }
.bid-row span:first-child { color: var(--green); font-weight: 600; }

.ob-midprice {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 10px; background: var(--bg3); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 800; font-family: var(--font-mono); color: var(--txt);
}
.ob-arrow { font-size: 10px; }

/* Recent Trades */
.trades-section { flex: 1; min-height: 0; }
.trades-hdr {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 5px 10px; font-size: 9.5px; color: var(--txt3);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border); background: var(--bg3);
}
.trades-list { overflow-y: auto; height: 180px; }
.trade-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 3.5px 10px; font-size: 11px; font-family: var(--font-mono);
  border-bottom: 1px solid rgba(30,45,69,0.5);
  transition: background 0.1s;
}
.trade-row:hover { background: var(--card); }
.trade-row.buy  span:first-child { color: var(--green); }
.trade-row.sell span:first-child { color: var(--red); }
.trade-row.new-trade { animation: flashRow 0.5s ease; }
@keyframes flashRow { from { background: rgba(20,188,189,0.15); } to { background: transparent; } }

/* Funding Grid */
.funding-grid { padding: 8px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.funding-item { display: flex; flex-direction: column; gap: 2px; }
.funding-item span { font-size: 10px; color: var(--txt3); }
.funding-item b { font-size: 12px; font-family: var(--font-mono); }

/* ============================================================
   BOTTOM ROW
   ============================================================ */
.bottom-row {
  display: grid; grid-template-columns: 360px 1fr;
  gap: 1px; background: var(--border); border-top: 1px solid var(--border);
}

.bottom-card {
  background: var(--bg2); padding: 12px 14px;
  overflow: hidden; display: flex; flex-direction: column; gap: 10px;
}

.bc-hdr {
  display: flex; align-items: center; justify-content: space-between;
}
.bc-hdr h3 { font-size: 13px; font-weight: 700; }

/* Portfolio */
.pf-summary-row { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pf-sum-item { flex: 1; padding: 8px 10px; border-right: 1px solid var(--border); text-align: center; }
.pf-sum-item:last-child { border-right: none; }
.pf-sum-item span { display: block; font-size: 10px; color: var(--txt3); margin-bottom: 2px; }
.pf-sum-item b { font-size: 13px; font-weight: 700; font-family: var(--font-mono); }

.pf-holdings { overflow-y: auto; max-height: 160px; }
.empty-msg { font-size: 12px; color: var(--txt3); text-align: center; padding: 20px 10px; }

.pf-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.pf-row:last-child { border-bottom: none; }
.pf-coin-img { width: 24px; height: 24px; border-radius: 50%; }
.pf-coin-info {}
.pf-coin-info .sym { font-weight: 700; }
.pf-coin-info .qty { font-size: 10px; color: var(--txt3); }
.pf-value { text-align: right; font-family: var(--font-mono); font-weight: 700; }
.pf-pnl { text-align: right; font-size: 11px; font-weight: 700; }
.pf-del { width: 20px; height: 20px; border: none; background: none; color: var(--txt3); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.pf-del:hover { color: var(--red); }

/* Market Table */
.market-card { overflow: hidden; }
.sort-tabs { display: flex; gap: 2px; }
.sort-btn {
  padding: 3px 8px; border: 1px solid transparent; border-radius: 4px;
  background: none; color: var(--txt3); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.sort-btn:hover { color: var(--txt); border-color: var(--border); }
.sort-btn.active { background: var(--teal-dim); color: var(--teal); border-color: var(--teal-glow); }

.tbl-wrap { overflow: auto; max-height: 220px; flex: 1; }
.mkt-tbl { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.mkt-tbl thead { position: sticky; top: 0; z-index: 1; }
.mkt-tbl th {
  padding: 6px 10px; text-align: left; font-size: 10px; font-weight: 700;
  color: var(--txt3); text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
.mkt-tbl td { padding: 6px 10px; border-bottom: 1px solid rgba(30,45,69,0.6); }
.mkt-tbl tbody tr { cursor: pointer; transition: background 0.15s; }
.mkt-tbl tbody tr:hover { background: var(--card); }
.coin-cell { display: flex; align-items: center; gap: 8px; }
.coin-cell img { width: 20px; height: 20px; border-radius: 50%; }
.coin-cell .sym { font-weight: 700; }
.coin-cell .nm { font-size: 10px; color: var(--txt3); }
.spark-cell svg { display: block; }
.rank-cell { color: var(--txt3); font-size: 11px; }

/* ============================================================
   SENTIMENT GAUGES
   ============================================================ */
.sentiment-section {
  padding: 20px 16px 10px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.snt-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.snt-hdr-left { display: flex; align-items: center; gap: 14px; }
.snt-hdr-left h3 { font-size: 14px; font-weight: 800; }
.snt-src-link {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--teal); text-decoration: none; font-weight: 600;
}
.snt-src-link:hover { text-decoration: underline; }
.snt-src-link svg { width: 13px; height: 13px; }
.snt-updated { font-size: 11px; color: var(--txt3); }

.snt-gauges {
  display: flex; align-items: flex-start; gap: 12px;
  flex-wrap: wrap; justify-content: center;
}

/* Gauge Cards */
.gauge-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 10px 10px;
  transition: border-color 0.2s, transform 0.2s;
  cursor: default;
}
.gauge-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.gauge-card.large { min-width: 220px; padding: 18px 16px 12px; }
.gauge-card.mini  { min-width: 155px; }

.gauge-title {
  font-size: 11.5px; font-weight: 700; color: var(--txt2);
  text-align: center; letter-spacing: 0.2px;
}
.gauge-subtitle {
  font-size: 10px; color: var(--txt3); text-align: center;
}

/* SVG Gauge */
.gauge-svg-wrap { position: relative; }
.gauge-svg-wrap svg { display: block; }

.gauge-center-val {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  text-align: center; pointer-events: none;
}
.gauge-center-val .gv-num {
  font-size: 20px; font-weight: 800; font-family: var(--font-mono);
  line-height: 1; display: block;
}
.gauge-card.large .gauge-center-val .gv-num { font-size: 28px; }
.gauge-center-val .gv-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; display: block; margin-top: 2px;
}
.gauge-card.large .gauge-center-val .gv-lbl { font-size: 12px; }

/* Gauge change badge */
.gauge-change {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; background: var(--bg3);
}
.gauge-change.up   { background: var(--green-dim); color: var(--green); }
.gauge-change.down { background: var(--red-dim);   color: var(--red); }
.gauge-change.flat { background: rgba(148,163,184,0.1); color: var(--txt3); }

/* Gauge scale labels */
.gauge-scale {
  display: flex; justify-content: space-between;
  width: 100%; padding: 0 4px;
  font-size: 9px; color: var(--txt3); font-family: var(--font-mono);
}

/* Legend */
.snt-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  justify-content: center;
}
.leg-item { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--txt3); }
.leg-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   NEWS SECTION
   ============================================================ */
.news-section { padding: 16px; background: var(--bg); border-top: 1px solid var(--border); }

.ns-hdr {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
  flex-wrap: wrap;
}
.ns-hdr h3 { font-size: 14px; font-weight: 800; }
.news-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ntab {
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 20px;
  background: none; color: var(--txt3); font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.ntab:hover { border-color: var(--teal); color: var(--teal); }
.ntab.active { background: var(--teal); color: #000; border-color: var(--teal); }

.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.news-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all 0.2s; cursor: pointer;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
}
.news-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.news-img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--bg3); }
.news-img-placeholder { width: 100%; height: 150px; background: linear-gradient(135deg, var(--bg3), var(--card2)); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.news-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.news-source { display: flex; align-items: center; justify-content: space-between; }
.news-src { font-size: 10px; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.news-date { font-size: 10px; color: var(--txt3); }
.news-title { font-size: 13px; font-weight: 700; line-height: 1.4; flex: 1; }
.news-body p { font-size: 11.5px; color: var(--txt2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Loading skeleton */
.news-skeleton {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  height: 240px; overflow: hidden;
}
.skeleton-pulse { width: 100%; height: 100%; background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   INDICES BAR (Stocks)
   ============================================================ */
.indices-bar {
  display: flex; align-items: center;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  overflow: hidden; height: 46px;
}
.tv-ticker-wrap { padding: 0; gap: 0; }
.tv-ticker-wrap .tradingview-widget-container { flex: 1; min-width: 0; height: 46px; }
.tv-ticker-wrap .tradingview-widget-container__widget { height: 46px; }
.idx-item { display: flex; flex-direction: column; align-items: flex-start; padding: 0 20px 0 0; flex-shrink: 0; gap: 2px; }
.idx-name { font-size: 10px; color: var(--txt3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.idx-val { font-size: 13px; font-weight: 800; font-family: var(--font-mono); }
.idx-chg { font-size: 11px; font-weight: 700; }
.idx-sep { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; margin: 0 8px; }

.market-session { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 600; }
.ms-dot { width: 8px; height: 8px; border-radius: 50%; }
.ms-dot.open { background: var(--green); animation: pulse 2s infinite; }
.ms-dot.closed { background: var(--red); }
.ms-dot.pre { background: var(--gold); animation: pulse 2s infinite; }

/* Sector Performance */
.sector-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.sector-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.sector-name { flex: 1; color: var(--txt2); }
.sector-bar-wrap { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.sector-bar { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.sector-bar.pos { background: var(--green); }
.sector-bar.neg { background: var(--red); }
.sector-pct { width: 42px; text-align: right; font-family: var(--font-mono); font-weight: 700; font-size: 11px; }

/* Economic Calendar */
.econ-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.econ-item { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.econ-time { font-family: var(--font-mono); color: var(--txt3); font-size: 10px; flex-shrink: 0; width: 40px; }
.econ-event { flex: 1; font-weight: 600; }
.econ-impact { font-size: 9px; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.econ-impact.high { background: var(--red-dim); color: var(--red); }
.econ-impact.med  { background: rgba(245,158,11,0.12); color: var(--gold); }
.econ-impact.low  { background: var(--green-dim); color: var(--green); }

/* Options */
.options-info { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.opt-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.opt-row span { color: var(--txt2); }
.opt-row b { font-family: var(--font-mono); font-size: 12px; }

/* Metric rows */
.metrics-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.metric-row { display: flex; justify-content: space-between; font-size: 11px; }

/* Info Tip */
.info-tip { cursor: help; color: var(--txt3); font-size: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.text-btn {
  background: none; border: none; color: var(--teal); font-size: 11.5px;
  font-weight: 600; cursor: pointer; padding: 2px 4px;
}
.text-btn:hover { text-decoration: underline; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 20px; background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #000; font-weight: 700; font-size: 13px;
  border: none; border-radius: 7px; cursor: pointer; transition: all 0.2s;
  text-decoration: none; width: 100%;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(20,188,189,0.3); }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,12,20,0.85); backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 440px;
  box-shadow: var(--shadow); overflow: hidden;
}
.modal-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.modal-hdr h3 { font-size: 15px; font-weight: 700; }
.close-modal-btn { background: none; border: none; color: var(--txt3); font-size: 18px; cursor: pointer; }
.close-modal-btn:hover { color: var(--txt); }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.form-grp { display: flex; flex-direction: column; gap: 5px; }
.form-grp label { font-size: 11.5px; font-weight: 600; color: var(--txt2); }
.form-grp input, .form-grp select {
  width: 100%; padding: 9px 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--txt); font-size: 13px; outline: none;
  transition: border 0.2s;
}
.form-grp input:focus, .form-grp select:focus { border-color: var(--teal); }
.form-grp select { cursor: pointer; }

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

/* Alerts List */
.alerts-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.alert-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px;
}
.alert-del { background: none; border: none; color: var(--red); cursor: pointer; font-size: 14px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 600;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--card2);
  border: 1px solid var(--teal); border-radius: 10px;
  box-shadow: var(--shadow); min-width: 240px; max-width: 380px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast-icon { font-size: 18px; }
.toast-msg { flex: 1; font-size: 13px; font-weight: 600; }
.toast-close { background: none; border: none; color: var(--txt3); cursor: pointer; font-size: 14px; }
.toast-close:hover { color: var(--txt); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 220px 1fr 260px; }
}

@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .left-panel, .right-panel { display: none; }
  .bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .global-stats { display: none; }
  .header-center { display: none; }
  .coin-metrics { display: none; }
  .ta-bar { display: none; }
}
