:root { --bg:#f6f7f9; --panel:#fff; --text:#1c2128; --muted:#667085; --line:#e3e6ea; --accent:#2f6fed; --ok:#16803c; --warn:#b54708; --bad:#c0262d; --bar:#2f6fed; --bar2:#16a34a }
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f1318; --panel:#171c23; --text:#e6e9ee; --muted:#98a2b3; --line:#2a313b; --accent:#6a9bff; --ok:#4ade80; --warn:#fbbf24; --bad:#f87171; --bar:#6a9bff; --bar2:#4ade80 }
}
* { box-sizing:border-box }
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif }
header { display:flex; align-items:center; gap:16px; padding:10px 20px; background:var(--panel); border-bottom:1px solid var(--line); flex-wrap:wrap }
header h1 { font-size:16px; margin:0 8px 0 0 }
nav { display:flex; gap:4px; flex:1 }
nav button { border:0; background:none; padding:6px 12px; border-radius:6px; color:var(--muted) }
nav button.on { background:var(--bg); color:var(--text); font-weight:600 }
main { max-width:1240px; margin:0 auto; padding:20px 16px }
.card { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:16px }
.card h2 { font-size:13px; margin:0 0 12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em }
.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; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:6px; padding:6px 8px; min-width:0 }
button { font:inherit; border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:6px; padding:6px 10px; cursor:pointer }
button:hover { border-color:var(--accent) }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff }
button.danger { color:var(--bad) }
button:disabled { opacity:.5; cursor:default }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:16px }
.stat { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:12px 14px }
.stat b { display:block; font-size:26px; line-height:1.2; font-variant-numeric:tabular-nums }
.stat span { color:var(--muted); font-size:12px }
.two { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(380px,100%),1fr)); gap:16px }
.table-wrap { overflow-x:auto }
table { width:100%; border-collapse:collapse }
th, td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; white-space:nowrap }
th { font-size:12px; color:var(--muted); font-weight:600 }
code { font:13px ui-monospace,Consolas,monospace }
.pill { padding:1px 8px; border-radius:999px; font-size:12px; border:1px solid currentColor }
.pill.active { color:var(--ok) } .pill.expired { color:var(--warn) } .pill.revoked { color:var(--bad) }
.actions { display:flex; gap:6px; flex-wrap:wrap }
.muted { color:var(--muted) }
.chart svg { width:100%; height:auto; display:block }
.chart .bar { fill:var(--bar) } .chart .bar2 { fill:var(--bar2) }
.chart text { fill:var(--muted); font-size:10px }
.legend { display:flex; gap:14px; font-size:12px; color:var(--muted); margin-top:6px }
.legend i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:5px }
.hbar { display:grid; grid-template-columns:110px 1fr 50px; gap:8px; align-items:center; margin:6px 0 }
.hbar .t { background:var(--bg); border-radius:4px; height:12px }
.hbar .f { background:var(--bar); height:100%; border-radius:4px }
.hbar span:last-child { text-align:right; font-variant-numeric:tabular-nums }
#msg { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); padding:8px 14px; border-radius:6px; background:var(--text); color:var(--bg); display:none; max-width:90vw; z-index:9 }
#msg.err { background:var(--bad); color:#fff }
.hidden { display:none !important }
.keys { white-space:pre; font:13px ui-monospace,Consolas,monospace; background:var(--bg); border:1px solid var(--line); border-radius:6px; padding:10px; margin-top:12px; overflow-x:auto }
