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

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════ */

:root {
  --bg-base:      #070b12;
  --bg-surface:   #0c1220;
  --bg-elevated:  #111927;
  --bg-card:      #141e2e;
  --bg-hover:     #1a2540;

  --border:       #1e2d45;
  --border-glow:  #1e3a5f;

  --accent-blue:  #1d9bf0;
  --accent-cyan:  #00d4ff;
  --accent-green: #00e676;
  --accent-red:   #ff3d5a;
  --accent-amber: #ffab00;
  --accent-purple:#a855f7;

  --text-primary:   #e8f0fe;
  --text-secondary: #7b92b2;
  --text-muted:     #3d5470;
  --text-label:     #4a6a94;

  --pnl-pos:  #00e676;
  --pnl-neg:  #ff3d5a;
  --pnl-zero: #7b92b2;

  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════ */

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

html { font-size: 13px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT — DASHBOARD GRID
═══════════════════════════════════════════════════════════ */

#root { flex-direction: column; height: 100vh; overflow: hidden; display: flex; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  grid-template-rows: auto 500px 1fr;
  grid-template-areas:
    "metrics  metrics"
    "chart    bots"
    "history  bots";
  gap: 1px;
  background: var(--border);
  flex: 1;
  min-height: 0;
}

.module { background: var(--bg-base); overflow: hidden; min-width: 0; }

.module-metrics  { grid-area: metrics; }

.module-chart    { grid-area: chart; }

.module-bots     { grid-area: bots; overflow-y: auto; }

.module-history  { grid-area: history; overflow-y: auto; }

/* ═══════════════════════════════════════════════════════════
   MODULE HEADER
═══════════════════════════════════════════════════════════ */

.mod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.mod-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-label);
}

.mod-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(29,155,240,0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(29,155,240,0.25);
}

/* ═══════════════════════════════════════════════════════════
   MODULE 1 — METRIC PANEL
═══════════════════════════════════════════════════════════ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
}

@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: var(--bg-surface);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: background var(--transition);
}

.metric-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-blue);
  opacity: 0;
  transition: opacity var(--transition);
}

.metric-card:hover { background: var(--bg-elevated); }

.metric-card:hover::after { opacity: 1; }

.metric-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: 6px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.metric-value.pos { color: var(--pnl-pos); }

.metric-value.neg { color: var(--pnl-neg); }

.metric-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.metric-bar-wrap {
  margin-top: 8px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transition: width 0.6s ease;
}

/* ═══════════════════════════════════════════════════════════
   MODULE 2 — CHART PANEL
═══════════════════════════════════════════════════════════ */

.chart-panel { display: flex; flex-direction: column; height: 100%; }

.chart-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 200px;
  min-height: 0;
}

@media (max-width: 768px) {
  .chart-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
}

.chart-symbol-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  overflow-x: auto;
  scrollbar-width: none;
}

.chart-symbol-bar::-webkit-scrollbar { display: none; }

.sym-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.sym-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-glow);
}

.sym-btn.active {
  background: rgba(29,155,240,0.15);
  border-color: var(--accent-blue);
  color: var(--accent-cyan);
}

.sym-btn.locked::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
}

.chart-area-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

.chart-container { width: 100%; height: 100%; }

.indicator-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  height: 80px;
  flex-shrink: 0;
}

.indicator-cell {
  background: var(--bg-surface);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ind-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: 4px;
}

.ind-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.ind-signal {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.ind-signal.buy  { color: var(--accent-green); }

.ind-signal.hold { color: var(--text-muted); }

.ind-signal.sell { color: var(--accent-red); }

/* ═══════════════════════════════════════════════════════════
   MODULE 3 — BOT STATUS MATRIX
═══════════════════════════════════════════════════════════ */

.bot-config-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.config-input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.config-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-label);
  white-space: nowrap;
}

.config-input {
  width: 100% !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 6px;
  text-align: center;
  transition: border-color var(--transition);
}

.bot-config-bar .btn-apply {
  grid-column: span 3;
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.config-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.btn-apply {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-blue);
  background: rgba(29,155,240,0.15);
  color: var(--accent-blue);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-apply:hover {
  background: rgba(29,155,240,0.3);
  color: var(--accent-cyan);
}

.bot-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.bot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color var(--transition);
}

.bot-card:hover { border-color: var(--border-glow); }

.bot-card.running  { border-left: 3px solid var(--accent-green); }

.bot-card.draining { border-left: 3px solid var(--accent-amber); }

.bot-card.paused   { border-left: 3px solid var(--text-muted); }

.bot-card.stopped  { border-left: 3px solid var(--text-muted); }

.bot-card.error    { border-left: 3px solid var(--accent-red); }

.bot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bot-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.bot-state-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  padding: 2px 7px;
  border-radius: 2px;
}

.state-running  { background: rgba(0,230,118,0.12); color: var(--accent-green); border: 1px solid rgba(0,230,118,0.25); }

.state-draining { background: rgba(255,171,0,0.12); color: var(--accent-amber); border: 1px solid rgba(255,171,0,0.25); }

.state-paused   { background: rgba(123,146,178,0.12); color: var(--text-secondary); border: 1px solid var(--border); }

.state-stopped  { background: rgba(123,146,178,0.08); color: var(--text-muted); border: 1px solid var(--border); }

.state-error    { background: rgba(255,61,90,0.12); color: var(--accent-red); border: 1px solid rgba(255,61,90,0.25); }

.state-starting { background: rgba(29,155,240,0.12); color: var(--accent-blue); border: 1px solid rgba(29,155,240,0.25); }

.bot-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin-bottom: 6px;
}

.bot-stat { display: flex; flex-direction: column; gap: 1px; }

.bot-stat-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.bot-stat-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.bot-stat-val.pos { color: var(--pnl-pos); }

.bot-stat-val.neg { color: var(--pnl-neg); }

.bot-stat-val.sym { color: var(--accent-cyan); font-weight: 600; }

.bot-action-text {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.4;
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 2px;
}

.bot-controls {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.btn-bot-action {
  flex: 1;
  padding: 4px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-bot-action.stop:hover  { background: rgba(255,61,90,0.15); border-color: var(--accent-red); color: var(--accent-red); }

.btn-bot-action.start:hover { background: rgba(0,230,118,0.15); border-color: var(--accent-green); color: var(--accent-green); }

/* PnL Chart */

.pnl-chart-wrap { padding: 12px; }

.pnl-chart-canvas { width: 100% !important; height: 120px !important; }

/* ═══════════════════════════════════════════════════════════
   MODULE 4 — AI PREDICTOR
═══════════════════════════════════════════════════════════ */

.predict-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  height: calc(100% - 37px);
}

.predict-cell {
  background: var(--bg-surface);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.predict-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  opacity: 0.4;
}

.predict-horizon {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.predict-symbol {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.predict-price {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.predict-range {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.predict-range span { color: var(--text-muted); }

.predict-direction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.dir-up   { background: rgba(0,230,118,0.12); color: var(--accent-green); border: 1px solid rgba(0,230,118,0.2); }

.dir-down { background: rgba(255,61,90,0.12); color: var(--accent-red); border: 1px solid rgba(255,61,90,0.2); }

.dir-flat { background: rgba(123,146,178,0.1); color: var(--text-secondary); border: 1px solid var(--border); }

.predict-meta { display: flex; flex-direction: column; gap: 5px; }

.predict-meta-row { display: flex; justify-content: space-between; align-items: center; }

.predict-meta-label { font-size: 9px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

.predict-meta-val { font-family: var(--font-mono); font-size: 10px; color: var(--text-secondary); }

.confidence-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.confidence-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.predict-model-info {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN UI
═══════════════════════════════════════════════════════════ */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: radial-gradient(circle at 50% -20%, var(--bg-hover) 0%, var(--bg-base) 60%);
}

.login-panel {
  background: rgba(12, 18, 32, 0.7);
  backdrop-filter: blur(20px);
  padding: 48px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glow);
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.login-header h2 {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-header p {
  color: var(--text-label);
  font-size: 13px;
  font-family: var(--font-mono);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.input-group input:focus {
  border-color: var(--accent-cyan);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.login-btn {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #0088cc 100%);
  color: #000;
  border: none;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

.login-btn:active {
  transform: translateY(1px);
}

.login-error {
  background: rgba(255, 61, 90, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(255, 61, 90, 0.3);
  padding: 12px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS
═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  body, #root {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 500px auto;
    grid-template-areas:
      "metrics"
      "chart"
      "bots"
      "history";
    width: 100%;
    max-width: 100%;
  }
  .module-bots {
    width: 100%;
  }
}

@media (max-width: 768px) {
  html { font-size: 12px; }
  
  .dashboard-header {
    padding: 0 12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .header-brand, .header-status {
    gap: 12px;
  }
  
  .metric-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tv-widget-container {
    height: 400px;
  }

  .login-panel {
    padding: 32px 24px;
    width: 100%;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   MODULE 5 — TRADE HISTORY TABLE
═══════════════════════════════════════════════════════════ */

.trade-table-wrap { overflow-x: auto; height: calc(100% - 37px); overflow-y: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
}

thead tr {
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

thead th {
  padding: 8px 10px;
  text-align: right;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-label);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th:first-child { text-align: left; }

tbody tr {
  border-bottom: 1px solid rgba(30,45,69,0.5);
  transition: background var(--transition);
}

tbody tr:hover { background: var(--bg-surface); }

tbody td {
  padding: 7px 10px;
  text-align: right;
  color: var(--text-secondary);
  white-space: nowrap;
}

tbody td:first-child { text-align: left; color: var(--accent-cyan); font-weight: 600; }

.td-pos { color: var(--pnl-pos) !important; }

.td-neg { color: var(--pnl-neg) !important; }

.td-muted { color: var(--text-muted) !important; }

/* ═══════════════════════════════════════════════════════════
   HEADER COMPONENTS
═══════════════════════════════════════════════════════════ */

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--accent-green); }
  50% { opacity: 0.6; box-shadow: 0 0 4px var(--accent-green); }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.header-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════════════════ */

.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.mono { font-family: var(--font-mono); }

.separator { width: 1px; height: 20px; background: var(--border); }

/* Scrollbar */

::-webkit-scrollbar { width: 4px; height: 4px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

::-webkit-scrollbar-thumb:hover { background: var(--border-glow); }

/* Micro-animation: value change flash */

@keyframes flash-pos {
  0%   { color: var(--accent-green); }
  100% { color: inherit; }
}

@keyframes flash-neg {
  0%   { color: var(--accent-red); }
  100% { color: inherit; }
}

.flash-pos { animation: flash-pos 0.6s ease; }

.flash-neg { animation: flash-neg 0.6s ease; }

/* order book depth bar */

.ob-bar-bid { background: rgba(0,230,118,0.15); }

.ob-bar-ask { background: rgba(255,61,90,0.15); }

.ob-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 2px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  transition: background var(--transition);
}

.ob-row:hover { background: var(--bg-elevated); }

.ob-price-bid { color: var(--accent-green); }

.ob-price-ask { color: var(--accent-red); }

.ob-qty { color: var(--text-secondary); text-align: right; }
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: var(--surface-light);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.settings-group {
  margin-bottom: 24px;
  background: rgba(255,255,255,0.02);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.settings-group h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--accent-cyan);
}

.settings-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  margin-top: 0;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-item label {
  font-size: 13px;
  color: var(--text-primary);
}

.setting-item input {
  background: var(--surface-dark);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  width: 100px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

.setting-item input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-cancel:hover {
  background: rgba(255,255,255,0.05);
}

.btn-save {
  background: var(--accent-cyan);
  border: none;
  color: #000;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-save:hover {
  background: #3b82f6; /* Adjust depending on accent-cyan exact color */
}

.btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
