:root {
  --rood: #971F1F;
  --rood-donker: #7a1818;
  --rood-licht: #f8ecec;
  --tekst: #1d1d1f;
  --grijs: #6b6b70;
  --lijn: #e3dfdc;
  --achter: #f5f3f1;
  --wit: #ffffff;
  --groen: #1f6f43;
  --groen-licht: #e7f4ec;
  --blauw: #1d4f91;
  --blauw-licht: #e8effa;
  --oranje: #8a5300;
  --oranje-licht: #fff4e5;
  --navhoogte: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--tekst); background: var(--achter); -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid rgba(151, 31, 31, .35); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
svg { flex: none; }

/* ------------------------------------------------------------ knoppen */
.knop-rood, .knop-licht {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.knop-rood { background: var(--rood); color: #fff; border: none; }
.knop-rood:hover { background: var(--rood-donker); }
.knop-licht { background: var(--wit); color: var(--tekst); border: 1px solid var(--lijn); }
.knop-licht:hover { border-color: var(--rood); color: var(--rood); }
.knop-tekst {
  background: none; border: none; color: var(--rood); font-weight: 600; padding: 8px 10px;
  border-radius: 10px; min-height: 40px;
}
.knop-tekst:hover { background: var(--rood-licht); }
.knop-icoon {
  background: none; border: none; color: var(--grijs); width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 12px; flex: none;
}
.knop-icoon:hover { background: var(--rood-licht); color: var(--rood); }
.breed { width: 100%; }

/* ------------------------------------------------------------ indeling */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.inhoud { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.appkop {
  flex: none; display: flex; align-items: center; gap: 12px; background: var(--wit);
  border-bottom: 1px solid var(--lijn);
  padding: 8px 12px 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
}
.appkop .kop-logo { height: 34px; width: auto; }
.appkop h1 { font-size: 20px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.proefbalk {
  flex: none; background: var(--oranje-licht); color: var(--oranje); text-align: center;
  font-size: 14px; padding: 6px 12px; border-bottom: 1px solid #f3dcb8;
}

/* menu: onderin (telefoon en iPad), links (laptop) */
.navigatie {
  flex: none; order: 2; display: flex; justify-content: center; gap: 4px;
  background: var(--wit); border-top: 1px solid var(--lijn);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.navigatie .nav-merk, .navigatie .nav-uit { display: none; }
.tab {
  flex: 1; max-width: 180px; min-height: calc(var(--navhoogte) - 12px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; border-radius: 12px; color: var(--grijs);
  font-size: 13px; font-weight: 600;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--rood); }
.tab:hover { color: var(--rood); }

@media (min-width: 1024px) {
  .app { flex-direction: row; }
  .navigatie {
    order: 0; flex-direction: column; justify-content: flex-start; width: 236px;
    border-top: none; border-right: 1px solid var(--lijn); padding: 20px 14px; gap: 6px;
  }
  .navigatie .nav-merk { display: block; padding: 0 8px 18px; }
  .nav-merk img { height: 54px; width: auto; }
  .tab {
    flex: none; max-width: none; min-height: 50px; flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 0 14px; font-size: 16px; color: var(--tekst);
  }
  .tab svg { width: 22px; height: 22px; color: var(--grijs); }
  .tab[aria-current="page"] { background: var(--rood-licht); color: var(--rood); }
  .tab[aria-current="page"] svg { color: var(--rood); }
  .navigatie .nav-uit { display: flex; margin-top: auto; }
  .appkop .kop-logo, .appkop #knop-uitloggen { display: none; }
  .appkop { padding-left: 28px; }
}

.scherm { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.smal { width: 100%; max-width: 880px; margin: 0 auto; }

/* ------------------------------------------------------------ gesprek */
.gesprek {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.gesprek > * { width: 100%; max-width: 880px; margin-left: auto; margin-right: auto; }
.bubbel {
  width: auto; max-width: min(88%, 760px); padding: 12px 16px; border-radius: 18px;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
}
.bubbel.gebruiker {
  align-self: flex-end; background: var(--rood); color: #fff; border-bottom-right-radius: 6px;
  margin-right: max(0px, calc((100% - 880px) / 2));
}
.bubbel.assistent, .bubbel.fout {
  align-self: flex-start; white-space: normal; border-bottom-left-radius: 6px;
  margin-left: max(0px, calc((100% - 880px) / 2));
}
.bubbel.assistent { background: var(--wit); border: 1px solid var(--lijn); }
.bubbel.fout { background: #fff4f4; border: 1px solid #f0c8c8; color: #8a1c1c; }
.bubbel p { margin: 0 0 8px; }
.bubbel p:last-child { margin-bottom: 0; }
.bubbel ol, .bubbel ul { margin: 4px 0 8px; padding-left: 24px; }
.bubbel li { margin: 4px 0; }
.bubbel .voorbeeld {
  background: var(--achter); border-radius: 12px; padding: 10px 12px; color: #4a4a4f;
  font-size: 15px; font-style: italic;
}
details { margin: 2px 0 8px; }
details summary { cursor: pointer; color: var(--grijs); font-size: 15px; }
details ul { font-size: 15px; color: #3a3a3c; }

.denken { display: flex; align-items: center; gap: 12px; color: var(--grijs); }
.stippen { display: inline-flex; gap: 4px; align-items: center; }
.stippen i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rood); opacity: .3;
  animation: stip 1.2s infinite;
}
.stippen i:nth-child(2) { animation-delay: .2s; }
.stippen i:nth-child(3) { animation-delay: .4s; }
@keyframes stip { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* resultaat */
.kaart {
  background: var(--wit); border: 1px solid var(--lijn); border-radius: 18px; padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.klaar-kop { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.klaar-kop .vink {
  width: 32px; height: 32px; border-radius: 50%; background: var(--groen-licht); color: var(--groen);
  display: grid; place-items: center; flex: none;
}
.kaart h3 { font-size: 20px; }
.kaart .sub { color: var(--grijs); margin: 0 0 14px; }
.bedragen { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 14px; }
.bedragen dt { color: var(--grijs); }
.bedragen dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.bedragen .totaal { font-weight: 700; color: var(--tekst); font-size: 19px; padding-top: 6px; border-top: 1px solid var(--lijn); }
.waarschuwing {
  background: var(--oranje-licht); color: var(--oranje); border-radius: 12px;
  padding: 10px 14px; margin: 0 0 14px; font-size: 15px;
}
.acties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.acties .knop-rood { grid-column: 1 / -1; }
.acties .knop-licht:only-of-type { grid-column: 1 / -1; }
.klein { font-size: 14px; color: var(--grijs); margin: 12px 0 0; }

/* invoer */
.invoer {
  flex: none; background: var(--wit); border-top: 1px solid var(--lijn); padding: 10px 12px;
}
.invoer > * { max-width: 880px; margin-left: auto; margin-right: auto; }
.balk { display: flex; align-items: flex-end; gap: 8px; }
textarea {
  flex: 1; min-width: 0; resize: none; font: inherit; font-size: 17px; line-height: 1.4;
  padding: 12px 16px; border: 1.5px solid #d3cecb; border-radius: 22px; min-height: 50px;
  max-height: 40vh; background: var(--wit); color: var(--tekst);
}
textarea::placeholder { color: #8e8e93; }
textarea:focus { outline: none; border-color: var(--rood); box-shadow: 0 0 0 3px var(--rood-licht); }
.rond {
  width: 50px; height: 50px; flex: none; border-radius: 50%; border: none;
  display: grid; place-items: center;
}
.mic, .foto { background: var(--rood-licht); color: var(--rood); }
.mic:hover, .foto:hover { background: #f1dada; }

/* foto's die met het volgende bericht meegaan */
.fotostrook { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; }
.fotostrook .duim { position: relative; flex: none; }
.duim img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; border: 1px solid var(--lijn); display: block; }
.duim button {
  position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--wit); background: #2c2c2e; color: #fff; font-size: 15px; line-height: 1;
  display: grid; place-items: center; padding: 0;
}
.bubbel .fotos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bubbel .fotos img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .5); }
.stuur { background: var(--rood); color: #fff; }
.stuur:hover { background: var(--rood-donker); }
.stuur.klaar-om-te-sturen { animation: puls 1.6s 2; }
@keyframes puls {
  0% { box-shadow: 0 0 0 0 rgba(151, 31, 31, .45); }
  70% { box-shadow: 0 0 0 14px rgba(151, 31, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(151, 31, 31, 0); }
}
.status { font-size: 14px; color: var(--grijs); min-height: 1.2em; margin-top: 6px; padding: 0 6px; }
.status:empty { display: none; }

.opnamebalk {
  display: flex; align-items: center; gap: 12px; min-height: 50px;
  background: var(--rood-licht); border-radius: 25px; padding: 0 6px 0 18px;
}
.opname-stip {
  width: 12px; height: 12px; border-radius: 50%; background: var(--rood); flex: none;
  animation: stip 1s infinite;
}
.opname-tekst { flex: 1; color: var(--rood); font-weight: 600; font-variant-numeric: tabular-nums; }
.opnamebalk .knop-rood { min-height: 40px; padding: 6px 16px; border-radius: 20px; }
.opnamebalk .knop-tekst { min-height: 40px; }

.termijnen { margin-bottom: 10px; }
.termijnen .label { font-size: 15px; font-weight: 600; margin: 0 0 8px 4px; }
.termijn-knoppen { display: flex; flex-wrap: wrap; gap: 8px; }
.termijn {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--lijn);
  background: var(--wit); color: var(--rood); font-weight: 700; font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.termijn:hover { border-color: var(--rood); }
.termijn.gekozen { border-color: var(--rood); background: var(--rood); color: #fff; }
.termijn-uitleg { font-size: 14px; color: var(--grijs); margin: 8px 4px 0; }
.termijn-uitleg strong { color: var(--tekst); }
.termijn-anders { display: flex; gap: 8px; margin-top: 8px; }
.termijn-anders input {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 10px 14px;
  border: 1.5px solid var(--lijn); border-radius: 12px;
}

/* ------------------------------------------------------------ offertes */
.lijstscherm { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lijstkop {
  position: sticky; top: 0; z-index: 2; background: var(--achter);
  padding: 14px 16px 10px;
}
.zoek {
  display: flex; align-items: center; gap: 10px; background: var(--wit);
  border: 1.5px solid #d3cecb; border-radius: 14px; padding: 0 14px; min-height: 50px;
}
.zoek:focus-within { border-color: var(--rood); box-shadow: 0 0 0 3px var(--rood-licht); }
.zoek svg { color: var(--grijs); }
.zoek input {
  flex: 1; min-width: 0; border: none; outline: none; font: inherit; font-size: 17px;
  background: transparent; color: var(--tekst); padding: 12px 0;
}
.filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px;
  padding: 0 14px; border-radius: 21px; border: 1.5px solid var(--lijn); background: var(--wit);
  font-size: 15px; font-weight: 600; color: var(--tekst);
}
.filter .aantal {
  font-size: 13px; background: var(--achter); color: var(--grijs); border-radius: 10px;
  padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.filter[aria-selected="true"] { background: var(--rood); border-color: var(--rood); color: #fff; }
.filter[aria-selected="true"] .aantal { background: rgba(255, 255, 255, .2); color: #fff; }

.lijst { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 24px; }
.lijst-uitleg { color: var(--grijs); font-size: 15px; margin: 4px 4px 2px; }
.offerte {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; width: 100%;
  background: var(--wit); border: 1px solid var(--lijn); border-radius: 16px; padding: 14px 16px;
}
.offerte:hover { border-color: #cfc9c5; box-shadow: 0 2px 6px rgba(0, 0, 0, .05); }
.offerte .wie { font-weight: 700; font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.offerte .wat {
  grid-column: 1 / -1; color: #48484d; font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.offerte .waar { grid-column: 1 / -1; color: var(--grijs); font-size: 14px; }
.offerte .meta { color: var(--grijs); font-size: 14px; font-variant-numeric: tabular-nums; }
.offerte .bedrag { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--achter); color: var(--grijs);
  justify-self: end;
}
.chip.s-concept { background: #eeeeef; color: #4a4a4f; }
.chip.s-verstuurd { background: var(--blauw-licht); color: var(--blauw); }
.chip.s-akkoord { background: var(--groen-licht); color: var(--groen); }
.chip.s-niet-akkoord { background: #fbe9e9; color: #9b1c1c; }
.chip.s-afgerond { background: #e3f1ef; color: #17645a; }
.chip.s-vervallen { background: #f1efed; color: #7a746f; }
.chip.s-archief { background: #f1efed; color: #7a746f; }
.chip.s-leeg { background: var(--oranje-licht); color: var(--oranje); }

.leeg-bericht { text-align: center; color: var(--grijs); padding: 40px 16px; }

/* ------------------------------------------------------------ detailblad */
.blad {
  border: none; padding: 0; background: var(--wit); color: var(--tekst);
  width: min(560px, 100% - 32px); max-height: min(88dvh, 820px); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.blad::backdrop { background: rgba(20, 16, 14, .45); }
.blad-inhoud { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.blad-kop { display: flex; align-items: flex-start; gap: 12px; }
.blad-kop h2 { flex: 1; font-size: 21px; overflow-wrap: anywhere; }
.blad-kop .knop-icoon { margin: -8px -8px 0 0; }
.blad .omschrijving { margin: 0; color: #3a3a3c; }
.blad .gegevens { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.blad .gegevens dt { color: var(--grijs); }
.blad .gegevens dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.blad h3 { font-size: 15px; color: var(--grijs); font-weight: 600; margin-top: 4px; }
.blad-open { display: flex; flex-direction: column; gap: 8px; }
.blad-open .klein { margin: 0; }
.statusknoppen { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.statusknop {
  min-height: 48px; border-radius: 12px; border: 1.5px solid var(--lijn); background: var(--wit);
  font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.statusknop:hover { border-color: var(--rood); }
.statusknop[aria-pressed="true"] { background: var(--rood); border-color: var(--rood); color: #fff; }

/* ------------------------------------------------------------ klussen */
.klus-overzicht { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.klus-overzicht div {
  background: var(--wit); border: 1px solid var(--lijn); border-radius: 14px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.klus-overzicht span { font-size: 13px; color: var(--grijs); }
.klus-overzicht strong { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.min { color: #9b1c1c; }
.offerte.algemeen { background: var(--achter); border-style: dashed; }
.blad .bedragen { margin: 0; }
.blad .acties { grid-template-columns: 1fr 1fr; }
.blad .acties .knop-rood { grid-column: auto; }
.boekingen { display: flex; flex-direction: column; border: 1px solid var(--lijn); border-radius: 14px; overflow: hidden; }
.boeking {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; padding: 10px 14px;
  background: var(--wit); border: none; border-bottom: 1px solid var(--lijn);
}
.boeking:last-child { border-bottom: none; }
.boeking:hover { background: var(--achter); }
.b-wat { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.b-bedrag { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.b-bedrag.inkomst { color: var(--groen); }
.b-meta { grid-column: 1 / -1; font-size: 13px; color: var(--grijs); }
.blad-voet { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.knop-tekst.gevaar { color: #9b1c1c; }
.formulier { display: flex; flex-direction: column; gap: 12px; }
.veld { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.veld > span { color: var(--grijs); }
.veld input, .veld select, .veld textarea {
  font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--lijn); border-radius: 12px;
  background: var(--wit); color: var(--tekst); min-height: 46px; width: 100%;
}
.veld input:focus, .veld select:focus { outline: none; border-color: var(--rood); box-shadow: 0 0 0 3px var(--rood-licht); }
.keuzes { display: flex; flex-wrap: wrap; gap: 8px; }
.keuze {
  min-height: 42px; padding: 0 14px; border-radius: 21px; border: 1.5px solid var(--lijn); background: var(--wit);
  font-weight: 600;
}
.keuze[aria-pressed="true"] { background: var(--rood); border-color: var(--rood); color: #fff; }
.post-toestand { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--grijs); margin: -2px 2px 10px; }

@media (max-width: 600px) {
  .klus-overzicht strong { font-size: 15px; }
  .blad {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0;
    max-height: 90dvh; padding-bottom: env(safe-area-inset-bottom);
  }
  .bubbel { max-width: 94%; }
  .acties { grid-template-columns: 1fr; }
  .opname-uitleg { display: none; }
}

/* melding onderin */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--navhoogte) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 20; background: #2c2c2e; color: #fff;
  padding: 12px 18px; border-radius: 14px; font-size: 15px; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
@media (min-width: 1024px) { .toast { bottom: 28px; } }

/* ------------------------------------------------------------ inloggen */
.inlog-pagina { display: grid; place-items: center; min-height: 100%; padding: 20px; }
.inlog-kaart {
  width: 100%; max-width: 380px; background: var(--wit); border: 1px solid var(--lijn);
  border-radius: 20px; padding: 30px 24px; display: flex; flex-direction: column; gap: 16px;
}
.inlog-logo { height: 80px; width: auto; align-self: center; }
.inlog-kaart h1 { text-align: center; font-size: 22px; margin: 0 0 4px; }
.inlog-kaart label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--grijs); }
.inlog-kaart input {
  font: inherit; font-size: 17px; padding: 12px 14px; border: 1.5px solid #d3cecb;
  border-radius: 12px; color: var(--tekst);
}
.inlog-kaart input:focus { outline: none; border-color: var(--rood); box-shadow: 0 0 0 3px var(--rood-licht); }
.melding { color: #8a1c1c; min-height: 1.2em; margin: 0; font-size: 15px; text-align: center; }
