/* ── Doarper Kwis palet ──────────────────────────────────────────────────── */
:root {
  --dk-dark:   #1F3864;
  --dk-med:    #2E75B6;
  --dk-light:  #D6E4F0;
  --dk-orange: #F4B942;
  --dk-white:  #FFFFFF;
  --bg:        #F0F4F8;
  --text:      #1a1a2e;
  --border:    #C8D8E8;
  --green:     #2E7D32;
  --yellow:    #F57F17;
  --red:       #C62828;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  background: var(--dk-dark);
  color: var(--dk-white);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-dk {
  background: var(--dk-orange);
  color: var(--dk-dark);
  font-weight: 900;
  font-size: 22px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  letter-spacing: -1px;
}
.header-main { font-size: 18px; font-weight: 700; line-height: 1.2; }
.header-sub  { font-size: 12px; color: var(--dk-light); letter-spacing: 1px; text-transform: uppercase; }

.header-status {
  background: var(--dk-orange);
  color: var(--dk-dark);
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
}
.header-status.running { background: #4CAF50; color: white; }
.header-status.error   { background: #f44336; color: white; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  background: var(--dk-med);
  display: flex;
  gap: 2px;
  padding: 0 16px;
  overflow-x: auto;
}
.tab {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.tab:hover  { color: white; background: rgba(255,255,255,0.1); }
.tab.active { color: var(--dk-orange); border-bottom-color: var(--dk-orange); background: rgba(0,0,0,0.15); }

/* ── Main content ────────────────────────────────────────────────────────── */
main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px 40px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

h2 {
  color: var(--dk-dark);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--dk-orange);
}
h3 { color: var(--dk-dark); font-size: 16px; margin-bottom: 10px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dk-dark);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fafcff;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--dk-med);
}
.hint { color: #888; font-size: 12px; margin-top: 4px; display: block; }

.path-row { display: flex; gap: 8px; }
.path-row input { flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition-property: background-color, color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.btn-primary   { background: var(--dk-dark); color: white; }
.btn-primary:hover   { background: var(--dk-med); }
.btn-secondary { background: var(--dk-light); color: var(--dk-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: #bdd4e8; }
.btn-danger    { background: #c62828; color: white; }
.btn-danger:hover    { background: #a31515; }
.btn-lg        { padding: 12px 28px; font-size: 16px; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; }

.save-msg { color: var(--green); margin-left: 12px; font-weight: 600; }

/* ── Scan controls ───────────────────────────────────────────────────────── */
.scan-controls { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }

.progress-block { margin: 16px 0; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 600; color: var(--dk-dark); }
.progress-bar-wrap { background: var(--dk-light); border-radius: 20px; height: 18px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--dk-dark), var(--dk-med)); height: 100%; width: 0%; transition: width 0.4s; border-radius: 20px; }
.progress-current { color: #666; font-size: 12px; margin-top: 4px; }

.scan-overall-text { font-size: 13px; color: #666; font-weight: 600; margin-left: 4px; }

/* ── Per-kwisboek bestandslijst ─────────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.file-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) 130px auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafcff;
  transition: background 0.15s, border-color 0.15s;
}
.file-row.status-bezig    { border-color: var(--dk-med); background: #f0f7ff; }
.file-row.status-klaar    { border-color: var(--green); }
.file-row.status-fout     { border-color: var(--red); background: #fff5f5; }
.file-row.status-gestopt  { border-color: var(--yellow); background: #fffdf0; }
.file-row.excluded { opacity: 0.55; }

.file-row-check { flex-shrink: 0; width: 18px; height: 18px; cursor: pointer; }

.file-row-main { min-width: 0; }
.file-row-name {
  font-weight: 600;
  color: var(--dk-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.file-row-sub {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.file-row-bar-wrap {
  background: var(--dk-light);
  border-radius: 12px;
  height: 10px;
  overflow: hidden;
}
.file-row-bar {
  background: linear-gradient(90deg, var(--dk-dark), var(--dk-med));
  height: 100%;
  width: 0%;
  transition: width 0.3s;
  border-radius: 12px;
}
.file-row.status-klaar   .file-row-bar { background: var(--green); }
.file-row.status-fout    .file-row-bar { background: var(--red); }
.file-row.status-gestopt .file-row-bar { background: var(--yellow); }

.file-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.file-row-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.file-row-status.status-wachten { background: #f0f0f0; color: #777; }
.file-row-status.status-bezig   { background: #e3f2fd; color: var(--dk-med); }
.file-row-status.status-klaar   { background: #e8f5e9; color: var(--green); }
.file-row-status.status-fout    { background: #ffebee; color: var(--red); }
.file-row-status.status-gestopt { background: #fff8e1; color: var(--yellow); }

.btn-rescan {
  background: var(--dk-light);
  color: var(--dk-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.btn-rescan:hover:not(:disabled) { background: var(--dk-med); color: white; }
.btn-rescan:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 600px) {
  .file-row { grid-template-columns: auto 1fr auto; grid-template-areas: "check name actions" "check bar bar"; row-gap: 6px; }
  .file-row-check { grid-area: check; }
  .file-row-main { grid-area: name; }
  .file-row-bar-wrap { grid-area: bar; }
  .file-row-actions { grid-area: actions; }
}

.log-box {
  background: #0f1923;
  color: #aaf0a0;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  padding: 14px;
  border-radius: 8px;
  max-height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 12px;
  min-height: 60px;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--dk-dark);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  position: sticky;
  top: 0;
}
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:nth-child(even) td { background: #f7fafd; }
.data-table tr:hover td { background: var(--dk-light); }
.data-table .rank-1 td { background: #FFF8E1; font-weight: 700; }
.data-table .rank-1 td:first-child { color: var(--dk-orange); font-size: 18px; }

.empty-row { text-align: center; color: #999; padding: 24px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green  { background: #e8f5e9; color: var(--green); }
.badge-yellow { background: #fff8e1; color: var(--yellow); }
.badge-red    { background: #ffebee; color: var(--red); }
.badge-grey   { background: #f5f5f5; color: #666; }
.badge-orange { background: #fff3e0; color: #e65100; }

.badge-link {
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.badge-link:hover { filter: brightness(0.92); text-decoration: underline; }

/* ── Review cards ────────────────────────────────────────────────────────── */
.review-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.review-card.bijna { border-left: 4px solid var(--dk-orange); }
.review-card.handmatig { border-left: 4px solid var(--dk-med); }
.review-crop {
  flex: 0 0 auto;
  max-width: 200px;
  max-height: 80px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.review-crop:hover {
  transform: scale(2.8);
  transform-origin: top left;
  position: relative;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.review-info { flex: 1; }
.review-info h4 { color: var(--dk-dark); font-size: 14px; margin-bottom: 4px; }
.review-info .meta { color: #666; font-size: 12px; margin-bottom: 8px; }
.review-info .answer { font-size: 15px; font-weight: 600; }
.review-info .correct { font-size: 13px; color: #555; margin-top: 2px; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.btn-score {
  background: var(--dk-light);
  color: var(--dk-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.btn-score.selected { background: var(--dk-dark); color: white; }
.btn-score:hover { background: var(--dk-med); color: white; }

/* ── Export ──────────────────────────────────────────────────────────────── */
.export-msg {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.export-msg.ok  { background: #e8f5e9; color: var(--green); }
.export-msg.err { background: #ffebee; color: var(--red); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.modal-box {
  background: white;
  border-radius: 12px;
  padding: 28px;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.modal-box h3 { margin-bottom: 14px; color: var(--dk-dark); }
.modal-box p  { margin-bottom: 6px; }

/* ── Google Drive ────────────────────────────────────────────────────────── */
.drive-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}
.drive-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}
.drive-dot.connected    { background: #4CAF50; }
.drive-dot.disconnected { background: #ccc; }
.drive-dot.error        { background: #f44336; }

.setup-steps {
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 4px;
  font-size: 13px;
}
.setup-steps summary { cursor: pointer; font-weight: 600; color: var(--dk-dark); }
.setup-steps ol  { margin: 10px 0 0 18px; line-height: 1.8; }
.setup-steps code {
  background: #e8f0fe; padding: 1px 6px; border-radius: 4px;
  font-size: 12px; color: #1a73e8;
}
.setup-uri-table {
  margin: 10px 0 4px 0;
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.setup-uri-table td {
  padding: 7px 10px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.setup-uri-table tr:first-child td { background: #f0f7ff; }
.setup-uri-table tr:last-child  td { background: #f0fff4; }
.setup-uri-table td:first-child { width: 52%; }

.drive-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.drive-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.drive-action-icon { font-size: 24px; flex-shrink: 0; }
.drive-action-card > div:nth-child(2) { flex: 1; }
.drive-action-sub { font-size: 12px; color: #666; margin-top: 2px; }

/* Drive map-browser */
.drive-breadcrumb {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}
.drive-crumb {
  color: var(--dk-med);
  cursor: pointer;
  text-decoration: underline;
}
.drive-crumb:last-child { color: var(--text); text-decoration: none; cursor: default; }
.drive-crumb-sep { color: #aaa; }

.drive-file-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 340px;
  overflow-y: auto;
}
.drive-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.drive-file-item:last-child { border-bottom: none; }
.drive-file-item:hover      { background: var(--dk-light); }
.drive-file-item.selected   { background: #e3f2fd; }
.drive-file-icon { font-size: 18px; flex-shrink: 0; }
.drive-file-name { flex: 1; }
.drive-file-date { font-size: 11px; color: #999; }
.drive-loading   { padding: 24px; text-align: center; color: #999; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .path-row { flex-direction: column; }
  .scan-controls { flex-direction: column; align-items: stretch; }
  .review-card { flex-direction: column; }
}

/* ── Beoordelen per vraag ─────────────────────────────────────────────── */
/* Eén scherm per vraag: sleutel bovenaan, dan lezingen en antwoorden, onderaan de
   knoppenbalk. Getallen in tabelcijfers zodat kolommen niet verspringen. */
#tab-beoordelen { font-variant-numeric: tabular-nums; }
#tab-beoordelen h2 { border-bottom: none; padding-bottom: 0; margin-bottom: 6px; }

.bd-start { display: grid; grid-template-columns: 1fr minmax(220px, 300px) auto; gap: 24px; align-items: center; }
.bd-start-tekst p { color: #4a5568; max-width: 60ch; }
.bd-mijn { font-weight: 600; color: var(--dk-dark); margin-bottom: 6px; }
.bd-mijn .bd-groot { font-size: 22px; }
.bd-totaal { font-size: 12px; color: #667; margin-top: 6px; }
.bd-balk { height: 8px; background: var(--dk-light); border-radius: 4px; overflow: hidden; }
.bd-balk > div { height: 100%; width: 0; background: var(--green); border-radius: 4px;
                 transition: width 300ms cubic-bezier(0.2, 0, 0, 1); }
.bd-uitleg { color: #4a5568; margin-bottom: 12px; }
.bd-knoprij { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }

/* Onder de vaste kop blijven bij scrollen naar de vraag */
.bd-vraag, .bd-rij { scroll-margin-top: 76px; scroll-margin-bottom: 72px; }
.bd-vraag a, .bd-wachtrij a, .bd-controleer a { color: var(--dk-med); font-weight: 600; }

/* Kop van de vraag */
.bd-kop { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bd-kop h3 { font-size: 20px; margin: 0; }
.bd-meta { font-size: 13px; color: #667; }
.bd-sleutel { margin: 12px 0 4px; padding: 12px 16px; background: var(--bg); border-radius: 8px; }
.bd-sleutel-label { font-size: 12px; color: #667; }
.bd-sleutel-tekst { font-size: 18px; font-weight: 700; color: var(--dk-dark); }
.bd-sleutel-syn { font-size: 13px; color: #4a5568; margin-top: 2px; }
.bd-melding { background: #fff8e1; border-left: 4px solid var(--dk-orange); padding: 10px 14px; border-radius: 6px; margin: 12px 0; }

/* Groepen en rijen */
.bd-groep { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 4px; font-weight: 700; color: var(--dk-dark); }
.bd-groep .bd-aantal { font-weight: 400; color: #667; font-size: 13px; }
.bd-groep.twijfel { color: #a85d00; }
details > summary.bd-groep { cursor: pointer; list-style: none; }
details > summary.bd-groep::before { content: "▸"; color: #667; }
details[open] > summary.bd-groep::before { content: "▾"; }

.bd-rij { display: grid; grid-template-columns: minmax(140px, 1fr) 64px auto auto; gap: 12px; align-items: center;
          padding: 8px 10px 8px 12px; border-bottom: 1px solid #edf2f7; position: relative;
          transition: background-color 120ms ease-out; }
.bd-rij.focus { background: #eef5fb; }
.bd-rij.focus::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
                        border-radius: 2px; background: var(--dk-orange); }
.bd-rij.hoofdjury { opacity: 0.6; }
.bd-tekst { font-size: 15px; word-break: break-word; color: var(--text); }
.bd-sub { display: block; font-size: 12px; color: #667; margin-top: 2px; }
.bd-label { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.bd-label.aangepast { background: #fff3e0; color: #a85d00; }
.bd-label.hoofdjury { background: #ede7f6; color: #5e35b1; }
.bd-label.klopt { background: #e8f5e9; color: var(--green); }
.bd-n { font-size: 13px; color: #4a5568; text-align: right; white-space: nowrap; }

/* Puntenkeuze: segmentknop; voorstel = stip onder het getal */
.bd-punten { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.bd-punten button { position: relative; min-width: 36px; height: 32px; padding: 0 10px; border: none; border-radius: 6px;
                    background: transparent; color: var(--dk-dark); font: inherit; font-weight: 700; cursor: pointer;
                    transition-property: background-color, color, scale; transition-duration: 150ms; transition-timing-function: ease-out; }
.bd-punten button.voorstel::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px;
                                    margin-left: -2px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.bd-punten button.gekozen { background: var(--dk-dark); color: #fff; }
/* 0 en vol getint i.p.v. vol gekleurd: een lijst met foute antwoorden blijft rustig */
.bd-punten button.gekozen.nul { background: #fdecea; color: var(--red); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.35); }
.bd-punten button.gekozen.vol { background: #e6f4ea; color: var(--green); box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.4); }
.bd-punten button:disabled { cursor: not-allowed; }
.bd-punten input { width: 72px; height: 32px; padding: 4px 8px; border: none; background: transparent; }

.bd-acties-rij { display: flex; gap: 4px; }
.bd-klein { border: 1px solid transparent; background: transparent; color: var(--dk-med); font: inherit; font-size: 13px;
            font-weight: 600; padding: 5px 8px; border-radius: 6px; cursor: pointer;
            transition-property: background-color, scale; transition-duration: 150ms; transition-timing-function: ease-out; }
.bd-klein:disabled { color: #a0aec0; cursor: not-allowed; }

/* Uitsneden: altijd een neutrale omlijning, nooit getint */
.bd-scan { display: block; max-width: 100%; max-height: 110px; background: #fff; border-radius: 4px;
           outline: 1px solid oklch(0 0 0 / 0.1); outline-offset: -1px; }
.bd-scans { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 0 6px; }
.bd-scans figure { margin: 0; max-width: 280px; }
.bd-scans figcaption { font-size: 12px; color: #667; margin-top: 2px; }

/* hidden moet winnen van display:flex hieronder */
.bd-vraag [hidden] { display: none !important; }

/* Lezingen controleren */
.bd-lezing { display: grid; grid-template-columns: minmax(200px, 360px) 1fr auto; gap: 16px; align-items: center;
             padding: 10px 0; border-bottom: 1px solid #edf2f7; }
.bd-lezing.klaar { opacity: 0.6; }
.bd-lezing-tekst { font-size: 16px; font-weight: 600; color: var(--text); }
.bd-lezing-tekst.leeg { font-style: italic; font-weight: 400; color: #667; }
.bd-lezing-acties { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bd-corrigeer { display: flex; gap: 6px; margin-top: 6px; }
.bd-corrigeer input { max-width: 280px; }

/* Knoppenbalk blijft onder in beeld zolang de vraag open is */
.bd-balkonder { position: sticky; bottom: 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
                margin: 18px -24px -24px; padding: 12px 24px; background: #fff; border-radius: 0 0 10px 10px;
                box-shadow: 0 -1px 0 rgba(31,56,100,0.08), 0 -6px 16px rgba(31,56,100,0.06); }
.bd-toetsen { margin-left: auto; font-size: 12px; color: #667; }
kbd { font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; padding: 2px 5px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); }

/* Wachtrij hoofdjury */
.bd-wachtrij { border-left: 4px solid #5e35b1; }
.bd-twijfel { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid #edf2f7; }
.bd-twijfel:last-child { border-bottom: none; }
.bd-twijfel-wat { font-weight: 600; }
.bd-notitie { font-size: 13px; color: #4a5568; margin-top: 2px; }
.bd-twijfel-acties { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Controleren (vier-ogen, blind, steekproef) */
.bd-controleer { border-left: 4px solid var(--dk-med); }
.bd-bevestig { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid #edf2f7; }
.bd-bevestig:last-child { border-bottom: none; }
.bd-controle { padding: 12px 16px; background: var(--bg); border-radius: 8px; margin-top: 8px; }
.bd-controle .bd-sleutel { background: #fff; }
.bd-controle-vraag { font-weight: 600; margin: 10px 0 6px; }
.bd-label.kans { background: #fff3e0; color: #8a4b00; }

/* Kwaliteit */
.bd-kwaliteit { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.bd-kwaliteit h4 { color: var(--dk-dark); margin-bottom: 4px; }
.bd-kwaliteit label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.bd-kw-getal { font-size: 14px; }
.bd-kw-getal strong { font-size: 22px; color: var(--dk-dark); }

/* Raster en mensen */
.bd-tabelscroll { overflow-x: auto; overscroll-behavior-x: contain; }
.bd-mensen .num { text-align: right; }
.bd-legenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #4a5568; margin-top: 8px; }
.bd-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.bd-legenda .bd-cel { width: 12px; height: 12px; cursor: default; }
.bd-raster { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 10px; }
.bd-cel { display: inline-block; width: 28px; height: 22px; border-radius: 4px; border: none; padding: 0; font-family: inherit; font-size: 9px; font-weight: 600; line-height: 22px;
          text-align: center; cursor: pointer; color: #2d3748; }
.bd-cel.klaar { background: #a5d6a7; }
.bd-cel.open  { background: #e2e8f0; }
.bd-cel.bezig { background: var(--dk-orange); }
.bd-cel.wacht { background: #d1c4e9; }

/* Drukken: kleine schaal, alleen zonder voorkeur voor beperkte beweging */
@media (prefers-reduced-motion: no-preference) {
  .btn:not(:disabled):active, .bd-punten button:not(:disabled):active,
  .bd-klein:not(:disabled):active, .bd-cel:active { scale: 0.96; }
}
/* Hover alleen op apparaten die kunnen hoveren (anders blijft hij 'hangen' na een tik) */
@media (hover: hover) {
  .bd-rij:hover { background: #f7fafc; }
  .bd-rij.focus:hover { background: #eef5fb; }
  .bd-punten button:not(.gekozen):not(:disabled):hover { background: var(--dk-light); }
  .bd-klein:not(:disabled):hover { background: var(--dk-light); }
  .bd-cel:hover { outline: 2px solid var(--dk-med); outline-offset: 1px; }
}
.bd-punten button, .bd-klein, .bd-cel { -webkit-tap-highlight-color: transparent; }
.bd-punten button:focus-visible, .bd-klein:focus-visible, .bd-cel:focus-visible { outline: 2px solid var(--dk-med); outline-offset: 2px; }

@media (max-width: 760px) {
  .bd-start { grid-template-columns: 1fr; }
  .bd-rij { grid-template-columns: 1fr auto; }
  .bd-rij .bd-n { text-align: left; }
  .bd-lezing { grid-template-columns: 1fr; }
  .bd-lezing-acties { justify-content: flex-start; }
  .bd-twijfel { grid-template-columns: 1fr; }
  .bd-twijfel-acties { justify-content: flex-start; }
  .bd-toetsen { display: none; }
}
.bd-twijfel > *, .bd-lezing > *, .bd-rij > * { min-width: 0; }

/* ── Inloggen en gebruikers (servermodus) ───────────────────────────────── */
.login-card { max-width: 380px; margin: 48px auto; }
.login-card h2 { margin-bottom: 16px; }
.login-card .btn { width: 100%; margin-bottom: 10px; }
.login-fout { color: var(--red); margin-bottom: 12px; }
.header-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.header-user form { display: inline; }
.header-user .btn { padding: 4px 10px; font-size: 12px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.upload-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 14px; }
.upload-row input[type="file"] { width: auto; }
