/* FloofNet Control Center
   Dunkles Navy, Cyan / Lila / Pink, dezentes Glow. Alle Komponenten nutzen diese Tokens. */

:root {
  --bg: #05070f;
  --bg-2: #090d1b;
  --panel: #0d1324;
  --panel-2: #121a30;
  --line: #1b2540;
  --line-2: #263255;
  --text: #e6ebff;
  --muted: #8a94b8;
  --faint: #5a6488;
  --cyan: #2fe0ff;
  --violet: #a07bff;
  --pink: #ff5fb4;
  --green: #3ee6a0;
  --amber: #ffc24d;
  --red: #ff5a72;
  --grad: linear-gradient(115deg, var(--cyan) 0%, var(--violet) 52%, var(--pink) 100%);
  --glow-cyan: 0 0 0 1px rgba(47, 224, 255, .35), 0 0 24px -6px rgba(47, 224, 255, .55);
  --glow-pink: 0 0 0 1px rgba(255, 95, 180, .35), 0 0 24px -6px rgba(255, 95, 180, .55);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(160, 123, 255, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(47, 224, 255, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  display: flex;
  min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .92em; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
pre { background: #070a16; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; overflow: auto; font-size: 12.5px; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 24px; height: 24px; }

/* ---------- Layout ---------- */
.sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, rgba(13, 19, 36, .92), rgba(5, 7, 15, .96));
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 0 22px -4px rgba(160, 123, 255, .7); }
.brand-mark .ic { color: #070a16; stroke-width: 2.2; }
.brand-name { font-weight: 750; font-size: 17px; letter-spacing: .01em; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 10.5px; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px;
  color: var(--muted); font-weight: 520; position: relative;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .03); text-decoration: none; }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(47, 224, 255, .12), rgba(160, 123, 255, .06)); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--cyan); }
.nav a.active .ic { color: var(--cyan); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; }
.me .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--violet); }
.me-name { font-weight: 600; font-size: 13.5px; }
.me a { color: inherit; }
.version { font-size: 11px; color: var(--faint); font-family: var(--mono); }

.main { flex: 1; min-width: 0; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 23px; display: flex; align-items: center; gap: 12px; }
.topbar .crumb { color: var(--faint); font-size: 13px; margin-bottom: 2px; }
.topbar .crumb a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.menu-toggle { display: none; }

/* ---------- Panels ---------- */
.panel { background: linear-gradient(180deg, rgba(18, 26, 48, .75), rgba(13, 19, 36, .75)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel, .stack > * + * { margin-top: 16px; }
.grid > .panel + .panel, .grid > * + * { margin-top: 0; }   /* im Raster regelt gap den Abstand */
.grid.mt, .grid + .panel, .panel + .grid { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { display: flex; align-items: center; gap: 9px; }
.panel-head h2 .ic { color: var(--violet); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 224, 255, .14), transparent 70%); pointer-events: none; }
.kpi:nth-child(2)::after { background: radial-gradient(circle, rgba(160, 123, 255, .16), transparent 70%); }
.kpi:nth-child(3)::after { background: radial-gradient(circle, rgba(255, 95, 180, .14), transparent 70%); }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; display: flex; align-items: center; gap: 7px; }
.kpi-value { font-family: var(--mono); font-size: 30px; font-weight: 650; margin-top: 6px; letter-spacing: -.02em; }
.kpi-value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.glow-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid rgba(27, 37, 64, .6); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
td.num, th.num { text-align: right; font-family: var(--mono); }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--faint); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1;
  padding: 9px 14px; border-radius: 9px; cursor: pointer;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2);
  transition: border-color .15s, box-shadow .15s, background .15s, transform .05s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { border-color: #3a4a7a; background: #16203b; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: none; box-shadow: var(--glow-cyan); }
.btn-primary { color: #050813; border: 0; background: var(--grad); box-shadow: 0 6px 22px -10px rgba(160, 123, 255, .9); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); box-shadow: 0 8px 26px -8px rgba(160, 123, 255, 1); }
.btn-danger { color: var(--red); border-color: rgba(255, 90, 114, .35); background: rgba(255, 90, 114, .06); }
.btn-danger:hover { border-color: var(--red); background: rgba(255, 90, 114, .12); box-shadow: 0 0 18px -6px rgba(255, 90, 114, .7); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------- Formulare ---------- */
label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; letter-spacing: .02em; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--faint); margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #080c19; border: 1px solid var(--line-2);
  border-radius: 9px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #33416b; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { padding: 8px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 12px; margin-right: 12px; cursor: pointer; }
input[type=color] { width: 54px; height: 38px; border: 1px solid var(--line-2); border-radius: 9px; background: #080c19; padding: 3px; }
select {
  appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fe0ff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
select option { background: var(--panel); color: var(--text); }
input[type=range] { width: 100%; accent-color: var(--violet); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--text); font-weight: 500; font-size: 14px; margin: 0 16px 0 0; }
.check input { appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line-2); background: #080c19; display: grid; place-items: center; cursor: pointer; margin: 0; }
.check input:checked { background: var(--grad); border-color: transparent; }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #050813; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.switch input { width: 36px; height: 20px; border-radius: 20px; position: relative; }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; border: 0; transform: none; }
.switch input:checked::after { transform: translateX(16px); background: #050813; width: 14px; height: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filters .field { margin: 0; min-width: 170px; }

/* ---------- Badges & Status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); background: rgba(255, 255, 255, .02); white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.badge-cyan { color: var(--cyan); border-color: rgba(47, 224, 255, .35); background: rgba(47, 224, 255, .07); }
.badge-violet { color: var(--violet); border-color: rgba(160, 123, 255, .35); background: rgba(160, 123, 255, .08); }
.badge-pink { color: var(--pink); border-color: rgba(255, 95, 180, .35); background: rgba(255, 95, 180, .08); }
.badge-green { color: var(--green); border-color: rgba(62, 230, 160, .35); background: rgba(62, 230, 160, .07); }
.badge-amber { color: var(--amber); border-color: rgba(255, 194, 77, .35); background: rgba(255, 194, 77, .07); }
.badge-red { color: var(--red); border-color: rgba(255, 90, 114, .35); background: rgba(255, 90, 114, .07); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot-on { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2.2s infinite; }
.dot-off { background: #3a4466; }
@keyframes pulse { 50% { box-shadow: 0 0 2px var(--green); } }

/* ---------- Meldungen ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; max-width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; background: rgba(13, 19, 36, .97); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -18px #000; animation: slide-in .25s ease-out; }
.toast .ic { margin-top: 1px; }
.toast-success { border-color: rgba(62, 230, 160, .45); } .toast-success .ic { color: var(--green); }
.toast-error { border-color: rgba(255, 90, 114, .5); } .toast-error .ic { color: var(--red); }
.toast-warning { border-color: rgba(255, 194, 77, .45); } .toast-warning .ic { color: var(--amber); }
.toast-info { border-color: rgba(47, 224, 255, .45); } .toast-info .ic { color: var(--cyan); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; }
@keyframes slide-in { from { transform: translateY(-8px); opacity: 0; } }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); margin-bottom: 16px; }
.notice .ic { margin-top: 1px; flex: none; }
.notice-error { border-color: rgba(255, 90, 114, .45); background: rgba(255, 90, 114, .06); } .notice-error .ic { color: var(--red); }
.notice-warning { border-color: rgba(255, 194, 77, .4); background: rgba(255, 194, 77, .05); } .notice-warning .ic { color: var(--amber); }
.notice-info { border-color: rgba(47, 224, 255, .35); background: rgba(47, 224, 255, .05); } .notice-info .ic { color: var(--cyan); }
.notice-success { border-color: rgba(62, 230, 160, .4); background: rgba(62, 230, 160, .05); } .notice-success .ic { color: var(--green); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice li { margin: 3px 0; font-family: var(--mono); font-size: 12.5px; }

/* ---------- Empty State ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: rgba(160, 123, 255, .08); border: 1px solid rgba(160, 123, 255, .25); color: var(--violet); }
.empty-icon .ic { width: 30px; height: 30px; }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 460px; margin: 0 auto 16px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-image: var(--grad) 1; border-bottom: 2px solid; }

/* ---------- Modal ---------- */
dialog.modal { border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); color: var(--text); padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px #000, var(--glow-pink); }
dialog.modal::backdrop { background: rgba(3, 5, 12, .72); backdrop-filter: blur(3px); }
.modal-body { padding: 22px 22px 6px; }
.modal-body h2 { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.modal-body h2 .ic { color: var(--pink); }
.modal-body p { color: var(--muted); margin: 0 0 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }

/* ---------- Key / Code ---------- */
.secret { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border: 1px dashed rgba(255, 95, 180, .55); border-radius: 10px; background: rgba(255, 95, 180, .05); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--faint); font-size: 12.5px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; min-width: 3px; background: linear-gradient(180deg, var(--violet), rgba(47, 224, 255, .5)); border-radius: 3px 3px 0 0; position: relative; }
.bars .bar:hover { background: var(--pink); }
.hbar { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 70px; gap: 12px; align-items: center; margin: 7px 0; font-size: 13px; }
.hbar-track { height: 9px; background: var(--panel-2); border-radius: 9px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--grad); border-radius: 9px; }
canvas.live-graph { width: 100%; height: 190px; display: block; }

/* ---------- Live-Stream ---------- */
.stream { max-height: 380px; overflow: auto; font-family: var(--mono); font-size: 12.5px; }
.stream-row { display: grid; grid-template-columns: 74px 120px 1fr; gap: 10px; padding: 6px 4px; border-bottom: 1px solid rgba(27, 37, 64, .5); }
.stream-row.new { animation: flash-row 1.2s ease-out; }
@keyframes flash-row { from { background: rgba(47, 224, 255, .14); } }
.stream-type { color: var(--cyan); }
.stream-data { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Simulator ---------- */
.sim-layout { display: grid; grid-template-columns: auto minmax(300px, 1fr); gap: 22px; align-items: start; }
.sim-device { padding: 14px; border-radius: 26px; background: linear-gradient(160deg, #1a2342, #0a0f1f); border: 1px solid var(--line-2); box-shadow: 0 30px 60px -30px #000, var(--glow-cyan); }
.sim-screen { position: relative; overflow: hidden; border-radius: 12px; background: #000; }
.sim-screen iframe { border: 0; position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.sim-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 10px; padding: 0 4px; }
.sim-inputs { display: flex; flex-direction: column; gap: 14px; }
.sim-btn {
  width: 100%; padding: 22px; font-size: 22px; font-weight: 800; letter-spacing: .18em; border-radius: 999px;
  color: #fff; border: 0; cursor: pointer; user-select: none;
  background: radial-gradient(circle at 50% 35%, #ff6b8b, #d1183f 60%, #8c0b28);
  box-shadow: 0 10px 0 #5b0718, 0 18px 30px -10px rgba(255, 60, 100, .7), inset 0 2px 0 rgba(255, 255, 255, .35);
  transition: transform .05s, box-shadow .05s;
}
.sim-btn.pressed, .sim-btn:active { transform: translateY(8px); box-shadow: 0 2px 0 #5b0718, 0 6px 16px -8px rgba(255, 60, 100, .7), inset 0 2px 0 rgba(255, 255, 255, .25); }
.sim-btn-generic { background: var(--grad); color: #050813; box-shadow: 0 8px 0 #3b2a7a, 0 14px 26px -12px rgba(160, 123, 255, .8); }
.sim-btn-generic.pressed, .sim-btn-generic:active { box-shadow: 0 1px 0 #3b2a7a; }
.state-view { max-height: 260px; overflow: auto; font-size: 12px; }
.sim-log { max-height: 200px; overflow: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sim-log div { padding: 3px 0; border-bottom: 1px solid rgba(27, 37, 64, .5); }
.kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); }

/* ---------- Reaktionen ---------- */
.reaction { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: rgba(9, 13, 27, .6); }
.reaction + .reaction { margin-top: 12px; }
.reaction-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.reaction-head h3 { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 15px; }

/* ---------- Doku ---------- */
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.doc-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.doc-nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-size: 13.5px; }
.doc-nav a.active { color: var(--text); background: rgba(47, 224, 255, .08); }
.doc { max-width: 900px; }
.doc h1 { font-size: 26px; margin: 0 0 16px; }
.doc h2 { font-size: 19px; margin: 32px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 15px; margin: 22px 0 8px; text-transform: none; letter-spacing: 0; color: var(--text); }
.doc p, .doc li { color: #c7cfee; }
.doc table { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; }
.doc th, .doc td { border-bottom: 1px solid var(--line); }
.doc .admonition { border-left: 3px solid var(--cyan); background: rgba(47, 224, 255, .05); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; }
.doc .admonition.warning, .doc .admonition.danger { border-color: var(--amber); background: rgba(255, 194, 77, .05); }
.doc .admonition-title { font-weight: 700; margin: 0 0 4px; color: var(--text); }

/* ---------- Login ---------- */
body.auth { align-items: center; justify-content: center; }
body.auth .main { flex: none; width: min(420px, calc(100vw - 32px)); padding: 0; }
.login-card { padding: 30px 28px; border-radius: 18px; background: rgba(13, 19, 36, .85); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -40px #000, var(--glow-cyan); }
.login-card .brand { justify-content: center; padding: 0 0 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar, .sim-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body { flex-direction: column; }
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; width: 260px; }
  body.nav-open .sidebar { transform: none; box-shadow: 30px 0 60px #000; }
  .btn.menu-toggle { display: inline-flex; }
  .main { padding: 18px 16px 50px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .hbar { grid-template-columns: 100px 1fr 60px; }
}
