@font-face { font-family: "Big Shoulders Stencil Display"; src: url("../fonts/stencil.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Big Shoulders Display"; src: url("../fonts/display.woff2") format("woff2"); font-weight: 500 900; font-display: swap; }
@font-face { font-family: Archivo; src: url("../fonts/archivo.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
:root {
  --green: #215330;
  --green-dark: #17381f;
  --green-deep: #0b1f12;
  --accent: #fec810;
  --paper: #f3ecd6;
  --paper-dark: #e5dcc0;
  --ink: #1b2a1f;
  --muted: #6b7a6f;
  --line: #d8d2bf;
  --ok: #2e8b57;
  --warn: #d98c00;
  --err: #c0392b;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Archivo, "Helvetica Neue", Arial, sans-serif; font-size: 15px; color: var(--ink); background: var(--paper); line-height: 1.45; }
a { color: var(--green); }
h1, h2, h3, h4 { font-family: "Big Shoulders Stencil Display", "Big Shoulders Display", Impact, "Arial Narrow", sans-serif; letter-spacing: .5px; margin: 0 0 .5em; color: var(--green-deep); }
h1 { font-size: 34px; text-transform: uppercase; }
h2 { font-size: 24px; text-transform: uppercase; }
h3 { font-size: 19px; }
h4 { font-size: 16px; font-family: Archivo, sans-serif; }
p { margin: 0 0 .8em; }
code, pre { font-family: "Courier Prime", Menlo, Consolas, monospace; }
pre { background: #fff8e0; border: 1px solid var(--line); padding: 10px; border-radius: var(--radius); white-space: pre-wrap; word-break: break-word; }

/* Topbar */
.topbar { background: var(--green-deep); color: var(--paper); display: flex; align-items: center; gap: 20px; padding: 0 18px; height: 58px; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-family: "Big Shoulders Stencil Display", Impact, sans-serif; font-size: 22px; letter-spacing: 1px; white-space: nowrap; }
.topbar .brand img { width: 30px; height: 30px; }
.topbar .brand em { font-style: normal; color: var(--accent); font-size: 14px; margin-left: 4px; font-family: Archivo, sans-serif; letter-spacing: 0; }
.mainnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.mainnav a { color: var(--paper); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: 14px; }
.mainnav a:hover, .mainnav a.active { background: var(--green); color: var(--accent); }
.mainnav a.muted { opacity: .7; font-weight: 400; }
.navtoggle { display: none; background: none; border: 1px solid var(--accent); color: var(--accent); font-size: 20px; border-radius: 6px; padding: 2px 10px; margin-left: auto; }
.pill { background: var(--accent); color: var(--green-deep); border-radius: 99px; padding: 0 7px; font-size: 12px; font-weight: 700; }
@media (max-width: 900px) {
  .navtoggle { display: block; }
  .mainnav { display: none; position: absolute; top: 58px; left: 0; right: 0; background: var(--green-deep); flex-direction: column; padding: 10px; }
  body.nav-open .mainnav { display: flex; }
}

.content { max-width: 1240px; margin: 0 auto; padding: 22px 18px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards / grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card h3 { margin-top: 0; }
.card.dark { background: var(--green-deep); color: var(--paper); border-color: var(--green-deep); }
.card.dark h3, .card.dark h2 { color: var(--accent); }
.card .meta { color: var(--muted); font-size: 13px; }
.gamecard { display: flex; gap: 14px; }
.gamecard img { width: 92px; height: 92px; object-fit: cover; border-radius: 6px; flex: none; background: var(--green); }
.gamecard .body { flex: 1; min-width: 0; }
.gamecard .title { font-family: "Big Shoulders Stencil Display", Impact, sans-serif; font-size: 22px; text-transform: uppercase; color: var(--green-deep); text-decoration: none; }
.stat { font-size: 30px; font-family: "Big Shoulders Stencil Display", Impact, sans-serif; color: var(--green); }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--paper-dark); color: var(--ink); white-space: nowrap; }
.badge.status-concept { background: #e0e0e0; }
.badge.status-inhoud_klaar { background: #d7ecff; color: #0b4a7a; }
.badge.status-media_klaar { background: #ffe9b3; color: #6b4b00; }
.badge.status-pdf_klaar { background: #d9f3e3; color: #1c6b3b; }
.badge.status-gesynct { background: var(--green); color: var(--accent); }
.badge.ok { background: #d9f3e3; color: #1c6b3b; }
.badge.warn { background: #ffe9b3; color: #6b4b00; }
.badge.err { background: #f9d6d2; color: #7a1d14; }
.badge.info { background: #e3e8ff; color: #263a8a; }
.badge.kind { background: var(--green-deep); color: var(--accent); }

/* Progress */
.progress { position: relative; background: var(--paper-dark); border-radius: 99px; height: 18px; overflow: hidden; margin: 4px 0; }
.progress .bar { background: var(--green); height: 100%; transition: width .3s; }
.progress span { position: absolute; left: 9px; top: 0; font-size: 11px; line-height: 18px; color: var(--ink); font-weight: 700; mix-blend-mode: normal; }
.progress.accent .bar { background: var(--accent); }
.progress.big { height: 26px; } .progress.big span { line-height: 26px; font-size: 13px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--green); color: var(--accent); border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2; font-family: inherit; }
.btn:hover { background: var(--green-dark); }
.btn.secondary { background: var(--white); color: var(--green); border: 1px solid var(--green); }
.btn.secondary:hover { background: var(--paper); }
.btn.accent { background: var(--accent); color: var(--green-deep); }
.btn.danger { background: var(--err); color: #fff; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.ghost { background: transparent; color: var(--green); border: 1px dashed var(--green); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.working { opacity: .7; pointer-events: none; }
.btngroup { display: flex; gap: 6px; flex-wrap: wrap; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 4px; color: var(--green-deep); }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=url], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
textarea.md { min-height: 160px; font-family: "Courier Prime", Menlo, monospace; font-size: 13.5px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--green); }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; }
.row > .field.w2 { flex: 2 1 260px; }
.row > .field.w-full { flex: 1 1 100%; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; }
.help { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.savestate { font-size: 12px; color: var(--muted); }

/* Markdown editor */
.mdeditor .toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.mdeditor .toolbar button { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.mdeditor .toolbar button:hover { background: var(--paper-dark); }
.mdeditor .preview { display: none; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fffdf6; min-height: 160px; }
.mdeditor.preview-on .preview { display: block; }
.mdeditor.preview-on textarea { display: none; }
.mdpreview h1, .mdpreview h2, .mdpreview h3 { font-family: Archivo, sans-serif; text-transform: none; letter-spacing: 0; font-size: 1.15em; margin: .6em 0 .3em; }
.mdpreview h1 { font-size: 1.35em; } .mdpreview h2 { font-size: 1.25em; }
.mdpreview table { border-collapse: collapse; margin: .5em 0; }
.mdpreview td, .mdpreview th { border: 1px solid var(--line); padding: 3px 8px; }
.mdpreview blockquote { border-left: 3px solid var(--accent); margin: .5em 0; padding-left: 10px; color: var(--muted); }
.mdpreview hr { border: 0; border-top: 1px dashed var(--line); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--green); margin: 12px 0 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--green-deep); font-weight: 700; border-radius: 6px 6px 0 0; font-size: 14px; }
.tabs a.active { background: var(--green); color: var(--accent); }
.tabs a .cnt { font-size: 11px; opacity: .7; margin-left: 4px; }
.tabpanel { display: none; } .tabpanel.active { display: block; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
table.list th { background: var(--green-deep); color: var(--paper); font-weight: 600; font-size: 13px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fffbea; }
.tablewrap { overflow-x: auto; }

/* Sortable lists */
.sortable .item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.sortable .item.dragging { opacity: .4; }
.sortable .item.over { outline: 2px dashed var(--accent); }
.item-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.item-head .handle { cursor: grab; color: var(--muted); font-size: 18px; user-select: none; }
.item-head .num { background: var(--green-deep); color: var(--accent); border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.item-head .name { font-weight: 700; flex: 1; }
.item-head .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.item-body { display: none; padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.item.open .item-body { display: block; }
.item.incomplete .item-head { border-left: 4px solid var(--warn); }
.item.complete .item-head { border-left: 4px solid var(--ok); }

/* Alerts / checks */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; border: 1px solid transparent; }
.alert-ok, .alert-success { background: #d9f3e3; border-color: #9fd9b6; color: #1c6b3b; }
.alert-warn, .alert-warning { background: #fff1c9; border-color: #f2d27a; color: #6b4b00; }
.alert-err, .alert-error, .alert-danger { background: #f9d6d2; border-color: #eea59d; color: #7a1d14; }
.alert-info { background: #e3e8ff; border-color: #b8c3ff; color: #263a8a; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 7px 10px; border-left: 4px solid var(--line); background: #fff; margin-bottom: 6px; border-radius: 0 6px 6px 0; font-size: 14px; }
.checklist li.ok { border-color: var(--ok); }
.checklist li.warn { border-color: var(--warn); }
.checklist li.err { border-color: var(--err); }
.checklist li.info { border-color: #6c7fd8; }
.checklist li .where { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* Todos */
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; }
.todo.done { opacity: .55; }
.todo.done .text { text-decoration: line-through; }
.todo input[type=checkbox] { width: 20px; height: 20px; margin-top: 1px; cursor: pointer; }
.todo .text { flex: 1; }
.todo .cat { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.todo .auto { font-size: 11px; color: var(--muted); font-style: italic; }
.todo .del { color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 16px; }

/* Media cards */
.mediacard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.mediacard .thumbs { display: flex; gap: 6px; padding: 10px; background: var(--green-deep); min-height: 130px; align-items: center; overflow-x: auto; }
.mediacard .thumb { position: relative; flex: none; }
.mediacard .thumb img, .mediacard .thumb video { height: 110px; width: auto; border-radius: 4px; border: 3px solid transparent; }
.mediacard .thumb.chosen img, .mediacard .thumb.chosen video { border-color: var(--accent); }
.mediacard .thumb .tools { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 3px; }
.mediacard .thumb .tools button { background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 4px; font-size: 11px; padding: 2px 5px; cursor: pointer; }
.mediacard .thumb .audio { background: var(--green); color: var(--paper); padding: 8px; border-radius: 4px; font-size: 12px; }
.mediacard .body { padding: 12px; flex: 1; }
.mediacard .prompt { font-size: 13px; background: #fffdf6; border: 1px solid var(--line); border-radius: 6px; padding: 8px; white-space: pre-wrap; max-height: 170px; overflow: auto; }
.mediacard .foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.status-nodig { background: #f9d6d2; color: #7a1d14; }
.status-gegenereerd { background: #ffe9b3; color: #6b4b00; }
.status-geupload { background: #d7ecff; color: #0b4a7a; }
.status-goedgekeurd { background: #d9f3e3; color: #1c6b3b; }

/* Queue */
.queue { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.queue .qlist { max-height: 260px; overflow: auto; font-size: 13px; }
.queue .qitem { display: flex; gap: 8px; padding: 4px 6px; border-bottom: 1px dashed var(--line); }
.queue .qitem .st { width: 90px; flex: none; font-weight: 700; }
.queue .qitem.pending .st { color: var(--muted); }
.queue .qitem.running .st { color: var(--warn); }
.queue .qitem.done .st { color: var(--ok); }
.queue .qitem.error .st { color: var(--err); }
.queue .qitem.skipped .st { color: var(--muted); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(11,31,18,.7); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow: auto; }
.modal[hidden] { display: none; }
.modal-box { background: var(--paper); border-radius: 10px; width: 100%; max-width: 980px; position: relative; padding: 22px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.modal-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 28px; cursor: pointer; color: var(--green-deep); }
.review-field { margin-bottom: 12px; }
.review-field label { font-size: 13px; }
.review-block { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fff; }
.review-block h4 { margin: 0 0 8px; }

/* Toasts */
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--green-deep); color: var(--paper); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; max-width: 360px; border-left: 4px solid var(--accent); }
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }

/* Diagram */
.diagram { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.diagram svg { display: block; }

/* Login / install */
.centerbox { max-width: 520px; margin: 40px auto; }
.centerbox .card { padding: 26px; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { padding: 4px 10px; border-radius: 99px; background: var(--paper-dark); font-size: 12px; font-weight: 700; }
.steps span.active { background: var(--green); color: var(--accent); }
.steps span.done { background: var(--ok); color: #fff; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.inline-form { display: inline; }
details summary { cursor: pointer; font-weight: 600; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
iframe.preview { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: var(--radius); background: #888; }
.copybtn { font-size: 12px; }
.filelist .file { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.filelist .file.old { opacity: .6; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diff pre { font-size: 12px; }
@media (max-width: 700px) { .diff { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }
