/* v86 verhuur: eigen stijlbestand van dit onderdeel
   1. Pagina Verhuurd (#page-verhuur, tabel .vh-tabel; op telefoon en tablet kaarten)
   2. Venster Verhuur bewerken (#verhuurEditModal, zelfde blokken als Nieuwe verhuur) */

/* ========== 1. Verhuurd ========== */
.vh-pagina { display: flex; flex-direction: column; gap: 12px; }
.vh-top { display: flex; gap: 12px; align-items: center; }
.vh-top .search-input { flex: 1 1 auto; min-width: 0; min-height: 44px; }
.vh-top .vh-nieuw { flex: 0 0 auto; min-height: 44px; }

.vh-filters { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.vh-chips { flex: 1 1 auto; gap: 6px; }
.vh-chips .tag { min-height: 36px; padding: 4px 12px; }
.vh-status-kies { display: none; margin: 0; }
.vh-status-kies select {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid #ccc; border-radius: var(--radius-md); background-color: var(--clr-surface);
  color: var(--clr-text); font: inherit;
}
.vh-status-kies select:focus { border-color: var(--clr-primary); outline: none; }
.vh-periode-knop {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 4px 12px; font-size: var(--fs-sm);
  border-radius: var(--radius-full); white-space: nowrap; background: var(--clr-surface);
}
.vh-periode-knop svg { flex: 0 0 auto; transition: transform .15s; }
.vh-periode-knop[aria-expanded="true"] svg { transform: rotate(180deg); }
.vh-periode-knop.vh-periode-aan { border-color: var(--clr-primary); color: var(--clr-primary); background: var(--clr-accent-light); }
.vh-periode-waarde { font-weight: 600; }

.vh-periode {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--clr-surface); border: 1px solid var(--clr-border); border-radius: 10px;
}
.vh-periode[hidden] { display: none; }
.vh-periode .form-group { margin: 0; flex: 0 1 200px; min-width: 0; }
.vh-periode input { min-height: 44px; width: 100%; }
.vh-periode-wis { min-height: 44px; }

#page-verhuur .lijst-teller { margin-top: 2px; }

/* Tabel (computer) */
.vh-kaart { padding: 0; overflow: hidden; border-radius: 12px; }
.vh-tabel { width: 100%; border-collapse: collapse; font-size: 14px; }
.vh-tabel th {
  text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600;
  color: var(--clr-text-muted); padding: 10px 12px; background: var(--clr-surface);
}
.vh-tabel td { padding: 11px 12px; vertical-align: middle; }
.vh-tabel .c-tel { display: none; }
.vh-tabel .c-bon { width: 52px; color: var(--clr-text-muted); }
.vh-tabel .c-naam strong { display: block; font-weight: 600; color: var(--clr-text); }
.vh-tabel .vh-tel { display: block; font-size: 13px; color: var(--clr-text-muted); margin-top: 1px; }
.vh-tabel .c-periode { white-space: nowrap; }
.vh-tabel .c-pers { width: 56px; }
.vh-tabel .vh-pers-label { display: none; }
.vh-tabel .c-bedrag { font-weight: 600; white-space: nowrap; }
.vh-tabel .c-status { white-space: nowrap; }
.vh-tabel .c-klaar { white-space: nowrap; }
.vh-tabel .c-acties { width: 1%; white-space: nowrap; }
.vh-tabel .rij-acties { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.vh-tabel .rij-acties .btn { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.vh-tabel .vh-volgende.btn-primary { min-width: 92px; }
.vh-tabel .nb { white-space: nowrap; }

/* Status als rustige tekst met een stip in plaats van een gekleurde pil */
.vh-tabel .c-status .badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; padding: 0; border-radius: 0;
  font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.vh-tabel .c-status .badge::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto;
}
.vh-tabel .c-status .badge-info { color: #1f5c99; }
.vh-tabel .c-status .badge-mee { color: #34506b; }
.vh-tabel .c-status .badge-warning { color: #b45309; }
.vh-tabel .c-status .badge-danger { color: var(--clr-danger); }
.vh-tabel .c-status .badge-success { color: var(--clr-success); }
.vh-tabel .c-status .badge-neutral { color: var(--clr-text-muted); }

/* Klaar ja/nee: tekst, geen pil */
.vh-klaar { font-size: 13px; font-weight: 600; }
.vh-klaar-ja { color: var(--clr-success); }
.vh-klaar-nee { color: #b45309; }
.vh-tabel .vh-lang { display: none; }
.vh-tabel .klaar-nvt { color: var(--clr-text-light); }

/* Groepskop per status: gewone letters */
.vh-tabel tr.groep-kop td,
.vh-tabel tr.groep-kop:hover td {
  padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--clr-text);
  text-transform: none; letter-spacing: 0; background: var(--clr-surface-alt);
}
.vh-tabel .groep-aantal { font-weight: 500; color: var(--clr-text-muted); }

.vh-tabel tr.rij-geannuleerd td { color: var(--clr-text-muted); }
.vh-tabel tr.rij-geannuleerd .c-naam strong { color: var(--clr-text-muted); text-decoration: line-through; text-decoration-color: #b8b1a6; }

/* Lege staat */
.vh-tabel tr.rij-leeg td, .vh-tabel tr.rij-leeg:hover td { background: var(--clr-surface); padding: 0; }
.vh-leeg { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--clr-text-muted); }
.vh-leeg strong { color: var(--clr-text); font-size: 15px; }
.vh-leeg .btn { margin-top: 8px; min-height: 40px; }

/* Tussen 1024 en 1239 px: telefoon onder de naam is genoeg ruimte, knoppen compact */
@media (min-width: 1024px) and (max-width: 1239px) {
  .vh-tabel th, .vh-tabel td { padding-left: 8px; padding-right: 8px; }
  .vh-tabel .rij-acties .btn { padding: 5px 10px; }
}

/* Telefoon en tablet: kaarten */
@media (max-width: 1023px) {
  .vh-tabel, .vh-tabel tbody { display: block; }
  .vh-tabel thead { display: none; }
  .vh-tabel tr {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "naam naam naam status"
      "bon periode periode bedrag"
      "tel tel pers klaar"
      "acties acties acties acties";
    gap: 3px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--clr-border);
    align-items: baseline;
  }
  .vh-tabel tr:last-child { border-bottom: none; }
  .vh-tabel td { display: block; padding: 0; border: none; min-width: 0; font-size: 14px; }
  .vh-tabel tr:hover td { background: transparent; }
  .vh-tabel tr.groep-kop, .vh-tabel tr.rij-leeg { display: block; padding: 0; }
  .vh-tabel tr.groep-kop td { padding: 7px 14px; }
  .vh-tabel .c-naam { grid-area: naam; }
  .vh-tabel .c-naam strong { font-size: 15px; overflow-wrap: anywhere; }
  .vh-tabel .vh-tel { display: none; }
  .vh-tabel .c-tel { grid-area: tel; display: block; color: var(--clr-text-muted); font-size: 13px; white-space: nowrap; }
  .vh-tabel .c-status { grid-area: status; text-align: right; }
  .vh-tabel .c-bon { grid-area: bon; width: auto; text-align: left; }
  .vh-tabel .c-bon::before { content: '#'; }
  .vh-tabel .c-periode { grid-area: periode; white-space: normal; font-variant-numeric: normal; }
  .vh-tabel .c-bedrag { grid-area: bedrag; text-align: right; }
  .vh-tabel .c-pers { grid-area: pers; width: auto; text-align: left; color: var(--clr-text-muted); font-size: 13px; }
  .vh-tabel .vh-pers-label { display: inline; }
  .vh-tabel .c-klaar { grid-area: klaar; text-align: right; }
  .vh-tabel .c-klaar .klaar-nvt { display: none; }
  .vh-tabel .vh-kort { display: none; }
  .vh-tabel .vh-lang { display: inline; }
  .vh-tabel .c-acties { grid-area: acties; width: auto; margin-top: 8px; white-space: normal; }
  .vh-tabel .rij-acties { justify-content: flex-start; }
  .vh-tabel .rij-acties .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 8px; font-size: 14px; white-space: normal; line-height: 1.2; }
  .vh-tabel .rij-acties .vh-volgende.btn-primary { flex-grow: 1.4; }
  .vh-tabel .c-status .badge { font-size: 13px; }
}

/* Tablet: knoppen rechts, niet over de hele breedte */
@media (min-width: 721px) and (max-width: 1023px) {
  .vh-tabel .rij-acties { justify-content: flex-end; }
  .vh-tabel .rij-acties .btn,
  .vh-tabel .rij-acties .vh-volgende.btn-primary { flex: 0 0 auto; min-width: 140px; }
  .vh-tabel .c-acties { margin-top: 4px; }
}

/* Tablet en telefoon: één regel met statuskeuze en periode in plaats van zeven filterknoppen */
@media (max-width: 1023px) {
  .vh-chips { display: none; }
  .vh-filters { flex-wrap: nowrap; gap: 8px; }
  .vh-status-kies { display: block; flex: 1 1 auto; min-width: 0; }
  .vh-periode-knop { flex: 0 0 auto; min-height: 44px; border-radius: var(--radius-md); padding: 6px 12px; }
}
@media (min-width: 721px) and (max-width: 1023px) {
  .vh-status-kies { flex: 0 1 320px; }
}

/* Telefoon */
@media (max-width: 720px) {
  .vh-top .vh-nieuw { display: none; }   /* Nieuwe verhuur staat al in het menu */
  .vh-periode-knop { max-width: 52%; }
  .vh-periode-knop .vh-periode-waarde { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 12px; }
  .vh-periode-knop.vh-periode-aan .vh-periode-label { display: none; }
  .vh-periode { padding: 10px 12px; gap: 8px; }
  .vh-periode .form-group { flex: 1 1 calc(50% - 4px); }
  .vh-periode-wis { flex: 1 1 100%; }
  .vh-pagina { gap: 10px; }
}

/* ========== 2. Venster Verhuur bewerken ========== */
/* Zelfde opbouw als Nieuwe verhuur: witte blokken op de lichte achtergrond, zijbalk met opslaan */
#verhuurEditModal .modal-box.ve-box { max-width: 1180px; width: 100%; background: var(--clr-bg); }
#verhuurEditModal .modal-header { background: var(--clr-surface); }
#verhuurEditModal .ve-indeling { grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
.ve-hoofd { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ve-hoofd > .card { margin: 0; }
#verhuurEditModal .ve-zijbalk { top: 76px; }
#verhuurEditModal .nw-zijkaart { gap: 10px; }
.ve-annuleer { width: 100%; min-height: 44px; }
.ve-onder { display: none; }
.ve-kort { display: none; }

/* Statusregel bovenaan */
#verhuurEditModal .ve-statusbalk {
  margin: 0; padding: 10px 14px; background: var(--clr-surface);
  border: 1px solid var(--clr-border); border-radius: 12px;
}
.ve-statusbalk-kop { font-weight: 600; color: var(--clr-text); }
.ve-statusbalk .badge {
  display: inline-flex; align-items: center; gap: 7px; background: none; padding: 0; border-radius: 0;
  font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0;
}
.ve-statusbalk .badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ve-statusbalk .badge-info { color: #1f5c99; }
.ve-statusbalk .badge-mee { color: #34506b; }
.ve-statusbalk .badge-warning { color: #b45309; }
.ve-statusbalk .badge-danger { color: var(--clr-danger); }
.ve-statusbalk .badge-success { color: var(--clr-success); }
.ve-statusbalk .badge-neutral { color: var(--clr-text-muted); }
.ve-statusbalk-knoppen .btn { min-height: 40px; }

/* Blok 1 Klantgegevens */
.ve-klantgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.ve-klantgrid .form-group { margin: 0; min-width: 0; }
.ve-klantgrid input { min-height: 44px; }
.ve-span2 { grid-column: 1 / -1; }

/* Blok 2 Huurperiode */
#verhuurEditModal .nw-sectie input[type="date"] { min-height: 44px; }
.ve-vakanties { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.ve-vakanties .btn { min-height: 40px; }

/* Blok 3 Personen */
.ve-persoon-kop { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ve-afgesteld { font-size: 13px; font-weight: 600; color: var(--clr-success); }
.ve-afgesteld::before { content: '\2713\00a0'; }
.ve-materiaal { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--clr-border); }
#ve-persons .person-block + .person-block { margin-top: 12px; }
.ve-geen-personen { padding: 24px 12px; }

/* Blok 4 Afronden */
.ve-afronden-rij { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.ve-skibox { flex: 0 0 auto; margin: 0; }
.ve-medewerker { flex: 1 1 220px; min-width: 0; margin: 0; }
.ve-medewerker select { min-height: 44px; }

/* Prijsoverzicht */
.ve-prijskaart .ve-prijs-melding { margin-top: 12px; }
.ve-aangepast { margin-top: 14px; max-width: 260px; }
.ve-aangepast input { min-height: 44px; }
.ve-veldhint { margin-top: 4px; font-size: 12px; color: var(--clr-text-muted); }

/* Tablet en telefoon: zijbalk wordt een vaste balk onderin met totaal en Opslaan */
@media (max-width: 980px) {
  #verhuurEditModal .ve-indeling { grid-template-columns: minmax(0, 1fr); }
  #verhuurEditModal .ve-zijbalk { top: auto; bottom: -2rem; margin: 0 -1.5rem -1.5rem; }
  #verhuurEditModal .ve-zijbalk .nw-zijkaart { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .ve-annuleer { display: none; }
  .ve-onder { display: flex; justify-content: flex-end; }
  .ve-onder .btn { flex: 0 0 auto; min-width: 160px; min-height: 44px; }
}
@media (max-width: 720px) {
  #verhuurEditModal .modal-box.ve-box { padding-bottom: 0 !important; }
  #verhuurEditModal .modal-header { margin-bottom: 12px; }
  #verhuurEditModal .ve-zijbalk { margin: 0 -14px; bottom: 0; }
  #verhuurEditModal .ve-zijbalk .nw-zijkaart { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  #verhuurEditModal .nw-opslaan { min-width: 130px; }
  .ve-hoofd { gap: 12px; }
  #verhuurEditModal .nw-sectie { padding: 14px; }
  .ve-klantgrid { gap: 10px 12px; }
  .ve-klantgrid > .form-group:nth-child(-n+2) { grid-column: 1 / -1; }
  .ve-statusbalk-knoppen .btn { min-height: 44px; }
  .ve-aangepast { max-width: none; }
  .ve-onder .btn { flex: 1 1 auto; }
}
@media (max-width: 360px) {
  .vh-filters { flex-wrap: wrap; }
  .vh-status-kies { flex: 1 1 100%; }
  .vh-periode-knop { flex: 1 1 100%; max-width: none; justify-content: center; }
  .ve-lang { display: none; }
  .ve-kort { display: inline; }
}
