:root { --bg:#150d22; --side:#1b1129; --panel:#1f1530; --panel2:#271b3c; --line:#3a2a55; --ink:#f3ecff; --muted:#a493c4; --gold:#e3b04b; --gold2:#c08a20;
  --ok:#3fbf7f; --bad:#ef5a6f; --warn:#e9a23b; --violet:#8a68ea; font:14px/1.45 system-ui, "Segoe UI", Inter, sans-serif; color:var(--ink); background:var(--bg); }
* { box-sizing:border-box; } body { margin:0; } a { color:var(--gold); }
code, pre { font:12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
h1,h2,h3,h4 { margin:0; } h1 { font-size:18px; } h2 { font-size:18px; } h3 { font-size:15px; } h4 { font-size:13px; color:var(--muted); font-weight:600; }
input, select, textarea { font:inherit; color:var(--ink); background:#120b1d; border:1px solid var(--line); border-radius:8px; padding:7px 10px; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--gold2); outline-offset:0; }
label { display:flex; flex-direction:column; gap:4px; color:var(--muted); font-size:12px; } label.row { flex-direction:row; align-items:center; gap:6px; color:var(--ink); font-size:13px; }
.btn { font:inherit; font-weight:600; border:1px solid var(--line); background:var(--panel2); color:var(--ink); border-radius:8px; padding:7px 14px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.btn:hover { border-color:var(--gold2); } .btn:disabled { opacity:.45; cursor:not-allowed; }
.btn.primary { background:linear-gradient(180deg,#e9b955,#c08a20); color:#2b1700; border-color:#c08a20; } .btn.danger { background:#7d2232; border-color:var(--bad); }
.btn.ghost { background:transparent; } .btn.sm { padding:4px 10px; font-size:12px; }
.row { display:flex; align-items:center; gap:8px; } .wrap { flex-wrap:wrap; } .grow { flex:1; } .stack { display:flex; flex-direction:column; gap:12px; } .narrow { max-width:520px; }
.muted { color:var(--muted); } .small { font-size:12px; } .err { color:var(--bad); font-size:13px; }
.badge { display:inline-block; padding:1px 8px; border-radius:999px; font-size:11px; font-weight:700; background:#2d2142; color:var(--muted); margin-right:4px; white-space:nowrap; }
.badge.ok { background:#123a29; color:#7ee2ae; } .badge.bad { background:#4a1622; color:#ff9aa8; } .badge.warn { background:#4a3312; color:#ffcd7a; } .badge.gold { background:#3e2c0b; color:var(--gold); }
/* auth */
.auth { min-height:100vh; display:grid; place-items:center; background:radial-gradient(ellipse at top,#2c1a47,var(--bg) 60%); padding:16px; }
.authcard { width:min(420px,100%); background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:28px; display:flex; flex-direction:column; gap:14px; box-shadow:0 20px 60px rgba(0,0,0,.45); }
.brand { font-weight:800; color:var(--gold); cursor:pointer; white-space:nowrap; overflow:hidden; } .brand.big { font-size:20px; cursor:default; }
.code { font-size:22px; letter-spacing:.4em; text-align:center; } .secret { display:flex; flex-direction:column; gap:6px; background:#120b1d; border:1px dashed var(--gold2); border-radius:10px; padding:12px; }
.secret code { font-size:15px; color:var(--gold); word-break:break-all; } .lang { align-self:flex-end; padding:4px 8px; font-size:12px; }
/* shell */
.shell { display:grid; grid-template-columns:248px 1fr; min-height:100vh; } .shell.collapsed { grid-template-columns:60px 1fr; }
.side { background:var(--side); border-right:1px solid var(--line); position:sticky; top:0; height:100vh; display:flex; flex-direction:column; }
.side .brand { padding:16px; font-size:15px; } .side nav { overflow-y:auto; flex:1; padding:0 8px 12px; }
.grp { margin-top:10px; } .gt { font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); padding:4px 8px; white-space:nowrap; overflow:hidden; }
.nav { display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:7px; color:var(--ink); text-decoration:none; font-size:13px; white-space:nowrap; }
.nav:hover { background:var(--panel2); } .nav.on { background:#3a2a10; color:var(--gold); } .nav.planned .lbl { color:var(--muted); }
.nav .num { font:11px ui-monospace, monospace; color:var(--muted); width:18px; } .nav .lbl { overflow:hidden; text-overflow:ellipsis; flex:1; }
.dot { width:6px; height:6px; border-radius:50%; background:#5a4a78; } .dot.partial { background:var(--warn); }
.collapse { margin:8px; background:transparent; color:var(--muted); border:1px solid var(--line); border-radius:8px; padding:4px; cursor:pointer; }
.collapsed .side .brand span, .collapsed .lbl, .collapsed .gt, .collapsed .dot { display:none; } .collapsed .nav { justify-content:center; }
.main { min-width:0; } .top { display:flex; align-items:center; gap:12px; padding:12px 20px; border-bottom:1px solid var(--line); background:rgba(21,13,34,.92); position:sticky; top:0; z-index:5; backdrop-filter:blur(6px); }
.top h1 { min-width:160px; } .gsearch { flex:1; max-width:520px; } .gsearch input { width:100%; } .top .lang { align-self:auto; }
.me { display:flex; flex-direction:column; line-height:1.15; text-align:right; } .me small { color:var(--muted); font-size:11px; }
.content { padding:20px; max-width:1500px; }
/* panels & metrics */
.panel { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:16px; } .ph { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.metrics { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:10px; }
.metric { background:var(--panel2); border:1px solid var(--line); border-radius:10px; padding:10px 12px; min-height:84px; } .metric.ni { opacity:.65; border-style:dashed; }
.ml { font-size:12px; color:var(--muted); } .mv { font-size:24px; font-weight:800; font-variant-numeric:tabular-nums; margin:2px 0; } .ms { font-size:10px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; } .note { background:#2a1d3f; border-left:3px solid var(--gold2); padding:8px 12px; border-radius:8px; color:var(--muted); font-size:13px; }
.note.ok { border-color:var(--ok); color:#bff0d4; } .note.bad { border-color:var(--bad); color:#ffc2cb; }
.ni-box { display:flex; flex-direction:column; gap:6px; align-items:flex-start; color:var(--muted); padding:20px 4px; }
/* tables */
.tablewrap { overflow:auto; } table { width:100%; border-collapse:collapse; font-size:13px; } th { text-align:left; color:var(--muted); font-weight:600; font-size:12px; padding:8px; border-bottom:1px solid var(--line); white-space:nowrap; }
td { padding:8px; border-bottom:1px solid #2a1e3d; vertical-align:top; } tr.click { cursor:pointer; } tr.click:hover td { background:#251a37; }
th.sortable { cursor:pointer; } th.sortable:hover { color:var(--ink); } .num { text-align:right; font-variant-numeric:tabular-nums; }
.matrix td.c { text-align:center; color:var(--gold); } .matrix th { text-align:center; vertical-align:bottom; }
.toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:12px; } .colpick { margin-bottom:10px; gap:14px; }
.pager { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:10px; color:var(--muted); font-size:12px; }
.tabs { display:flex; gap:4px; flex-wrap:wrap; } .tab { font:inherit; font-size:12px; background:transparent; color:var(--muted); border:1px solid var(--line); border-radius:999px; padding:4px 12px; cursor:pointer; }
.tab.on { background:#3a2a10; color:var(--gold); border-color:var(--gold2); } .tab.ni { border-style:dashed; }
.phead { display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; } .kv { display:grid; grid-template-columns:auto auto; gap:2px 14px; font-size:13px; } .kv span { color:var(--muted); }
.noteitem { background:var(--panel2); border-radius:10px; padding:10px 12px; } .noteitem p { margin:6px 0 0; white-space:pre-wrap; }
.feed { list-style:none; margin:0; padding:0; max-height:420px; overflow:auto; } .feed li { padding:6px 4px; border-bottom:1px solid #2a1e3d; cursor:pointer; font-size:13px; } .feed time { color:var(--muted); font-variant-numeric:tabular-nums; }
.json { margin:0; max-width:520px; white-space:pre-wrap; word-break:break-all; color:#d8ccf0; }
.grid-form > .row { grid-column:1/-1; }
.grid-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; align-items:end; } .inline-edit { background:var(--panel2); padding:10px; border-radius:10px; min-width:280px; }
.notbuilt { text-align:center; padding:40px 16px; display:flex; flex-direction:column; align-items:center; gap:10px; } .nb-icon { font-size:44px; } .notbuilt p { max-width:640px; margin:0; }
/* charts */
.chartbox .ph { margin-bottom:6px; } .chart { width:100%; height:auto; display:block; } .chart .grid { stroke:#33264b; stroke-width:1; } .chart .axis { fill:var(--muted); font-size:10px; }
.chart .cross { stroke:#6b5a8c; stroke-dasharray:3 3; } .chart .ring { stroke:var(--panel); stroke-width:2; } .tip rect { fill:#0f0918; stroke:var(--line); } .tip text { fill:var(--ink); font-size:11px; }
.legend { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); } .legend i { width:10px; height:3px; border-radius:2px; display:inline-block; }
.modal { position:fixed; inset:0; background:rgba(8,4,14,.7); display:grid; place-items:center; z-index:50; } .modal .box { background:var(--panel); border:1px solid var(--gold2); border-radius:14px; padding:22px; width:min(380px,92vw); display:flex; flex-direction:column; gap:10px; }
@media (max-width:900px) { .shell { grid-template-columns:60px 1fr; } .shell .side .brand span, .shell .lbl, .shell .gt, .shell .dot { display:none; } .grid2 { grid-template-columns:1fr; } .top { flex-wrap:wrap; } .me { display:none; } .gsearch { order:9; flex-basis:100%; max-width:none; } .top h1 { min-width:0; flex:1; } }
