/* Portaal + Foto annotatie — donker thema in de stijl van Jake.lift.
   Palet: diepe donkerblauw-zwart met amber accent. Barlow Condensed (koppen)
   + Inter (tekst). Geoptimaliseerd voor Chrome op iPhone 16 Pro (safe-areas). */

:root {
  --bg: #0f1218;
  --surface: #171b24;
  --surface-hi: #1f2530;
  --line: #2a313e;
  --text: #e8ecf2;
  --dim: #8a94a6;
  --faint: #5a6473;
  --accent: #f5b93b;
  --accent-ink: #1a1500;
  --accent-dim: #3a2f12;
  --good: #34d399;
  --bad: #f2637e;
  --water: #4ea8de;
  --purple: #b694f5;

  --r-sm: 10px;
  --r: 13px;
  --r-lg: 18px;
  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 18px 44px rgba(0, 0, 0, 0.6);
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* Condensed koppen als handtekening van de huisstijl. */
h1,
h2,
.titel,
.app-naam,
.cat-titel,
.detail-kop .titel {
  font-family: 'Barlow Condensed', 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

/* ---------- Topbalk ---------- */
.balk {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  padding-top: calc(11px + var(--sat));
  background: rgba(15, 18, 24, 0.82);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.balk h1 {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inhoud {
  padding: 18px 16px;
  padding-bottom: calc(28px + var(--sab));
  max-width: 1080px;
  margin: 0 auto;
}

/* ---------- Knoppen ---------- */
.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-hi);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.knop:active {
  transform: scale(0.97);
}
.knop.primair {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
}
.knop.gevaar {
  background: transparent;
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}
.knop.breed {
  width: 100%;
}
.knop.sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
}
.knop:disabled {
  opacity: 0.5;
  cursor: default;
}

.icon-knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  gap: 6px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.icon-knop:active {
  background: var(--surface-hi);
}

/* ---------- Formulier ---------- */
input[type='text'],
input[type='search'],
input[type='date'],
input[type='password'],
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
}
textarea {
  min-height: 88px;
  resize: vertical;
}
label.veld {
  display: block;
  margin: 16px 0 6px;
  font-weight: 600;
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kaart-blok {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.kaart-blok h2 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- Zoek/filter ---------- */
.zoekbalk {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.zoekbalk .groei {
  flex: 1;
  min-width: 180px;
}
.datumfilter {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--dim);
}
.datumfilter input {
  min-width: 138px;
}

/* ---------- Overzicht-raster ---------- */
.raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 13px;
}
.kaart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.kaart:active {
  transform: scale(0.98);
}
@media (hover: hover) {
  .kaart:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    transform: translateY(-2px);
  }
}
.kaart .thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--surface-hi);
  display: block;
}
.kaart .thumb.leeg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 13px;
}
.kaart .body {
  padding: 11px 12px 12px;
}
.kaart .notitie {
  font-weight: 600;
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kaart .meta {
  color: var(--dim);
  font-size: 13px;
  margin-top: 3px;
}
.kaart .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 9px;
}

.leeg-melding {
  color: var(--dim);
  text-align: center;
  padding: 56px 16px;
}

/* ---------- Detailpagina ---------- */
.detail-kop {
  margin-bottom: 6px;
}
.detail-kop .titel {
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
}
.detail-kop .meta {
  color: var(--dim);
  font-size: 14px;
  margin-top: 2px;
}
.acties {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 16px 0 22px;
}
.foto-blok {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.foto-blok img {
  width: 100%;
  display: block;
}
.foto-blok .labels {
  padding: 14px 16px;
}
.foto-blok .labels-kop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
}
.foto-blok ol {
  margin: 0;
  padding-left: 22px;
}
.foto-blok li {
  margin: 5px 0;
}
.foto-blok li::marker {
  color: var(--accent);
  font-weight: 700;
}
.foto-blok .geen-labels {
  color: var(--faint);
  font-style: italic;
}

/* ---------- Foto-strip (nieuwe melding) ---------- */
.foto-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 11px;
  margin: 6px 0 2px;
}
.foto-strip .mini,
.foto-strip .toevoeg-tegel {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-hi);
}
.foto-strip .mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.foto-strip .mini .nr-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.foto-strip .mini .bewerk-hint {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 14px 8px 6px;
  text-align: center;
}
.foto-strip .toevoeg-tegel {
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  background: transparent;
  color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.foto-strip .toevoeg-tegel .plus {
  font-size: 30px;
  line-height: 1;
}
.foto-strip .toevoeg-tegel:active {
  background: var(--surface-hi);
}

.tip {
  color: var(--dim);
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.55;
}

.verborgen {
  display: none !important;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + var(--sab));
  transform: translateX(-50%) translateY(8px);
  background: var(--surface-hi);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
  max-width: 88%;
  text-align: center;
  box-shadow: var(--sh-lg);
}
#toast.zichtbaar {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= Portaal (landingspagina) ================= */
.portaal {
  max-width: 720px;
}
.categorie {
  margin-bottom: 26px;
}
.cat-titel {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin: 4px 2px 12px;
}
.cat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.cat-dot.werk {
  background: var(--accent);
}
.cat-dot.prive {
  background: var(--purple);
}
.app-raster {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .app-raster {
    grid-template-columns: 1fr 1fr;
  }
}
.app-kaart {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.app-kaart:active {
  transform: scale(0.985);
}
@media (hover: hover) {
  .app-kaart:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    transform: translateY(-2px);
  }
}
.app-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex: 0 0 auto;
  display: block;
}
.app-logo.emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: var(--surface-hi);
}
.app-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-naam {
  font-size: 21px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1;
}
.app-desc {
  font-size: 13px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.app-pijl {
  font-size: 26px;
  color: var(--accent);
  flex: 0 0 auto;
  line-height: 1;
}
.app-kaart.komt-binnenkort {
  opacity: 0.6;
  cursor: default;
}
.badge-soon {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  background: var(--surface-hi);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* Merk in de app-topbalk (logo + naam) */
.merk {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}
.merk img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: 0 0 auto;
}
.merk h1 {
  flex: initial;
  font-size: 22px;
}

/* ================= Modal (label-comment popup) ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 20px;
}
.modal h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  font-family: 'Barlow Condensed', sans-serif;
}
.modal .modal-sub {
  color: var(--dim);
  font-size: 13.5px;
  margin: 0 0 14px;
}
.modal input {
  margin-bottom: 16px;
}
.modal-knoppen {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ================= Taken-app ================= */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: 0 0 auto;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.chip.actief {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.taak-lijst {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.taak-rij {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease;
}
.taak-rij:active {
  transform: scale(0.99);
}
@media (hover: hover) {
  .taak-rij:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  }
}
.status-knop {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--faint);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 14px;
  font-weight: 800;
}
.status-knop.klaar {
  background: var(--good);
  border-color: var(--good);
  color: #04210f;
}
.taak-mid {
  flex: 1;
  min-width: 0;
}
.taak-titel {
  font-weight: 600;
  font-size: 15.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taak-titel.done {
  text-decoration: line-through;
  color: var(--dim);
}
.taak-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 5px;
  flex-wrap: wrap;
}
.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.status-te_doen {
  background: color-mix(in srgb, var(--dim) 22%, transparent);
  color: var(--dim);
}
.status-bezig {
  background: var(--accent-dim);
  color: var(--accent);
}
.status-wachten {
  background: color-mix(in srgb, var(--purple) 22%, transparent);
  color: var(--purple);
}
.status-klaar {
  background: color-mix(in srgb, var(--good) 20%, transparent);
  color: var(--good);
}
.pill.deadline {
  background: var(--surface-hi);
  color: var(--dim);
}
.pill.deadline.te-laat {
  background: color-mix(in srgb, var(--bad) 20%, transparent);
  color: var(--bad);
}
.pill.prio-hoog {
  background: color-mix(in srgb, var(--bad) 20%, transparent);
  color: var(--bad);
}
.pill.prio-laag {
  background: var(--surface-hi);
  color: var(--faint);
}
.pill.bijlage {
  background: var(--surface-hi);
  color: var(--dim);
}

/* Segmented control (status/prioriteit in detail + modal) */
.segment {
  display: flex;
  gap: 2px;
  background: var(--surface-hi);
  border-radius: 11px;
  padding: 3px;
}
.segment button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
}
.segment button.actief {
  background: var(--accent);
  color: var(--accent-ink);
}

.veld-rij {
  display: flex;
  gap: 12px;
}
.veld-rij > div {
  flex: 1;
  min-width: 0;
}

/* Bijlagen */
.bijlage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin: 4px 0 10px;
}
.bijlage-foto {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-hi);
}
.bijlage-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bijlage-bestand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  margin-bottom: 8px;
}
.bijlage-bestand .ic {
  font-size: 22px;
  flex: 0 0 auto;
}
.bijlage-bestand .naam {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 14px;
}
.bijlage-bestand .grootte {
  color: var(--dim);
  font-size: 12px;
  flex: 0 0 auto;
}
.bijlage-verwijder {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bestand-verwijder {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--bad);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
}
.geen-bijlagen {
  color: var(--faint);
  font-style: italic;
  font-size: 13.5px;
  margin: 2px 0 4px;
}

/* ================= Foto-galerij + batch-acties ================= */
.galerij {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  padding-bottom: 150px; /* ruimte voor de actiebalk */
}
.gal-cel {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-hi);
  cursor: pointer;
}
.gal-cel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gal-cel .vink {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-weight: 800;
  font-size: 14px;
}
.gal-cel.select-mode .vink {
  display: flex;
}
.gal-cel.geselecteerd {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.gal-cel.geselecteerd .vink {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.actiebalk {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + var(--sab));
  box-shadow: var(--sh-lg);
}
.actiebalk-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
}
.actiebalk-top .linkje {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.actiebalk-knoppen {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.actiebalk-knoppen::-webkit-scrollbar {
  display: none;
}
.ab-knop {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-hi);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.ab-knop:active {
  transform: scale(0.97);
}
.ab-knop.primair {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
}
