:root {
  --bg: #07090b; --text: #e9ece9; --muted: #98a29b; --dim: #7f8a84;
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.1);
  --surface: rgba(255,255,255,.035); --surface2: rgba(255,255,255,.055);
  --accent: #e3a13e; --accent2: #f6c06a; --on-accent: #1a1206;
  --ok: #5ee6a0; --warn: #e3a13e; --bad: #ff8a7a; --info: #7cb8ff;
  --radius: 14px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1100px 620px at -5% -15%, rgba(227,161,62,.11), transparent 60%),
              radial-gradient(900px 520px at 105% -5%, rgba(80,200,170,.07), transparent 60%), var(--bg);
  background-attachment: fixed; color: var(--text); font-size: 14px; line-height: 1.45;
}
a { color: var(--accent2); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 600; }
.boot { padding: 40px; color: var(--muted); }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line2); background: var(--surface2); color: var(--text); font: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent2), #e3892e); border-color: transparent; color: var(--on-accent); font-weight: 600;
  box-shadow: 0 8px 22px -10px rgba(232,140,50,.85), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.danger { background: rgba(255,110,90,.06); border-color: rgba(255,120,100,.3); color: var(--bad); }
.btn.danger:hover { background: rgba(255,110,90,.14); }
.btn.ghost { background: transparent; border-color: transparent; color: #c9cfcb; }
.btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn.ghost.bad { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
input, select, textarea { min-height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2);
  background: rgba(0,0,0,.3); color: var(--text); font: inherit; width: 100%; }
textarea { padding: 12px 14px; min-height: 320px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(240,170,80,.7); box-shadow: 0 0 0 4px rgba(227,161,62,.15); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: #aeb6b0; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }

/* cards, pills, tables */
.card { background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 24px 48px -28px rgba(0,0,0,.7); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.stat .label { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #c9cfcb; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .info { color: var(--info); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 20px; }
.table td { padding: 10px 20px; border-top: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.025); }
.scroll-x { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.notice.warn { background: rgba(227,161,62,.08); border: 1px solid rgba(227,161,62,.3); color: #f2c37a; }
.notice.bad { background: rgba(255,110,90,.08); border: 1px solid rgba(255,120,100,.3); color: #ffc2b8; }
.notice.ok { background: rgba(94,230,160,.08); border: 1px solid rgba(94,230,160,.28); color: #bfe8c9; }

/* layout */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 240px; max-width: 280px; padding: 18px 12px; display: flex; flex-direction: column; gap: 22px;
  background: rgba(8,10,12,.55); backdrop-filter: blur(18px); border-right: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 10.5px; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--accent2), #e07f2a); color: var(--on-accent); box-shadow: 0 8px 24px -8px rgba(232,140,50,.75), inset 0 1px 0 rgba(255,255,255,.35); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 0 12px 6px; }
.nav { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: #b9c1bb; text-decoration: none; font-weight: 500; }
.nav:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav.active { background: rgba(227,161,62,.1); color: #fff; box-shadow: inset 0 0 0 1px rgba(227,161,62,.35); }
.nav svg { width: 18px; height: 18px; flex: 0 0 auto; }
.main-col { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 32px; border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(7,9,11,.62); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
.main { padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 20px; max-width: 1320px; width: 100%; }
.srv-tab { gap: 8px; }
.srv-tab.active { background: rgba(227,161,62,.13); border-color: var(--accent); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); font-weight: 600; font-size: 13px; }
.menu-btn { display: none; }

/* console */
.console { background: rgba(0,0,0,.42); height: 460px; overflow: auto; padding: 14px 16px; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.console .e { color: var(--bad); } .console .w { color: var(--warn); }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 20px; border-radius: 20px; padding: 32px; }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: 200px; height: 200px; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; display: block; }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-family: "JetBrains Mono", ui-monospace, monospace; min-height: 54px; }

/* dialogs & toast */
dialog { border: 1px solid var(--line2); border-radius: 18px; background: #101315; color: var(--text); padding: 24px; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
#toast { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
#toast .t { padding: 12px 16px; border-radius: 12px; background: #142219; border: 1px solid rgba(94,230,160,.3); color: #bfe8c9; box-shadow: 0 16px 40px -16px #000; max-width: 380px; }
#toast .t.err { background: #24130f; border-color: rgba(255,120,100,.35); color: #ffc2b8; }

@media (max-width: 760px) {
  .side { display: none; max-width: none; flex-basis: 100%; border-right: none; border-bottom: 1px solid var(--line); }
  .side.open { display: flex; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .main { padding: 18px 16px 40px; }
  h1 { font-size: 24px; }
  .btn { min-height: 44px; } .btn.sm { min-height: 38px; }
  input, select { font-size: 16px; }
  .table th, .table td { padding: 10px 14px; }
}
