/* =====================================================
   Feedback-modal + detail. Identiek in OMS, PMS en KMS: alleen de gedeelde
   thematokens, en `.modal` volledig overschreven omdat die per app een andere
   padding, scroll en hoogte heeft.
   ===================================================== */

/* Boven elke andere modal: het venster wordt ook geopend vanuit een modal die al open is. */
#feedbackModal       { z-index: 2000; }
#feedbackDetailModal { z-index: 2010; }

/* Elementen hieronder krijgen een eigen display; zonder dit wint dat van het hidden-attribuut. */
.fbm-overlay [hidden] { display: none !important; }

.fbm-overlay {
  --fbm-rood:  var(--color-danger, #dc2626);
  --fbm-blauw:  var(--color-primary, #2563eb);
  --fbm-groen:  var(--color-success, #16a34a);
  --fbm-radius: 10px;
}

.fbm-overlay > .modal.fbm {
  padding: 0;
  width: min(1200px, calc(100vw - 32px));
  max-width: none;
  height: min(780px, calc(100vh - 32px));
  height: min(780px, calc(100dvh - 32px));
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Kop ──────────────────────────────────────────────────────────────── */

.fbm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.fbm-head-icoon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--fbm-radius);
  background: color-mix(in srgb, var(--fbm-blauw) 13%, transparent);
  color: var(--fbm-blauw);
}
.fbm-head-icoon svg { width: 19px; height: 19px; }
.fbm-head-tekst { min-width: 0; flex: 1 1 auto; }
.fbm-head-tekst h3 {
  margin: 0;
  font-size: 17px; font-weight: 700; line-height: 1.3;
  color: var(--text-heading);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fbm-head-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fbm-head .modal-close { align-self: flex-start; margin: -2px -6px 0 0; }

/* Soortkleur: rood voor een fout, blauw voor een wens. Gedeeld door kop, tegel en lijst. */
.fbm-soort-bug     { --fbm-soort: var(--fbm-rood); }
.fbm-soort-feature { --fbm-soort: var(--fbm-blauw); }
.fbm-head-icoon.fbm-soort-bug,
.fbm-head-icoon.fbm-soort-feature {
  background: color-mix(in srgb, var(--fbm-soort) 13%, transparent);
  color: var(--fbm-soort);
}

/* ── Twee kolommen ────────────────────────────────────────────────────── */

.fbm-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(400px, 500px) 1fr;
}

.fbm-kolomkop {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fbm-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border-color);
}
.fbm-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 8px;
}
.fbm-form-scroll > .fbm-kolomkop { margin-bottom: 14px; }

.fbm-veld { margin-bottom: 16px; }
.fbm-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.fbm-optioneel { font-weight: 400; color: var(--text-muted); margin-left: 4px; }

.fbm-overlay .fbm-input { width: 100%; box-sizing: border-box; }
.fbm-overlay textarea.fbm-input { resize: vertical; min-height: 120px; line-height: 1.5; }
.fbm-overlay .fbm-input.is-fout { border-color: var(--fbm-rood); }
.fbm-overlay .fbm-input.is-fout:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fbm-rood) 18%, transparent); }

.fbm-fout {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fbm-rood);
}

/* Soort: twee tegels, één keuze. */
.fbm-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fbm-type {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--fbm-radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit; font-size: 13px; font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.fbm-type:hover { border-color: color-mix(in srgb, var(--fbm-soort) 55%, var(--border-color)); }
.fbm-type:focus-visible { outline: 2px solid var(--fbm-soort); outline-offset: 2px; }
.fbm-type-icoon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg-subtle, var(--bg-page));
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.fbm-type-icoon svg { width: 16px; height: 16px; }
.fbm-type[aria-pressed="true"] {
  border-color: var(--fbm-soort);
  background: color-mix(in srgb, var(--fbm-soort) 7%, var(--bg-card));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fbm-soort) 12%, transparent);
}
.fbm-type[aria-pressed="true"] .fbm-type-icoon {
  background: var(--fbm-soort);
  color: #fff;
}

/* Sleepzone + voorbeeld. */
.fbm-drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 14px;
  border: 1.5px dashed var(--border-input, var(--border-color));
  border-radius: var(--fbm-radius);
  background: var(--bg-subtle, var(--bg-page));
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.fbm-drop:hover,
.fbm-drop.drag-over {
  border-color: var(--fbm-blauw);
  background: color-mix(in srgb, var(--fbm-blauw) 6%, var(--bg-card));
}
.fbm-drop:focus-visible { outline: 2px solid var(--fbm-blauw); outline-offset: 2px; }
.fbm-drop.is-fout { border-color: var(--fbm-rood); }
.fbm-drop svg { width: 22px; height: 22px; color: var(--text-muted); margin-bottom: 2px; }
.fbm-drop-tekst { font-size: 12.5px; color: var(--text-secondary); }
.fbm-drop-tekst strong { color: var(--text-primary); font-weight: 600; }
.fbm-drop-formaat { font-size: 11px; color: var(--text-muted); }

.fbm-preview {
  border: 1px solid var(--border-color);
  border-radius: var(--fbm-radius);
  overflow: hidden;
  background: var(--bg-subtle, var(--bg-page));
}
.fbm-preview img {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: contain;
  background: var(--bg-page);
}
.fbm-preview-regel {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--border-color);
  font-size: 11.5px;
  color: var(--text-secondary);
}
.fbm-preview-regel span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-preview-weg {
  flex-shrink: 0;
  border: 0; background: none; padding: 2px 4px;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--fbm-rood);
  cursor: pointer;
}
.fbm-preview-weg:hover { text-decoration: underline; }

/* Label/waarde-blok: meegestuurde gegevens, en in het detail de metagegevens. */
.fbm-dl {
  display: grid;
  grid-template-columns: minmax(100px, max-content) 1fr;
  gap: 4px 14px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--fbm-radius);
  background: var(--bg-subtle, var(--bg-page));
  font-size: 12.5px;
}
.fbm-dl dt { color: var(--text-muted); }
.fbm-dl dd { margin: 0; color: var(--text-primary); font-weight: 500; overflow-wrap: anywhere; }

.fbm-form-voet {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-modal);
}
.fbm-voet-melding { flex: 1 1 auto; min-width: 0; }
.fbm-voet-melding .fbm-fout { margin: 0; }
.fbm-verstuurd {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600;
  color: var(--fbm-groen);
  animation: fbm-in .25s ease;
}
.fbm-verstuurd svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Lijst ────────────────────────────────────────────────────────────── */

.fbm-lijst {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--bg-subtle, var(--bg-page));
}
.fbm-lijst-kop {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px 12px;
}

.fbm-filter {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--bg-card);
}
.fbm-filter-knop {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 0; border-radius: 6px;
  background: none;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.fbm-filter-knop:hover { color: var(--text-primary); }
.fbm-filter-knop:focus-visible { outline: 2px solid var(--fbm-blauw); outline-offset: 1px; }
.fbm-filter-knop[aria-selected="true"] {
  background: color-mix(in srgb, var(--fbm-blauw) 12%, transparent);
  color: var(--fbm-blauw);
}
.fbm-filter-aantal {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bg-subtle, var(--bg-page));
  font-size: 11px; line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.fbm-filter-aantal:empty { display: none; }
.fbm-filter-knop[aria-selected="true"] .fbm-filter-aantal { background: var(--bg-card); }

.fbm-lijst-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 22px 18px;
  display: flex; flex-direction: column; gap: 8px;
}

.fbm-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--fbm-radius);
  background: var(--bg-card);
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.fbm-item:hover {
  border-color: color-mix(in srgb, var(--fbm-blauw) 45%, var(--border-color));
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08));
}
.fbm-item:focus-visible { outline: 2px solid var(--fbm-blauw); outline-offset: 2px; }
.fbm-item.is-nieuw { animation: fbm-nieuw 1.6s ease; }

.fbm-item-icoon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--fbm-soort) 12%, transparent);
  color: var(--fbm-soort);
}
.fbm-item-icoon svg { width: 16px; height: 16px; }

.fbm-item-tekst { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fbm-item-titel {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fbm-item-meta {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fbm-punt { opacity: .6; }
.fbm-item-bijlage { display: inline-flex; margin-left: 3px; }
.fbm-item-bijlage svg { width: 13px; height: 13px; }

.fbm-item-pijl { display: flex; color: var(--text-muted); flex-shrink: 0; transition: transform .15s; }
.fbm-item-pijl svg { width: 16px; height: 16px; }
.fbm-item:hover .fbm-item-pijl { transform: translateX(2px); color: var(--text-secondary); }

/* Status: grijs = ontvangen, blauw = loopt, groen = klaar. Geen oranje: de gebruiker hoeft niets te doen. */
.fbm-status {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
  --fbm-st: var(--text-muted);
  background: color-mix(in srgb, var(--fbm-st) 13%, transparent);
  color: var(--fbm-st);
}
.fbm-status::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.fbm-status-in_behandeling { --fbm-st: var(--fbm-blauw); }
.fbm-status-afgehandeld    { --fbm-st: var(--fbm-groen); }

/* Laden / leeg / fout */
.fbm-skelet {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--fbm-radius);
  background: var(--bg-card);
}
.fbm-skelet-blok { width: 32px; height: 32px; border-radius: 8px; }
.fbm-skelet-regels { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.fbm-skelet-regels span { height: 10px; border-radius: 5px; }
.fbm-skelet-regels span:first-child { width: 62%; }
.fbm-skelet-regels span:last-child  { width: 34%; }
.fbm-skelet-blok,
.fbm-skelet-regels span {
  background: var(--border-color);
  animation: fbm-puls 1.3s ease-in-out infinite;
}

.fbm-leeg {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 40px 20px;
  text-align: center;
}
.fbm-leeg-icoon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  margin-bottom: 4px;
}
.fbm-leeg-icoon svg { width: 22px; height: 22px; }
.fbm-leeg-titel { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.fbm-leeg-sub { font-size: 12.5px; color: var(--text-muted); max-width: 30ch; }

/* ── Detail ───────────────────────────────────────────────────────────── */

.fbm-overlay > .modal.fbm.fbm-detail {
  width: min(760px, calc(100vw - 32px));
  height: auto;
  max-height: min(860px, calc(100vh - 32px));
  max-height: min(860px, calc(100dvh - 32px));
}

.fbm-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 22px 20px;
}

.fbm-detail-status {
  margin: 0 -22px 18px;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle, var(--bg-page));
}
.fbm-stappen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0; padding: 0;
  list-style: none;
}
.fbm-stap {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center;
}
/* De verbindingslijn naar de vorige stap, van bol tot bol. */
.fbm-stap + .fbm-stap::before {
  content: '';
  position: absolute;
  top: 11px;
  right: calc(50% + 15px);
  left: calc(-50% + 15px);
  height: 2px;
  border-radius: 1px;
  background: var(--border-color);
}
.fbm-stap.is-gedaan::before,
.fbm-stap.is-huidig::before { background: var(--fbm-stap-kleur); }
.fbm-stappen { --fbm-stap-kleur: var(--fbm-blauw); }
.fbm-stappen[data-stap="2"] { --fbm-stap-kleur: var(--fbm-groen); }
.fbm-stappen[data-stap="0"] { --fbm-stap-kleur: var(--text-muted); }

.fbm-stap-bol {
  position: relative;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: #fff;
}
.fbm-stap-bol svg { width: 12px; height: 12px; }
.fbm-stap.is-gedaan .fbm-stap-bol {
  border-color: var(--fbm-stap-kleur);
  background: var(--fbm-stap-kleur);
}
.fbm-stap.is-huidig .fbm-stap-bol {
  border-color: var(--fbm-stap-kleur);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--fbm-stap-kleur) 16%, transparent);
}
.fbm-stap.is-huidig .fbm-stap-bol::after {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fbm-stap-kleur);
}
.fbm-stappen[data-stap="2"] .fbm-stap.is-huidig .fbm-stap-bol { background: var(--fbm-stap-kleur); }
.fbm-stappen[data-stap="2"] .fbm-stap.is-huidig .fbm-stap-bol::after { display: none; }

.fbm-stap-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.fbm-stap.is-gedaan .fbm-stap-label { color: var(--text-secondary); }
.fbm-stap.is-huidig .fbm-stap-label { color: var(--text-primary); font-weight: 700; }
.fbm-stappen-noot { margin-top: 12px; text-align: center; font-size: 11.5px; color: var(--text-muted); }

.fbm-detail-sectie + .fbm-detail-sectie { margin-top: 20px; }
.fbm-detail-sectie > .fbm-kolomkop { margin-bottom: 8px; }
.fbm-detail-tekst {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fbm-dl-plat { margin-top: 12px; }

.fbm-schot {
  position: relative;
  min-height: 120px;
  border: 1px solid var(--border-color);
  border-radius: var(--fbm-radius);
  overflow: hidden;
  background: var(--bg-subtle, var(--bg-page));
}
.fbm-schot a { display: block; cursor: zoom-in; }
.fbm-schot img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}
.fbm-schot.is-laden img { opacity: 0; }
.fbm-schot.is-laden::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid var(--border-color);
  border-top-color: var(--fbm-blauw);
  border-radius: 50%;
  animation: fbm-draai .8s linear infinite;
}
.fbm-schot-fout {
  padding: 44px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.fbm-detail-voet {
  flex-shrink: 0;
  display: flex; justify-content: flex-end;
  padding: 12px 22px;
  border-top: 1px solid var(--border-color);
}

@keyframes fbm-in    { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes fbm-puls  { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes fbm-draai { to { transform: rotate(360deg); } }
@keyframes fbm-nieuw {
  0%   { border-color: var(--fbm-groen); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fbm-groen) 20%, transparent); }
  100% { border-color: var(--border-color); box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fbm-overlay *, .fbm-overlay *::before, .fbm-overlay *::after { animation: none !important; transition: none !important; }
}

/* ── Smal scherm: één kolom, het geheel scrolt ────────────────────────── */

@media (max-width: 860px) {
  .fbm-overlay > .modal.fbm { height: calc(100vh - 24px); height: calc(100dvh - 24px); width: calc(100vw - 24px); }
  .fbm-body { display: block; overflow-y: auto; }
  .fbm-form { border-right: 0; border-bottom: 1px solid var(--border-color); }
  .fbm-form-scroll, .fbm-lijst-scroll { overflow: visible; }
  .fbm-head, .fbm-form-scroll, .fbm-form-voet, .fbm-lijst-kop, .fbm-lijst-scroll { padding-left: 16px; padding-right: 16px; }
  .fbm-detail-body { padding: 0 16px 18px; }
  .fbm-detail-status { margin: 0 -16px 18px; padding-left: 16px; padding-right: 16px; }
  .fbm-item-pijl { display: none; }
}
@media (max-width: 420px) {
  .fbm-types { grid-template-columns: 1fr; }
  .fbm-item { flex-wrap: wrap; }
  .fbm-item .fbm-status { margin-left: 44px; }
}
