:root {
    --bg: #f6f7f9; --surface: #fff; --text: #1d2433; --muted: #667085; --line: #e4e7ec;
    --accent: #b42318; --ok: #067647; --ok-bg: #dcfae6; --warn: #b54708; --warn-bg: #fef0c7;
    --crit: #b42318; --crit-bg: #fee4e2; --info-bg: #eef2f6; --up: #067647;
    --radius: 10px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1218; --surface: #171b23; --text: #e6e8ec; --muted: #98a2b3; --line: #2a303b;
        --ok: #75e0a7; --ok-bg: #053321; --warn: #fdb022; --warn-bg: #4e1d09; --crit: #fda29b; --crit-bg: #55160c;
        --info-bg: #252b36; --up: #75e0a7; --accent: #f97066;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
body.center { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
p { margin: 0 0 10px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px;
       background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.nav .brand { font-weight: 700; color: var(--text); }
.nav nav { display: flex; gap: 18px; align-items: center; }
.nav nav a { color: var(--text); }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
main.narrow { max-width: 640px; }
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.grid .card { margin-bottom: 0; }
.grid + .card, .grid + section { margin-top: 18px; }
.card.login { width: 100%; max-width: 360px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); }
main > .table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.table th, .table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-weight: 600; color: var(--muted); font-size: 12px; }
.table tfoot th { border-bottom: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.detail { max-width: 460px; }
.up { color: var(--up); font-weight: 600; }

.kv { border-collapse: collapse; width: 100%; }
.kv th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 12px 4px 0; width: 45%; vertical-align: top; }
.kv td { padding: 4px 0; word-break: break-word; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--info-bg); }
.sev-ok { background: var(--ok-bg); color: var(--ok); }
.sev-warning { background: var(--warn-bg); color: var(--warn); }
.sev-critical { background: var(--crit-bg); color: var(--crit); }
.sev-info { background: var(--info-bg); color: var(--muted); }

.small { font-size: 12px; }
.muted, tr.muted td { color: var(--muted); }
.warn { color: var(--warn); }
.error { background: var(--crit-bg); color: var(--crit); padding: 10px 12px; border-radius: 8px; }
.ok { background: var(--ok-bg); color: var(--ok); padding: 10px 12px; border-radius: 8px; }

.form label { display: block; margin-bottom: 14px; font-weight: 500; }
.form label .small { display: block; font-weight: 400; margin-top: 4px; }
.form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.login form label { display: block; margin-bottom: 14px; font-weight: 500; }
input:not([type=checkbox]) { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text);
        background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
button, .button { font: inherit; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
        color: var(--text); cursor: pointer; display: inline-block; }
button.small { padding: 2px 10px; font-size: 12px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { border-color: var(--crit); color: var(--crit); }
button.link { border: 0; background: none; padding: 0; color: var(--text); }
.button:hover { text-decoration: none; }
form.inline { display: inline; }

pre.json { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow: auto; max-height: 70vh; }
pre.key { background: var(--warn-bg); color: var(--text); padding: 14px; border-radius: 8px; font-size: 14px; word-break: break-all; white-space: pre-wrap; user-select: all; }
.narrow-form { max-width: 480px; }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
