:root { --bg:#f5f6f8; --card:#fff; --text:#1d2433; --muted:#6b7385; --line:#e2e5ec; --accent:#00539b; --ok:#1e8e3e; --warn:#e8a200; --bad:#c62828; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#12151c; --card:#1b2029; --text:#e6e9f0; --muted:#98a1b5; --line:#2b3240; --accent:#5aa9ff; }
}
* { box-sizing: border-box; }
body { margin:0; font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; background:var(--bg); color:var(--text); }
header { display:flex; align-items:center; gap:16px; padding:10px 20px; background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; flex-wrap:wrap; }
header h1 { font-size:17px; margin:0; }
.spacer { flex:1; }
nav { display:flex; gap:4px; }
button, select, input { font:inherit; color:inherit; }
button { background:var(--card); border:1px solid var(--line); border-radius:6px; padding:6px 12px; cursor:pointer; }
button:hover { border-color:var(--accent); }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.danger { color:var(--bad); }
nav button { border:none; background:none; border-radius:6px; }
nav button.active { background:var(--accent); color:#fff; }
input, select { background:var(--card); border:1px solid var(--line); border-radius:6px; padding:6px 8px; }
main { padding:20px; max-width:1300px; margin:0 auto; }
.muted { color:var(--muted); }
.notice { background:var(--card); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; padding:10px 14px; margin-bottom:12px; }
.notice a { color:var(--accent); font-weight:600; }
.badge { font-size:11px; background:var(--accent); color:#fff; border-radius:10px; padding:2px 8px; vertical-align:middle; }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:16px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px 16px; }
.card .n { font-size:24px; font-weight:600; }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(380px,1fr)); gap:12px; margin-bottom:16px; }
.chartbox { position:relative; height:280px; }
.toolbar { display:flex; gap:8px; align-items:center; margin-bottom:12px; flex-wrap:wrap; }
table { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
th, td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); white-space:nowrap; }
th { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; cursor:pointer; user-select:none; }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; }
.bar { width:90px; height:8px; background:var(--line); border-radius:4px; display:inline-block; vertical-align:middle; margin-right:6px; overflow:hidden; }
.bar > i { display:block; height:100%; background:var(--ok); }
.bar.warn > i { background:var(--warn); } .bar.bad > i { background:var(--bad); }
.tag { font-size:11px; border-radius:10px; padding:1px 8px; border:1px solid var(--line); }
.tag.warn { color:var(--warn); border-color:var(--warn); }
dialog { border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--text); padding:20px; min-width:340px; }
dialog::backdrop { background:rgba(0,0,0,.4); }
dialog label { display:block; margin:10px 0 2px; font-size:12px; color:var(--muted); }
dialog input, dialog select { width:100%; }
.actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
#toast { position:fixed; right:16px; bottom:16px; padding:10px 14px; border-radius:8px; background:var(--text); color:var(--bg); opacity:0; transition:opacity .2s; pointer-events:none; z-index:20; max-width:420px; }
#toast.show { opacity:1; } #toast.err { background:var(--bad); color:#fff; }
