:root {
  --bg:#f3f4f6; --card:#fff; --text:#1f2933; --soft:#6b7280; --line:#e5e7eb; --sel:#eaf3ff;
  --blue:#1e87f0; --blue-d:#1a74cf; --r:10px;
  --red:#c0392b; --red-bg:#fde8e6; --yellow:#8a6a00; --yellow-bg:#fdf1c8; --grey:#6b7280; --grey-bg:#eceef1;
  --blue-bg:#e1eefc; --green:#1f7a4d; --green-bg:#dcf3e6;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#14161a; --card:#1d2025; --text:#e8eaed; --soft:#9aa1ab; --line:#2f343b; --sel:#1c2a3d;
    --red-bg:#3b1f1c; --red:#f08a7e; --yellow-bg:#3a3217; --yellow:#e5c864; --grey-bg:#2a2e34; --grey:#a0a7b1;
    --blue-bg:#17304f; --green-bg:#16352a; --green:#69c79a; }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color:var(--blue); text-decoration:none; }
h1 { font-size:22px; margin:6px 0 4px; }
h2 { font-size:16px; margin:0 0 12px; }
h3 { font-size:14px; margin:20px 0 6px; }
.meta { color:var(--soft); font-size:12.5px; }
.pad { padding:16px; }
.sp { flex:1; }

/* balk */
.top { position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:12px; height:56px; padding:0 16px; background:var(--card); border-bottom:1px solid var(--line); }
.brand { font-weight:700; font-size:17px; color:var(--text); }
.avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:var(--blue-bg); color:var(--blue); font-weight:600; font-size:12px; cursor:pointer; list-style:none; }
.avatar::-webkit-details-marker { display:none; }
.menu { position:relative; }
.pop { position:absolute; right:0; top:42px; min-width:180px; background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:0 8px 24px rgba(0,0,0,.14); padding:6px; }
.pop .who { padding:6px 10px; color:var(--soft); font-size:12.5px; }
.pop a, .linklike { display:block; width:100%; text-align:left; padding:7px 10px; border-radius:6px; color:var(--text); background:none; font:inherit; border:0; cursor:pointer; }
.pop a:hover, .linklike:hover { background:var(--bg); }

/* knoppen en velden */
button, .btn { display:inline-block; font:inherit; font-weight:500; border:0; border-radius:8px; padding:8px 14px; background:var(--blue); color:#fff; cursor:pointer; }
button:hover, .btn:hover { background:var(--blue-d); }
.btn.ghost, button.ghost { background:transparent; color:var(--text); border:1px solid var(--line); }
.btn.ghost:hover { background:var(--bg); }
.small { padding:5px 10px; font-size:12.5px; }
label { display:block; font-size:12.5px; color:var(--soft); margin:12px 0 4px; }
input[type=text], input[type=password], input[type=search], textarea, select { width:100%; font:inherit; color:var(--text); background:var(--card); border:1px solid var(--line); border-radius:8px; padding:8px 10px; }
textarea { min-height:100px; resize:vertical; }
select { appearance:none; background-image:linear-gradient(45deg,transparent 50%,var(--soft) 50%),linear-gradient(135deg,var(--soft) 50%,transparent 50%); background-position:calc(100% - 16px) 52%,calc(100% - 11px) 52%; background-size:5px 5px; background-repeat:no-repeat; padding-right:28px; }
.row { display:flex; gap:8px; align-items:center; margin-top:14px; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.err { background:var(--red-bg); color:var(--red); border-radius:8px; padding:9px 12px; margin:10px 0; }
.ok { background:var(--green-bg); color:var(--green); border-radius:8px; padding:9px 12px; margin:10px 0; word-break:break-word; }
.card, .panel { background:var(--card); border:1px solid var(--line); border-radius:var(--r); }
.card { padding:18px; }
.center { display:block; }
.login { max-width:340px; margin:12vh auto 0; }
.login h1 { margin-top:0; }

/* indeling */
.app { display:grid; grid-template-columns:220px minmax(0,1fr); gap:12px; padding:12px; align-items:start; max-width:1440px; margin:0 auto; }
.mid { padding:20px; min-height:300px; }
.listp { padding:0; overflow:hidden; position:sticky; top:68px; max-height:calc(100vh - 80px); display:flex; flex-direction:column; max-width:960px; }
.mid { max-width:960px; }
.show-detail .listp, .show-list .mid { display:none; }
.search { padding:12px; }
.tabs { display:flex; gap:4px; padding:0 12px 8px; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.tabs a { color:var(--soft); padding:5px 9px; border-radius:8px; font-size:13px; }
.tabs a b { background:var(--grey-bg); border-radius:10px; padding:0 6px; font-weight:600; font-size:12px; }
.tabs a.on { background:var(--blue-bg); color:var(--blue); }
.rows { overflow:auto; flex:1; }
.item, .lcols { display:grid; grid-template-columns:52px minmax(0,1fr) 120px 84px 84px; gap:10px; align-items:center; padding:10px 12px; border-bottom:1px solid var(--line); color:var(--text); }
.item.hc, .lcols.hc { grid-template-columns:52px minmax(0,1fr) 150px 120px 84px 84px; }
.item:hover { background:var(--bg); }
.item.sel { background:var(--sel); box-shadow:inset 3px 0 0 var(--blue); }
.num { color:var(--soft); font-size:12px; font-weight:400; }
.thumb { width:52px; height:40px; border-radius:6px; background:var(--grey-bg); overflow:hidden; }
.thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.ttl { font-weight:500; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pill { display:inline-block; padding:1px 9px; border-radius:6px; font-size:12px; font-weight:500; white-space:nowrap; }
.s-open { background-color:var(--red-bg); color:var(--red); }
.s-in_behandeling { background-color:var(--blue-bg); color:var(--blue); }
.s-opgelost { background-color:var(--green-bg); color:var(--green); }

/* detail */
.head { display:flex; align-items:center; gap:10px; }
.head form { margin:0; }
.idn { color:var(--soft); font-size:16px; }
select.pill { width:auto; border:0; padding:4px 26px 4px 11px; font-size:13px; cursor:pointer; background-position:calc(100% - 14px) 52%,calc(100% - 9px) 52%; background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%); }
select.pill:hover { filter:brightness(.96); }
.text { white-space:pre-wrap; word-break:break-word; margin:8px 0; }
.shot { max-width:100%; max-height:520px; border-radius:8px; border:1px solid var(--line); display:block; margin:10px 0; }
.shot.small { max-height:220px; }
.empty { display:none; }
.back { display:inline-block; margin-bottom:10px; }
.empty p { color:var(--soft); }
.drop { border:2px dashed var(--line); border-radius:var(--r); padding:22px 12px; text-align:center; color:var(--soft); cursor:pointer; }
.drop.mini { padding:8px; font-size:12.5px; margin-top:8px; }
.drop.has { padding:8px; border-style:solid; }
.drop.has { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:flex-start; }
.pv { position:relative; }
.pv img { height:90px; max-width:160px; object-fit:cover; border-radius:6px; display:block; }
.pv b { position:absolute; top:-6px; right:-6px; width:20px; height:20px; border-radius:50%; background:var(--text); color:var(--card); text-align:center; line-height:20px; font-size:14px; }
.more { display:grid; place-items:center; width:48px; height:90px; border:2px dashed var(--line); border-radius:6px; font-size:22px; color:var(--soft); }
.gal { display:flex; flex-wrap:wrap; gap:10px; margin:10px 0; }
.gal a, .gal .gi { display:block; }
.gal img { display:block; max-width:100%; max-height:200px; cursor:zoom-in; border-radius:8px; border:1px solid var(--line); }
.gal.small img { max-height:110px; }
.gi { font-weight:400; margin:0; color:var(--soft); font-size:12px; }
.gi img { max-height:120px; }
.gi span { display:block; margin-top:4px; }
.gi input { width:auto; }
.tl { list-style:none; margin:0; padding:0; }
.tl li.cm { background:var(--bg); border-radius:8px; padding:8px 12px; margin:8px 0; }
.tl li.ev { color:var(--soft); font-size:12.5px; padding:4px 2px; }
.reply { margin-top:14px; }

/* gebruikers */
.narrow { max-width:760px; margin:0 auto; padding:16px; }
.narrow .panel { margin-bottom:12px; }
.users { width:100%; border-collapse:collapse; }
.users td { padding:10px 6px; border-bottom:1px solid var(--line); vertical-align:middle; }
.users .act { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.users .act form { margin:0; }
.users tr.off { opacity:.55; }

/* telefoon: lijst of detail, nooit allebei */
@media (max-width:760px) {
  .app { grid-template-columns:1fr; padding:8px; }
  .listp { position:static; max-height:none; }
  .top .btn { padding:7px 10px; }
  input, select, textarea { font-size:16px; }
}

/* schermafbeelding groot in een venster */
#lightbox { border:0; padding:0; background:transparent; max-width:96vw; max-height:96vh; overflow:visible; }
#lightbox::backdrop { background:rgba(0,0,0,.72); }
#lightbox img { display:block; max-width:96vw; max-height:92vh; border-radius:8px; cursor:zoom-out; background:var(--card); }
.lbx { position:absolute; top:-14px; right:-14px; width:34px; height:34px; padding:0; border-radius:50%; background:var(--card); color:var(--text); font-size:22px; line-height:34px; }

/* hoofdstukken */
.search { display:flex; gap:8px; }
.search input { flex:1; min-width:0; }
.search select { width:auto; max-width:46%; }
.grp { padding:8px 12px 6px; font-size:12px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:var(--soft); background:var(--bg); border-bottom:1px solid var(--line); }
.chsel { width:auto; max-width:200px; padding-top:4px; padding-bottom:4px; font-size:13px; }
.chlist { width:100%; border-collapse:collapse; }
.chlist td { padding:8px 4px; border-bottom:1px solid var(--line); vertical-align:middle; }
.chlist form { margin:0; display:flex; gap:6px; }
.chlist td:last-child form { justify-content:flex-end; }

/* kolom met hoofdstukken */
.chp { padding:10px 8px; position:sticky; top:68px; }
.chp h2 { font-size:12px; text-transform:uppercase; letter-spacing:.03em; color:var(--soft); margin:2px 8px 8px; }
.chrow { display:flex; align-items:center; gap:2px; }
.chrow > a:first-child { flex:1; min-width:0; }
.chp a.plus { flex:none; width:26px; height:26px; padding:0; justify-content:center; color:var(--soft); font-size:18px; line-height:1; opacity:0; }
.chrow:hover .plus, .plus:focus { opacity:1; }
.chp a.plus:hover { background:var(--blue-bg); color:var(--blue); }
.chp a { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:7px 8px; border-radius:8px; color:var(--text); }
.chp a span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chp a b { flex:none; background:var(--grey-bg); color:var(--soft); border-radius:10px; padding:0 7px; font-size:12px; font-weight:600; }
.chp a:hover { background:var(--bg); }
.chp a.on { background:var(--blue-bg); color:var(--blue); font-weight:600; }
.chp form { margin:8px 0 0; }
.chnew { width:100%; background:transparent; color:var(--blue); border:1px dashed var(--line); padding:7px 8px; text-align:left; }
.chnew:hover { background:var(--bg); }
@media (max-width:1100px) {
  .app { grid-template-columns:minmax(0,1fr); }
  .chp { grid-column:1; position:static; display:flex; flex-wrap:nowrap; gap:6px; overflow-x:auto; padding:8px; align-items:center; }
  .chp h2 { display:none; }
  .chp a { flex:none; border:1px solid var(--line); }
  .chp form { margin:0; flex:none; }
  .chp a.plus { display:none; }
  .chp .chrow.trash { margin:0; padding:0; border:0; }
}
@media (max-width:760px) {
  .show-detail .chp { display:none; }
}

/* slepen van een melding naar een hoofdstuk */
.item[draggable=true] { cursor:grab; }
.item.dragging { opacity:.45; }
.dragging-bug .chp a[data-chap] { outline:1px dashed var(--line); }
.chp a.over { background:var(--blue-bg); outline:2px solid var(--blue); color:var(--blue); }
@media (hover:none) { .chp a.plus { opacity:1; } }

/* prullenmand */
.chrow.trash { margin-top:8px; padding-top:8px; border-top:1px solid var(--line); }
.trashbar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-bottom:1px solid var(--line); }
.trashbar form { margin:0; }
.trashed { display:flex; align-items:center; flex-wrap:wrap; gap:10px; background:var(--yellow-bg); color:var(--yellow); border-radius:8px; padding:10px 12px; margin:12px 0; }
.trashed form { margin:0; }
.danger { color:var(--red) !important; }
.btn.ghost.danger:hover { background:var(--red-bg); }
.dlg { border:1px solid var(--line); border-radius:var(--r); background:var(--card); color:var(--text); padding:20px; max-width:420px; }
.dlg::backdrop { background:rgba(0,0,0,.45); }
.dlg h3 { margin:0 0 6px; font-size:16px; }
.dlgrow { display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.dlgrow form { margin:0; }
.dlgrow .btn { width:100%; text-align:center; }

.lhead { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 12px 0; }
.lhead h1 { margin:0; font-size:18px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* in het lijstoverzicht staat de knop al boven de lijst */
.show-list .top .btn { display:none; }

.sortsel { flex:none; width:auto; max-width:48%; }

/* kolomkoppen en extra kolommen in de lijst */
.lcols { padding-top:7px; padding-bottom:7px; background:var(--bg); font-size:12px; border-bottom:1px solid var(--line); }
.lcols a { color:var(--soft); font-weight:600; white-space:nowrap; }
.lcols a:hover, .lcols a.on { color:var(--text); }
.chn { font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chn.none { color:var(--soft); }
.dt { color:var(--soft); font-size:12.5px; white-space:nowrap; }
.sortsel { display:none; }
@media (max-width:1100px) {
  .item, .lcols { grid-template-columns:52px minmax(0,1fr) 120px; }
  .item.hc, .lcols.hc { grid-template-columns:52px minmax(0,1fr) 130px 120px; }
  .dt, .col-created, .col-updated { display:none; }
}
@media (max-width:760px) {
  .lcols { display:none; }
  .sortsel { display:block; }
  .item, .item.hc { grid-template-columns:52px minmax(0,1fr) auto; grid-template-areas:"t ttl st" "t chn st"; row-gap:2px; }
  .thumb { grid-area:t; } .ttl { grid-area:ttl; } .st { grid-area:st; } .chn { grid-area:chn; }
}

/* gebruikersoverzicht */
.dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--line); }
.dot.on { background:#2ecc71; box-shadow:0 0 0 3px var(--green-bg); }
.users td:first-child { width:22px; }
.users .num2 { text-align:right; white-space:nowrap; }
.uchip { margin:10px 12px 0; padding:6px 10px; background:var(--blue-bg); color:var(--blue); border-radius:8px; font-size:13px; display:flex; justify-content:space-between; gap:10px; }
.uchip a { white-space:nowrap; }

/* projectkeuze in de bovenbalk */
.psel { width:auto; max-width:220px; margin-left:10px; padding-top:5px; padding-bottom:5px; font-weight:600; }
@media (max-width:760px) { .psel { max-width:130px; margin-left:4px; } }

/* toegang per project */
.access { padding:4px 4px 14px !important; }
.access form { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; }
.chk { display:inline-flex; align-items:center; gap:5px; margin:0; font-size:13px; color:var(--text); }
.chk input { width:auto; }
.chk.off { color:var(--soft); }
.projchk { display:flex; flex-wrap:wrap; gap:6px 14px; margin:4px 0; }

/* taken */
.tasklist { margin:6px 0; }
.task { display:flex; align-items:center; gap:10px; padding:7px 4px; border-bottom:1px solid var(--line); }
.task .tg { margin:0; display:flex; }
.task .tg input { width:17px; height:17px; margin:0; cursor:pointer; }
.task .tt { flex:1; min-width:0; word-break:break-word; }
.task .tt .meta { display:block; }
.task.done .tt { text-decoration:line-through; color:var(--soft); }
.task .ta { margin:0; } .task .ta select { width:auto; max-width:140px; padding:3px 24px 3px 8px; font-size:12.5px; }
.task .td { margin:0; } .task .x { background:transparent; color:var(--soft); padding:0 6px; font-size:18px; line-height:1; }
.task .x:hover { color:var(--red); background:transparent; }
.taskadd { display:flex; gap:8px; margin-top:8px; }
.taskadd input[type=text] { flex:1; min-width:0; }
.taskadd select { width:auto; max-width:140px; }
.tprog { display:inline-block; margin-left:6px; padding:0 7px; border-radius:10px; background:var(--grey-bg); color:var(--soft); font-size:11.5px; font-weight:600; white-space:nowrap; }
.tprog.all { background:var(--green-bg); color:var(--green); }
.doneT { padding:8px 12px; } .doneT summary { cursor:pointer; color:var(--soft); }
.listp .tasklist { padding:0 12px; }
