/*
  Fyxdo — Conceptfactuur: regels, regel aanpassen en toevoegen, totalen, betalen, wat nog nodig is, versturen.
  Laadvolgorde: brand/fonts/fonts.css → brand/tokens.css → brand/icons/icons.css
               → screens/auth/auth.css → screens/app/app.css → screens/klanten/klanten.css
               → screens/afspraken/afspraak.css → screens/diensten/diensten.css → screens/afspraken/detail.css
               → screens/bedrijf/bedrijf.css → screens/facturen/conceptfactuur.css
  Bouwt voort op Klant bekijken (fx-detail-head, fx-prop, fx-confirm, fx-tag), Klanten (fx-combo, fx-choice, fx-picked),
  Diensten (fx-money--suffix, fx-invoice-lines, fx-textarea--short, fx-archive--divided) en Nieuwe afspraak (fx-select).
  Alleen variabelen uit tokens.css. Geen gradiënten, geen schaduwen, geen inline stijl.

  Breed scherm: in de app @media (min-width: 768px). Hier een container query,
  zodat mobiel en breed in de referentie naast elkaar staan.
*/

/* ---------- Pagina: één kolom ---------- */
.fx-invoice-page { max-width: 720px; }
.fx-invoice-page > section + section { margin-top: var(--space-10); }

/* Prijsstand onder de sectietitel Regels */
.fx-section-title + .fx-section-lead { margin: calc(var(--space-1) * -1) 0 var(--space-2); }
.fx-section-lead + .fx-alert--inline { margin: 0 0 var(--space-3); }

/* ---------- Factuurregel: een knop over de hele breedte ---------- */
.fx-line {
  width: 100%;
  min-height: 56px;
  box-sizing: border-box;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  align-items: baseline;
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.fx-lines > .fx-line:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.fx-lines > .fx-line:last-child  { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.fx-lines > .fx-line:only-child  { border-radius: var(--radius-md); }
.fx-line:hover { background: var(--bg); }
.fx-line:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.fx-line-desc { grid-column: 1; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.fx-line-amount { grid-column: 2; font-size: 16px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-line-edit { grid-column: 3; grid-row: 1 / span 2; align-self: center; color: var(--text-muted); display: inline-flex; }
.fx-line-edit :is(.fx-ico, .fx-icon) { width: var(--size-icon-sm); height: var(--size-icon-sm); }
.fx-line-meta {
  grid-column: 1 / span 2;
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  font-size: 14px; line-height: 20px;   /* text-small */
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.fx-line-meta :is(.fx-ico, .fx-icon) { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* Lijn tussen regels (ook tussen een regel en een open formulier). Na .fx-line, die border: 0 zet. */
.fx-card.fx-lines > * + * { border-top: 1px solid var(--border); }

/* Regel toevoegen onder de kaart */
.fx-add { margin-top: var(--space-4); }
.fx-add .fx-btn { width: 100%; }

/* ---------- Regel aanpassen en toevoegen: formulier in de kaart ---------- */
.fx-line-form {
  margin: 0;
  padding: var(--space-4);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.fx-lines > .fx-line-form:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.fx-lines > .fx-line-form:last-child  { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.fx-lines > .fx-line-form:only-child  { border-radius: var(--radius-md); }
.fx-line-form h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.fx-line-form h3:focus { outline: none; }
.fx-line-form .fx-confirm-actions { margin-top: calc(var(--space-2) * -1); }

/* Vaste waarde in plaats van een veld (datum van een afspraakregel) */
.fx-static { margin: 0; font-size: 16px; line-height: 24px; color: var(--text); }

/* Uitkomst van de regel */
.fx-line-result {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px; line-height: 20px;
  font-variant-numeric: tabular-nums;
}
.fx-line-result strong { font-weight: 600; white-space: nowrap; }

/* Onder het formulier: naar de afspraak, ongedaan maken of verwijderen */
.fx-line-form-more {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}
.fx-line-form-more .fx-btn { width: auto; }
.fx-link--chevron { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--size-touch); }

/* Keuze over de volle breedte (Btw: 21% · 9% · Vrijgesteld) */
.fx-choice--fill { display: flex; align-self: stretch; }
.fx-choice--fill label { flex: 1 1 0; min-width: 0; padding: 0 var(--space-2); }

/* Omschrijving met dienstsuggesties: zonder zoekicoon (het is een gewoon tekstveld) */
.fx-combo--plain .fx-input { padding-left: var(--space-4); padding-right: var(--space-4); }

/* Naam van de klant als link, contactpersoon eronder zonder linkopmaak */
a.fx-prop dd.fx-prop-name { text-decoration: none; }
a.fx-prop dd.fx-prop-name > span { display: block; }
a.fx-prop dd.fx-prop-name > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
a.fx-prop dd.fx-prop-name > span + span { color: var(--text); }

/* ---------- Totaal ---------- */
.fx-totals { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }

/* ---------- Betalen ---------- */
.fx-pay { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }

/* ---------- Nog nodig om te versturen ---------- */
.fx-todo { margin: 0; }
.fx-todo > div { min-width: 0; flex: 1; }
.fx-todo ul { list-style: none; margin: var(--space-1) 0 calc(var(--space-2) * -1); padding: 0; }
.fx-todo li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.fx-todo li + li { border-top: 1px solid var(--border); }
.fx-todo a {
  min-height: var(--size-touch);
  display: inline-flex; align-items: center;
  color: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.fx-todo a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.fx-todo li > :is(.fx-ico, .fx-icon) { width: 16px; height: 16px; flex: none; }

/* ---------- Versturen ---------- */
.fx-send { gap: var(--space-4); }
.fx-send .fx-send-btn { width: 100%; }
.fx-send .fx-confirm { align-self: stretch; }

/* Samenvatting in de bevestiging */
.fx-summary { margin: 0; display: flex; flex-direction: column; }
.fx-summary > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4);
  padding: var(--space-2) 0;
  font-size: 14px; line-height: 20px;
}
.fx-summary > div + div { border-top: 1px solid var(--border); }
.fx-summary dt { color: var(--text-muted); }
.fx-summary dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Laadstaat van de kop */
.fx-skel-line--h1 { height: 28px; margin: var(--space-1) 0 var(--space-6); }

/* ---------- Breed scherm ---------- */
@container (min-width: 768px) {
  .fx-add .fx-btn, .fx-send .fx-send-btn { width: auto; }
  .fx-line { padding: var(--space-3) var(--space-6); }
  .fx-line-form, .fx-totals, .fx-pay { padding: var(--space-6); }
  .fx-line-form .fx-field, .fx-line-form .fx-fieldset, .fx-line-form .fx-line-result { max-width: 480px; box-sizing: border-box; }
  .fx-send { max-width: none; }
  .fx-send .fx-confirm { max-width: 560px; }
}
