@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  --ink: #1b2a4a;
  --ink-soft: #3c4a68;
  --paper: #f5efdf;
  --paper-dim: #ece3cc;
  --paper-card: #fbf8ef;
  --line: rgba(27, 42, 74, 0.16);
  --line-strong: rgba(27, 42, 74, 0.32);

  --p1: #a6301e;
  --p1-soft: #f3e3df;
  --p2: #b7862f;
  --p2-soft: #f2e8d6;
  --p3: #2e6e62;
  --p3-soft: #e0ebe8;

  --accent: var(--p1);
  --accent-soft: var(--p1-soft);

  --radius: 3px;
  --shadow: 0 1px 0 rgba(27, 42, 74, 0.08), 0 8px 20px -12px rgba(27, 42, 74, 0.35);
  --shadow-lift: 0 2px 0 rgba(27, 42, 74, 0.1), 0 16px 36px -16px rgba(27, 42, 74, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(rgba(27, 42, 74, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a { color: inherit; }

/* ============ APP SHELL ============ */
#app {
  max-width: 880px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-card);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
}

.topbar__brand .stamp-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 13px;
  transform: rotate(-8deg);
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(27, 42, 74, 0.35);
}
.brand-mark-lg {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  margin: 0 auto 14px;
  display: block;
  box-shadow: 0 3px 10px rgba(27, 42, 74, 0.35);
}

.version-tag {
  font-family: "IBM Plex Mono";
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper-dim);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 1px 6px;
  vertical-align: middle;
  margin-left: 4px;
}
.version-tag--auth {
  display: inline-block;
  margin: 8px auto 0;
  text-align: center;
}

.topbar__brand h1 {
  font-size: 17px;
  line-height: 1.15;
}
.topbar__brand span.sub {
  display: block;
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.topbar__user .who {
  text-align: right;
  line-height: 1.2;
}
.topbar__user .who b { display: block; font-size: 13px; }
.topbar__user .who span { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

.btn-ghost {
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
}
.btn-ghost:hover { border-color: var(--ink); }

main {
  flex: 1;
  padding: 24px 20px 64px;
}

/* ============ AUTH SCREEN ============ */
.auth-wrap {
  max-width: 440px;
  margin: 6vh auto 0;
  padding: 0 20px;
}
.auth-hero {
  text-align: center;
  margin-bottom: 28px;
}
.auth-hero .stamp-mark-lg {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 26px;
  transform: rotate(-6deg);
}
.auth-hero h1 { font-size: 26px; margin-bottom: 6px; }
.auth-hero p { color: var(--ink-soft); font-size: 14px; margin: 0; }

.card {
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.tabs-toggle {
  display: flex;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.tabs-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.tabs-toggle button.active {
  background: var(--ink);
  color: var(--paper);
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.btn-primary {
  width: 100%;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-top: 4px;
}
.btn-primary:hover { background: #0f1a30; }
.btn-primary:disabled { opacity: 0.55; cursor: default; }

.form-msg {
  font-size: 13px;
  padding: 9px 11px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1.5px solid transparent;
}
.form-msg.error { background: var(--p1-soft); border-color: var(--p1); color: var(--p1); }
.form-msg.ok { background: var(--p3-soft); border-color: var(--p3); color: var(--p3); }

.auth-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 16px;
}
.auth-offline-banner {
  margin-top: 14px;
  font-size: 12px;
  text-align: center;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
}
.docent-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-decoration: underline;
}
.docent-link:hover { color: var(--ink); }

/* ============ FOLDER TABS (periods) ============ */
.folder-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
  padding: 0 4px;
}
.folder-tab {
  flex: 1;
  border: 1.5px solid var(--ink);
  border-bottom: none;
  background: var(--paper-dim);
  padding: 12px 10px 14px;
  border-radius: 8px 8px 0 0;
  text-align: left;
  position: relative;
  top: 2px;
  transition: top 0.12s ease;
}
.folder-tab .nr {
  font-family: "IBM Plex Mono";
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
.folder-tab .naam {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  margin-top: 3px;
  display: block;
}
.folder-tab.active {
  background: var(--paper-card);
  top: 0;
  box-shadow: 0 -2px 0 var(--tab-color, var(--ink)) inset;
}
.folder-tab.active .nr { opacity: 1; color: var(--tab-color, var(--ink)); }

.folder-body {
  border: 1.5px solid var(--ink);
  border-radius: 0 6px 6px 6px;
  background: var(--paper-card);
  padding: 22px;
  box-shadow: var(--shadow);
}

.folder-body__intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-strong);
}
.folder-body__intro h2 { font-size: 20px; }
.folder-body__intro p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.progress-ring {
  flex-shrink: 0;
  text-align: center;
  font-family: "IBM Plex Mono";
}
.progress-ring .num { font-size: 20px; font-weight: 600; }
.progress-ring .lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }

/* ============ TOPIC LIST ============ */
.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: #fff;
  text-align: left;
  width: 100%;
  transition: border-color 0.12s, transform 0.08s;
}
.topic-row:hover { border-color: var(--ink); transform: translateX(2px); }
.topic-row__nr {
  font-family: "IBM Plex Mono";
  font-weight: 600;
  font-size: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topic-row__text { flex: 1; min-width: 0; }
.topic-row__text h3 { font-size: 15px; }
.topic-row__text p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.topic-row__stamp {
  flex-shrink: 0;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--p3);
  color: var(--p3);
  border-radius: 4px;
  padding: 4px 7px;
  transform: rotate(-6deg);
  white-space: nowrap;
}
.topic-row__chevron { color: var(--line-strong); font-size: 18px; }

/* ============ TOPIC DETAIL ============ */
.topic-header {
  margin-bottom: 18px;
}
.topic-header .crumb {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.topic-header .crumb button {
  border: none; background: none; padding: 0;
  color: var(--ink-soft); text-decoration: underline; font-size: 12px;
}
.topic-header h2 { font-size: 23px; }
.topic-header p.sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.topic-header .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-family: "IBM Plex Mono";
  font-size: 10.5px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--ink-soft);
}

.subtabs {
  display: flex;
  gap: 4px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 20px;
}
.subtabs button {
  border: none;
  background: none;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
}
.subtabs button.active {
  color: var(--ink);
  border-bottom-color: var(--tab-color, var(--ink));
}

/* --- Uitleg tab --- */
.doelen-box {
  background: var(--tab-soft, var(--paper-dim));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.doelen-box h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; color: var(--ink-soft); }
.doelen-box ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.doelen-box li { margin-bottom: 4px; }

.uitleg-sectie { margin-bottom: 22px; }
.uitleg-sectie h3 {
  font-size: 16px;
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 3px solid var(--tab-color, var(--ink));
}
.uitleg-sectie ul { margin: 0; padding-left: 20px; }
.uitleg-sectie li { margin-bottom: 7px; font-size: 14.5px; line-height: 1.55; }

.mark-read-btn {
  display: block;
  margin: 10px auto 0;
  border: 1.5px solid var(--ink);
  background: transparent;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13.5px;
}
.mark-read-btn.done {
  background: var(--p3);
  border-color: var(--p3);
  color: #fff;
}

/* --- Begrippen / flashcards --- */
.flash-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.flash-progress { font-family: "IBM Plex Mono"; font-size: 12px; color: var(--ink-soft); }
.flashcard {
  width: 100%;
  max-width: 480px;
  min-height: 190px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.flashcard .hint {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.flashcard .term {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 22px;
}
.flashcard .def {
  font-size: 15px;
  line-height: 1.5;
}
.flash-controls { display: flex; gap: 10px; width: 100%; max-width: 480px; }
.flash-controls button {
  flex: 1;
  border-radius: var(--radius);
  padding: 12px;
  font-weight: 700;
  font-size: 13.5px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
}
.flash-controls .know { border-color: var(--p3); color: var(--p3); }
.flash-controls .know:hover { background: var(--p3-soft); }
.flash-controls .again { border-color: var(--p1); color: var(--p1); }
.flash-controls .again:hover { background: var(--p1-soft); }
.flash-nav { display: flex; gap: 8px; align-items: center; }
.flash-nav button { border: none; background: none; color: var(--ink-soft); font-size: 20px; padding: 4px 10px; }
.flash-done-msg { text-align: center; padding: 20px 0; }
.flash-done-msg .big { font-family: "Fraunces", serif; font-size: 19px; margin-bottom: 6px; }

/* --- Oefenvragen --- */
.quiz-progressbar {
  height: 6px;
  background: var(--paper-dim);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
}
.quiz-progressbar__fill {
  height: 100%;
  background: var(--tab-color, var(--ink));
  transition: width 0.25s ease;
}
.quiz-q-label {
  font-family: "IBM Plex Mono";
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.quiz-q { font-size: 16.5px; margin-bottom: 16px; font-family: "Fraunces", serif; font-weight: 500; line-height: 1.4; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.quiz-opt {
  text-align: left;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.quiz-opt:hover { border-color: var(--ink); }
.quiz-opt .letter {
  font-family: "IBM Plex Mono";
  font-weight: 700;
  font-size: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quiz-opt.correct { border-color: var(--p3); background: var(--p3-soft); }
.quiz-opt.correct .letter { border-color: var(--p3); background: var(--p3); color: #fff; }
.quiz-opt.wrong { border-color: var(--p1); background: var(--p1-soft); }
.quiz-opt.wrong .letter { border-color: var(--p1); background: var(--p1); color: #fff; }
.quiz-opt:disabled { cursor: default; }

.quiz-textarea {
  width: 100%;
  min-height: 100px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 12px;
}
.quiz-textarea:focus { outline: 2px solid var(--ink); }

.model-antwoord {
  background: var(--paper-dim);
  border-left: 3px solid var(--tab-color, var(--ink));
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.model-antwoord b {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.uitleg-feedback {
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--paper-dim);
}

.quiz-nav { display: flex; justify-content: space-between; gap: 10px; }
.quiz-nav button {
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13.5px;
}
.quiz-nav button:disabled { opacity: 0.4; cursor: default; }
.quiz-nav button.secondary { background: transparent; color: var(--ink); }

.quiz-result {
  text-align: center;
  padding: 26px 10px;
}
.quiz-result .stamp-mark-lg { margin: 0 auto 14px; }
.quiz-result .score {
  font-family: "Fraunces", serif;
  font-size: 34px;
  font-weight: 700;
}
.quiz-result .score span { font-size: 18px; color: var(--ink-soft); }
.quiz-result p.msg { color: var(--ink-soft); margin: 8px 0 20px; font-size: 14px; }

/* ============ TEACHER DASHBOARD ============ */
.teacher-wrap h2 { font-size: 21px; margin-bottom: 4px; }
.teacher-wrap > p.sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 20px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 24px; }
.stat-card {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-card);
  padding: 14px;
}
.stat-card .num { font-family: "Fraunces", serif; font-size: 26px; font-weight: 700; }
.stat-card .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }

.teacher-table-wrap {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--paper-card);
}
table.teacher-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.teacher-table th, table.teacher-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
table.teacher-table th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: var(--paper-dim);
  position: sticky; top: 0;
}
table.teacher-table td.name { font-weight: 600; font-family: "Fraunces", serif; }
.cell-bar {
  display: inline-block;
  width: 60px;
  height: 7px;
  border-radius: 4px;
  background: var(--paper-dim);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.cell-bar__fill { height: 100%; background: var(--p3); }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ============ MISC ============ */
.loading-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.sync-banner {
  font-size: 11.5px;
  text-align: center;
  padding: 6px;
  background: var(--p2-soft);
  color: #6b4d17;
  border-bottom: 1px solid var(--p2);
}

@media (max-width: 560px) {
  .topbar { padding: 12px 14px; }
  main { padding: 18px 14px 56px; }
  .folder-tab .naam { font-size: 12.5px; }
  .folder-body { padding: 16px; }
  .folder-body__intro { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

button:focus-visible, .topic-row:focus-visible, .quiz-opt:focus-visible, input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ============ XP / RANG (topbar) ============ */
.xp-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 130px;
}
.xp-widget .rang {
  font-family: "Fraunces", serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.xp-bar {
  width: 130px;
  height: 6px;
  border-radius: 4px;
  background: var(--paper-dim);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.xp-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--p2), var(--p1));
}
.xp-widget .xp-num {
  font-family: "IBM Plex Mono";
  font-size: 9.5px;
  color: var(--ink-soft);
}

/* ============ BADGE / STEMPELVERZAMELING ============ */
.badge-collection {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}
.badge-collection h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}
.badge-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono";
  font-weight: 600;
  font-size: 12px;
  color: var(--line-strong);
  background: #fff;
}
.badge-dot.done {
  border-color: var(--p3);
  background: var(--p3);
  color: #fff;
  transform: rotate(-4deg);
}

/* ============ BRON TAB ============ */
.bron-card {
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--paper-dim);
  padding: 16px 18px;
  margin-bottom: 20px;
  position: relative;
}
.bron-card::before {
  content: "BRON";
  position: absolute;
  top: -9px;
  left: 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: "IBM Plex Mono";
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
}
.bron-card h4 { font-size: 14.5px; margin-bottom: 3px; }
.bron-card .soort { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.bron-card blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--line-strong);
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.5;
}

.niveau-badge {
  display: inline-block;
  font-family: "IBM Plex Mono";
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  margin-bottom: 10px;
}
.niveau-badge.goed { background: var(--p3-soft); color: var(--p3); }
.niveau-badge.deels { background: var(--p2-soft); color: #6b4d17; }
.niveau-badge.onvoldoende { background: var(--p1-soft); color: var(--p1); }

/* ============ PLANNING / TIJDLIJN ============ */
.planning-wrap h2 { font-size: 21px; margin-bottom: 4px; }
.planning-wrap > p.sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 22px; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line-strong);
}
.timeline-block { position: relative; margin-bottom: 26px; }
.timeline-block::before {
  content: "";
  position: absolute;
  left: -26px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--block-color, var(--ink));
  background: var(--paper);
}
.timeline-block.nu::before {
  background: var(--block-color, var(--ink));
}
.timeline-block .meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.timeline-block .maand {
  font-family: "IBM Plex Mono";
  font-size: 11px;
  font-weight: 600;
  color: var(--block-color, var(--ink));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timeline-block .weken { font-size: 11px; color: var(--ink-soft); }
.timeline-block .nu-tag {
  font-family: "IBM Plex Mono";
  font-size: 9.5px;
  background: var(--ink);
  color: var(--paper);
  padding: 1px 7px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}
.timeline-block h3 { font-size: 16.5px; margin-bottom: 3px; }
.timeline-block p.omschr { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; }
.timeline-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline-topic-chip {
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}
.timeline-topic-chip:hover { border-color: var(--block-color, var(--ink)); }
.timeline-topic-chip .check { color: var(--p3); font-weight: 700; }

/* ============ TEACHER: subnav + drill-down ============ */
.teacher-subnav { display: flex; gap: 4px; border-bottom: 1.5px solid var(--ink); margin-bottom: 18px; }
.teacher-subnav button {
  border: none; background: none;
  padding: 9px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1.5px;
}
.teacher-subnav button.active { color: var(--ink); border-bottom-color: var(--ink); }

table.teacher-table tr.clickable { cursor: pointer; }
table.teacher-table tr.clickable:hover { background: var(--paper-dim); }

.student-detail {
  border: 1.5px solid var(--ink);
  border-top: none;
  background: var(--paper-card);
  padding: 16px 18px;
  font-size: 13px;
}
.student-detail h4 { font-size: 13px; margin: 14px 0 8px; padding-top:10px; border-top: 1px dashed var(--line-strong); }
.student-detail h4:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.answer-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.answer-row:last-child { border-bottom: none; }
.answer-row .icon { flex-shrink: 0; width: 18px; text-align: center; font-weight: 700; }
.answer-row .icon.ok { color: var(--p3); }
.answer-row .icon.deels { color: #b7862f; }
.answer-row .icon.fout { color: var(--p1); }
.answer-row .body { flex: 1; min-width: 0; }
.answer-row .vraagtekst { font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.answer-row .antwoordtekst { font-size: 13px; }
.answer-row .antwoordtekst.leeg { color: var(--ink-soft); font-style: italic; }

.topic-select {
  padding: 9px 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  background: #fff;
  margin-bottom: 18px;
}

.vraag-analyse-block { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px dashed var(--line-strong); }
.vraag-analyse-block .vraagtitel { font-family: "Fraunces", serif; font-size: 14.5px; margin-bottom: 10px; }
.mc-tally-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.mc-tally-row .opt-label { width: 160px; flex-shrink: 0; }
.mc-tally-row .bar-track { flex: 1; height: 14px; background: var(--paper-dim); border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; }
.mc-tally-row .bar-fill { height: 100%; background: var(--ink); }
.mc-tally-row .bar-fill.correct-fill { background: var(--p3); }
.mc-tally-row .count { width: 26px; text-align: right; font-family: "IBM Plex Mono"; font-size: 11px; }

.kort-tally { display: flex; gap: 14px; margin-bottom: 10px; font-size: 12px; }
.kort-tally span { display: flex; align-items: center; gap: 5px; }
.kort-antwoord-lijst { max-height: 220px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.kort-antwoord-item { padding: 8px 11px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.kort-antwoord-item:last-child { border-bottom: none; }
.kort-antwoord-item .naam { font-weight: 700; margin-right: 6px; }

/* Grote Oefentoets */
.mixed-cta {
  margin-top: 20px;
  border: 1.5px dashed var(--ink);
  border-radius: 6px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.mixed-cta div h4 { font-size: 14.5px; margin-bottom: 3px; }
.mixed-cta div p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.mixed-cta button {
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

/* ============ SNELKOPPELINGEN (dashboard) ============ */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.quick-link-card {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--paper-card);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
}
.quick-link-card:hover { transform: translateY(-1px); border-color: var(--p1); }
.quick-link-card .ic { font-size: 22px; }
@media (max-width: 560px) {
  .quick-links { grid-template-columns: 1fr 1fr; }
}

/* ============ VERGRENDELDE LESSEN ============ */
.topic-row.locked {
  opacity: 0.55;
  cursor: default;
  background: var(--paper-dim);
}
.topic-row.locked:hover { transform: none; border-color: var(--line-strong); }
.topic-row__stamp.goedgekeurd { border-color: var(--p3); background: var(--p3); color: #fff; }

/* ============ BEGRIPPEN IN LES (onder lesdoelen) ============ */
.begrippen-in-les { margin: 18px 0 22px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.begrippen-in-les h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 8px; }
.begrippen-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============ GETYPTE FLASHCARDS (begrippen/personen) ============ */
.flashcard-typed {
  width: 100%;
  max-width: 500px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  margin: 0 auto;
}
.term-groot {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 16px;
}
.flashcard-typed .quiz-textarea { min-height: 80px; }
.flashcard-typed .model-antwoord { text-align: left; }
.flashcard-typed .persoon-foto { margin: 0 auto 10px; }

/* ============ BEGRIPPENLIJST ============ */
.begrippenlijst-wrap h2 { font-size: 21px; margin-bottom: 4px; }
.begrippenlijst-wrap > p.sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 18px; }
.begrippenlijst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.begrip-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  font-size: 12.5px;
}
.begrip-card b { display: block; font-family: "Fraunces", serif; font-size: 14px; margin-bottom: 3px; }
.begrip-card span { color: var(--ink-soft); line-height: 1.4; }

.uitleg-feedback.fout { background: var(--p1-soft); color: var(--p1); }

@keyframes stampDrop {
  0% { transform: scale(2.2) rotate(-18deg); opacity: 0; }
  60% { transform: scale(0.94) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); opacity: 1; }
}
.stamp-animate { animation: stampDrop 0.4s ease-out; }

/* ============ AFTELBALK ============ */
.countdown-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: "IBM Plex Mono";
  font-size: 12px;
  text-align: center;
  flex-wrap: wrap;
}
.countdown-bar .num {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 15px;
  color: #f2c879;
}
.countdown-bar .datum { opacity: 0.75; }

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--p2-soft);
  color: #6b4d17;
  border-bottom: 1px solid var(--p2);
  font-size: 12.5px;
  text-align: center;
}

/* ============ SPELLETJESHUB ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.game-card {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.game-card__ic { font-size: 30px; margin-bottom: 4px; }
.game-card h3 { font-size: 15.5px; }
.game-card p { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; min-height: 32px; }
.game-card button {
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13px;
  width: 100%;
}
.game-stats {
  font-family: "IBM Plex Mono";
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  text-align: center;
}

/* ============ GEHEUGENSPEL ============ */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.memory-card {
  min-height: 90px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.memory-card.open {
  background: #fff;
  color: var(--ink);
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-size: 12.5px;
  padding: 8px;
  text-align: center;
  line-height: 1.35;
}
.memory-card.matched { background: var(--p3-soft); border-color: var(--p3); color: var(--p3); opacity: 0.75; }
.memory-card:disabled { cursor: default; }

/* ============ TIJDLIJN-SORTEERSPEL ============ */
.sorteer-lijst { display: flex; flex-direction: column; gap: 8px; }
.sorteer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: #fff;
}
.sorteer-item.correct { border-color: var(--p3); background: var(--p3-soft); }
.sorteer-item.wrong { border-color: var(--p1); background: var(--p1-soft); }
.sorteer-item__nr {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sorteer-item__tekst { flex: 1; font-size: 13px; line-height: 1.4; }
.sorteer-item__knoppen { display: flex; gap: 4px; flex-shrink: 0; }
.sorteer-item__knoppen button {
  border: 1.5px solid var(--line-strong);
  background: #fff;
  width: 30px; height: 30px;
  border-radius: 4px;
  font-size: 14px;
}
.sorteer-item__uitkomst { font-size: 11.5px; font-weight: 700; flex-shrink: 0; white-space: nowrap; }

/* ============ QUIZ SPRINT ============ */
.sprint-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-dim);
}
.sprint-timer {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--p1);
}
.sprint-score { font-family: "IBM Plex Mono"; font-size: 12.5px; }

/* ============ WIE BEN IK? ============ */
.wieben-card {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow);
}
.wieben-hints {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 16px 0;
  font-size: 13.5px;
}
.wieben-hints li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-strong);
}
.wieben-hints li:first-child { border-top: 1px dashed var(--line-strong); }

/* ============ PERSONEN FLASHCARDS ============ */
.persoon-foto {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  object-fit: cover;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(27, 42, 74, 0.3);
}
.persoon-naam { font-family: "Fraunces", serif; font-weight: 600; font-size: 19px; margin-bottom: 2px; }
.persoon-jaren { font-family: "IBM Plex Mono"; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 3px; }
.persoon-rol { font-size: 12.5px; color: var(--ink-soft); font-style: italic; margin-bottom: 10px; }
.persoon-omschr { font-size: 14px; line-height: 1.5; max-width: 380px; }
.persoon-wiki-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-soft);
  text-decoration: underline;
}
.persoon-wiki-link:hover { color: var(--ink); }
.persoon-empty { text-align: center; padding: 30px; color: var(--ink-soft); }

/* ============ EXAMENSTRATEGIE ============ */
.strategie-wrap h2 { font-size: 21px; margin-bottom: 4px; }
.strategie-wrap > p.sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 22px; }
.strategie-blok {
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--paper-card);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.strategie-blok h3 {
  font-size: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.strategie-blok h3 .nr {
  font-family: "IBM Plex Mono";
  font-size: 12px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.strategie-blok ul { margin: 0; padding-left: 20px; }
.strategie-blok li { margin-bottom: 7px; font-size: 14px; line-height: 1.55; }
.strategie-blok table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13.5px; }
.strategie-blok table th, .strategie-blok table td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line);
}
.strategie-blok table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.strategie-blok table td.woord { font-family: "Fraunces", serif; font-weight: 600; }

/* ============ TEACHER: wachtwoord resetten ============ */
.reset-pw-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 4px 9px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: 8px;
}
.reset-pw-btn:hover { border-color: var(--p1); color: var(--p1); }
.reset-pw-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--p2-soft);
  border: 1.5px solid var(--p2);
  border-top: none;
  font-size: 13px;
  flex-wrap: wrap;
}
.reset-pw-form input {
  padding: 7px 9px;
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
  font-size: 13px;
  width: 160px;
}
.reset-pw-form button {
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 7px 12px;
  border-radius: 3px;
  font-size: 12.5px;
  font-weight: 700;
}
.reset-pw-form .cancel { background: transparent; color: var(--ink); }
.reset-pw-result {
  padding: 10px 18px;
  background: var(--p3-soft);
  border: 1.5px solid var(--p3);
  border-top: none;
  font-size: 13px;
}
