:root {
  --bg: #0e1013;
  --panel: #171a1f;
  --panel-hi: #1e222a;
  --line: #262b33;
  --text: #e8eaed;
  --muted: #8b939f;
  --brand: #fee300;
  --danger: #ff7b72;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
.muted { color: var(--muted); }

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 26px; border-bottom: 1px solid var(--line); background: var(--panel);
  flex-wrap: wrap;
}
.nav .brand { font-weight: 700; letter-spacing: .4px; text-decoration: none; }
.nav .brand b { color: var(--brand); }
.nav .links { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav .links a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.nav .links a:hover { color: var(--text); background: var(--panel-hi); }
.nav .links a.on { color: #111; background: var(--brand); font-weight: 600; }
.nav .logout { color: var(--muted); text-decoration: none; font-size: 13px; }
.nav .logout:hover { color: var(--danger); }

main { padding: 22px 26px 60px; max-width: 980px; margin: 0 auto; }
h1 { margin: 0; font-size: 19px; letter-spacing: .4px; }
h2 { margin: 0 0 16px; font-size: 14px; font-weight: 600; color: var(--muted);
     text-transform: uppercase; letter-spacing: .8px; }

/* ── Shared components (stats/todo/spy) ─────────────────────────── */
.controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tabs button {
  background: none; border: 0; color: var(--muted); padding: 9px 17px;
  font: inherit; font-size: 14px; cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--brand); color: #111; font-weight: 600; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; flex: 1 1 170px; }
.card .n { font-size: 26px; font-weight: 700; color: var(--brand); }
.card .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.row { margin-bottom: 13px; }
.row .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; gap: 12px; }
.row .top span:last-child { color: var(--muted); white-space: nowrap; }
.track { background: #0b0d10; border-radius: 4px; height: 9px; overflow: hidden; }
.fill { height: 100%; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 7px 0; border-bottom: 1px solid var(--line); text-align: left; }
td:last-child, th:last-child { text-align: right; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
svg { width: 100%; height: auto; display: block; }
#error { color: var(--danger); }

button.btn {
  background: var(--brand); color: #111; border: 0; border-radius: 6px;
  padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
button.btn:hover { filter: brightness(0.95); }
button.btn.ghost { background: none; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
button.btn.ghost:hover { color: var(--text); border-color: var(--muted); }
input[type=text], input[type=password] {
  background: #0b0d10; border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 10px 12px; font: inherit; font-size: 14px;
}
input[type=text]:focus, input[type=password]:focus { outline: 1px solid var(--brand); }

/* ── Login page ──────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; width: 100%; max-width: 340px; }
.login-card h1 { text-align: center; margin-bottom: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card input[type=password] { width: 100%; }
.login-card .btn { width: 100%; padding: 11px; }
.login-error { color: var(--danger); font-size: 13px; text-align: center; margin: 0 0 4px; }

/* ── Todo page ───────────────────────────────────────────────────── */
.todo-add { display: flex; gap: 10px; margin-bottom: 18px; }
.todo-add input[type=text] { flex: 1; }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
}
.todo-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.todo-item .text { flex: 1; word-break: break-word; }
.todo-item.done .text { color: var(--muted); text-decoration: line-through; }
.todo-item .del {
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 8px;
}
.todo-item .del:hover { color: var(--danger); }

/* ── Command spy page ────────────────────────────────────────────── */
.spy-table td.cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.spy-table td.player { color: var(--brand); font-weight: 600; white-space: nowrap; }
.spy-table td.server { color: var(--muted); white-space: nowrap; }
.spy-table td.time { color: var(--muted); white-space: nowrap; }

/* ── Broadcast page ──────────────────────────────────────────────── */
.broadcast-form textarea {
  width: 100%; resize: vertical; background: #0b0d10; border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 10px 12px; font: inherit; font-size: 14px;
}
.broadcast-form textarea:focus { outline: 1px solid var(--brand); }
.broadcast-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; }

/* ── Network status page ─────────────────────────────────────────── */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.status-dot.online { background: #5ce07a; }
.status-dot.offline { background: var(--danger); }
.status-dot.unknown { background: var(--muted); }

/* ── Player lookup page ──────────────────────────────────────────── */
.lookup-form { display: flex; gap: 10px; margin-bottom: 18px; }
.lookup-form input[type=text] { flex: 1; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.on { background: #5ce07a; color: #111; }
.badge.off { background: var(--panel-hi); color: var(--muted); }
.badge.banned { background: var(--danger); color: #111; }
.online-group { margin-bottom: 14px; }
.online-group .server-name { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--panel-hi); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
