/* Vzlit cabinet — design tokens, layout, components */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8fafc; --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --line: #e2e8f0; --line-2: #cbd5e1; --accent: #2563eb; --accent-ink: #ffffff; --accent-soft: #eff4ff;
  --good: #15803d; --good-soft: #ecfdf3; --bad: #b91c1c; --bad-soft: #fef2f2; --warn: #b45309; --warn-soft: #fffbeb;
  --side: #0b1220; --side-ink: #cbd5e1; --side-muted: #64748b; --side-hover: #16213a; --side-active: #1e2d4f;
  --radius: 10px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --surface: #121826; --surface-2: #0f1520; --ink: #e5e9f0; --ink-2: #c3cad6; --muted: #8b95a7;
    --line: #232c3d; --line-2: #2f3a50; --accent: #5b8cff; --accent-ink: #0b0f17; --accent-soft: #17223a;
    --good: #4ade80; --good-soft: #0f2a1b; --bad: #f87171; --bad-soft: #2d1416; --warn: #fbbf24; --warn-soft: #2b2110;
    --side: #070a11; --side-hover: #111827; --side-active: #17223a; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --surface: #121826; --surface-2: #0f1520; --ink: #e5e9f0; --ink-2: #c3cad6; --muted: #8b95a7;
  --line: #232c3d; --line-2: #2f3a50; --accent: #5b8cff; --accent-ink: #0b0f17; --accent-soft: #17223a;
  --good: #4ade80; --good-soft: #0f2a1b; --bad: #f87171; --bad-soft: #2d1416; --warn: #fbbf24; --warn-soft: #2b2110;
  --side: #070a11; --side-hover: #111827; --side-active: #17223a; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; } h1 { font-size: 22px; font-weight: 650; } h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; } p { margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .hidden { display: none !important; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; font-weight: 700; font-size: 18px; color: #fff; letter-spacing: .2px; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #22d3ee); display: grid; place-items: center; font-size: 15px; color: #fff; }
.pswitch { margin: 4px 12px 10px; }
.pswitch select { width: 100%; background: var(--side-hover); color: #fff; border: 1px solid #22304d; border-radius: 8px; padding: 8px 10px; font: inherit; }
.nav { padding: 4px 8px 16px; flex: 1; }
.nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--side-ink); font-size: 13.5px; text-decoration: none; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.on { background: var(--side-active); color: #fff; box-shadow: inset 2px 0 0 #3b82f6; }
.nav a .ic { width: 18px; text-align: center; opacity: .9; }
.nav a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.side-foot { padding: 12px 18px; border-top: 1px solid #172036; font-size: 12px; color: var(--side-muted); }
.side-foot a { color: var(--side-ink); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .burger { display: none; }
.crumbs { color: var(--muted); font-size: 13px; } .crumbs b { color: var(--ink); font-weight: 600; }
.top .sp { flex: 1; }
.content { padding: 24px 28px 48px; max-width: 1320px; width: 100%; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card > h2, .card > h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; } .card-head .sp { flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sp { flex: 1; } .page-head p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: 12.5px; } .kpi .v { font-size: 24px; font-weight: 650; margin-top: 2px; word-break: break-word; }
.kpi .d { font-size: 12.5px; margin-top: 2px; } .kpi.sm .v { font-size: 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 550; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { filter: brightness(1.06); text-decoration: none; } .btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--accent); } .btn.ghost:hover { background: var(--accent-soft); }
.btn.plain { background: transparent; border-color: var(--line-2); color: var(--ink-2); } .btn.plain:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); } .btn.sm { padding: 4px 10px; font-size: 12.5px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 550; margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; } .field.wide { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 12.5px; cursor: pointer; background: var(--surface); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { font: inherit; background: none; border: 0; padding: 9px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.tag.good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.tag.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.tag.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.tag.info { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 14px; }
.alert.warn { background: var(--warn-soft); border-color: transparent; } .alert.bad { background: var(--bad-soft); border-color: transparent; }
.alert.info { background: var(--accent-soft); border-color: transparent; } .alert.good { background: var(--good-soft); border-color: transparent; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 30px; margin-bottom: 6px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; top: 0; cursor: pointer; user-select: none; white-space: nowrap; }
tr:last-child td { border-bottom: 0; } tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .cell-long { max-width: 460px; white-space: pre-wrap; word-break: break-word; }
.sev-critical, .sev-high { color: var(--bad); font-weight: 600; } .sev-medium { color: var(--warn); font-weight: 600; } .sev-low { color: var(--muted); }
.section { margin-top: 18px; } .section > h3 { margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 14px; font-size: 13.5px; } .kv .k { color: var(--muted); }
.hist { list-style: none; margin: 0; padding: 0; } .hist li { padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.hist li:hover { background: var(--surface-2); } .hist li.on { border-color: var(--accent); background: var(--accent-soft); }
.hist .t { font-weight: 550; font-size: 13px; } .hist .m { font-size: 12px; color: var(--muted); }
.score { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700;
  background: conic-gradient(var(--c, var(--accent)) calc(var(--p, 0) * 1%), var(--line) 0); position: relative; }
.score::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.score span { position: relative; z-index: 1; }
.scorerow { display: flex; gap: 22px; align-items: center; } .scorerow > .kpis { flex: 1; min-width: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mod { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.mod:hover { border-color: var(--accent); text-decoration: none; } .mod .h { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.mod p { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font-size: 13.5px; }
.toast.bad { background: var(--bad); color: #fff; }
details.more summary { cursor: pointer; color: var(--accent); font-size: 12.5px; } details.more[open] summary { margin-bottom: 6px; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.copy { cursor: pointer; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at 0% 0%, #1d4ed8 0%, #0b1220 60%); color: #e2e8f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 34px; color: #fff; margin: 28px 0 12px; } .auth-side ul { padding-left: 18px; line-height: 1.9; color: #cbd5e1; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-box { width: 100%; max-width: 400px; } .auth-box .field { margin-bottom: 12px; }
.auth-box .btn { width: 100%; justify-content: center; padding: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .app.menu .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  .top { padding: 10px 16px; } .top .burger { display: inline-flex; }
  .content { padding: 16px 16px 40px; } .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; } .auth-side { display: none; }
  .kv { grid-template-columns: 1fr; }
  .scorerow { flex-direction: column; align-items: flex-start; } .scorerow > .kpis { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .v { font-size: 20px; }
  #who, #planbadge, .crumbs { display: none; } .top { gap: 8px; } .top .sp { flex: 1; }
  .page-head h1 { font-size: 20px; }
}
