/* ============================================================
   Fiattering intern (WP36): lijst links, factuurkaart rechts.
   Alleen bestaande tokens; licht en donker via de tokens.
   ============================================================ */

.fi { display: flex; flex-direction: column; gap: 14px; }
.fi .dash-head { margin-bottom: 2px; }
.fi-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.fi-seg .wl-chip em { font-style: normal; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; line-height: 18px; text-align: center; font-size: 11px; color: var(--text); background: var(--bg-2); }

.fi-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); gap: 16px; align-items: start; }
.fi-raster--vol { grid-template-columns: minmax(0, 1fr); }
.fi-links { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fi-rechts { position: sticky; top: 12px; min-width: 0; }
@media (max-width: 980px) { .fi-raster { grid-template-columns: minmax(0, 1fr); } .fi-rechts { position: static; } }


/* ---- lijst ---- */
.fi-lijst { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 16px); overflow: clip; box-shadow: var(--shadow); }
.fi-rij { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 18px; border: 0; border-top: 1px solid var(--line); background: transparent; font: inherit; color: var(--text); text-align: left; cursor: pointer; box-shadow: inset 3px 0 0 transparent; }
.fi-lijst > .fi-rij:first-child { border-top: 0; }
.fi-rij:hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.fi-rij.is-actief { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand); }
.fi-rij:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fi-rij__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fi-rij__t b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-rij__t i { font-style: normal; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-rij__r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }

.fi-pil { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); }
.fi-pil--ok { color: color-mix(in srgb, var(--brand) 70%, var(--text)); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.fi-pil--wacht { color: var(--amber-tekst); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.fi-pil--neg { color: var(--signal); background: var(--signal-soft); border-color: color-mix(in srgb, var(--signal) 30%, transparent); }
.fi-pillen { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- kaart ---- */
.fi-kaart { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 16px); box-shadow: var(--shadow); max-height: calc(100vh - 180px); overflow: auto; }
.fi-raster--vol .fi-kaart, .card .fi-kaart { max-height: none; }
.fi-kaart__kop { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-right: 72px; }
.fi-kaart__titel { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.3; color: var(--text); }
.fi-sluit { position: absolute; top: 14px; right: 14px; height: 28px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font: inherit; font-size: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.fi-sluit:hover { color: var(--text); border-color: var(--line-strong); }
.fi-velden { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 13px; }
.fi-velden dt { color: var(--text-2); }
.fi-velden dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fi-velden b { font-weight: 500; }

.fi-blok { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.fi-blok__kop { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.fi-noot, .fi-uitleg { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.fi-uitleg { padding-left: 10px; border-left: 2px solid var(--line-strong); }
.fi-fout { margin: 0; font-size: 12.5px; color: var(--signal); }

.fi-lagen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.fi-laag { position: relative; display: flex; gap: 10px; padding: 6px 0 10px; }
.fi-laag:not(:last-child)::after { content: ''; position: absolute; left: 11px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.fi-laag__stip { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); background: var(--bg-2); border: 1px solid var(--line-strong); }
.fi-laag--akkoord .fi-laag__stip { color: #fff; background: var(--brand); border-color: var(--brand); }
.fi-laag--afgekeurd .fi-laag__stip { color: #fff; background: var(--signal); border-color: var(--signal); }
.fi-laag--open .fi-laag__stip { color: var(--amber); border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
.fi-laag__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fi-laag__t b { font-size: 13px; font-weight: 500; color: var(--text); }
.fi-laag__t i { font-style: normal; font-size: 12px; color: var(--text-2); }
.fi-laag__t em { font-style: normal; font-size: 12px; color: var(--text); padding: 6px 9px; margin-top: 3px; border-radius: 8px; background: var(--bg-2); }

.fi-match { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fi-match span { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); }
.fi-match i { font-style: normal; font-size: 11px; color: var(--text-2); }
.fi-match b { font-size: 13px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.fi-vlaggen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text); }
.fi-vlaggen li { display: flex; align-items: center; gap: 6px; }
.fi-vlaggen svg { color: var(--amber); }

.fi-melding, .fi-klaar { margin: 0; display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: var(--text); }
.fi-melding { background: color-mix(in srgb, var(--amber) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line)); }
.fi-melding svg { color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.fi-melding.is-telaat { background: var(--signal-soft); border-color: color-mix(in srgb, var(--signal) 35%, var(--line)); }
.fi-melding.is-telaat svg { color: var(--signal); }
.fi-klaar { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.fi-klaar svg { color: var(--brand); flex-shrink: 0; margin-top: 1px; }

.fi-knoppen { display: flex; gap: 8px; flex-wrap: wrap; }
.fi-knoppen .btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; font-size: 13px; }
.fi-knoppen .btn[disabled] { opacity: .5; cursor: not-allowed; }
.fi-knop--neg { background: var(--signal); border-color: var(--signal); }

.fi-veld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.fi-veld > span, .fi-veld > label { font-weight: 500; color: var(--text); }
.fi-veld label span { display: block; font-weight: 400; color: var(--text-2); margin-top: 2px; }
.fi-veld input, .fi-veld select, .fi-veld textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; line-height: 1.45; }
.fi-veld textarea { resize: vertical; min-height: 60px; }
.fi-veld input:focus, .fi-veld select:focus, .fi-veld textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.fi-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.45; color: var(--text); }
.fi-check input { margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }

.fi-historie { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.fi-historie li { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; }
.fi-historie time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.fi-historie b { font-weight: 500; color: var(--text); }
.fi-historie span { color: var(--text-2); }
.fi-historie em { display: block; font-style: normal; color: var(--text); margin-top: 2px; }

/* ---- afwijkingen ---- */
.fi-mm__rij { border-top: 1px solid var(--line); }
.fi-mm__rij:first-child { border-top: 0; }
.fi-mm__rij.is-actief { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand); }
.fi-rij--plat { border-top: 0; }
.fi-mm__vraag { margin: 0 18px 8px; font-size: 12.5px; color: var(--text-2); }
.fi-mm__vraag b { color: var(--text); font-weight: 500; }
.fi-mm__actie { padding: 0 18px 12px; }

/* ---- registreren ---- */
.fi-form { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 16px); box-shadow: var(--shadow); }
.fi-twee { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- projectinstelling ---- */
.fi-pm { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 12px; font-size: 12.5px; color: var(--text-2); }
.fi-pm__schakel { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.fi-pm__schakel input { accent-color: var(--brand); }

.fi-naar { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* h69 slice 20: een retourbon toont reden, regels en creditnota volledig, ook op de telefoon */
.fi-rij--retour .fi-rij__t b,
.fi-rij--retour .fi-rij__t i { white-space: normal; overflow: visible; }
.fi-doc { gap: 8px; }
.fi-doc__kop { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fi-doc__pdf { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
