:root {
  --bg: #0b1220;
  --bg-card: #121c2e;
  --bg-sidebar: #0e1628;
  --border: #1e2d45;
  --text: #e8eef7;
  --muted: #8fa3bf;
  --accent: #7c6cff;
  --accent-dim: #5b4fd6;
  --accent2: #00c9a7;
  --danger: #ff6b6b;
  --success: #34d399;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }
button, .btn { border: none; border-radius: 8px; padding: 0.6rem 1rem; font-size: 0.9rem; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #fff; font-weight: 600; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: rgba(255,107,107,0.15); color: var(--danger); border: 1px solid rgba(255,107,107,0.35); }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 0.65rem 0.85rem; font-size: 0.95rem; }
textarea { min-height: 100px; resize: vertical; font-family: inherit; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: radial-gradient(circle at 20% 20%, rgba(124,108,255,0.1), transparent 40%), var(--bg); }
.auth-card { width: min(420px,100%); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.brand-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; font-weight: 800; color: #fff; }
.brand h1 { font-size: 1.35rem; }
.brand p { color: var(--muted); font-size: 0.85rem; }
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.35); color: #ffb4b4; }
.alert-success { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.35); color: #a7f3d0; }
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-sidebar); border-right: 1px solid var(--border); padding: 1.25rem; display: flex; flex-direction: column; }
.nav { list-style: none; flex: 1; }
.nav li { margin-bottom: 0.35rem; }
.nav button { width: 100%; text-align: left; background: transparent; color: var(--muted); padding: 0.75rem 0.9rem; border-radius: 8px; border: 1px solid transparent; }
.nav button.active, .nav button:hover { background: rgba(124,108,255,0.12); color: var(--text); border-color: rgba(124,108,255,0.3); }
.main { padding: 1.5rem 2rem; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.stat-card .label { color: var(--muted); font-size: 0.8rem; }
.stat-card .value { font-size: 1.4rem; font-weight: 700; margin-top: 0.25rem; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 0.5rem; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-on { background: rgba(52,211,153,0.15); color: #6ee7b7; }
.badge-off { background: rgba(255,107,107,0.15); color: #fca5a5; }
.toggle-row { display: flex; align-items: center; gap: 0.75rem; }
.toggle { width: 48px; height: 26px; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; border: none; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ''; width: 20px; height: 20px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: 0.15s; }
.toggle.on::after { left: 25px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.mono { font-family: ui-monospace, monospace; font-size: 0.8rem; word-break: break-all; }
.empty { color: var(--muted); text-align: center; padding: 2rem; }
.session-picker { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.session-picker label { font-size: 0.75rem; margin-bottom: 0.4rem; }
.session-label { font-size: 0.85rem; color: var(--accent); font-weight: 500; margin-left: 0.35rem; }
.badge-ready { background: rgba(52,211,153,0.15); color: #6ee7b7; }
.badge-warn { background: rgba(251,191,36,0.15); color: #fcd34d; }
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; }
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; } }
