/* =====================================================================
   Mirrage — design system
   ===================================================================== */
:root {
  --bg: #06060b;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.065);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #eeedf6;
  --muted: #9391a8;
  --faint: #5f5d74;
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --teal: #5eead4;
  --pink: #f0abfc;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #fb7185;
  --radius: 20px;
  --radius-sm: 12px;
  --grad: linear-gradient(115deg, #d8ccff 0%, #a78bfa 38%, #5eead4 100%);
  --grad-soft: linear-gradient(135deg, rgba(167,139,250,.16), rgba(94,234,212,.08));
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 60px -28px rgba(0,0,0,.7);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Unbounded", "Inter", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font-family: inherit; }

/* ---------- background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after, .aurora span {
  content: ""; position: absolute; border-radius: 50%; filter: blur(120px);
}
.aurora::before { width: 700px; height: 560px; background: #6d28d9; top: -300px; left: -200px; opacity: .30; animation: drift 28s ease-in-out infinite alternate; }
.aurora::after { width: 560px; height: 520px; background: #0f766e; bottom: -260px; right: -180px; opacity: .26; animation: drift 34s ease-in-out infinite alternate-reverse; }
.aurora span { width: 420px; height: 340px; background: #a21caf; top: 30%; left: 58%; opacity: .10; animation: drift 40s ease-in-out infinite alternate; }
.aurora .grain {
  position: absolute; inset: 0; filter: none; border-radius: 0; opacity: 1; width: auto; height: auto; animation: none;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}
@keyframes drift { to { transform: translate(80px, 50px) scale(1.1); } }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.022em; }
h1 { font-size: 27px; }
h2 { font-size: 16.5px; }
h3 { font-size: 14.5px; }
.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: .92em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.logo { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--grad); position: relative; flex: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 8px 26px -6px rgba(167,139,250,.75);
}
.logo-mark::after { content: ""; position: absolute; inset: 8px; background: var(--bg); clip-path: polygon(0 100%, 50% 0, 100% 100%, 50% 64%); }
.logo small { font-family: "Inter"; font-weight: 500; color: var(--muted); font-size: 11px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 99px; letter-spacing: .02em; }

/* ---------- layout ---------- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 10px; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-hero { grid-template-columns: 1.25fr 1fr; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-hero, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } .container { padding: 0 16px; } }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.greeting { padding: 26px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.greeting h1 { font-size: 30px; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.018));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow); position: relative; transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.card.flat { box-shadow: none; background: rgba(255,255,255,.02); }
.card.hover:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card.glow { background: linear-gradient(160deg, rgba(167,139,250,.10), rgba(255,255,255,.02) 45%, rgba(94,234,212,.06)); }
.card.glow::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(196,181,253,.6), rgba(255,255,255,.04) 35%, rgba(255,255,255,.04) 65%, rgba(94,234,212,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat { display: flex; flex-direction: column; gap: 14px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.chip-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(167,139,250,.18); }
.chip-icon svg { width: 17px; height: 17px; }
.chip-icon.teal { background: rgba(94,234,212,.09); color: var(--teal); border-color: rgba(94,234,212,.18); }
.chip-icon.pink { background: rgba(240,171,252,.09); color: var(--pink); border-color: rgba(240,171,252,.18); }
.chip-icon.amber { background: rgba(251,191,36,.08); color: var(--warn); border-color: rgba(251,191,36,.18); }
.stat-value { font-size: 27px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 15px; color: var(--faint); font-weight: 500; letter-spacing: -0.01em; }
.stat-sub { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.big-number { font-family: var(--display); font-size: 58px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- progress ---------- */
.progress { height: 8px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); border-radius: inherit; transition: width 1s var(--ease); box-shadow: 0 0 16px rgba(167,139,250,.5); }
.progress.sm { height: 5px; }
.progress.warn > div { background: linear-gradient(90deg, #fbbf24, #fb923c); box-shadow: none; }
.progress.bad > div { background: linear-gradient(90deg, #fb7185, #e11d48); box-shadow: none; }

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none; border: 1px solid var(--border-strong); background: rgba(255,255,255,.045); color: var(--text);
  font: inherit; font-weight: 500; font-size: 13.5px; padding: 9px 16px; border-radius: var(--radius-sm);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s var(--ease); white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.085); border-color: rgba(255,255,255,.2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--grad); color: #0b0a14; border-color: transparent; font-weight: 600; box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 10px 30px -12px rgba(167,139,250,.9); }
.btn.primary:hover { filter: brightness(1.07) saturate(1.05); box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset, 0 14px 36px -12px rgba(167,139,250,1); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255,255,255,.06); }
.btn.danger:hover { color: var(--bad); border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn.icon { padding: 7px; }
.btn.lg { padding: 13px 20px; font-size: 14.5px; border-radius: 14px; }
.btn svg { width: 15px; height: 15px; flex: none; }

.input, textarea.input, select.input {
  width: 100%; background: rgba(0,0,0,.25); border: 1px solid var(--border-strong); color: var(--text);
  font: inherit; padding: 12px 14px; border-radius: var(--radius-sm); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color: var(--faint); }
textarea.input { font-family: var(--mono); font-size: 12.5px; min-height: 140px; resize: vertical; }
.input:focus { border-color: rgba(167,139,250,.65); box-shadow: 0 0 0 4px rgba(167,139,250,.13); background: rgba(0,0,0,.35); }
.field { display: block; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.field + .field { margin-top: 14px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 42px; }

/* ---------- auth screen ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; border-right: 1px solid var(--border); }
.auth-art h1 { font-family: var(--display); font-weight: 500; font-size: 44px; line-height: 1.08; letter-spacing: -0.045em; max-width: 520px; }
.auth-art p.lead { color: var(--muted); font-size: 16px; max-width: 440px; margin: 18px 0 0; }
.features { display: grid; gap: 14px; max-width: 460px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature b { display: block; font-weight: 500; font-size: 14px; }
.feature span { color: var(--muted); font-size: 13px; }
.mirage { display: block; width: calc(100% + 112px); margin: 8px -56px; height: clamp(120px, 24vh, 240px); flex: none; pointer-events: none; opacity: .9; mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.mirage path { fill: none; stroke-width: 1.2; stroke-dasharray: 4 10; animation: haze 6s linear infinite; }
.mirage path:nth-child(2n) { animation-duration: 9s; animation-direction: reverse; }
@keyframes haze { to { stroke-dashoffset: -140; } }
.mirage .sun { animation: pulse 6s ease-in-out infinite; transform-origin: center; }
@keyframes pulse { 50% { opacity: .65; } }
.auth-form { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 400px; padding: 34px; }
.login-card h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.03em; }
.login-card .btn.primary { width: 100%; margin-top: 18px; }
.error-text { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }
.hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.hint svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { border-right: 0; padding: 28px 22px 0; min-height: auto; }
  .auth-art .features, .mirage { display: none; }
  .auth-art h1 { font-size: 30px; margin-top: 28px; }
}

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); background: rgba(255,255,255,.03); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); border-color: rgba(74,222,128,.22); background: rgba(74,222,128,.07); }
.badge.ok.live::before { box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: ping 2s infinite; }
.badge.warn { color: var(--warn); border-color: rgba(251,191,36,.22); background: rgba(251,191,36,.07); }
.badge.bad { color: var(--bad); border-color: rgba(251,113,133,.22); background: rgba(251,113,133,.07); }
.badge.plain::before { display: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 5px; border-radius: 99px; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; color: #0b0a14; background: var(--grad); flex: none; }
.avatar.lg { width: 40px; height: 40px; border-radius: 13px; font-size: 15px; }
.user-chip .meta { line-height: 1.2; padding-right: 4px; }
.user-chip .meta b { font-weight: 500; font-size: 13px; display: block; }
.user-chip .meta span { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; padding: 10px 22px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 13px 22px; border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.022); }
td.num, th.num { text-align: right; }
.empty { padding: 44px 20px; text-align: center; color: var(--faint); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state .chip-icon { width: 46px; height: 46px; border-radius: 15px; }
.empty-state .chip-icon svg { width: 22px; height: 22px; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; padding: 4px; background: rgba(0,0,0,.28); border: 1px solid var(--border); border-radius: 13px; gap: 2px; }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; padding: 7px 15px; border-radius: 9px; cursor: pointer; transition: all .2s var(--ease); display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.active { background: rgba(255,255,255,.1); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 12px -4px rgba(0,0,0,.6); }

/* ---------- code ---------- */
.code {
  position: relative; background: rgba(3,3,8,.55); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; font-family: var(--mono); font-size: 12.8px; line-height: 1.75; overflow-x: auto; white-space: pre; color: #d9d6ee;
}
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 16px; border: 1px solid var(--border); border-bottom: 0; border-radius: 14px 14px 0 0; background: rgba(255,255,255,.025); font-size: 12px; color: var(--muted); font-family: var(--mono); }
.code-head + .code { border-radius: 0 0 14px 14px; }
.code-head .dots { display: flex; gap: 6px; margin-right: 6px; }
.code-head .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.1); }
.code .k { color: #c4b5fd; } .code .s { color: #5eead4; } .code .c { color: var(--faint); } .code .n { color: #f0abfc; } .code .d { color: #fcd34d; }
.inline-code { font-family: var(--mono); font-size: 12.3px; background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); color: #dcd8f0; }

/* ---------- steps ---------- */
.steps { position: relative; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding-bottom: 24px; position: relative; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 1px; background: linear-gradient(var(--border-strong), transparent); }
.step-num { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(167,139,250,.25); }
.step:last-child .step-num { background: rgba(74,222,128,.1); color: var(--ok); border-color: rgba(74,222,128,.25); }
.step h3 { margin: 6px 0 6px; }
.step p { margin: 0 0 12px; color: var(--muted); }
.step-body { min-width: 0; }

/* ---------- key field ---------- */
.key-box { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,.3); border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 14px; }
.key-box code { flex: 1; font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d9d6ee; }

/* ---------- charts ---------- */
.chart-wrap { position: relative; }
.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(255,255,255,.05); stroke-dasharray: 3 5; }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: Inter, sans-serif; }
.chart .line { fill: none; stroke: url(#lineGrad); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: url(#areaGrad); }
.chart .cursor { stroke: rgba(255,255,255,.18); stroke-width: 1; }
.chart .dot { fill: var(--bg); stroke: #c4b5fd; stroke-width: 2.2; }
.chart .bar { fill: url(#barGrad); transition: opacity .15s; }
.chart .bar:hover { opacity: .75; }
.chart text { fill: var(--faint); font-size: 10px; font-family: Inter, sans-serif; }
.tooltip { position: absolute; pointer-events: none; background: rgba(16,16,26,.92); border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 11px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -120%); backdrop-filter: blur(8px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.8); transition: opacity .12s; }
.tooltip b { font-weight: 600; font-size: 13px; display: block; }
.tooltip span { color: var(--muted); }

/* ---------- ring ---------- */
.ring { width: 150px; height: 150px; flex: none; }
.ring circle { fill: none; stroke-width: 11; }
.ring .track { stroke: rgba(255,255,255,.055); }
.ring .val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); transform: rotate(-90deg); transform-origin: center; filter: drop-shadow(0 0 6px rgba(167,139,250,.45)); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(3,3,8,.6); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .2s ease; }
.modal { width: 100%; max-width: 520px; background: linear-gradient(180deg, #13131e, #0e0e17); border: 1px solid var(--border-strong); border-radius: 22px; padding: 28px; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 120px -20px rgba(0,0,0,.9); animation: pop .26s var(--ease); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal h2 { margin-bottom: 4px; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; }
.toast { display: flex; align-items: center; gap: 9px; background: rgba(22,22,34,.94); border: 1px solid var(--border-strong); padding: 10px 16px; border-radius: 99px; font-size: 13.5px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.9); animation: pop .22s var(--ease); backdrop-filter: blur(10px); }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.toast.bad::before { background: var(--bad); }

/* ---------- admin shell ---------- */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--border); padding: 24px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; background: rgba(6,6,11,.5); backdrop-filter: blur(14px); }
.side .logo { padding: 0 10px 28px; }
.nav-label { font-size: 11px; color: var(--faint); padding: 0 12px 8px; letter-spacing: .06em; text-transform: uppercase; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 500; transition: all .2s var(--ease); border: 0; background: none; font-family: inherit; width: 100%; text-align: left; }
.nav-item svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, rgba(167,139,250,.14), rgba(167,139,250,.03)); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-item.active svg { color: var(--accent); opacity: 1; }
.nav-count { margin-left: auto; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.main { padding: 34px 40px 60px; min-width: 0; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 620px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side .logo { padding: 0 10px 0 4px; width: 100%; margin-bottom: 10px; }
  .side .nav-item { width: auto; }
  .side .spacer, .nav-label, .nav-item.active::before { display: none; }
  .main { padding: 22px 16px 50px; }
}

.acc-card { display: flex; flex-direction: column; gap: 16px; }
.acc-head { display: flex; align-items: center; gap: 12px; }
.acc-head .who { min-width: 0; flex: 1; }
.acc-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.acc-email { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-row { display: grid; grid-template-columns: 62px 1fr 42px; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted); }
.meter-row b { color: var(--text); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.kv { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 500; }
.kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kv-grid > div { padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.04); }
.kv-grid span { display: block; font-size: 11px; color: var(--faint); }
.kv-grid b { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.err-line { font-size: 12px; color: var(--bad); background: rgba(251,113,133,.06); border: 1px solid rgba(251,113,133,.15); padding: 7px 10px; border-radius: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; background: var(--grad-soft); color: #d8ccff; border: 1px solid rgba(167,139,250,.2); }

.switch { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: rgba(255,255,255,.1); border-radius: 99px; cursor: pointer; transition: .25s var(--ease); }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

.preset-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.preset-row .btn { border-radius: 99px; }

/* ---------- motion: only on first paint ---------- */
.fade-in { animation: rise .55s var(--ease) both; }
.fade-in:nth-child(2) { animation-delay: .04s; } .fade-in:nth-child(3) { animation-delay: .08s; }
.fade-in:nth-child(4) { animation-delay: .12s; } .fade-in:nth-child(5) { animation-delay: .16s; }
body.settled .fade-in { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.hidden { display: none !important; }
::selection { background: rgba(167,139,250,.35); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
