:root {
    --bg: #f4f5f7; --card: #fff; --text: #1e2430; --muted: #6b7280; --line: #e3e6eb;
    --accent: #2563eb; --good: #16a34a; --bad: #dc2626; --warn: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, Consolas, "JetBrains Mono", monospace; font-size: 13px; }
header.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
    padding: 10px 24px; background: #111827; color: #fff; }
header .brand { font-weight: 700; font-size: 18px; }
header .brand small { font-weight: 400; color: #9ca3af; margin-left: 8px; font-size: 13px; }
header nav a { color: #d1d5db; margin-right: 18px; }
header nav a.active { color: #fff; border-bottom: 2px solid var(--accent); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 22px; }
h1 small, h2 small { font-weight: 400; color: var(--muted); font-size: 70%; margin-left: 8px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form, form.inline { display: inline; margin: 0; }
.btn { display: inline-block; padding: 7px 14px; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; color: var(--text);
    font: inherit; cursor: pointer; }
.btn:hover { background: #f1f3f6; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.active { background: #e5e7eb; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; border-top: 4px solid var(--line); }
.card.good { border-top-color: var(--good); }
.card.bad { border-top-color: var(--bad); }
.card h2 { margin-top: 0; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 10px 4px 0; width: 42%; vertical-align: top; }
table.kv td { padding: 4px 0; vertical-align: top; }
table.kv.narrow { max-width: 520px; }
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
table.list th, table.list td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.list tr.bad td { background: #fef2f2; }
td.plan { background: #f9fafb; }
.addr { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #e5e7eb; margin: 2px 4px 2px 0; font-size: 13px; }
.addr.ok { background: #dcfce7; color: #166534; }
.addr.fail { background: #fee2e2; color: #991b1b; }
.st { padding: 1px 8px; border-radius: 10px; font-size: 13px; background: #e5e7eb; }
.st-ok { background: #dcfce7; color: #166534; }
.st-error, .st-aborted { background: #fee2e2; color: #991b1b; }
.st-partial { background: #fef3c7; color: #92400e; }
.st-running { background: #dbeafe; color: #1e40af; }
.err { color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; background: #e5e7eb; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }
pre.log { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow: auto; max-height: 70vh; white-space: pre-wrap; }
label { display: block; margin: 8px 0; }
label input { display: block; width: 100%; max-width: 320px; padding: 7px 9px; border: 1px solid #cfd4dc; border-radius: 6px; font: inherit; margin-top: 3px; }
.pager { display: flex; gap: 16px; justify-content: center; }
body.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px 30px; width: 340px; }
.login-box h1 { margin: 0; font-size: 24px; }
.login-box .sub { color: var(--muted); margin-bottom: 16px; }
.login-box .btn { width: 100%; margin-top: 10px; }
@media (max-width: 640px) { main { padding: 14px; } header.top { padding: 10px 14px; } }
.btn.small { padding: 3px 9px; font-size: 13px; }
select { padding: 4px 6px; border: 1px solid #cfd4dc; border-radius: 6px; font: inherit; }
