:root {
  --primary: #1f2a44;
  --accent: #f5b400;
  --bg: #f4f5f8;
  --card: #ffffff;
  --text: #1c1f26;
  --muted: #6b7280;
  --border: #dfe2ea;
  --danger: #c0392b;
  --ok: #1e8e3e;
  --warn: #b7791f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }
a { color: var(--primary); }
code { background: #eef0f5; padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }

.topbar { background: var(--primary); color: #fff; }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15em; }
.brand span { color: var(--accent); font-weight: 400; }
.topbar nav a { color: #d9dce6; text-decoration: none; margin-left: 18px; padding: 6px 0; border-bottom: 2px solid transparent; }
.topbar nav a.active { color: #fff; border-color: var(--accent); }
.topbar nav a.muted { color: #9aa1b5; }

.container { max-width: 960px; margin: 24px auto; padding: 0 20px; }
.container.wide { max-width: 1400px; }
.footer { text-align: center; color: var(--muted); font-size: 0.85em; padding: 30px 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 18px 22px; margin-bottom: 20px; }
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
h1 { font-size: 1.5em; margin: 0 0 12px; }
h2 { font-size: 1.1em; margin: 18px 0 10px; }
.card h2:first-child { margin-top: 0; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.hint { color: var(--muted); font-size: 0.9em; margin: 6px 0 0; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 0.9em; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; font: inherit; font-weight: 400; background: #fff; }
textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; font: inherit; }
label.inline-label { display: flex; align-items: center; gap: 8px; margin: 0; }
label.inline-label input { margin: 0; width: auto; }
label.checkbox, .checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.checkbox input, .checkbox input { width: auto; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.inline-form label { margin: 0; }
.inline-form label input { width: 260px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }

.btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: var(--text); text-decoration: none; font: inherit; cursor: pointer; line-height: 1.2; }
.btn:hover { background: #f2f3f7; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #2c3a5e; }
.btn-danger { color: var(--danger); border-color: #e7c2be; }
.btn-danger:hover { background: #fbeceb; }
.btn-small { padding: 4px 9px; font-size: 0.85em; }
.btn[disabled] { opacity: 0.35; cursor: default; }
form.inline { display: inline; }
.actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table tr.dragging { opacity: 0.4; }
.table tr.drag-over td { border-top: 2px solid var(--accent); }
.drag-handle { cursor: grab; color: #b0b5c3; user-select: none; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.flash-success { background: #e8f5ec; border-color: #b8e0c4; color: #17662c; }
.flash-error { background: #fbeceb; border-color: #f0c1bd; color: #8b1d12; }
.flash-warning { background: #fff7e0; border-color: #f2dc9b; color: #6e4a00; }
.flash ul { margin: 8px 0 0; padding-left: 20px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.78em; font-weight: 600; background: #eef0f5; color: var(--muted); }
.badge-actueel, .badge-ok, .badge-status-live { background: #e8f5ec; color: var(--ok); }
.badge-verouderd, .badge-lijkt, .badge-status-klaar { background: #fff7e0; color: var(--warn); }
.badge-ontbreekt, .badge-dubbel, .badge-fout { background: #fbeceb; color: var(--danger); }
.badge-niet-gekoppeld, .badge-status-concept { background: #eef0f5; color: var(--muted); }
.badge-type-open { background: #e6eefc; color: #244a9e; }
.badge-type-meerkeuze { background: #f1e6fc; color: #6a2ba6; }
.badge-type-foto { background: #e6f7f4; color: #1b6e5f; }
select.status { padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border); font: inherit; font-size: 0.9em; }
select.status-live { background: #e8f5ec; }
select.status-klaar { background: #fff7e0; }

.round-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.round-head h2 { margin: 0; }
.round-edit { margin: 12px 0; padding: 12px 14px; background: #f8f9fc; border: 1px dashed var(--border); border-radius: 6px; }
.round .table { margin-top: 12px; }
tr.row-dubbel td, tr.row-fout td { color: var(--muted); }

.dup-result { margin: -6px 0 12px; }
.dup-result .dup-exact { background: #fbeceb; border: 1px solid #f0c1bd; color: #8b1d12; padding: 8px 12px; border-radius: 6px; font-size: 0.9em; }
.dup-result .dup-near { background: #fff7e0; border: 1px solid #f2dc9b; color: #6e4a00; padding: 8px 12px; border-radius: 6px; font-size: 0.9em; }
.dup-result .dup-ok { color: var(--ok); font-size: 0.85em; }
.image-preview img { max-height: 160px; max-width: 100%; border: 1px solid var(--border); border-radius: 4px; margin: -6px 0 12px; }

@media (max-width: 800px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar-inner { height: auto; flex-direction: column; align-items: flex-start; padding: 10px 16px; gap: 6px; }
  .topbar nav a { margin: 0 14px 0 0; }
}

.thumb-logo { max-height: 60px; background: #2c3a5e; padding: 4px 8px; border-radius: 4px; display: block; margin-top: 6px; }
.thumb-bg { max-height: 60px; border-radius: 4px; display: block; margin-top: 6px; }
.thumb-q { max-height: 44px; border-radius: 3px; border: 1px solid var(--border); }
.thumb-q-large { max-height: 140px; border-radius: 4px; border: 1px solid var(--border); display: block; margin-top: 6px; }
.media-current { display: block; margin-top: 6px; font-weight: 400; }
.media-current audio { width: 100%; max-width: 320px; display: block; margin-top: 4px; }

.progress { height: 14px; background: #eef0f5; border-radius: 7px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); border-radius: 7px; transition: width 0.3s; }
#build-log { margin-top: 6px; max-height: 120px; overflow-y: auto; }
button[disabled].busy { opacity: 0.7; }
