:root { --bg:#f6f7f9; --card:#fff; --text:#1d2330; --muted:#6b7280; --line:#e5e7eb; --accent:#2563eb; --ok:#16a34a; --off:#9ca3af; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--text); }
header { background:#111827; color:#fff; padding:0 16px; }
header .wrap { display:flex; gap:20px; align-items:center; height:56px; }
header a { color:#d1d5db; text-decoration:none; font-weight:500; }
header a:hover, header a.brand { color:#fff; }
header .brand { font-weight:700; margin-right:auto; }
.wrap { max-width:1150px; margin:0 auto; }
main { padding:24px 16px; }
h1 { font-size:1.5rem; margin:0 0 16px; }
h2 { font-size:1.15rem; margin:28px 0 12px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:18px; }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:24px; }
.stat .n { font-size:1.8rem; font-weight:700; }
.stat .n.small { font-size:1.1rem; padding:6px 0; }
.stat .l { color:var(--muted); font-size:.9rem; }
.table-wrap { overflow-x:auto; background:var(--card); border:1px solid var(--line); border-radius:10px; }
table { width:100%; border-collapse:collapse; font-size:.93rem; }
th, td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
th { background:#f9fafb; font-weight:600; color:#374151; white-space:nowrap; }
tr:last-child td { border-bottom:none; }
td.num { text-align:right; font-variant-numeric:tabular-nums; }
.muted { color:var(--muted); }
.small { font-size:.85rem; }
a { color:var(--accent); }
.btn { display:inline-block; background:var(--accent); color:#fff; border:none; border-radius:8px; padding:9px 16px; font-size:.95rem; cursor:pointer; text-decoration:none; }
.btn.secondary { background:#fff; color:var(--text); border:1px solid var(--line); }
.btn.danger { background:#dc2626; }
.toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.toolbar h1 { margin:0 auto 0 0; }
form.stack { display:grid; gap:14px; max-width:560px; }
label { font-weight:600; font-size:.92rem; display:grid; gap:6px; }
input, select, textarea { font:inherit; padding:9px 10px; border:1px solid #d1d5db; border-radius:8px; width:100%; background:#fff; }
.hint { font-weight:400; color:var(--muted); font-size:.84rem; }
.error { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; padding:10px 12px; border-radius:8px; margin-bottom:14px; }
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:.78rem; font-weight:600; }
.badge.on { background:#dcfce7; color:#166534; }
.badge.off { background:#f3f4f6; color:#4b5563; }
.badge.zero { background:#fef3c7; color:#92400e; }
.grid2 { display:grid; grid-template-columns: 300px 1fr; gap:20px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.qrimg { width:100%; max-width:280px; image-rendering:pixelated; border:1px solid var(--line); border-radius:8px; background:#fff; }
.chart { display:flex; align-items:flex-end; gap:3px; height:120px; padding-top:8px; }
.chart div { flex:1; background:var(--accent); border-radius:3px 3px 0 0; min-height:2px; opacity:.85; }
.chart div.empty { background:var(--line); }
code { background:#f3f4f6; padding:2px 6px; border-radius:5px; word-break:break-all; }
dl { display:grid; grid-template-columns:max-content 1fr; gap:8px 16px; margin:0; }
dt { color:var(--muted); }
dd { margin:0; word-break:break-word; }
.login { max-width:360px; margin:60px auto; }
header form { margin:0; }
header button.link { background:none; border:none; color:#d1d5db; font:inherit; font-weight:500; cursor:pointer; padding:0; }
header button.link:hover { color:#fff; }
header a, header button.link { white-space:nowrap; }
@media (max-width: 480px) {
  header .wrap { gap:14px; justify-content:space-between; }
  header .brand { display:none; }
}
