:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222c;
  --border: #2a303c;
  --text: #f0f2f5;
  --text-muted: #9aa3b2;
  --gold: #c9a227;
  --gold-dim: #8a7019;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100vh; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; color: var(--text); }
.header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo-title { font-size: 1.125rem; font-weight: 600; margin: 0; }
.logo-sub { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.04em; margin: 0; }
.btn-group { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.btn-group button {
  padding: 6px 12px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.btn-group button.active {
  background: var(--gold);
  color: #000;
  font-weight: 500;
}
.btn {
  padding: 6px 12px;
  font-size: 0.875rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.btn:hover { border-color: var(--gold-dim); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gold {
  background: var(--gold);
  color: #000;
  border: none;
  font-weight: 500;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.status-dot.ok { background: var(--green); }
.status-dot.deg { background: #eab308; }
.status-dot.off { background: var(--red); }
.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.error-banner {
  border: 1px solid rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: 6px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.card {
  text-align: left;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
}
.card.active { border-color: var(--gold); }
.card:hover { border-color: var(--gold-dim); }
.card-pair { font-weight: 600; }
.card-price { font-size: 1.35rem; font-family: ui-monospace, monospace; margin: 4px 0; }
.grid-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1280px) {
  .grid-main { grid-template-columns: 2fr 1fr; }
}
.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.tf-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
}
.tf-btn.active {
  background: var(--gold);
  color: #000;
  font-weight: 500;
}
.panel-body { padding: 16px; }
.signal-dir {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.signal-dir.LONG { color: var(--green); border-color: rgba(34,197,94,0.4); }
.signal-dir.SHORT { color: var(--red); border-color: rgba(239,68,68,0.4); }
.signal-dir.NO_TRADE { color: var(--text-muted); }
.signal-dir.PROVISIONAL { color: #eab308; border-color: rgba(234,179,8,0.4); }
.checklist-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 4px 0;
}
.badge-pass { color: var(--green); font-size: 0.75rem; font-weight: 500; }
.badge-fail { color: var(--red); font-size: 0.75rem; font-weight: 500; }
.badge-unc { color: #eab308; font-size: 0.75rem; font-weight: 500; }
.muted { color: var(--text-muted); font-size: 0.75rem; }
.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label { display: block; font-size: 0.875rem; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  margin-top: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-box {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px;
}
.stat-label { font-size: 0.7rem; color: var(--text-muted); }
.stat-val { font-size: 1.1rem; font-weight: 600; }
.rr-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 2px 0;
}
.chart-wrap { width: 100%; height: 420px; }
@media (max-width: 640px) {
  .chart-wrap { height: 300px; }
}
