/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #dde1e6;
  --text: #1a2332;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.1);
}

body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }

/* ---- Buttons ---- */
button, .btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 6px; font-size: 13px;
  font-weight: 500; cursor: pointer; border: none; transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f0f2f5; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f0f2f5; }
.btn-danger { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fecaca; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 13px; color: var(--text-muted); }
input, textarea, select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; color: var(--text); background: var(--surface); outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; font-family: inherit; }

/* ---- Utils ---- */
.hidden { display: none !important; }
.page-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.error-msg { color: var(--danger); font-size: 13px; }
.success-msg { color: var(--ok); font-size: 13px; }
.empty-state { color: var(--text-muted); padding: 32px; text-align: center; }

/* ---- Editor layout ---- */
.editor-layout { display: flex; height: 100vh; overflow: hidden; }

/* ---- Sidebar ---- */
.sidebar { width: 300px; min-width: 300px; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar-title { padding: 14px 16px 8px; font-size: 1rem; border-bottom: 1px solid var(--border); }

.stat-block { padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.stat-value { font-weight: 700; font-size: 17px; }
.stat-value.over-budget { color: var(--danger); }
.stat-sub { font-size: 11px; font-weight: 500; }

.budget-bar, .livability-bar { height: 7px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.budget-bar > div, .livability-bar > div { height: 100%; border-radius: 3px; transition: width .3s, background .3s; }

.requirements-block { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.req-item { list-style: none; display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12.5px; }
.req-item.ok { color: var(--ok); }
.req-item.nok { color: var(--text-muted); }
.req-icon { font-size: 11px; width: 14px; }

.palette-block { padding: 10px 14px; }
.palette-category h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 10px 0 4px; }
.palette-item {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 5px 8px; margin-bottom: 2px; border-radius: 6px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; text-align: left; transition: background .1s;
}
.palette-item:hover { background: #f0f4ff; }
.palette-item.selected { background: #eff6ff; border-color: var(--primary); }
.palette-item.unaffordable { opacity: .4; }
.palette-swatch {
  width: 28px; height: 28px; border-radius: 5px; border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold; color: white; flex-shrink: 0;
}
.palette-label { flex: 1; font-size: 13px; }
.palette-cost { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ---- Grid wrapper ---- */
.grid-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.grid-toolbar { flex-shrink: 0; display: flex; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.grid-toolbar button.active { background: #fef3c7; border-color: #f59e0b; }
.docent-link { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.canvas-area { flex: 1; min-height: 0; display: flex; flex-direction: row; align-items: stretch; gap: 12px; overflow: hidden; padding: 12px 12px 12px 16px; }
.canvas-center { flex: 1; overflow: auto; min-width: 0; min-height: 0; padding: 4px; }
.canvas-center canvas { display: block; }
.btn-sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .btn-sidebar-toggle { display: inline-flex; }
  .sidebar-backdrop.active {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
  }
  #sidebar-mount {
    display: none;
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: 300px;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.45);
    overflow-y: auto;
  }
  #sidebar-mount.sidebar-open { display: block; }
  .grid-toolbar { flex-wrap: wrap; }
  .legend-panel { display: none; }
}
#grid-canvas { display: block; cursor: crosshair; box-shadow: var(--shadow); border-radius: 4px; height: 100%; width: auto; max-width: 100%; }

/* ---- Legend panel ---- */
.legend-panel { width: 176px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; align-self: flex-start; max-height: 100%; }
.legend-panel-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.legend-items { overflow-y: auto; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-bottom: 1px solid #f4f4f4; }
.legend-item:last-child { border-bottom: none; }
.legend-swatch { width: 22px; height: 22px; border-radius: 4px; border: 2px solid; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; }
.legend-label { flex: 1; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-count { font-size: 11px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.legend-section { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 6px 10px 2px; background: #f8f9fa; border-bottom: 1px solid var(--border); }
.legend-empty { font-size: 12px; color: var(--text-muted); padding: 12px 10px; font-style: italic; }
.heatmap-legend { border-top: 1px solid var(--border); flex-shrink: 0; }
.heatmap-scale { display: flex; gap: 8px; align-items: stretch; padding: 10px 10px 6px; }
.heatmap-scale-bar { width: 18px; flex-shrink: 0; border-radius: 4px; background: linear-gradient(to bottom, #c0392b, #f4a460, #e8e8e8, #7ec8e3, #1e6091); }
.heatmap-scale-labels { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--text-muted); min-height: 90px; }
.heatmap-examples { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.heatmap-ex { font-size: 10px; padding: 2px 6px; border-radius: 3px; }
.heatmap-ex--cool    { background: rgba(30, 96, 145, 0.15); color: #1e6091; }
.heatmap-ex--neutral { background: rgba(0,0,0,0.04); color: var(--text-muted); }
.heatmap-ex--warm    { background: rgba(244, 164, 96, 0.2); color: #b5541a; }
.heatmap-ex--hot     { background: rgba(192, 57, 43, 0.15); color: #922b21; font-weight: 600; }
.flood-scale-bar { width: 18px; flex-shrink: 0; border-radius: 4px; background: linear-gradient(to bottom, #1a4fa8, #7ec8e3, #e8f8e8, #5cb85c); }
.flood-ex--safe  { background: rgba(92, 184, 92, 0.18); color: #276327; }
.flood-ex--risk  { background: rgba(70, 130, 220, 0.18); color: #1a3a8a; }
.flood-ex--high  { background: rgba(30, 50, 180, 0.2);  color: #0a1a6a; font-weight: 600; }
.flood-ex--water { background: rgba(93, 173, 226, 0.2);  color: #1a5276; font-style: italic; }

/* ---- 15-minutenstad legenda ---- */
.access-score-legend { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 4px; }
.access-score-item   { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.access-dot          { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.access-score-4 .access-dot { background: rgba( 39,174, 96, 0.85); }
.access-score-3 .access-dot { background: rgba(125,172, 33, 0.85); }
.access-score-2 .access-dot { background: rgba(212,172, 13, 0.85); }
.access-score-1 .access-dot { background: rgba(211, 84,  0, 0.85); }
.access-score-0 .access-dot { background: rgba(192, 57, 43, 0.85); }
.access-cats { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 4px; }
.access-cat  { padding-top: 4px; }
.access-cat strong { color: var(--text); font-size: 11px; }

/* ---- Livability tooltip ---- */
.lv-tooltip {
  position: fixed;
  z-index: 200;
  width: 250px;
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.tt-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: #fff; }
.tt-stats { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.tt-stat  { display: flex; justify-content: space-between; gap: 8px; }
.tt-stat span:first-child { color: #94a3b8; }
.tt-stat span:last-child  { font-weight: 700; white-space: nowrap; }
.tt-stat span.pos { color: #6ee7b7; }
.tt-stat span.neg { color: #fca5a5; }
.tt-note { margin: 3px 0 0; font-size: 11.5px; color: #94a3b8; font-style: italic; }
.tt-note.pos { color: #6ee7b7; }
.tt-note.neg { color: #fca5a5; }
.tt-divider { border: none; border-top: 1px solid rgba(255,255,255,0.15); margin: 7px 0; }
.tt-total { margin-bottom: 6px; color: #cbd5e1; }
.tt-total strong { color: #fff; }
.tt-items { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.tt-items li { display: flex; justify-content: space-between; gap: 8px; }
.tt-items li span:last-child { font-weight: 700; white-space: nowrap; }
.tt-items li.pos span:last-child { color: #6ee7b7; }
.tt-items li.neg span:last-child { color: #fca5a5; }
.tt-empty { color: rgba(255,255,255,0.4); font-style: italic; margin: 0; }
.tt-access-title { font-size: 11px; font-weight: 600; color: #94a3b8; margin-bottom: 4px; }
.tt-access-cats  { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.tt-access-cat   { font-size: 11.5px; }
.tt-access-cat.pos { color: #6ee7b7; }
.tt-access-cat.neg { color: #fca5a5; }

/* Special building popover */
.special-overlay { position: fixed; inset: 0; background: transparent; z-index: 100; }
.special-dialog { position: fixed; background: var(--surface); padding: 14px 16px; border-radius: 10px; width: 276px; box-shadow: 0 6px 24px rgba(0,0,0,0.18), 0 0 0 1px var(--border); }
.special-dialog-header { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px; }
.special-name-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 10px; }
.special-colors { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid; cursor: pointer; padding: 0; outline: none; transition: transform .1s; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { transform: scale(1.1); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(0,0,0,0.4); }
.special-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- Landing page ---- */
.landing-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.landing-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 36px; width: 100%; max-width: 420px; }
.landing-title { font-size: 1.8rem; margin-bottom: 6px; }
.landing-sub { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }
.landing-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 0; }
.landing-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.landing-input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; outline: none; transition: border-color .15s; }
.landing-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.landing-divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; margin: 16px 0; }
.landing-divider::before, .landing-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sandbox-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sandbox-mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.sandbox-mode-btn:hover { border-color: var(--primary); background: #eff6ff; }
.sandbox-mode-title { font-size: 14px; font-weight: 600; color: var(--text); }
.sandbox-mode-desc { font-size: 11px; color: var(--text-muted); text-align: center; }
.landing-sandbox-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.landing-teacher-link { text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.landing-teacher-link a { font-size: 12px; color: var(--text-muted); }
.landing-teacher-link a:hover { color: var(--text); }
.btn-block { width: 100%; justify-content: center; padding: 10px 16px; font-size: 14px; }

/* ---- Submit page ---- */
.submit-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.submit-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 480px; }
.submit-card h1 { margin-bottom: 20px; }
.submit-summary { display: flex; gap: 16px; margin-bottom: 20px; padding: 14px; background: var(--bg); border-radius: 6px; }
.summary-stat { display: flex; flex-direction: column; align-items: center; flex: 1; }
.summary-stat span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.summary-stat strong { font-size: 18px; font-weight: 700; }
.submit-warning { background: #fffbeb; border: 1px solid #fbbf24; border-radius: 6px; padding: 10px 12px; margin-bottom: 16px; font-size: 13px; color: #92400e; }
.submit-card form { display: flex; flex-direction: column; gap: 14px; }
.submit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.submit-class-info { background: var(--bg); border-radius: 6px; padding: 10px 14px; font-size: 13px; }
.submit-class-code { color: var(--text-muted); font-size: 12px; }

/* ---- Shared city page ---- */
.shared-page { min-height: 100vh; background: var(--bg); }
.shared-header { text-align: center; padding: 24px 16px 12px; }
.shared-subtitle { color: var(--text-muted); margin-top: 4px; }
.shared-body { display: flex; gap: 24px; padding: 0 24px 24px; flex-wrap: wrap; justify-content: center; }
.shared-grid-wrap canvas { display: block; box-shadow: var(--shadow); border-radius: 4px; max-height: calc(100vh - 140px); width: auto; }
.shared-info { width: 260px; display: flex; flex-direction: column; gap: 16px; }
.shared-stats { background: var(--surface); border-radius: var(--radius); padding: 16px; }
.ss-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
.ss-value { font-size: 2rem; font-weight: 800; display: block; }
.vote-block { display: flex; gap: 12px; }
.vote-btn { flex: 1; justify-content: center; padding: 14px; font-size: 20px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all .15s; }
.vote-btn:hover { background: #f0f4ff; border-color: var(--primary); }
.vote-btn.voted { background: #eff6ff; border-color: var(--primary); }
.shared-reqs { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.shared-reqs ul { margin-top: 6px; }

/* ---- Login ---- */
.login-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 380px; }
.login-card h1 { margin-bottom: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }

/* ---- Dashboard ---- */
.dashboard-page { padding: 24px; max-width: 1100px; margin: 0 auto; }
.dash-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.dash-header h1 { flex: 1; }
.dash-actions { display: flex; gap: 8px; }
.submissions-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.submissions-table th { background: #f8f9fa; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.submissions-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.submissions-table tr:hover td { background: #f8faff; }
.lv-badge { color: white; padding: 2px 8px; border-radius: 12px; font-weight: 700; font-size: 12px; }
.lv-badge[style*="c8960c"] { color: #1a1200; } /* goud: donkere tekst leesbaarder */

/* ---- Detail ---- */
.detail-page { padding: 20px 24px; max-width: 1100px; margin: 0 auto; }
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.detail-header h1 { flex: 1; }
.detail-header small { font-size: .75em; color: var(--text-muted); font-weight: 400; }
.detail-body { display: flex; gap: 24px; flex-wrap: wrap; }
.detail-grid-wrap canvas { display: block; box-shadow: var(--shadow); border-radius: 4px; max-height: calc(100vh - 120px); width: auto; }
.detail-info { width: 280px; display: flex; flex-direction: column; gap: 16px; }
.detail-stats { display: flex; gap: 10px; }
.ds { flex: 1; background: var(--surface); border-radius: 6px; padding: 10px 12px; }
.ds span { font-size: 11px; text-transform: uppercase; color: var(--text-muted); display: block; }
.ds strong { font-size: 17px; font-weight: 700; }
.detail-reqs { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.detail-reqs ul { margin-top: 6px; }
.grade-form { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ---- Class manager ---- */
.class-manager-page { padding: 24px; max-width: 800px; margin: 0 auto; }
.new-class-form { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.new-class-form h3 { margin-bottom: 10px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.form-row input { flex: 1; min-width: 120px; }
.classes-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.classes-table th { background: #f8f9fa; font-size: 12px; text-transform: uppercase; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.classes-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
code { background: #f0f2f5; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 13px; }
.mode-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mode-basic   { background: #e0f2fe; color: #0369a1; }
.mode-expert  { background: #fef3c7; color: #92400e; }
.mode-master  { background: #1b2631; color: #f0e6ff; }
.mode-custom  { background: #f0fdf4; color: #166534; }
.sandbox-mode-btn--master { border-color: #2e4053; }
.sandbox-mode-btn--master:hover { border-color: #1b2631; background: #f0e6ff; }

/* ---- Isometrische weergave ---- */
.iso-view { display: flex; flex-direction: column; height: 100vh; background: #1a2332; }
.iso-toolbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.iso-title { font-weight: 600; font-size: 15px; }
.iso-canvas-wrap { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 24px; }
.iso-canvas-wrap canvas { display: block; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.iso-empty { color: #aaa; padding: 48px; font-size: 15px; }

/* ---- Klasoverzicht ---- */
.class-overview-page { padding: 24px; max-width: 1000px; margin: 0 auto; }
.cls-code-badge { font-size: 14px; font-weight: 400; margin-left: 8px; }
.overview-section { margin-bottom: 32px; }
.overview-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.student-add-form { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.student-add-form input { flex: 1; min-width: 200px; max-width: 320px; }
.student-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.student-item { display: flex; align-items: center; gap: 6px; background: #f0f4ff; border: 1px solid #c7d2fe; border-radius: 20px; padding: 4px 10px 4px 12px; font-size: 13px; }
.btn-remove-student { background: none; border: none; cursor: pointer; color: #6b7280; font-size: 14px; line-height: 1; padding: 0 2px; }
.btn-remove-student:hover { color: #dc2626; }
.overview-table { margin-top: 8px; }
.overview-table .custom-reqs-col { color: #9ca3af; font-style: italic; }
.row-not-submitted td { color: #9ca3af; }
.unmatched-title { font-size: 14px; color: #6b7280; margin: 20px 0 8px; }
.cls-actions { display: flex; gap: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-yes     { background: #d1fae5; color: #065f46; }
.badge-no      { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #92400e; }

/* ---- Opdrachtinstellingen (custom modus) ---- */
.custom-reqs-section { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 16px 20px; }
.custom-reqs-form { display: flex; flex-direction: column; gap: 16px; }
.custom-reqs-row { display: flex; gap: 16px; flex-wrap: wrap; }
.custom-reqs-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.custom-reqs-row input[type="number"] { width: 140px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.cr-checks { border: 1px solid #bbf7d0; border-radius: 6px; padding: 12px 16px; background: white; }
.cr-checks legend { font-size: 13px; font-weight: 600; padding: 0 6px; color: #166534; }
.cr-checks-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
.cr-check-option { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cr-save-row { display: flex; align-items: center; gap: 12px; }
.save-feedback { font-size: 13px; color: #166534; font-weight: 500; }

/* ---- Opdrachttekst sectie ---- */
.assignment-text-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px 20px; }
.assignment-text-section .form-hint { font-size: 12px; color: #6b7280; font-weight: 400; margin-left: 8px; }
.assignment-text-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; resize: vertical; box-sizing: border-box; }

/* ---- Opdracht-blok in sidebar ---- */
.assignment-text-block { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.assignment-text-block h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #1e40af; }
.assignment-text-block p { margin: 0; font-size: 13px; line-height: 1.5; color: #1e3a8a; }

/* ---- Snel cijfer geven ---- */
.grade-quick-input { width: 60px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; text-align: center; }
.grade-quick-input:focus { outline: none; border-color: var(--primary); }

/* ---- Versiehistorie ---- */
.btn-history-toggle { background: none; border: none; cursor: pointer; font-size: 12px; color: #6b7280; padding: 0 4px; }
.btn-history-toggle:hover { color: var(--primary); }
.history-rows td { padding: 0; }
.history-cell { background: #f9fafb; padding: 8px 12px !important; }
.history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-table th { font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.history-table td { padding: 4px 8px; }
.history-table tr.row-link:hover td { background: #f0f4ff; cursor: pointer; }

/* ---- Klasinstellingen ---- */
.cls-settings-section { background: #fafafa; border: 1px solid var(--border); }
.settings-subsection { padding-top: 12px; margin-top: 4px; }
.settings-subsection + .settings-subsection { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.settings-subsection h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.cls-settings-form .form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.cls-settings-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.cls-settings-form input, .cls-settings-form select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.cls-settings-form input[id="cs-name"] { min-width: 200px; }

/* ---- Student edit ---- */
.si-actions { display: flex; gap: 4px; }
.student-item { display: flex; align-items: center; justify-content: space-between; }
.student-item--editing { display: block; }
.student-edit-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 4px 0; }
.student-edit-form input[type="text"] { flex: 1; min-width: 120px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.student-edit-form input[type="password"] { width: 160px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }

/* ---- Optionele gebouwen beschrijving ---- */
.opt-building-desc { color: #6b7280; font-size: 11px; font-weight: 400; }
