:root {
  --navy: #0a1180;
  --cyan: #00c8d7;
  --bg: #07111f;
  --bg2: #0c1a2e;
  --card: #102038;
  --line: #1e3352;
  --text: #e8eef8;
  --muted: #8fa3bf;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --blue: #38bdf8;
  --radius: 14px;
  --font: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: var(--cyan); text-decoration: none; }
.dev-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #f59e0b;
  color: #111;
  text-align: center;
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 3px solid #7c2d12;
  box-shadow: 0 2px 0 #7c2d12;
}
.dev-banner a { color: #111; text-decoration: underline; font-weight: 800; }
.dev-banner code { font-size: 12px; background: rgba(0,0,0,.12); padding: 2px 6px; border-radius: 6px; }
.check-prod { color: #fecaca !important; font-weight: 700; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--bg2);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand i { color: var(--cyan); font-size: 22px; }
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; }
.top-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
  background: #1a2b44; color: var(--text);
}
.chip.ok { background: rgba(34,197,94,.15); color: #4ade80; }
.chip.off { background: rgba(239,68,68,.15); color: #f87171; }
.chip.warn { background: rgba(245,158,11,.18); color: #fbbf24; }
.chip.blue { background: rgba(56,189,248,.15); color: #7dd3fc; }
.layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; padding: 16px 22px 28px; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.kpis-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 720px) { .kpis { grid-template-columns: 1fr 1fr; } .kpis-5 { grid-template-columns: 1fr 1fr; } }
.list-sm { max-height: 180px; }
.card-sub { margin-top: 14px; }
.driver-card { margin-top: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.45; }
.chip.stale { background: rgba(245,158,11,.25); color: #fcd34d; }
.kpi-warn b { color: #fbbf24; }
.kpi { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-size: 22px; }
.kpi span { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.steps { display: grid; gap: 8px; margin-bottom: 14px; }
.step {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.dot { width: 18px; height: 18px; border-radius: 50%; background: #334155; flex: 0 0 18px; margin-top: 2px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.dot.wait { background: var(--warn); }
.step strong { display: block; font-size: 13px; }
.step small { color: var(--muted); }
.list { max-height: 280px; overflow: auto; display: grid; gap: 6px; }
.row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center;
  background: var(--bg2); border-radius: 10px; padding: 8px 10px; font-size: 13px;
}
.row .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.row .b { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
input, select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
textarea { min-height: 70px; resize: vertical; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--cyan); color: #042026; }
.btn-ghost { background: #1a2b44; color: var(--text); }
.btn-danger { background: #7f1d1d; color: #fecaca; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
body.mode-live .dev-banner { background: #ef4444; color: #fff; border-bottom-color: #7f1d1d; }
body.mode-live .dev-banner a { color: #fff; }
.chip.live { background: rgba(239,68,68,.2); color: #fecaca; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.check input { width: auto; }
.result {
  margin-top: 12px; border-radius: 12px; padding: 12px; background: var(--bg2); border: 1px dashed var(--line);
  font-size: 13px; min-height: 52px; color: var(--muted);
}
.result.ok { border-color: var(--ok); color: #bbf7d0; }
.result.err { border-color: var(--err); color: #fecaca; }
.ativos { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: rgba(34,197,94,.15); color: #86efac; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.muted { color: var(--muted); font-size: 12px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.links a { background: #1a2b44; padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.auth-body { background: radial-gradient(1200px 500px at 50% -10%, #123, var(--bg)); }
.auth-wrap { min-height: calc(100vh - 32px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo i { font-size: 28px; color: var(--cyan); }
.auth-logo h1 { margin: 8px 0 0; }
.auth-logo p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.alert-err { background: rgba(239,68,68,.12); color: #fecaca; }
.auth-hint { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.row-click { cursor: pointer; }
.row-click:hover { outline: 1px solid var(--cyan); }
.table-wrap { overflow: auto; margin-top: 10px; }
.mtx { width: 100%; border-collapse: collapse; font-size: 12px; }
.mtx th, .mtx td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mtx th { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }
.mtx tr.fill-row { cursor: pointer; }
.mtx tr.fill-row:hover td { background: #1a2b44; }
.intent-on { color: #86efac; font-weight: 700; }
.intent-off { color: #fca5a5; font-weight: 700; }
.intent-none { color: var(--muted); }
