/* Sales Recorder — zakelijke, rustige stijl met Cronos-logo. Eén accentkleur: opname-rood. */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/inter.woff2) format('woff2'); }
:root {
  --bg: #F7F7F5;
  --card: #FFFFFF;
  --subtle: #F2F2EF;
  --ink: #18181B;
  --text: #27272A;
  --muted: #71717A;
  --border: #E6E5E1;
  --border-strong: #D4D3CE;
  --red: #E5484D;
  --red-dark: #CE2C31;
  --green: #18794E;  --green-bg: #E9F6EE;
  --amber: #A35200;  --amber-bg: #FDF1E3;
  --rose: #B4232A;   --rose-bg: #FCEBEC;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; color: var(--ink); margin: 0; }
h2 { font-size: .95rem; font-weight: 600; color: var(--ink); margin: 0 0 .5rem; }
p { margin: .25rem 0; }
ul, ol { padding-left: 1.15rem; margin: .25rem 0; }
li { margin: .3rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header & navigatie ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; color: var(--ink); }
.brand svg { width: 22px; height: 22px; fill: var(--ink); }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 0 12px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--ink); }
.nav a .i { display: none; }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.topbar-user #topbar-naam { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 720px) {
  .topbar { backdrop-filter: none; background: #fff; } /* backdrop-filter zou de vaste navbalk in de header vangen */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; height: auto; z-index: 20; justify-content: space-around; background: #fff; border-top: 1px solid var(--border); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .nav a { flex-direction: column; gap: 3px; font-size: .72rem; padding: 4px 16px; border: 0; margin: 0; }
  .nav a .i { display: block; width: 22px; height: 22px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

.view { max-width: 1080px; margin: 0 auto; padding: 28px 20px 48px; }
.view.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- Formulierelementen ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
}
input::placeholder { color: #A1A1AA; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24,24,27,.08); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; border-radius: var(--radius-sm); padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--ink);
}
.btn:hover { background: var(--subtle); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Opnemen ---------- */
.recorder { text-align: center; padding: 24px 24px 22px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.timer { font-size: 3.2rem; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 28px; line-height: 1; }
.hint { color: var(--muted); min-height: 1.5em; margin-top: 10px; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 36px; margin: 34px 0 28px; }
.controls #btn-pause { grid-column: 1; justify-self: end; }
.controls .rec { grid-column: 2; }
.controls .ctrl-spacer { grid-column: 3; }
.ctrl { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.ctrl:hover { background: var(--subtle); }
.upload { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; cursor: pointer; }
.upload:hover { color: var(--ink); }
.is-recording .upload { visibility: hidden; }

/* Klassieke opnameknop: rode stip → rood vierkantje (stop) */
.rec { width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--border-strong); background: var(--card); padding: 0; display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rec:hover { border-color: var(--muted); }
.rec:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.rec-dot { width: 64px; height: 64px; border-radius: 50%; background: var(--red); transition: all .2s ease; }
.rec.recording .rec-dot { width: 30px; height: 30px; border-radius: 6px; }
.ctrl-spacer { width: 52px; }

/* ---------- Gesprekkenlijst ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.filters input { flex: 1; }
.filter-wrap { position: relative; }
.filter-wrap > .btn { height: 100%; }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ink); color: #fff; font-size: .72rem; padding: 0 5px; }
.popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.1); padding: 14px 16px 16px; }
.popover .label { margin: 12px 0 6px; }
.popover .label:first-child { margin-top: 0; }
.popover .linkbtn { margin-top: 14px; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-size: .85rem; padding: 5px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--card); color: var(--text); cursor: pointer; }
.chips button:hover { border-color: var(--ink); }
.chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips button:disabled { opacity: .4; cursor: not-allowed; }

.table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tr { display: grid; grid-template-columns: 84px minmax(0, 1fr) 100px 100px 120px 56px 32px; gap: 16px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.tr:first-child { border-top: 0; }
a.tr:hover { background: #FAFAF9; }
.tr.th { font-size: .8rem; color: var(--muted); padding-top: 10px; padding-bottom: 10px; background: #FAFAF9; }
.tr .titel strong { display: block; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .titel span { font-size: .85rem; color: var(--muted); }
.tr .dim { color: var(--muted); font-size: .88rem; }
.tr .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .tr { grid-template-columns: minmax(0, 1fr) auto 32px; gap: 4px 12px; }
  .tr .del { grid-column: 3; grid-row: 1 / span 2; }
  .tr.th { display: none; }
  .tr .titel { grid-column: 1; grid-row: 1; }
  .tr .c-sent { grid-column: 2; grid-row: 1; justify-self: end; }
  .tr .datum { grid-column: 1; grid-row: 2; }
  .tr .c-status { grid-column: 2; grid-row: 2; justify-self: end; }
  .tr .c-int, .tr .num { display: none; }
}
.empty { padding: 32px 18px; color: var(--muted); text-align: center; }

/* badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .8rem; font-weight: 500; background: var(--subtle); color: var(--text); white-space: nowrap; }
.badge.positief, .badge.hoog { background: var(--green-bg); color: var(--green); }
.badge.gemengd { background: var(--amber-bg); color: var(--amber); }
.badge.negatief { background: var(--rose-bg); color: var(--rose); }
.badge.laag { color: var(--muted); }
.status-txt { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.status-txt.open { color: var(--ink); font-weight: 500; }
.status-txt.fout { color: var(--rose); font-weight: 500; }
.status-txt.open::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: 2px; }

/* ---------- Detail ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.back:hover { color: var(--ink); }
.back .i { width: 16px; height: 16px; }
.meta { color: var(--muted); margin-top: 4px; }
.status { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--border); }
.status.error { background: var(--rose-bg); border-color: transparent; color: var(--rose); }
.sent { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--green-bg); color: var(--green); font-size: .9rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sent .linkbtn { color: var(--green); font-size: .85rem; margin-left: auto; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.doc { margin-top: 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.facts > div { padding: 14px 18px; border-left: 1px solid var(--border); min-width: 0; }
.facts > div:first-child { border-left: 0; }
.facts .v { color: var(--ink); font-weight: 500; }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr 1fr; } .facts > div:nth-child(3) { border-left: 0; } .facts > div:nth-child(n+3) { border-top: 1px solid var(--border); } }
.doc section { padding: 18px 22px; border-top: 1px solid var(--border); }
.doc section:first-of-type { border-top: 0; }
.doc .who { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.items { padding-left: 1.1rem; }
.items li { margin-bottom: .55rem; }
.items li::marker { color: var(--muted); }
blockquote { margin: .3rem 0 0; padding-left: 12px; border-left: 2px solid var(--border-strong); color: var(--muted); font-size: .92rem; }
.marks { list-style: none; padding: 0; }
.marks li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: start; }
.marks .i { width: 16px; height: 16px; margin-top: 3px; }
.marks .ok { color: var(--green); }
.marks .open { color: var(--amber); }
.marks .sig { color: var(--ink); }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.todo li:first-child { border-top: 0; padding-top: 0; }
.todo .wie { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.next { background: #FAFAF9; }
.next p { color: var(--ink); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 3px 9px; border-radius: 6px; background: var(--subtle); font-size: .85rem; }

.more { display: flex; flex-wrap: wrap; gap: 20px; margin: 18px 2px 8px; font-size: .9rem; }

/* goedkeurbalk */
.approve { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0,0,0,.04); }
.approve-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 20px; }
.approve-dest { flex: 1; min-width: 0; }
.approve-dest .label { margin-bottom: 6px; }
.approve .btn.primary { padding: 11px 18px; white-space: nowrap; }
body.has-approve .view { padding-bottom: 150px; }
@media (max-width: 720px) {
  .approve { bottom: calc(60px + env(safe-area-inset-bottom)); padding-bottom: 14px; }
  .approve-inner { flex-direction: column; align-items: stretch; gap: 12px; }
  #dest { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
  #dest button { white-space: nowrap; }
  body.has-approve .view { padding-bottom: 170px; }
}

/* ---------- Inzichten ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr 1fr; } .kpi .v { font-size: 1.35rem; } }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: .82rem; color: var(--muted); }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.panel h2 { margin-bottom: 14px; }
.panel h2 .muted { font-weight: 400; font-size: .85rem; }


.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: .9rem; max-width: calc(100% - 32px); z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
body.has-approve .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
@media (max-width: 720px) { .toast { bottom: calc(80px + env(safe-area-inset-bottom)); } body.has-approve .toast { bottom: calc(230px + env(safe-area-inset-bottom)); } }

.del { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.del .i { width: 16px; height: 16px; }
.del:hover { background: var(--rose-bg); color: var(--rose); }
@media (hover: hover) { a.tr .del { opacity: 0; } a.tr:hover .del, a.tr .del:focus-visible { opacity: 1; } }
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-top .back { margin-bottom: 0; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.small .i { width: 15px; height: 15px; }
#btn-delete-top:hover { color: var(--rose); border-color: var(--rose); background: var(--card); }
.linkbtn.plain { color: var(--text); text-align: left; }

/* ---------- Bijlagen (notities, foto's, documenten) ---------- */
.add-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 2px 0 10px; }
.add-row .btn { padding: 7px 12px; font-size: .88rem; }
.add-row .btn .i { width: 16px; height: 16px; }
.pending { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 12px; }
.pending:empty { display: none; }
.notitie-box { margin: 0 0 12px; text-align: left; }
.notitie-box textarea { min-height: 80px; margin-bottom: 8px; resize: vertical; }
.notitie-box .row { display: flex; gap: 8px; justify-content: flex-end; }
.bijlagen { margin-top: 12px; padding: 16px 18px; }
.bijlagen-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bijlagen-head h2 { margin: 0; }
.bijlagen-head .add-row { margin: 0; justify-content: flex-end; }
.bijlage-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.bijlage-item:first-child { border-top: 0; }
.bijlage-item .thumb { width: 44px; height: 44px; border-radius: 6px; background: var(--subtle); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.bijlage-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.bijlage-item .thumb .i { width: 18px; height: 18px; }
.bijlage-item .naam { font-weight: 500; color: var(--ink); }
.bijlage-item .tekst { font-size: .88rem; color: var(--muted); white-space: pre-wrap; margin-top: 2px; max-height: 5.5em; overflow: hidden; }
.bijlage-item .tekst.open { max-height: none; }
.bijlage-item .meer { font-size: .82rem; }
.bijlagen .leeg { color: var(--muted); font-size: .9rem; padding: 8px 0 2px; }
.chip-file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 10px; border-radius: 6px; background: var(--subtle); font-size: .85rem; max-width: 100%; }
.chip-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.chip-file button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; display: grid; place-items: center; }
.chip-file button:hover { color: var(--rose); }
.chip-file .i { width: 14px; height: 14px; }
.chip-file.fout { background: var(--rose-bg); color: var(--rose); }
.status.stale { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.status.stale .btn { background: var(--card); }

/* ---------- Bewerken ---------- */
.detail-actions { display: flex; gap: 8px; }
.edit-form { margin-top: 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; display: grid; gap: 14px; }
.edit-form label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.edit-form label > span small { color: #A1A1AA; }
.edit-form input, .edit-form textarea, .edit-form select { font-size: .95rem; color: var(--ink); }
.edit-form textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
.edit-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-form .three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .edit-form .two, .edit-form .three { grid-template-columns: 1fr; } }
.edit-form .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.follow { list-style: none; padding: 0; margin: 0; }
.follow li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.follow li:first-child { border-top: 0; }
.follow a { text-decoration: none; color: var(--ink); font-weight: 500; }
.follow a:hover { text-decoration: underline; }
.follow .stap { color: var(--text); font-size: .92rem; grid-column: 1; }
.follow .side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .82rem; color: var(--muted); }
.insight { margin-top: 12px; }
.insight .lead { font-size: 1rem; line-height: 1.6; color: var(--ink); margin: 0 0 6px; max-width: 76ch; }
.insight-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.insight h3 { font-size: .85rem; font-weight: 600; color: var(--ink); margin: 14px 0 4px; }
.insight ul { margin: 0; padding-left: 1.1rem; }
.insight li { margin: .35rem 0; font-size: .93rem; }
@media (max-width: 720px) { .insight-cols { grid-template-columns: 1fr; } }
.rec-item { padding: 9px 0; border-top: 1px solid var(--border); }
.rec-item:first-child { border-top: 0; }
.rec-item .top { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; color: var(--ink); }
.rec-item .top span { font-weight: 400; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.rec-item p { font-size: .88rem; color: var(--muted); margin: 2px 0 4px; }
.klanten { display: flex; flex-wrap: wrap; gap: 4px; }
.klanten button { font: inherit; font-size: .78rem; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.klanten button:hover { border-color: var(--ink); }

/* ---------- Eindrapport ---------- */
.rapport-card { margin-top: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rapport-icon { width: 42px; height: 42px; border-radius: 8px; background: var(--rose-bg); color: var(--red-dark); display: grid; place-items: center; flex: none; }
.rapport-icon .i { width: 22px; height: 22px; }
.rapport-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.rapport-info strong { color: var(--ink); font-weight: 600; }
.rapport-acties { display: flex; gap: 8px; }

/* ---------- Modals: camera en PDF-viewer ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(24,24,27,.55); display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--card); border-radius: var(--radius); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.25); }
.modal-box.wide { width: min(980px, 100%); height: calc(100vh - 32px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.icon-btn { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--subtle); color: var(--ink); }
.viewer-acties { display: flex; align-items: center; gap: 8px; }
.viewer-acties a { text-decoration: none; }
.viewer-mobiel { flex: 1; display: grid; place-items: center; padding: 32px 24px; text-align: center; color: var(--muted); }
#viewer-frame { flex: 1; width: 100%; border: 0; background: #525659; }
.cam-view { background: #000; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.cam-view video, .cam-view img { width: 100%; height: 100%; object-fit: contain; }
.cam-acties { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px; }
.cam-acties .linkbtn { font-size: .88rem; }
.cam-acties .linkbtn:first-child { justify-self: start; }
.cam-acties .linkbtn:last-child { justify-self: end; }
#cam-check { display: flex; justify-content: flex-end; }
#cam-check[hidden] { display: none; }
.shutter { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--border-strong); background: var(--card); cursor: pointer; padding: 0; position: relative; }
.shutter::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--ink); }
.shutter:active::after { inset: 8px; }
@media (max-width: 600px) { .modal { padding: 0; } .modal-box, .modal-box.wide { width: 100%; height: 100%; max-height: none; border-radius: 0; } .cam-view { aspect-ratio: auto; flex: 1; } }

/* ---------- Opname-opties en opnamebalk ---------- */
.rec-opties { display: grid; gap: 6px; max-width: 520px; margin: -8px auto 18px; text-align: left; }
.optie { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--muted); cursor: pointer; }
.optie input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.optie strong { color: var(--ink); font-weight: 500; }
.recbar { display: flex; align-items: center; gap: 12px; max-width: 1080px; margin: 0 auto; padding: 8px 20px; font-size: .88rem; color: var(--ink); border-top: 1px solid var(--border); }
.recbar-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; }
.recbar-tijd { font-variant-numeric: tabular-nums; color: var(--muted); }
.recbar-link { margin-left: auto; color: var(--muted); text-decoration: none; }
.recbar-link:hover { color: var(--ink); text-decoration: underline; }
.recbar-stop { font: inherit; font-weight: 500; border: 0; border-radius: var(--radius-sm); padding: 5px 12px; background: var(--red); color: #fff; cursor: pointer; }
.recbar-stop:hover { background: var(--red-dark); }
.recbar > * { white-space: nowrap; }
@media (max-width: 480px) { .recbar { gap: 10px; padding: 8px 16px; } .recbar-link { display: none; } .recbar-stop { margin-left: auto; } }

/* ---------- Inlogpagina ---------- */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: min(380px, 100%); padding: 28px; }
.login-box .brand { margin-bottom: 22px; }
.login-box h1 { font-size: 1.35rem; margin-bottom: 16px; }
.login-box form { display: grid; gap: 8px; margin-bottom: 14px; }
.login-box .btn { margin-top: 6px; padding: 11px 14px; }
.login-fout { color: var(--rose); font-size: .88rem; margin: 2px 0 0; }

/* ---------- Gebruikersbeheer ---------- */
.beheer-blok { padding: 20px; margin-bottom: 16px; }
.beheer-blok > p { margin: 0 0 12px; }
.beheer-rij { display: flex; gap: 8px; flex-wrap: wrap; }
.beheer-rij select, .beheer-rij input { flex: 1 1 220px; width: auto; min-width: 0; max-width: 100%; }
a.btn { text-decoration: none; }
.login-box > p.muted { margin: 0 0 14px; }
.link-vak { margin-top: 14px; padding: 12px; border-radius: var(--radius-sm); background: var(--green-bg); }
.link-vak p { margin: 0 0 8px; }
.tabel-wrap { overflow-x: auto; }
.tabel { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabel th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tabel td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* Keuzelijsten met een eigen, rustig pijltje (gelijk in elke browser) en dezelfde hoogte als de knoppen ernaast */
.beheer select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  padding-right: 38px; line-height: 1.4;
}
.beheer select:hover { border-color: var(--ink); }
.beheer select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24,24,27,.08); }
.beheer select:disabled { cursor: default; color: var(--muted); background-color: var(--subtle); border-color: var(--border); }
.beheer-rij { align-items: stretch; }
.beheer-rij .btn { white-space: nowrap; }
.tabel td select { width: auto; min-width: 130px; padding: 6px 32px 6px 10px; font-size: .85rem; background-position: right 9px center; background-size: 14px; }
.tabel .badge { margin-top: 4px; }
.tabel th, .tabel td.datum { white-space: nowrap; }
.btn.gevaar { color: var(--rose); }
.btn.gevaar:hover { background: var(--rose-bg); border-color: var(--rose); }
.tabel tr.inactief .naam { color: var(--muted); text-decoration: line-through; }
.tabel .acties { white-space: nowrap; text-align: right; }
.tabel .acties .btn + .btn { margin-left: 6px; }
.link-rij { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.link-rij:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .topbar-user #topbar-naam { display: none; }
  .tabel thead { display: none; }
  .tabel tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .tabel td { border: 0; padding: 0; }
  .tabel .acties { grid-column: 1 / -1; text-align: left; white-space: normal; }
  .tabel .acties .btn { margin: 0 6px 6px 0 !important; }
  .beheer-rij .btn { flex: 1 1 100%; }
}
