:root { color-scheme: dark; --bg:#14161a; --panel:#1c1f25; --line:#2b2f38; --text:#e6e8ec; --muted:#9aa1ad; --accent:#5b8def; --ok:#3fb27f; --warn:#e0a43a; --bad:#e5534b; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:15px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif; }
a { color:var(--accent); }
h1,h2,h3 { margin:0 0 .5rem; font-weight:600; }
h1 { font-size:1.3rem; } h2 { font-size:1.1rem; } h3 { font-size:.95rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.muted { color:var(--muted); } .center { text-align:center; padding:3rem 1rem; } .small { font-size:.85rem; }
header { display:flex; flex-wrap:wrap; gap:.75rem 1rem; align-items:center; padding:.75rem 1rem; border-bottom:1px solid var(--line); background:var(--panel); }
.grow { flex:1; }
main { max-width:1100px; margin:0 auto; padding:1rem; }
main.login { max-width:420px; text-align:center; padding-top:4rem; }
.btn, button { background:var(--accent); color:#fff; border:0; border-radius:6px; padding:.45rem .9rem; font:inherit; cursor:pointer; text-decoration:none; display:inline-block; }
button.ghost { background:transparent; color:var(--text); border:1px solid var(--line); }
button.danger { background:var(--bad); }
button:disabled { opacity:.5; cursor:default; }
select, input { background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:6px; padding:.35rem .5rem; font:inherit; max-width:100%; }
input[type=number] { width:7rem; }
nav.tabs { display:flex; gap:.25rem; margin:0 0 1rem; border-bottom:1px solid var(--line); overflow-x:auto; }
nav.tabs button { background:transparent; color:var(--muted); border-radius:6px 6px 0 0; border-bottom:2px solid transparent; }
nav.tabs button.on { color:var(--text); border-bottom-color:var(--accent); }
.card { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:1rem; margin-bottom:1rem; }
.scroll { overflow-x:auto; }
table { border-collapse:collapse; width:100%; }
th, td { text-align:left; padding:.45rem .6rem; border-bottom:1px solid var(--line); vertical-align:middle; }
th { color:var(--muted); font-weight:500; font-size:.85rem; white-space:nowrap; }
tr.cat td { background:#181b20; color:var(--muted); font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; }
.pill { display:inline-block; padding:.05rem .5rem; border-radius:999px; font-size:.78rem; border:1px solid var(--line); }
.pill.on { color:var(--ok); border-color:var(--ok); } .pill.off { color:var(--muted); } .pill.err { color:var(--bad); border-color:var(--bad); }
.row { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; }
.stat b { display:block; font-size:1.4rem; }
#toast { position:fixed; right:1rem; bottom:1rem; background:var(--panel); border:1px solid var(--line); border-left:3px solid var(--ok); padding:.6rem .9rem; border-radius:6px; max-width:80vw; }
#toast.err { border-left-color:var(--bad); }
textarea { width:100%; background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:6px; padding:.5rem; font:inherit; resize:vertical; margin:.5rem 0; }
textarea:disabled { opacity:.6; }
input[type=checkbox] { width:1.2rem; height:1.2rem; }
header + main .charts { display:grid; grid-template-columns:repeat(auto-fit,minmax(420px,1fr)); gap:1rem; margin-top:1rem; }
.charts .card { margin-bottom:0; }
.chart h3 { margin:0; }
.chart svg { width:100%; height:auto; display:block; }
.chart svg .grid { stroke:var(--line); stroke-width:1; }
.chart svg .axis { fill:var(--muted); font-size:11px; }
.chart svg .hit { fill:transparent; }
.chart svg .hit:hover { fill:rgba(255,255,255,.06); }
.c0 { fill:var(--accent); background:var(--accent); } .c1 { fill:var(--warn); background:var(--warn); } .c2 { fill:var(--ok); background:var(--ok); }
.legend { display:flex; gap:1rem; margin:.25rem 0; }
.legend .sw { display:inline-block; width:.7rem; height:.7rem; border-radius:2px; vertical-align:middle; }
@media (max-width:520px) { header + main .charts { grid-template-columns:1fr; } }
