:root { --bg:#f5f6f8; --card:#fff; --text:#1d2433; --muted:#6b7385; --line:#e3e6ec; --accent:#1f5fbf;
  --replace:#c2410c; --realloc:#1d7a46; --trash:#6b7385; --keep:#1f5fbf; }
@media (prefers-color-scheme: dark) { :root { --bg:#14171d; --card:#1c2029; --text:#e6e9ef; --muted:#9aa3b5; --line:#2c3240; --accent:#6ea2ff;
  --replace:#fb923c; --realloc:#4ade80; --trash:#9aa3b5; --keep:#6ea2ff; } }
* { box-sizing: border-box; }
body { margin:0; font:14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif; background:var(--bg); color:var(--text); }
.top { 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; }
.brand { font-weight:700; font-size:16px; }
nav { display:flex; gap:4px; flex-wrap:wrap; }
nav button { border:0; background:none; color:var(--muted); padding:6px 10px; border-radius:6px; cursor:pointer; font:inherit; }
nav button.active { background:var(--bg); color:var(--text); font-weight:600; }
.right { margin-left:auto; display:flex; gap:10px; align-items:center; }
main { padding:20px; max-width:1500px; margin:0 auto; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:16px; }
.center { max-width:420px; margin:80px auto; text-align:center; }
h1 { font-size:20px; } h2 { font-size:15px; margin:0 0 10px; }
.muted { color:var(--muted); } .small { font-size:12px; }
.btn, button.btn { display:inline-block; background:var(--accent); color:#fff; border:0; border-radius:6px; padding:7px 14px; text-decoration:none; cursor:pointer; font:inherit; }
.ghost, .btn.ghost { background:none; color:var(--accent); border:1px solid var(--line); border-radius:6px; padding:6px 12px; cursor:pointer; font:inherit; text-decoration:none; }
.row-between { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.scroll { overflow:auto; }
table.grid { border-collapse:collapse; width:100%; font-variant-numeric:tabular-nums; }
.grid th, .grid td { padding:5px 8px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
.grid th { position:sticky; top:0; background:var(--card); font-weight:600; font-size:12px; color:var(--muted); }
.grid td.num, .grid th.num { text-align:right; }
.grid tr.total td { font-weight:600; background:var(--bg); }
.grid tr.grand td { font-weight:700; border-top:2px solid var(--text); }
.grid tbody tr:hover td { background:color-mix(in srgb, var(--accent) 6%, transparent); }
.zero { color:var(--line); }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:16px; }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px; }
.kpi .v { font-size:28px; font-weight:700; }
.kpi .l { color:var(--muted); font-size:12px; }
.kpi.replace .v { color:var(--replace); } .kpi.realloc .v { color:var(--realloc); } .kpi.trash .v { color:var(--trash); } .kpi.keep .v { color:var(--keep); }
.tag { display:inline-block; padding:1px 7px; border-radius:10px; font-size:12px; border:1px solid currentColor; }
.tag.Trash { color:var(--trash); } .tag.Keep { color:var(--keep); } .tag.Reallocate { color:var(--realloc); } .tag.override { border-style:dashed; }
.filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
input, select, textarea { font:inherit; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--text); }
.inline { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.switch { display:flex; gap:8px; align-items:center; font-weight:600; }
dialog { border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--text); width:min(520px,95vw); }
dialog label { display:grid; gap:4px; margin-bottom:10px; font-size:12px; color:var(--muted); }
dialog::backdrop { background:rgb(0 0 0 / .35); }
#toast { position:fixed; bottom:20px; right:20px; background:var(--text); color:var(--bg); padding:10px 14px; border-radius:8px; z-index:10; max-width:420px; }
#toast.err { background:#b91c1c; color:#fff; }
button.link { background:none; border:0; color:var(--accent); cursor:pointer; padding:0; font:inherit; }
