/* ---------- Lettertype (lokaal gehost) ---------- */
@font-face { font-family: Geist; font-weight: 400; font-display: swap; src: url(../fonts/geist-latin-400.woff2) format("woff2"); }
@font-face { font-family: Geist; font-weight: 500; font-display: swap; src: url(../fonts/geist-latin-500.woff2) format("woff2"); }
@font-face { font-family: Geist; font-weight: 600; font-display: swap; src: url(../fonts/geist-latin-600.woff2) format("woff2"); }

/* ---------- Tokens ---------- */
:root {
    --ink: #14213d;          /* merkkleur, donker paneel */
    --ink-soft: #1d2d50;
    --accent: #0f8a72;       /* groenblauw accent */
    --accent-hover: #0b735f;
    --accent-ring: rgb(15 138 114 / .28);
    --on-accent: #ffffff;    /* tekst op accentkleur */

    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #172033;
    --text-muted: #5d6779;
    --line: #e1e4ea;
    --line-strong: #c9ced8;
    --field: #ffffff;
    --danger: #c8372d;
    --notice-bg: #e7f4f0;
    --notice-text: #0b5e4e;

    --radius-sm: 6px;
    --radius: 10px;
    --font: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #0d1628;
        --ink-soft: #16223b;
        --accent: #2bb596;
        --accent-hover: #4cc6aa;
        --accent-ring: rgb(43 181 150 / .32);
        --on-accent: #06261f;

        --bg: #0f141d;
        --surface: #151b26;
        --text: #e5e9f0;
        --text-muted: #96a0b0;
        --line: #252d3b;
        --line-strong: #344052;
        --field: #111720;
        --danger: #f0766c;
        --notice-bg: #12302a;
        --notice-text: #8fdcc7;

        color-scheme: dark;
    }
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    font-feature-settings: "tnum" 1;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1 {
    font-size: 1.625rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -.02em;
    margin: 0 0 1.75rem;
}

a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:not(.btn):hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wordmark {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -.015em;
    color: inherit;
}
a.wordmark:hover { color: inherit; text-decoration: none; }

/* ---------- Gastpagina's: gesplitst scherm ---------- */
.split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 5fr) 7fr;
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem;
    background: var(--ink);
    color: #fff;
    overflow: hidden;
}

.trend { width: 100%; height: auto; display: block; }
.trend-grid line { stroke: rgb(255 255 255 / .08); stroke-width: 1; }
.trend-area { fill: rgb(43 181 150 / .10); }
.trend-line {
    fill: none;
    stroke: #2bb596;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw 1.4s cubic-bezier(.6, 0, .2, 1) both;
}
.trend-dot {
    fill: #2bb596;
    transform-box: fill-box;
    transform-origin: center;
    stroke: var(--ink);
    stroke-width: 3;
    animation: pop .3s 1.3s ease-out both;
}

@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }

@media (prefers-reduced-motion: reduce) {
    .trend-line, .trend-dot { animation: none; }
}

.form-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: var(--surface);
}

.form-wrap { width: 100%; max-width: 360px; }

@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .brand-panel { flex-direction: row; align-items: center; padding: 1rem 16px; }
    .trend { width: 72px; }
    .trend-grid, .trend-area { display: none; }
    .form-pane { align-items: flex-start; padding: 2.5rem 16px; }
}

/* ---------- Formulieren ---------- */
.field { margin-bottom: 1.125rem; }

label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .375rem;
}

.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.label-row a { font-size: .8125rem; }

input[type=text], input[type=email], input[type=password] {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 .75rem;
    font: inherit;
    color: inherit;
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s;
}

input:hover { border-color: var(--text-muted); }

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

input[aria-invalid=true] { border-color: var(--danger); }
input[aria-invalid=true]:focus { box-shadow: 0 0 0 3px rgb(200 55 45 / .22); }

.error { color: var(--danger); font-size: .8125rem; margin: .375rem 0 0; }

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 400;
    color: var(--text-muted);
    margin: .25rem 0 1.5rem;
    cursor: pointer;
}
.checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 1.125rem;
    font: inherit;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}

.btn-primary, .btn-primary:hover { color: var(--on-accent); }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn:hover { text-decoration: none; }
.btn-block { width: 100%; }

.btn-ghost {
    height: 34px;
    padding: 0 .75rem;
    background: transparent;
    border-color: var(--line);
    color: var(--text);
    font-size: .875rem;
}
.btn-ghost:hover { background: var(--bg); border-color: var(--line-strong); color: var(--text); }

.intro { color: var(--text-muted); margin: -1rem 0 1.75rem; }

.notice {
    padding: .75rem .875rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--notice-bg);
    color: var(--notice-text);
    font-size: .875rem;
}

.form-footer {
    margin: 2rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: .875rem;
    color: var(--text-muted);
}

/* ---------- Ingelogde omgeving ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.account { display: flex; align-items: center; gap: .625rem; }
.account form { margin: 0 0 0 .375rem; }
.account-name { font-size: .875rem; font-weight: 500; }

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.page { max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.5rem; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { margin-bottom: .25rem; }
.page-header p { margin: 0; color: var(--text-muted); }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}

@media (max-width: 760px) {
    .topbar { padding: 0 16px; }
    .account-name { display: none; }
    .page { padding: 1.75rem 16px; }
}

/* ==========================================================
   Applicatie: navigatie, tabellen, formulieren, panelen
   ========================================================== */

:root { --warning-bg: #fdf3e1; --warning-text: #8a5a00; --info: #2f5fd0; }
@media (prefers-color-scheme: dark) {
    :root { --warning-bg: #3a2c10; --warning-text: #f3c873; --info: #8fb0ff; }
}

h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .75rem; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8125rem; }

.topbar-left { display: flex; align-items: center; gap: 2rem; }
.mainnav { display: flex; gap: .25rem; }
.mainnav a {
    padding: .375rem .625rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: .875rem;
    font-weight: 500;
}
.mainnav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.mainnav a.active { color: var(--text); background: var(--bg); }

.page-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.backlink { display: inline-block; font-size: .8125rem; color: var(--text-muted); margin-bottom: .375rem; }
.backlink::before { content: "‹ "; }
.backlink:hover { color: var(--text); }

.btn-sm { height: 32px; padding: 0 .75rem; font-size: .8125rem; }
.btn-link { background: none; border: 0; color: var(--accent); padding: 0; height: auto; font-weight: 500; }
.btn-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.btn-danger, .btn-danger:hover { color: var(--danger); }
span.btn[aria-disabled] { opacity: .45; cursor: default; }

.notice-error { background: rgb(200 55 45 / .1); color: var(--danger); }
.notice-warning { background: var(--warning-bg); color: var(--warning-text); }

.empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
}
.empty p { margin: 0 0 1rem; }
.empty p:last-child { margin: 0; }

/* Statusindicator */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); margin: 0 .375rem 1px; vertical-align: middle; }
.dot-on { position: relative; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
/* Actief: een ring die vanuit het stipje uitdijt en vervaagt, als een hartslag. */
.dot-on::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--accent);
    animation: dot-pulse 2s cubic-bezier(.2, .6, .35, 1) infinite;
    pointer-events: none;
}
@keyframes dot-pulse {
    0%   { transform: scale(1);   opacity: .7; }
    70%  { transform: scale(2.8); opacity: 0; }
    100% { transform: scale(2.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .dot-on::after { animation: none; display: none; }
}

.badge {
    display: inline-block;
    padding: .125rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--line);
}
.badge-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.badge-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge-success { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); border-color: transparent; }
.badge-muted { opacity: .7; }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
    text-align: left;
    font-weight: 500;
    font-size: .8125rem;
    color: var(--text-muted);
    padding: .625rem 1rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.num { text-align: right !important; }
.strong { font-weight: 600; }
.rowlink { color: var(--text); font-weight: 500; }
.rowlink:hover { color: var(--accent); }
.sub { color: var(--text-muted); font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.text-danger { color: var(--danger); }

.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; }

/* Kerncijfers */
.stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    margin: 0 0 2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.stats > div { padding: 1rem 1.25rem; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: .8125rem; color: var(--text-muted); }
.stats dd { margin: .25rem 0 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.stats small { font-size: .8125rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; margin-left: .25rem; }
.stat-highlight dd { color: var(--accent); }

/* Hoofdkolom + zijkolom */
.split-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.sidebar { display: grid; gap: 1rem; }
.sidebar .panel { padding: 1.25rem; }
.sidebar form { margin: 0; }
.section-title { margin-bottom: 1rem; }

.filters { display: flex; gap: .5rem; margin-bottom: 1rem; }
.filters input { flex: 1; }
.filters select { width: auto; }

.hint { font-size: .8125rem; color: var(--text-muted); margin: .375rem 0 .75rem; }
.field .hint { margin-bottom: 0; }

input[type=search], input[type=number], input[type=time], input[type=url], select, textarea {
    display: block;
    width: 100%;
    padding: 0 .75rem;
    height: 42px;
    font: inherit;
    color: inherit;
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
}
textarea { height: auto; padding: .625rem .75rem; line-height: 1.55; resize: vertical; }
textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8125rem; }
select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input[type=file] { font-size: .8125rem; margin: .25rem 0 .75rem; max-width: 100%; }

.inline-form { display: flex; gap: .5rem; }
.inline-form input { height: 32px; font-size: .8125rem; }

code.block {
    display: block;
    padding: .5rem .625rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    word-break: break-all;
    margin-bottom: .5rem;
}
code.wrap { word-break: break-all; }
details { margin-top: .5rem; font-size: .875rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 500; }
details[open] summary { margin-bottom: .5rem; }
pre.code {
    margin: 0;
    padding: .75rem;
    font-size: .75rem;
    line-height: 1.5;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.errorlist { margin: 0 0 .75rem; padding-left: 1.125rem; font-size: .8125rem; color: var(--danger); }

/* Mailvoorbeeld */
.mailpreview { border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .8125rem; overflow: hidden; }
.mailpreview-head { padding: .625rem .75rem; background: var(--bg); border-bottom: 1px solid var(--line); display: grid; gap: .125rem; }
.mailpreview-head span { display: inline-block; width: 4.5rem; color: var(--text-muted); }
.mailpreview-body { padding: .75rem; white-space: pre-wrap; max-height: 320px; overflow-y: auto; line-height: 1.55; }

/* Berichten van een lead */
.message {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
    border-left: 3px solid var(--accent);
}
.message-in { border-left-color: var(--ink); }
.message header { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; }
.message-subject { font-weight: 500; margin: .25rem 0 .75rem; }
.message-body { white-space: pre-wrap; font-size: .875rem; line-height: 1.6; }

.details { display: grid; grid-template-columns: auto 1fr; gap: .375rem 1rem; margin: 0; font-size: .875rem; }
.details dt { color: var(--text-muted); }
.details dd { margin: 0; min-width: 0; }
.plainlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .875rem; }

/* Instellingenformulier */
.settings { max-width: 1040px; }
.settings-section {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2.5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--line);
}
.settings-section:first-of-type { border-top: 0; padding-top: 0; }
.settings-intro p { color: var(--text-muted); font-size: .875rem; margin: 0 0 .75rem; }
.settings-fields { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 1rem; }
.label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; }

.vars { margin: 0; font-size: .8125rem; }
.vars dt { margin-top: .5rem; }
.vars dt code { color: var(--accent); }
.vars dd { margin: .125rem 0 0; color: var(--text-muted); }

.daypicker { display: flex; gap: .375rem; flex-wrap: wrap; }
.daypicker label { margin: 0; cursor: pointer; }
.daypicker input { position: absolute; opacity: 0; pointer-events: none; }
.daypicker span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-muted);
}
.daypicker input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.daypicker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-actions {
    display: flex;
    gap: .5rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--line);
    position: sticky;
    bottom: 0;
    background: var(--bg);
}

@media (max-width: 1000px) {
    .split-main { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(3, 1fr); }
    .stats > div:nth-child(4) { border-left: 0; }
    .stats > div:nth-child(n+4) { border-top: 1px solid var(--line); }
    .settings-section { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 760px) {
    .topbar-left { gap: 1rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats > div { border-left: 0 !important; }
    .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .stats > div:nth-child(odd) { border-right: 1px solid var(--line); }
    .filters { flex-direction: column; }
}

/* ==========================================================
   Inbox
   ========================================================== */

.page-wide { max-width: none; padding: 0; }
.count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: .25rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: .6875rem;
    font-weight: 600;
    vertical-align: 1px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.inbox {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    height: calc(100vh - 56px);
}
.inbox-list {
    border-right: 1px solid var(--line);
    background: var(--surface);
    overflow-y: auto;
}
.inbox-tabs {
    display: flex;
    gap: .125rem;
    padding: .75rem .75rem 0;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 2;
}
.inbox-tabs a {
    padding: .5rem .625rem .625rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.inbox-tabs a:hover { color: var(--text); text-decoration: none; }
.inbox-tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

.inbox-filters { display: flex; gap: .5rem; padding: .75rem; border-bottom: 1px solid var(--line); }
.inbox-filters input, .inbox-filters select { height: 34px; font-size: .8125rem; }
.inbox-filters select { width: auto; max-width: 45%; }

.inbox-item {
    display: block;
    padding: .875rem 1rem .875rem 1.125rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    position: relative;
}
.inbox-item:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.inbox-item.is-active { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.inbox-item.is-unread::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 1.25rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.inbox-item-top { display: flex; justify-content: space-between; gap: .75rem; font-size: .875rem; }
.inbox-from { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-unread .inbox-from, .is-unread .inbox-subject { font-weight: 600; }
.inbox-date { color: var(--text-muted); font-size: .75rem; white-space: nowrap; }
.inbox-subject { font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .125rem; }
.inbox-preview { font-size: .8125rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-meta { display: flex; gap: .5rem; align-items: center; margin-top: .375rem; font-size: .75rem; flex-wrap: wrap; }
.attention { color: var(--warning-text); font-weight: 500; }
.inbox-empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--text-muted); font-size: .875rem; }
.inbox-list .pagination { padding: .75rem; margin: 0; }

.tag {
    display: inline-block;
    padding: 0 .375rem;
    border-radius: 4px;
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--line);
}
.tag-sales { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.tag-ai { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag-intent { color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }

.inbox-detail { overflow-y: auto; display: flex; flex-direction: column; }
.inbox-placeholder { margin: auto; color: var(--text-muted); }

.convo-header { padding: 1.5rem 2rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.convo-back { display: none; }
.convo-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.convo-title h1 { font-size: 1.25rem; margin: 0; }
.convo-sub { margin: .375rem 0 0; color: var(--text-muted); font-size: .8125rem; }
.convo-header .notice { margin: .875rem 0 0; }

.thread { padding: 1.5rem 2rem; display: grid; gap: .875rem; align-content: start; }
.mail {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    max-width: 820px;
}
.mail-out { border-left: 3px solid var(--accent); }
.mail-auto { opacity: .7; }
.mail header { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; margin-bottom: .625rem; }
.mail-flags { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .625rem; font-size: .8125rem; }
.mail-body { white-space: pre-wrap; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.mail-html iframe { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.attachments { list-style: none; margin: .875rem 0 0; padding: .75rem 0 0; border-top: 1px solid var(--line); font-size: .8125rem; display: grid; gap: .25rem; }

.composer {
    margin-top: auto;
    padding: 1.25rem 2rem 1.5rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.composer form { max-width: 820px; margin: 0; }
.composer-head { display: flex; gap: .625rem; align-items: center; margin-bottom: .625rem; }
.composer-label { font-size: .8125rem; color: var(--text-muted); font-weight: 500; }
.composer textarea { font-size: .875rem; }
.composer-actions { display: flex; gap: .625rem; align-items: center; margin-top: .75rem; flex-wrap: wrap; }

@media (max-width: 900px) {
    .inbox { grid-template-columns: 1fr; height: auto; }
    .inbox.has-detail .inbox-list { display: none; }
    .inbox:not(.has-detail) .inbox-detail { display: none; }
    .inbox-list { border-right: 0; }
    .convo-back { display: inline-block; }
    .convo-header, .thread, .composer { padding-left: 16px; padding-right: 16px; }
    .convo-title { flex-direction: column; }
    .inbox-tabs { overflow-x: auto; }
}

/* Nieuw bericht & bijlagen */
.inbox-toolbar { padding: .75rem .75rem 0; }
.inbox-toolbar .btn { width: 100%; }
.compose-form { padding: 1.5rem 2rem; max-width: 860px; }
.compose-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
    margin-bottom: .625rem;
}
.compose-row label { margin: 0; color: var(--text-muted); font-weight: 500; }
.compose-form > .error { margin: -.25rem 0 .625rem 102px; }
.compose-form textarea { margin-top: .5rem; font-size: .875rem; }
.attach-input { margin-top: .625rem; }
.attach-input input[type=file] { margin: 0; }
@media (max-width: 900px) {
    .compose-form { padding: 1.25rem 16px; }
    .compose-row { grid-template-columns: 1fr; gap: .25rem; }
    .compose-form > .error { margin-left: 0; }
}

/* Follow-ups in projectformulier */
.followup-step { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.followup-step .field { margin-bottom: .5rem; }
.input-suffix { display: flex; align-items: center; gap: .5rem; }
.input-suffix input { width: 6rem; }
.input-suffix span { color: var(--text-muted); }

/* Statistieken */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.filter-project select { min-width: 220px; margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 2px; }
.segmented a { padding: .375rem .75rem; border-radius: calc(var(--radius) - 2px); font-size: .875rem; color: var(--text-muted); text-decoration: none; }
.segmented a:hover { color: var(--text); }
.segmented a.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); font-weight: 500; }
.stats.stats-5 { grid-template-columns: repeat(5, 1fr); }
.panel + .panel, .panel + .stats-columns, .stats-columns + .panel { margin-top: 1rem; }
.sidebar .panel + .panel { margin-top: 0; }
.panel h2 { font-size: 1rem; margin: 0 0 1rem; }
.panel h3 { font-size: .875rem; margin: 1.5rem 0 .75rem; }
.stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stats-columns > .panel { margin: 0; min-width: 0; }
.empty-inline { color: var(--text-muted); font-size: .875rem; margin: 0; }

.minicharts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.minichart { margin: 0; min-width: 0; }
.minichart figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: .8125rem; color: var(--text-muted); margin-bottom: .5rem; }
.minichart figcaption strong { font-size: 1.125rem; color: var(--text); font-weight: 600; }
.bars {
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    align-items: end;
    gap: 2px;
    height: 96px;
    border-bottom: 1px solid var(--line);
}
.bar-slot { position: relative; height: 100%; display: flex; align-items: flex-end; }
.bar { display: block; width: 100%; max-width: 14px; margin: 0 auto; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar-slot:hover .bar { filter: brightness(1.15); }
.bar-slot:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: .25rem .5rem;
    border-radius: 6px;
    background: var(--text);
    color: var(--surface);
    font-size: .75rem;
    pointer-events: none;
    z-index: 2;
}
.minichart:first-child .bar-slot:nth-child(-n+4):hover::after { left: 0; transform: none; }
.minichart:last-child .bar-slot:nth-last-child(-n+4):hover::after { left: auto; right: 0; transform: none; }
.bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-top: .375rem; }
.table-toggle { margin-top: 1.25rem; }
.table-toggle summary { cursor: pointer; font-size: .875rem; color: var(--text-muted); margin-bottom: .75rem; }

@media (max-width: 1000px) {
    .stats.stats-5 { grid-template-columns: repeat(3, 1fr); }
    .minicharts { grid-template-columns: 1fr; }
    .stats-columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .stats.stats-5 { grid-template-columns: repeat(2, 1fr); }
}
