/* ──────────────────────────────────────────────────────────────
   We Enable Cockpit — Design System
   Source: Brandbook We Enable 2025, via Claude Design handoff
   (We Enable Cockpit.dc.html + we-enable-design-system).

   Palette: 60-30-10 rule
     60% -> Communicate Blue (#18062F) + Innovate Green (#3CF4B3)
     30% -> Future White (#FFFFFF) + Partical Blue (#3B3159)
     10% -> Efficient Red (#EB0052)  <- CTA only
────────────────────────────────────────────────────────────── */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap");
/* Halcom substitute until Halcom-{Medium,Semibold,Bold}.woff2 are dropped into fonts/halcom/ */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&display=swap");

@font-face {
    font-family: 'Halcom';
    src: url('/fonts/halcom/Halcom-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Halcom';
    src: url('/fonts/halcom/Halcom-Semibold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Halcom';
    src: url('/fonts/halcom/Halcom-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --communicate-blue: #18062F;
    --partical-blue:    #3B3159;
    --innovate-green:   #3CF4B3;
    --future-white:     #FFFFFF;
    --efficient-red:    #EB0052;

    --communicate-blue-85: rgba(24, 6, 47, 0.85);
    --communicate-blue-60: rgba(24, 6, 47, 0.60);
    --partical-blue-50:    rgba(59, 49, 89, 0.50);
    --future-white-80:     rgba(255, 255, 255, 0.80);
    --future-white-60:     rgba(255, 255, 255, 0.60);
    --future-white-12:     rgba(255, 255, 255, 0.12);
    --future-white-06:     rgba(255, 255, 255, 0.06);
    --innovate-green-20:   rgba(60, 244, 179, 0.20);

    --bg:            var(--communicate-blue);
    --surface:       var(--partical-blue);
    --surface-soft:  rgba(59, 49, 89, 0.5);
    --border:        var(--future-white-12);
    --border-strong: var(--future-white-60);

    --fg:        var(--future-white);
    --fg-muted:  var(--future-white-60);
    --fg-subtle: rgba(255, 255, 255, 0.40);
    --fg-accent: var(--innovate-green);

    --success:   var(--innovate-green);
    --danger:    var(--efficient-red);
    --warning:   #FACC15;

    --font-display: "Halcom", "Poppins", ui-sans-serif, system-ui, sans-serif;
    --font-sans:    "DM Sans", ui-sans-serif, system-ui, sans-serif;
    --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 40px;  --sp-8: 64px;

    --radius-sm: 4px;
    --radius:    8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-btn: 999px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);

    --dur-fast: 120ms;
    --dur: 200ms;
}

/* ── Base ─────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 20px;
}
a { color: var(--innovate-green); text-decoration: none; }
a:hover { color: #6ff7c8; text-decoration: underline; }
input, select, button, textarea { font-family: var(--font-sans); }
input::placeholder { color: rgba(255,255,255,0.35); }
input[type=date] { color-scheme: dark; }
/* Native <select> dropdowns: Windows paints the option list with the OS colour scheme, so
   without these the list is white-on-white in the dark theme (macOS styles it itself). */
select { color-scheme: dark; }
select option { background: var(--surface); color: var(--fg); }
:root[data-theme="light"] select { color-scheme: light; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }
.tnum { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4, h5 { font-family: var(--font-display); margin: 0; font-weight: 700; }
.eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--fg-subtle);
}
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.accent { color: var(--innovate-green); }
.danger { color: var(--efficient-red); }
::selection { background: var(--innovate-green); color: var(--communicate-blue); }

/* ── App shell ────────────────────────────────────────────── */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 256px; flex: none; position: sticky; top: 0; align-self: flex-start; height: 100vh;
    background: rgba(24,6,47,0.55); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 24px 16px; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sidebar-brand img { height: 20px; width: auto; }
.sidebar-brand .cockpit-label {
    color: var(--fg-subtle); font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
    text-transform: uppercase; padding-left: 10px; border-left: 1px solid var(--border);
}
.sidebar-section { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.sidebar-section:first-of-type { margin-top: 0; }
.sidebar-section-label { padding: 8px 12px 4px; font-size: 11px; }

.nav-link {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent;
    color: var(--future-white-80); font: 500 14px var(--font-sans); cursor: pointer;
    transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-link:hover { background: rgba(255,255,255,0.05); text-decoration: none; color: var(--fg); }
.nav-link.active {
    border-color: rgba(60,244,179,0.25); background: rgba(60,244,179,0.12); color: var(--innovate-green);
}
.nav-link svg { flex: none; }
.nav-link span { flex: 1; }

.sidebar-spacer { flex: 1; }

/* ── Topbar ───────────────────────────────────────────────── */

.topbar {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
    padding: 28px 40px 20px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
    background: linear-gradient(to bottom, var(--bg) 70%, rgba(24,6,47,0.85));
}
.topbar-crumb { display: flex; align-items: center; gap: 8px; color: var(--fg-subtle); font-size: 12px; letter-spacing: 0.06em; margin-bottom: 8px; }
.topbar-crumb .sep { opacity: 0.5; }
.topbar-crumb .current { color: var(--fg-muted); }
.topbar h1 { font-size: 30px; line-height: 36px; letter-spacing: -0.01em; }
.topbar-sub { margin: 6px 0 0; color: var(--fg-muted); font-size: 14px; max-width: 640px; min-height: 20px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-meta { display: flex; align-items: center; gap: 16px; flex: none; }
.sync-pill {
    display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border);
    border-radius: 999px; background: rgba(255,255,255,0.03); font-size: 12px; color: var(--fg-muted);
}
.sync-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--innovate-green); box-shadow: 0 0 8px var(--innovate-green); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 999px; background: var(--innovate-green); color: var(--communicate-blue);
    font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none;
}
.user-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.user-role { color: var(--fg-subtle); font-size: 11px; }

.page-content { padding: 28px 40px 64px; display: flex; flex-direction: column; gap: 24px; }

/* ── Cards ────────────────────────────────────────────────── */

.card {
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
    padding: 16px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.card-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.card-footer { padding: 12px 24px; border-top: 1px solid var(--border); color: var(--fg-subtle); font-size: 12px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 1400px; }
.kpi-row.kpi-row-wrap { display: flex; flex-wrap: wrap; }
/* KPI section: a heading with what the cards are about, then a full-width grid
   of equal cards, so a longer sub line never makes one card differ from its neighbours. */
.kpi-section { margin-bottom: 20px; }
.kpi-section-title { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.kpi-section-sub { font-size: 12px; color: var(--fg-muted); margin: 0 0 10px; }
.kpi-section { min-width: 0; }
/* Every row fills the full width; the cards in a row share it equally. The
   minimum is small enough for seven cards on a laptop, so rows do not wrap. */
.kpi-grid { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; min-width: 0; box-sizing: border-box; }
.kpi-grid > .kpi-card { flex: 1 1 130px; min-width: 0; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; padding-left: 14px; padding-right: 14px; }
.kpi-grid .kpi-label { flex-wrap: wrap; }
.kpi-grid .kpi-value { font-size: 22px; line-height: 28px; }
.kpi-grid .kpi-klein .kpi-value { font-size: 17px; line-height: 22px; }
.kpi-card {
    border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px;
    background: var(--surface); box-shadow: var(--shadow-sm); min-width: 140px;
}
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--fg-muted); font-size: 12px; letter-spacing: 0.04em; margin-bottom: 10px; }
.kpi-label .info-icoon { cursor: help; opacity: 0.5; }
.kpi-value { font-family: var(--font-display); font-size: 26px; line-height: 30px; font-weight: 700; }
.kpi-sub { color: var(--fg-subtle); font-size: 11px; margin-top: 4px; }

.kpi-row.kpi-row-herkomst { display: flex; align-items: center; flex-wrap: wrap; }
.kpi-row-label { font-size: 13px; color: var(--fg-muted); font-weight: 600; align-self: center; margin-right: 4px; }
.note-text { font-size: 13px; color: var(--fg-muted); line-height: 20px; }
.kpi-klein { padding: 10px 16px; min-width: 120px; border-top: 3px solid transparent; }
.kpi-klein .kpi-value { font-size: 17px; }
.kpi-regie    { border-top-color: #7C93FF; }
.kpi-vast     { border-top-color: var(--innovate-green); }
.kpi-hosting  { border-top-color: var(--warning); }
.kpi-retainer { border-top-color: #A78BFA; }
.kpi-onbekend { border-top-color: var(--fg-subtle); }
.kpi-productief  { border-top-color: var(--innovate-green); }
.kpi-intern-uren { border-top-color: #7C93FF; }
.kpi-verlof      { border-top-color: var(--fg-subtle); }
.kpi-missing     { border-top-color: #ff5c93; }
.kpi-missing.kpi-missing-ok { border-top-color: var(--innovate-green); }

a.kpi-clickable {
    text-decoration: none; color: inherit; display: block; cursor: pointer;
    transition: background var(--dur-fast), border-color var(--dur-fast);
}
a.kpi-clickable:hover { background: rgba(255,255,255,0.06); border-color: var(--border-strong); text-decoration: none; }
a.kpi-clickable.kpi-active { background: rgba(60,244,179,0.10); border-color: var(--innovate-green); }

.breakdown-card {
    border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; background: var(--surface);
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.breakdown-label { font-size: 12px; letter-spacing: 0.04em; color: var(--fg-muted); white-space: nowrap; }
.breakdown-items { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; }
.breakdown-item { flex: 1; min-width: 160px; border-left: 3px solid; padding: 6px 0 6px 12px; }
.breakdown-item .label { color: var(--fg-muted); font-size: 12px; }
.breakdown-item .value { font-family: var(--font-display); font-size: 19px; font-weight: 700; }

/* ── Tables ───────────────────────────────────────────────── */

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead tr { color: var(--fg-muted); text-align: left; }
table.data-table th {
    padding: 12px 16px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; white-space: nowrap;
}
table.data-table th.right, table.data-table td.right { text-align: right; }
table.data-table td { padding: 11px 16px; }
table.data-table.right-default th, table.data-table.right-default td { text-align: right; }
table.data-table.right-default th.left, table.data-table.right-default td.left { text-align: left; }
table.data-table tbody tr { border-top: 1px solid var(--border); }
table.data-table tbody tr.row-internal { background: rgba(124,147,255,0.06); }
table.data-table tbody tr.row-no-cost-rate { background: rgba(250,204,21,0.05); }
table.data-table tbody tr.row-negative td.margin-cell { color: var(--efficient-red); }
table.data-table tbody tr.row-outlier { background: rgba(235,0,82,0.06); }
td.cell-negative { color: var(--efficient-red); font-weight: 600; }

/* ── Badges ───────────────────────────────────────────────── */

.badge {
    display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 7px;
    font-size: 10px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.badge-internal { background: rgba(124,147,255,0.18); color: #9db0ff; border-color: rgba(124,147,255,0.35); }
.badge-warning  { background: rgba(250,204,21,0.16); color: #f5cf4d; border-color: rgba(250,204,21,0.35); }
.badge-success  { background: rgba(60,244,179,0.15); color: var(--innovate-green); border-color: rgba(60,244,179,0.3); }
.badge-danger   { background: rgba(235,0,82,0.15); color: #ff5c93; border-color: rgba(235,0,82,0.3); }
.badge-muted    { background: rgba(255,255,255,0.06); color: var(--fg-muted); border-color: var(--border); }
.badge-purple   { background: rgba(111,45,168,0.18); color: #d8b4fe; border-color: rgba(111,45,168,0.35); }

/* ── Buttons ──────────────────────────────────────────────── */
/* Brandbook signature: pill with a small slanted top-right corner. */

.btn {
    --btn-notch: 10px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 18px; border: none; cursor: pointer; font-size: 13px; font-weight: 600;
    font-family: var(--font-sans); border-radius: var(--radius-btn);
    clip-path: polygon(0 0, calc(100% - var(--btn-notch)) 0, 100% var(--btn-notch), 100% 100%, 0 100%);
    transition: filter var(--dur-fast);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
/* Anchor buttons must keep their own colour on hover, not the global link mint. */
.btn-ghost:hover { color: var(--fg); }
.btn-green:hover { color: var(--communicate-blue); }
.btn-outline-green:hover { color: var(--innovate-green); }
.btn-sm { padding: 6px 14px; font-size: 12px; --btn-notch: 8px; }
.btn-green  { background: var(--innovate-green); color: var(--communicate-blue); }
.btn-red    { background: var(--efficient-red); color: var(--future-white); }
.btn-ghost  { background: rgba(255,255,255,0.03); color: var(--fg); border: 1px solid var(--border); clip-path: none; border-radius: var(--radius); }
.btn-outline-green { background: var(--innovate-green-20); color: var(--innovate-green); border: 1px solid rgba(60,244,179,0.3); clip-path: none; border-radius: 999px; }

/* ── Form controls ────────────────────────────────────────── */

.input, select.input, input.input {
    padding: 7px 10px; background: rgba(255,255,255,0.045); border: 1px solid var(--border-strong);
    border-radius: var(--radius); color: var(--fg); font-size: 13px; outline: none;
}
.input:focus, select.input:focus, input.input:focus { border-color: var(--innovate-green); }
/* Chrome/Edge on Windows paint the open option list with the <select>'s own background-color.
   The translucent .input background then lands on a white popup, so give selects an opaque one. */
select, select.input { background-color: var(--surface); }
select option, select.input option { background-color: var(--surface); color: var(--fg); }
:root[data-theme="light"] select, :root[data-theme="light"] select.input { background-color: #FFFFFF; }
:root[data-theme="light"] select option { background-color: #FFFFFF; color: var(--fg); }

.segmented { display: inline-flex; padding: 3px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 10px; gap: 2px; }
.segmented button, .segmented a {
    padding: 7px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 600;
    background: transparent; color: var(--fg-muted); transition: all var(--dur-fast);
}
.segmented button.active, .segmented a.active { background: var(--innovate-green); color: var(--communicate-blue); }

/* ── Progress bars ────────────────────────────────────────── */

.progress-track { height: 7px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; min-width: 90px; }
.progress-fill { height: 100%; border-radius: 999px; }
.pct-bar-wrap { display: flex; align-items: center; gap: 8px; }
.pct-bar-wrap .progress-track { flex: 1; }
.pct-bar-wrap span { width: 40px; text-align: right; color: var(--fg-muted); font-size: 12px; }

/* ── Toolbar / filters ────────────────────────────────────── */

.toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; max-width: 1600px; }
.toolbar-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar.toolbar-full { max-width: none; }

/* ── Modal (pop-up) ──────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(9,2,20,0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
/* While a pop-up is open the page behind it does not scroll (set by modal.js). */
body.modal-open { overflow: hidden; }
.modal-panel { width: 100%; max-width: 720px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 24px 64px rgba(0,0,0,0.45); }
.modal-panel.modal-wide { max-width: 920px; }
.modal-panel.modal-xxl { max-width: none; width: 80vw; }
/* Head and foot stay in view while the panel's body scrolls (the panel is the scroll container). */
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; background: var(--surface); }
.modal-title { font-weight: 700; font-family: var(--font-display); font-size: 16px; }
.modal-sub { margin-top: 3px; font-size: 12px; color: var(--fg-muted); }
.modal-close { border: 0; background: none; color: var(--fg-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--fg); }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; align-items: center; gap: 10px; position: sticky; bottom: 0; z-index: 2; background: var(--surface); }
.modal-foot::before { content: ''; position: absolute; inset: 0; background: var(--surface-soft); z-index: -1; }
.modal-foot { isolation: isolate; }

/* ── Tooltips (public/js/tooltip.js) ─────────────────────── */
.app-tip {
    position: fixed; z-index: 1000; max-width: 320px; pointer-events: none;
    opacity: 0; transform: translateY(4px); transition: opacity 0.12s ease, transform 0.12s ease;
}
.app-tip.is-visible { opacity: 1; transform: translateY(0); }
.app-tip.is-below { transform: translateY(-4px); }
.app-tip.is-below.is-visible { transform: translateY(0); }
.app-tip-body {
    background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong);
    border-radius: var(--radius); padding: 8px 11px; font-size: 12px; line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.app-tip-arrow {
    position: absolute; width: 10px; height: 10px; bottom: -5px; margin-left: -5px;
    background: var(--surface); border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong);
    transform: rotate(45deg);
}
.app-tip.is-below .app-tip-arrow { bottom: auto; top: -5px; transform: rotate(225deg); }
/* Rich tooltip content: a title line and rows of swatch · label · value. */
.tip-content { display: none; }
.app-tip .tip-title { font-weight: 700; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.app-tip .tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-tip .tip-row + .tip-row { margin-top: 3px; }
.app-tip .tip-row span { color: var(--fg-muted); flex: 1; }
.app-tip .tip-row b { font-variant-numeric: tabular-nums; }
.app-tip .tip-row.tip-total { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.app-tip .tip-row.tip-total span { color: var(--fg); font-weight: 600; }
.app-tip .tip-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }

/* Tabbladen boven de pagina-inhoud (planning) */
.page-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.page-tabs a { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--fg-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.page-tabs a:hover { color: var(--fg); background: rgba(255,255,255,0.04); }
.page-tabs a.active { color: var(--fg-accent); border-bottom-color: var(--fg-accent); }
.filter-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-label { display: flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 13px; }

.multiselect { position: relative; display: inline-block; }
.multiselect-toggle {
    padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: rgba(255,255,255,0.045); color: var(--fg); cursor: pointer; font-size: 13px; min-width: 160px; text-align: left;
}
.multiselect-panel {
    display: none; position: absolute; z-index: 10; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px; margin-top: 4px; box-shadow: var(--shadow-md); min-width: 200px;
}
.multiselect-panel.open { display: block; }
.multiselect-panel label { display: flex; align-items: center; gap: 6px; padding: 5px 4px; white-space: nowrap; cursor: pointer; font-size: 13px; }

/* ── Charts ───────────────────────────────────────────────── */

.chart-card canvas { max-height: 340px; cursor: pointer; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--fg-muted); flex-wrap: wrap; }
.chart-legend .swatch { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-legend .line { width: 14px; height: 2px; display: inline-block; }
.chart-legend .dashed { width: 14px; height: 0; border-top: 2px dashed var(--efficient-red); display: inline-block; }

/* Active filters under a toolbar: one chip per filter with a cross, plus a reset. */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 16px; font-size: 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: inherit; text-decoration: none; }
.filter-chip b { color: var(--fg-muted); font-weight: 700; }
.filter-chip:hover { border-color: #ff5c93; text-decoration: none; }
.filter-chip:hover b { color: #ff5c93; }
.filter-chip-reset { border-style: dashed; color: var(--fg-muted); }
.filter-banner {
    display: none; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(124,147,255,0.08);
    border: 1px solid rgba(124,147,255,0.3); border-radius: var(--radius); padding: 10px 14px; font-size: 13px;
}
.filter-banner.actief { display: flex; }
.filter-banner button {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 4px 10px;
    background: var(--innovate-green-20); color: var(--innovate-green); border: 1px solid rgba(60,244,179,0.3);
    border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.filter-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-summary .item { padding: 2px 8px; border-radius: 999px; font-size: 12px; color: var(--communicate-blue); font-weight: 600; }
.filter-summary .item.productief { background: var(--innovate-green); }
.filter-summary .item.intern { background: #7C93FF; color: var(--future-white); }
.filter-summary .item.verlof { background: rgba(255,255,255,0.5); }
.filter-summary .item.omzet { background: var(--future-white); }
.filter-summary .item.percentage { background: rgba(255,255,255,0.5); }

td.omschrijving { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-muted); }

/* ── simple-datatables dark-theme overrides ──────────────────
   The library ships its own light-theme stylesheet; these overrides
   restyle its generated markup (search box, pagination, info text)
   to match the dark design system. ─────────────────────────── */

.datatable-top, .datatable-bottom { color: var(--fg-muted); font-size: 12px; }
.datatable-search input, .datatable-selector {
    background: rgba(255,255,255,0.045); border: 1px solid var(--border-strong); border-radius: var(--radius);
    color: var(--fg); font-size: 13px; padding: 7px 10px;
}
.datatable-selector option { background: var(--surface); color: var(--fg); }
.datatable-info { color: var(--fg-subtle); }
.datatable-pagination a, .datatable-pagination button {
    color: var(--fg-muted); border: 1px solid var(--border) !important; background: transparent !important;
}
.datatable-pagination li.active a, .datatable-pagination a:hover {
    background: var(--innovate-green) !important; color: var(--communicate-blue) !important; border-color: var(--innovate-green) !important;
}
.datatable-pagination li.datatable-disabled a { color: var(--fg-subtle); opacity: 0.5; }
.datatable-table th { color: var(--fg-muted); }
.datatable-sorter::before, .datatable-sorter::after { opacity: 0.5; }
.datatable-empty { color: var(--fg-muted); }

/* ── Flash messages ───────────────────────────────────────── */

.flash { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; border: 1px solid transparent; }
.flash-success { background: rgba(60,244,179,0.12); color: var(--innovate-green); border-color: rgba(60,244,179,0.3); }
.flash-error   { background: rgba(235,0,82,0.12); color: #ff5c93; border-color: rgba(235,0,82,0.3); }
.flash-warning { background: rgba(250,204,21,0.12); color: #f5cf4d; border-color: rgba(250,204,21,0.35); }
:root[data-theme="light"] .flash-warning { background: rgba(202,138,4,0.12); color: #92610a; border-color: rgba(202,138,4,0.40); }

/* ── Status-based table rows (budget, margin) ────────────── */

table.data-table tbody tr.status-under, table.data-table tbody tr.status-success { background: rgba(60,244,179,0.05); }
table.data-table tbody tr.status-warning { background: rgba(250,204,21,0.05); }
table.data-table tbody tr.status-over, table.data-table tbody tr.status-danger { background: rgba(235,0,82,0.06); }
table.data-table tbody tr.status-no_budget { background: rgba(255,255,255,0.02); }

.fill-under, .fill-success { background: var(--innovate-green); }
.fill-warning { background: var(--warning); }
.fill-over, .fill-danger { background: var(--efficient-red); }

.kpi-card.status-under, .kpi-card.status-success { border-left: 4px solid var(--innovate-green); }
.kpi-card.status-warning { border-left: 4px solid var(--warning); }
.kpi-card.status-over, .kpi-card.status-danger { border-left: 4px solid var(--efficient-red); }

/* ── Forms ────────────────────────────────────────────────── */

.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.form-group textarea { resize: vertical; min-height: 60px; width: 320px; }

/* ── Misc ─────────────────────────────────────────────────── */

table.data-table .separator { border-left: 2px solid var(--border-strong); }
table.data-table th[title] { cursor: help; border-bottom: 1px dashed var(--fg-subtle); }
table.data-table thead tr.subheader th { background: rgba(255,255,255,0.03); }
table.data-table thead tr.subheader th.totals-header { background: rgba(60,244,179,0.08); }

.details-box { margin-bottom: 16px; font-size: 13px; color: var(--fg-muted); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; background: var(--surface); }
.details-box summary { cursor: pointer; font-weight: 600; color: var(--fg); }
.details-box dl { margin: 10px 0 0; display: grid; grid-template-columns: 160px 1fr; gap: 4px 16px; }

/* ── OHW age buckets / facturability bars ────────────────── */

.age-bars { display: flex; gap: 4px; }
.age-bar { height: 10px; border-radius: 3px; min-width: 4px; }
.bar-0-30  { background: var(--innovate-green); }
.bar-31-60 { background: var(--warning); }
.bar-61-90 { background: #FB923C; }
.bar-90p   { background: var(--efficient-red); }

/* ── Capacity planning grid ───────────────────────────────── */

table.capacity-table td.capacity-cell { padding: 8px 10px; vertical-align: top; border-left: 1px solid var(--border); min-width: 160px; }
td.occupancy-cell { min-width: 130px; }
.occupancy-figures { font-size: 12px; margin-bottom: 3px; }
.planning-chip {
    padding: 5px 8px; border-radius: 8px; margin-bottom: 4px; min-height: 60px; box-sizing: border-box;
    background: rgba(255,255,255,0.09); border: 1px solid var(--border-strong); border-top: 3px solid var(--fg-subtle);
    color: var(--fg);
}
.planning-chip:last-child { margin-bottom: 0; }
.planning-chip .title { font-weight: 500; font-size: 11px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning-chip .client { font-size: 10px; line-height: 13px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning-chip .hours { font-size: 13px; font-weight: 700; line-height: 16px; margin-top: 1px; }
.planning-chip .chip-meta { font-size: 10px; line-height: 14px; color: var(--fg-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-total {
    margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--border);
    font-size: 12px; font-weight: 700; color: var(--fg); text-align: right;
}

table.capacity-table tfoot .row-total td { border-top: 2px solid var(--border-strong); background: rgba(255,255,255,0.03); padding: 11px 16px; }

/* Chip-kleuren per project (kleur = crc32(projectId) % 8, zie CapacityPlanningService) */
.chip-c0 { border-left-color: #38BDF8; background: rgba(56,189,248,0.12); }
.chip-c1 { border-left-color: #A78BFA; background: rgba(167,139,250,0.12); }
.chip-c2 { border-left-color: #F472B6; background: rgba(244,114,182,0.12); }
.chip-c3 { border-left-color: #FB923C; background: rgba(251,146,60,0.12); }
.chip-c4 { border-left-color: #60A5FA; background: rgba(96,165,250,0.12); }
.chip-c5 { border-left-color: #2DD4BF; background: rgba(45,212,191,0.12); }
.chip-c6 { border-left-color: #C084FC; background: rgba(192,132,252,0.12); }
.chip-c7 { border-left-color: #FB7185; background: rgba(251,113,133,0.12); }

/* ── Light mode ───────────────────────────────────────────────
   Opt-in via <html data-theme="light">. Keeps the dark sidebar
   (brand rail) and lightens the content area by overriding the
   semantic tokens. */
:root[data-theme="light"] {
    --bg:            #EEF0F4;
    --surface:       #FFFFFF;
    --surface-soft:  #E7E9F0;
    --border:        rgba(24, 6, 47, 0.12);
    --border-strong: rgba(24, 6, 47, 0.38);
    --fg:            #18062F;
    --fg-muted:      rgba(24, 6, 47, 0.62);
    --fg-subtle:     rgba(24, 6, 47, 0.42);
}
/* Topbar uses --bg in a gradient; give it a solid light surface instead. */
:root[data-theme="light"] .topbar {
    background: #EEF0F4;
}
/* Keep the sidebar the original solid purple (not washed out on a light body). */
:root[data-theme="light"] .sidebar {
    background: var(--communicate-blue);
    border-right-color: rgba(255, 255, 255, 0.10);
}
:root[data-theme="light"] .sidebar .cockpit-label,
:root[data-theme="light"] .sidebar .sidebar-section-label {
    color: rgba(255, 255, 255, 0.55);
}
/* Sidebar stays dark, so keep nav text/hover light (not the dark --fg). */
:root[data-theme="light"] .sidebar .nav-link,
:root[data-theme="light"] .sidebar .nav-link:hover {
    color: var(--future-white-80);
}
:root[data-theme="light"] .sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}
/* Chip background reads better on light cards. */
:root[data-theme="light"] .planning-chip {
    background: rgba(24, 6, 47, 0.06);
    border-color: rgba(24, 6, 47, 0.16);
}
/* Zebra striping in light mode (class applied by JS to visible rows). */
:root[data-theme="light"] .planning-grid tbody tr.zebra > td {
    background: rgba(24, 6, 47, 0.035);
}
/* Badges need darker text/stronger fills to stay legible on light surfaces. */
:root[data-theme="light"] .badge-warning { background: rgba(202, 138, 4, 0.16); color: #92610a; border-color: rgba(202, 138, 4, 0.40); }
:root[data-theme="light"] .badge-success { background: rgba(60, 244, 179, 0.22); color: var(--communicate-blue); border-color: rgba(60, 244, 179, 0.5); }
:root[data-theme="light"] .badge-danger  { background: rgba(190, 18, 60, 0.12); color: #be123c; border-color: rgba(190, 18, 60, 0.35); }
:root[data-theme="light"] .badge-purple  { background: rgba(124, 58, 173, 0.14); color: #6b21a8; border-color: rgba(124, 58, 173, 0.35); }
:root[data-theme="light"] .badge-muted   { background: rgba(24, 6, 47, 0.06); color: var(--fg-muted); border-color: var(--border); }
/* Mint-on-mint is unreadable on light; keep brand green (Innovate Green) as the
   fill with dark brand text, like the primary button. */
:root[data-theme="light"] .btn-outline-green { background: rgba(60, 244, 179, 0.22); color: var(--communicate-blue); border-color: rgba(60, 244, 179, 0.55); }
/* Brand mint is unreadable on white — use the brand purple for links in light
   mode. Exclude .btn so button variants keep their own colour. */
:root[data-theme="light"] a:not(.btn) { color: #7C3AAD; }
:root[data-theme="light"] a:not(.btn):hover { color: #581C87; }
/* Mint accent text is unreadable on white; use a deeper readable green. */
:root[data-theme="light"] .accent { color: #0E9E70; }
/* Theme toggle button. */
#theme-toggle {
    border: 1px solid var(--border-strong); background: transparent; color: var(--fg);
    border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── Print / PDF export ─────────────────────────────────────
   "Exporteer PDF" prints the page; the browser's print dialog saves it as PDF.
   Light colours on white paper, no navigation or controls, one column. */
.print-only { display: none; }
@media print {
    :root, :root[data-theme="dark"] {
        --bg: #FFFFFF; --surface: #FFFFFF; --surface-soft: #F1F2F6;
        --border: rgba(24, 6, 47, 0.18); --border-strong: rgba(24, 6, 47, 0.38);
        --fg: #18062F; --fg-muted: rgba(24, 6, 47, 0.62); --fg-subtle: rgba(24, 6, 47, 0.45);
        --shadow-sm: none; --shadow-md: none;
    }
    @page { size: A4 landscape; margin: 12mm; }
    html, body { background: #FFFFFF !important; color: var(--fg); }
    .app-shell { display: block; }
    .sidebar, .topbar-meta, .toolbar, .filter-bar, .filter-banner, .filter-form, .page-tabs,
    .btn, button, .segmented, .details-box, .datatable-top, .datatable-bottom, .note-text .badge { display: none !important; }
    main { display: block !important; }
    .topbar { position: static; padding: 0 0 8mm; border-bottom: 1px solid var(--border); background: none !important; }
    .topbar h1 { font-size: 22pt; }
    .topbar-sub { white-space: normal; overflow: visible; }
    .page-content { padding: 6mm 0 0; gap: 6mm; display: block; }
    .print-only { display: block; font-size: 10pt; color: var(--fg-muted); margin: 0 0 4mm; }
    .card, .kpi-card { box-shadow: none !important; border: 1px solid var(--border); background: #FFFFFF !important; break-inside: avoid; }
    .kpi-section { break-inside: avoid; margin-bottom: 5mm; }
    .kpi-grid { gap: 3mm; }
    .kpi-grid > .kpi-card { padding: 3mm 3.5mm; }
    .kpi-grid .kpi-value { font-size: 15pt; line-height: 1.2; }
    .kpi-grid .kpi-klein .kpi-value { font-size: 12pt; }
    .kpi-label { font-size: 8pt; margin-bottom: 2mm; }
    .kpi-sub { font-size: 7pt; }
    .kpi-section-title { font-size: 11pt; }
    .kpi-section-sub { font-size: 8pt; }
    .card-header { padding: 3mm 4mm; }
    .card-title { font-size: 11pt; }
    .data-table { font-size: 8pt; }
    .data-table th, .data-table td { padding: 1.2mm 2mm; }
    .data-table tr { break-inside: avoid; }
    .data-table thead { display: table-header-group; }
    .chart-card { height: 75mm; position: relative; }
    .chart-card canvas { max-width: 100% !important; max-height: 70mm !important; }
    a { color: inherit; text-decoration: none; }
    a[href]::after { content: none; }
    details { break-inside: avoid; }
    details:not([open]) { display: none; }
}

