/* =========================================================
   Educa UI — v3.0 (Full Renovation)
   Premium, consistent layouts for PHP modules (XAMPP-ready)
   ========================================================= */

/* ---------------- Overhoren (O2–O5 UX) ---------------- */
.oh-progress{height:8px;border-radius:999px;background:rgba(17,24,39,.08);overflow:hidden;margin:10px 0 8px;}
.oh-progress-bar{height:100%;background:rgba(37,99,235,.75);border-radius:999px;transition:width .25s ease;}
.oh-quiz-meta{display:flex;gap:12px;align-items:center;margin-bottom:10px;}
.oh-actions-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:10px;}

/* --------------------------- Tokens --------------------------- */
:root{
  --bg:#f6f8fc;
  --bg2:#eef2ff;
  --card:#ffffff;
  --text:#0f172a;
  --text2:#1f2937;
  --muted:#64748b;
  --line:#e2e8f0;
  --line2:#cbd5e1;

  --brand:#2563eb;
  --brand2:#1d4ed8;
  --brandSoft:rgba(37,99,235,.12);

  --good:#16a34a;
  --warn:#d97706;
  --bad:#dc2626;

  --shadow-sm:0 1px 3px rgba(2,6,23,.05);
  --shadow:0 8px 24px rgba(2,6,23,.08);
  --shadow-lg:0 18px 48px rgba(2,6,23,.12);

  --r-xs:10px;
  --r-sm:12px;
  --r:16px;
  --r-lg:22px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --t:.15s ease;

  --sidebar-w: 280px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 60px;
}

/* ---------------------- Premium components ---------------------- */
.page-hero{
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.82));
  border:1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.stat-strip{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
}
.stat{
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  border-radius: var(--r);
  padding:12px;
  box-shadow: 0 1px 0 rgba(2,6,23,.02);
}
.stat-label{ color:var(--muted); font-size:12px; letter-spacing:.02em; }
.stat-value{ font-weight:900; font-size:22px; letter-spacing:-.02em; margin-top:4px; }
.stat-sub{ color:var(--muted); font-size:12px; margin-top:4px; }

.pill{ display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; border:1px solid var(--line); background:#fff; font-weight:700; font-size:12px; }
.pill.good{ background: rgba(22,163,74,.10); border-color: rgba(22,163,74,.22); color:#166534; }
.pill.warn{ background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.22); color:#92400e; }
.pill.bad{ background: rgba(220,38,38,.10); border-color: rgba(220,38,38,.22); color:#991b1b; }

.empty{
  border:1px dashed var(--line2);
  background: rgba(255,255,255,.72);
  border-radius: var(--r);
  padding:14px;
}
.empty-title{ font-weight:800; margin:0 0 6px 0; }
.empty-sub{ color:var(--muted); margin:0; }

@media (max-width: 1024px){
  .stat-strip{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Module accents (optional: set body class from PHP: module-toetsen etc.) */
body{ --accent: var(--brand); --accentSoft: var(--brandSoft); }
body.module-toetsen{ --accent:#2563eb; --accentSoft:rgba(37,99,235,.12);} /* blue */
body.module-inzicht{ --accent:#0ea5e9; --accentSoft:rgba(14,165,233,.12);} /* cyan */
body.module-bespreking{ --accent:#d97706; --accentSoft:rgba(217,119,6,.14);} /* amber */
body.module-nakijken{ --accent:#16a34a; --accentSoft:rgba(22,163,74,.12);} /* green */
body.module-chat{ --accent:#db2777; --accentSoft:rgba(219,39,119,.12);} /* pink */
body.module-settings{ --accent:#334155; --accentSoft:rgba(51,65,85,.10);} /* slate */
body.module-klassen{ --accent:#7c3aed; --accentSoft:rgba(124,58,237,.12);} /* violet */

/* --------------------------- Reset ---------------------------- */
*,:before,:after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background: radial-gradient(1200px 420px at 20% -10%, var(--bg2), transparent 60%), var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-size:15px;
  line-height:1.55;
}
img{ max-width:100%; display:block; }
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:8px; }
:focus:not(:focus-visible){ outline:none; }

.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* --------------------------- Layout --------------------------- */
.container{ max-width:1120px; margin:0 auto; padding:24px 20px; }
.container-wide{ max-width:1320px; }

.no-scroll{ overflow:hidden; }

/* App shell (sidebar + main) */
.app-shell{ min-height:100vh; }

/* Desktop: docked sidebar like ChatGPT */
.sidebar{
  position:fixed;
  top:var(--topbar-h);
  left:0;
  height:calc(100vh - var(--topbar-h));
  width:var(--sidebar-w);
  z-index:120;
  overflow:hidden;
  background: rgba(255,255,255,.94);
  border-right:1px solid var(--line);
  border-radius:0;
  box-shadow:none;
  transition: width .18s ease;
}
.app-shell.is-collapsed .sidebar{ width:var(--sidebar-w-collapsed); }

.app-main{
  margin-left:var(--sidebar-w);
  min-height:calc(100vh - var(--topbar-h));
  padding:18px 20px 0;
  transition: margin-left .18s ease;
}
.app-shell.is-collapsed .app-main{ margin-left:var(--sidebar-w-collapsed); }

/* Keep content nicely centered */
.app-content{ max-width:1320px; margin:0 auto; }
.app-main-noauth{ max-width:1120px; margin:0 auto; padding:18px 20px 0; }

@media (max-width: 1024px){
  /* On mobile we go back to single column + drawer */
  .sidebar{
    top:0; left:0;
    height:100vh;
    width:min(320px, 92vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
    border-right:none;
    border-radius: 0 18px 18px 0;
    box-shadow: var(--shadow-sm);
  }
  .sidebar.open{ transform: translateX(0); }
  .app-main{ margin-left:0; padding:14px 16px 0; }
  .app-shell.is-collapsed .app-main{ margin-left:0; }
  .app-content{ max-width:1320px; }
}


/* --------------------------- Topbar --------------------------- */
.topbar{
  position:sticky;
  top:0;
  z-index:100;
  background:rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom:1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.topbar-inner{
  max-width:1320px;
  margin:0 auto;
  padding:0 20px;
  height:60px;
  display:flex;
  align-items:center;
  gap:12px;
  position:relative;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  letter-spacing:-.02em;
  color:var(--text);
  text-decoration:none;
}
.brand:hover{ text-decoration:none; }
.brand img{ width:30px; height:30px; }
.spacer{ flex:1; }

.icon-btn{
  width:40px; height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:0 1px 0 rgba(2,6,23,.02);
  cursor:pointer;
  transition: all var(--t);
}
.icon-btn:hover{ border-color:var(--line2); box-shadow:var(--shadow-sm); }
.icon-btn svg{ width:20px; height:20px; }

.topbar-toggle{ display:none; border:0; background:transparent; padding:8px; cursor:pointer; color:var(--text); }
.topbar-toggle svg{ width:24px; height:24px; }

.topbar-actions{ display:flex; align-items:center; gap:10px; }

@media (max-width:768px){
  .topbar-toggle{ display:flex; }
  .topbar-actions{
    display:none;
    position:absolute;
    top:60px;
    left:0;
    right:0;
    background:#fff;
    padding:12px 16px;
    border-bottom:1px solid var(--line);
    box-shadow: var(--shadow);
    flex-direction:column;
    gap:10px;
    align-items:stretch;
  }
  .topbar-actions.open{ display:flex; }
}

/* --------------------------- Sidebar -------------------------- */
.sidebar-top{
  padding:14px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.sidebar-title{ font-weight:900; letter-spacing:-.01em; }
.sidebar-nav{ padding:10px; display:flex; flex-direction:column; gap:6px; }
.side-section{
  margin:10px 10px 4px;
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:800;
}
.side-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
  color:var(--text);
  text-decoration:none;
  transition: all var(--t);
}
.side-link:hover{ text-decoration:none; background:rgba(2,6,23,.03); border-color:var(--line); }
.side-link.active{ background: var(--accentSoft); border-color: rgba(0,0,0,0); }
.side-link .label{ font-weight:700; font-size:14px; }
.side-link .hint{ font-size:12px; color:var(--muted); }

/* Collapsed sidebar: hide section labels to keep it compact */
.app-shell.is-collapsed .side-section{ display:none; }

.sidebar-bottom{ padding:12px; border-top:1px solid var(--line); }

/* Drawer on mobile */
.drawer-backdrop{ position:fixed; inset:0; background:rgba(2,6,23,.35); z-index:120; }

/* --------------------------- Components ----------------------- */
.card{
  background:rgba(255,255,255,.95);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card.pad{ padding:18px; }
.card.pad-lg{ padding:22px; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
}
.pill.good{ background:rgba(22,163,74,.10); border-color:rgba(22,163,74,.20); color:#166534; }
.pill.warn{ background:rgba(217,119,6,.12); border-color:rgba(217,119,6,.22); color:#92400e; }
.pill.bad{ background:rgba(239,68,68,.10); border-color:rgba(239,68,68,.20); color:#991b1b; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  transition: all var(--t);
  text-decoration:none;
  line-height:1.2;
}
.btn:hover{ text-decoration:none; border-color:var(--line2); box-shadow:var(--shadow-sm); }
.btn:active{ transform: translateY(1px); }
.btn.sm{ padding:8px 12px; border-radius:10px; font-size:13px; }
.btn.block{ width:100%; }
.btn.primary{
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 88%, #000 12%));
  border-color: rgba(0,0,0,0);
  color:#fff;
  box-shadow: 0 10px 22px rgba(37,99,235,.22);
}
.btn.primary:hover{ filter:brightness(.98); box-shadow: 0 14px 32px rgba(37,99,235,.28); }
.btn.danger{ background:rgba(239,68,68,.10); border-color:rgba(239,68,68,.22); color:#991b1b; }

.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--bg);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.badge.accent{ background: var(--accentSoft); border-color:rgba(0,0,0,0); color:var(--accent); }

/* Backwards-compatible badge colors (old v2 templates) */
.badge.blue{ background: var(--accentSoft); border-color:rgba(0,0,0,0); color:var(--accent); }
.badge.green{ background: rgba(22,163,74,.12); border-color:rgba(0,0,0,0); color:#166534; }
.badge.red{ background: rgba(239,68,68,.12); border-color:rgba(0,0,0,0); color:#991b1b; }

/* --------------------------- Page System --------------------- */
.page{ padding: 10px 0 18px; }
.page-header{ margin-bottom:14px; }
.page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.page-head-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.page-head-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.page-head-left{ min-width:0; }
.h1-compact{ font-size:26px; }
.page-head .left{ min-width:0; }
.page-head .right{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.h1{ font-size:28px; letter-spacing:-.02em; margin:0; line-height:1.15; }
.h2{ font-size:18px; letter-spacing:-.01em; margin:0; }
.subtitle{ margin-top:6px; color:var(--muted); }

.module-hero{
  border:1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(900px 240px at 10% -20%, var(--accentSoft), transparent 55%),
    rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
}
.module-hero.pad{ padding:18px; }
.module-hero .kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  font-size:12px;
  letter-spacing:.10em;
  text-transform:uppercase;
  color: var(--accent);
}

/* Grid tiles */
.grid{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; }
@media (max-width: 1024px){ .grid{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:620px){ .grid{ grid-template-columns:1fr; } }

.tile{
  display:flex;
  gap:14px;
  padding:16px;
  border-radius: var(--r-lg);
  border:1px solid var(--line);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
  color:var(--text);
  text-decoration:none;
  transition: all var(--t);
}
.tile:hover{ text-decoration:none; transform: translateY(-2px); box-shadow: var(--shadow); border-color:var(--line2); }
.tile h3{ margin:0; font-size:15px; font-weight:900; }
.tile p{ margin:6px 0 0 0; color:var(--muted); font-size:13px; }

/* Tiles used on select_school.php */
.tile-top{ display:flex; align-items:center; gap:12px; }
.tile-title{ font-weight:950; font-size:15px; letter-spacing:-.01em; }
.tile-sub{ margin-top:10px; font-size:13px; color:var(--muted); }
.tile-icon{
  width:44px; height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--accentSoft);
  flex:0 0 auto;
}
.tile-icon svg{ width:22px; height:22px; stroke: var(--accent); fill:none; stroke-width:2; }

.icon{
  width:44px; height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--accentSoft);
  border:1px solid rgba(0,0,0,0);
  flex:0 0 auto;
}
.icon svg{ width:22px; height:22px; stroke: var(--accent); fill:none; stroke-width:2; }

/* Tables */
.table-wrap{ overflow:auto; border:1px solid var(--line); border-radius: var(--r-lg); background:#fff; box-shadow: var(--shadow-sm); }
table{ width:100%; border-collapse:collapse; font-size:14px; }
thead{ background: rgba(2,6,23,.03); }
th{ text-align:left; padding:12px 14px; font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); border-bottom:1px solid var(--line); white-space:nowrap; }
td{ padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background: rgba(37,99,235,.03); }

/* Forms */
label{ display:block; font-weight:800; font-size:13px; color:var(--text2); margin-bottom:6px; }
input,select,textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-size:14px;
  font-family:var(--font);
  transition: border-color var(--t), box-shadow var(--t);
}
/* Form helpers used across pages */
.form-field{ display:grid; gap:6px; margin-bottom:14px; }
.form-actions{ margin-top:18px; }
.form-hint{ font-size:12px; color:var(--muted); }
input:focus,select:focus,textarea:focus{ border-color: var(--accent); box-shadow: 0 0 0 4px var(--accentSoft); }
textarea{ min-height:120px; resize:vertical; }

.alert{ padding:12px 14px; border-radius:14px; border:1px solid var(--line); background:#fff; box-shadow: var(--shadow-sm); }
.alert.error{ border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.10); color:#991b1b; }
.alert.success{ border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.10); color:#166534; }
.alert.warn{ border-color: rgba(217,119,6,.25); background: rgba(217,119,6,.12); color:#92400e; }

.hr{ height:1px; background:var(--line); border:0; margin:16px 0; }

/* Module sections (old templates) */
.module-wrap{ padding: 18px 0; }
.module-tight{ padding-top:0; }
.section-head{ margin-bottom:12px; }

/* Empty states */
.empty-state{ text-align:center; padding:40px 20px; color:var(--muted); }
.empty-state h3{ margin:0 0 8px 0; color:var(--text); font-weight:950; }
.empty-state p{ margin:0; font-size:14px; max-width:360px; margin-left:auto; margin-right:auto; }
.empty-state.full{ grid-column: 1 / -1; }

/* Stats */
.stats-grid{ display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:12px; margin-top:14px; }
@media (max-width: 1024px){ .stats-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:520px){ .stats-grid{ grid-template-columns:1fr; } }
.stat{ border:1px solid var(--line); border-radius: var(--r-lg); background:#fff; box-shadow: var(--shadow-sm); padding:16px; }
.stat .k{ font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); font-weight:900; }
.stat .v{ font-size:24px; font-weight:950; letter-spacing:-.02em; margin-top:6px; }
.stat .s{ font-size:12px; color:var(--muted); margin-top:4px; }

/* --------------------------- Login -------------------------- */
.page-auth{ background: radial-gradient(1200px 600px at 20% 0%, rgba(37,99,235,.10), transparent 55%),
                     radial-gradient(900px 500px at 80% 10%, rgba(96,165,250,.12), transparent 55%),
                     #f7f9fc; }
.page-auth .app-main{ background: transparent; }
.page-auth .topbar{ background: rgba(255,255,255,.72); backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.page-auth .container{ padding-top: 24px; padding-bottom: 40px; }

.login-wrapper{ min-height: calc(100vh - 120px); display:flex; align-items:center; justify-content:center; padding:40px 20px; }
.login-card{ width:100%; max-width:440px; }
.login-head{ text-align:center; margin-bottom:16px; }
.login-logo{ width:56px; height:56px; margin:0 auto 14px; }
.login-school{ margin-top:10px; display:flex; justify-content:center; gap:10px; flex-wrap:wrap; color:var(--muted); }

/* ---------------------------- Chat -------------------------- */
/* Chat lives inside app-main; make it full-height & premium */
.chat-container{ padding:0; }
.chat-shell{ display:grid; grid-template-columns:320px 1fr; gap:14px; padding: 14px 0 0; align-items:stretch; height: calc(100vh - 60px - 32px); }
@media (max-width: 1024px){ .chat-shell{ grid-template-columns:1fr; height:auto; } }

.chat-sidebar, .chat-main{
  border:1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
  overflow:hidden;
  min-height: 0;
}

.chat-sidebar{ display:flex; flex-direction:column; }
.chat-main{ display:flex; flex-direction:column; }

.chat-side-top{ padding:14px; border-bottom:1px solid var(--line); }
.chat-search{ margin-top:10px; }
.chat-search input{ width:100%; }
.chat-list{ padding:10px; overflow:auto; flex:1; }

.subject-header{ font-size:11px; letter-spacing:.10em; text-transform:uppercase; color:var(--muted); font-weight:900; padding:12px 10px 6px; }
.chat-item{ display:flex; justify-content:space-between; gap:10px; padding:10px; border-radius:14px; border:1px solid transparent; color:var(--text); text-decoration:none; transition:all var(--t); }
.chat-item:hover{ text-decoration:none; background: rgba(2,6,23,.03); border-color: var(--line); }
.chat-item.active{ background: var(--accentSoft); border-color: rgba(0,0,0,0); }
.chat-item .title{ font-weight:900; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width: 220px; }
.chat-item .sub{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.chat-main-top{ padding:14px; border-bottom:1px solid var(--line); display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.chat-main-title{ margin:0; font-size:18px; font-weight:950; letter-spacing:-.02em; }
.chat-main-sub{ margin:4px 0 0 0; color:var(--muted); font-size:13px; }

.pill-select{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.pill-select select{ width:auto; }

.chat-log{ flex:1; overflow:auto; padding:16px; background: #fff; }
.msg-wrap{ position:relative; display:flex; }
.msg-wrap.me{ justify-content:flex-end; }
.msg{
  max-width: 78%;
  padding:10px 12px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(2,6,23,.02);
  white-space: pre-wrap;
  word-break: break-word;
  font-size:14px;
}
.msg.me{ background: var(--accentSoft); border-color: rgba(0,0,0,0); }
.msg.ai{ background:#fff; }

.copy-btn{
  position:absolute;
  top:8px;
  right:8px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:4px 8px;
  font-size:12px;
  color:var(--muted);
  cursor:pointer;
  opacity:0;
  transition: opacity var(--t);
}
.msg-wrap.ai:hover .copy-btn{ opacity:1; }

.chat-bar{ border-top:1px solid var(--line); padding:12px; background: #fff; }
.composer-form{ display:flex; flex-direction:column; gap:10px; }
.composer-row{ display:flex; gap:10px; align-items:flex-end; }
.composer-row textarea{ min-height:46px; max-height:180px; }
.quick-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.quick-row .tip{ margin-left:auto; color:var(--muted); font-size:12px; }
.kbd{ font-family: var(--mono); font-size:12px; padding:2px 6px; border:1px solid var(--line); border-bottom-width:2px; border-radius:8px; background:#fff; color:var(--muted); }


/* Chat: hide mobile-only header controls on desktop (shown via mobile.css) */
.chat-mobile-left{display:none;}

/* ----------------------- Chat Phase 2 ------------------------
   Make Chat feel like a full-page experience (ChatGPT-style):
   - Edge-to-edge sidebar + main
   - Sticky header + sticky composer with blur
   - Meta controls as subtle pills
-------------------------------------------------------------- */

/* Shell takes full viewport under the topbar */
.chat-shell{
  grid-template-columns: 360px 1fr;
  gap: 0;
  padding: 0;
  height: calc(100vh - var(--topbar-h));
}

/* Remove card look; use separators */
.chat-sidebar, .chat-main{
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.chat-sidebar{
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
}

/* Sticky chat header */
.chat-main-top{
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
}

/* Messages scroll area */
.chat-log{
  background: transparent;
  padding: 18px 22px;
}
.chat-log .msg-wrap{
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.msg{ max-width: min(78%, 720px); }

/* Sticky composer at bottom with blur */
.chat-bar{
  position: sticky;
  bottom: 0;
  z-index: 6;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  padding: 14px 16px;
}

/* Meta pills (Vak/Modus) */
.composer-settings{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.mini-select{ display:inline-flex; align-items:center; gap:0; }
.mini-select span{ display:none; }
.mini-select select{
  width:auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(2,6,23,.04);
  border: 1px solid rgba(2,6,23,.08);
  font-weight: 800;
}
.mini-select select:focus{ outline:none; box-shadow: 0 0 0 4px rgba(37,99,235,.18); border-color: rgba(37,99,235,.55); }

/* Mobile: keep the previous stacked behavior */
@media (max-width: 1024px){
  .chat-shell{ grid-template-columns: 1fr; height: auto; }
  .chat-sidebar{ border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-main-top{ position: relative; }
  .chat-bar{ position: relative; }
}

.new-msg-btn{
  position:sticky;
  bottom:92px;
  margin:0 auto;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0);
  background: var(--accentSoft);
  color: var(--accent);
  font-weight:900;
  font-size:13px;
  box-shadow: var(--shadow);
  cursor:pointer;
}
.new-msg-btn[hidden]{ display:none; }
.typing{ display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:13px; }
.dots{ display:inline-flex; gap:3px; }
.dots span{ width:6px; height:6px; border-radius:50%; background: rgba(100,116,139,.65); animation: blink 1.2s infinite; }
.dots span:nth-child(2){ animation-delay:.2s; }
.dots span:nth-child(3){ animation-delay:.4s; }
@keyframes blink{ 0%,100%{ opacity:.35; } 50%{ opacity:1; } }

/* Attachments */
.attachments{ margin-top:10px; display:flex; flex-wrap:wrap; gap:8px; }
.att{ display:flex; align-items:center; gap:8px; padding:6px 8px; border:1px solid var(--line); border-radius:12px; background:#fff; color:inherit; text-decoration:none; max-width:320px; }
.att:hover{ text-decoration:none; border-color:var(--line2); }
.att img{ width:44px; height:44px; object-fit:cover; border-radius:10px; border:1px solid var(--line); }
.att-name{ font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:240px; }

/* --------------------------- Footer ------------------------- */
.site-footer{ margin-top:40px; padding:20px 0; border-top:1px solid var(--line); color:var(--muted); font-size:13px; }
.footer-inner{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.footer-sep{ color:var(--line2); margin:0 6px; }
.footer-meta{ font-size:12px; color:var(--muted); }
@media (max-width:768px){ .footer-inner{ flex-direction:column; text-align:center; } }

/* --------------------------- Utilities ---------------------- */
.flex{ display:flex; }
.flex-wrap{ flex-wrap:wrap; }
.items-center{ align-items:center; }
.justify-between{ justify-content:space-between; }
.justify-end{ justify-content:flex-end; }
.gap-1{ gap:8px; }
.gap-2{ gap:14px; }
.mt-1{ margin-top:8px; }
.mt-2{ margin-top:16px; }
.mt-3{ margin-top:24px; }
.mb-0{ margin-bottom:0; }
.mb-1{ margin-bottom:8px; }
.mb-2{ margin-bottom:16px; }
.text-center{ text-align:center; }

@media print{
  .topbar,.site-footer,.btn{ display:none !important; }
  body{ background:#fff; }
  .card,.table-wrap{ box-shadow:none; }
}

/* =========================================================
   Student Experience — Renovation Pack (v1)
   - makes leerling-kant feel like a modern learning hub
   - keeps existing backend & routes intact
   ========================================================= */

/* Student background + calmer typography */
body.role-student{
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(37,99,235,.10), transparent 55%),
    radial-gradient(900px 320px at 90% 0%, rgba(124,58,237,.10), transparent 50%),
    var(--bg);
}

/* Student defaults */
body.role-student{ --accent: #2563eb; --accentSoft: rgba(37,99,235,.10); }

/* Page wrapper */
.page{
  padding: 18px 0 24px;
}

/* Premium hero header for student pages */
.page-hero{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(1000px 260px at 15% -20%, var(--accentSoft), transparent 55%),
    #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.page-hero.pad{ padding: 18px; }
.page-hero .kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.page-hero h1{ margin: 10px 0 6px 0; }
.page-hero p{ margin: 0; color: var(--muted); }

.hero-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Quick cards */
.quick-grid{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 1024px){
  .quick-grid{ grid-template-columns: 1fr; }
}

/* Learning cards (replaces “all tiles look the same”) */
.module-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 1024px){
  .module-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .module-grid{ grid-template-columns: 1fr; }
}

.module-card{
  position: relative;
  display:flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  overflow:hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.module-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
  text-decoration:none;
}
.module-card:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

.module-card::before{
  content:"";
  position:absolute;
  inset: -1px -1px auto -1px;
  height: 64px;
  background: linear-gradient(135deg, var(--accentSoft), transparent);
}

.module-card .top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  position: relative;
}

.module-card .micon{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--accentSoft);
  border: 1px solid rgba(0,0,0,0);
}
.module-card .micon svg{ width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 2; }

.module-card h3{ margin:0; font-size: 16px; }
.module-card .desc{ margin: 2px 0 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.module-card .meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  position: relative;
}
.module-card .chip{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.module-card .go{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
}

/* Per-card accents (set via data-accent="...") */
.module-card[data-accent="blue"]{ --accent:#2563eb; --accentSoft: rgba(37,99,235,.10); }
.module-card[data-accent="purple"]{ --accent:#7c3aed; --accentSoft: rgba(124,58,237,.10); }
.module-card[data-accent="green"]{ --accent:#16a34a; --accentSoft: rgba(22,163,74,.12); }
.module-card[data-accent="amber"]{ --accent:#d97706; --accentSoft: rgba(217,119,6,.12); }
.module-card[data-accent="pink"]{ --accent:#db2777; --accentSoft: rgba(219,39,119,.10); }
.module-card[data-accent="sky"]{ --accent:#0ea5e9; --accentSoft: rgba(14,165,233,.10); }

/* Student KPI cards */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1024px){ .kpi-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px){ .kpi-grid{ grid-template-columns: 1fr; } }

.kpi{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:#fff;
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.kpi .k{ font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.kpi .v{ font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.kpi .s{ font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .dot{
  width: 12px; height: 12px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accentSoft);
}

/* Student list headers (tables/forms) */
.section{
  margin-top: 14px;
}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.section-head h2{ font-size: 18px; margin:0; }
.section-head .sub{ color: var(--muted); font-size: 13px; margin: 4px 0 0 0; }

/* Make sidebar feel nicer for students */
body.role-student .sidebar-title{ font-weight: 900; }
body.role-student .side-link.active{ background: var(--accentSoft); }

/* Small improvement: avoid inline style reliance */
.subtitle{ color: var(--muted); }

/* =========================================================
   Premium Module Interiors — Teacher (and general)
   Consistent headers, forms, tables, detail layouts
   ========================================================= */

/* Page wrapper */
.page{ padding: 10px 0 22px; }

/* Section card helpers */
.section{ margin-top: 14px; }
.section .card{ overflow: hidden; }
.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}
.section-head .left{ min-width: 0; }
.section-head .right{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

/* Compact title/subtitle */
.title{
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
}
.desc{ margin: 4px 0 0 0; color: var(--muted); }

/* Action bar */
.toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
}
.toolbar .left, .toolbar .right{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.toolbar input[type="search"],
.toolbar input[type="text"],
.toolbar select{ min-width: 200px; }

/* Form grid */
.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full{ grid-column: 1 / -1; }
.form-grid .row{ display:flex; gap:12px; }
.form-grid .row > *{ flex:1; }
@media (max-width: 780px){
  .form-grid{ grid-template-columns: 1fr; }
  .form-grid .row{ flex-direction: column; }
}

/* Table tweaks */
.table-wrap table td .meta-sub{ margin-top: 2px; color: var(--muted); font-size: 12px; }
.table-actions{ text-align:right; white-space:nowrap; }
.table-actions .btn{ padding: 8px 10px; }

/* Detail layout */
.detail{
  display:grid;
  grid-template-columns: 1.4fr .6fr;
  gap: 14px;
  align-items:start;
}
@media (max-width: 1024px){
  .detail{ grid-template-columns: 1fr; }
}

/* Softer danger button for destructive inline actions */
.btn.danger-soft{
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
  color: #991b1b;
}
.btn.danger-soft:hover{ background: rgba(239,68,68,.12); }

/* Progress bars */
.bar{ height:10px; background: rgba(2,6,23,.06); border-radius: 999px; overflow:hidden; }
.bar > span{ display:block; height:100%; background: rgba(37,99,235,.55); }

/* =========================================================
   Deep module renovations: Chat + Overhoren
   ========================================================= */

/* Helpers */
.is-hidden{ display:none !important; }
.ml-auto{ margin-left:auto !important; }

/* Chat: remove inline layout dependencies */
.chat-inline-form{
  display:flex;
  gap:8px;
  align-items:center;
}

/* Overhoren (student) */
body.module-overhoren{ --accent:#16a34a; --accentSoft: rgba(34,197,94,.10); }
.oh-hero{ background: linear-gradient(180deg, var(--accentSoft), rgba(255,255,255,0)); }
.oh-quick{ margin-top:14px; }
.oh-quick-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.oh-quick-title{ font-weight:800; }
.oh-quick-sub{ color: var(--muted); margin-top:4px; }
.oh-quick-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.oh-choose{ margin-top:14px; }

.oh-input{ margin-top:14px; }
.oh-title{ margin:0 0 8px 0; }
.oh-two{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
@media (max-width: 720px){ .oh-two{ grid-template-columns:1fr; } }

.oh-quiz{ margin-top:14px; }
.oh-quiz-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.oh-quiz-step{ font-weight:800; }
.oh-q{ margin-top:12px; font-size:18px; font-weight:800; letter-spacing:-0.01em; }
.oh-hint{ margin-top:10px; color: var(--muted); }
.oh-answer{ margin-top:14px; }
.oh-feedback{ margin-top:14px; }
.oh-feedback-title{ font-weight:800; margin-bottom:6px; }
.oh-model{ margin-top:6px; }
.oh-next{ margin-top:12px; }

.oh-result{ margin-top:14px; }
.oh-result-sub{ margin:0; color: var(--muted); }
.oh-result-actions{ margin-top:14px; display:flex; gap:10px; flex-wrap:wrap; }

.oh-review{ margin-top:14px; }
.oh-review-title{ margin:0 0 10px 0; }
.oh-review-list{ display:grid; gap:10px; }
.oh-review-item{ padding:12px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.oh-review-q{ font-weight:800; }
.oh-review-line{ margin-top:6px; }
.oh-review-line + .oh-review-line{ margin-top:4px; }
.oh-review-feedback{ margin-top:6px; color: var(--text-secondary); }
.oh-review-feedback.is-correct{ color: #166534; }
.oh-review-feedback.is-wrong{ color: #991b1b; }


/* ===================== ChatGPT-like docked sidebar ===================== */
:root{
  --sidebar-w: 280px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 60px;
}

/* Shell becomes full-width; sidebar is fixed */
.app-shell{
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
}

/* Main content shifts to make room for sidebar */
.app-main{
  margin-left: var(--sidebar-w);
  padding: 18px 20px 0;
  transition: margin-left .2s ease;
}

/* Fixed docked sidebar */
.sidebar{
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  height: calc(100vh - var(--topbar-h));
  width: var(--sidebar-w);
  border-radius: 0;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  z-index: 90;
  overflow: hidden;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: width .2s ease;
}

/* Sidebar header actions */
.sidebar-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

/* nav icon (collapsed sidebar) */
.menu-icon{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  background: transparent;
  flex: 0 0 auto;
}
.menu-icon svg{ width: 20px; height: 20px; }

/* In expanded sidebar we don't show the "letter icons" (user preference).
   They remain visible only when the sidebar is collapsed, so you still have a compact navigation cue. */
.sidebar .menu-icon{ display:none; }
.app-shell.is-collapsed .sidebar .menu-icon{ display:inline-flex; }

/* Collapsed: make items look like icon buttons */
.app-shell.is-collapsed .side-link{
  justify-content:center;
  padding: 10px 8px;
}
.app-shell.is-collapsed .side-link .hint{ display:none; }
.app-shell.is-collapsed .sidebar-bottom .btn{ padding: 10px 8px; }
.app-shell.is-collapsed .sidebar-bottom .btn{ font-size: 0; }
.app-shell.is-collapsed .sidebar-bottom .btn::before{ content: "⎋"; font-size: 18px; }

/* Link layout */
.side-link{
  justify-content: flex-start;
  gap: 10px;
}
.side-link .hint{ margin-left:auto; }

/* Collapsed state */
.app-shell.is-collapsed .sidebar{
  width: var(--sidebar-w-collapsed);
}
.app-shell.is-collapsed .app-main{
  margin-left: var(--sidebar-w-collapsed);
}
.app-shell.is-collapsed .sidebar-title{
  display:none;
}
.app-shell.is-collapsed .menu-label{
  display:none;
}
.app-shell.is-collapsed .side-link{
  justify-content:center;
}
.app-shell.is-collapsed .side-link .hint{
  display:none;
}

/* Mobile keeps existing drawer behaviour */
@media (max-width: 1024px){
  .app-main{
    margin-left: 0;
    padding: 18px 16px 0;
  }
  .sidebar{
    top: 0;
    height: 100vh;
    width: min(320px, 92vw);
    border-right: 1px solid var(--line);
    transform: translateX(-105%);
    transition: transform .18s ease;
  }
  .sidebar.open{ transform: translateX(0); }
}


/* Collapsed sidebar polish (avoid duplicate/conflicting rules) */
.app-shell.is-collapsed .sidebar .side-link{width:46px;height:46px;padding:0;margin:6px auto;border-radius:14px;align-items:center;justify-content:center;background:transparent}
.app-shell.is-collapsed .sidebar .side-link:hover{background:rgba(15,23,42,.06)}
.app-shell.is-collapsed .sidebar .side-link.active{background:rgba(37,99,235,.10)}
.app-shell.is-collapsed .sidebar .side-link .menu-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:10px;opacity:.95}
.app-shell.is-collapsed .sidebar .side-link:hover .menu-icon{background:rgba(15,23,42,.06)}
.app-shell.is-collapsed .sidebar .side-link.active .menu-icon{background:rgba(37,99,235,.12);color:var(--brand)}


/* ChatGPT-style chat tweaks */
.chat-main-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.chat-menu{ position:relative; }
.icon-btn{
  width:40px; height:40px;
  border:1px solid rgba(0,0,0,.10);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
}
.menu-pop{
  position:absolute;
  right:0;
  top:44px;
  min-width:160px;
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  padding:6px;
  z-index:30;
}
.menu-item{
  display:block;
  width:100%;
  text-align:left;
  padding:10px 10px;
  border-radius:10px;
  background:transparent;
  border:0;
  cursor:pointer;
}
.menu-item:hover{ background:rgba(0,0,0,.05); }
.menu-danger{
  display:block;
  width:100%;
  text-align:left;
  padding:10px 10px;
  border-radius:10px;
  background:transparent;
  border:0;
  cursor:pointer;
  color:#b42318;
}
.menu-danger:hover{ background:rgba(180,35,24,.08); }

.composer-settings{
  display:flex;
  gap:12px;
  align-items:center;
  margin: 6px 0 10px 0;
}
.mini-select{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color: rgba(0,0,0,.65);
}
.mini-select select{
  border:1px solid rgba(0,0,0,.12);
  border-radius:12px;
  padding:8px 10px;
  background:#fff;
}


/* Chat focus mode: make chat feel like a full-screen app.
   IMPORTANT: we do NOT hard-force collapse here (users can still toggle).
   We only adjust spacing & remove page chrome that causes scrolling. */
body.focus-chat .site-footer{ display:none; }
body.focus-chat .app-main{ padding:0; }
body.focus-chat .app-content{ max-width:none; margin:0; }
body.focus-chat .container.chat-container{
  max-width:none;
  margin:0;
  padding:0;
}

/* Keep sidebar minimal in focus mode (cosmetic only) */
body.focus-chat .sidebar-bottom .btn.block{ padding-left:0; padding-right:0; }

/* ----------------------- Chat Phase 4 ------------------------
   Visual polish: message bubbles, composer, sidebar items.
-------------------------------------------------------------- */

/* Remove card look for chat panels (edge-to-edge) */
body.focus-chat .chat-sidebar,
body.focus-chat .chat-main{
  border:0;
  border-radius:0;
  box-shadow:none;
  background: transparent;
}

/* Let chat occupy full viewport under topbar */
body.focus-chat .chat-shell{
  height: calc(100vh - var(--topbar-h));
}

/* Sidebar: subtle divider and clean spacing */
body.focus-chat .chat-sidebar{
  border-right:1px solid var(--line);
  /* ChatGPT-like contrast: slightly tinted sidebar */
  background: #f7f7f8;
}
body.focus-chat .chat-side-top{ padding:16px; border-bottom:1px solid var(--line); }
body.focus-chat .chat-list{ padding:10px 8px; }

/* Starter prompts (draft state) */
.starter-block{ max-width: 760px; margin: 0 auto 18px; padding: 12px 14px; border: 1px solid rgba(2,6,23,.06); border-radius: 18px; background: rgba(255,255,255,.72); backdrop-filter: blur(8px); }
.starter-title{ font-weight: 900; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: rgba(0,0,0,.55); margin-bottom: 10px; }
.starter-grid{ display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; }
@media (max-width:720px){ .starter-grid{ grid-template-columns: 1fr; } }
.starter{ text-align:left; border:1px solid rgba(2,6,23,.10); background:#fff; border-radius: 14px; padding: 10px 12px; font-weight: 800; cursor:pointer; transition: transform var(--t), background var(--t), border-color var(--t); }
.starter:hover{ background: rgba(37,99,235,.06); border-color: rgba(37,99,235,.18); transform: translateY(-1px); }

/* Follow-up buttons under assistant messages */
.follow-row{ display:flex; gap:8px; flex-wrap:wrap; margin: 8px 0 0; }
.follow{ border:1px solid rgba(2,6,23,.10); background:#fff; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; cursor:pointer; transition: background var(--t), border-color var(--t); }
.follow:hover{ background: rgba(2,6,23,.03); border-color: rgba(2,6,23,.18); }

/* Chat items: more modern */
body.focus-chat .chat-item{
  border-radius: 12px;
}
body.focus-chat .chat-item.active{
  background: rgba(37,99,235,.10);
}

/* Main: header sticky, log scrolls, composer sticky */
body.focus-chat .chat-main{ background: #fff; }
body.focus-chat .chat-main-top{
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(10px);
}

/* ==========================
   Overhoren O1 (focus / fullscreen)
   - voorkomt page-scroll
   - houdt quiz binnen viewport
   ========================== */
body.focus-overhoren{ overflow:hidden; }
body.focus-overhoren .site-footer{ display:none; }
body.focus-overhoren .app-main{ padding:0; }
body.focus-overhoren .app-content{ max-width:none; margin:0; }

body.focus-overhoren main.container.page.oh-page{
  max-width:none;
  margin:0;
  padding:0;
  height: calc(100vh - var(--topbar-h));
  overflow:hidden;
}

body.focus-overhoren .page-hero.oh-hero{
  position: sticky;
  top: 0;
  z-index: 4;
  margin:0;
  border-radius:0;
  border-bottom:1px solid var(--line);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
}

/* Zorg dat de inhoud onder de hero scrollt binnen de pagina */
body.focus-overhoren .oh-page > .module-wrap,
body.focus-overhoren .oh-page > .card{
  max-width: 1100px;
  margin-left:auto;
  margin-right:auto;
}

body.focus-overhoren .oh-choose,
body.focus-overhoren .oh-input,
body.focus-overhoren .oh-review,
body.focus-overhoren .oh-result{
  max-height: calc(100vh - var(--topbar-h) - 180px);
  overflow:auto;
}

body.focus-overhoren .oh-quiz{
  max-width: 1024px;
  margin-left:auto;
  margin-right:auto;
  height: calc(100vh - var(--topbar-h) - 190px);
  overflow:auto;
}

body.focus-overhoren .oh-answer,
body.focus-overhoren .oh-next{
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 14px;
}

/* Messages: centered column with nicer bubbles */
body.focus-chat .chat-log{
  background: radial-gradient(1200px 420px at 20% -10%, rgba(238,242,255,.65), transparent 60%), #fff;
  padding: 22px 18px 36px;
}
body.focus-chat .msg-wrap{ max-width: 760px; margin: 0 auto 14px; }
body.focus-chat .msg{ max-width: 100%; border-radius: 18px; padding: 12px 14px; font-size: 15px; line-height: 1.6; }
body.focus-chat .msg.ai{ background:#ffffff; border:1px solid rgba(2,6,23,.06); box-shadow: 0 1px 2px rgba(2,6,23,.04); }
body.focus-chat .msg.me{ background: rgba(37,99,235,.10); border:1px solid rgba(37,99,235,.12); }

/* Composer: sticky with blur and nicer input */
body.focus-chat .chat-bar{
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(2,6,23,.06);
}
body.focus-chat .composer-row textarea{
  border-radius: 18px;
  padding: 12px 14px;
}
body.focus-chat .quick-row .btn{
  border-radius: 999px;
}


/* ===== Phase 6: Student-friendly intent chips (ChatGPT-like) ===== */
.composer-meta{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.pill-select select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  border:1px solid rgba(0,0,0,.10);
  background:rgba(255,255,255,.85);
  border-radius:999px;
  padding:10px 34px 10px 14px;
  font-weight:600;
  font-size:14px;
  line-height:1;
  cursor:pointer;
}
.pill-select{ position:relative; }
.pill-select:after{
  content:"▾";
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  opacity:.65;
  pointer-events:none;
  font-size:12px;
}

.mode-chips{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.mode-chip{
  border:1px solid rgba(0,0,0,.10);
  background:rgba(255,255,255,.85);
  border-radius:999px;
  padding:9px 12px;
  font-weight:650;
  font-size:13px;
  cursor:pointer;
  transition:transform .05s ease, background .15s ease, border-color .15s ease;
}
.mode-chip:hover{ background:rgba(255,255,255,1); border-color: rgba(0,0,0,.16); }
.mode-chip:active{ transform: translateY(1px); }
.mode-chip.active{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Follow-ups should look like subtle chips */
.follow-row{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.follow{ border-radius:999px; padding:8px 12px; font-weight:650; }



/* ===== Hotfix: ensure sticky composer doesn't block clicks (z-index stacking) ===== */
body.focus-chat .chat-shell{ position:relative; }
body.focus-chat .chat-sidebar{ position:relative; z-index:10; }
body.focus-chat .chat-main{ position:relative; z-index:0; }
body.focus-chat .chat-main-top{ z-index:2; }
body.focus-chat .chat-log{ position:relative; z-index:1; }
body.focus-chat .chat-bar{ z-index:3; }

/* ================= Desktop polish v2 (Chat + Overhoren + Teacher Vak) ================= */

/* Small spinner */
.spinner{ width:14px; height:14px; border-radius:999px; border:2px solid rgba(15,23,42,.18); border-top-color: rgba(15,23,42,.55); animation:spin .8s linear infinite; display:inline-block; }
@keyframes spin{ to{ transform:rotate(360deg);} }

/* Chat: subtle sending banner */
.chat-sending{
  display:none;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  font-weight:650;
  margin-top:10px;
}
.chat-main.is-sending .chat-sending{ display:flex; }

/* Empty blocks in sidebars */
.empty-block{ border:1px dashed var(--line2); background: rgba(255,255,255,.72); border-radius: var(--r); padding:14px; }
.empty-block .t{ font-weight:850; margin:0 0 6px 0; }
.empty-block .s{ margin:0; color:var(--muted); }

/* Overhoren: form submit overlay */
.oh-overlay{
  position:fixed;
  inset:0;
  background: rgba(15,23,42,.35);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.oh-overlay .box{
  width:min(520px, 92vw);
  background: rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding:16px;
}
.oh-overlay .box .tt{ font-weight:900; font-size:16px; margin:0 0 4px 0; }
.oh-overlay .box .ss{ margin:0; color:var(--muted); }
.oh-overlay .row{ display:flex; gap:10px; align-items:center; margin-top:10px; }

/* Teacher Vak: section framing */
.section{ margin-top:16px; }
.section-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.section-head h2{ margin:0; font-size:18px; letter-spacing:-.01em; }
.section-head .sub{ margin:4px 0 0 0; color:var(--muted); }

.teacher-grid{ display:grid; grid-template-columns: 1.25fr .75fr; gap:14px; align-items:start; }
@media (max-width: 1024px){ .teacher-grid{ grid-template-columns: 1fr; } }

.card.soft{ background: rgba(255,255,255,.92); }



/* ===== v19 student polish ===== */
@media (min-width: 1025px){
  .sidebar [data-drawer-close]{ display:none; }
  .app-shell.is-collapsed .sidebar-top{
    padding: 12px 0 10px;
    justify-content: center;
    border-bottom: 1px solid var(--line);
  }
  .app-shell.is-collapsed .sidebar-actions{
    width:100%;
    justify-content:center;
  }
  .app-shell.is-collapsed .sidebar .icon-btn{
    width:44px;
    height:44px;
    border-radius:14px;
  }
  .app-shell.is-collapsed .sidebar-nav{
    padding-top: 12px;
  }
  .app-shell.is-collapsed .sidebar-bottom{
    padding: 12px 0 14px;
  }
  .app-shell.is-collapsed .sidebar-bottom .btn.block{
    width:46px;
    height:46px;
    margin:0 auto;
    border-radius:14px;
    border:1px solid var(--line);
    background:#fff;
    box-shadow:none;
  }
}

body.role-student .topbar .btn,
body.role-student .sidebar-bottom .btn{
  border-color: var(--line);
  box-shadow: none;
}
body.role-student .topbar .btn:hover,
body.role-student .sidebar-bottom .btn:hover{
  border-color: var(--line2);
  box-shadow: 0 4px 16px rgba(15,23,42,.06);
}
body.role-student .page-hero .pill{ white-space: nowrap; }


/* Minimal UI polish: remove helper copy / small gray guidance */
.page-hero .hero-row > div:first-child > p,
.section-head .sub,
.section-head .subtitle,
p.subtitle,
.module-sub,
.tile p,
.empty-sub,
.stat-sub,
.hero-copy-muted,
.helper-copy,
.quick-help-copy,
.small-help-copy,
.meta-sub,
.hint:not(.keep-copy) {
  display: none !important;
}

/* Tighter vertical rhythm after helper copy removal */
.page-hero .hero-row > div:first-child .h1,
.page-hero .hero-row > div:first-child h1 {
  margin-bottom: 0 !important;
}

.card.pad > .row + .subtitle,
.card.pad > .section-head + .subtitle,
.card.pad > h2 + .subtitle,
.card.pad > h1 + .subtitle {
  display:none !important;
}

/* Keep chat list metadata visible */
.chat-item .sub,
.subject-header,
.chat-main-sub,
.table-wrap table td .meta-sub.keep-visible {
  display: block !important;
}
