:root, [data-theme="dark"] {
  --bg:#0B1020; --side:#0E1630; --card:#121A33; --row:#0F1836; --tint:#14204A; --active:#1B2A5C; --onactive:#FFFFFF;
  --greenbg:#0F2A27; --amberbg:#2B2410; --redbg:#33161B; --line:#22305A; --line2:#2F4690;
  --text:#E6ECFF; --muted:#93A0C8; --soft:#C7D2F5; --blue:#9DB8FF; --accent:#7FC4FF;
  --green:#34D399; --amber:#FBBF24; --red:#F87171; --gborder:#1F6B58; --aborder:#8A6A12; --rborder:#9B3A45;
}
[data-theme="light"] {
  --bg:#F4F7FD; --side:#FFFFFF; --card:#FFFFFF; --row:#EEF3FC; --tint:#E3ECFF; --active:#D6E4FF; --onactive:#10285E;
  --greenbg:#E3F6EE; --amberbg:#FFF4D6; --redbg:#FDE6E8; --line:#D3DDF2; --line2:#B6C8F2;
  --text:#131A33; --muted:#55618A; --soft:#3B4770; --blue:#1F4FC9; --accent:#1453E0;
  --green:#0E8A5F; --amber:#8A5F00; --red:#C0343F; --gborder:#A6DEC8; --aborder:#E8CF86; --rborder:#F0B4BA;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color:inherit; text-decoration:none; }
button { font:inherit; cursor:pointer; }
h1,h2 { font-family:"Space Grotesk", Inter, sans-serif; letter-spacing:-.01em; margin:0; }
.shell { display:flex; flex-wrap:wrap; min-height:100vh; }
.side { flex:0 0 232px; background:var(--side); border-right:1px solid var(--line); padding:22px 14px; display:flex; flex-direction:column; gap:22px; }
.brand { display:flex; align-items:center; gap:10px; padding:0 8px; font:700 20px "Space Grotesk", sans-serif; }
.logo { width:34px; height:34px; border-radius:10px; background:linear-gradient(135deg,#1453E0,#7FC4FF); display:flex; align-items:center; justify-content:center; color:#0B1020; }
.nav { display:flex; flex-direction:column; gap:4px; }
.nav a { padding:11px 12px; border-radius:10px; color:var(--muted); display:flex; justify-content:space-between; gap:8px; }
.nav a.on { background:var(--active); color:var(--onactive); border:1px solid var(--line2); font-weight:600; }
.me { margin-top:auto; font-size:13px; color:var(--muted); display:flex; flex-direction:column; gap:8px; }
.main { flex:1 1 640px; min-width:0; padding:26px clamp(14px,4vw,36px); display:flex; flex-direction:column; gap:18px; }
.top { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:20px; }
.grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
.kpi .k { color:var(--muted); font-size:12px; } .kpi .v { font:700 26px "Space Grotesk",sans-serif; margin-top:4px; }
.btn { padding:9px 15px; border-radius:10px; border:1px solid var(--line2); background:transparent; color:var(--blue); font-weight:600; }
.btn.primary { background:linear-gradient(135deg,#1453E0,#3B82F6); color:#fff; border:0; }
.btn.danger { color:var(--red); border-color:var(--rborder); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.chip { padding:2px 10px; border-radius:99px; font-size:12px; font-weight:600; display:inline-block; }
.ok { background:var(--greenbg); color:var(--green); } .warn { background:var(--amberbg); color:var(--amber); }
.bad { background:var(--redbg); color:var(--red); } .info { background:var(--tint); color:var(--blue); }
table { width:100%; border-collapse:collapse; min-width:620px; } .tw { overflow-x:auto; }
th { text-align:left; color:var(--muted); font-size:12px; font-weight:500; padding:10px 12px; text-transform:uppercase; letter-spacing:.05em; }
td { padding:11px 12px; border-top:1px solid var(--line); }
tr.click { cursor:pointer; } tr.click:hover, tr.sel { background:var(--row); }
.muted { color:var(--muted); } .row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.cols { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-start; } .cols > * { min-width:0; }
.board { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); align-items:start; }
.col { background:var(--side); border:1px solid var(--line); border-radius:16px; padding:12px; display:flex; flex-direction:column; gap:10px; }
.task { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px; text-align:left; color:inherit; width:100%; }
.task.sel { border-color:var(--accent); }
input, select, textarea { width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--line2); background:var(--row); color:var(--text); font:inherit; }
label { display:block; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.05em; margin:10px 0 6px; }
.login { max-width:380px; margin:12vh auto; padding:0 16px; display:flex; flex-direction:column; gap:14px; }
.bars { display:flex; align-items:flex-end; gap:10px; height:200px; border-bottom:1px solid var(--line); padding-top:10px; }
.bars .m { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:6px; height:100%; }
.bars .b { width:100%; max-width:46px; border-radius:6px 6px 0 0; min-height:2px; }
.tl { display:flex; gap:10px; align-items:center; padding:8px 10px; background:var(--row); border-radius:10px; margin-top:6px; }
.dot { width:11px; height:11px; border-radius:50%; flex:none; background:var(--line2); } .dot.on { background:var(--green); }
.toast { position:fixed; right:16px; bottom:16px; background:var(--card); border:1px solid var(--line2); border-radius:12px; padding:12px 16px; max-width:320px; }
@media (max-width: 820px) {
  .side { flex:1 1 100%; flex-direction:column; border-right:0; border-bottom:1px solid var(--line); padding:12px; gap:10px; }
  .nav { flex-direction:row; overflow-x:auto; } .nav a { white-space:nowrap; } .me { margin-top:0; flex-direction:row; flex-wrap:wrap; align-items:center; }
}
