:root {
  --blauw: #1f3855;
  --geel: #f9a800;
  --wit: #ffffff;
  --lichtgrijs: #f4f6f9;
  --grijs: #6c757d;
  --donkergrijs: #343a40;
  --groen: #28a745;
  --rood: #dc3545;
  --rand: #dee2e6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--lichtgrijs);
  color: var(--donkergrijs);
  min-height: 100vh;
}

/* ── NAVIGATIE ── */
nav {
  background: var(--geel);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo img, .nav-logo svg {
  height: 36px;
  width: auto;
}

.nav-logo span {
  color: var(--blauw);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.nav-logo span em {
  color: var(--blauw);
  font-style: normal;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--blauw);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background: rgba(0,0,0,0.08);
  color: var(--blauw);
}

.nav-links a.active {
  background: var(--blauw);
  color: var(--wit);
  font-weight: 600;
}

.nav-user {
  color: var(--blauw);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── LAYOUT ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── PAGINA-HEADER ── */
.page-header {
  background: var(--blauw);
  color: var(--wit);
  padding: 2rem 2rem 1.5rem;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
}

.page-header .badge-geel {
  display: inline-block;
  background: var(--geel);
  color: var(--blauw);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── KAARTEN ── */
.card {
  background: var(--wit);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

.card-header {
  background: var(--blauw);
  color: var(--wit);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.25rem;
}

/* ── GRID ── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ── TRAINING-KAART ── */
.course-card {
  background: var(--wit);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}

.course-card-thumb {
  height: 140px;
  background: var(--blauw);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card-thumb .thumb-placeholder {
  font-size: 2.5rem;
  opacity: 0.4;
}

.course-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--blauw);
  margin-bottom: 0.35rem;
}

.course-card-desc {
  font-size: 0.85rem;
  color: var(--grijs);
  flex: 1;
  margin-bottom: 0.75rem;
}

.progress-bar-wrap {
  background: var(--lichtgrijs);
  border-radius: 20px;
  height: 8px;
  margin-bottom: 0.4rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--geel);
  border-radius: 20px;
  transition: width 0.4s;
}

.progress-bar.done {
  background: var(--groen);
}

.progress-label {
  font-size: 0.78rem;
  color: var(--grijs);
}

/* ── BADGES / LABELS ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-blauw { background: var(--blauw); color: var(--wit); }
.badge-geel { background: var(--geel); color: var(--blauw); }
.badge-groen { background: var(--groen); color: var(--wit); }
.badge-rood { background: var(--rood); color: var(--wit); }
.badge-grijs { background: #e9ecef; color: var(--grijs); }

/* ── KNOPPEN ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--geel); color: var(--blauw); }
.btn-secondary { background: var(--blauw); color: var(--wit); }
.btn-danger { background: var(--rood); color: var(--wit); }
.btn-ghost { background: transparent; color: var(--blauw); border: 2px solid var(--blauw); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }

/* ── FORMULIEREN ── */
.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--blauw);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 2px solid var(--rand);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--wit);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--geel);
}

textarea { min-height: 120px; resize: vertical; }

.form-hint {
  font-size: 0.78rem;
  color: var(--grijs);
  margin-top: 0.25rem;
}

/* ── TABEL ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  background: var(--blauw);
  color: var(--wit);
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--rand);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f9ff; }

/* ── ALERTS ── */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border-left: 4px solid;
}

.alert-success { background: #d4edda; color: #155724; border-color: var(--groen); }
.alert-error { background: #f8d7da; color: #721c24; border-color: var(--rood); }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #17a2b8; }

/* ── STAT-KAARTJES ── */
.stat-card {
  background: var(--wit);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blauw);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--grijs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .stat-accent { color: var(--geel); }

/* ── MODULE-BLOKKEN in content-editor ── */
.block-item {
  background: var(--wit);
  border: 2px solid var(--rand);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.block-type-badge {
  background: var(--blauw);
  color: var(--wit);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.05em;
  min-width: 70px;
  text-align: center;
}

.block-type-badge.type-text { background: #6f42c1; }
.block-type-badge.type-image { background: #fd7e14; }
.block-type-badge.type-video { background: #dc3545; }
.block-type-badge.type-question { background: var(--geel); color: var(--blauw); }

.block-preview {
  flex: 1;
  font-size: 0.88rem;
  color: var(--grijs);
}

.block-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* ── MODULE LEERDER-WEERGAVE ── */
.module-content-block {
  margin-bottom: 1.75rem;
}

.module-content-block img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.module-content-block .video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.module-content-block .video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.question-block {
  background: #f0f4ff;
  border: 2px solid #c5d0ee;
  border-radius: 10px;
  padding: 1.25rem;
}

.question-block h4 {
  color: var(--blauw);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--rand);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: var(--wit);
  transition: border-color 0.2s, background 0.2s;
}

.answer-option:hover { border-color: var(--geel); background: #fffbf0; }
.answer-option input[type="radio"] { accent-color: var(--geel); }

/* ── VOORTGANGSBALK in module ── */
.module-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--rand);
}

/* ── LOGIN / REGISTER ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blauw);
  padding: 2rem;
}

.auth-card {
  background: var(--wit);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo img, .auth-logo svg {
  height: 60px;
}

.auth-card h1 {
  font-size: 1.4rem;
  color: var(--blauw);
  margin-bottom: 0.25rem;
  text-align: center;
}

.auth-card .sub {
  color: var(--grijs);
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ── SIDEBAR LAYOUT ── */
.layout-sidebar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.sidebar {
  background: var(--wit);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 1.25rem 0;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grijs);
  padding: 0 1.25rem;
  margin-bottom: 0.75rem;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.88rem;
  color: var(--donkergrijs);
  text-decoration: none;
  transition: background 0.15s;
}

.sidebar a:hover { background: var(--lichtgrijs); }

.sidebar a.active {
  background: #eef2ff;
  color: var(--blauw);
  font-weight: 600;
  border-right: 3px solid var(--geel);
}

/* ── TOETS ── */
.exam-question {
  background: var(--wit);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.exam-question h3 {
  font-size: 1rem;
  color: var(--blauw);
  margin-bottom: 1rem;
}

.exam-question .q-number {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--geel);
  background: var(--blauw);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

/* ── TOETSRESULTAAT ── */
.result-score {
  text-align: center;
  padding: 2rem;
  background: var(--wit);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.result-score .big-score {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--blauw);
}

.result-score.passed .big-score { color: var(--groen); }
.result-score.failed .big-score { color: var(--rood); }

.result-score .result-label {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

/* ── HULP ── */
.divider {
  border: none;
  border-top: 1px solid var(--rand);
  margin: 1.5rem 0;
}

.text-muted { color: var(--grijs); font-size: 0.88rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }

@media (max-width: 768px) {
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
}
