/* ═══════════════════════════════════════════════════════════════
   CryptoBot AI — Dark Trading Terminal Design System
   Palette: Volcanic Glass (#1A1A1A, #333, #FF6B2B, #FFB088)
   Fonts: Syne (display) + Space Mono (data) + Inter (body)
═══════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:       #0a0a0f;
  --bg-surface:    #111118;
  --bg-card:       #16161f;
  --bg-card-hover: #1e1e2a;
  --bg-input:      #1a1a24;
  --border:        #2a2a3a;
  --border-bright: #3a3a50;

  --accent:        #00ff88;
  --accent-dim:    #00cc6a;
  --accent-glow:   rgba(0,255,136,0.15);
  --orange:        #ff6b2b;
  --orange-dim:    #cc5522;
  --orange-glow:   rgba(255,107,43,0.15);
  --blue:          #4488ff;
  --blue-glow:     rgba(68,136,255,0.15);
  --purple:        #9966ff;
  --yellow:        #ffcc00;
  --red:           #ff4444;
  --red-dim:       #cc2222;

  --text-primary:  #e8e8f0;
  --text-secondary:#9090a8;
  --text-muted:    #5a5a72;
  --text-accent:   #00ff88;

  --font-display:  'Syne', sans-serif;
  --font-mono:     'Space Mono', monospace;
  --font-body:     'Inter', sans-serif;

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 30px rgba(0,255,136,0.1);
  --shadow-orange: 0 0 30px rgba(255,107,43,0.15);

  --transition:    all 0.2s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Animated Background ───────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridPulse 8s ease-in-out infinite;
}
@keyframes gridPulse {
  0%,100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(120px); opacity: 0.06;
}
.bg-glow-1 {
  width: 600px; height: 600px;
  background: var(--accent);
  top: -200px; left: -200px;
  animation: glowFloat1 12s ease-in-out infinite;
}
.bg-glow-2 {
  width: 500px; height: 500px;
  background: var(--orange);
  bottom: -150px; right: -150px;
  animation: glowFloat2 15s ease-in-out infinite;
}
@keyframes glowFloat1 {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(60px, 40px); }
}
@keyframes glowFloat2 {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(-40px, -60px); }
}

/* ── Top Navigation Bar ────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: rgba(10,10,15,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar-left { display: flex; align-items: center; gap: 32px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* Logo */
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.logo-icon { font-size: 20px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  letter-spacing: 2px; color: var(--text-primary);
}
.logo-accent { color: var(--accent); }
.logo-badge {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 1px;
}

/* Tab Navigation */
.tab-nav { display: flex; gap: 4px; }
.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border);
}
.tab-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--accent-dim);
}
.tab-icon { font-size: 14px; }

/* Market Ticker */
.market-ticker { display: flex; gap: 16px; }
.ticker-item {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-secondary);
  display: flex; gap: 6px; align-items: center;
}
.ticker-price { color: var(--text-primary); font-weight: 700; }

/* Connection Status */
.connection-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  animation: statusPulse 2s ease-in-out infinite;
}
.status-dot.connected { background: var(--accent); }
.status-dot.error { background: var(--red); }
@keyframes statusPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Clock */
.clock {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-muted);
  letter-spacing: 1px;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  position: relative; z-index: 1;
  padding: 20px;
  max-width: 1800px; margin: 0 auto;
}

/* Tab Panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Stats Row ─────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.stat-card.stat-primary {
  border-color: var(--accent-dim);
  background: linear-gradient(135deg, var(--bg-card), rgba(0,255,136,0.05));
}
.stat-card.stat-fear { border-color: var(--orange-dim); }
.stat-icon { font-size: 22px; flex-shrink: 0; }
.stat-value {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--text-primary); line-height: 1;
}
.stat-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 3px;
}

/* ── Panel Header ──────────────────────────────────────────── */
.panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.panel-title h2 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
}
.panel-subtitle {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
}
.panel-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Live Badge */
.badge-live {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  background: rgba(0,255,136,0.1);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: 1px;
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.badge-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 10px;
}

/* ── Controls ──────────────────────────────────────────────── */
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.ctrl-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.ctrl-select:hover, .ctrl-select:focus {
  border-color: var(--accent-dim);
  background: var(--bg-card-hover);
}
.ctrl-large { min-width: 140px; }

.btn-scan {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  color: #000;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  letter-spacing: 0.5px;
}
.btn-scan:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,255,136,0.4);
}
.btn-scan:active { transform: translateY(0); }
.btn-scan.loading { opacity: 0.7; pointer-events: none; }

.btn-secondary {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}
.btn-secondary.active {
  border-color: var(--orange-dim);
  color: var(--orange);
  background: var(--orange-glow);
}

/* ── Data Table ────────────────────────────────────────────── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.table-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px; gap: 12px;
  color: var(--text-secondary);
}
.table-loading p { font-size: 14px; }
.loading-sub { font-size: 12px; color: var(--text-muted); }

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.data-table thead tr {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(42,42,58,0.5);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr {
  transition: var(--transition);
  cursor: pointer;
}
.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* Table cell types */
.cell-symbol {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 13px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 6px;
}
.cell-symbol .trending-badge {
  font-size: 10px; background: var(--orange-glow);
  color: var(--orange); border: 1px solid var(--orange-dim);
  padding: 1px 5px; border-radius: 3px;
}
.cell-price {
  font-family: var(--font-mono);
  font-weight: 700; color: var(--text-primary);
}
.cell-change { font-family: var(--font-mono); font-weight: 700; }
.cell-change.positive { color: var(--accent); }
.cell-change.negative { color: var(--red); }

.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 24px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
}
.score-high { background: rgba(0,255,136,0.15); color: var(--accent); border: 1px solid var(--accent-dim); }
.score-mid  { background: rgba(255,204,0,0.12); color: var(--yellow); border: 1px solid rgba(255,204,0,0.3); }
.score-low  { background: rgba(255,107,43,0.12); color: var(--orange); border: 1px solid var(--orange-dim); }

.signal-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px; white-space: nowrap;
}
.signal-strong-buy { background: rgba(0,255,136,0.15); color: var(--accent); border: 1px solid var(--accent-dim); }
.signal-buy        { background: rgba(0,204,102,0.12); color: #00cc66; border: 1px solid rgba(0,204,102,0.3); }
.signal-watch      { background: rgba(255,204,0,0.12); color: var(--yellow); border: 1px solid rgba(255,204,0,0.3); }
.signal-avoid      { background: rgba(255,68,68,0.12); color: var(--red); border: 1px solid rgba(255,68,68,0.3); }

.rsi-badge {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
}
.rsi-oversold  { color: var(--accent); background: var(--accent-glow); }
.rsi-neutral   { color: var(--text-secondary); background: var(--bg-input); }
.rsi-overbought{ color: var(--red); background: rgba(255,68,68,0.1); }

.vol-ratio {
  font-family: var(--font-mono); font-size: 12px;
  display: flex; align-items: center; gap: 4px;
}
.vol-high { color: var(--accent); }
.vol-mid  { color: var(--yellow); }
.vol-low  { color: var(--text-muted); }

.target-cell {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--accent);
}
.stop-cell {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--red);
}

.signals-mini {
  display: flex; flex-direction: column; gap: 2px;
  max-width: 220px;
}
.signal-tag {
  font-size: 10px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.btn-detail {
  padding: 4px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px; cursor: pointer;
  transition: var(--transition);
}
.btn-detail:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Scalping Layout ───────────────────────────────────────── */
.scalping-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}

/* Signal Card */
.signal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}
.signal-card.long  { border-color: var(--accent-dim); box-shadow: var(--shadow-glow); }
.signal-card.short { border-color: var(--red); box-shadow: 0 0 30px rgba(255,68,68,0.1); }

.signal-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.signal-symbol {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--text-primary);
}
.signal-direction {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  padding: 4px 14px; border-radius: 6px;
  letter-spacing: 1px;
}
.signal-direction.LONG    { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent-dim); }
.signal-direction.SHORT   { background: rgba(255,68,68,0.1); color: var(--red); border: 1px solid rgba(255,68,68,0.3); }
.signal-direction.NEUTRAL { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }
.signal-quality {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 4px;
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border);
}

.signal-confidence { margin-bottom: 16px; }
.confidence-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.confidence-bar-wrap {
  height: 8px; background: var(--bg-input);
  border-radius: 4px; overflow: hidden; margin-bottom: 4px;
}
.confidence-bar {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 10px rgba(0,255,136,0.4);
}
.confidence-value {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--accent); text-align: right;
}

.signal-levels {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.level-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.level-label {
  font-size: 9px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 3px;
}
.level-value {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
}
.level-entry  .level-value { color: var(--blue); }
.level-tp1    .level-value { color: var(--accent); }
.level-tp2    .level-value { color: var(--accent-dim); }
.level-tp3    .level-value { color: #00aa55; }
.level-sl     .level-value { color: var(--red); }
.level-rr     .level-value { color: var(--yellow); }

.signal-timer {
  font-size: 11px; color: var(--text-muted);
  text-align: center; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.timer-value {
  font-family: var(--font-mono);
  color: var(--orange); font-weight: 700;
}

/* Indicator Grid */
.indicator-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 16px;
}
.ind-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: var(--transition);
}
.ind-card:hover { border-color: var(--border-bright); }
.ind-name {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.ind-value {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 4px;
}
.ind-signal {
  font-size: 10px; color: var(--text-muted);
}
.ind-bar {
  height: 3px; background: var(--bg-input);
  border-radius: 2px; overflow: hidden;
}
.ind-fill {
  height: 100%; border-radius: 2px;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* Signal Reasons */
.signal-reasons {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.signal-reasons h4 {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 10px;
}
.reasons-list { display: flex; flex-direction: column; gap: 6px; }
.reason-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
  padding: 5px 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-dim);
}
.reasons-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 10px; }

/* ── Chart Panel ───────────────────────────────────────────── */
.chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.chart-title {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
}
.chart-controls { display: flex; gap: 4px; }
.chart-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px; cursor: pointer;
  transition: var(--transition);
}
.chart-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }
.chart-btn.active { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-glow); }

.price-chart { height: 320px; }

/* Signal History */
.signal-history {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}
.signal-history h4 {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.history-item {
  display: grid;
  grid-template-columns: 80px 60px 60px 1fr auto;
  gap: 8px; align-items: center;
  padding: 6px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 11px;
  border-left: 2px solid var(--border);
  transition: var(--transition);
}
.history-item.long  { border-left-color: var(--accent); }
.history-item.short { border-left-color: var(--red); }
.history-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 10px; }

/* Multi-Signal Grid */
.multi-signals {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.multi-signals h4 {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 10px;
}
.multi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.multi-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer; transition: var(--transition);
}
.multi-item:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.multi-item.long  { border-left: 2px solid var(--accent); }
.multi-item.short { border-left: 2px solid var(--red); }
.multi-symbol { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-primary); }
.multi-dir    { font-size: 10px; font-weight: 700; margin-top: 2px; }
.multi-conf   { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* ── Backtesting ───────────────────────────────────────────── */
.strategy-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.strategy-placeholder {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px; gap: 12px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.placeholder-icon { font-size: 48px; }
.placeholder-sub { font-size: 12px; color: var(--text-muted); text-align: center; }

.strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.strategy-card:hover { border-color: var(--border-bright); transform: translateY(-2px); }
.strategy-card.best {
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-glow);
}
.strategy-card.best::before {
  content: '⭐ BEST';
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 2px 7px; border-radius: 4px;
}
.strat-name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 4px;
}
.strat-desc {
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 14px; line-height: 1.4;
}
.strat-metrics { display: flex; flex-direction: column; gap: 8px; }
.strat-metric {
  display: flex; justify-content: space-between; align-items: center;
}
.strat-metric-label { font-size: 11px; color: var(--text-muted); }
.strat-metric-value {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
}
.strat-metric-value.positive { color: var(--accent); }
.strat-metric-value.negative { color: var(--red); }

.trade-history-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
}
.trade-history-panel h4 {
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Market Overview ───────────────────────────────────────── */
.market-layout { display: flex; flex-direction: column; gap: 20px; }

.market-stats-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.mstat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}
.mstat-card:hover { border-color: var(--border-bright); }
.mstat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.mstat-value {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800;
  color: var(--text-primary);
}

.movers-layout {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.movers-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.movers-panel h3 {
  font-size: 14px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 12px;
}
.movers-list { display: flex; flex-direction: column; gap: 6px; }
.mover-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}
.mover-item:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.mover-symbol { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-primary); }
.mover-price  { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.mover-change { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.mover-change.up   { color: var(--accent); }
.mover-change.down { color: var(--red); }

/* Order Book */
.orderbook-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.orderbook-panel .panel-header { margin-bottom: 12px; }
.orderbook-panel h3 { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.orderbook-layout {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 12px; align-items: start;
}
.ob-side { display: flex; flex-direction: column; gap: 3px; }
.ob-header {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 8px; margin-bottom: 4px;
}
.ob-row {
  display: flex; justify-content: space-between;
  padding: 4px 8px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 12px;
  position: relative; overflow: hidden;
}
.ob-row::before {
  content: ''; position: absolute; top: 0; bottom: 0;
  opacity: 0.08; border-radius: 3px;
}
.ob-asks .ob-row { color: var(--red); }
.ob-asks .ob-row::before { background: var(--red); right: 0; }
.ob-bids .ob-row { color: var(--accent); }
.ob-bids .ob-row::before { background: var(--accent); left: 0; }
.ob-spread {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); text-align: center;
  padding: 8px 4px; writing-mode: vertical-rl;
  text-orientation: mixed;
}
.ob-pressure { margin-top: 12px; }
.pressure-bar-wrap {
  display: flex; height: 24px; border-radius: 4px; overflow: hidden;
}
.pressure-buy {
  background: rgba(0,255,136,0.2);
  color: var(--accent);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: width 0.5s ease;
}
.pressure-sell {
  background: rgba(255,68,68,0.2);
  color: var(--red);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: width 0.5s ease;
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  width: 90%; max-width: 900px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-secondary); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); z-index: 1;
}
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  color: var(--text-primary);
}
.modal-price {
  font-family: var(--font-mono);
  font-size: 20px; font-weight: 700;
  color: var(--accent);
}
.modal-body {
  padding: 20px 24px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.modal-chart-wrap { grid-column: 1 / -1; }
.modal-section { margin-bottom: 16px; }
.modal-section h4 {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 10px;
}
.modal-targets, .modal-indicators {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modal-target-item, .modal-ind-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.modal-target-label, .modal-ind-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.modal-target-value, .modal-ind-value {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  color: var(--text-primary); margin-top: 2px;
}
.modal-signals-list { display: flex; flex-direction: column; gap: 6px; }
.modal-signal-item {
  font-size: 12px; color: var(--text-secondary);
  padding: 6px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-dim);
}

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 280px; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1);
  font-size: 13px;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--yellow); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1400px) {
  .strategy-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .market-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .scalping-layout { grid-template-columns: 1fr; }
  .movers-layout { grid-template-columns: 1fr; }
  .tab-nav { display: none; }
}
@media (max-width: 768px) {
  .main-content { padding: 12px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .strategy-grid { grid-template-columns: 1fr; }
  .modal-body { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .market-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Utility ───────────────────────────────────────────────── */
.text-accent  { color: var(--accent); }
.text-red     { color: var(--red); }
.text-yellow  { color: var(--yellow); }
.text-orange  { color: var(--orange); }
.text-muted   { color: var(--text-muted); }
.font-mono    { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.hidden       { display: none !important; }
.pulse        { animation: livePulse 2s ease-in-out infinite; }