:root {
  --bg: #0a0a0f;
  --card: #101014;
  --card2: #16161c;
  --border: #232330;
  --fg: #fafafa;
  --muted: #9a9aae;
  --primary: #8b5cf6;
  --primary-fg: #ffffff;
  --radius: 14px;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --sky: #38bdf8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.aurora {
  min-height: 100vh;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(50rem 40rem at 100% 0%, rgba(56, 189, 248, 0.06), transparent 55%),
    var(--bg);
}
.glass {
  background: linear-gradient(180deg, rgba(22, 22, 28, 0.7), rgba(16, 16, 20, 0.6));
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(139, 92, 246, 0.3); }
.hide-sb::-webkit-scrollbar { display: none; }
.hide-sb { scrollbar-width: none; }

/* ---------- login ---------- */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.brand-badge {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); margin: 0 auto 1rem;
  font-size: 22px;
}
.auth-box { width: 100%; max-width: 360px; }
.auth-card { padding: 1.5rem; border-radius: 18px; }

/* ---------- controls ---------- */
label { font-size: 0.8rem; color: var(--muted); font-weight: 500; display: block; margin-bottom: 0.4rem; }
input, textarea, select {
  width: 100%; height: 40px; padding: 0 0.75rem; font-size: 0.9rem;
  background: rgba(30, 30, 38, 0.6); border: 1px solid var(--border); border-radius: 10px; color: var(--fg);
}
textarea { height: auto; min-height: 84px; padding: 0.6rem 0.75rem; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.field { margin-bottom: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 40px; padding: 0 1rem; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-fg); font-weight: 500; font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn.outline { background: transparent; box-shadow: none; border-color: var(--border); }
.btn.outline:hover { background: rgba(255, 255, 255, 0.05); }
.btn.sm { height: 32px; padding: 0 0.7rem; font-size: 0.8rem; }
.btn.block { width: 100%; }
.err { color: var(--red); font-size: 0.85rem; margin-top: 0.3rem; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: rgba(16, 16, 20, 0.4); padding: 1rem 0.75rem; height: 100vh;
  position: sticky; top: 0; overflow-y: auto;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
  padding: 0 1.5rem; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: rgba(10, 10, 15, 0.7); backdrop-filter: blur(8px); z-index: 10;
}
.content { padding: 1.5rem; flex: 1; }
.logo-row { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.5rem; margin-bottom: 1rem; }
.logo-row .badge { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); font-size: 16px; }
.logo-row b { font-size: 0.9rem; }
.nav-group { margin-bottom: 1.1rem; }
.nav-group h4 { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6b6b80; padding: 0 0.5rem; margin-bottom: 0.35rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border-radius: 9px;
  color: var(--muted); font-size: 0.87rem; margin-bottom: 1px;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.nav-item.active { background: rgba(139, 92, 246, 0.15); color: var(--primary); font-weight: 500; }
.nav-item .ic { width: 18px; text-align: center; }
.switcher {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(30, 30, 38, 0.5);
  color: var(--fg); font-size: 0.87rem; margin-bottom: 1rem;
}
.switcher .av { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(139, 92, 246, 0.2); color: var(--primary); font-size: 0.75rem; font-weight: 600; }

/* ---------- page bits ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; max-width: 46rem; }
.grid { display: grid; gap: 1rem; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .cols-3, .cols-4, .cols-2 { grid-template-columns: 1fr; } .sidebar { display: none; } }
.stat { padding: 1.25rem; }
.stat .v { font-size: 1.9rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; }
.card-pad { padding: 1.25rem; }
.row { display: flex; align-items: center; gap: 1rem; padding: 1rem; }
.badge2 { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 500; padding: 0.15rem 0.6rem; border-radius: 999px; }
.b-primary { background: rgba(139, 92, 246, 0.15); color: var(--primary); }
.b-green { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.b-amber { background: rgba(251, 191, 36, 0.15); color: var(--amber); }
.b-red { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.b-outline { border: 1px solid var(--border); color: var(--muted); }
.stars { color: var(--amber); letter-spacing: 1px; font-size: 0.8rem; }
.stars .off { color: #3a3a48; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.mono { font-family: ui-monospace, monospace; }
.empty { text-align: center; padding: 3.5rem 1.5rem; }
.empty .ic { font-size: 1.6rem; margin-bottom: 0.75rem; }
pre.out { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.85rem; max-height: 20rem; overflow: auto; }
.toast-wrap { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.6rem 1rem; border-radius: 10px; font-size: 0.85rem; border: 1px solid var(--border); background: var(--card2); animation: fade 0.2s ease; }
.toast.ok { border-color: rgba(52, 211, 153, 0.4); }
.toast.bad { border-color: rgba(248, 113, 113, 0.4); }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.7rem; border-radius: 999px; background: rgba(139, 92, 246, 0.15); color: var(--primary); font-size: 0.8rem; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 0.35rem; margin-bottom: 1.25rem; }
.step { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-size: 0.7rem; background: var(--card2); color: var(--muted); }
.step.on { background: rgba(139, 92, 246, 0.2); color: var(--primary); outline: 1px solid var(--primary); }
.step.done { background: var(--primary); color: #fff; }
.step-line { width: 16px; height: 1px; background: var(--border); }
.mb { margin-bottom: 1rem; } .mt { margin-top: 1rem; }
.flex { display: flex; gap: 0.5rem; align-items: center; } .wrap { flex-wrap: wrap; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp 0.7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
