/* ============================================================
   Factuurverloop (29-09): band bovenaan Factuurintake met drie
   fasen en tegels, daaronder de lijst van de gekozen emmer en
   de factuurkaart. Bouwt op fiattering.css en factuurintake.css;
   alleen bestaande tokens, licht en donker via de tokens.
   ============================================================ */

.fv { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 16px); box-shadow: var(--shadow); }
.fv.is-dicht { padding: 8px 14px; }
.fv__kop { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fv__toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 0; border: 0; background: transparent; font: inherit; color: var(--text); cursor: pointer; }
.fv__toggle b { font-weight: 500; font-size: 14px; }
.fv__toggle em { font-style: normal; font-size: 12px; color: var(--text-2); }
.fv__toggle svg { color: var(--text-2); transition: transform .15s ease; }
.fv__uitleg { font-size: 12px; color: var(--text-2); line-height: 1.45; }

/* ---- fasen en tegels ---- */
.fv-fasen { display: grid; grid-template-columns: 2fr 2fr 4fr; gap: 14px; align-items: start; }
.fv-fase { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fv-fase .fi-blok__kop { display: flex; align-items: center; gap: 8px; }
.fv-fase .fi-blok__kop .fi-pil { text-transform: none; letter-spacing: 0; font-weight: 500; }
.fv-tegels { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.fv-tegel { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 76px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); font: inherit; color: var(--text); text-align: left; cursor: pointer; box-shadow: inset 0 2px 0 transparent; }
.fv-tegel b { font-weight: 500; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fv-tegel span { font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.fv-tegel i { font-style: normal; font-size: 11px; color: var(--text-2); line-height: 1.3; }
.fv-tegel:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.fv-tegel:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.fv-tegel.is-on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); box-shadow: inset 0 2px 0 var(--brand); }
.fv-tegel.is-leeg b { color: var(--text-3, var(--text-2)); }
.fv-tegel--wacht:not(.is-leeg) b { color: var(--amber-tekst); }
.fv-tegel--neg:not(.is-leeg) b { color: var(--signal); }
.fv-tegel--ok:not(.is-leeg) b { color: color-mix(in srgb, var(--brand) 80%, var(--text)); }

/* ---- lijst en kaart onder de tegels ---- */
.fv-onder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; padding-top: 12px; border-top: 1px solid var(--line); }
.fv-onder.is-gekozen { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); }
.fv-onder__lijst { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fv-onder__kaart { min-width: 0; position: sticky; top: 12px; }
.fv-onder__kop { display: flex; align-items: center; gap: 10px; }
.fv-onder__kop b { font-weight: 500; font-size: 14px; }
.fv-onder__kop span { font-size: 12px; color: var(--text-2); flex: 1; }

.fv-lijst { border: 1px solid var(--line); border-radius: 12px; overflow: clip; background: var(--surface); }
.fv-rij { width: 100%; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 96px minmax(0, 1.6fr); gap: 12px; align-items: center; padding: 10px 14px; 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; }
.fv-lijst > .fv-rij:first-child { border-top: 0; }
.fv-rij--kop { padding: 7px 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); background: var(--bg-2); cursor: default; }
.fv-rij:not(.fv-rij--kop):hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.fv-rij.is-actief { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand); }
.fv-rij:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fv-cel { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fv-cel b { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.fv-cel i { font-style: normal; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fv-cel--geld b, .fv-cel--geld i { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fv-l { display: none; }
.fv-stand { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.fv-stand b { font-weight: 500; font-size: 12.5px; line-height: 1.35; }
.fv-stand i { font-style: normal; font-size: 11.5px; color: var(--text-2); }

/* ---- smal ---- */
@media (max-width: 1200px) {
  .fv-fasen { grid-template-columns: 1fr 1fr; }
  .fv-fase--exact { grid-column: 1 / -1; }
  .fv-onder.is-gekozen { grid-template-columns: minmax(0, 1fr); }
  .fv-onder__kaart { position: static; }
  .fv-onder.is-gekozen .fv-onder__lijst { display: none; }
  .fv .fz-terug { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
  .fv .fi-kaart > .fi-sluit { display: none; }
}
@media (max-width: 760px) {
  .fv { padding: 12px 14px; }
  .fv-fasen { grid-template-columns: minmax(0, 1fr); }
  .fv-tegels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fv-tegel { min-height: 68px; }
  .fv-rij--kop { display: none; }
  .fv-rij { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px; }
  .fv-cel--wie, .fv-cel--stand { grid-column: 1 / -1; }
  .fv-l { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
  .fv-cel--dagen { align-items: flex-start; }
}
