:root {
  /* Huisstijl Even Aandacht (evenaandacht.nl): lichtblauw uit het logo, met een donkerdere variant voor knoppen en
     links zodat witte tekst goed leesbaar blijft (contrast 4,75:1). */
  --logo-blue: #79bbe5;
  --bg: #f8f8f8;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #1f2328;
  --muted: #5c6670;
  --border: #e1e6ec;
  --brand: #2e79a9;
  --brand-ink: #ffffff;
  --brand-soft: #e8f3fb;
  --ok: #2e7d4f;
  --ok-soft: #e3f3e9;
  --warn: #9a6a00;
  --warn-soft: #fbf0d6;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c; --surface: #19212a; --surface-2: #222c37; --text: #e6edf3; --muted: #9aa7b4; --border: #2f3b48;
    --brand: #79bbe5; --brand-ink: #0b1d2b; --brand-soft: #1b3142; --ok: #6cc893; --ok-soft: #1c3326;
    --warn: #e8b84a; --warn-soft: #3a3019; --bad: #f08a80; --bad-soft: #3d2220; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-weight: 600; color: var(--brand); } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--brand); }
.loading { padding: 2rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; padding: .25rem .5rem 1rem; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.side .brand { justify-content: center; padding: .25rem .5rem 1rem; }
.side .brand img.logo { width: 150px; height: auto; border-radius: 10px; }
.auth .brand img.logo { width: 200px; height: auto; border-radius: 14px; box-shadow: var(--shadow); }
.auth .brand { flex-direction: column; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: .5rem .65rem; border-radius: 8px; color: var(--text); text-decoration: none; margin-bottom: 2px; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--logo-blue); }
.nav .count { background: var(--bad); color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 .45rem; font-weight: 600; }
.side .who { border-top: 1px solid var(--border); margin-top: 1rem; padding: .75rem .5rem 0; font-size: .85rem; }
main { padding: 1.5rem 2rem 3rem; max-width: 1200px; width: 100%; min-width: 0; }
.topbar { display: none; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 0; z-index: 20; height: auto; }
  .side.open { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
  main { padding: 1rem 1rem 3rem; }
}

/* Components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; text-decoration: none; color: inherit; display: block; }
.kpi .v { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.kpi.alert .v { color: var(--bad); }
.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .cols-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.spread h1, .spread h2 { margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: var(--surface-2); }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

button, .btn { font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: .45rem .9rem; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
button:hover, .btn:hover { background: var(--surface-2); }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.primary:hover { filter: brightness(1.07); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.small { padding: .2rem .6rem; font-size: .85rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.big { width: 100%; padding: 1.2rem; font-size: 1.2rem; border-radius: 14px; justify-content: center; }

form .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem 1rem; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .35rem; }
.checks label { display: flex; align-items: center; gap: .35rem; font-weight: 400; color: var(--text); font-size: .95rem; }
.checks input { width: auto; margin: 0; }
.slot { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: .5rem; align-items: end; margin-bottom: .5rem; }
.form-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }

.notice { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; background: var(--brand-soft); }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.ok { background: var(--ok-soft); }
.empty { color: var(--muted); padding: 1rem 0; }

.contract-body { white-space: pre-wrap; font: .9rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1rem; border-radius: 8px; max-height: 420px; overflow: auto; }
.sigpad { border: 2px dashed var(--border); border-radius: 8px; background: #fff; width: 100%; height: 160px; touch-action: none; display: block; }
.sig-img { max-height: 60px; background: #fff; border-radius: 4px; }

.score { display: inline-flex; align-items: center; gap: .4rem; }
.bar { width: 70px; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); }

.auth { max-width: 420px; margin: 8vh auto; padding: 0 1rem; }
.auth .brand { justify-content: center; font-size: 1.3rem; }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 600; }

.clock { text-align: center; }
.clock .timer { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .5rem 0; }

#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .65rem 1rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 2rem); z-index: 50; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--bad); color: #fff; }

dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(760px, calc(100% - 2rem)); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog .dlg { padding: 1.1rem 1.25rem; max-height: 85vh; overflow: auto; }

/* Smalle schermen: tabellen met class "stack" worden kaarten, zodat knoppen in beeld blijven. */
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--border); padding: .4rem 0; }
  table.stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .2rem 0; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; text-align: left; }
  table.stack td:not([data-label]) { justify-content: flex-end; }
  table.stack td:not([data-label])::before { content: none; }
}

/* Onboarding */
.checks-list { list-style: none; padding: 0; margin: .5rem 0; font-size: .9rem; }
.checks-list li { display: flex; gap: .45rem; padding: .15rem 0; }
.checks-list li > span { width: 1.1em; flex: none; font-weight: 700; }
.checks-list li.ok > span { color: var(--ok); }
.checks-list li.warn > span { color: var(--warn); }
.checks-list li.fail > span { color: var(--bad); }
.checks-list li.todo { color: var(--muted); }
.doc { border: 1px solid var(--border); border-radius: 8px; padding: .75rem .9rem; margin-bottom: .75rem; }
.step.done { border-color: var(--logo-blue); }
.step h2 { margin: 0; }
.upload { margin-top: .5rem; }
details { margin: .4rem 0; }
summary { cursor: pointer; }
.consent-text { background: var(--surface-2); padding: .6rem .8rem; border-radius: 8px; white-space: pre-line; }

/* Twee sporen: wisselknop en spoorlabel. Het schoonmaakspoor krijgt een groene accentkleur, zodat altijd zichtbaar is waar u werkt. */
.track-switch { display: flex; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; margin: 0 .25rem 1rem; }
.track-switch button { flex: 1; border: 0; background: transparent; padding: .4rem .5rem; border-radius: 8px; font-size: .9rem; justify-content: center; color: var(--muted); }
.track-switch button.active { background: var(--surface); color: var(--track); font-weight: 600; box-shadow: var(--shadow); }
.track-pill { display: inline-block; margin: 0 .5rem 1rem; padding: .2rem .7rem; border-radius: 99px; background: var(--track-soft); color: var(--track); font-weight: 600; font-size: .85rem; }
.topbar .track-pill { margin: 0; }
:root { --track: var(--brand); --track-soft: var(--brand-soft); }
body[data-track="schoonmaak"] { --track: #2f7d5b; --track-soft: #e3f3ea; }
body[data-track="schoonmaak"] h1 { color: var(--track); }
body[data-track="schoonmaak"] .nav a.active { background: var(--track-soft); color: var(--track); box-shadow: inset 3px 0 0 var(--track); }
@media (prefers-color-scheme: dark) { body[data-track="schoonmaak"] { --track: #6cc893; --track-soft: #1c3326; } }

/* Berichten */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; gap: .75rem; padding: .75rem .5rem; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li:hover, .notif-list li:focus { background: var(--surface-2); outline: none; }
.notif-list li.unread { background: var(--track-soft); }
.notif-list li.unread b::before { content: ''; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--track); margin-right: .4rem; vertical-align: middle; }
.notif-list li.urgent { box-shadow: inset 3px 0 0 var(--bad); }
.notif-list .ni { font-size: 1.25rem; line-height: 1.4; }
tr.row-urgent td { background: var(--bad-soft); }

/* Financieel: eenvoudige staafgrafiek */
.bars { display: flex; gap: .75rem; align-items: flex-end; padding: .5rem 0; overflow-x: auto; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 44px; flex: 1; }
.bar-stack { display: flex; align-items: flex-end; gap: 4px; }
.bar { width: 16px; border-radius: 4px 4px 0 0; }
.bar.rev, .dot.rev { background: var(--track); }
.bar.mar, .dot.mar { background: var(--ok); }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin: 0 .25rem 0 .75rem; vertical-align: middle; }
.neg { color: var(--bad); }
button.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger.solid:disabled { opacity: .5; }
@media (min-width: 821px) { .rooster { table-layout: fixed; } .rooster td:first-child { width: 120px; } .rooster td.act { width: 240px; } }
/* Chat */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; }
.chat-list ul { list-style: none; margin: 0; padding: 0; }
.chat-list li a { display: block; padding: .6rem .5rem; border-radius: 8px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.chat-list li a:hover, .chat-list li a.active { background: var(--brand-soft); }
.chat-list .count { background: var(--bad); color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 .45rem; font-weight: 600; }
.chat-eligible li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.chat-pane { display: flex; flex-direction: column; min-height: 60vh; }
.chat-head { gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chat-actions { display: flex; gap: .4rem; }
.chat-back { display: none; font-size: 1.5rem; text-decoration: none; line-height: 1; }
.chat-disclaimer { margin-bottom: .6rem; }
.chat-log { flex: 1; overflow-y: auto; max-height: 55vh; display: flex; flex-direction: column; gap: .45rem; padding: .3rem .1rem 1rem; }
.chat-log.inspect { max-height: 50vh; margin-top: 1rem; }
.msg { max-width: 78%; padding: .5rem .75rem; border-radius: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.msg .t { display: block; font-size: .7rem; opacity: .7; margin-top: .2rem; text-align: right; }
.msg.mine { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--brand-soft); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; max-width: 92%; background: transparent; border: 1px dashed var(--border); color: var(--muted); font-size: .82rem; text-align: center; }
.msg.system .t { text-align: center; }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; border-top: 1px solid var(--border); padding-top: .6rem; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 2.6rem; }
tr.row-bad td { background: var(--bad-soft); }
@media (max-width: 820px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.has-active .chat-list { display: none; }
  .chat-layout:not(.has-active) .chat-pane { display: none; }
  .chat-back { display: inline; }
  .chat-log { max-height: calc(100vh - 340px); }
  .msg { max-width: 88%; }
}
/* Keuze samenwerkingsvorm bij registratie */
fieldset.choice { border: 0; padding: 0; margin: .75rem 0 0; display: grid; gap: .5rem; }
fieldset.choice legend { font-weight: 600; margin-bottom: .4rem; }
.choice-card { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.choice-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-card input { margin-top: .25rem; width: auto; }
.choice-card small { display: block; color: var(--muted); margin-top: .2rem; font-weight: 400; }
.choice-card.disabled { opacity: .55; cursor: not-allowed; }

/* Informatie en hulp */
.help-contact { border-color: var(--brand); }
.help-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.help-buttons .btn { padding: .6rem 1rem; }
.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.link-card { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; background: var(--surface); }
.link-card:hover, .link-card:focus-visible { border-color: var(--brand); background: var(--surface-2); }
.link-card .link-host { color: var(--brand); font-weight: 600; margin-top: auto; padding-top: .25rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip { border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; }
.chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
details.faq { border-bottom: 1px solid var(--border); padding: .6rem 0; margin: 0; }
details.faq summary { font-weight: 600; }
details.faq p { margin: .5rem 0 0; }
[hidden] { display: none !important; }

/* Hulpchat */
.msg .who { display: block; font-size: .72rem; font-weight: 600; opacity: .8; margin-bottom: .15rem; }
.msg.theirs.assistant { background: var(--surface-2); border: 1px solid var(--border); }
.msg.typing { opacity: .7; }
.support-log { min-height: 160px; max-height: 420px; border: 1px solid var(--border); border-radius: 10px; padding: .75rem; margin-bottom: .6rem; }
.support-actions { margin-top: .6rem; gap: .5rem; }

/* Tweestapsverificatie */
.tfa-qr { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--border); margin: .5rem 0 1rem; }
.tfa-qr svg { width: 100%; height: 100%; display: block; }
.tfa-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .4rem; margin: .5rem 0; }
.tfa-codes code { padding: .4rem .6rem; background: var(--surface-2); border-radius: 6px; text-align: center; font-size: 1rem; letter-spacing: .05em; }
.tfa-steps li { margin-bottom: .4rem; }
