/* Spooker CRM — rustige basis: één accentkleur, weinig kaders, witruimte voor hiërarchie */
:root {
    --bg: #f6f7f9;
    --surface: #fff;
    --line: #e7e9ee;
    --text: #1d2330;
    --muted: #6b7280;
    --faint: #9aa1ad;
    --accent: #4b3fd1;
    --accent-soft: #efeefe;
    --danger: #b42318;
    --danger-soft: #fdeceb;
    --ok: #18794e;
    --ok-soft: #e6f4ec;
    --warn: #9a6400;
    --warn-soft: #fdf4e3;
    --sidebar: #171a33;
    --radius: 10px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --t-fast: 150ms;
    --t-med: 250ms;
    --t-slow: 320ms;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; }
small, .muted { color: var(--muted); }
.late { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- Knoppen en invoer ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 1px solid var(--line); background: var(--surface);
       color: var(--text); padding: 7px 16px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
       transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease); }
.btn:hover { border-color: #cfd4dc; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(0, 0, 0, .04); color: var(--text); }
.btn.danger, .danger { color: var(--danger) !important; }
.btn.success { color: var(--ok); }
.btn.small.ghost { color: var(--accent); }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 14px; }
.btn.icon { padding: 4px 10px; font-size: 18px; line-height: 1; }
.btn.busy { opacity: .7; cursor: progress; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.link:hover { text-decoration: underline; }
input, select, textarea { font: inherit; width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
       transition: border-color var(--t-fast), box-shadow var(--t-fast); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 18px; min-height: 0; height: 18px; accent-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-weight: 500; font-size: 14px; }
label > input, label > select, label > textarea { margin-top: 5px; font-weight: 400; font-size: 15px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 400; }
label.inline input { margin: 0; width: auto; }
.help { display: block; margin-top: 4px; font-weight: 400; font-size: 13px; }
kbd { font: 12px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); background: var(--surface); }

/* ---- Formulieren: eerst de essentie, details op verzoek ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 15px; }
.form-grid h3 { grid-column: 1 / -1; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary, details.later summary, details.recent summary, details.inline-filter summary {
    cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
details summary::-webkit-details-marker { display: none; }
details.more summary::before, details.later summary::before, details.recent summary::before, details.inline-filter summary::before {
    content: "›"; display: inline-block; transition: transform var(--t-fast) var(--ease); font-size: 18px; line-height: 1; }
details[open] > summary::before { transform: rotate(90deg); }
details.more[open] > .form-grid { margin-top: 10px; animation: enter var(--t-med) var(--ease) backwards; }
.field-error { display: block; color: var(--danger); font-size: 13px; font-weight: 400; margin-top: 4px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: 8px; margin: 14px 0 0; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.req::after { content: " *"; color: var(--danger); }
.draft-note { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; font-size: 14px; }
.dupes { background: var(--warn-soft); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.dupes ul { margin: 6px 0; padding-left: 18px; }
.step-context { margin: -6px 0 14px; color: var(--muted); }

/* ---- Login ---- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--sidebar); padding: 16px; }
.login-card { background: var(--surface); padding: 32px; border-radius: 14px; width: min(380px, 100%); display: grid; gap: 16px; animation: pop var(--t-slow) var(--ease) both; }
.login-card h1, .brand { font-size: 22px; font-weight: 700; }
.login-card h1 span, .brand span { color: var(--accent); font-weight: 400; }

/* ---- Indeling ---- */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--t-slow) var(--ease); }
.sidebar { background: var(--sidebar); color: #c9cce4; display: flex; flex-direction: column; padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.sidebar .brand { color: #fff; padding: 0 10px 24px; white-space: nowrap; }
.sidebar .brand span { color: #a59cff; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { color: #c9cce4; padding: 9px 12px; border-radius: 8px; white-space: nowrap; transition: background var(--t-fast); }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.sidebar nav a.active { background: rgba(165, 156, 255, .16); color: #fff; }
.sidebar .me { margin-top: auto; padding: 10px 12px; display: grid; gap: 2px; white-space: nowrap; }
.sidebar .me strong { color: #fff; }
.sidebar .me a, .sidebar .me .link { color: #a59cff; text-align: left; font-size: 14px; }
body.focus-mode .layout { grid-template-columns: 0 minmax(0, 1fr); }
body.focus-mode .sidebar { padding-left: 0; padding-right: 0; }
main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 8px; background: rgba(246, 247, 249, .9); backdrop-filter: blur(8px); padding: 12px 32px; position: sticky; top: 0; z-index: 5; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { background: var(--surface); padding-right: 36px; }
.search .shortcut { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input:focus ~ .shortcut { opacity: 0; }
.search.pulse input { animation: pulse 700ms var(--ease); }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--radius); box-shadow: 0 12px 32px rgba(20, 24, 40, .12); max-height: 70vh; overflow: auto; z-index: 20; padding: 6px;
            animation: drop var(--t-fast) var(--ease) both; }
.dropdown a { display: block; padding: 8px 10px; color: var(--text); border-radius: 6px; }
.dropdown a:hover, .dropdown a.focus { background: var(--accent-soft); text-decoration: none; }
.dropdown .group { padding: 8px 10px 4px; font-size: 12px; color: var(--faint); font-weight: 600; }
#page { padding: 12px 32px 64px; max-width: 1280px; outline: none; }
#page > * { animation: enter var(--t-med) var(--ease) backwards; }
/* Ruimtelijke navigatie: dieper komt van rechts, terug komt van links */
#page[data-dir="forward"] > * { animation-name: enter-right; }
#page[data-dir="back"] > * { animation-name: enter-left; }
/* Gedeeld element: de naam in de lijst groeit uit tot de paginatitel */
::view-transition-group(org-title) { animation-duration: var(--t-slow); animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--t-med); }

/* ---- Bouwstenen ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
.label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 28px 0 10px; }
.hint { color: var(--muted); font-size: 14px; margin: -6px 0 12px; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters > input[type=search] { flex: 1 1 280px; max-width: 420px; }
.more-filters { display: flex; gap: 8px; flex-wrap: wrap; flex-basis: 100%; animation: enter var(--t-med) var(--ease) backwards; }
.more-filters select, .more-filters input { width: auto; min-width: 180px; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.segmented { display: inline-flex; background: #eceef2; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer;
                    transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20, 24, 40, .1); font-weight: 500; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.calm { color: var(--muted); padding: 8px 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 18ms); }
tr.clickable { cursor: pointer; transition: background var(--t-fast); }
tr.clickable:hover td { background: #fafaff; }
.row-title { color: var(--text); font-weight: 600; }
.table-wrap { background: var(--surface); border-radius: var(--radius); overflow: auto; box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #eef0f3; color: var(--muted); white-space: nowrap; }
/* Semantische kleur: grijs = status, groen = klaar/gewonnen, accent = klaar voor de volgende stap, amber/rood alleen voor tijd */
.badge.klant, .badge.lead-geconverteerd, .badge.stage-gewonnen { background: var(--ok-soft); color: var(--ok); }
.badge.lead-gekwalificeerd { background: var(--accent-soft); color: var(--accent); }
.badge.lead-gediskwalificeerd, .badge.stage-verloren, .badge.ex-klant, .badge.inactief { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.badge.archived { background: #2b2f3a; color: #fff; }
.tag { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; margin: 0 4px 4px 0; }

/* Acties die pas bij aanwijzen of focus verschijnen (op aanraakschermen altijd zichtbaar) */
.row-actions { display: inline-flex; gap: 14px; font-size: 14px; opacity: .35; transition: opacity var(--t-fast); }
li:hover .row-actions, li:focus-within .row-actions, .contact:hover .row-actions, .contact:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }

/* Menu achter "⋯" */
.menu { position: relative; display: inline-block; z-index: 10; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
             box-shadow: 0 12px 32px rgba(20, 24, 40, .14); padding: 6px; z-index: 30; animation: drop var(--t-fast) var(--ease) both; transform-origin: top right; }
.menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--accent-soft); outline: none; }
.menu-list button small { display: block; font-size: 12px; color: var(--faint); }

/* ---- Vandaag ---- */
.hello { margin: 12px 0 0; }
.hello h1 { font-size: 30px; letter-spacing: -.01em; }
.hello p { margin: 4px 0 0; font-size: 16px; }
.intent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.intent { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 16px 18px; cursor: pointer; font: inherit; color: var(--text);
          display: grid; gap: 4px; transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-med), filter var(--t-med); }
.intent b { font-size: 16px; }
.intent:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(75, 63, 209, .1); transform: translateY(-1px); }
.intent:active { transform: scale(.98); }
.intent.chosen { border-color: var(--accent); background: var(--accent-soft); }
.intent.dim { opacity: .45; transform: scale(.97); filter: saturate(.4); }
/* Feedforward: bij aanwijzen zie je wat er gebeurt; de ruimte is gereserveerd, dus niets verspringt */
.intent .preview { font-size: 13px; color: var(--accent); opacity: 0; transform: translateY(-2px); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease); }
.intent:hover .preview, .intent:focus-visible .preview { opacity: 1; transform: none; }
.intent.chosen .preview, .intent.dim .preview { opacity: 0; }
@media (hover: none) { .intent .preview { display: none; } }
.intent-step { margin-top: 14px; background: var(--surface); border-radius: 12px; padding: 18px; box-shadow: 0 1px 2px rgba(20, 24, 40, .05); animation: unfold var(--t-slow) var(--ease) both; transform-origin: top; }
.step-question { font-size: 16px; font-weight: 600; }
.pick-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.pick-list li { animation: enter var(--t-med) var(--ease) backwards; }
.pick-list button { width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px 12px; font: inherit; color: var(--text); cursor: pointer; transition: background var(--t-fast); }
.pick-list button:hover, .pick-list button:focus-visible { background: var(--accent-soft); outline: none; }
.pick-list li.muted { padding: 10px 12px; }

ul.attention, ul.task-list, ul.lead-list, ul.opp-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
ul.attention li, ul.task-list li, ul.lead-list li, ul.opp-list li { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line);
    animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 25ms); transition: background var(--t-fast), opacity var(--t-med); }
ul.attention li:last-child, ul.task-list li:last-child, ul.lead-list li:last-child, ul.opp-list li:last-child { border-bottom: 0; }
.what { flex: 1; min-width: 0; display: grid; color: var(--text); }
a.what:hover { text-decoration: none; }
a.what:hover b { color: var(--accent); }
.what small { overflow: hidden; text-overflow: ellipsis; }
ul.attention li.late .what small { color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; margin: 0 6px; }
.dot.lead { background: var(--accent); }
.dot.quiet { background: var(--warn); }
details.later, details.recent { margin-top: 14px; }
details.later[open] > ul, details.recent[open] > ul { margin-top: 8px; animation: enter var(--t-med) var(--ease) backwards; }
ul.plain { list-style: none; padding: 0; display: grid; gap: 6px; }
.quiet-line { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-top: 28px; padding: 14px 16px; border-radius: var(--radius); color: var(--muted); border: 1px dashed var(--line); }
.quiet-line b { color: var(--text); font-size: 18px; }
.quiet-line:hover { text-decoration: none; border-color: var(--accent); }

/* Afvinken */
.check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c4c9d2; background: var(--surface); cursor: pointer; position: relative; padding: 0;
         transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease); }
.check:hover { border-color: var(--ok); }
.check::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0);
                transition: transform var(--t-fast) var(--ease); }
li.done .check { background: var(--ok); border-color: var(--ok); transform: scale(1.08); }
li.done .check::after { transform: rotate(45deg) scale(1); }
li.done .what b { color: var(--muted); text-decoration: line-through; }
.task-list .due, .lead-list .state, .opp-list .state { text-align: right; font-size: 14px; white-space: nowrap; }
.lead-list .state, .opp-list .state { display: grid; justify-items: end; gap: 2px; }
.lead-list .actions { display: flex; gap: 6px; align-items: center; }
.opp-list li { cursor: pointer; }
.opp-list li:hover { background: #fafaff; }
.leaving { opacity: 0 !important; transform: translateX(12px); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease); }

/* ---- Klantbeeld ---- */
.org-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 8px -12px 20px; padding: 6px 12px 10px; flex-wrap: wrap;
            position: sticky; top: 64px; z-index: 4; background: var(--bg); }
.org-head h1 { font-size: 28px; letter-spacing: -.01em; margin-top: 4px; }
.back { font-size: 14px; color: var(--muted); }
.back::before { content: "‹ "; }
.sub { margin: 6px 0 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.sub .late { font-weight: 500; }
.head-actions { display: flex; gap: 6px; align-items: center; }
.org-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.details-card { position: sticky; top: 76px; }
dl.details { display: grid; grid-template-columns: 112px 1fr; gap: 8px 12px; margin: 0 0 12px; font-size: 14px; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; word-break: break-word; }
.ids { font-size: 12px; color: var(--faint); margin: 14px 0 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -6px -4px 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
               white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; transition: color var(--t-fast), border-color var(--t-med) var(--ease); }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-color: var(--accent); font-weight: 600; }
.tabs .count { background: #eef0f3; color: var(--muted); }
#tab-content > * { animation: enter var(--t-med) var(--ease) backwards; }
.tab-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.inline-filter { margin-bottom: 12px; }
.inline-filter .filters { margin: 10px 0 0; }
.inline-filter select { width: auto; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 16px; animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.timeline li::before { content: ""; position: absolute; left: -27px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li.telefoon::before { border-color: #0e8fa8; }
.timeline li.email::before { border-color: #c97a0a; }
.timeline li.vergadering::before { border-color: var(--ok); }
.timeline li.demo::before { border-color: #c2399f; }
.t-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.timeline .meta { color: var(--muted); font-size: 13px; }
.timeline .body { white-space: pre-wrap; margin: 6px 0 0; }
.timeline .outcome { margin-top: 6px; font-size: 14px; color: var(--muted); }
.timeline .outcome::before { content: "→ "; }

.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.contact { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; align-content: start;
           animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.contact .tags { margin-top: 4px; }
.contact .reach { display: grid; font-size: 14px; }
.contact .row-actions { margin-top: 6px; }

ol.history { list-style: none; padding: 0; margin: 0; }
ol.history li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; }
ol.history .changes { font-size: 14px; color: var(--muted); margin-top: 2px; }
ol.history del { color: var(--danger); }
ol.history ins { color: var(--ok); text-decoration: none; }

/* ---- Pipeline ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: #eef0f4; border-radius: 12px; padding: 10px; min-height: 220px; transition: background var(--t-fast), box-shadow var(--t-fast); }
.column.closed { background: transparent; border: 1px dashed var(--line); }
.column.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.column header { padding: 4px 6px 10px; font-weight: 600; font-size: 14px; }
.column header .count { background: transparent; color: var(--muted); }
.column header .sum { font-weight: 400; color: var(--muted); font-size: 13px; }
.cards { display: grid; gap: 8px; }
.deal { background: var(--surface); border-radius: 9px; padding: 11px 12px; cursor: pointer; display: grid; gap: 2px; box-shadow: 0 1px 2px rgba(20, 24, 40, .08);
        transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease), opacity var(--t-fast); animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.deal[draggable=true] { cursor: grab; }
.deal:hover { box-shadow: 0 6px 16px rgba(20, 24, 40, .12); transform: translateY(-1px); }
.deal.dragging { opacity: .35; transform: scale(.97); }
.deal.moved { animation: land var(--t-slow) var(--ease) both; }
.deal .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-top: 4px; }
.drop-hint { color: var(--faint); font-size: 13px; text-align: center; padding: 18px 0; border: 1px dashed #d3d8e0; border-radius: 8px; }

/* ---- Contactmoment: van keuze naar formulier ---- */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.chip { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px; font: inherit; font-weight: 500;
        color: var(--text); cursor: pointer; transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), background var(--t-fast), opacity var(--t-med); }
.chip:hover { border-color: var(--accent); }
.chip:active { transform: scale(.97); }
.chip-icon { font-size: 20px; width: 28px; text-align: center; color: var(--accent); }
.chip.chosen { grid-column: 1 / -1; background: var(--accent-soft); border-color: var(--accent); padding: 10px 14px; animation: morph var(--t-slow) var(--ease) both; }
.chip.chosen::after { content: "wijzigen"; margin-left: auto; font-size: 13px; font-weight: 400; color: var(--accent); }
.step-form:not(:empty) { margin-top: 16px; animation: unfold var(--t-slow) var(--ease) both; }
.step-form .modal-form .form-actions { margin-top: 18px; }
.consequences { padding-left: 20px; }

/* ---- Modal en melding ---- */
.modal { position: fixed; inset: 0; background: rgba(15, 18, 40, .4); display: grid; place-items: start center; padding: 8vh 16px; overflow: auto; z-index: 50;
         animation: fade var(--t-fast) ease both; }
.modal-card { background: var(--surface); border-radius: 16px; width: min(640px, 100%); padding: 22px 26px 24px; box-shadow: 0 24px 60px rgba(15, 18, 40, .22);
              animation: pop var(--t-med) var(--ease) both; }
.modal.closing { animation: fade var(--t-fast) ease reverse both; }
.modal.closing .modal-card { animation: pop var(--t-fast) ease reverse both; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.modal-card h2 { font-size: 20px; }
.toast { position: fixed; bottom: 24px; left: 50%; display: flex; align-items: center; gap: 16px; background: var(--sidebar); color: #fff; padding: 11px 14px 11px 18px;
         border-radius: 10px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); opacity: 0; transform: translate(-50%, 12px);
         transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.toast .undo { white-space: nowrap; background: rgba(255, 255, 255, .14); border: 0; color: #fff; font: inherit; font-weight: 600; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.toast .undo:hover { background: rgba(255, 255, 255, .24); }

/* ---- Beweging: iedere animatie verklaart een verandering ---- */
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes enter-right { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes enter-left { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } to { opacity: 1; transform: none; } }
@keyframes morph { from { transform: scale(.96); } 60% { transform: scale(1.01); } to { transform: none; } }
@keyframes land { from { transform: scale(1.04); box-shadow: 0 10px 24px rgba(75, 63, 209, .25); } to { transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(75, 63, 209, .35); } 100% { box-shadow: 0 0 0 10px rgba(75, 63, 209, 0); } }

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
    *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ---- Smalle schermen ---- */
@media (max-width: 900px) {
    .layout, body.focus-mode .layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 10px 16px; }
    body.focus-mode .sidebar { display: none; }
    .sidebar .brand { padding: 0 8px 0 0; font-size: 18px; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .sidebar nav a { padding: 6px 10px; }
    .sidebar .me { margin: 0 0 0 auto; padding: 0; grid-auto-flow: column; gap: 10px; align-items: center; }
    .sidebar .me strong, .sidebar .me small { display: none; }
    .topbar, #page { padding-left: 16px; padding-right: 16px; }
    .org-layout, .form-grid { grid-template-columns: minmax(0, 1fr); }
    .details-card, .org-head { position: static; }
    .hide-sm { display: none; }
    .filters > input[type=search] { max-width: none; }
    .more-filters select, .more-filters input, .more-filters label.inline { min-width: 0; flex: 1 1 140px; }
    .lead-list li { flex-wrap: wrap; }
    .lead-list .state { justify-items: start; text-align: left; }
    .modal { padding: 16px 8px; }
    .modal-card { padding: 18px 16px; }
    .search .shortcut { display: none; }
    .intent-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .intent { padding: 12px 14px; }
    .intent b { font-size: 15px; }
    .hello h1 { font-size: 26px; }
}

/* ---- Live preview en feedforward ---- */
.form-grid small.live { display: block; font-size: 12px; color: var(--muted); min-height: 18px; font-weight: 400; }
.preview-box { grid-column: 1 / -1; background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; font-size: 14px; animation: fade var(--t-fast) both; }
.preview-box p { margin: 0 0 4px; font-weight: 600; }
.preview-box ul { margin: 0; padding-left: 18px; }
.preview-box small { color: var(--muted); }
.drop-preview { font-weight: 400; font-size: 12px; color: var(--accent); margin-top: 2px; animation: fade var(--t-fast) both; }

/* ---- Verder waar je was ---- */
.dot.draft { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
ul.drafts .btn.quiet { color: var(--muted); }

/* ---- Batch-acties: selecteren maakt van het afvinkrondje een selectievak ---- */
.selecting li { cursor: pointer; }
.selecting .check { pointer-events: none; border-radius: 6px; }
.selecting li.done .check { background: var(--surface); border-color: #c4c9d2; transform: none; }
.selecting li.done .check::after { transform: rotate(45deg) scale(0); }
.selecting li.selected { background: var(--accent-soft); }
.selecting li.selected .check { background: var(--accent); border-color: var(--accent); }
.selecting li.selected .check::after { transform: rotate(45deg) scale(1); }
.selecting .row-actions { visibility: hidden; }
.batch-bar { position: sticky; bottom: 16px; margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--sidebar); color: #fff;
             padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 24, 40, .25); animation: pop var(--t-med) var(--ease) both; }
.batch-bar > span { margin-right: auto; }
.batch-bar select { width: auto; }
.batch-bar .btn.quiet { color: #c9cce4; }

/* ---- Abonnementen ---- */
.sub-card { padding: 4px 0 18px; display: grid; gap: 14px; animation: enter var(--t-med) var(--ease) backwards; }
.sub-card + .sub-card { border-top: 1px solid var(--line); padding-top: 20px; }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sub-head h3 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.signals { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sig { font-size: 14px; padding: 8px 12px; border-radius: 8px; background: #f2f3f6; color: var(--muted); }
.sig.soon { background: var(--warn-soft); color: var(--warn); }
.sig.late { background: var(--danger-soft); color: var(--danger); }
.sub-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 0; }
.sub-facts dt { font-size: 12px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sub-facts dd { margin: 4px 0 0; display: grid; }
.sub-facts dd small { color: var(--muted); font-size: 13px; }
.usage { display: grid; gap: 4px; font-size: 14px; }
.usage-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width var(--t-slow) var(--ease); }
.usage.near .usage-bar span { background: var(--warn); }
.usage.over .usage-bar span { background: var(--danger); }
.usage.over b { color: var(--danger); }
.usage.stale { opacity: .6; }
.sub-modules { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sub-modules .label { margin: 0 6px 0 0; }
.module { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: #f2f3f6; }
.module.pending { background: var(--warn-soft); color: var(--warn); }
.module.unlicensed { background: var(--danger-soft); color: var(--danger); }
.module small { font-size: 11px; }
.change-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.change-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--bg); border-radius: 8px; padding: 10px 14px; }
.change-list li.mislukt { background: var(--danger-soft); }
.change-list .what { display: grid; gap: 2px; }
.change-list .what small { color: var(--muted); font-size: 13px; }
.change-list .next { display: flex; gap: 12px; align-items: center; }
.badge.change-concept, .badge.change-in_behandeling, .badge.sub-actief, .badge.sub-proef { background: #eef0f3; color: var(--muted); }
.badge.change-mislukt, .badge.sub-geschorst { background: var(--danger-soft); color: var(--danger); }
.badge.change-uitgevoerd { background: var(--ok-soft); color: var(--ok); }
.badge.sub-opgezegd, .badge.sub-beeindigd, .badge.stale { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.more-info summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.more-info[open] summary { margin-bottom: 8px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.preview-box .warn { margin: 6px 0 0; color: var(--warn); font-weight: 600; }
.preview-box del { color: var(--faint); }
.dot.renewal { background: var(--warn); }
.dot.payment, .dot.change { background: var(--danger); }
ul.renewal-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
ul.renewal-list li { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 25ms); }
ul.renewal-list li:last-child { border-bottom: 0; }
ul.renewal-list li.past { opacity: .6; }
ul.renewal-list .what { flex: 1; display: grid; color: var(--text); min-width: 0; }
ul.renewal-list .what small { color: var(--muted); }
ul.renewal-list .state { text-align: right; display: grid; font-size: 14px; white-space: nowrap; }
ul.renewal-list .state small { color: var(--muted); }
.soon { color: var(--warn); }
ul.renewal-list li > :last-child { flex: none; width: 130px; text-align: right; }
@media (max-width: 900px) {
    ul.renewal-list li { flex-wrap: wrap; }
    ul.renewal-list .state { text-align: left; }
    ul.renewal-list li > :last-child { width: auto; }
}
.sub-card .label { margin: 0 0 8px; }
#renewal-list .quiet-line { margin: 0 0 12px; }
.change-list .what .badge { justify-self: start; }

/* ---- Klantreis ---- */
.journey-steps { display: flex; gap: 4px; margin: 0 0 16px; overflow-x: auto; counter-reset: step; }
.journey-steps a { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; color: var(--muted); white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); }
.journey-steps a:hover { background: rgba(0, 0, 0, .04); text-decoration: none; color: var(--text); }
.journey-steps a .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--line); color: var(--muted); }
.journey-steps a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.journey-steps a.active .n { background: var(--accent); color: #fff; }
.journey-steps a + a::before { content: ""; width: 14px; height: 1px; background: var(--line); margin-right: 6px; margin-left: -10px; }
ul.journey-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
#tab-content ul.journey-list { box-shadow: none; background: var(--bg); }
ul.journey-list li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); animation: enter var(--t-med) var(--ease) backwards; }
ul.journey-list li:last-child { border-bottom: 0; }
ul.journey-list .what { flex: 1; display: grid; min-width: 0; }
ul.journey-list .what a { color: var(--text); }
ul.journey-list .what small { color: var(--muted); }
ul.journey-list .state { display: grid; text-align: right; font-size: 14px; white-space: nowrap; }
ul.journey-list .state small { color: var(--muted); }
ul.journey-list .next, .journey-card .head-actions { display: flex; align-items: center; gap: 6px; }
.journey-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.journey-card { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; align-content: start;
                box-shadow: 0 1px 2px rgba(20, 24, 40, .05); animation: enter var(--t-med) var(--ease) backwards; }
#tab-content .journey-card { box-shadow: none; padding: 0; }
.journey-card > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.journey-card > header > div:first-child { display: grid; }
.journey-card > header a { color: var(--text); }
.journey-card > header small { color: var(--muted); }
.journey-card.niet_geconverteerd, .journey-card.geconverteerd { opacity: .75; }
.trial-time { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.trial-time b { color: var(--text); }
.trial-time.soon .usage-bar span { background: var(--warn); }
.trial-time.late .usage-bar span { background: var(--danger); }
.trial-time.late b { color: var(--danger); }
.sig-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sig-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f2f3f6; color: var(--muted); }
.sig-chip.late { background: var(--danger-soft); color: var(--danger); }
.sig-chip.soon { background: var(--warn-soft); color: var(--warn); }
.sig-chip.ok { background: var(--ok-soft); color: var(--ok); }
.sig-chip.accent { background: var(--accent-soft); color: var(--accent); }
.sig-chip.muted { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); }
.mini-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0; }
.mini-facts dt { font-size: 12px; color: var(--faint); }
.mini-facts dd { margin: 2px 0 0; font-size: 14px; }
.journey-section + .journey-section { margin-top: 22px; }
.journey-section > .label { margin: 0 0 10px; }
.journey-actions { justify-content: flex-start; gap: 8px; margin: 16px 0; }
.journey-past { margin: 8px 0 18px; }
.journey-past > * + * { margin-top: 10px; }
ul.steps { box-shadow: none; background: transparent; }
ul.steps li { padding: 10px 4px; }
ul.steps li.wacht_op_platform .check { border-style: dashed; border-color: var(--accent); }
ul.steps li.geblokkeerd .check { border-color: var(--danger); }
ul.steps li.klaar .check { background: var(--ok); border-color: var(--ok); }
ul.steps li.klaar .check::after { transform: rotate(45deg) scale(1); }
ul.steps li.klaar .what b { color: var(--muted); font-weight: 500; }
ol.plan { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 2px; }
ol.plan li span { margin-right: 6px; }
ol.plan li > small { color: var(--muted); }
.badge.demo-gehouden, .badge.onb-voltooid { background: var(--ok-soft); color: var(--ok); }
.badge.demo-geannuleerd, .badge.demo-niet_verschenen { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.badge.onb-geblokkeerd { background: var(--danger-soft); color: var(--danger); }
.badge.onb-achter { background: var(--warn-soft); color: var(--warn); }
.badge.onb-afronden { background: var(--accent-soft); color: var(--accent); }
.dot.demo { background: var(--accent); }
.dot.trial { background: var(--warn); }
.dot.quote { background: var(--warn); }
.dot.onboarding { background: var(--danger); }
@media (max-width: 900px) {
    .journey-cards { grid-template-columns: minmax(0, 1fr); }
    ul.journey-list li { flex-wrap: wrap; }
    ul.journey-list .state { text-align: left; }
    .journey-steps a + a::before { display: none; }
}
.journey-card { grid-template-columns: minmax(0, 1fr); min-width: 0; }
ul.steps li { flex-wrap: wrap; }
ul.steps .what { flex: 1 1 200px; min-width: 0; }
.mini-facts dd { overflow-wrap: anywhere; }

/* ---- Offertes ---- */
ul.quote-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
#tab-content ul.quote-list { background: var(--bg); box-shadow: none; }
ul.quote-list li { display: flex; align-items: center; gap: 18px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
    animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 25ms); transition: background var(--t-fast); }
ul.quote-list li:last-child { border-bottom: 0; }
ul.quote-list li:hover { background: #fafaff; }
.quote-list .amount, .quote-list .state { display: grid; justify-items: end; gap: 2px; font-size: 14px; white-space: nowrap; }
.quote-list .amount small, .quote-list .state small { font-size: 13px; }
.org-quotes { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-head h2 { font-size: 17px; }
.badge.quote-verstuurd { background: var(--accent-soft); color: var(--accent); }
.badge.quote-geaccepteerd { background: var(--ok-soft); color: var(--ok); }
.badge.quote-verlopen { background: var(--danger-soft); color: var(--danger); }
.badge.quote-afgewezen, .badge.quote-vervangen { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }

.quote-head { align-items: flex-start; }
.quote-head h1 .muted { font-weight: 500; }
.quote-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.versions { display: inline-flex; gap: 2px; font-size: 13px; }
.versions a, .versions span { padding: 1px 8px; border-radius: 6px; }
.versions span { background: #eceef2; color: var(--text); font-weight: 600; }
.save-state { font-size: 13px; color: var(--faint); transition: color var(--t-fast); }
.save-state.error { color: var(--danger); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.head-actions .menu-list a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); }
.head-actions .menu-list a:hover { background: var(--accent-soft); text-decoration: none; }
.lock-note { margin: -6px 0 16px; padding: 10px 14px; border-radius: 8px; background: #eef0f3; color: var(--muted); font-size: 14px; }
.lock-note.geaccepteerd { background: var(--ok-soft); color: var(--ok); }

.quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.quote-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.lines-card { overflow-x: auto; }
.quote-form select:disabled { appearance: none; background-image: none; }
.quote-form .card { margin: 0; }
.quote-form .field > span:first-child { display: block; font-weight: 500; font-size: 14px; margin-bottom: 5px; }
.quote-form .live { display: block; color: var(--faint); font-size: 13px; min-height: 1em; }
.quote-form input:disabled, .quote-form select:disabled, .quote-form textarea:disabled { background: transparent; border-color: transparent; padding-left: 0; color: var(--text); opacity: 1; }
.quote-form .segmented button:disabled { cursor: default; }
.quote-form details.more { padding: 16px 20px; }
.lines-card h2 { font-size: 16px; margin-bottom: 10px; }
.lines-card h2 small { font-weight: 400; font-size: 13px; color: var(--faint); margin-left: 6px; }
table.quote-lines { width: 100%; border-collapse: collapse; }
.quote-lines th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.quote-lines td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.quote-lines td:first-child { width: 100%; }
.quote-lines td b { display: block; font-weight: 500; }
.quote-lines td small { color: var(--faint); font-size: 12px; }
.quote-lines .num { text-align: right; white-space: nowrap; }
.quote-lines input { width: 92px; min-height: 34px; padding: 4px 8px; text-align: right; }
.quote-lines td.num:nth-child(2) input { width: 64px; }
.quote-lines tr.override input[data-k=unit_price] { border-color: var(--warn); }
.quote-lines tr.flash { animation: land var(--t-slow) var(--ease); background: var(--accent-soft); transition: background 1.2s; }
.quote-lines .empty { padding: 18px; }
.add-line { margin-top: 10px; display: inline-block; }
.add-line .menu-list { left: 0; right: auto; min-width: 280px; max-height: 340px; overflow: auto; }
.menu-head { margin: 8px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }

.quote-summary { position: sticky; top: 84px; display: grid; gap: 8px; }
.quote-summary h2 { font-size: 16px; margin-bottom: 4px; }
.quote-summary > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.quote-summary > div span { color: var(--muted); }
.quote-summary > div b { white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
.quote-summary .minus b { color: var(--ok); }
.quote-summary .total { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; }
.quote-summary .total span { color: var(--text); font-weight: 600; }
.quote-summary .total b { font-weight: 700; }
.quote-summary .quiet b { color: var(--muted); }
.quote-summary .per-period { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.quote-summary .feeds { margin: 4px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
    .quote-layout { grid-template-columns: minmax(0, 1fr); }
    .quote-summary { position: static; }
    ul.quote-list li { flex-wrap: wrap; gap: 6px 14px; }
    ul.quote-list li .what { flex-basis: 100%; }
    .quote-lines th:nth-child(3), .quote-lines td:nth-child(3) { display: none; }
    .quote-lines td { padding: 10px 4px; }
    .quote-lines input { width: 72px; }
    .head-actions { flex-wrap: wrap; }
}

/* ---- Tickets ---- */
ul.ticket-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
#tab-content ul.ticket-list { background: var(--bg); box-shadow: none; }
ul.ticket-list li { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
    animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 25ms); transition: background var(--t-fast); }
ul.ticket-list li:last-child { border-bottom: 0; }
ul.ticket-list li:hover { background: #fafaff; }
.ticket-list .who { width: 150px; text-align: right; }
.ticket-list .state { display: grid; justify-items: end; gap: 2px; font-size: 14px; white-space: nowrap; min-width: 130px; }
.prio { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #d3d7de; }
.prio.hoog { background: var(--warn); }
.prio.kritiek { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.as-of { margin: 8px 2px 0; font-size: 12px; color: var(--faint); text-align: right; }
.ticket-kpis { margin: -4px 0 16px; }
.ticket-kpis a { text-decoration: none; }
.filters input[type=search] { max-width: 300px; min-height: 36px; }
.badge.ticket-nieuw { background: var(--accent-soft); color: var(--accent); }
.badge.ticket-opgelost { background: var(--ok-soft); color: var(--ok); }
.badge.ticket-gesloten { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.badge.prio-hoog { background: var(--warn-soft); color: var(--warn); }
.badge.prio-kritiek { background: var(--danger-soft); color: var(--danger); }
.dot.ticket { background: var(--danger); }

.ticket-head h1 { font-size: 24px; margin: 2px 0 0; }
.sla-strip { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: -6px 0 16px; }
.sla { display: inline-flex; align-items: baseline; gap: 6px; font-size: 14px; color: var(--text); }
.sla-strip .sla { padding: 6px 12px; border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
.sla small { color: var(--muted); font-size: 12px; }
.sla.ok { color: var(--ok); }
.sla.soon { color: var(--warn); }
.sla.late { color: var(--danger); font-weight: 500; }
.sla-strip .sla.soon { background: var(--warn-soft); }
.sla-strip .sla.late { background: var(--danger-soft); }
.sla.muted { color: var(--muted); }
.lock-note.escalated { background: var(--danger-soft); color: var(--danger); }
.csat-show { display: block; margin-top: 4px; letter-spacing: .5px; }

.ticket-main { display: grid; gap: 14px; min-width: 0; }
.ticket-desc p { margin: 6px 0 0; }
ol.conversation { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.msg { animation: enter var(--t-med) var(--ease) backwards; }
.msg.system { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--faint); padding: 0 6px; }
.msg.in, .msg.out, .msg.note { padding: 12px 16px; border-radius: 12px; max-width: 86%; }
.msg.in { background: var(--surface); box-shadow: 0 1px 2px rgba(20, 24, 40, .06); justify-self: start; }
.msg.out { background: var(--accent-soft); justify-self: end; }
.msg.note { background: var(--warn-soft); border: 1px dashed #e8cf9a; justify-self: stretch; max-width: none; }
.msg .meta { display: flex; gap: 10px; align-items: baseline; font-size: 13px; margin-bottom: 4px; }
.msg .meta time { margin-left: auto; color: var(--faint); font-size: 12px; }
.msg .meta span { color: var(--muted); }
.msg .body { overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.files .file { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); }
.files .file small { color: var(--faint); }

.composer { display: grid; gap: 10px; transition: box-shadow var(--t-med), background var(--t-med); }
.composer textarea { min-height: 110px; }
.composer[data-mode=out] { box-shadow: 0 0 0 2px var(--accent-soft), 0 1px 2px rgba(20, 24, 40, .05); }
.composer[data-mode=note] { background: #fffaf0; }
.composer-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer-foot .spacer { flex: 1; }
.composer-ff { margin: 0; font-size: 13px; }
.file-pick { cursor: pointer; }

.ticket-side { display: grid; gap: 14px; position: sticky; top: 84px; }
.ticket-side .card { padding: 16px 18px; }
.ticket-side h2.label, .ticket-desc h2.label { margin: 0 0 8px; }
.ctx-org { margin: 0 0 10px; }
.ctx-lines { display: grid; gap: 6px; font-size: 14px; }
.ctx-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.ctx-lines > div > span { color: var(--muted); flex: none; }
.ctx-lines > div > b { font-weight: 500; text-align: right; }
.ctx-lines .mods b { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.mod { font-size: 12px; padding: 1px 8px; border-radius: 999px; font-weight: 500; }
.mod.on { background: var(--ok-soft); color: var(--ok); }
.mod.off { color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.ctx-flags { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--line); font-size: 13px; display: grid; gap: 3px; color: var(--muted); }
.preview-box .ctx-lines { margin: 6px 0 8px; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ticket-props select:disabled, .ticket-props input:disabled { background: transparent; border-color: transparent; padding-left: 0; appearance: none; color: var(--text); opacity: 1; }
@media (max-width: 900px) {
    .ticket-side { position: static; }
    ul.ticket-list li { flex-wrap: wrap; gap: 6px 12px; }
    ul.ticket-list li .what { flex-basis: calc(100% - 30px); }
    .ticket-list .who { width: auto; text-align: left; margin-left: 24px; }
    .ticket-list .state { min-width: 0; margin-left: auto; }
    .msg.in, .msg.out { max-width: 100%; }
    .filters input[type=search] { max-width: none; }
}

/* ---- Rapportages ---- */
.menu-list a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); }
.menu-list a:hover, .menu-list a:focus-visible { background: var(--accent-soft); text-decoration: none; outline: none; }
.menu-list a small { display: block; font-size: 12px; color: var(--faint); }
.report-filters { align-items: center; }
.custom-range { display: inline-flex; align-items: center; gap: 6px; animation: enter var(--t-med) var(--ease) both; }
.custom-range input { width: auto; min-height: 36px; }
.report-filters select { width: auto; min-height: 36px; }
.report-meta { margin: -6px 0 6px; font-size: 13px; }
.report-section { margin-bottom: 8px; }
.report-section > .label small { font-weight: 400; color: var(--faint); margin-left: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; align-content: start; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; color: var(--text);
        box-shadow: 0 1px 2px rgba(20, 24, 40, .05); animation: enter var(--t-med) var(--ease) backwards; transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease); }
a.tile:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(75, 63, 209, .1); transform: translateY(-1px); }
.t-label { font-size: 13px; color: var(--muted); }
.t-value { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.t-value small { font-size: 15px; font-weight: 500; color: var(--muted); }
.t-def { font-size: 12px; color: var(--faint); }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; margin-top: 10px; }
.report-section .card { padding: 16px 18px; }
.report-section > .card + .card { margin-top: 10px; }
.report-section h3 { font-size: 15px; margin-bottom: 10px; }
.report-section h3 small { font-weight: 400; color: var(--faint); margin-left: 4px; }
ul.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.b-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-track { height: 10px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.b-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; opacity: .85; transform-origin: left; animation: grow var(--t-slow) var(--ease) backwards; }
.b-fill.crit { background: var(--danger); }
.b-value { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.b-value small { color: var(--faint); }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.empty-line { margin: 0; font-size: 14px; }
table.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.report-table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); }
.report-table tr:last-child td { border-bottom: 0; }
.report-table tr[data-href] { cursor: pointer; }
.report-table tr[data-href]:hover { background: #fafaff; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ok-text { color: var(--ok); }
.note { font-size: 13px; margin: 8px 2px 0; }
details.definitions { margin: 24px 0 8px; }
details.definitions summary { cursor: pointer; color: var(--accent); }
details.definitions dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0; font-size: 14px; }
details.definitions dt { font-weight: 500; }
details.definitions dd { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-cols { grid-template-columns: minmax(0, 1fr); }
    .report-section .card { overflow-x: auto; }
    details.definitions dl { grid-template-columns: minmax(0, 1fr); }
    .custom-range input { flex: 1; }
    .report-filters .segmented { display: flex; flex-wrap: wrap; width: 100%; }
    .report-filters .segmented button { flex: 1 0 auto; }
    .report-filters select, .custom-range { width: 100%; }
    .report-table { min-width: 0; }
    .report-table th:nth-child(2), .report-table td:nth-child(2) { display: none; }
}

/* ---- Klantgezondheid ---------------------------------------------------- */
/* Semantische kleur: groen gezond, oranje aandacht, rood risico; grijs gestreept is onbekend */
.health-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef0f3; color: var(--muted); }
.health-chip b { font-variant-numeric: tabular-nums; }
.health-chip small { font-weight: 400; color: inherit; opacity: .8; }
.health-chip.h-gezond { background: var(--ok-soft); color: var(--ok); }
.health-chip.h-aandacht { background: var(--warn-soft); color: var(--warn); }
.health-chip.h-risico { background: var(--danger-soft); color: var(--danger); }
.chip-link:hover { text-decoration: none; filter: brightness(.97); }
.health-table tr[data-href] { cursor: pointer; transition: background var(--t-fast); }
.health-table tr[data-href]:hover td, .health-table tr[data-href]:focus-visible td { background: #fafaff; }
.health-table td small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.health-table td.alerts span { display: block; font-size: 13px; }
.health-table td.alerts .soon { color: var(--warn); }
.fdots { display: inline-flex; gap: 3px; }
.fdot { width: 14px; height: 14px; border-radius: 4px; background: #eef0f3; }
.fdot.h-gezond { background: var(--ok); opacity: .8; }
.fdot.h-aandacht { background: #e0a23a; }
.fdot.h-risico { background: var(--danger); }
.fdot.f-onbekend { background: repeating-linear-gradient(135deg, #e3e6eb 0 3px, #f6f7f9 3px 6px); }
.fdot.f-nvt { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

.health { display: grid; gap: 22px; }
.health h3 { font-size: 15px; }
.health .section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.health-score { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 18px; border-radius: var(--radius);
                background: #f6f7f9; border-left: 4px solid var(--faint); }
.health-score.h-gezond { border-left-color: var(--ok); }
.health-score.h-aandacht { border-left-color: #e0a23a; }
.health-score.h-risico { border-left-color: var(--danger); background: #fffafa; }
.gauge { --c: var(--faint); display: grid; place-items: center; align-content: center; width: 84px; height: 84px; border-radius: 50%;
         background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--v) * 1%), #e7e9ee 0); }
.h-gezond .gauge { --c: var(--ok); }
.h-aandacht .gauge { --c: #e0a23a; }
.h-risico .gauge { --c: var(--danger); }
.gauge b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge small { font-size: 11px; color: var(--faint); }
.verdict h2 { font-size: 16px; }
.verdict h2 .health-chip { font-size: 14px; padding: 4px 12px; }
.verdict p { margin: 6px 0 0; font-size: 14px; }
.verdict .override { background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; }
.health-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.health-alerts { list-style: none; margin: -8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.health-alerts li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.health-alerts li.late { background: var(--danger-soft); color: var(--danger); }
.health-alerts a { color: inherit; text-decoration: underline; }
.factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.factors li { display: grid; grid-template-columns: 190px minmax(0, 1fr) 72px; grid-template-areas: "label track score" ". text text"; gap: 2px 12px; align-items: center; }
.factors .f-label { grid-area: label; font-weight: 500; font-size: 14px; }
.factors .f-label small { color: var(--faint); font-weight: 400; }
.factors .b-track { grid-area: track; }
.factors .f-score { grid-area: score; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.factors .f-text { grid-area: text; font-size: 13px; }
.factors .b-fill.h-gezond { background: var(--ok); }
.factors .b-fill.h-aandacht { background: #e0a23a; }
.factors .b-fill.h-risico { background: var(--danger); }
.factors .f-onbekend .b-track { background: repeating-linear-gradient(135deg, #e3e6eb 0 4px, #f6f7f9 4px 8px); }
.factors .f-onbekend .f-score, .factors .f-nvt .f-score { color: var(--faint); font-weight: 400; font-size: 13px; }
.factors .f-nvt, .factors .f-off { opacity: .6; }
.factors .f-nvt .b-track { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.health-grid section { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.health-grid .details { margin: 0 0 10px; }
.health .source, .health .expansions { font-size: 12px; color: var(--faint); margin: 6px 0 0; }
.mini-track { display: inline-block; vertical-align: middle; width: 60px; height: 6px; border-radius: 3px; background: #eef0f3; overflow: hidden; margin-left: 6px; }
.mini-track span { display: block; height: 100%; background: var(--ok); }
.succ-list { list-style: none; margin: 0; padding: 0; }
.succ-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.succ-list li:last-child { border-bottom: 0; }
.succ-list li[tabindex] { cursor: pointer; }
.succ-list li[tabindex]:hover .what b { color: var(--accent); }
.succ-list .what p { margin: 2px 0; font-size: 14px; white-space: pre-line; }
.succ-list .what small { font-size: 12px; }
.succ-list [data-archive] { opacity: 0; transition: opacity var(--t-fast); }
.succ-list li:hover [data-archive], .succ-list li:focus-within [data-archive] { opacity: 1; }
.badge.goal-behaald { background: var(--ok-soft); color: var(--ok); }
.badge.goal-losgelaten { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.badge.goal-late { background: var(--warn-soft); color: var(--warn); }
.succ-mijlpaal .succ-list li { padding-left: 18px; position: relative; }
.succ-mijlpaal .succ-list li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.dot.health { background: var(--danger); }
@media (max-width: 900px) {
    .health-score { grid-template-columns: auto minmax(0, 1fr); }
    .health-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
    .health-grid { grid-template-columns: minmax(0, 1fr); }
    .factors li { grid-template-columns: minmax(0, 1fr) 64px; grid-template-areas: "label score" "track track" "text text"; }
    .health-table .hide-sm { display: none; }
    .health-table th, .health-table td { padding: 10px 12px; }
    #health-status-filter .segmented { display: flex; flex-wrap: wrap; }
    .succ-list [data-archive] { opacity: 1; }
}

/* ---- Import, export en gegevensbronnen ---------------------------------- */
#data-body { display: grid; gap: 20px; }
.import-step { padding: 18px 20px; }
.file-drop input[type=file] { padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: #fafbfc; cursor: pointer; }
.file-drop input[type=file]:hover { border-color: var(--accent); }
#import-preview { padding: 18px 20px; display: grid; gap: 14px; animation: enter var(--t-med) var(--ease); }
#import-preview .section-head { display: flex; justify-content: space-between; align-items: center; }
#import-preview h2 { font-size: 16px; }
.import-counts { margin: 0; }
.import-counts small { color: var(--faint); margin-left: 6px; }
.import-counts .soon, .health-table .soon { color: var(--warn); }
.note.warn { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 8px; margin: 0; }
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 10px 0 2px; }
.mapping-grid label { display: grid; gap: 4px; font-size: 13px; }
.mapping-grid label span { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-table { font-size: 14px; }
.import-table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.import-table tr.i-fout td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.import-table tr.i-dubbel td:first-child { box-shadow: inset 3px 0 0 #e0a23a; }
.badge.imp-nieuw { background: var(--ok-soft); color: var(--ok); }
.badge.imp-dubbel { background: var(--warn-soft); color: var(--warn); }
.badge.imp-fout { background: var(--danger-soft); color: var(--danger); }
.badge.imp-undone { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.import-go { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.import-go .preview-box { margin: 0; flex: 1; }
.import-list, .systems { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
.import-list li, .systems li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.import-list li:last-child, .systems li:last-child { border-bottom: 0; }
.import-list .what small, .systems .what small { display: block; }
.import-list .state, .systems .state { text-align: right; display: grid; justify-items: end; gap: 2px; }
.systems .manual { color: var(--muted); margin-top: 2px; }
.badge.src-self { background: var(--accent-soft); color: var(--accent); }
.badge.src-on { background: var(--ok-soft); color: var(--ok); }
.badge.src-off { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.badge.src-ext { background: #eef0f3; color: var(--text); }
.sources-table { font-size: 14px; }
.sources-table tr.group-start td { border-top: 1px solid var(--line); }
.intro { margin: 0; max-width: 70ch; }
.export-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.export-sets { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.export-sets button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; cursor: pointer;
                      transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.export-sets button small { color: var(--muted); }
.export-sets button.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.export-detail { padding: 18px 20px; display: grid; gap: 12px; justify-items: start; }
.export-detail h2 { font-size: 16px; }
.export-detail .cols { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.export-detail .cols span { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #f1f2f5; }
.export-detail .preview-box { margin: 0; justify-self: stretch; }
.export-detail .label { margin: 0; }
a.btn[aria-disabled=true] { pointer-events: none; opacity: .5; }
@media (max-width: 900px) {
    .export-layout { grid-template-columns: minmax(0, 1fr); }
    .export-sets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .import-go { flex-direction: column; align-items: stretch; }
    .import-list li, .systems li { grid-template-columns: minmax(0, 1fr) auto; }
    .import-list li > :last-child, .systems li > :last-child { grid-column: 1 / -1; justify-self: start; }
    .import-table .hide-sm, .sources-table .hide-sm { display: none; }
    #data-body ~ * .segmented, .filters .segmented { flex-wrap: wrap; }
}

/* ---- Campagnes ----------------------------------------------------------- */
.camp-table td small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.camp-table tr[data-href] { cursor: pointer; transition: background var(--t-fast); }
.camp-table tr[data-href]:hover td { background: #fafaff; }
.badge.camp-gepland { background: var(--accent-soft); color: var(--accent); }
.badge.camp-gepauzeerd { background: var(--warn-soft); color: var(--warn); }
.badge.camp-verzonden { background: var(--ok-soft); color: var(--ok); }
.badge.camp-afgerond { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.badge.rcp-verzonden { background: var(--ok-soft); color: var(--ok); }
.badge.rcp-overgeslagen { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.mini-track.wide { width: 140px; }
.camp-head .sub span.soon { color: var(--warn); }
.camp-steps { display: grid; gap: 16px; }
.camp-step { padding: 18px 20px; display: grid; gap: 12px; }
.camp-step .section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.camp-step h2 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.camp-step p { margin: 0; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.goal-line { display: flex; align-items: center; gap: 8px; }
.seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.seg-grid .label { margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
            transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.seg-chip:hover:not(:disabled) { border-color: var(--accent); }
.seg-chip.chosen { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-chip:disabled { cursor: default; opacity: .75; }
.audience { margin: 0; }
.who-table { font-size: 14px; }
.who-table td { padding: 8px 10px; }
.who-table td small { display: block; color: var(--faint); font-size: 12px; }
.who-table tr.skip td:first-child { color: var(--muted); }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-pick { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tpl-pick select { width: auto; }
.msg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.msg-form { display: grid; gap: 10px; }
.msg-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.msg-form .help { font-size: 13px; color: var(--muted); }
.mail-preview .label { margin: 0 0 6px; }
.mail { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fcfcfd; font-size: 14px; }
.mail-subj { font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px !important; }
.mail-body { white-space: pre-line; }
.mail-foot { margin-top: 14px !important; font-size: 12px; color: var(--faint); }
.camp-tiles .tile { border: 1px solid var(--line); }
.camp-leads li { padding: 4px 0; }
.tpl-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); }
.tpl-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tpl-list li:last-child { border-bottom: 0; }
.tpl-list .what small { display: block; }
.tpl-list .what p { margin: 4px 0 0; font-size: 13px; color: var(--muted); white-space: pre-line; }
@media (max-width: 900px) {
    .seg-grid, .msg-grid { grid-template-columns: minmax(0, 1fr); }
    .camp-table .hide-sm, .who-table .hide-sm { display: none; }
}

/* Selectievakjes in formulieren lenen de klasse .check, maar niet het afvinkrondje */
.form-grid label.check { width: auto; height: auto; border: 0; border-radius: 0; background: none; cursor: pointer; transform: none; }
.form-grid label.check::after { content: none; }

/* Werktijden en feestdagen (SLA) */
.sla-form > .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.sla-form [data-field=day_start], .sla-form [data-field=day_end] { grid-column: span 2; }
.sla-form h3 .field-error { display: inline; margin-left: 8px; font-weight: 400; }
.sla-form .small-note { font-size: 13px; margin: 8px 0 0; }
table.sla-preview { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-size: 14px; }
table.sla-preview th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 2px 8px 4px 0; }
table.sla-preview td { padding: 4px 8px 4px 0; vertical-align: top; border-top: 1px solid var(--line); }
table.sla-preview td small { display: block; color: var(--muted); }
ul.closed-days { list-style: none; padding: 0 !important; margin: 0 0 8px !important; display: grid; gap: 2px; }
ul.closed-days span { display: inline-block; min-width: 150px; color: var(--muted); }
.sla-info .preview-box { margin: 12px 0; }
@media (max-width: 600px) { ul.closed-days span { min-width: 0; margin-right: 6px; } }
@media (max-width: 600px) {
    .sla-form > .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sla-form [data-field=day_start], .sla-form [data-field=day_end] { grid-column: span 1; }
}

/* ---- Koppelingen ---- */
.int-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--faint); vertical-align: middle; }
.int-dot.ok { background: var(--ok); }
.int-dot.warn { background: #d99a00; }
.int-dot.late { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.int-dot.off { background: transparent; box-shadow: inset 0 0 0 2px #c4c9d2; }
.badge.int-ok { background: var(--ok-soft); color: var(--ok); }
.badge.int-warn { background: var(--warn-soft); color: var(--warn); }
.badge.int-late { background: var(--danger-soft); color: var(--danger); }
.badge.int-off { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
ul.integrations { list-style: none; margin: 0 0 20px; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 24, 40, .05); }
ul.integrations li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line);
                     cursor: pointer; animation: enter var(--t-med) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
ul.integrations li:last-child { border-bottom: 0; }
ul.integrations li:hover, ul.integrations li:focus-visible { background: #fafbfc; outline: none; }
ul.integrations .what small { display: block; }
ul.integrations .state { display: grid; justify-items: end; gap: 2px; text-align: right; }
.int-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.int-head h2 { margin: 4px 0 2px; font-size: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.int-head p { margin: 0; }
.int-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.int-detail .quiet-line { margin-top: 12px; }
.int-detail .card { margin-top: 16px; }
.int-detail .card h3 { margin: 0 0 10px; font-size: 16px; }
.adapter-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.adapter-opt { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 500;
               transition: border-color var(--t-fast), background var(--t-fast); }
.adapter-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.adapter-fields { animation: fade var(--t-med) var(--ease); }
.adapter-fields:empty, .secret-slot:empty { display: none; }
.adapter-fields > .note { margin: 0; color: var(--muted); }
.secret-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.secret-row > span { font-weight: 600; }
.secret-row .help { flex-basis: 100%; margin: 0; }
.form-actions.left { justify-content: flex-start; align-items: center; flex-wrap: wrap; }
.test-result { font-size: 14px; }
.ok-text { color: var(--ok); }
.copy-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; min-width: 0; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: #f3f4f7; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
code.secret-once { font-size: 14px; }
ul.event-types { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
ul.event-types small { display: block; color: var(--muted); }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 10px; }
.map-grid label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.map-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.map-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px 4px 0; }
.map-table td { padding: 4px 6px 4px 0; border-top: 1px solid var(--line); }
.map-table input { width: 100%; }
.req-mark { color: var(--muted); font-size: 11px; }
.map-right textarea { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; width: 100%; }
.map-preview { margin-top: 10px; background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; min-height: 40px; }
.map-preview p { margin: 0 0 4px; }
.map-preview pre, ul.ievents pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 260px; overflow: auto; }
.log-card .section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.log-card h3 { margin: 0; font-size: 16px; }
ul.ievents { list-style: none; margin: 0; padding: 0; }
ul.ievents li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
ul.ievents .dir { font-weight: 700; color: var(--muted); text-align: center; }
ul.ievents li.st-fout .dir, ul.ievents li.st-geweigerd .dir { color: var(--danger); }
ul.ievents .what small { display: block; }
ul.ievents .what .sys { display: inline; color: var(--faint); }
ul.ievents details summary { font-size: 12px; color: var(--muted); cursor: pointer; }
ul.ievents .state { display: grid; justify-items: end; gap: 4px; text-align: right; }
.badge.iev-verwerkt, .badge.iev-verzonden { background: var(--ok-soft); color: var(--ok); }
.badge.iev-bewaard, .badge.iev-genegeerd { background: #eef0f3; color: var(--muted); }
.badge.iev-wacht { background: var(--warn-soft); color: var(--warn); }
.badge.iev-fout, .badge.iev-geweigerd { background: var(--danger-soft); color: var(--danger); }
.small-link { font-size: 13px; }
.empty-log { margin: 6px 0; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.invoice-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 8px 4px 0; }
.invoice-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.invoice-table td small { display: block; color: var(--muted); }
.invoice-table .num { text-align: right; }
.badge.inv-betaald { background: var(--ok-soft); color: var(--ok); }
.badge.inv-open { background: #eef0f3; color: var(--text); }
.badge.inv-vervallen { background: var(--danger-soft); color: var(--danger); }
.badge.inv-gecrediteerd { background: #eef0f3; color: var(--muted); }
@media (max-width: 760px) {
    .map-grid { grid-template-columns: minmax(0, 1fr); }
    ul.ievents li { grid-template-columns: 18px minmax(0, 1fr); }
    ul.ievents .state { grid-column: 2; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
    ul.integrations li { grid-template-columns: auto minmax(0, 1fr); }
    ul.integrations .state { grid-column: 2; justify-items: start; text-align: left; }
}
.adapter-opt input[type=radio] { width: 16px; height: 16px; margin: 0; padding: 0; flex: none; accent-color: var(--accent); }
.btn:disabled:not(.busy) { opacity: .5; cursor: not-allowed; }

/* ---- Beheer: rollen en rechten, privacy, bewaartermijnen, pakketten (CRM-SEC-001..018, PACK-001) ---- */
.admin-split { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 16px; align-items: start; }
.role-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; position: sticky; top: 72px; }
.role-list button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); cursor: pointer; font: inherit; color: var(--text); transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.role-list button:hover { border-color: var(--accent); }
.role-list button.active { border-color: var(--accent); background: var(--accent-soft); }
.role-detail { padding: 18px 20px; }
.role-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.role-head h2 { margin: 0; font-size: 18px; }
.own-only { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius); background: var(--warn-soft); margin: 8px 0 16px; }
.own-only span { display: grid; gap: 2px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 20px; }
.perm-groups fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.perm-groups legend { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.perm-groups label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.perm-groups label.extra { color: var(--accent); }
.perm-diff { margin: 6px 0 0; padding-left: 18px; }
.perm-diff .plus { color: var(--ok); }
.perm-diff .plus::marker { content: '+ '; }
.perm-diff .minus { color: var(--danger); }
.perm-diff .minus::marker { content: '− '; }
.privacy-list li.late { border-left: 3px solid var(--danger); }
.privacy-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.retention-form { padding: 18px 20px; }
.retention-form .live { display: block; margin-top: 2px; }
.catalog-card { padding: 18px 20px; }
.catalog-table { width: 100%; border-collapse: collapse; }
.catalog-table th, .catalog-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.catalog-table .num { text-align: right; white-space: nowrap; }
.catalog-table tr.withdrawn td { color: var(--faint); }
.badge.cat-actief { background: var(--ok-soft); color: var(--ok); }
.badge.cat-concept { background: var(--warn-soft); color: var(--warn); }
.badge.cat-vervallen, .badge.privacy-afgerond, .badge.privacy-afgewezen { background: var(--line); color: var(--muted); }
.badge.privacy-open { background: var(--accent-soft); color: var(--accent); }
.badge.privacy-in_behandeling { background: var(--warn-soft); color: var(--warn); }
.webform-card { padding: 18px 20px; display: grid; gap: 10px; }
.webform-card textarea.code { font: 13px ui-monospace, monospace; width: 100%; }
label.check.big { display: flex; gap: 10px; align-items: flex-start; }
label.check.big span { display: grid; }
/* Taken: herhaling en herinnering; bijlagen bij contactmomenten */
.task-list .recur, .task-list .remind { white-space: nowrap; }
.timeline .files { list-style: none; padding: 0; }
.timeline .files li { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.file-pick { cursor: pointer; }
@media (max-width: 720px) {
    .admin-split { grid-template-columns: 1fr; }
    .role-list { position: static; }
}

/* ---- Mail en agenda (CRM-INT-016/017) ---- */
.account { max-width: 760px; }
.provider-pick { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.provider-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; min-width: 220px; text-align: left; }
.provider-btn small { font-weight: 400; opacity: .85; }
.mailbox-card .int-head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.mb-switches { list-style: none; padding: 0; margin: 16px 0 0; }
.mb-switches li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; flex: 1; }
.switch input { appearance: none; flex: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; margin: 2px 0 0; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--t-fast) var(--ease); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch span { display: flex; flex-direction: column; }
.mb-effect { color: var(--muted); }
.reg-steps { padding-left: 20px; margin: 0 0 16px; }
.reg-steps li { margin: 6px 0; }
.reg-steps .copy-row { margin: 4px 0; }
.reg-steps code { font-size: 12px; background: #f3f4f7; padding: 1px 5px; border-radius: 4px; }
.mb-users li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.list-head { margin: 24px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }
