:root {
  --bg: #0b0f14;
  --bg-panel: #111820;
  --bg-rail: #0e141c;
  --cyan: #3de0ff;
  --cyan-dim: #1a8aa0;
  --amber: #f0a030;
  --amber-dim: #8a5a18;
  --ok: #3dff9a;
  --fail: #ff4d6a;
  --text: #d8e4ef;
  --muted: #6a7d90;
  --line: #1e2a38;
  --font-ui: "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "Consolas", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(61,224,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,224,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
a { color: var(--cyan); text-decoration: none; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
}
.hud-frame {
  border: 1px solid var(--cyan-dim);
  background: var(--bg-panel);
  position: relative;
  padding: 2.5rem 2rem;
  width: min(400px, 100%);
  box-shadow: 0 0 40px rgba(61,224,255,0.08), inset 0 0 60px rgba(0,0,0,0.4);
}
.hud-frame::before, .hud-frame::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--cyan);
}
.hud-frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hud-frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.brand {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-align: center;
  margin-bottom: 0.35rem;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: var(--amber);
  text-align: center;
  margin-bottom: 2rem;
  text-transform: uppercase;
}
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
input, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.1rem;
  outline: none;
}
input:focus, select:focus { border-color: var(--cyan); }
.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid var(--cyan);
  background: rgba(61,224,255,0.1);
  color: var(--cyan);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  width: 100%;
}
.btn:hover { background: rgba(61,224,255,0.22); }
.btn-amber {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(240,160,48,0.1);
}
.btn-amber:hover { background: rgba(240,160,48,0.22); }
.btn-sm { width: auto; padding: 0.55rem 1rem; }
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.85rem 1.25rem;
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
}
.btn-link:hover { color: var(--text); }
.error-box {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fail);
  border: 1px solid var(--fail);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  background: rgba(255,77,106,0.08);
}
.shell { display: flex; min-height: 100vh; }
.rail {
  width: 220px;
  background: var(--bg-rail);
  border-right: 1px solid var(--line);
  padding: 1.5rem 0;
  flex-shrink: 0;
}
.rail-brand {
  font-family: var(--font-mono);
  color: var(--cyan);
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.rail-brand span {
  color: var(--amber);
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  margin-top: 0.25rem;
}
.nav-item {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0.85rem 1.25rem;
  border-left: 2px solid transparent;
  text-transform: uppercase;
}
.nav-item:hover { color: var(--text); background: rgba(61,224,255,0.04); }
.nav-item.active {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: rgba(61,224,255,0.06);
}
.main { flex: 1; padding: 1.5rem 2rem; overflow: auto; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar h1 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.status-pills { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot.bad { background: var(--fail); box-shadow: 0 0 6px var(--fail); }
.panel {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  margin-bottom: 1.25rem;
  position: relative;
}
.panel-h {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-h span { color: var(--muted); }
.panel-b { padding: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.metric {
  border: 1px solid var(--line);
  padding: 0.85rem;
  background: var(--bg);
}
.metric .k {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.metric .v {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--cyan);
  margin-top: 0.35rem;
}
.metric .v.amber { color: var(--amber); }
.metric .v.ok { color: var(--ok); }
.metric .v.fail { color: var(--fail); }
table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.8rem; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.1em;
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid rgba(30,42,56,0.7);
}
tr:hover td { background: rgba(61,224,255,0.04); }
.st { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.st-run { color: var(--cyan); }
.st-queue { color: var(--amber); }
.st-ok { color: var(--ok); }
.st-fail { color: var(--fail); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.form-row.full { grid-template-columns: 1fr; }
.hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--amber-dim);
  margin-top: -0.6rem;
  margin-bottom: 1rem;
}
.lookup { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.lookup input { margin: 0; flex: 1; }
.mbps { color: var(--ok); }
.muted { color: var(--muted); }
.corner-tl, .corner-br {
  position: absolute; width: 10px; height: 10px;
  border-color: var(--amber); border-style: solid;
}
.corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
.empty {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 1rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0;
}
.detail-grid.compact { gap: 0.55rem 1rem; }
.detail-grid > div { min-width: 0; }
.detail-grid dt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.detail-grid dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-word;
}
.radio-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.radio-card {
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  background: rgba(8, 14, 22, 0.45);
}
.radio-card-h {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}
.live-chart {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  background: #0e141c;
}
body.page-live-usage {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.page-live-usage .shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body.page-live-usage .main {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.page-live-usage .topbar {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}
.live-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.live-page .live-controls { flex-shrink: 0; }
.live-page .live-controls .panel,
.live-page .live-chart-panel { margin-bottom: 0; }
.live-chart-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.live-chart-panel .panel-h { flex-shrink: 0; }
.live-chart-panel .panel-b {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.live-chart-wrap {
  flex: 1;
  min-height: 180px;
  position: relative;
}
.live-chart-wrap .live-chart {
  position: absolute;
  inset: 0;
}
.live-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.65rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.live-legend .lg-down { color: var(--ok); }
.live-legend .lg-up { color: var(--amber); }
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .grid-2, .metrics, .form-row, .detail-grid, .radio-groups { grid-template-columns: 1fr; }
}
