:root {
    --bg: #f8fafc; --surface: #fff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
    --primary: #1d4ed8; --primary-ink: #fff; --ok: #15803d; --warn: #b45309; --danger: #b91c1c; --radius: 8px;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #0b1120; --surface: #111827; --ink: #e5e7eb; --muted: #94a3b8; --line: #1f2937; --primary: #3b82f6; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .6rem; }
.card h2 { margin-top: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }
.narrow { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.top { background: #0f172a; color: #fff; }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: inherit; font-size: 1.05rem; }
.brand span { font-weight: 400; opacity: .7; }
.brand.center { display: block; text-align: center; margin-bottom: 20px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { color: #cbd5e1; padding: 6px 10px; border-radius: var(--radius); }
.top nav a.active, .top nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.who { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.node { font: 12px ui-monospace, monospace; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 99px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 16px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); width: 100%; font-weight: 400; }
input[type=checkbox] { width: auto; }
textarea.mono { font-size: 13px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
button.link.danger { color: var(--danger); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e2e8f0; color: #334155; }
.badge.big { font-size: 14px; padding: 4px 12px; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-suspended, .badge-expired { background: #fef3c7; color: #92400e; }
.badge-revoked { background: #fee2e2; color: #991b1b; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nag { background: #f59e0b; color: #111 !important; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { display: inline; }
.codes { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 16px; line-height: 1.8; columns: 2; max-width: 360px; }
.twofa { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; padding: 8px; border-radius: var(--radius); line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.secret { font-size: 18px; letter-spacing: .05em; word-break: break-all; }
tr.warn td { color: var(--warn); }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.bulk select { max-width: 240px; }
td.check, th.check { width: 32px; }
.badge-update { background: #dbeafe; color: #1e40af; }
pre.log { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.badge-product_off { background: #e0e7ff; color: #3730a3; }
.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; }
