:root {
  --bg: #f6f7fb; --card: #fff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --brand: #2f4bd8; --brand-soft: #eef1fd; --ok: #15803d; --ok-soft: #e8f6ec; --bad: #b91c1c; --bad-soft: #fdecec; --warn: #a16207; --warn-soft: #fdf6e3;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 0 0 12px; }
code, pre { font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; }
pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow-x: auto; margin: 8px 0 16px; }
.muted { color: var(--muted); }
.pad { padding: 24px; }

.layout { display: flex; min-height: 100vh; }
nav.side { width: 210px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; background: #111827; color: #cbd5e1; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
nav.side .brand { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 16px; }
nav.side a { color: #cbd5e1; padding: 8px 10px; border-radius: 6px; }
nav.side a:hover { background: #1f2937; }
nav.side a.on { background: var(--brand); color: #fff; }
nav.side .grow { flex: 1; }
nav.side .who { font-size: 12px; padding: 8px 10px; color: #94a3b8; overflow-wrap: anywhere; }
main { flex: 1; padding: 28px; max-width: 1100px; min-width: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 12px; }
.tile .v { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--line); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

form.row, .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select { font: inherit; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: var(--text); min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
button { font: inherit; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; }
button.ghost { background: #fff; color: var(--text); border-color: #d1d5db; }
button.small { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

.auth { max-width: 380px; margin: 10vh auto; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; }
.msg.bad { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.secret { background: var(--warn-soft); border: 1px solid #f3e1a6; padding: 12px; border-radius: 8px; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  nav.side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  nav.side .grow, nav.side .who { display: none; }
  main { padding: 16px; }
}
