:root {
  --groen: #2c2857; /* donkerblauw van FMB */
  --groen-licht: #e8e7f1;
  --tekst: #1b1f1c;
  --zacht: #5d665f;
  --lijn: #d3d9d4;
  --vlak: #ffffff;
  --achter: #f4f6f4;
  --fout: #b3261e;
  --fout-licht: #fbe9e7;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--achter);
  color: var(--tekst);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  background: var(--groen); color: #fff;
}
.topbar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; }
.icon-btn {
  min-width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; font-size: 26px; line-height: 1;
}
.icon-btn:active { background: rgba(255,255,255,.15); }

main { padding: 12px 12px calc(env(safe-area-inset-bottom) + 96px); max-width: 720px; margin: 0 auto; }

.kaart {
  background: var(--vlak); border: 1px solid var(--lijn); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.kaart h2 { margin: 0 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--groen); }

label.veld { display: block; margin-bottom: 10px; }
label.veld > span { display: block; font-size: 13px; color: var(--zacht); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password], textarea, select {
  width: 100%; font: inherit; color: inherit;
  padding: 11px 12px; border: 1px solid var(--lijn); border-radius: 10px; background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--groen); outline-offset: -1px; border-color: var(--groen); }

.rij2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 380px) { .rij2 { grid-template-columns: 1fr; } }

.keuzes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.keuze {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--lijn); border-radius: 22px;
  background: #fff; font-size: 15px; user-select: none;
}
.keuze input { position: absolute; opacity: 0; pointer-events: none; }
.keuze:has(input:checked) { background: var(--groen); border-color: var(--groen); color: #fff; }
.groep-titel { font-size: 13px; color: var(--zacht); margin: 10px 0 6px; }

.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--groen);
  background: #fff; color: var(--groen); font: inherit; font-weight: 600;
}
.knop.vol { background: var(--groen); color: #fff; }
.knop.breed { width: 100%; }
.knop.gevaar { border-color: var(--fout); color: var(--fout); }
.knop:active { transform: scale(.98); }

.onderbalk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: rgba(244,246,244,.96); border-top: 1px solid var(--lijn);
  display: flex; gap: 10px; justify-content: center;
}
.onderbalk .knop { flex: 1; max-width: 360px; }
/* PDF bekijken op het beginscherm van een iPhone */
.pdflaag { position: fixed; inset: 0; z-index: 20; background: #fff; padding-top: env(safe-area-inset-top); }
.pdflaag iframe { display: block; width: 100%; height: calc(100% - 64px - env(safe-area-inset-bottom)); border: 0; }
.pdflaag .onderbalk { z-index: 21; }

.lijst-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; font: inherit; color: inherit;
}
.lijst-item .wat { flex: 1; min-width: 0; }
.lijst-item .klant { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lijst-item .sub { font-size: 13px; color: var(--zacht); }
.label {
  font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 10px;
  background: var(--groen-licht); color: var(--groen); white-space: nowrap;
}
.label.concept { background: #fff3d6; color: #7a5400; }
.leeg { text-align: center; color: var(--zacht); padding: 40px 12px; }

.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.foto { border: 1px solid var(--lijn); border-radius: 10px; overflow: hidden; background: #fff; }
.foto img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.foto input { border: 0; border-top: 1px solid var(--lijn); border-radius: 0; font-size: 14px; padding: 8px; }
.foto button { width: 100%; border: 0; border-top: 1px solid var(--lijn); background: #fff; color: var(--fout); padding: 8px; font: inherit; font-size: 14px; }

.handtekening { margin-bottom: 12px; }
.handtekening canvas {
  display: block; width: 100%; height: 160px; touch-action: none;
  border: 1px dashed #9aa59c; border-radius: 10px; background: #fff;
}
.handtekening .acties { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; color: var(--zacht); }
.handtekening .acties button { border: 0; background: none; color: var(--groen); font: inherit; font-weight: 600; padding: 8px 4px; }

.melding { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.melding.fout { background: var(--fout-licht); border: 1px solid #f0b8b2; }
.melding.ok { background: var(--groen-licht); border: 1px solid #c9c6dc; }
.melding ul { margin: 6px 0 0; padding-left: 20px; }
/* Seintje op het startscherm (bijvoorbeeld: nog geen initialen voor het bonnummer); tikken opent Instellingen. */
.melding.tip { display: block; width: 100%; text-align: left; font: inherit; font-size: 15px; line-height: 1.4;
  color: var(--tekst, #222); background: #fff8e6; border: 1px solid #f0d9a0; min-height: 44px; cursor: pointer; }

.mist { border-color: var(--fout) !important; background: #fffafa; }

#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%);
  background: #1b1f1c; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw;
}
#toast.zichtbaar { opacity: .95; }

.klein { font-size: 13px; color: var(--zacht); }

select { appearance: auto; min-height: 46px; }
.rij3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.keuze:has(input[type=radio]:checked) { background: var(--groen); border-color: var(--groen); color: #fff; }
/* Verzendstatus in de Android-app */
.status { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--groen); }
.knop:disabled { opacity: .55; }
/* Telefoon: alles groot genoeg om met de vinger aan te tikken (minstens 44px), en tekst in velden 16px (anders zoomt de telefoon in) */
.handtekening .acties button { min-height: 44px; padding: 8px 12px; }
.foto input { font-size: 16px; min-height: 44px; }
.foto button { min-height: 44px; }
/* Titel bovenin altijd op één regel; op smalle telefoons iets kleiner */
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 380px) { .topbar h1 { font-size: 16px; } }
/* Aangetikte keuze, ook op telefoons met een oude WebView (zonder :has) */
.keuze.aan { background: var(--groen); border-color: var(--groen); color: #fff; }
@media (max-width: 340px) { .topbar h1 { font-size: 15px; } }

/* ---------- Uren en verlof ---------- */
/* Tabbladen bovenaan het startscherm: Uren | Verlof */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 12px; background: #fff;
  border: 1px solid var(--lijn); border-radius: var(--radius); padding: 4px; }
.tabs button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--groen);
  font: inherit; font-weight: 600; }
.tabs button.aan { background: var(--groen); color: #fff; }
/* Eén regel van de urenstaat (klant of verlof). Ziekteverlof roodachtig, vakantie en ander verlof blauwachtig. */
.regel { border: 1px solid var(--lijn); border-left: 4px solid var(--groen); border-radius: 10px; padding: 10px 10px 2px;
  margin-bottom: 10px; background: #fff; }
.regel.ziek { background: #fbe4e1; border-color: #f0b8b2; border-left-color: #c0392b; }
.regel.verlof { background: #e4e9f7; border-color: #c3cbe6; border-left-color: #3a4f9e; }
.regel.kosten { border-left-color: #7a8a7d; }
.regel-kop { display: grid; grid-template-columns: 1fr 44px; gap: 0 10px; align-items: end; }
.regel-weg { height: 46px; margin-bottom: 10px; border: 1px solid var(--lijn); border-radius: 10px; background: #fff;
  color: var(--fout); font-size: 22px; }
.regel .hulp { margin: 0 0 10px; }
.regel .hulp summary { min-height: 44px; display: flex; align-items: center; color: var(--groen); font-weight: 600; cursor: pointer; }
.totalen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.totalen div { border: 1px solid var(--lijn); border-radius: 10px; padding: 8px 10px; }
.totalen span { display: block; font-size: 13px; color: var(--zacht); }
.totalen strong { font-size: 20px; color: var(--groen); }
.kaart.dag h2 { text-transform: none; letter-spacing: 0; font-size: 16px; }
@media (max-width: 380px) { .rij3 { grid-template-columns: 1fr 1fr; } }

/* Maandstaat (1.1): de maand per week om in te klappen, en de uren na "Uitrekenen" */
details.week { margin-bottom: 12px; }
details.week > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px;
  padding: 0 14px; background: var(--vlak); border: 1px solid var(--lijn); border-radius: var(--radius); cursor: pointer;
  font-weight: 600; color: var(--groen); list-style: none; }
details.week > summary::-webkit-details-marker { display: none; }
details.week > summary::after { content: '▾'; font-size: 14px; }
details.week[open] > summary { margin-bottom: 10px; }
details.week[open] > summary::after { content: '▴'; }
details.week > summary > span:first-child { flex: 1; }
.week-uren { font-size: 14px; color: var(--zacht); font-weight: 600; }
.kaart.dag.vandaag { border-color: var(--groen); box-shadow: 0 0 0 1px var(--groen) inset; }
.uitkomst { margin: 0 0 6px; }
.arbeidstijd-kort { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.arbeidstijd-kort span { color: var(--zacht); }
.uitkomst .totalen strong { font-size: 17px; }

/* Verlof: status van een aanvraag, en het overzicht van een verstuurde aanvraag */
.label.goed { background: #e1f2e6; color: #1e6b37; }
.label.afgewezen { background: var(--fout-licht); color: var(--fout); }
.samenvatting { margin: 4px 0 6px; font-weight: 600; color: var(--groen); }
.kaartkop { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.kaartkop h2 { margin: 0; }
.regelpaar { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--lijn); }
.regelpaar span { color: var(--zacht); font-size: 14px; }
.regelpaar strong { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Selecteren en verwijderen in een lijst (ingedrukt houden of "Selecteren") ---------- */
.lijst-item { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.lijst-item .vinkje { display: none; flex: none; width: 26px; height: 26px; border: 2px solid #9aa59c; border-radius: 50%; }
.lijst-item.kiesbaar .vinkje { display: block; }
.lijst-item.gekozen { border-color: var(--groen); background: var(--groen-licht); }
.lijst-item.gekozen .vinkje { border-color: var(--groen); background: var(--groen); position: relative; }
.lijst-item.gekozen .vinkje::after { content: ''; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.lijstkop { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 6px; }
.tekstknop { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--groen); font: inherit; font-weight: 600; }
body.selecteren .onderbalk.gewoon, body.selecteren .lijstkop, body.selecteren .melding.tip { display: none; }
body.selecteren .tabs { opacity: .45; pointer-events: none; }
.knop.vol.gevaar-vol { background: var(--fout); border-color: var(--fout); color: #fff; }
.onderbalk[hidden] { display: none; }
/* Lange mailadressen breken af in plaats van buiten beeld te lopen */
.melding, .klein, .status { overflow-wrap: anywhere; }
.saldo-groot { font-size: 22px; font-weight: 700; }
.let-op { color: #a14d00; font-weight: 600; }
