/* Alphas — design system
   An instrument, not a dashboard. Deep ink, hairline graticule rules, every
   figure tabular monospace so digits align to the tick. Green and red are
   reserved strictly for sign. Each bot owns a hue used consistently. */

:root {
  --void: #070B14; --abyss: #0A1020; --panel: #0D1424; --panel-hi: #111A2E; --panel-2: #0F172A;
  --rule: #1A2540; --rule-soft: #131C31; --mist: #64789E; --paper: #C3D2EE; --bright: #EAF1FF;
  --gain: #2BE8A5; --loss: #FF5470; --warn: #FFB454; --accent: #7C6CFF; --accent-2: #00E5C7;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step: 4px; --radius: 4px; --ease: cubic-bezier(.22,.61,.36,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1100px 620px at 18% -8%, #101B33 0%, transparent 62%),
              radial-gradient(820px 520px at 96% 4%, #0E1A2C 0%, transparent 58%), var(--void);
  color: var(--paper); font-family: var(--sans); font-size: 14px; line-height: 1.5; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mono, .num, td.num, th.num, .stat-value, .chip, .pill, .tape, input, select, textarea, code, .hash {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 1;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0; color: var(--bright); }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mist); }
.muted { color: var(--mist); } .small { font-size: 12px; } .bright { color: var(--bright); }
.gain { color: var(--gain); } .loss { color: var(--loss); } .flat { color: var(--paper); } .warn { color: var(--warn); }

/* ── shell ─────────────────────────────────────────────────────────────── */
.bar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; border-bottom: 1px solid var(--rule);
  background: rgba(7,11,20,.85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 12px; height: 12px; border-radius: 2px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 0 18px rgba(0,229,199,.35); }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .02em; color: var(--bright); }
.brand-name em { font-style: normal; color: var(--mist); font-weight: 500; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--paper); font-size: 13px; }
.nav a:hover { background: var(--panel-hi); text-decoration: none; }
.nav a.active { background: var(--panel-hi); color: var(--bright); box-shadow: inset 0 0 0 1px var(--rule); }
.nav .sep { width: 1px; background: var(--rule); margin: 4px 8px; }
.bar-right { display: flex; align-items: center; gap: 12px; }
.who { font-size: 12px; color: var(--mist); }
.who b { color: var(--paper); font-weight: 600; }
.shell { max-width: 1320px; margin: 0 auto; padding: 24px; }
.banner { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; border: 1px solid; }
.banner.ok { border-color: rgba(43,232,165,.4); background: rgba(43,232,165,.08); color: var(--gain); }
.banner.err { border-color: rgba(255,84,112,.45); background: rgba(255,84,112,.08); color: var(--loss); }
.banner.warn { border-color: rgba(255,180,84,.45); background: rgba(255,180,84,.08); color: var(--warn); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--mist); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── panels & grid ─────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 960px) { .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.main-side { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 16px; }
.panel.tight { padding: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { font-size: 14px; }
.stat { padding: 14px 16px; }
.stat .eyebrow { margin-bottom: 6px; }
.stat-value { font-size: 22px; color: var(--bright); line-height: 1.1; }
.stat-sub { font-size: 12px; color: var(--mist); margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 13px; }
.kv dt { color: var(--mist); } .kv dd { margin: 0; color: var(--paper); text-align: right; }

/* ── tables ────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mist); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.015); }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--mist); font-size: 13px; border: 1px dashed var(--rule); border-radius: 6px; }

/* ── chips, pills, dots ────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--abyss); color: var(--paper); white-space: nowrap; }
.chip.live { border-color: rgba(255,84,112,.5); color: var(--loss); }
.chip.paper { border-color: rgba(124,108,255,.5); color: #B7AEFF; }
.chip.ok { border-color: rgba(43,232,165,.4); color: var(--gain); }
.chip.err { border-color: rgba(255,84,112,.5); color: var(--loss); }
.chip.warn { border-color: rgba(255,180,84,.5); color: var(--warn); }
.chip.dim { color: var(--mist); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--mist); }
.dot.running { background: var(--gain); box-shadow: 0 0 8px rgba(43,232,165,.6); }
.dot.paused_daily { background: var(--warn); } .dot.killed, .dot.error { background: var(--loss); } .dot.idle { background: var(--mist); }
.hue { width: 10px; height: 10px; border-radius: 2px; display: inline-block; vertical-align: -1px; margin-right: 6px; }
.hash { font-size: 11px; color: var(--mist); }

/* ── forms ─────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-size: 12px; color: var(--mist); }
.field .help { font-size: 12px; color: var(--mist); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; background: var(--abyss); color: var(--bright); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 9px 10px; font-size: 13px; outline: none; transition: border-color .15s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { accent-color: var(--accent-2); width: 15px; height: 15px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius); font-size: 13px;
  font-weight: 600; cursor: pointer; border: 1px solid var(--rule); background: var(--panel-hi); color: var(--bright);
  transition: transform .1s var(--ease), background .15s var(--ease); text-decoration: none; }
.btn:hover { background: #172240; text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #00E5C7 0%, #2BE8A5 100%); color: #06251C; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { border-color: rgba(255,84,112,.5); color: var(--loss); background: rgba(255,84,112,.06); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.seg button, .seg a { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 6px 12px;
  background: transparent; color: var(--mist); border: none; cursor: pointer; }
.seg .on { background: var(--panel-hi); color: var(--bright); box-shadow: inset 0 0 0 1px var(--rule); }

/* ── login ─────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 380px; }
.login .brand { margin-bottom: 28px; justify-content: center; }
.login .panel { padding: 28px; }

/* ── charts ────────────────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; height: 260px; }
.chart canvas { width: 100%; height: 100%; display: block; }
.chart.tall { height: 340px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 2px; vertical-align: 3px; margin-right: 6px; background: var(--c, var(--mist)); }

/* ── tape ──────────────────────────────────────────────────────────────── */
.tape { font-size: 12px; max-height: 420px; overflow-y: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--abyss); }
.tape-row { display: grid; grid-template-columns: 112px 110px 90px 1fr; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--rule-soft); align-items: baseline; }
.tape-row:last-child { border-bottom: none; }
.tape-row .k { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--mist); }
.tape-row.k-entry_filled .k, .tape-row.k-trade_closed .k { color: var(--bright); }
.tape-row.k-signal .k { color: var(--accent-2); } .tape-row.k-skipped .k, .tape-row.k-paused .k { color: var(--warn); }
.tape-row.k-error .k, .tape-row.k-venue_error .k, .tape-row.k-rejected .k, .tape-row.k-killed .k { color: var(--loss); }
.tape-row.fresh { animation: flash .9s var(--ease); }
@keyframes flash { from { background: rgba(0,229,199,.12); } to { background: transparent; } }

/* ── bot cards ─────────────────────────────────────────────────────────── */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 14px; position: relative; display: block; color: inherit; }
.card:hover { border-color: #26355A; text-decoration: none; }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card .name { font-weight: 600; color: var(--bright); }
.card .policy { font-size: 12px; color: var(--mist); margin-bottom: 10px; }
.card .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card .metrics div { font-size: 12px; } .card .metrics b { display: block; font-family: var(--mono); font-weight: 500; color: var(--paper); font-size: 13px; }
.preset { border: 1px solid var(--rule); border-radius: 6px; padding: 12px; cursor: pointer; background: var(--abyss); }
.preset:hover { border-color: #26355A; } .preset.on { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2) inset; }
.preset h3 { font-size: 13px; margin-bottom: 4px; } .preset p { font-size: 12px; color: var(--mist); margin: 0; }
.preset .ev { font-size: 11px; color: var(--paper); margin-top: 6px; }
.symbols { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; padding: 8px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--abyss); }
.symbols label { font-family: var(--mono); font-size: 11px; display: inline-flex; gap: 5px; align-items: center; padding: 3px 7px; border-radius: 3px; border: 1px solid var(--rule-soft); cursor: pointer; }
.symbols label:has(input:checked) { border-color: var(--accent-2); color: var(--bright); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--rule); }
.steps span.on { color: var(--bright); border-color: var(--accent); }
details.adv summary { cursor: pointer; color: var(--mist); font-size: 12px; margin: 8px 0; }
.lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--mist); display: inline-block; }
.lamp.ok { background: var(--gain); box-shadow: 0 0 8px rgba(43,232,165,.6); } .lamp.err { background: var(--loss); } .lamp.idle { background: var(--mist); }
.foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--rule-soft); color: var(--mist); font-size: 11px; display: flex; justify-content: space-between; }
code { background: var(--abyss); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.invoice-total { font-size: 28px; color: var(--bright); }
.progress { height: 6px; border-radius: 3px; background: var(--rule-soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
