/* =====================================================================
   AIM-Robotics klantportaal
   Huisstijl van de homepage (site/site.css): navy #0A1628, primair #0B1993,
   accent #428FE7, DINosaur. Tekstkleuren halen minimaal WCAG AA.
   Geen externe bronnen: de pagina's draaien onder een strikte CSP.
   ===================================================================== */

@font-face {
    font-family: 'DINosaur';
    src: url('/site/fonts/DINosaur-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DINosaur';
    src: url('/site/fonts/DINosaur-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --navy-950: #070F1F;
    --navy-900: #0A1628;
    --navy-800: #13233D;
    --primary: #0B1993;
    --primary-hover: #1A2BB5;
    --accent: #428FE7;
    --accent-text: #1D5FB8;
    --accent-on-dark: #8CB8F2;

    --ink: #0F172A;
    --text: #334155;
    --muted: #475569;
    --faint: #64748B;
    --line: #E2E8F0;
    --line-strong: #CBD5E1;
    --field: #7C8BA1;
    --tint: #F4F7FB;
    --surface: #FFFFFF;

    --ok: #047857;      --ok-bg: #ECFDF5;
    --warn: #B45309;    --warn-bg: #FFFBEB;
    --bad: #B91C1C;     --bad-bg: #FEF2F2;
    --info: #1D5FB8;    --info-bg: #EFF6FF;
    --neutral: #475569; --neutral-bg: #F1F5F9;

    --radius-lg: 16px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
    --shadow-md: 0 14px 34px -16px rgba(15, 23, 42, .22);
    --font: 'DINosaur', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --sidebar: 264px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--tint);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--accent-text); }
a:hover { color: var(--primary); }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

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

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 100;
    padding: 10px 16px; border-radius: 10px;
    background: var(--primary); color: #fff; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.icon {
    width: 1.15em; height: 1.15em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- knoppen ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    min-height: 44px; padding: 0 18px;
    border: 1px solid transparent; border-radius: 10px;
    font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn--danger { background: var(--bad); color: #fff; }
.btn--ghost { background: transparent; color: var(--accent-text); padding: 0 10px; }
.btn--ghost:hover { background: var(--info-bg); }
.btn--small { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .spinner { width: 1em; height: 1em; }

.spinner {
    display: inline-block; width: 22px; height: 22px;
    border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: draai .8s linear infinite;
}
@keyframes draai { to { transform: rotate(360deg); } }

/* ---------- formulieren ---------- */
.field { display: grid; gap: 6px; }
.field + .field, .field + .row, .row + .field { margin-top: 16px; }
/* Naast elkaar: de gap van het grid geeft de ruimte, ook onder elkaar op mobiel */
.grid-2 > .field + .field { margin-top: 0; }
.grid-2 > .field { align-content: start; }
.field label, .label { font-weight: 700; color: var(--ink); font-size: .92rem; }
.field .hint { color: var(--faint); font-size: .85rem; }
.input, .select, .textarea {
    width: 100%; min-height: 46px; padding: 10px 14px;
    border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66, 143, 231, .25); }
.input[readonly] { background: var(--tint); color: var(--muted); }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 48px; }
.password-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: 0; background: none; color: var(--faint); cursor: pointer; border-radius: 8px;
}
.password-toggle:hover { color: var(--primary); }

.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.choice {
    position: relative; display: block; padding: 14px 16px 14px 44px;
    border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; cursor: pointer;
}
.choice input { position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; accent-color: var(--primary); }
.choice strong { display: block; color: var(--ink); }
.choice span { color: var(--muted); font-size: .88rem; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; background: #F7F8FF; }
.choice--urgent:has(input:checked) { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad) inset; background: var(--bad-bg); }

/* ---------- meldingen ---------- */
.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; border-radius: var(--radius); border: 1px solid;
    font-size: .95rem;
}
.alert .icon { margin-top: 2px; }
.alert--error { background: var(--bad-bg); border-color: #FECACA; color: var(--bad); }
.alert--ok { background: var(--ok-bg); border-color: #A7F3D0; color: var(--ok); }
.alert--info { background: var(--info-bg); border-color: #BFDBFE; color: var(--info); }
.alert--warn { background: var(--warn-bg); border-color: #FDE68A; color: var(--warn); }
.alert strong { color: inherit; }
.alert a { color: inherit; font-weight: 700; }

/* =====================================================================
   INLOGGEN EN WACHTWOORD
   ===================================================================== */
.auth {
    min-height: 100vh; min-height: 100dvh;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: #fff;
}
.auth-main { display: flex; flex-direction: column; padding: 32px clamp(20px, 6vw, 72px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-logo img { width: 150px; height: auto; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.auth-back:hover { color: var(--primary); }
.auth-form { width: 100%; max-width: 420px; margin: auto; padding: 48px 0; }
.auth-form h1 { margin-bottom: 8px; }
.auth-form .lead { color: var(--muted); margin-bottom: 28px; }
.auth-form .alert { margin-bottom: 20px; }
.auth-form form { display: grid; gap: 0; }
.auth-options { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 24px; flex-wrap: wrap; font-size: .92rem; }
.auth-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.auth-aside {
    position: relative; overflow: hidden;
    background: radial-gradient(120% 90% at 100% 0%, #16307A 0%, var(--navy-900) 55%, var(--navy-950) 100%);
    color: #CBD5E1; padding: clamp(32px, 6vw, 72px); display: flex; flex-direction: column; justify-content: center;
}
.auth-aside::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 40px 40px;
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { color: #fff; font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 12px; }
.auth-aside p { color: #CBD5E1; max-width: 460px; }
.auth-features { display: grid; gap: 18px; margin: 32px 0; max-width: 460px; }
.auth-features li { display: flex; gap: 14px; }
.auth-features .icon-badge { background: rgba(255,255,255,.08); color: var(--accent-on-dark); }
.auth-features strong { display: block; color: #fff; }
.auth-features span { font-size: .92rem; }
.auth-help { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; font-size: .92rem; display: grid; gap: 6px; max-width: 460px; }
.auth-help a { color: #fff; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.auth-help a:hover { color: var(--accent-on-dark); }

.icon-badge {
    display: inline-grid; place-items: center; flex: none;
    width: 40px; height: 40px; border-radius: 12px; background: var(--info-bg); color: var(--primary);
}
.icon-badge .icon { width: 20px; height: 20px; }

/* =====================================================================
   APP-LAYOUT
   ===================================================================== */
.app {
    min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr);
    background: linear-gradient(90deg, var(--navy-900) var(--sidebar), transparent var(--sidebar));
}

.sidebar {
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; gap: 20px;
    padding: 22px 16px; background: var(--navy-900); color: #CBD5E1;
    overflow-y: auto;
}
.sidebar-brand img { width: 132px; height: auto; margin: 4px 8px 0; }
.sidebar-client { margin: 0 8px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.06); }
.sidebar-client small { display: block; color: #94A3B8; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.sidebar-client strong { color: #fff; font-size: .98rem; }
.nav { display: grid; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 12px;
    min-height: 44px; padding: 0 12px; border-radius: 10px;
    color: #CBD5E1; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(66, 143, 231, .18); color: #fff; font-weight: 700; }
.nav a[aria-current="page"] .icon { color: var(--accent-on-dark); }
.nav .nav-count {
    margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
    display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700;
    background: var(--accent); color: #fff;
}
.nav .nav-lock { margin-left: auto; color: #64748B; }
.sidebar-cta { margin: 0 4px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.sidebar-help { padding: 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); font-size: .88rem; display: grid; gap: 6px; }
.sidebar-help strong { color: #fff; }
.sidebar-help a { color: #CBD5E1; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.sidebar-help a:hover { color: #fff; }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 0 8px; }
.sidebar-user .avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--primary); color: #fff; font-weight: 700; font-size: .9rem;
}
.sidebar-user a { color: #fff; text-decoration: none; font-weight: 700; font-size: .92rem; display: block; }
.sidebar-user button { border: 0; background: none; padding: 0; color: #94A3B8; font-size: .85rem; cursor: pointer; }
.sidebar-user button:hover { color: #fff; }

/* Meekijken vanuit het ERP: altijd zichtbaar bovenaan */
.meekijk-balk {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    max-width: 1120px; margin: 0 auto 20px; padding: 12px 16px;
    border: 1px solid #FDE68A; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn);
    box-shadow: var(--shadow-sm); font-size: .92rem;
}
.meekijk-balk > div { flex: 1 1 260px; }
.meekijk-balk strong { color: inherit; }
.meekijk-balk .btn { flex: none; }

.topbar { display: none; }
.main { min-width: 0; padding: clamp(20px, 3.5vw, 40px); }
.content { max-width: 1120px; margin: 0 auto; }

/* ---------- paginakop ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 6px; }
.page-head .eyebrow { display: block; color: var(--accent-text); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .92rem; margin-bottom: 14px; }
.backlink:hover { color: var(--primary); }

/* ---------- kaarten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: clamp(18px, 2.4vw, 24px); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 1.05rem; }
.card-head a { font-size: .9rem; font-weight: 700; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.stack { display: grid; gap: 20px; align-content: start; }
.grid-2 > aside, .grid-2 > form > aside, .grid-2 > .stack { align-self: start; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-title { font-size: 1.05rem; margin: 8px 0 12px; }
.card > .section-title { margin: 0; padding: 22px 24px 8px; }
.card-split { border-top: 1px solid var(--line); }
.card-split h3 { font-size: 1rem; margin-bottom: 4px; }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 24px; }
.tile {
    display: flex; gap: 14px; align-items: center; padding: 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
    transition: border-color .15s var(--ease), transform .15s var(--ease);
}
a.tile:hover { border-color: var(--accent); transform: translateY(-1px); color: inherit; }
.tile strong { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--ink); }
.tile span { color: var(--muted); font-size: .9rem; }
.tile .sub { display: block; color: var(--warn); font-size: .8rem; font-weight: 700; margin-top: 2px; }

/* Pagina achter de QR-sticker op een installatie: grote knoppen voor op de telefoon */
.machine-actions { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.action-tile {
    display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 18px 20px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
    transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.action-tile:hover { border-color: var(--accent); transform: translateY(-1px); color: inherit; }
.action-tile-text { flex: 1; min-width: 0; }
.action-tile-text strong { display: block; font-size: 1.1rem; color: var(--ink); }
.action-tile-text span { display: block; margin-top: 2px; color: var(--muted); font-size: .9rem; }
.action-tile-go { flex: none; color: var(--faint); }
.action-tile--alert { border-color: #FCA5A5; background: var(--bad-bg); }
.action-tile--alert .icon-badge { background: #FEE2E2; color: var(--bad); }

.welcome {
    display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap;
    padding: clamp(20px, 3vw, 28px); margin-bottom: 24px; border-radius: var(--radius-lg);
    background: radial-gradient(120% 140% at 100% 0%, #16307A 0%, var(--navy-900) 60%);
    color: #CBD5E1;
}
.welcome h1 { color: #fff; }
.welcome p { margin-top: 6px; }
.welcome .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome .btn--secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.welcome .btn--secondary:hover { background: rgba(255,255,255,.14); color: #fff; border-color: #fff; }

/* ---------- lijsten ---------- */
.list { display: grid; }
.list-item {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
    padding: 14px 24px; border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--tint); color: inherit; }
.list-item .title { color: var(--ink); font-weight: 700; }
.list-item .meta { color: var(--faint); font-size: .88rem; grid-column: 1; }
.list-item .side { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 10px; text-align: right; }
.list-empty { padding: 20px 24px; color: var(--faint); }

/* ---------- tabellen ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--tint); }
.table a.rowlink { color: var(--ink); font-weight: 700; text-decoration: none; }
.table a.rowlink:hover { color: var(--primary); text-decoration: underline; }
.table .muted { color: var(--faint); font-size: .88rem; }

/* ---------- labels ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap;
    background: var(--neutral-bg); color: var(--neutral);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--plain::before { display: none; }

/* ---------- feitenlijst ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px 24px; }
.facts dt { color: var(--faint); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.facts dd { margin: 4px 0 0; color: var(--ink); font-weight: 700; }
.facts dd small { display: block; color: var(--faint); font-weight: 500; }

/* ---------- voortgang ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; }
.project-card { display: grid; gap: 14px; padding: 20px 24px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.project-card:first-child { border-top: 0; }
a.project-card:hover { background: var(--tint); color: inherit; }
.project-card .head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.project-card .head h3 { font-size: 1.05rem; }
.project-card .code { color: var(--faint); font-size: .85rem; font-weight: 500; margin-left: 6px; }
.project-card .stats { display: flex; gap: 8px 24px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.project-card .stats b { color: var(--ink); }

/* ---------- planning (Gantt op hoofdlijnen) ---------- */
.gantt-wrap { overflow-x: auto; }
.gantt { --label: 190px; min-width: 700px; position: relative; font-size: .88rem; }
.gantt-scale { display: grid; grid-template-columns: var(--label) 1fr; border-bottom: 1px solid var(--line); }
.gantt-months { position: relative; height: 42px; }
.gantt-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); padding: 4px 6px 0; color: var(--faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; }
.gantt-row { display: grid; grid-template-columns: var(--label) 1fr; align-items: center; min-height: 44px; border-bottom: 1px dashed var(--line); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-label { padding-right: 12px; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-label small { display: block; color: var(--faint); font-weight: 500; font-size: .78rem; }
.gantt-track { position: relative; height: 44px; }
.gantt-bar {
    position: absolute; top: 12px; height: 20px; border-radius: 6px; min-width: 6px;
    background: var(--accent); box-shadow: inset 0 0 0 1px rgba(11, 25, 147, .15);
}
.gantt-bar--done { background: #94A3B8; }
.gantt-bar--active { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.gantt-bar--planned { background: #BFD6F6; box-shadow: inset 0 0 0 1px #8CB8F2; }
.gantt-bar--nodate { background: repeating-linear-gradient(45deg, #E2E8F0, #E2E8F0 6px, #F1F5F9 6px, #F1F5F9 12px); left: 0; right: 0; }
.gantt-milestone {
    position: absolute; top: 14px; width: 16px; height: 16px; margin-left: -8px;
    transform: rotate(45deg); border-radius: 3px; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--primary);
}
.gantt-milestone--done { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.gantt-body { position: relative; }
.gantt-overlay { position: absolute; inset: 0; display: grid; grid-template-columns: var(--label) 1fr; pointer-events: none; z-index: 2; }
.gantt-overlay-track { position: relative; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--bad); }
.gantt-today span { position: absolute; top: -17px; left: 4px; font-size: .68rem; font-weight: 700; color: var(--bad); text-transform: uppercase; background: #fff; padding: 0 3px; }
.gantt-legend .legend-diamond { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: var(--primary); }
.gantt-legend i.gantt-bar--done, .gantt-legend i.gantt-bar--active, .gantt-legend i.gantt-bar--planned { box-shadow: none; }
.gantt-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: .85rem; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }

/* Onderliggende fases, als AIM voor een project een dieper detailniveau heeft gekozen */
.gantt-row--sub { min-height: 38px; }
.gantt-row--sub .gantt-track { height: 38px; }
.gantt-row--sub .gantt-label { font-weight: 600; font-size: .82rem; color: var(--muted); }
.gantt-row--sub .gantt-bar { top: 12px; height: 14px; border-radius: 4px; }
.gantt-row--n2 .gantt-label { padding-left: 16px; }
.gantt-row--n3 .gantt-label { padding-left: 30px; }
.gantt-row--n4 .gantt-label { padding-left: 44px; }
.row--n2 { --inspring: 18px; }
.row--n3 { --inspring: 34px; }
.row--n4 { --inspring: 50px; }
.row--sub td { padding-top: 9px; padding-bottom: 9px; font-size: .9rem; }
.row--sub td:first-child { padding-left: calc(16px + var(--inspring)); color: var(--muted); }

.milestones { display: grid; gap: 0; }
.milestone { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 24px; border-top: 1px solid var(--line); }
.milestone:first-child { border-top: 0; }
.milestone .dot { width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px; background: var(--primary); margin-left: 6px; }
.milestone--done .dot { background: var(--ok); }
.milestone--done .name { color: var(--muted); }
.milestone .name { color: var(--ink); font-weight: 700; }
.milestone .when { color: var(--faint); font-size: .9rem; text-align: right; }

/* ---------- gesprek bij een melding ---------- */
.thread { display: grid; gap: 14px; }
.msg { max-width: min(640px, 88%); padding: 12px 16px; border-radius: 14px; background: var(--tint); border: 1px solid var(--line); }
.msg--aim { justify-self: start; background: var(--info-bg); border-color: #BFDBFE; }
.msg--me { justify-self: end; background: #fff; }
.msg header { display: flex; gap: 10px; justify-content: space-between; font-size: .8rem; color: var(--faint); margin-bottom: 4px; }
.msg header strong { color: var(--ink); }
.msg p { white-space: pre-wrap; color: var(--text); overflow-wrap: anywhere; }
/* Verloop van een melding: statusstappen tussen de berichten en de soort update */
.tl-status { display: flex; align-items: center; gap: 8px; justify-self: center; padding: 4px 12px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); font-size: .8rem; color: var(--faint); }
.tl-status strong { color: var(--ink); }
.tl-status .icon { width: 14px; height: 14px; }
.tl-tijd { color: var(--faint); }
.soort { display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 6px; padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #fff; color: var(--info); border: 1px solid #BFDBFE; }
.soort .icon { width: 12px; height: 12px; }
.soort--onderzoek { color: #0E7490; border-color: #A5F3FC; }
.soort--volgende_stap { color: var(--warn); border-color: #FDE68A; }
.soort--oplossing { color: var(--ok); border-color: #A7F3D0; }
.soort--vraag { color: var(--bad); border-color: #FECACA; }
.stand { border-color: #BFDBFE; }
.stand h2 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.stand .facts dd { font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.stand-breed { grid-column: span 2; }

.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photo { position: relative; width: 112px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--tint); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button {
    position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
    border: 0; background: rgba(15, 23, 42, .7); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.photo-add {
    width: 112px; height: 84px; border-radius: 10px; border: 1.5px dashed var(--field); background: #fff;
    color: var(--muted); display: grid; place-items: center; text-align: center; font-size: .8rem; cursor: pointer;
}
.photo-add:hover { border-color: var(--primary); color: var(--primary); }
.photo-add .icon { width: 22px; height: 22px; margin: 0 auto 2px; }
a.photo:hover { border-color: var(--accent); }
button.photo--open { padding: 0; cursor: zoom-in; }
button.photo--open:hover { border-color: var(--accent); }
/* Venster bij een factuur: akkoord, vraag of afwijzen */
.sheet {
    width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto;
    border: 0; border-radius: var(--radius-lg); padding: 28px 24px 24px; box-shadow: var(--shadow-md); color: var(--text);
}
.sheet::backdrop { background: rgba(7, 15, 31, .55); }
.sheet h2 { font-size: 1.5rem; color: var(--ink); }
.sheet h2 small { font-size: .9rem; font-weight: 400; }
.sheet .eyebrow { display: block; color: var(--accent-text); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.sheet-close {
    position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 10px;
    background: var(--tint); color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.factuur-acties { justify-content: flex-end; flex-wrap: nowrap; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; overflow: visible; }
.lightbox::backdrop { background: rgba(7, 15, 31, .82); }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px; }
.lightbox-close {
    position: absolute; top: -18px; right: -18px; width: 40px; height: 40px; border-radius: 50%; border: 0;
    background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-md);
}

/* ---------- bestelstappen ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.step { position: relative; padding-top: 22px; color: var(--faint); font-size: .85rem; font-weight: 700; }
.step::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--line); }
.step--done { color: var(--ok); }
.step--done::before { background: var(--ok); }
.step--current { color: var(--primary); }
.step--current::before { background: linear-gradient(90deg, var(--primary), var(--accent)); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--field); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { width: 36px; height: 38px; border: 0; background: var(--tint); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.qty button:hover { background: var(--info-bg); color: var(--primary); }
.qty input { width: 52px; height: 38px; border: 0; text-align: center; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart { position: sticky; top: 24px; }
.cart-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.cart-line:last-child { border-bottom: 0; }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; color: var(--ink); padding-top: 12px; }

/* ---------- leeg, laden, vergrendeld ---------- */
.empty { text-align: center; padding: clamp(28px, 5vw, 48px) 24px; color: var(--muted); }
.empty .icon-badge { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 14px; }
.empty .icon-badge .icon { width: 26px; height: 26px; }
.empty h2 { margin-bottom: 8px; }
.empty p { max-width: 520px; margin: 0 auto; }
.empty .btn { margin-top: 18px; }
.locked .icon-badge { background: var(--neutral-bg); color: var(--neutral); }

.loading { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 64px 0; color: var(--faint); }
.skeleton { background: linear-gradient(90deg, #EEF2F7 25%, #F8FAFC 50%, #EEF2F7 75%); background-size: 200% 100%; animation: glim 1.4s infinite; border-radius: 8px; }
@keyframes glim { to { background-position: -200% 0; } }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
    max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
    background: var(--navy-900); color: #fff; box-shadow: var(--shadow-md); font-size: .95rem;
}

.note { color: var(--faint); font-size: .88rem; }
.noscript { padding: 24px; max-width: 640px; }
.voorlader { min-height: 100vh; display: grid; place-items: center; color: var(--faint); }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Storing opgelost: de klant bevestigt of heropent */
.bevestig { margin-top: 16px; border-color: #A7F3D0; background: var(--ok-bg); }
.bevestig h2 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; color: var(--ok); }
.bevestig-label { margin-top: 12px; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bevestig-tekst { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.bevestig--klaar { background: var(--surface); border-color: var(--line); }
.bevestig--klaar h2 { color: var(--ink); }
.actions-row--center { justify-content: center; }

/* =====================================================================
   RESPONSIEF
   ===================================================================== */
/* ---------- bellen ---------- */
.topbar-call { display: none; }
.sidebar-help .sidebar-emergency { color: #fff; font-weight: 700; }
.callout {
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
    padding: 16px 20px; border: 1px solid #BFDBFE; border-radius: var(--radius-lg); background: var(--info-bg);
}
.callout-icon {
    width: 44px; height: 44px; flex: none; display: grid; place-items: center;
    border-radius: 12px; background: var(--surface); color: var(--primary);
}
.callout-body { flex: 1 1 260px; min-width: 0; }
.callout-body strong { color: var(--ink); }
.callout-body p { color: var(--muted); margin-top: 2px; font-size: .92rem; }
.callout-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- ondertekenen, afwijzen, vragen ---------- */
.decision { display: grid; gap: 14px; }
.decision-form {
    display: grid; gap: 14px; padding: 18px;
    border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--tint);
}
.decision-form[hidden] { display: none; }
.decision-form h3 { font-size: 1rem; }
.choice-list { display: grid; gap: 8px; margin-top: 8px; }
.tile--attention { border-color: #FCD34D; background: var(--warn-bg); }
.row-muted td { color: var(--faint); }
.row-muted strong { color: var(--muted); }

/* ---------- video's en foto's bij berichten ---------- */
.video-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.video { margin: 0; display: grid; gap: 8px; align-content: start; }
.video video { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--navy-900); }
.video-link {
    display: grid; place-items: center; align-content: center; gap: 6px; aspect-ratio: 16 / 9;
    border-radius: var(--radius); background: var(--navy-900); color: #fff; text-decoration: none; font-weight: 700;
}
.video-link:hover { background: var(--navy-800); color: #fff; }
.video-link .icon { width: 40px; height: 40px; }
.video figcaption { display: grid; gap: 2px; }
.video figcaption span { color: var(--muted); font-size: .9rem; }
.msg .photos { margin-top: 10px; }
.photos--small .photo { width: 84px; height: 64px; }

@media (max-width: 1100px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .app { grid-template-columns: minmax(0, 1fr); background: none; }
    .topbar {
        position: sticky; top: 0; z-index: 30;
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        height: 60px; padding: 0 16px; background: var(--navy-900);
    }
    .topbar img { width: 110px; height: auto; }
    .meekijk-balk { position: static; }
    .topbar-call {
        display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
        height: 44px; padding: 0 14px; border-radius: 10px;
        background: var(--primary); color: #fff; text-decoration: none; font-weight: 700;
    }
    .topbar-call:hover { background: var(--primary-hover); color: #fff; }
    .topbar button {
        width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff;
        display: grid; place-items: center; cursor: pointer;
    }
    .sidebar {
        position: fixed; inset: 60px 0 0 0; z-index: 25; height: auto;
        transform: translateX(-100%); transition: transform .25s var(--ease);
        visibility: hidden;
    }
    body.nav-open .sidebar { transform: none; visibility: visible; }
    body.nav-open { overflow: hidden; }
    .sidebar-brand { display: none; }
}

@media (max-width: 860px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-aside { padding: 32px 20px; }
    .auth-features { margin: 20px 0; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .cart { position: static; }
}

@media (max-width: 640px) {
    .stand-breed { grid-column: auto; }
    .main { padding: 20px 16px 32px; }
    .card-head, .list-item, .milestone, .project-card, .card > .section-title { padding-left: 16px; padding-right: 16px; }
    .table--stack thead { display: none; }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
    .table--stack tr:last-child { border-bottom: 0; }
    .table--stack td { padding: 2px 0; border: 0; }
    .table--stack td[data-label]::before { content: attr(data-label) ": "; color: var(--faint); font-size: .85rem; }
    .table--stack tr.row--sub { padding-left: calc(16px + var(--inspring)); }
    .table--stack .row--sub td, .table--stack .row--sub td:first-child { padding: 2px 0; }
    .table--stack td.num { text-align: left; }
    .steps { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
    .welcome .actions, .welcome .actions .btn { width: 100%; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .list-item { grid-template-columns: minmax(0, 1fr); }
    .list-item .side { grid-row: auto; grid-column: 1; justify-content: flex-start; text-align: left; flex-wrap: wrap; margin-top: 6px; }
    .msg { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
    .sidebar, .topbar, .btn, .skip-link { display: none !important; }
    .app { display: block; }
    body { background: #fff; }
    .card { box-shadow: none; }
}
