:root { --bg:#0f1218; --card:#171b23; --line:#262c38; --text:#e6e9ef; --muted:#8b93a5; --accent:#4f8cff; --ok:#2fbf71; --warn:#f0a020; --bad:#e5484d; --mem:#a77bff; }
* { 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); }
.hidden { display:none !important; }
.muted { color:var(--muted); }
button { background:#232a37; color:var(--text); border:1px solid var(--line); border-radius:8px; padding:6px 12px; cursor:pointer; font:inherit; }
button:hover { border-color:#3a4356; }
button:disabled { opacity:.5; cursor:default; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.ghost { background:transparent; }
button.danger { color:var(--bad); }
input { width:100%; padding:8px 10px; border-radius:8px; border:1px solid var(--line); background:#0f1218; color:var(--text); font:inherit; margin-top:4px; }
.login { min-height:100vh; display:grid; place-items:center; }
.login-card { width:320px; display:flex; flex-direction:column; gap:12px; }
.login-card h1 { margin:0 0 4px; font-size:20px; }
.error { color:var(--bad); min-height:1em; margin:0; }
.topbar { display:flex; align-items:center; gap:16px; padding:12px 20px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--bg); z-index:2; }
.brand { font-weight:600; }
nav { display:flex; gap:6px; flex:1; }
.tab { background:transparent; border-color:transparent; }
.tab.active { background:#232a37; border-color:var(--line); }
main { padding:20px; max-width:1200px; margin:0 auto; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:16px; }
.card h2 { font-size:14px; margin:0 0 12px; color:var(--muted); font-weight:600; }
.grid { display:grid; gap:16px; }
.grid.stats { grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); }
.grid.two { grid-template-columns:repeat(auto-fit, minmax(380px, 1fr)); }
.grid > .card { margin-bottom:0; }
.grid + .card, .card + .grid { margin-top:16px; }
.stat .label { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.stat .value { font-size:28px; font-weight:600; margin:4px 0 8px; font-variant-numeric:tabular-nums; }
.stat .sub { color:var(--muted); font-size:12px; margin-top:6px; }
.bar { height:6px; background:#232a37; border-radius:3px; overflow:hidden; }
.bar > div { height:100%; width:0; background:var(--ok); transition:width .4s; }
.bar > div.warn { background:var(--warn); } .bar > div.bad { background:var(--bad); }
table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:middle; }
th { color:var(--muted); font-weight:500; font-size:12px; }
tr:last-child td { border-bottom:none; }
td.actions { white-space:nowrap; text-align:right; }
td.actions button { padding:4px 9px; font-size:12px; margin-left:4px; }
.toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.toolbar h2 { margin:0; font-size:18px; }
.pill { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; background:#232a37; }
.pill.on { background:rgba(47,191,113,.15); color:var(--ok); }
.pill.off { background:rgba(229,72,77,.15); color:var(--bad); }
.pill.run { background:rgba(79,140,255,.15); color:var(--accent); }
canvas { width:100%; display:block; }
.legend { color:var(--muted); font-size:12px; margin-top:6px; display:flex; gap:6px; align-items:center; }
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; margin-left:10px; }
.dot.cpu { background:var(--accent); } .dot.mem { background:var(--mem); }
dialog { width:min(1000px, 95vw); height:80vh; background:var(--card); color:var(--text); border:1px solid var(--line); border-radius:12px; padding:0; display:flex; flex-direction:column; }
dialog:not([open]) { display:none; }
dialog::backdrop { background:rgba(0,0,0,.6); }
.dialog-head { display:flex; justify-content:space-between; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); }
.dialog-head h3 { margin:0; font-size:14px; }
pre { margin:0; padding:12px 16px; overflow:auto; flex:1; font:12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space:pre-wrap; word-break:break-all; }
.backups { margin-top:10px; }
.backups td { font-size:13px; }
.toast { position:fixed; bottom:20px; right:20px; background:#232a37; border:1px solid var(--line); padding:10px 14px; border-radius:8px; max-width:420px; z-index:10; }
.toast.err { border-color:var(--bad); }
.empty { color:var(--muted); padding:12px 0; }
@media (max-width:640px) { .topbar { flex-wrap:wrap; } nav { order:3; width:100%; } .grid.two { grid-template-columns:1fr; } }
