:root {
  --bg: #090d14;
  --bg-2: #0d131d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-solid: #111826;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #e7f0ff;
  --muted: #8a98b0;
  --faint: #5d6a80;
  --primary: #1279d1;
  --primary-2: #4aa6ee;
  --grad: linear-gradient(180deg, #4aa6ee, #1279d1);
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --violet: #8b5cf6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --sidebar: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Open Sans", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(18, 121, 209, 0.18), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(139, 92, 246, 0.08), transparent 60%);
}
a { color: var(--primary-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: Consolas, "JetBrains Mono", monospace; font-size: 12.5px; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px; padding: 20px 14px;
  border-right: 1px solid var(--border); background: rgba(9, 13, 20, 0.7); backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 22px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--grad); box-shadow: 0 8px 24px -8px rgba(18, 121, 209, 0.7); overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 600; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: rgba(18, 121, 209, 0.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(74, 166, 238, 0.22); }
.nav a.active svg { color: var(--primary-2); }
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px;
  background: var(--surface-2); color: var(--text);
}
.nav a.active .count { background: var(--primary); }
.sidebar-foot { margin-top: auto; }
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
}
.user-card img { width: 34px; height: 34px; border-radius: 50%; }
.user-card .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-card .sub { font-size: 11.5px; color: var(--muted); }
.user-card a { margin-left: auto; color: var(--muted); display: grid; place-items: center; padding: 6px; border-radius: 8px; }
.user-card a:hover { color: var(--red); background: rgba(239, 68, 68, 0.1); }

.main { flex: 1; min-width: 0; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.topbar h1 { font-size: 24px; }
.topbar .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.topbar .spacer { flex: 1; }
.btn.menu-btn { display: none; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15); }
.dot.off { background: var(--red); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }

.stat { position: relative; overflow: hidden; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .icon {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(74, 166, 238, 0.12); color: var(--primary-2);
}
.stat .value { font-size: 30px; font-weight: 800; margin-top: 12px; letter-spacing: -0.02em; }
.stat .hint { color: var(--faint); font-size: 12px; }
.stat.green .icon { background: rgba(34, 197, 94, 0.12); color: var(--green); }
.stat.amber .icon { background: rgba(245, 158, 11, 0.12); color: var(--amber); }
.stat.violet .icon { background: rgba(139, 92, 246, 0.14); color: #a78bfa; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; color: var(--text);
  transition: transform 0.08s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: rgba(74, 166, 238, 0.5); color: #fff; box-shadow: 0 8px 24px -10px rgba(18, 121, 209, 0.9); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.btn.danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.icon-only { width: 34px; padding: 0; }
.btn.discord { background: #5865f2; border-color: #6d78f5; color: #fff; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label-row { font-size: 12.5px; font-weight: 600; color: #c6d2e6; }
.field .help { font-size: 12px; color: var(--faint); }
.input, .select, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 11px; background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-strong); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(74, 166, 238, 0.18); }
.select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a98b0' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--surface-solid); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.color-input { display: flex; gap: 8px; }
.color-input input[type=color] {
  width: 40px; height: 40px; padding: 3px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.25); cursor: pointer; flex: none;
}
.color-input input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type=color]::-webkit-color-swatch { border: none; border-radius: 8px; }

.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.toggle-row:first-child { padding-top: 0; }
.toggle-row .txt { flex: 1; }
.toggle-row .txt b { display: block; font-weight: 600; }
.toggle-row .txt span { color: var(--muted); font-size: 12.5px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.12); cursor: pointer; transition: background 0.2s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.2s; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }

/* role picker */
.picker { position: relative; }
.picker-box {
  min-height: 40px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 8px;
  border-radius: 11px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-strong); cursor: text;
}
.picker.open .picker-box { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(74, 166, 238, 0.18); }
.picker-box input { flex: 1; min-width: 90px; border: none; background: none; outline: none; height: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 9px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.chip button { border: none; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; line-height: 1; font-size: 15px; }
.chip button:hover { color: var(--red); }
.picker-menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 240px; overflow: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow);
}
.picker-menu div { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.picker-menu div:hover, .picker-menu div.hl { background: var(--surface-2); }
.picker-menu div i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.picker-menu .empty { color: var(--faint); cursor: default; }

/* ---------- tables / lists ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); padding: 10px 20px; border-bottom: 1px solid var(--border);
}
td { padding: 13px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell img { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--surface-2); }
.user-cell b { font-weight: 600; display: block; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-cell small { color: var(--faint); font-size: 11.5px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px;
  font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; }
.badge.green { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.25); color: #86efac; }
.badge.red { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.badge.amber { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; }
.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); }
.tabs button {
  border: none; background: none; padding: 6px 14px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs button.active { background: var(--surface-2); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; color: var(--muted); font-size: 12.5px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .ico {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
}
.empty-state b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- chart ---------- */
.chart { height: 200px; display: flex; align-items: flex-end; gap: 8px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart .bar { width: 44%; max-width: 14px; border-radius: 5px 5px 2px 2px; min-height: 3px; transition: height 0.5s cubic-bezier(.2, .8, .2, 1); position: relative; }
.chart .bar.o { background: var(--grad); }
.chart .bar.c { background: rgba(255, 255, 255, 0.16); }
.chart .col span { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.chart .col:hover .bar.o { filter: brightness(1.2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

.progress { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress div { height: 100%; border-radius: 99px; }

/* ---------- panels ---------- */
.panel-card { position: relative; overflow: hidden; cursor: pointer; transition: transform 0.15s, border-color 0.15s; display: flex; flex-direction: column; gap: 14px; }
.panel-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.panel-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent, var(--primary)); }
.panel-card .glow { position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: var(--accent); opacity: 0.08; filter: blur(30px); }
.panel-card .row { display: flex; align-items: center; gap: 12px; }
.panel-card .emoji-box {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 21px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.panel-card h3 { font-size: 16px; }
.panel-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel-meta div { background: rgba(0, 0, 0, 0.2); border-radius: 11px; padding: 9px 12px; }
.panel-meta span { display: block; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.panel-meta b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.panel-card.new { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); min-height: 200px; background: transparent; }
.panel-card.new::before { display: none; }
.panel-card.new:hover { color: var(--text); border-color: var(--primary-2); }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; }
.editor-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-title .num {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: rgba(74, 166, 238, 0.14); color: var(--primary-2);
}
.section-title h3 { font-size: 15px; }
.section-title p { margin: 0; color: var(--muted); font-size: 12.5px; }
.question {
  display: grid; grid-template-columns: 1fr 1fr 120px auto auto; gap: 10px; align-items: center;
  padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border); margin-bottom: 10px;
}
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--primary); width: 15px; height: 15px; }
.savebar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 22px; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 12px 18px; border-radius: 16px; background: rgba(17, 24, 38, 0.9); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.savebar .spacer { flex: 1; }
.savebar .state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* discord preview */
.dc { background: #313338; border-radius: 14px; padding: 16px; font-family: "gg sans", "Open Sans", sans-serif; color: #dbdee1; }
.dc-msg { display: flex; gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #5865f2; object-fit: cover; }
.dc-name { font-weight: 600; color: #f2f3f5; font-size: 15px; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: 5px; vertical-align: 2px; }
.dc-time { color: #949ba4; font-size: 12px; margin-left: 6px; }
.dc-embed { margin-top: 6px; background: #2b2d31; border-left: 4px solid; border-radius: 4px; padding: 10px 14px 14px; max-width: 100%; }
.dc-embed-title { font-weight: 700; color: #f2f3f5; font-size: 15px; margin-bottom: 6px; }
.dc-embed-desc { font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.dc-embed img { max-width: 100%; border-radius: 4px; margin-top: 10px; }
.dc-embed-foot { font-size: 12px; color: #949ba4; margin-top: 10px; }
.dc-field { margin-top: 8px; }
.dc-field b { display: block; color: #f2f3f5; font-size: 13.5px; }
.dc-buttons { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #fff; }
.dc-btn.primary { background: #5865f2; } .dc-btn.secondary { background: #4e5058; } .dc-btn.success { background: #248046; } .dc-btn.danger { background: #da373c; }
.dc-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }

/* ---------- drawer / modal / toast ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 10, 0.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.15s;
}
.modal {
  width: 100%; max-width: 440px; background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 24px; box-shadow: var(--shadow); animation: pop 0.18s cubic-bezier(.2, .9, .3, 1.2);
}
.modal h3 { font-size: 17px; margin-bottom: 6px; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal .actions { margin-top: 20px; }
.drawer-overlay { justify-content: flex-end; padding: 0; }
.drawer {
  width: min(980px, 100%); height: 100%; background: var(--bg-2); border-left: 1px solid var(--border-strong);
  display: flex; flex-direction: column; animation: slide 0.22s cubic-bezier(.2, .8, .2, 1);
}
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 16px; }
.drawer-head .spacer { flex: 1; }
.drawer-meta { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-meta div { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 7px 12px; }
.drawer-meta span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.drawer-meta b { font-weight: 600; font-size: 13px; }
.drawer iframe { flex: 1; border: none; width: 100%; background: var(--bg); }
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-weight: 600;
  animation: pop 0.2s;
}
.toast.ok svg { color: var(--green); } .toast.err svg { color: var(--red); }
.banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; margin-bottom: 22px;
  background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.3);
}
.banner .grow { flex: 1; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.page { animation: fade 0.25s; }

/* ---------- login ---------- */
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login {
  width: 100%; max-width: 410px; text-align: center; padding: 38px 34px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--border); backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.login .brand-logo { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 20px; }
.login h1 { font-size: 24px; margin-bottom: 6px; }
.login p { color: var(--muted); margin: 0 0 26px; }
.login .btn { width: 100%; height: 46px; font-size: 14.5px; border-radius: 14px; }
.login .note { margin-top: 20px; font-size: 12px; color: var(--faint); display: flex; align-items: center; justify-content: center; gap: 6px; }
.alert { padding: 11px 14px; border-radius: 12px; margin-bottom: 20px; font-size: 13px; text-align: left; display: flex; gap: 10px; align-items: flex-start; }
.alert.err { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fecaca; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .grid-main, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 50; left: 0; transform: translateX(-100%); transition: transform 0.2s; background: var(--bg-2); }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .main { padding: 18px 16px 50px; }
  .btn.menu-btn { display: inline-flex; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .question { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .topbar h1 { font-size: 20px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat .value { font-size: 24px; }
}
