/* Stijl overgenomen uit klantenfiche-prototype.html (kleuren en lettertypes van bookies.finance).
   Lettertypes staan op de eigen site, zodat er niets naar Google gaat. */
@font-face { font-family: "Sora"; font-weight: 400; font-display: swap; src: url(fonts/sora-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url(fonts/sora-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-display: swap; src: url(fonts/sora-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --bg: #F6F8F9;
  --surface: #FFFFFF;
  --sunk: #F1F0F5;
  --ink: #231459;
  --muted: #67637F;
  --line: #E4E2EC;
  --accent: #6B4BEF;
  --accent-2: #5075FB;
  --accent-ink: #FFFFFF;
  --accent-soft: #EFEBFE;
  --note: #FFF4E0;
  --note-ink: #8A5A00;
  --ok: #1F9E74;
  --form: #E9EEFF;
  --form-ink: #3A55C9;
  --shadow: 0 1px 2px rgba(35,20,89,.05), 0 8px 24px -14px rgba(35,20,89,.22);
  --f-display: "Sora", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Sora", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120B2E; --surface: #1B1440; --sunk: #160F36; --ink: #ECEAF7; --muted: #A7A3C0; --line: #2E2656;
    --accent: #A08BFF; --accent-2: #7F9BFF; --accent-ink: #120B2E; --accent-soft: #251C52;
    --note: #2C2214; --note-ink: #FFC56B; --ok: #4ED8A8; --form: #1B2550; --form-ink: #9DB2FF;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #120B2E; --surface: #1B1440; --sunk: #160F36; --ink: #ECEAF7; --muted: #A7A3C0; --line: #2E2656;
  --accent: #A08BFF; --accent-2: #7F9BFF; --accent-ink: #120B2E; --accent-soft: #251C52;
  --note: #2C2214; --note-ink: #FFC56B; --ok: #4ED8A8; --form: #1B2550; --form-ink: #9DB2FF;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: .9rem; line-height: 1.55;
  padding-inline: 20px; padding-block: 0 48px;
}
.wrap { max-width: 1480px; margin-inline: auto; display: flex; flex-direction: column; gap: 14px; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding-left: 1.1rem; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* App bar */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--accent-ink); display: grid; place-items: center; font-size: .85rem; }
.brand small { font-weight: 500; color: var(--muted); font-family: var(--f-body); }
.search { flex: 1 1 260px; max-width: 360px; }
.search input { width: 100%; font: inherit; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.example-tag { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--bg); white-space: nowrap; }

/* Client header */
.client { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.who { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.who-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.who h1 { font-size: 1.5rem; line-height: 1.2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .75rem; padding: 2px 9px; border-radius: 6px; background: var(--accent-soft); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--muted); font-size: .84rem; }
.meta b { color: var(--ink); font-weight: 600; }
.attn { background: var(--note); padding: 14px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.attn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lbl { font-family: var(--f-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 500; color: var(--muted); }
.attn .lbl { color: var(--note-ink); }
.attn ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: .86rem; }
.attn li::before { content: "!"; font-weight: 700; color: var(--note-ink); margin-right: 8px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--note-ink); font-size: .78rem; font-weight: 600; cursor: pointer; }

/* Buttons */
.sp {
  display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600;
  color: var(--accent); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px;
  background: var(--surface); white-space: nowrap; cursor: pointer;
}
.sp:hover { border-color: var(--accent); }
.sp .mono { font-weight: 400; font-size: .7rem; color: var(--muted); }
.btn {
  border: 0; border-radius: 8px; padding: 7px 14px; font-size: .84rem; font-weight: 600; cursor: pointer;
  background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn svg, .zoom svg, .back svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: 8px; }
.hint { color: var(--muted); font-size: .8rem; }
.tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: .76rem; align-items: center; flex-wrap: wrap; }

/* Overview columns */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.group-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; padding: 4px 4px 2px; cursor: pointer; text-align: left;
}
.group-head h2 { font-size: 1rem; }
.zoom { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); font-weight: 500; }
.group-head:hover .zoom, .group-head:hover h2 { color: var(--accent); }

details.blk { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
details.blk > summary {
  list-style: none; cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .88rem;
}
details.blk > summary::-webkit-details-marker { display: none; }
details.blk > summary::after { content: "+"; font-family: var(--f-mono); color: var(--muted); margin-left: 8px; }
details.blk[open] > summary::after { content: "–"; }
details.blk > summary .cnt { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); font-weight: 400; margin-left: auto; }
details.blk > summary .peek { font-weight: 400; color: var(--muted); font-size: .78rem; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
details.blk[open] > summary .peek { display: none; }
.in { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.in > .sp, .card > .sp { align-self: flex-start; }

.row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: 4px 10px; padding-block: 5px; border-bottom: 1px dashed var(--line); font-size: .84rem; align-items: baseline; }
.row:last-of-type { border-bottom: 0; }
.row .k { color: var(--muted); }
.row .v { font-weight: 600; min-width: 0; }
.ok { color: var(--ok); font-weight: 700; }
.src { font-family: var(--f-mono); font-size: .62rem; font-weight: 500; color: var(--form-ink); background: var(--form); border-radius: 4px; padding: 0 5px; white-space: nowrap; cursor: help; }
.src.man { color: var(--muted); background: var(--sunk); }

/* Opvolging bar */
.followup { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.followup-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--sunk); flex-wrap: wrap; }
.followup-head .group-head { width: auto; padding: 0; gap: 14px; }
.followup-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.followup-body > div { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.followup-body > div + div { border-left: 1px solid var(--line); }
.log { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.entry { display: flex; flex-direction: column; gap: 2px; padding-block: 8px; border-bottom: 1px dashed var(--line); font-size: .84rem; }
.entry .when { font-size: .74rem; color: var(--muted); }
.entry .when b { color: var(--ink); font-family: var(--f-body); }
.form { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-block: 6px; border-bottom: 1px dashed var(--line); font-size: .84rem; flex-wrap: wrap; }
.form:last-of-type { border-bottom: 0; }
.form .d { color: var(--muted); font-size: .74rem; }
.later { border: 1px dashed var(--line); border-radius: 10px; padding: 9px 12px; color: var(--muted); font-size: .82rem; }

/* Zoomed view (style of proposal 2) */
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.detail-bar { display: flex; align-items: stretch; gap: 8px; border-bottom: 1px solid var(--line); padding-inline: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: .84rem; cursor: pointer; padding: 10px 8px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; border-left: 1px solid var(--line); padding-left: 6px; }
.tab { border: 0; background: none; cursor: pointer; padding: 12px 12px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .9rem; }
.tab .cnt { font-family: var(--f-mono); font-size: .72rem; margin-left: 4px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.panel { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.panel-sec { display: flex; flex-direction: column; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.card .row { grid-template-columns: 7rem minmax(0, 1fr) auto; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; background: var(--surface); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-top h4 { font-size: .98rem; }
.kind { font-family: var(--f-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card.wide { grid-column: 1 / -1; }

[hidden] { display: none !important; }

@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  body { padding-inline: 16px; }
  .client, .board, .followup-body { grid-template-columns: 1fr; }
  .followup-body > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .k { grid-column: 1 / -1; font-size: .76rem; }
  .toolbar { position: static; }
  .tabs { border-left: 0; padding-left: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .detail:not([hidden]) { animation: zoomin .18s ease-out; }
  @keyframes zoomin { from { transform: scale(.985); } to { transform: none; } }
}

/* ===== Aanvullingen voor de echte site ===== */
body { margin: 0; }
a { color: inherit; }
a.brand { text-decoration: none; color: inherit; }
a.sp { text-decoration: none; }
.sp.off { color: var(--muted); cursor: default; }
.sp.off:hover { border-color: var(--line); }
.whoami { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.whoami b { color: var(--ink); }
.whoami select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; }
.test-tag { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--note); color: var(--note-ink); white-space: nowrap; }
.melding { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; color: var(--muted); }
.melding.fout { border-color: #d9534f; color: #b52b27; }

/* Klantenlijst */
.lijst { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.lijst table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.lijst th { text-align: left; font-family: var(--f-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 500; color: var(--muted); padding: 10px 16px; background: var(--sunk); border-bottom: 1px solid var(--line); }
.lijst td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.lijst tr:last-child td { border-bottom: 0; }
.lijst tbody tr { cursor: pointer; }
.lijst tbody tr:hover { background: var(--accent-soft); }
.lijst td a { font-weight: 600; text-decoration: none; }
.lijst .leeg { color: var(--muted); text-align: center; padding: 24px; }
@media (max-width: 760px) { .lijst .opt { display: none; } }

/* Kaartsubtitel in het overzicht (blok met meerdere kaarten) */
.sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-weight: 600; font-size: .82rem; }
.sub .kind { font-weight: 400; }

/* Notities */
.attn li { position: relative; padding-right: 60px; }
.attn li .acties { position: absolute; right: 0; top: 50%; transform: translateY(-50%); margin-left: 0; }
.attn li::before { display: none; }
.attn .txt::before { content: "!"; font-weight: 700; color: var(--note-ink); margin-right: 8px; }
.attn .leeg { color: var(--note-ink); opacity: .7; font-size: .82rem; }
.wie { font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wie b { color: var(--ink); font-weight: 600; }
.student { font-family: var(--f-mono); font-size: .62rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; border-radius: 4px; background: #FFE3EC; color: #A3164A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .student { background: #4A1A2E; color: #FF9DC0; } }
:root[data-theme="dark"] .student { background: #4A1A2E; color: #FF9DC0; }
.entry.door-student { border-left: 3px solid #E04F86; padding-left: 10px; }
.kop-acties { display: inline-flex; align-items: center; gap: 10px; }
.kop-acties .sp svg, .ico svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.attn .sp { background: transparent; border-color: color-mix(in srgb, var(--note-ink) 30%, transparent); color: var(--note-ink); }
.attn .btn { padding: 4px 10px; font-size: .76rem; }
.attn .txt .student { margin-left: 6px; vertical-align: 1px; }
.acties { display: inline-flex; gap: 2px; margin-left: auto; }
.ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.ico:hover { border-color: var(--line); background: var(--surface); color: var(--accent); }
.ico.gevaar:hover { color: #c0392b; }
.entry .wie { width: 100%; }
.link-btn.meer { color: var(--accent); align-self: flex-start; margin-top: 6px; }
.entry .txt { white-space: pre-wrap; }

/* Venster om een notitie te schrijven */
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 18px 20px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(18, 11, 46, .35); }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h3 { font-size: 1.05rem; }
dialog textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 120px; resize: vertical; }
dialog .knoppen { display: flex; justify-content: flex-end; gap: 8px; }
dialog .knoppen .sp { padding: 7px 14px; font-size: .84rem; }
dialog .info { font-size: .78rem; color: var(--muted); }
dialog .fout { color: #c0392b; font-size: .8rem; }
.wie-kort { margin-left: 8px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
/* Icoontjes bij verslagen zweven rechts op de naamregel, zodat er niets verspringt. */
.entry { position: relative; }
.entry .acties { position: absolute; right: 0; top: 4px; }
/* Op smallere schermen: kopknoppen netjes onder de titel in plaats van over de rand. */
.attn-head { flex-wrap: wrap; align-items: center; }
.kop-acties { flex-wrap: nowrap; white-space: nowrap; }
