/* HI-Cloud Panel – Design */
:root {
  --bg: #070a12;
  --bg-2: #0c1120;
  --card: rgba(17, 24, 39, .72);
  --card-solid: #111827;
  --border: rgba(148, 163, 184, .12);
  --border-strong: rgba(148, 163, 184, .22);
  --text: #e6ebf5;
  --muted: #8b95a9;
  --accent: #5b8cff;
  --accent-2: #a855f7;
  --grad: linear-gradient(135deg, #4f8cff 0%, #a855f7 100%);
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
small { font-size: 12px; }
[hidden] { display: none !important; }

.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(79,140,255,.16), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(168,85,247,.12), transparent 60%),
    radial-gradient(500px 400px at 50% 110%, rgba(79,140,255,.07), transparent 60%); }

/* ---------- Layout ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; border-right: 1px solid var(--border); background: rgba(7,10,18,.6); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 16px; }
.brand small { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: 10.5px; }
nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 16px 12px 6px; opacity: .8; }
nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #c3cad8; transition: .15s; cursor: pointer; }
nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
nav a:hover { background: rgba(148,163,184,.08); color: #fff; }
nav a.active { background: linear-gradient(135deg, rgba(79,140,255,.18), rgba(168,85,247,.14)); color: #fff; box-shadow: inset 0 0 0 1px rgba(91,140,255,.28); }
nav a.soon { opacity: .55; cursor: default; }
nav a.soon:hover { background: none; }
.pill { margin-left: auto; font-size: 10.5px; padding: 2px 8px; border-radius: 99px; background: rgba(148,163,184,.12); color: var(--muted); }
.pill-accent { background: rgba(91,140,255,.16); color: #9db8ff; margin: 0; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.me { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--muted); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; transition: .15s; }
.icon-btn:hover { color: #fff; border-color: var(--border-strong); background: rgba(148,163,184,.08); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { padding: 34px 40px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.page-head p { margin: 6px 0 0; }
.back { display: inline-block; color: var(--muted); margin-bottom: 14px; font-size: 13px; }
.back:hover { color: #fff; }

/* ---------- Komponenten ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; backdrop-filter: blur(12px); }
.card > h2 { margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; padding: 10px 18px; font: 600 14px var(--sans); cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s, opacity .2s; color: #fff; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); box-shadow: 0 6px 24px -6px rgba(91,140,255,.55), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { box-shadow: 0 10px 30px -6px rgba(124,108,255,.7), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-ghost { background: rgba(148,163,184,.08); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(148,163,184,.14); border-color: var(--border-strong); }
.btn-danger { background: rgba(239,68,68,.14); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn.loading { opacity: .7; pointer-events: none; }
.btn.loading::before { content: ""; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-danger { background: none; border: 0; color: #f87171; cursor: pointer; font-size: 13px; padding: 0; }

input, textarea, select { font: inherit; color: var(--text); background: rgba(2,6,15,.55); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.2); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .name-field { display: flex; flex-direction: column; gap: 7px; font-weight: 550; font-size: 13px; color: #c3cad8; }

.alert { padding: 11px 14px; border-radius: 11px; margin: 14px 0; font-size: 13.5px; }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fecaca; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #bbf7d0; }

.toast { position: fixed; top: 22px; right: 22px; z-index: 50; padding: 13px 18px; border-radius: 12px; max-width: 420px; font-weight: 550; box-shadow: 0 18px 50px -10px rgba(0,0,0,.6); animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2); backdrop-filter: blur(10px); }
.toast-success { background: rgba(20,83,45,.9); border: 1px solid rgba(34,197,94,.45); }
.toast-error { background: rgba(127,29,29,.92); border: 1px solid rgba(239,68,68,.5); }
.toast.hide { opacity: 0; transform: translateY(-10px); transition: .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } }

.bar { height: 6px; border-radius: 99px; background: rgba(148,163,184,.12); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.bar i.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-top: 4px; }
.stat-value small { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat-sub { font-size: 12px; }
.engine-dots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dot-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 5px 11px; border-radius: 99px; background: rgba(148,163,184,.08); border: 1px solid var(--border); }
.dot-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot-chip.ok i { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot-chip.off { opacity: .6; }

.create-card { border-color: rgba(91,140,255,.3); background: linear-gradient(160deg, rgba(79,140,255,.08), rgba(168,85,247,.05) 60%, rgba(17,24,39,.72)); animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.create-form { display: grid; grid-template-columns: 1fr; gap: 18px; }
.engine-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.engine-option input { position: absolute; opacity: 0; pointer-events: none; }
.engine-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--border-strong); background: rgba(2,6,15,.4); cursor: pointer; transition: .18s; position: relative; }
.engine-card b { display: block; }
.engine-card small { color: var(--muted); }
.engine-card:hover { border-color: rgba(91,140,255,.5); }
.engine-option input:checked + .engine-card { border-color: var(--accent); background: rgba(91,140,255,.1); box-shadow: 0 0 0 3px rgba(91,140,255,.15); }
.engine-card .check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; color: transparent; transition: .18s; }
.engine-option input:checked + .engine-card .check { background: var(--grad); border-color: transparent; color: #fff; }
.engine-option.disabled .engine-card { opacity: .45; cursor: not-allowed; }
.engine-logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: -.02em; flex-shrink: 0; }
.engine-logo.lg { width: 54px; height: 54px; font-size: 18px; border-radius: 14px; }
.engine-mysql { background: linear-gradient(135deg, #00758f, #f29111); color: #fff; }
.engine-postgres { background: linear-gradient(135deg, #336791, #6aa2d8); color: #fff; }
.prefixed { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: rgba(2,6,15,.55); max-width: 420px; }
.prefixed span { padding: 10px 4px 10px 12px; font-family: var(--mono); color: var(--muted); }
.prefixed input { border: 0; background: transparent; padding-left: 2px; flex: 1; font-family: var(--mono); box-shadow: none; }
.prefixed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.2); }
.create-form .btn { justify-self: start; }

.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 20px; }
.db-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: transform .2s, border-color .2s, box-shadow .2s; display: block; position: relative; overflow: hidden; }
.db-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 120px at 50% -20%, rgba(91,140,255,.14), transparent 70%); opacity: 0; transition: .25s; pointer-events: none; }
.db-card:hover { transform: translateY(-3px); border-color: rgba(91,140,255,.4); box-shadow: 0 20px 40px -20px rgba(0,0,0,.7); }
.db-card:hover::after { opacity: 1; }
.db-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.db-card h3 { font-family: var(--mono); font-size: 15px; word-break: break-all; }
.db-card p { margin: 2px 0 16px; font-size: 13px; }
.db-card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.db-card-meta span { display: flex; flex-direction: column; min-width: 0; }
.db-card-meta small { color: var(--muted); font-size: 11.5px; }
.db-card-meta b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.15), 0 0 12px var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(34,197,94,.05), 0 0 12px var(--ok); } }
.db-card-new { border: 1.5px dashed var(--border-strong); background: transparent; color: var(--muted); font: 600 14px var(--sans); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 180px; }
.db-card-new span { font-size: 30px; font-weight: 300; line-height: 1; }
.db-card-new:hover { color: #fff; }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty-state p { margin: 8px 0 22px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border: 0; }
.timeline li > div { display: flex; flex-direction: column; font-size: 13.5px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--muted); flex-shrink: 0; }
.tl-db\.create { background: var(--ok); }
.tl-db\.delete { background: var(--danger); }
.tl-db\.password, .tl-account\.password { background: var(--warn); }
.tl-login { background: var(--accent); }

/* ---------- Datenbank-Detail ---------- */
.db-head { align-items: center; flex-wrap: wrap; }
.db-title { display: flex; align-items: center; gap: 16px; }
.db-title h1 { font-size: 24px; }
.db-title p { margin: 4px 0 0; }
.head-stats { display: flex; gap: 10px; }
.head-stats > div { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 110px; }
.head-stats small { color: var(--muted); }
.head-stats b { font-size: 18px; }

.celebrate { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px; background: linear-gradient(135deg, rgba(34,197,94,.14), rgba(91,140,255,.1)); border: 1px solid rgba(34,197,94,.35); animation: fadeUp .5s ease; }
.celebrate-icon { font-size: 30px; animation: rocket 1.6s ease-in-out infinite; }
.celebrate p { margin: 2px 0 0; }
@keyframes rocket { 50% { transform: translateY(-5px) rotate(-6deg); } }

.db-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.cred-list { margin: 0 0 18px; display: flex; flex-direction: column; }
.cred-list > div { display: grid; grid-template-columns: 110px 1fr; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cred-list dt { color: var(--muted); font-size: 13px; }
.cred-list dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cred-list code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { background: rgba(148,163,184,.08); border: 1px solid var(--border); color: var(--muted); font: 600 12px var(--sans); padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: .15s; flex-shrink: 0; }
.copy:hover { color: #fff; border-color: var(--border-strong); }
.copy.done { color: #86efac; border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.1); }
.tabs { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tab-bar { display: flex; background: rgba(2,6,15,.4); border-bottom: 1px solid var(--border); }
.tab-bar button { background: none; border: 0; color: var(--muted); padding: 10px 14px; font: 600 12.5px var(--sans); cursor: pointer; border-bottom: 2px solid transparent; }
.tab-bar button.active { color: #fff; border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 12px; align-items: center; gap: 10px; }
.tab-panel.active { display: flex; }
code.block { flex: 1; display: block; padding: 10px 12px; background: rgba(2,6,15,.6); border-radius: 8px; overflow-x: auto; white-space: nowrap; color: #c4d4ff; }
.secret-block { filter: blur(4px); transition: filter .2s; }
.secret-block:hover { filter: none; }
.hint { font-size: 13px; margin: 14px 0 0; }

.tables-card { display: flex; flex-direction: column; }
.table-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 360px; }
.table-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.table-list li:hover { background: rgba(91,140,255,.1); }
.table-list li.muted { cursor: default; }
.table-list li.muted:hover { background: none; }
.table-list .t-name { font-family: var(--mono); display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; }
.table-list .t-name::before { content: "▦"; color: var(--accent); }
.table-list .t-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

.editor-card { padding-bottom: 0; overflow: hidden; }
.editor-actions { display: flex; align-items: center; gap: 12px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: rgba(148,163,184,.08); }
.kbd-hint { font-size: 12px; }
.editor { display: flex; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: #050811; }
.gutter { padding: 14px 10px; text-align: right; color: #4b5568; font: 13.5px/1.6 var(--mono); user-select: none; white-space: pre; background: rgba(148,163,184,.04); border-right: 1px solid var(--border); min-width: 42px; }
.editor textarea { flex: 1; border: 0; border-radius: 0; background: transparent; resize: vertical; min-height: 150px; font: 13.5px/1.6 var(--mono); padding: 14px; color: #dbe5ff; box-shadow: none !important; tab-size: 2; }
.result { margin: 16px -22px 0; border-top: 1px solid var(--border); min-height: 90px; }
.result-empty { padding: 26px 22px; text-align: center; font-size: 13px; }
.result-meta { display: flex; gap: 14px; align-items: center; padding: 10px 22px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--border); background: rgba(2,6,15,.35); }
.result-meta .ok { color: #86efac; font-weight: 650; }
.result-error { margin: 16px 22px; padding: 12px 14px; border-radius: 10px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fecaca; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.result-scroll { overflow: auto; max-height: 460px; }
.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.grid th { position: sticky; top: 0; background: #0d1322; text-align: left; padding: 9px 14px; font-weight: 650; border-bottom: 1px solid var(--border-strong); white-space: nowrap; color: #c3cad8; }
.grid td { padding: 8px 14px; border-bottom: 1px solid var(--border); font-family: var(--mono); white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.grid tr:hover td { background: rgba(91,140,255,.06); }
.grid .null { color: #5b6478; font-style: italic; }
.grid .rownum { color: #4b5568; text-align: right; width: 1%; }

.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-color: rgba(239,68,68,.25); background: linear-gradient(135deg, rgba(239,68,68,.06), var(--card)); }
.danger-zone p { margin: 4px 0 0; }

/* ---------- Konto / Admin ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.node-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: rgba(2,6,15,.35); display: flex; flex-direction: column; gap: 12px; }
.node-head { display: flex; justify-content: space-between; gap: 10px; }
.node-head > div { display: flex; flex-direction: column; min-width: 0; }
.node-state { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 99px; background: rgba(148,163,184,.1); height: fit-content; white-space: nowrap; }
.node-state.on { background: rgba(34,197,94,.14); color: #86efac; }
.node-state.offline { background: rgba(239,68,68,.14); color: #fca5a5; }
.node-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.node-meters small { color: var(--muted); }
.node-meters .bar { margin-top: 5px; }
.node-engines { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; }
.node-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); align-items: center; }
.inline-form input { flex: 1; min-width: 160px; }
.inline-form input[type=number] { flex: 0 0 90px; min-width: 0; }
.check-label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.check-label input { min-width: 0; flex: none; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--border-strong); }
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table a { color: #9db8ff; }
.row-form { display: flex; align-items: center; gap: 22px; }
.num { width: 80px; padding: 6px 10px; }
.switch { position: relative; width: 40px; height: 22px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(148,163,184,.2); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--danger); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,4,10,.7); backdrop-filter: blur(6px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card-solid); border: 1px solid var(--border-strong); border-radius: 18px; padding: 26px; width: 100%; max-width: 440px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.modal h3 { font-size: 18px; }
.modal p { color: var(--muted); margin: 8px 0 16px; }
.modal input { width: 100%; font-family: var(--mono); margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; }
.login-grid { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); }
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 410px; background: rgba(13,19,34,.8); border: 1px solid var(--border-strong); border-radius: 22px; padding: 34px; backdrop-filter: blur(18px); box-shadow: 0 40px 100px -30px rgba(79,140,255,.35); animation: fadeUp .5s ease; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; font-size: 18px; }
.login-brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.login-card h1 { font-size: 24px; }
.login-card > p { margin: 6px 0 22px; }
.login-card .btn { margin-top: 6px; padding: 12px; }
.login-foot { font-size: 12.5px; text-align: center; margin: 22px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .db-layout, .two-col { grid-template-columns: 1fr; }
  .head-stats { width: 100%; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .brand { padding: 0; }
  nav { flex-direction: row; flex-basis: 100%; order: 3; overflow-x: auto; }
  .nav-label { display: none; }
  .sidebar-foot { border: 0; padding: 0; margin-left: auto; }
  .me-text { display: none; }
  .main { padding: 22px 16px 50px; }
  .stats, .engine-pick { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .cred-list > div { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- SSO ---------- */
.btn-sso { background: linear-gradient(135deg, rgba(79,140,255,.22), rgba(168,85,247,.22)); border: 1px solid rgba(124,108,255,.55); padding: 13px; font-size: 14.5px; box-shadow: 0 8px 30px -10px rgba(124,108,255,.6); }
.btn-sso:hover { background: linear-gradient(135deg, rgba(79,140,255,.34), rgba(168,85,247,.34)); }
.btn-sso img { border-radius: 6px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 20px 0 6px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.login-foot a { color: #9db8ff; }
.tl-login\.sso { background: var(--accent-2); }
