:root {
  /* Huisstijl Van Gestel Kozijnen & Glas (overgenomen van vangestelkozijnen.nl) */
  --bg: #f9fafb; --panel: #ffffff; --ink: #151e28; --muted: #6b7887; --line: #dbe1e8; --line2: #eef1f4;
  --brand: #17304f; --brand2: #23456e; --accent: #ee862b; --accent-ink: #ffffff; --link: #1f4f8a; --mint: #dcefe3;
  --ok: #2f8a63; --warn: #b7791f; --bad: #d64545; --info: #2b6cb0;
  --s-nog: #9aa5ae; --s-voorlopig: #ee862b; --s-levering: #c97a2b; --s-klant: #8e6bbf; --s-def: #2f8a63;
  --s-uitv: #1f4f8a; --s-controle: #6b8e23; --s-klaar: #5f6b73; --s-blok: #d64545;
  --radius: 8px; --shadow: 0 1px 2px rgba(21,30,40,.06), 0 2px 8px rgba(21,30,40,.05);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .25rem; } h2 { font-size: 1.1rem; margin: 0 0 .6rem; } h3 { font-size: 1rem; margin: .2rem 0 .5rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .75rem; } .pad { padding: 1rem; } .right { text-align: right; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .col { display: flex; flex-direction: column; gap: .4rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; }

#testbanner { background: repeating-linear-gradient(45deg, #fff3cd, #fff3cd 12px, #ffe8a1 12px, #ffe8a1 24px); color: #6b4e00; text-align: center; font-size: .8rem; padding: .25rem; font-weight: 600; }
#asbanner { background: #5b2a86; color: #fff; display: flex; gap: .6rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .35rem 1rem; font-size: .9rem; font-weight: 600; }
#asbanner[hidden] { display: none; }
#asbanner button { font-size: .8rem; }
#bekijkals { color: #fff; }
header#top { position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff; display: flex; align-items: center; gap: 1rem; padding: 0 1rem; height: 52px; }
header .brand { color: #fff; font-weight: 800; letter-spacing: .1px; white-space: nowrap; display: flex; align-items: center; gap: .5rem; } header .brand span { color: var(--accent); font-weight: 600; }
header .brand img { height: 34px; background: #fff; border-radius: 4px; padding: 2px; }
#nav { display: flex; gap: .15rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
#nav a { color: #d5e1e8; padding: .4rem .65rem; border-radius: 6px; white-space: nowrap; font-size: .92rem; }
#nav a.active, #nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.top-right { display: flex; gap: .7rem; align-items: center; font-size: .85rem; white-space: nowrap; }
button.link { background: none; border: 0; color: #d5e1e8; cursor: pointer; padding: 0; font: inherit; } button.link:hover { color: #fff; text-decoration: underline; }
main#app { padding: 1rem; max-width: 1700px; margin: 0 auto; }
#bottomnav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
#bottomnav a { flex: 1; text-align: center; padding: .55rem .2rem; font-size: .78rem; color: var(--muted); }
#bottomnav a.active { color: var(--brand); font-weight: 700; }
#bottomnav a .ic { display: block; font-size: 1.2rem; line-height: 1.3; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card h2 .count { font-weight: 400; color: var(--muted); font-size: .9rem; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .25rem .8rem; font-size: .93rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .12rem .55rem; font-size: .76rem; font-weight: 600; background: var(--line2); color: var(--ink); white-space: nowrap; }
#syncpill.ok { background: #d9f2e3; color: var(--ok); } #syncpill.pending { background: #fff1cf; color: #8a5a00; } #syncpill.busy { background: #dbe9f8; color: var(--info); }
.pill.ok { background: #d9f2e3; color: var(--ok); } .pill.warn { background: #fff1cf; color: #8a5a00; } .pill.bad { background: #fadbd8; color: var(--bad); } .pill.info { background: #dbe9f8; color: var(--info); } .pill.sim { background: #efe3fb; color: #6b3fa0; }
.status { color: #fff; } .status.nog_in_te_plannen { background: var(--s-nog); } .status.voorlopig_gereserveerd { background: var(--s-voorlopig); color: #3b2a00; } .status.wacht_op_levering { background: var(--s-levering); }
.status.wacht_op_klantbevestiging { background: var(--s-klant); } .status.definitief_ingepland { background: var(--s-def); } .status.in_uitvoering { background: var(--s-uitv); } .status.uitgevoerd_wacht_op_controle { background: var(--s-controle); }
.status.afgerond { background: var(--s-klaar); } .status.geblokkeerd { background: var(--s-blok); }

button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 6px; padding: .42rem .8rem; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; text-decoration: none; }
button:hover, .btn:hover { border-color: #b7c2cb; text-decoration: none; } button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); } button.primary:hover, .btn.primary:hover { background: var(--brand2); }
button.accent, .btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; } button.accent:hover { filter: brightness(.95); }
button.danger { color: var(--bad); border-color: #efc3bd; } button.small, .btn.small { padding: .2rem .5rem; font-size: .82rem; }
button.big { padding: .75rem 1rem; font-size: 1.05rem; width: 100%; justify-content: center; }
input, select, textarea { font: inherit; border: 1px solid #c9d2d9; border-radius: 6px; padding: .42rem .55rem; background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 80px; resize: vertical; } input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3e0; border-color: #6fa3c8; }
label.f { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); } label.f > input, label.f > select, label.f > textarea { color: var(--ink); font-size: .95rem; }
label.chk { display: inline-flex; gap: .4rem; align-items: center; font-size: .92rem; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .7rem; }
.form .wide { grid-column: 1 / -1; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; } table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; border-bottom: 1px solid var(--line); padding: .35rem .4rem; }
table.t td { border-bottom: 1px solid var(--line2); padding: .4rem; vertical-align: top; } table.t tr:hover td { background: #fafbfc; }
.scrollx { overflow-x: auto; }
.notice { border-left: 4px solid var(--info); background: #eef5fb; padding: .55rem .8rem; border-radius: 4px; font-size: .9rem; margin: .5rem 0; }
.notice.warn { border-color: var(--warn); background: #fff7e6; } .notice.bad { border-color: var(--bad); background: #fdecea; } .notice.ok { border-color: var(--ok); background: #eaf7ef; } .notice.sim { border-color: #6b3fa0; background: #f5eefc; }
.list { list-style: none; padding: 0; margin: 0; } .list li { padding: .5rem 0; border-bottom: 1px solid var(--line2); } .list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); font-style: italic; padding: .4rem 0; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; } .tabs a { padding: .5rem .8rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--brand); font-weight: 600; text-decoration: none; }

/* ---------- planbord ---------- */
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .7rem; }
.toolbar .weeklabel { font-weight: 700; font-size: 1.05rem; min-width: 220px; }
.board { --namew: 170px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 170px); box-shadow: var(--shadow); }
.board-grid { display: grid; min-width: 1100px; }
.bh { position: sticky; top: 0; z-index: 5; background: #f8fafb; border-bottom: 1px solid var(--line); padding: .35rem .5rem; font-size: .82rem; font-weight: 600; }
.bh.today { background: #fff8e3; } .bh.holiday { color: var(--bad); } .bh .hours { display: flex; justify-content: space-between; font-weight: 400; color: var(--muted); font-size: .68rem; margin-top: 2px; }
.bn { position: sticky; left: 0; z-index: 4; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line2); padding: .4rem .5rem; font-size: .86rem; }
.bn .team { font-size: .72rem; color: var(--muted); } .bn.extern { background: #fbf8f2; }
.bh.corner { left: 0; z-index: 6; position: sticky; }
.cell { position: relative; border-left: 1px solid var(--line2); border-bottom: 1px solid var(--line2); min-height: 66px; background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--line2) 1px); }
.cell.today { background-color: #fffcf2; } .cell.nonwork { background-color: #f6f6f6; }
.cell .gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: #f0f2f4; pointer-events: none; }
.blk { position: absolute; border-radius: 5px; padding: 2px 5px 2px 6px; font-size: .74rem; line-height: 1.2; overflow: hidden; cursor: grab; color: #10202a; border: 1px solid rgba(0,0,0,.15); border-left: 4px solid var(--s-nog); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); touch-action: none; user-select: none; }
.blk b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .ln { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.blk.voorlopig { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #fbf3df 6px, #fbf3df 12px); border-style: dashed; }
.blk.conflict { outline: 2px solid var(--bad); } .blk.warn::after { content: "!"; position: absolute; top: 1px; right: 4px; font-weight: 800; color: var(--warn); }
.blk.dragging { opacity: .85; cursor: grabbing; z-index: 20; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.blk .rz { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.blk.readonly { cursor: pointer; }
.absence { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(120,120,120,.12), rgba(120,120,120,.12) 5px, rgba(120,120,120,.04) 5px, rgba(120,120,120,.04) 10px); border-left: 2px solid #999; font-size: .68rem; color: #555; padding: 2px 4px; pointer-events: none; }
.absence.pending { border-left-style: dashed; }
.legend { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.side { position: fixed; top: 52px; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; border-left: 1px solid var(--line); box-shadow: -6px 0 24px rgba(0,0,0,.12); z-index: 40; overflow-y: auto; padding: 1rem; }
.side .close { float: right; }
.conflict-list li { color: var(--bad); } .warn-list li { color: #8a5a00; }

/* ---------- weekplanning mobiel + mijn werk ---------- */
.day { margin-bottom: 1rem; } .day > h3 { position: sticky; top: 52px; background: var(--bg); padding: .4rem 0; margin: 0; z-index: 3; }
.wk-item { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--s-nog); border-radius: 6px; padding: .55rem .7rem; margin: .35rem 0; }
.wk-item.mine { border-color: #b8d7ea; box-shadow: 0 0 0 2px #dbeefa inset; }
.wk-item.voorlopig { border-left-style: dashed; }
.wk-item .t { font-weight: 700; } .wk-item .who { font-size: .82rem; color: var(--muted); }
.job-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.job-card .time { font-weight: 800; font-size: 1.1rem; } .job-card .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem; margin-top: .6rem; }
.job-card .actions .btn, .job-card .actions button { justify-content: center; }

/* ---------- klantkaart ---------- */
.cust-head { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1rem; }
.cust-head .big { font-size: 1.4rem; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { border-left: 2px solid var(--line); padding: .2rem 0 .7rem .9rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.telefoon::before { background: var(--info); } .timeline li.email::before { background: #6b3fa0; } .timeline li.notitie::before { background: var(--accent); } .timeline li.systeem::before { background: #999; }
.timeline .meta { font-size: .78rem; color: var(--muted); } .timeline .body { white-space: pre-wrap; font-size: .9rem; }

/* ---------- werkbon / handtekening ---------- */
.sigpad { width: 100%; height: 220px; border: 2px dashed #9fb0bd; border-radius: 8px; background: #fff; touch-action: none; display: block; }
.signview { max-width: 760px; margin: 0 auto; }
.savestate { font-size: .8rem; font-weight: 600; } .savestate.local { color: #8a5a00; } .savestate.syncing { color: var(--info); } .savestate.saved { color: var(--ok); }
.photos { display: flex; flex-wrap: wrap; gap: .4rem; } .photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- dialogen en meldingen ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,30,40,.45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; width: min(720px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal header { padding: .9rem 1rem; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; }
.modal .mb { padding: 1rem; } .modal footer { padding: .8rem 1rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: .4rem; align-items: center; }
.toast { background: #1f2d36; color: #fff; padding: .55rem .9rem; border-radius: 8px; font-size: .9rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 90vw; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
.login { max-width: 380px; margin: 10vh auto; } .login .card { padding: 1.5rem; } .login h1 { margin-bottom: 1rem; }

@media (max-width: 820px) {
  :root { font-size: 15.5px; }
  main#app { padding: .7rem .7rem 5rem; }
  header#top { gap: .5rem; } #nav { display: none; } .top-right #whoami { display: none; }
  .cust-head { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
  .side { top: 0; z-index: 70; }
}
@media print { header#top, #bottomnav, .toolbar, button { display: none !important; } }

/* ---------- v0.2: sheet, uren, inmeten, berichten ---------- */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; margin-left: 3px; }
#bottomnav a { position: relative; } #bottomnav a .badge { position: absolute; top: 2px; left: 55%; }
.sheet-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 190px); -webkit-overflow-scrolling: touch; }
table.sheet { border-collapse: separate; border-spacing: 0; font-size: .78rem; min-width: 100%; }
table.sheet th, table.sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px; vertical-align: top; min-width: 112px; max-width: 160px; }
table.sheet thead th { position: sticky; top: 0; background: var(--brand); color: #fff; z-index: 3; font-weight: 600; white-space: nowrap; text-align: left; }
table.sheet thead th.today { background: var(--accent); }
table.sheet th.name, table.sheet td.name { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 74px; max-width: 90px; font-weight: 700; }
table.sheet thead th.name { z-index: 4; background: var(--brand); }
table.sheet tr.me td { background: #fff7ef; } table.sheet tr.me td.name { background: #ffeedd; }
table.sheet td.today { background: #fffaf3; }
table.sheet .job { display: block; padding: 2px 0; color: var(--ink); text-decoration: none; line-height: 1.25; }
table.sheet .job + .job { border-top: 1px dashed var(--line); }
table.sheet .job.voorlopig { color: #8a5300; font-style: italic; }
table.sheet .job .t { color: var(--muted); font-size: .7rem; }
table.sheet .off { color: var(--muted); font-weight: 600; text-transform: lowercase; }
table.sheet tr.team td { background: var(--line2); font-weight: 700; color: var(--muted); font-size: .72rem; }
.daycard { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 10px; padding: .75rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.daycard .top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.daycard .hrs { font-weight: 800; font-size: 1.1rem; } .daycard .ot { color: var(--accent); font-weight: 700; } .daycard .ot.neg { color: var(--bad); }
.timepair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .5rem 0; }
.timepair input { font-size: 1.15rem; padding: .5rem; width: 100%; }
.saldo { font-size: 2.2rem; font-weight: 800; color: var(--brand); } .saldo.neg { color: var(--bad); }
.flag { font-size: .82rem; padding: .25rem .5rem; border-radius: 5px; margin: .15rem 0; } .flag.hoog { background: #fde8e8; color: #9b1c1c; } .flag.middel { background: #fff3e0; color: #8a5300; } .flag.info { background: #eef4fb; color: #1f4f8a; }
.signedbadge { background: var(--mint); color: #1d5a3f; font-weight: 700; border-radius: 5px; padding: .15rem .5rem; font-size: .8rem; }
.win { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .8rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.win h3 { margin: 0 0 .4rem; display: flex; gap: .5rem; align-items: center; } .win h3 .nr { background: var(--brand); color: #fff; border-radius: 6px; padding: 0 .5rem; }
.win .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.win input.prefilled { background: #f2f6fb; } .win input.need { border-color: var(--accent); }
.win .sub { border-top: 1px dashed var(--line); margin-top: .6rem; padding-top: .5rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; } .thumbs figure { margin: 0; text-align: center; font-size: .65rem; color: var(--muted); }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.alarm { background: #fde8e8; border: 2px solid var(--bad); color: #7f1d1d; border-radius: 8px; padding: .7rem; font-weight: 600; margin: .5rem 0; }
.msg { padding: .6rem .2rem; border-bottom: 1px solid var(--line2); cursor: pointer; } .msg.unread .s { font-weight: 800; } .msg .m { font-size: .78rem; color: var(--muted); }
.msg.unread::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.item { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--line2); } .item input[type=checkbox] { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.health td:first-child { font-weight: 600; }
@media (max-width: 820px) { table.sheet th, table.sheet td { min-width: 96px; } .win .grid { grid-template-columns: 1fr 1fr; } }
/* voorkom horizontaal scrollen op telefoons: invoervelden passen zich aan de kolom aan */
label.f { min-width: 0; } label.f > input, label.f > select, label.f > textarea { width: 100%; min-width: 0; }
.form > *, .grid3 > *, .grid2 > *, .win .grid > * { min-width: 0; }
@media (max-width: 820px) { .win .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .toolbar select { max-width: 46vw; } .kv { grid-template-columns: 105px minmax(0, 1fr); } }
@media (max-width: 820px) { html { scroll-padding-top: 64px; scroll-padding-bottom: 96px; } }
#bottomnav a { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 820px) { header#top { padding: 0 .6rem; } .top-right { min-width: 0; gap: .4rem; } #syncpill { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; } header .brand span { display: none; } }
@media (min-width: 821px) { #bottomnav { display: none !important; } }
@media (min-width: 821px) { header#top { height: auto; min-height: 52px; flex-wrap: wrap; padding-top: .3rem; padding-bottom: .3rem; } #nav { flex-wrap: wrap; overflow: visible; } }

/* v0.2.1: brede tabellen scrollen op de telefoon binnen hun eigen kader i.p.v. de hele pagina */
@media (max-width: 820px) { table.t { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; } }

/* v0.2.1: [hidden] wint altijd (header/onderbalk stonden zichtbaar op het inlogscherm) */
[hidden] { display: none !important; }

/* v0.3 voortgang per opdracht */
.vg-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .4rem 0; }
.vg { display: flex; flex-direction: column; min-width: 7.5rem; flex: 1 1 7.5rem; padding: .4rem .55rem; border-radius: 8px; border: 1px solid #d6d9de; background: #f6f7f9; color: #59606b; font-size: .82rem; }
.vg .vg-l { font-weight: 600; }
.vg .vg-i { font-size: .9rem; }
.vg .vg-d, .vg .vg-x { font-size: .75rem; }
.vg.klaar { background: #e6f4ea; border-color: #8cc79c; color: #1e5b2f; }
.vg.bezig { background: #fff4e0; border-color: #f0b459; color: #6b4300; }
.vg.overgeslagen { opacity: .6; }
/* v0.3 werkbon: niet gemonteerd */
.item.nietgem { background: #fff1f0; border-radius: 6px; }
.nietgem-form { border-left: 3px solid #d9534f; margin: 0 0 .6rem 1.6rem; }
.nietgem-form .row input, .win .row.small input { width: 5.5rem; flex: 0 0 auto; }

/* v0.4 dashboard en offertes */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; }
.kpi-v { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.kpi-l { font-size: .85rem; color: var(--muted); }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list > li { border-bottom: 1px solid var(--line); }
.dash-list > li.zero { opacity: .55; }
.dash-row { display: flex; align-items: center; gap: .6rem; width: 100%; background: none; border: 0; padding: .5rem .2rem; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.dash-row:disabled { cursor: default; }
.dash-row:hover:not(:disabled) { background: #f6f7f9; }
.dash-list > li.open .dash-row { font-weight: 600; }
.dash-n { min-width: 2.2rem; text-align: right; font-size: 1.05rem; }
.dash-sub { margin: 0 0 .6rem 0; padding-left: 1.1rem; font-size: .9rem; }
.dash-sub li { margin: .15rem 0; }
.dash-sub li.late a { color: #b42318; }
.tabs .tab .count { color: var(--muted); font-weight: 400; }

/* v0.6: menu voor iedereen, ook op de telefoon (☰ opent een zijmenu met dezelfde items als bovenin) */
#menubtn { display: none; color: #fff; font-size: 1.55rem; line-height: 1; padding: .2rem .35rem; }
#drawer { position: fixed; inset: 0; z-index: 80; background: rgba(10,20,30,.45); }
#drawer .drawer-panel { position: absolute; top: 0; left: 0; bottom: 0; width: min(310px, 86vw); background: #fff; display: flex; flex-direction: column; box-shadow: 6px 0 24px rgba(0,0,0,.2); overflow-y: auto; }
#drawer .drawer-head { background: var(--brand); color: #fff; padding: .9rem 1rem; display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; padding-top: calc(.9rem + env(safe-area-inset-top)); }
#drawer .drawer-head .link { color: #fff; font-size: 1.3rem; }
#drawer-roles { color: #d5e1e8; margin-top: .15rem; }
#drawer-list { display: flex; flex-direction: column; padding: .4rem 0; flex: 1; }
#drawer-list a { padding: .75rem 1.1rem; color: var(--ink); font-size: 1.05rem; border-left: 4px solid transparent; }
#drawer-list a.active { background: #f1f5f9; border-left-color: var(--accent); font-weight: 700; text-decoration: none; }
#drawer-list a .badge { margin-left: .4rem; }
#drawer .drawer-foot { border-top: 1px solid var(--line); padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
#drawer .drawer-foot .link { color: var(--bad); font-size: .95rem; }
body.drawer-open { overflow: hidden; }
@media (max-width: 820px) { #menubtn { display: inline-block; } .top-right #logout { display: none; } }

/* v0.6: delen per kozijn */
.delen { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.deel { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; align-items: end; }
.deel-nr { font-weight: 700; font-size: .85rem; padding-bottom: .5rem; }

/* v0.6: offerte-overzicht per kozijn met grote foto's */
.koz-list { display: flex; flex-direction: column; gap: 1.1rem; }
.koz { border: 1px solid var(--line); border-radius: 8px; padding: .6rem; background: #fcfdfe; }
.koz-row td { font-size: .95rem; } .koz-row .koz-nr { font-weight: 800; color: var(--accent); width: 2rem; }
.koz-notes { white-space: pre-wrap; font-size: .9rem; background: #fff; border-left: 3px solid var(--line); padding: .3rem .6rem; margin: .4rem 0; }
.bigphotos { display: grid; gap: .6rem; margin-top: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bigphotos.n1 { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.bigphotos.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bigphotos.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bigphotos figure { margin: 0; } .bigphotos img { width: 100%; height: auto; max-height: 520px; object-fit: contain; background: #eef1f4; border-radius: 6px; border: 1px solid var(--line); display: block; }
.bigphotos figcaption { font-size: .75rem; color: var(--muted); margin-top: .15rem; }
@media (max-width: 820px) { .bigphotos, .bigphotos.n3, .bigphotos.n4 { grid-template-columns: minmax(0, 1fr); } }

/* v0.7: dashboard – kolom buiten SLA */
.dash-sla { min-width: 5.2rem; text-align: right; } .dash-head { padding-top: 0; padding-bottom: .2rem; }
.sla-bad { color: #fff; background: var(--bad); border-radius: 999px; padding: 0 .55rem; } .sla-ok { color: var(--ok); }

/* v0.7: bestelpagina – 1e en 2e inmeting onder elkaar */
table.cmp td { font-size: .92rem; } table.cmp tr.cmp-2 td { background: #f5f9fd; } table.cmp td.diff { background: #fde2df !important; color: #8b1d12; font-weight: 700; }
tr.late td { background: #fff4f2; }
.ref1 { background: #f8fafc; border: 1px dashed var(--line); border-radius: 6px; padding: .4rem; margin: .3rem 0 .6rem; }
.btn.wrap, button.wrap { white-space: normal; text-align: left; max-width: 100%; }
.bigphotos.n1 { max-width: 560px; }
.photo-pair { display: inline-flex; gap: 0; } .photo-pair button + button { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; } .photo-pair button:first-of-type { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* v0.9.0 agenda en mail */
.agenda-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin-top: .8rem; }
.agenda-week .card { margin: 0; }
.agenda-day.today { border-color: var(--accent); }
.agenda-item .time { font-weight: 600; font-variant-numeric: tabular-nums; }
.agenda-item.outlook { opacity: .85; }
ul.mails li { padding: .3rem 0; }
details.mail summary { cursor: pointer; }
.qline { border-bottom: 1px solid #e5e7eb; padding: .5rem 0 .7rem; }
.qline textarea { width: 100%; }
.tot { margin-left: auto; max-width: 380px; margin-top: .8rem; }
.tot > div { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; color: var(--muted, #6b7280); }
.tot > div b { color: inherit; }
.tot .grand { border-top: 1px solid #e5e7eb; margin-top: .3rem; padding-top: .4rem; font-weight: 600; color: #111; font-size: 1.1rem; }
.wv.focus { outline: 2px solid var(--accent); }
tr.probleem td { background: #fff4f4; }

/* v0.9.3 vergelijk 1e/2e inmeting */
.t.vergelijk tr.kop td{background:var(--bg2,#f3f4f6);padding-top:.6rem}
.t.vergelijk tr.r2 td{border-bottom:2px solid var(--line,#ddd)}
.t.vergelijk td.diff{background:#fff1d6;font-weight:600}
.pre{white-space:pre-wrap}

/* v0.9.4 Hier offerte maken */
.offerte-kop{display:flex;gap:1.5rem;align-items:center;flex-wrap:wrap}
.offerte-kop>dl{flex:1 1 420px;margin:0}
.hier-offerte{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:.3rem;margin-right:2.5rem}
.hier-offerte button{font-size:1.05rem;padding:.75rem 1.4rem}
@media (max-width:700px){.hier-offerte{margin:0;width:100%}.hier-offerte button{width:100%}}
.qline.open{border-left:4px solid #e8a33d;padding-left:.6rem}
.qline .bron{font-size:.75rem;color:var(--muted,#6b7280)}
.pdf-drop{border:2px dashed var(--line,#cbd5e1);border-radius:10px;padding:1rem;text-align:center}
.pdf-drop.over{background:#eef6ff;border-color:#3b82f6}

/* v0.9.9 inmeting: kozijn toevoegen prominent, afstand opslaan/afronden */
button.kozijn-toevoegen{display:block;width:100%;font-weight:700;font-size:1.15rem;padding:.9rem 1rem;margin:.8rem 0 1.2rem}
.opslaan-rij{display:flex;justify-content:space-between;align-items:center;gap:3rem;margin:1.5rem 0 2.5rem;flex-wrap:wrap}
.opslaan-rij>button:last-child{margin-left:auto}
@media (max-width:600px){.opslaan-rij{flex-direction:column;align-items:stretch;gap:2.5rem}.opslaan-rij>button:last-child{margin-left:0}}
.bovenlicht{border-left:3px solid var(--line,#cbd5e1);padding-left:.6rem;margin:.4rem 0}

/* v0.9.10 startpagina */
.tegels{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.8rem;margin:.6rem 0}
.tegel{display:block;background:var(--card,#fff);border:1px solid var(--line,#e2e8f0);border-radius:10px;padding:1rem;color:inherit;text-decoration:none;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.tegel:hover{border-color:#1e3a4c}
.tegel.let-op{border-left:4px solid #d97706}
.tegel-titel{font-weight:600}
.tegel-aantal{font-size:2rem;font-weight:700;line-height:1.2;margin:.2rem 0}
.tegel-sub{font-size:.85rem;color:var(--muted,#64748b)}
/* v0.9.14: werkbon zoals de papieren versie, mobiel af te vinken */
.wb-kop{border-top:4px solid #1e3a4c}
.wb-instr{background:#fff8e6;border-left:4px solid #d97706}
.wb-el{border:1px solid #d6dde3;border-radius:10px;padding:.6rem .7rem;background:#fff}
.wb-el.ok{border-color:#2f855a;background:#f0fff4}
.wb-el.niet{border-color:#c53030;background:#fff5f5}
.wb-el-kop{display:flex;gap:.6rem;align-items:flex-start}
.wb-nr{font-size:1.25rem;min-width:2.6rem;color:#1e3a4c}
.wb-titel{font-weight:600;font-size:1.05rem}
.wb-keuze{display:flex;gap:.5rem;margin-top:.5rem}
.wb-keuze{flex-wrap:wrap}
.wb-keuze button{flex:1 1 9rem;min-width:0;min-height:48px;font-size:1rem;font-weight:600;white-space:normal}
.wb-keuze button.aan-ok{background:#2f855a;color:#fff;border-color:#2f855a}
.wb-keuze button.aan-niet{background:#c53030;color:#fff;border-color:#c53030}
.nietgem-form{margin:.4rem 0 .6rem 0}
.mail-eko{border-left:3px solid #1e3a4c;padding:.4rem .6rem;margin:.4rem 0;background:#f7fafc;border-radius:6px}
.mail-eko.uit{border-left-color:#2f855a;background:#f0fff4}
.mail-eko .body{white-space:pre-wrap;font-size:.92rem}
