:root {
  --bg: #0b0e14;
  --bg-elev: #11151d;
  --bg-card: #151a24;
  --border: #1e2533;
  --fg: #e6e9ef;
  --fg-dim: #8a93a6;
  --fg-faint: #5b6478;
  --green: #3ddc84;
  --red: #ff6b6b;
  --amber: #ffb347;
  --accent: #6ea8ff;
  --mono: ui-monospace, SFMono-Regular, "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-elev); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-weight: 600; letter-spacing: 0.02em; }
.brand-ver { color: var(--fg-dim); font-family: var(--mono); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint);
  align-self: center; margin-right: 4px; box-shadow: 0 0 0 0 rgba(61,220,132,.6); }
.dot.live { background: var(--green); animation: pulse 2s infinite; }
.dot.paper { background: var(--amber); }
.dot.halt { background: var(--red); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61,220,132,.6); }
  70% { box-shadow: 0 0 0 6px rgba(61,220,132,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); }
}

nav { display: flex; gap: 8px; align-items: center; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--bg-card);
  border: 1px solid var(--border); font-family: var(--mono); font-size: 12px;
  color: var(--fg-dim); }
.chip.pair { color: var(--fg); border-color: var(--accent); }
.chip.strategy { color: var(--accent); }
.chip.mode { text-transform: uppercase; letter-spacing: 0.08em; }

main { max-width: 1400px; margin: 0 auto; padding: 24px; display: flex;
  flex-direction: column; gap: 20px; }

.grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 13px; font-weight: 500; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.08em; }
.card-meta { font-family: var(--mono); font-size: 12px; color: var(--fg-faint); }

.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-faint); margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums;
  font-family: var(--mono); }
.kpi-sub { font-size: 12px; color: var(--fg-dim); margin-top: 6px;
  font-family: var(--mono); }
.kpi-value.pos { color: var(--green); }
.kpi-value.neg { color: var(--red); }

.chart-card { min-height: 340px; }
.chart-card canvas { width: 100% !important; height: 320px !important; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.scroll { max-height: 320px; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.tbl th, .tbl td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--fg-faint); font-weight: 500; position: sticky; top: 0;
  background: var(--bg-card); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .pos { color: var(--green); }
.tbl .neg { color: var(--red); }
.tbl .side-buy { color: var(--green); }
.tbl .side-sell { color: var(--red); }

.metric-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
}
.metric { background: var(--bg-elev); padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--border); }
.metric-label { font-size: 11px; color: var(--fg-faint); text-transform: uppercase;
  letter-spacing: 0.08em; }
.metric-value { font-family: var(--mono); font-size: 16px; margin-top: 4px;
  font-variant-numeric: tabular-nums; }

footer { text-align: center; color: var(--fg-faint); font-size: 12px;
  padding: 24px; border-top: 1px solid var(--border); margin-top: 24px; }
