/* ==========================================================================
   NoctisOne — AI Platform dashboard design system
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand greens */
  --brand-900: #06140d;
  --brand-800: #0a1f15;
  --brand-700: #0d2a1c;
  --green-700: #0f6b4f;
  --green-600: #15795a;
  --green-500: #1b8f6c;
  --green-400: #34b27f;
  --emerald: #10b981;

  /* Surfaces */
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --border: #e7ebe9;
  --border-strong: #d8dedb;

  /* Text */
  --ink: #0e1a14;
  --ink-2: #38473f;
  --muted: #6c7a72;
  --muted-2: #95a19a;

  /* Status */
  --ok-bg: #e6f5ee;   --ok-fg: #14794f;
  --warn-bg: #fbf2dd; --warn-fg: #9a6b18;
  --info-bg: #e8f0fb; --info-fg: #2c5aa8;
  --purple-bg:#efe9fb; --purple-fg:#6f51c9;
  --red-bg:#fae9e9;   --red-fg:#b3403a;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(13, 31, 22, .05);
  --shadow: 0 6px 22px rgba(13, 31, 22, .06);
  --shadow-lg: 0 18px 48px rgba(13, 31, 22, .12);
  --sidebar-w: 274px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6,.font-display { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ===== App shell ========================================================= */
.app { display: flex; min-height: 100vh; }

.content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
.content.no-sidebar { margin-left: 0; }

/* ===== Sidebar =========================================================== */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0b2016 0%, #081710 100%);
  color: #cfdcd5;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 50;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(155deg, #2fd497 0%, #0e9e6e 55%, #0b7d57 100%);
  display: grid; place-items: center; color: #06241a;
  box-shadow: 0 6px 16px rgba(16,185,129,.3);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-family:'Plus Jakarta Sans'; font-weight: 800; font-size: 19px; color: #fff; letter-spacing:-.2px; line-height:1; }
.brand-sub { font-size: 10px; letter-spacing: 2px; color: #6f8a7d; font-weight: 600; margin-top:3px; }

/* workspace switcher */
.ws-switch {
  display:flex; align-items:center; gap:10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px; padding: 9px 11px; margin-bottom: 14px; cursor: pointer;
}
.ws-switch .ws-avatar {
  width: 28px; height: 28px; border-radius: 8px; flex:none;
  background: linear-gradient(155deg,#2fd497,#0b7d57); color:#06241a;
  display:grid; place-items:center; font-weight:700; font-size:13px;
}
.ws-switch .ws-name { font-weight:700; color:#eef4f1; font-size:13.5px; line-height:1.1; }
.ws-switch .ws-meta { font-size:11px; color:#6f8a7d; }
.ws-switch .chev { margin-left:auto; color:#6f8a7d; }

.nav-section { font-size: 10.5px; letter-spacing: 1.6px; color: #5d7568; font-weight: 700; padding: 14px 12px 6px; }
.nav { display:flex; flex-direction:column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: #b4c5bc; font-weight: 500; font-size: 14px;
  transition: background .14s, color .14s;
}
.nav-link svg { width: 18px; height: 18px; flex:none; opacity:.92; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #eaf2ee; }
.nav-link.active { background: rgba(33,184,124,.16); color: #fff; }
.nav-link.active svg { color: #2fd497; opacity:1; }
.nav-link .count { margin-left:auto; font-size:12px; color:#8aa093; background:rgba(255,255,255,.06); border-radius:20px; padding:1px 8px; }
.nav-link.disabled { color:#5e7165; cursor:default; }
.nav-link.disabled:hover { background:transparent; color:#5e7165; }
.nav-badge { margin-left:auto; font-size:9px; letter-spacing:1px; font-weight:700; color:#7d9488; border:1px solid rgba(255,255,255,.12); border-radius:6px; padding:2px 6px; }

.sidebar-footer { margin-top:auto; padding-top:12px; border-top:1px solid rgba(255,255,255,.07); display:flex; align-items:center; gap:11px; }
.sf-avatar { width:34px;height:34px;border-radius:10px;background:#13301f;border:1px solid rgba(255,255,255,.08); color:#9fe9c6; display:grid;place-items:center;font-weight:700;font-size:13px;flex:none;}
.sf-name { font-weight:700;color:#eef4f1;font-size:13.5px;line-height:1.15;}
.sf-role { font-size:11.5px;color:#6f8a7d;}
.sf-logout { margin-left:auto;color:#7d9488;display:grid;place-items:center;padding:6px;border-radius:8px;}
.sf-logout:hover { color:#fff; background:rgba(255,255,255,.06); }
.logout-btn { margin-top:12px; display:flex; align-items:center; justify-content:center; gap:8px; padding:10px 12px; border-radius:10px; font-size:13.5px; font-weight:700; color:#ffb4b4; background:rgba(220,68,68,.10); border:1px solid rgba(220,68,68,.28); text-decoration:none; transition:background .15s,color .15s; }
.logout-btn svg { width:18px; height:18px; flex:none; }
.logout-btn:hover { background:rgba(220,68,68,.20); color:#fff; }

/* ===== Topbar ============================================================ */
.topbar {
  height: 68px; display:flex; align-items:center; gap:16px;
  padding: 0 30px; background: var(--bg);
  position: sticky; top:0; z-index: 30;
}
.topbar-title { font-weight: 600; font-size: 15px; color: var(--ink-2); }
.topbar-spacer { flex:1; }
.searchbox {
  display:flex; align-items:center; gap:10px;
  background: var(--surface); border:1px solid var(--border);
  border-radius: 11px; padding: 8px 12px; width: 320px; color: var(--muted);
}
.searchbox input { border:0; outline:0; background:transparent; flex:1; font-size:14px; color:var(--ink); }
.searchbox .kbd { font-size:11px; color:var(--muted-2); border:1px solid var(--border); border-radius:6px; padding:1px 6px; }
.icon-btn {
  width:42px; height:42px; border-radius:11px; border:1px solid var(--border);
  background: var(--surface); display:grid; place-items:center; color:var(--ink-2); cursor:pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* ===== Page ============================================================== */
.page { padding: 8px 30px 48px; }
.page-head { display:flex; align-items:flex-start; gap:18px; margin-bottom: 22px; }
.page-head .grow { flex:1; min-width:0; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing:-.6px; margin:0; }
.page-sub { color: var(--muted); margin: 7px 0 0; font-size: 14.5px; max-width: 70ch; }
.page-actions { display:flex; gap:10px; flex:none; }

/* breadcrumb */
.crumbs { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:13.5px; font-weight:500; margin-bottom:2px; }
.crumbs .sep { color:var(--muted-2); }
.crumbs .now { color:var(--ink); font-weight:700; }

/* ===== Buttons =========================================================== */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border-radius: 11px; border:1px solid transparent; cursor:pointer;
  font-family:'Plus Jakarta Sans'; font-weight: 600; font-size: 14px;
  padding: 11px 18px; transition: filter .14s, background .14s, border-color .14s;
  white-space:nowrap;
}
.btn svg { width:17px; height:17px; }
.btn-primary { background: var(--green-600); color:#fff; box-shadow: 0 6px 16px rgba(21,121,90,.22); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-dark { background:#0e1a14; color:#fff; }
.btn-sm { padding: 7px 12px; font-size:13px; border-radius:9px; }
.btn-block { width:100%; }
.btn-link { background:transparent; color: var(--green-600); padding:0; font-weight:700; }

/* ===== Cards ============================================================= */
.card { display:block; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
/* Defensive override so Bootstrap's .btn-primary blue never beats the brand green */
.btn.btn-primary { background: var(--green-600); border-color: var(--green-600); color:#fff; }
.card-pad { padding: 22px; }
.grid { display:grid; gap: 18px; }

/* KPI / stat cards */
.stats { display:grid; grid-template-columns: repeat(4,1fr); gap:18px; margin-bottom: 22px; }
.stat { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.stat .label { font-size: 11.5px; letter-spacing:.6px; font-weight:700; color: var(--muted); text-transform:uppercase; }
.stat .value { font-size: 34px; font-weight: 800; letter-spacing:-1px; margin-top: 10px; font-family:'Plus Jakarta Sans'; }
.stat .value.sm { font-size: 26px; }

/* ===== Badges / pills ==================================================== */
.badge {
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; font-weight:600; padding: 3px 10px; border-radius:20px; line-height:1.4;
}
.badge .dot { width:6px; height:6px; border-radius:50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-info { background: var(--info-bg); color: var(--info-fg); }
.badge-purple { background: var(--purple-bg); color: var(--purple-fg); }
.badge-red { background: var(--red-bg); color: var(--red-fg); }
.badge-muted { background: #eef1ef; color: var(--muted); }
.badge-soft { background: var(--surface-2); color: var(--ink-2); border:1px solid var(--border); font-weight:600; }
.chip { display:inline-flex; align-items:center; padding:4px 11px; border-radius:8px; font-size:12.5px; font-weight:600; background:var(--surface-2); border:1px solid var(--border); color:var(--ink-2); }

/* ===== Tables ============================================================ */
.tbl-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); overflow:hidden; }
.tbl-head { display:flex; align-items:flex-start; gap:14px; padding: 20px 22px; }
.tbl-head .ic { width:42px;height:42px;border-radius:12px;background:var(--ok-bg);color:var(--green-600);display:grid;place-items:center;flex:none;}
.tbl-head h3 { margin:0; font-size:17px; font-weight:700; }
.tbl-head p { margin:3px 0 0; color:var(--muted); font-size:13.5px; }
.tbl-head .right { margin-left:auto; }

table.tbl { width:100%; border-collapse: collapse; }
table.tbl thead th {
  text-align:left; font-size:11.5px; letter-spacing:.5px; text-transform:uppercase;
  color:var(--muted); font-weight:700; padding: 12px 22px; border-top:1px solid var(--border); border-bottom:1px solid var(--border);
  background: var(--surface-2);
}
table.tbl tbody td { padding: 16px 22px; border-bottom:1px solid var(--border); vertical-align:middle; font-size:14px; }
table.tbl tbody tr:last-child td { border-bottom:0; }
table.tbl tbody tr:hover { background: var(--surface-2); }
.cell-main { font-weight:700; color:var(--ink); }
.cell-sub { color:var(--muted); font-size:13px; margin-top:2px; }
.cell-flex { display:flex; align-items:center; gap:12px; color:inherit; text-decoration:none; }
a.cell-flex:hover .cell-main { text-decoration:underline; }
.row-avatar { width:38px;height:38px;border-radius:11px;flex:none;display:grid;place-items:center;font-weight:700;color:#fff;background:linear-gradient(155deg,#1fae7c,#0b7d57);}

.row-actions { display:flex; gap:8px; justify-content:flex-end; }
.act { width:36px;height:36px;border-radius:9px;border:1px solid var(--border);background:var(--surface);display:grid;place-items:center;color:var(--muted);cursor:pointer;}
.act:hover { background:var(--surface-2); color:var(--ink); }

/* segmented control */
.segment { display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:11px; padding:3px; gap:2px; }
.segment a { padding:6px 16px; border-radius:8px; font-size:13.5px; font-weight:600; color:var(--muted); }
.segment a.active { background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm); }

/* ===== Forms ============================================================= */
.field { margin-bottom: 16px; }
.field label, .lbl { display:block; font-size:13px; font-weight:600; color:var(--ink-2); margin-bottom:7px; }
.lbl .hint { color:var(--muted-2); font-weight:500; margin-left:8px; }
.req { color:var(--green-600); }
.input, .select, .textarea {
  width:100%; background:var(--surface); border:1px solid var(--border-strong);
  border-radius:11px; padding: 11px 13px; font-size:14px; color:var(--ink); font-family:inherit; outline:none;
  transition: border-color .14s, box-shadow .14s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--green-400); box-shadow: 0 0 0 3px rgba(33,184,124,.14); }
.textarea { min-height: 84px; resize: vertical; line-height:1.5; }
.input-group { display:flex; align-items:stretch; }
.input-group .prefix { display:grid; place-items:center; padding:0 12px; background:var(--surface-2); border:1px solid var(--border-strong); border-right:0; border-radius:11px 0 0 11px; color:var(--muted); font-size:13px; }
.input-group .input { border-radius:0 11px 11px 0; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap: 0 26px; }

/* color input */
.color-field { display:flex; align-items:center; gap:10px; border:1px solid var(--border-strong); border-radius:11px; padding:6px 10px; }
.color-swatch { width:30px;height:30px;border-radius:8px;flex:none;padding:0;border:1px solid var(--border-strong);cursor:pointer;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none; }
.color-swatch::-webkit-color-swatch-wrapper { padding:0; }
.color-swatch::-webkit-color-swatch { border:0;border-radius:7px; }
.color-swatch::-moz-color-swatch { border:0;border-radius:7px; }
.color-field input[type=text], .color-field input:not(.color-swatch) { border:0; outline:0; flex:1; font-family:'JetBrains Mono'; font-size:13px; }

/* toggle */
.switch { position:relative; display:inline-block; width:42px; height:24px; }
.switch input { opacity:0; width:0; height:0; }
.slider { position:absolute; inset:0; background:#cfd6d2; border-radius:20px; transition:.18s; cursor:pointer; }
.slider:before { content:""; position:absolute; height:18px; width:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.18s; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--green-500); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* section header within form card */
.sec-head { display:flex; align-items:center; gap:11px; margin: 26px 0 16px; }
.sec-head:first-child { margin-top: 4px; }
.sec-num { width:24px;height:24px;border-radius:7px;background:var(--ok-bg);color:var(--green-600);display:grid;place-items:center;font-size:12.5px;font-weight:700;flex:none;}
.sec-head h4 { margin:0;font-size:15px;font-weight:700; }
.sec-line { flex:1; height:1px; background:var(--border); }

/* ===== Tabs (chatbot editor) ============================================ */
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--border); margin: 8px 0 22px; overflow-x:auto; }
.tab {
  display:inline-flex; align-items:center; gap:8px; padding: 11px 14px;
  font-size:14px; font-weight:600; color:var(--muted); white-space:nowrap;
  border-bottom:2px solid transparent; margin-bottom:-1px;
}
.tab svg { width:16px; height:16px; }
.tab:hover { color:var(--ink); }
.tab.active { color:var(--green-600); border-bottom-color: var(--green-600); }

/* editor header */
.ed-head { display:flex; align-items:center; gap:14px; margin: 14px 0 6px; }
.ed-avatar { width:46px;height:46px;border-radius:13px;display:grid;place-items:center;color:#fff;font-weight:700;font-size:18px;background:linear-gradient(155deg,#1fae7c,#0b7d57);flex:none;}
.ed-title { font-size:24px;font-weight:800;letter-spacing:-.4px;display:flex;align-items:center;gap:12px; }
.ed-meta { color:var(--muted); font-size:13px; margin-top:3px; display:flex; gap:8px; align-items:center; }
.ed-meta .mono { color:var(--ink-2); }
.ed-actions { margin-left:auto; display:flex; gap:10px; }
.back-link { display:inline-flex; align-items:center; gap:7px; color:var(--muted); font-weight:600; font-size:13.5px; margin-bottom:12px; }
.back-link:hover { color:var(--ink); }

/* ===== Chat widget preview ============================================== */
.preview-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); overflow:hidden; }
.preview-head { display:flex; align-items:center; gap:11px; padding:16px 18px; border-bottom:1px solid var(--border); }
.preview-head .ic { width:34px;height:34px;border-radius:9px;background:var(--ok-bg);color:var(--green-600);display:grid;place-items:center;flex:none; }
.preview-head h4 { margin:0;font-size:14.5px;font-weight:700; }
.preview-head p { margin:2px 0 0;font-size:12.5px;color:var(--muted); }

.widget { border-radius:16px; overflow:hidden; border:1px solid var(--border); margin:18px; box-shadow:var(--shadow); }
.widget-top { background: var(--green-600); color:#fff; padding:14px 16px; display:flex; align-items:center; gap:11px; }
.widget-top .wa { width:34px;height:34px;border-radius:9px;background:rgba(255,255,255,.18);display:grid;place-items:center;font-weight:700;flex:none;}
.widget-top .wn { font-weight:700;font-size:15px;line-height:1.1; }
.widget-top .ws-on { font-size:12px;opacity:.85;display:flex;align-items:center;gap:6px;margin-top:2px;}
.widget-top .ws-on:before{content:"";width:7px;height:7px;border-radius:50%;background:#7ef0b8;}
.widget-body { background:#fbfcfb; padding:16px; display:flex; flex-direction:column; gap:11px; }
.bubble { max-width:82%; padding:11px 14px; border-radius:14px; font-size:13.5px; line-height:1.45; }
.bubble.bot { background:#fff; border:1px solid var(--border); border-bottom-left-radius:5px; align-self:flex-start; }
.bubble.user { background: var(--green-600); color:#fff; border-bottom-right-radius:5px; align-self:flex-end; }
.qr-row { display:flex; flex-wrap:wrap; gap:8px; }
.qr { padding:8px 13px; border:1px solid var(--border-strong); border-radius:20px; font-size:12.5px; font-weight:600; color:var(--ink-2); background:#fff; }
.widget-input { display:flex; align-items:center; gap:10px; background:#fff; border:1px solid var(--border); border-radius:12px; padding:10px 12px; margin-top:4px; }
.widget-input span { flex:1; color:var(--muted-2); font-size:13px; }
.widget-input .send { width:30px;height:30px;border-radius:8px;background:var(--green-600);color:#fff;display:grid;place-items:center;flex:none;}

/* ===== Notes / callouts ================================================= */
.note { display:flex; gap:11px; padding:14px 16px; border-radius:13px; font-size:13.5px; line-height:1.5; }
.note svg { width:18px; height:18px; flex:none; margin-top:1px; }
.note-green { background: #eaf6f0; color:#16604a; }
.note-blue { background: var(--info-bg); color:#274f8f; }
.note-amber { background: var(--warn-bg); color:#7d5912; }
.note b { font-weight:700; }

/* code block */
.code {
  background:#0a1712; color:#cfe6da; border-radius:14px; padding:18px 20px;
  font-family:'JetBrains Mono'; font-size:13px; line-height:1.6; position:relative; overflow:auto;
}
.code .cmt { color:#5f7d6e; }
.code .tag { color:#7ed3a8; }
.code .attr { color:#9ecbff; }
.code .str { color:#e3c08a; }
.code-copy { position:absolute; top:12px; right:12px; background:rgba(255,255,255,.08); color:#cfe6da; border:0; border-radius:8px; padding:6px 11px; font-size:12px; font-weight:600; cursor:pointer; display:flex; gap:6px; align-items:center; }

/* two-column editor layout */
.split { display:grid; grid-template-columns: 1fr 360px; gap:22px; align-items:start; }
.split-wide { grid-template-columns: 1fr 420px; }

/* drag handle */
.drag { color:var(--muted-2); cursor:grab; display:grid; place-items:center; }

/* misc */
.muted { color:var(--muted); }
.right { margin-left:auto; }
.flex { display:flex; align-items:center; gap:10px; }
.flex-col { display:flex; flex-direction:column; }
.gap-sm { gap:8px; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:16px}
.text-mono{font-family:'JetBrains Mono';font-size:13px;color:var(--ink-2);}
.divider{height:1px;background:var(--border);margin:18px 0;}

/* flash messages */
.flash-wrap{position:fixed;top:16px;right:16px;z-index:200;display:flex;flex-direction:column;gap:8px;max-width:380px;}
.flash{padding:12px 16px;border-radius:12px;font-size:14px;box-shadow:var(--shadow);display:flex;gap:10px;align-items:center;}
.flash-success{background:var(--ok-bg);color:var(--ok-fg);}
.flash-danger,.flash-warning{background:var(--warn-bg);color:var(--warn-fg);}
.flash-info{background:var(--info-bg);color:var(--info-fg);}

/* ===== Login ============================================================= */
.auth { display:grid; grid-template-columns: 1fr 1fr; min-height:100vh; }
.auth-left {
  position:relative; overflow:hidden; color:#dfeee7; padding:46px;
  background: radial-gradient(120% 90% at 0% 0%, #0f2e1f 0%, #0a1f15 45%, #07150e 100%);
  display:flex; flex-direction:column;
}
.auth-left .grid-bg { position:absolute; inset:0; opacity:.5;
  background-image:linear-gradient(rgba(120,180,150,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(120,180,150,.06) 1px,transparent 1px);
  background-size:46px 46px; }
.auth-left .inner { position:relative; z-index:1; display:flex; flex-direction:column; height:100%; }
.auth-eyebrow { color:#3fce99; letter-spacing:2px; font-size:12px; font-weight:700; text-transform:uppercase; }
.auth-h1 { font-size:46px; font-weight:800; line-height:1.05; letter-spacing:-1.2px; color:#fff; margin:14px 0 18px; }
.auth-p { color:#9fb6ab; font-size:16px; max-width:46ch; }
.auth-feats { display:flex; gap:30px; margin-top:auto; }
.auth-feat h5 { font-family:'Plus Jakarta Sans'; font-size:19px; margin:0 0 4px; color:#fff; font-weight:700; }
.auth-feat p { margin:0; font-size:12.5px; color:#7d9488; }

.auth-cards { position:absolute; right:-30px; bottom:120px; display:flex; flex-direction:column; gap:12px; z-index:1; }
.mini-card { display:flex; align-items:center; gap:12px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:13px 16px; width:330px; backdrop-filter:blur(4px); }
.mini-card .mi { width:38px;height:38px;border-radius:10px;background:rgba(33,184,124,.18);color:#5fe0a8;display:grid;place-items:center;flex:none;}
.mini-card .mt { font-weight:700;color:#fff;font-size:14px; }
.mini-card .ms { font-size:12px;color:#7d9488; }
.mini-card .live { margin-left:auto; font-size:10px; font-weight:700; letter-spacing:1px; color:#5fe0a8; border:1px solid rgba(95,224,168,.35); border-radius:6px; padding:2px 7px; }

.auth-right { display:flex; align-items:center; justify-content:center; padding:46px; background:#fff; }
.auth-form { width:100%; max-width:380px; }
.auth-form h2 { font-size:32px; font-weight:800; margin:0 0 6px; letter-spacing:-.5px; }
.auth-form .sub { color:var(--muted); margin:0 0 28px; }
.auth-row { display:flex; align-items:center; justify-content:space-between; margin:14px 0 18px; }
.check { display:flex; align-items:center; gap:9px; font-size:13.5px; color:var(--ink-2); cursor:pointer; }
.check input { width:18px;height:18px;accent-color:var(--green-600); }
.invite { display:flex; gap:11px; margin-top:18px; padding:14px 16px; background:var(--surface-2); border:1px solid var(--border); border-radius:13px; font-size:13px; color:var(--muted); }
.invite svg { color:var(--green-600); flex:none; }

/* modal */
.modal-backdrop { position:fixed; inset:0; background:rgba(8,16,12,.55); backdrop-filter:blur(2px); z-index:1000; display:none; align-items:flex-start; justify-content:center; padding:64px 16px; overflow-y:auto; }
.modal-backdrop.open { display:flex; }
/* Override Bootstrap's `.modal { display:none; position:fixed; ... }` which
   would otherwise keep our custom modal box hidden inside the open backdrop. */
.modal-backdrop .modal { display:block; position:relative; top:auto; left:auto; height:auto; overflow:visible; padding:0; pointer-events:auto; background:var(--surface); border:1px solid var(--border); border-radius:16px; width:100%; max-width:560px; box-shadow:0 24px 60px rgba(0,0,0,.25); animation:modal-in .14s ease-out; }
@keyframes modal-in { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border); }
.modal-head h3 { margin:0; font-size:17px; font-weight:800; }
.modal-x { background:none; border:0; cursor:pointer; color:var(--muted); font-size:22px; line-height:1; padding:0 4px; }
.modal-x:hover { color:var(--ink); }
.modal-body { padding:22px; }
.modal-foot { display:flex; justify-content:flex-end; gap:10px; padding:16px 22px; border-top:1px solid var(--border); }
.check-inline { display:flex; align-items:center; gap:9px; font-size:13.5px; color:var(--ink-2); cursor:pointer; font-weight:600; }
.check-inline input { width:17px; height:17px; accent-color:var(--green-600); }

/* test panel */
.test-chunk { border:1px solid var(--border); border-radius:11px; padding:12px 14px; margin-top:10px; background:var(--surface-2); }
.test-chunk .tc-head { display:flex; gap:8px; align-items:center; margin-bottom:6px; font-size:12px; }
.test-chunk .tc-body { font-size:13px; color:var(--ink-2); line-height:1.5; white-space:pre-wrap; }
.test-answer { border:1px solid var(--green-400); background:rgba(33,184,124,.07); border-radius:12px; padding:14px 16px; line-height:1.55; white-space:pre-wrap; }

/* responsive */
@media (max-width: 1100px){ .split{grid-template-columns:1fr;} .stats{grid-template-columns:repeat(2,1fr);} .auth{grid-template-columns:1fr;} .auth-left{display:none;} }
@media (max-width: 720px){ .form-grid{grid-template-columns:1fr;} .stats{grid-template-columns:1fr;} .sidebar{display:none;} .content{margin-left:0;} }
