/* D&D Schadecontrole — gedeelde stijl. Eerst voor de gsm (één kolom, grote knoppen), dan breder voor het beheer. */
:root {
  --inkt: #111827; --zacht: #6B7280; --lijn: #E5E7EB; --vlak: #F3F4F6; --wit: #fff;
  --kop: #1F2937; --accent: #FACC15; --accent-donker: #A16207;
  --goed: #059669; --goed-vlak: #ECFDF5; --fout: #B91C1C; --fout-vlak: #FEE2E2; --let: #C2410C; --let-vlak: #FFEDD5;
  --ruit: #DBEAFE; --voorlicht: #FDBA74; --achterlicht: #FCA5A5;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, 'Segoe UI', Roboto, Arial, sans-serif; color: var(--inkt); background: var(--vlak); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.balk { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
        background: var(--kop); color: #fff; min-height: 54px; }
.balk h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balk .wie { font-size: 13px; opacity: .8; }
.balk button { border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.balk .terug { font-size: 20px; padding: 2px 12px; }

main { max-width: 760px; margin: 0 auto; padding: 14px 14px 120px; }
.kaart { background: var(--wit); border: 1px solid var(--lijn); border-radius: 12px; padding: 14px; margin: 0 0 14px; }
.kaart h2 { margin: 0 0 8px; font-size: 17px; }
.kaart h3 { margin: 12px 0 6px; font-size: 15px; }
.hint { color: var(--zacht); font-size: 14px; margin: 4px 0 10px; }
.leeg { color: var(--zacht); font-style: italic; }

label.veld { display: block; margin: 0 0 12px; font-weight: 600; font-size: 15px; }
label.veld input, label.veld select, label.veld textarea { display: block; width: 100%; margin-top: 4px; padding: 12px; border: 1.5px solid #D1D5DB;
  border-radius: 10px; background: #fff; font-weight: 400; font-size: 16px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; }

.knop { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: 2px solid var(--lijn);
        border-radius: 12px; background: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.knop.hoofd { background: var(--kop); border-color: var(--kop); color: #fff; }
.knop.geel { background: var(--accent); border-color: var(--accent); color: var(--inkt); }
.knop.goed { background: var(--goed); border-color: var(--goed); color: #fff; }
.knop.gevaar { color: var(--fout); border-color: #FCA5A5; }
.knop.breed { width: 100%; }
.knop:disabled { opacity: .5; cursor: not-allowed; }
.knoppen { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.knoppen .knop { flex: 1; }
.onderbalk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
             background: rgba(255,255,255,.96); border-top: 1px solid var(--lijn); }
.onderbalk > div { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.onderbalk .knop { flex: 1; }

.melding { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 15px; }
.melding.fout { background: var(--fout-vlak); color: var(--fout); border: 1px solid #FCA5A5; }
.melding.goed { background: var(--goed-vlak); color: var(--goed); border: 1px solid #6EE7B7; }
.melding.let { background: var(--let-vlak); color: var(--let); border: 1px solid #FDBA74; }

/* Wagenlijst */
.wagens { display: grid; gap: 10px; }
.wagen { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--lijn); border-radius: 12px; background: #fff;
         text-align: left; cursor: pointer; width: 100%; }
.wagen:hover, .wagen:focus { border-color: var(--accent-donker); }
.wagen .naam { font-weight: 700; font-size: 17px; }
.wagen .plaat { display: inline-block; font: 600 14px/1 ui-monospace, Consolas, monospace; border: 1.5px solid #B91C1C; color: #B91C1C; border-radius: 4px;
                padding: 4px 6px; background: #fff; }
.wagen .sub { color: var(--zacht); font-size: 13px; }
.wagen .teller { margin-left: auto; text-align: right; font-size: 13px; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.badge.rood { background: var(--fout-vlak); color: var(--fout); }
.badge.groen { background: var(--goed-vlak); color: var(--goed); }
.badge.oranje { background: var(--let-vlak); color: var(--let); }
.badge.grijs { background: var(--vlak); color: var(--zacht); }

/* Stappen bovenaan */
.stappen { display: flex; gap: 4px; margin: 0 0 12px; }
.stappen span { flex: 1; height: 6px; border-radius: 3px; background: var(--lijn); }
.stappen span.af { background: var(--goed); }
.stappen span.nu { background: var(--accent); }

/* Diagram */
.tabs { display: flex; gap: 6px; margin: 0 0 8px; }
.tabs button { flex: 1; min-height: 44px; border: 2px solid var(--lijn); background: #fff; border-radius: 10px; font-weight: 700; cursor: pointer; }
.tabs button.aan { border-color: var(--kop); background: var(--kop); color: #fff; }
svg.diagram { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.dz { fill: #fff; stroke: #374151; stroke-width: 1.3; stroke-linejoin: round; transition: fill .12s; }
.dz-ruit { fill: var(--ruit); }
.dz-licht-v { fill: var(--voorlicht); }
.dz-licht-a { fill: var(--achterlicht); }
.dz-wiel { fill: #D1D5DB; }
.dz-zetel { fill: #E5E7EB; }
.dz-vloer { fill: #F9FAFB; }
.dz-knop { fill: #fff; stroke-dasharray: 4 3; }
.dz[role=button] { cursor: pointer; }
.dz[role=button]:hover { fill: #FEF9C3; }
.dz.bekend { fill: #F87171; stroke: #991B1B; stroke-width: 2; }
.dz.nieuw { fill: #FB923C; stroke: #9A3412; stroke-width: 2; }
.dz.gekozen { fill: var(--accent) !important; stroke: #713F12; stroke-width: 2.5; }
.dz:focus { outline: none; stroke: #2563EB; stroke-width: 3; }
.dz-naaf { fill: #fff; stroke: #6B7280; stroke-width: 1; pointer-events: none; }
.dz-deco { fill: none; stroke: #6B7280; stroke-width: 1.2; pointer-events: none; }
.dz-omtrek { fill: none; stroke: #9CA3AF; stroke-width: 1.5; stroke-dasharray: 6 4; pointer-events: none; }
.dz-nr { font: 700 11px system-ui, Arial, sans-serif; fill: #111827; text-anchor: middle; pointer-events: none; }
.dz-knoptekst { font-size: 13px; }
.dz-kop { font: 700 11px system-ui, Arial, sans-serif; fill: #9CA3AF; text-anchor: middle; letter-spacing: 1px; }
.dz-zij { font: 700 10px system-ui, Arial, sans-serif; fill: #9CA3AF; letter-spacing: 1px; }
.legende { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 13px; color: var(--zacht); margin: 6px 0 0; }
.legende i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid #374151; }
.legende i.bekend { background: #F87171; } .legende i.nieuw { background: #FB923C; } .legende i.gekozen { background: var(--accent); }

/* Schadelijst */
.schade { border: 1px solid var(--lijn); border-left: 5px solid #DC2626; border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; background: #fff; }
.schade.nieuw { border-left-color: #EA580C; }
.schade.hersteld { border-left-color: var(--goed); }
.schade .kop { display: flex; gap: 8px; align-items: baseline; }
.schade .kop strong { flex: 1; }
.schade .zone { font-weight: 700; }
.schade .sub { color: var(--zacht); font-size: 13px; }
.schade .acties { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.schade .acties .knop { min-height: 40px; padding: 6px 12px; font-size: 14px; }

/* Foto's */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.tegel { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--lijn); border-radius: 8px; overflow: hidden; background: var(--vlak); }
.tegel img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.tegel .ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--zacht); font-size: 12px; text-align: center; }
.tegel .balkje { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--accent-donker); transition: width .2s; }
.tegel .status { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); }
.tegel .status.fout { background: var(--fout); }
.tegel .weg { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
              font-size: 17px; line-height: 30px; cursor: pointer; }
.tegel .opnieuw { margin-left: 6px; border: 0; background: #fff; color: var(--fout); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.fotoknop { position: relative; overflow: hidden; }
.fotoknop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.venster { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.94); display: flex; flex-direction: column; color: #fff; }
.venster .vkop { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px; }
.venster .vkop span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.venster button { border: 0; background: rgba(255,255,255,.18); color: #fff; border-radius: 50%; width: 48px; height: 48px; font-size: 26px; cursor: pointer; flex-shrink: 0; }
.venster .vbeeld { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 10px 16px; position: relative; }
.venster .vbeeld img { max-width: 100%; max-height: 100%; object-fit: contain; }
.venster .vorige, .venster .volgende { position: absolute; bottom: 20px; }
.venster .vorige { left: 16px; } .venster .volgende { right: 16px; }

/* Staat van de wagen */
.keuze { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.keuze label { flex: 1; min-width: 70px; }
.keuze input { position: absolute; opacity: 0; pointer-events: none; }
.keuze span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 10px; border: 2px solid var(--lijn); border-radius: 10px;
              background: #fff; font-weight: 700; cursor: pointer; text-align: center; }
.keuze input:checked + span { border-color: var(--kop); background: var(--kop); color: #fff; }
.keuze input:checked + span.slecht { border-color: var(--let); background: var(--let); }
.keuze input:focus-visible + span { outline: 3px solid var(--accent); }
.vraag { font-weight: 700; margin-top: 4px; }

/* Handtekening */
.tekenvlak { display: block; width: 100%; height: 190px; border: 2px dashed #9CA3AF; border-radius: 12px; background: #fff; touch-action: none; }
.tekenvlak.getekend { border-style: solid; border-color: var(--goed); }
.vink { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 12px 0; }
.vink input { width: 26px; height: 26px; flex-shrink: 0; margin: 0; }

/* Verslag */
.verslag table { width: 100%; border-collapse: collapse; font-size: 15px; }
.verslag th { text-align: left; color: var(--zacht); font-weight: 600; padding: 4px 10px 4px 0; vertical-align: top; width: 38%; }
.verslag td { padding: 4px 0; }
.verslag .handtekening img { max-width: 320px; width: 100%; border: 1px solid var(--lijn); border-radius: 8px; background: #fff; }
.verslag .vingerafdruk { font: 11px ui-monospace, Consolas, monospace; color: var(--zacht); word-break: break-all; }
.ok { color: var(--goed); font-weight: 700; }
.nok { color: var(--let); font-weight: 700; }

/* Beheer: tabellen en tabs */
.beheer main { max-width: 1100px; }
.tabel { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.tabel th, .tabel td { padding: 8px; border-bottom: 1px solid var(--lijn); text-align: left; vertical-align: top; }
.tabel th { background: var(--vlak); font-size: 13px; color: var(--zacht); }
.tabel tr.klik { cursor: pointer; }
.tabel tr.klik:hover td { background: #FEFCE8; }
.rij { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.rij > * { flex: 1; min-width: 150px; }

@media print {
  .balk, .onderbalk, .knoppen, .geen-print, .tegel .weg { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .kaart { border: 0; padding: 0 0 10px; page-break-inside: avoid; }
  .dz, .tegel, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.sub { color: var(--zacht); font-size: 13px; }
