:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --accent: #c9a227;
  --ok: #2ecc71;
  --danger: #e74c3c;
  --text: #eee;
  --muted: #9aa3b5;
  --border: #2a3550;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); }
body.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; background: #0f0f1a; border-bottom: 2px solid var(--accent);
}
header h1 { margin: 0; font-size: 1.15rem; color: var(--accent); }
header a { color: var(--accent); margin-left: 1rem; text-decoration: none; }
header a:hover { text-decoration: underline; }
main { padding: 1.25rem; max-width: 1400px; margin: 0 auto; }
.grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.stats-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.two-col { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.three-col { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.controls-row { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--card); border-radius: 8px; padding: 1rem 1.2rem;
  border: 1px solid var(--border);
}
.card.stat.ok { border-color: var(--ok); }
.card.stat.off { border-color: var(--danger); }
.card h2 { margin: 0 0 .8rem; font-size: .95rem; color: var(--accent); font-weight: 600; }
.card h3.subhead { margin: 1rem 0 .5rem; font-size: .85rem; color: var(--muted); }
.big { font-size: 1.75rem; font-weight: bold; margin: 0; line-height: 1.2; }
.muted { color: var(--muted); font-size: .8rem; margin: .25rem 0 0; }
.btnrow { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn {
  border: none; padding: .5rem 1rem; border-radius: 4px;
  cursor: pointer; background: #444; color: #fff; font-size: .9rem;
}
.btn.ok { background: #1e6b3a; }
.btn.danger { background: #8b1a1a; }
.btn:hover { filter: brightness(1.1); }
.output pre {
  background: #0d0d14; padding: 1rem; overflow: auto;
  max-height: 280px; font-size: 12px; border-radius: 4px;
}
.err { color: var(--danger); }
label { display: block; margin: .6rem 0; }
input { width: 100%; padding: .5rem; margin-top: .2rem; border-radius: 4px; border: 1px solid #333; background: #111; color: #fff; }

.bar-row { display: flex; align-items: center; gap: .5rem; margin: .35rem 0; font-size: .85rem; }
.bar-label { flex: 0 0 110px; color: var(--muted); }
.bar-track { flex: 1; height: 8px; background: #0d0d14; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bar-fill-alt { background: #4a9eff; }
.bar-fill-ml { background: #a855f7; }
.bar-val { flex: 0 0 28px; text-align: right; font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data th, table.data td { padding: .35rem .5rem; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; }
table.data tr:hover td { background: rgba(255,255,255,.03); }
table.data.compact td, table.data.compact th { padding: .25rem .4rem; }
table.data .num { font-variant-numeric: tabular-nums; color: var(--muted); }

@media (max-width: 600px) {
  .bar-label { flex: 0 0 80px; font-size: .75rem; }
  .big { font-size: 1.4rem; }
}
