:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --border: #e2e5ea;
  --text: #16181d; --muted: #646b78; --accent: #2f6fed; --accent-text: #ffffff;
  --ok: #16834a; --ok-bg: #e5f5ec; --warn: #9a6200; --warn-bg: #fdf3dc;
  --err: #c2312f; --err-bg: #fbe8e7; --off: #6b7280; --off-bg: #eef0f3;
  --radius: 8px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --surface: #171a20; --surface-2: #1e222a; --border: #2a2f39;
    --text: #e6e8ec; --muted: #9aa1ad; --accent: #5b8ff7; --accent-text: #0b0d11;
    --ok: #4cc485; --ok-bg: #12291d; --warn: #e2b04a; --warn-bg: #2b2412;
    --err: #f06a66; --err-bg: #301615; --off: #9aa1ad; --off-bg: #23272f;
  }
}
* { 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(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 13px; }

header.top { background: var(--surface); border-bottom: 1px solid var(--border); }
header.top .inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex;
  align-items: center; gap: 24px; height: 56px; }
.brand { font-weight: 700; letter-spacing: -0.01em; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
nav a.on, nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

main { max-width: 1280px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 22px; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.big { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.b-active { color: var(--ok); background: var(--ok-bg); }
.b-expired { color: var(--warn); background: var(--warn-bg); }
.b-disabled { color: var(--off); background: var(--off-bg); }
.b-err { color: var(--err); background: var(--err-bg); }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

input, select, textarea, button { font: inherit; color: var(--text); }
input, select, textarea { background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox] { width: auto; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.inline { display: inline; }
.filters input, .filters select { width: auto; }
.pw { filter: blur(4px); cursor: pointer; transition: filter .15s; }
.pw.show { filter: none; }
.test-out { font-size: 12px; }

.login { max-width: 360px; margin: 12vh auto; }

@media (max-width: 640px) {
  header.top .inner { gap: 12px; }
  .brand { display: none; }
  .big { font-size: 22px; }
}
