/* Owner-dashboard: desktop eerst, bruikbaar op de telefoon. */
.midden { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.uit-kaart { max-width: 420px; padding: 28px 24px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.uit-kaart p { color: var(--tekst-2); }
.uit-logo { border-radius: 16px; }

.app {
  max-width: 1480px; margin: 0 auto; display: grid; gap: 16px;
  padding: calc(14px + var(--veilig-boven)) calc(20px + var(--veilig-rechts)) calc(28px + var(--veilig-onder)) calc(20px + var(--veilig-links));
}
.balk { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.balk-rechts { display: flex; align-items: center; gap: 10px; }
.wie { color: var(--tekst-2); font-size: 14px; }

.tellers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tellers li { background: var(--vlak); border: 1px solid var(--rand-zacht); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.tg { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tn { font-size: 13px; color: var(--tekst-3); font-weight: 600; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rand-zacht); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 46px; padding: 0 16px; border: 0; background: none; color: var(--tekst-2); font-weight: 650;
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 0;
}
.tab:hover { color: var(--tekst); background: var(--grijs-zacht); }
.tab[aria-selected="true"] { color: var(--tekst); border-bottom-color: var(--accent); }

.werk { display: grid; gap: 14px; }
.filters { display: grid; grid-template-columns: 220px 220px minmax(180px, 1fr) auto; gap: 12px; align-items: end; }
.filters .veld > label { font-size: 13px; color: var(--tekst-3); }
.filters .invoer { min-height: 44px; padding-top: 9px; padding-bottom: 9px; }
.filters select.invoer { background-position: calc(100% - 20px) 19px, calc(100% - 15px) 19px; }
.f-vandaag { white-space: nowrap; }

.splits { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
body.detail-open .splits { grid-template-columns: minmax(0, 1fr) minmax(420px, 520px); }
.lijst-wrap { min-width: 0; display: grid; gap: 10px; overflow-x: auto; }
.leeg { padding: 40px 16px; text-align: center; color: var(--tekst-3); border: 1px dashed var(--rand); border-radius: var(--radius); }

/* ---------- tabel ---------- */
.tabel { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--vlak); border: 1px solid var(--rand-zacht); border-radius: var(--radius); overflow: hidden; }
.tabel th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--tekst-3); padding: 12px 14px; background: var(--bg-2); border-bottom: 1px solid var(--rand-zacht); white-space: nowrap; }
.tabel td { padding: 12px 14px; border-bottom: 1px solid var(--rand-zacht); vertical-align: top; font-size: 14px; }
.tabel tbody tr:last-child td { border-bottom: 0; }
#rijen tr { cursor: pointer; transition: background 0.12s ease; }
#rijen tr:hover { background: var(--vlak-2); }
#rijen tr.gekozen { background: var(--accent-zacht); box-shadow: inset 3px 0 0 var(--accent); }
.cel-code { max-width: 300px; }
.rij-link { color: var(--tekst); font-weight: 650; text-decoration: none; font-size: 13.5px; }
.rij-link:hover { text-decoration: underline; }
.rij-tekst { display: block; color: var(--tekst-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.speler { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.speler-naam { font-weight: 600; overflow-wrap: anywhere; }
.pil-klein { font-size: 11.5px; padding: 4px 10px; }
.pil-klein::before { width: 6px; height: 6px; }
.lease { color: var(--accent-sterk); font-size: 13px; }

/* ---------- detail ---------- */
.detail {
  position: sticky; top: 12px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: 0 18px 18px; display: grid; gap: 18px; align-content: start; overscroll-behavior: contain;
}
.detail:focus { outline: none; }
.detail-laden { display: grid; place-items: center; padding: 60px 0; }
.d-kop {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 0 12px; background: var(--vlak); border-bottom: 1px solid var(--rand-zacht);
}
.d-kop-titel { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.d-code { font-family: var(--mono); font-size: 18px; }
.d-kop .icoonknop { font-size: 26px; line-height: 1; flex: none; }
.d-melding { border: 1px solid rgba(242, 139, 60, 0.3); background: var(--oranje-zacht); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.d-melding-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--oranje); }
.d-tekst { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; }

.feiten { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.feiten div { min-width: 0; }
.feiten dt { font-size: 12px; color: var(--tekst-3); font-weight: 600; }
.feiten dd { margin: 2px 0 0; font-size: 14.5px; overflow-wrap: anywhere; }

.d-sectie { display: grid; gap: 10px; }
.d-sectie h3 { font-size: 13px; font-weight: 700; color: var(--tekst-3); letter-spacing: 0.05em; text-transform: uppercase; }
.dubbel { padding: 12px 14px; border-radius: 12px; background: var(--oranje-zacht); border: 1px solid rgba(242, 139, 60, 0.3); }
.dubbel h3 { color: var(--oranje); }
.dubbel-lijst { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dubbel-lijst li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dubbel-lijst a { color: var(--accent-sterk); font-weight: 650; }

.bewijs-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bewijs-vak { background: var(--bg-2); border: 1px solid var(--rand-zacht); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.bewijs-vak h4 { margin: 0; font-size: 14px; }
.bv-conclusie { border-color: rgba(70, 201, 139, 0.35); }
.bv-actievoorstel { border-color: rgba(245, 165, 36, 0.35); }
.bewijs-vak ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bewijs-tekst { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }

.bijlagen { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.bijlagen li { display: grid; gap: 4px; }
.bijlagen img, .bijlagen video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #000; border: 1px solid var(--rand-zacht); }

.tijdlijn { list-style: none; margin: 0; padding: 0; display: grid; }
.tijdlijn li { position: relative; padding: 0 0 14px 22px; }
.tijdlijn li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--rand); }
.tijdlijn li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--rand-zacht); }
.tijdlijn li:last-child::after { display: none; }
.tijdlijn li.tl-status::before, .tijdlijn li.tl-heropend::before { background: var(--accent); }
.tijdlijn li.tl-opmerking::before { background: var(--blauw); }
.tl-wat { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tl-tekst { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--tekst-2); font-size: 14px; }

.acties { border-top: 1px solid var(--rand-zacht); padding-top: 16px; }
.actie { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--rand-zacht); }
.actie h4 { margin: 0; font-size: 15px; }
.actie .knop { justify-self: start; }
.actie .invoer { min-height: 46px; }
.twee { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- beheer ---------- */
.beheer { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.beheer > .melding { grid-column: 1 / -1; }
.beheer-blok { padding: 18px; display: grid; gap: 14px; min-width: 0; }
.beheer-blok h2 { font-size: 17px; }
.beheer-blok:first-of-type { grid-column: 1 / -1; }
.tabel-wrap { overflow-x: auto; }
.tabel-klein td, .tabel-klein th { font-size: 13.5px; }
.knoppen { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form .veld { flex: 1; min-width: 200px; }
.link-vak { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--groen-zacht); border: 1px solid rgba(70, 201, 139, 0.3); }
.link-rij { display: flex; gap: 8px; }
.link-rij .invoer { flex: 1; min-width: 0; font-size: 13px; }
.push-form { display: grid; gap: 12px; }
.push-form .knop { justify-self: start; }
.bericht { display: block; max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60; bottom: calc(20px + var(--veilig-onder));
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--vlak-3);
  border: 1px solid var(--rand); box-shadow: var(--schaduw); font-weight: 600; font-size: 15px;
}

/* ---------- smaller ---------- */
@media (max-width: 1180px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .tellers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  body.detail-open .splits { grid-template-columns: minmax(0, 1fr); }
  body.detail-open { overflow: hidden; }
  .detail {
    position: fixed; inset: 0; z-index: 30; max-height: none; border-radius: 0; border: 0;
    padding: var(--veilig-boven) calc(16px + var(--veilig-rechts)) calc(24px + var(--veilig-onder)) calc(16px + var(--veilig-links));
  }
  .beheer { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .app { padding-left: calc(12px + var(--veilig-links)); padding-right: calc(12px + var(--veilig-rechts)); }
  .tg { font-size: 21px; }
  .tellers li { padding: 12px; }
  .filters { grid-template-columns: 1fr; }
  .wie { display: none; }
  /* Tabel wordt kaarten */
  .tabel thead { display: none; }
  .tabel, .tabel tbody, .tabel tr, .tabel td { display: block; width: 100%; }
  .tabel { background: none; border: 0; }
  #rijen { display: grid; gap: 10px; }
  #rijen tr { background: var(--vlak); border: 1px solid var(--rand-zacht); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; }
  #rijen td { border: 0; padding: 0; width: auto; }
  #rijen td.cel-code { width: 100%; max-width: none; }
  #rijen td.lease:empty { display: none; }
  .rij-tekst { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tabel-klein tr { border-bottom: 1px solid var(--rand-zacht); padding: 12px 14px; }
  .tabel-klein td { padding: 2px 0; border: 0; }
  .tabel-klein td[data-kop]::before { content: attr(data-kop); display: inline-block; min-width: 96px; color: var(--tekst-3); font-size: 12px; }
  .tabel-klein td[data-kop=""]::before { display: none; }
  .feiten, .bewijs-raster, .twee { grid-template-columns: minmax(0, 1fr); }
  .link-rij { flex-direction: column; }
}
.actie-akkoord { background: var(--groen-zacht); border-color: rgba(70, 201, 139, 0.3); }
.knop-groot { min-height: 52px; font-size: 16px; }
.tab-aantal:not(:empty) { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--groen-zacht); color: var(--groen); font-size: 12.5px; }
