:root {
  --bg: #14161A; --panel: #1E2127; --line: #2A2E36; --line2: #4A505C;
  --text: #F2F2EE; --muted: #A9AEB8; --accent: #FFB020; --danger: #FF8A80;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 'Barlow', system-ui, sans-serif; }
h1, h2 { font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif; font-weight: 600; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 30px; } h2 { font-size: 22px; }
a { color: var(--accent); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .pad { padding: 12px 16px; }
.error { color: var(--danger); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: 'Barlow Condensed', 'Barlow', sans-serif; font-weight: 600; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); flex: none; }
.top-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; }
a.avatar { color: var(--text); text-decoration: none; }
a.avatar:hover { background: var(--line2); }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; margin: 0 0 12px; padding: 0; list-style: none; }
.codes li { padding: 8px; border: 1px solid var(--line2); border-radius: 8px; text-align: center; }
.qr { display: inline-block; padding: 12px; background: #fff; border-radius: 8px; line-height: 0; }
.qr:empty { display: none; }
.key { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; overflow-wrap: anywhere; color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 15px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line2); background: transparent; color: var(--text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #14161A; font-weight: 600; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; border-radius: 8px; }
.icon-btn:hover { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.flash { margin: 12px 16px 0; padding: 10px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.form { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-size: 16px; display: flex; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
input:not([type=checkbox]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line2);
  background: var(--bg); color: var(--text); font: inherit;
}
input[type=file] { color: var(--text); font: inherit; max-width: 100%; }
input[type=color] { width: 60px; height: 44px; padding: 2px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; margin: 0; }
legend { color: var(--muted); font-size: 14px; padding: 0 6px; }

/* Login */
.login { max-width: 420px; padding-top: 8vh; }

/* Dashboard */
.home-main { max-width: 860px; padding-top: 10vh; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.tile svg { color: var(--accent); }
.tile:hover { border-color: var(--accent); }
.tile.primary { background: var(--accent); border-color: var(--accent); color: #14161A; }
.tile.primary svg { color: #14161A; }
.tile-title { font-family: 'Barlow Condensed', 'Barlow', sans-serif; font-weight: 600; font-size: 22px; }
.tile-text { font-size: 14px; color: var(--muted); }
.tile.primary .tile-text { color: #14161A; }

/* Schermvullende pagina's */
body.full { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.full > main { flex: 1; min-height: 0; }

/* Tekeningen */
.draw { display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.doc-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.doc-search { padding: 12px; border-bottom: 1px solid var(--line); }
.docs { flex: 1; overflow: auto; }
.doc-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.doc-row form { flex: none; }
.doc { flex: 1; min-width: 0; min-height: 48px; padding: 8px 14px; text-align: left; background: transparent; border: 0; color: var(--text); font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.doc:hover { background: var(--bg); }
.doc.active { background: var(--bg); color: var(--accent); font-weight: 600; }
.doc-upload { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.doc-upload label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.viewer-bar strong { flex: 1; min-width: 120px; overflow-wrap: anywhere; }
.viewer-tools { display: flex; gap: 6px; }
#pages { flex: 1; overflow: auto; padding: 12px; background: #0C0D10; color: var(--muted); -webkit-overflow-scrolling: touch; }
#pages canvas { display: block; margin: 0 auto 12px; background: #fff; }
.pdf-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.only-m { display: none; }
@media (max-width: 800px) {
  .draw { grid-template-columns: minmax(0, 1fr); }
  .draw .viewer { display: none; }
  .draw.viewing .doc-list { display: none; }
  .draw.viewing .viewer { display: flex; }
  .only-m { display: inline-flex; }
}

/* Takenbord */
.board-page { display: flex; flex-direction: column; }
.board-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding: 12px 16px; position: relative; }
.pop summary { list-style: none; }
.pop summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; z-index: 10; left: 16px; right: 16px; top: 64px; max-width: 420px; max-height: calc(100dvh - 160px); overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.filters select { width: auto; }
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.chip { display: inline-block; align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 13px; border: 1px solid var(--c, var(--line2)); color: var(--text); background: color-mix(in srgb, var(--c, transparent) 22%, transparent); }
.board { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 16px 16px; overflow-x: auto; scroll-snap-type: x proximity; }
.col { flex: 1 0 280px; max-width: 520px; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; scroll-snap-align: start; }
.col.over { border-color: var(--accent); }
.col h2 { margin: 0; padding: 12px 14px; font-size: 18px; letter-spacing: .05em; text-transform: uppercase; display: flex; justify-content: space-between; }
.count { color: var(--muted); }
.col-body { flex: 1; overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.task:hover { border-color: var(--line2); }
.task-title { font-weight: 500; overflow-wrap: anywhere; }
.task-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-height: 28px; }

/* Taak + admin */
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
.photo { position: relative; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.photo form { position: absolute; top: 2px; right: 2px; }
.photo .icon-btn { background: rgba(20,22,26,.8); color: var(--text); }
.note { padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; padding: 8px; min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }

/* ===== Versie 1.2: projecten en bord ===== */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input:not([type=color]) { flex: 1 1 140px; width: auto; }
.grow { flex: 1; min-width: 0; }
.is-done { text-decoration: line-through; opacity: .7; }
.lbl { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.proj { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 110px; padding: 16px; border-radius: 10px; text-decoration: none; }
.proj:hover { filter: brightness(1.08); }
.proj-name { font-family: 'Barlow Condensed', 'Barlow', sans-serif; font-weight: 600; font-size: 22px; overflow-wrap: anywhere; }
.proj.new { background: var(--panel); border: 1px dashed var(--line2); gap: 10px; }
.label-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 4px; }
.check-row .check { overflow-wrap: anywhere; }

.kb { display: flex; flex-direction: column; background: var(--pc); }
.kb-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; position: relative; }
.kb-bar h1 { margin: 0 8px; font-size: 26px; color: var(--pt); overflow-wrap: anywhere; }
.kb-btn, .kb select.kb-btn { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 40px; padding: 0 12px; border: 0; border-radius: 6px; background: #fff; color: #172B4D; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.kb-btn input { width: 18px; height: 18px; accent-color: #0C66E4; }
.kb-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-note { padding: 6px 10px; border-radius: 6px; background: #fff; color: #172B4D; font-size: 14px; }
.kb-note a { color: #0C66E4; }
.kb .pop-body { top: 56px; left: 12px; right: 12px; }
.kb-lists { flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 12px; padding: 4px 12px 14px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.klist { flex: 0 0 290px; max-width: 86vw; max-height: 100%; display: flex; flex-direction: column; background: #EBECF0; color: #172B4D; border-radius: 10px; scroll-snap-align: start; }
.klist header { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px; }
.kb .klist input.kin:not([type=checkbox]) { min-height: 38px; padding: 6px 8px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: #172B4D; }
.kb .klist input.kin:not([type=checkbox])::placeholder { color: #44546F; opacity: 1; }
.kb .klist input.kin:not([type=checkbox]):focus { background: #fff; border-color: #0C66E4; outline: 0; }
.kb .klist input.ktitle-in:not([type=checkbox]) { font-weight: 600; font-size: 16px; }
.kmenu { position: relative; }
.kmenu summary { list-style: none; width: 40px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; color: #44546F; font-weight: 700; letter-spacing: 1px; }
.kmenu summary::-webkit-details-marker { display: none; }
.kmenu summary:hover, .kmenu[open] summary { background: #D5D9E0; }
.kmenu form { position: absolute; right: 0; top: 42px; z-index: 5; width: 200px; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(9,30,66,.3); padding: 6px; display: flex; flex-direction: column; }
.kmenu button { min-height: 40px; border: 0; background: transparent; text-align: left; padding: 0 10px; border-radius: 6px; font: inherit; color: #172B4D; cursor: pointer; }
.kmenu button:hover { background: #EBECF0; }
.kcards { flex: 1; min-height: 12px; overflow-y: auto; padding: 4px 8px; display: flex; flex-direction: column; gap: 8px; }
.kcard { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: #fff; color: #172B4D; border-radius: 8px; box-shadow: 0 1px 1px rgba(9,30,66,.25); text-decoration: none; }
.kcard:hover { box-shadow: 0 0 0 2px #0C66E4; }
.kcard.dragging { opacity: .35; }
.lbls { display: flex; flex-wrap: wrap; gap: 4px; }
.ktitle { overflow-wrap: anywhere; }
.kmeta { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.kmeta:has(.kbadges:empty):has(.kav:empty) { display: none; }
.kbadges { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: #44546F; }
.due { padding: 2px 6px; border-radius: 4px; background: #DCDFE4; color: #172B4D; }
.due.late { background: #C9372C; color: #fff; }
.due.ok { background: #1F845A; color: #fff; }
.kav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.kcard .avatar { background: #DCDFE4; color: #172B4D; }
.kadd { display: flex; gap: 6px; padding: 6px 8px 8px; }
.kadd .kin { flex: 1; min-width: 0; width: auto; }
.kgo { min-height: 38px; padding: 0 12px; border: 0; border-radius: 6px; background: #0C66E4; color: #fff; font: inherit; font-weight: 600; cursor: pointer; display: none; }
.kadd:focus-within .kgo { display: inline-block; }
.klist.knew { background: rgba(255,255,255,.75); }

/* ===== Versie 1.2.1: bord in donkere modus; de projectkleur is alleen een accent ===== */
.proj { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-top: 4px solid var(--pc, var(--accent)); }
.proj:hover { filter: none; border-color: var(--pc, var(--accent)); }
.kb { background: var(--bg); border-top: 3px solid var(--pc, var(--accent)); }
.kb-bar h1 { color: var(--text); }
.kb-btn, .kb select.kb-btn { background: var(--panel); color: var(--text); border: 1px solid var(--line2); }
.kb-btn input { accent-color: var(--accent); }
.kb-note { background: var(--panel); color: var(--text); border: 1px solid var(--line2); }
.kb-note a { color: var(--accent); }
.klist { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.kb .klist input.kin:not([type=checkbox]) { color: var(--text); }
.kb .klist input.kin:not([type=checkbox])::placeholder { color: var(--muted); }
.kb .klist input.kin:not([type=checkbox]):focus { background: var(--bg); border-color: var(--accent); }
.kmenu summary { color: var(--muted); }
.kmenu summary:hover, .kmenu[open] summary { background: var(--line); }
.kmenu form { background: #2A2E36; border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.kmenu button { color: var(--text); }
.kmenu button:hover { background: var(--line2); }
.kcard { background: var(--bg); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.kcard:hover { box-shadow: none; border-color: var(--accent); }
.kbadges { color: var(--muted); }
.due { background: var(--line2); color: var(--text); }
.kcard .avatar { background: var(--line2); color: var(--text); }
.kgo { background: var(--accent); color: #14161A; }
.klist.knew { background: transparent; border: 1px dashed var(--line2); }

/* ===== Versie 1.2.2 ===== */
.klist-name { flex: 1; margin: 0; padding: 8px; font: 600 16px/1.3 'Barlow', system-ui, sans-serif; overflow-wrap: anywhere; }
