/* ux-labels 26-10: punaise (vastzetten) en labels per bedrijf (routes/labels.js). Rustige kleuren; tekst altijd in
   --text op een lichte tint van de labelkleur, zodat het contrast in licht en donker goed blijft. */
.dl-kleur-grijs { --lc: #9ca3af; } .dl-kleur-blauw { --lc: #60a5fa; } .dl-kleur-groen { --lc: #4ade80; } .dl-kleur-geel { --lc: #facc15; }
.dl-kleur-oranje { --lc: #fb923c; } .dl-kleur-rood { --lc: #f87171; } .dl-kleur-paars { --lc: #c084fc; } .dl-kleur-roze { --lc: #f472b6; }
html[data-theme="light"] .dl-kleur-grijs { --lc: #6b7280; } html[data-theme="light"] .dl-kleur-blauw { --lc: #2563eb; }
html[data-theme="light"] .dl-kleur-groen { --lc: #15803d; } html[data-theme="light"] .dl-kleur-geel { --lc: #a16207; }
html[data-theme="light"] .dl-kleur-oranje { --lc: #c2410c; } html[data-theme="light"] .dl-kleur-rood { --lc: #b91c1c; }
html[data-theme="light"] .dl-kleur-paars { --lc: #7e22ce; } html[data-theme="light"] .dl-kleur-roze { --lc: #be185d; }
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .dl-kleur-grijs { --lc: #6b7280; } html:not([data-theme="dark"]) .dl-kleur-blauw { --lc: #2563eb; }
  html:not([data-theme="dark"]) .dl-kleur-groen { --lc: #15803d; } html:not([data-theme="dark"]) .dl-kleur-geel { --lc: #a16207; }
  html:not([data-theme="dark"]) .dl-kleur-oranje { --lc: #c2410c; } html:not([data-theme="dark"]) .dl-kleur-rood { --lc: #b91c1c; }
  html:not([data-theme="dark"]) .dl-kleur-paars { --lc: #7e22ce; } html:not([data-theme="dark"]) .dl-kleur-roze { --lc: #be185d; }
}

/* Chip */
.dl-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.dl-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 16em; padding: 1px 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lc, var(--muted)) 50%, transparent);
  background: color-mix(in srgb, var(--lc, var(--muted)) 16%, transparent);
  color: var(--text); font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dl-stip { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--lc, var(--muted)); }
.dl-chip-meer { --lc: var(--muted); color: var(--muted); }

/* Punaise */
.vast-icoon { display: inline-flex; align-items: center; color: var(--accent); }
.vast-icoon .vast-pin { fill: currentColor; fill-opacity: .25; }
.sidebar-vast-icoon { margin-right: 4px; vertical-align: -1px; }
.sidebar-vast-icoon svg { width: 11px; height: 11px; }
.chats-kaart-vast { margin-right: 6px; vertical-align: -2px; }

/* Chatkop: punaise + chips naast de titel */
.chat-kop-info { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.chat-kop-labels { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.chat-kop-labels[hidden] { display: none; }
.chat-kop-chips { flex-wrap: nowrap; overflow: hidden; }

/* Kaarten in Alle dossiers */
.chats-kaart-labels { margin: 4px 0 2px; }

/* Filter in Alle dossiers: zelfde vorm als de knop Bewaard */
.dl-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dl-filters[hidden] { display: none; }
#chatsList .dl-filter {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; min-height: 40px; padding: 0 12px; margin: 0;
  border: 1px solid var(--control-border); border-radius: 8px; background: var(--bg); color: var(--text);
  font-size: 14px; font-weight: 400; box-shadow: none; cursor: pointer; white-space: nowrap;
}
#chatsList .dl-filter:hover:not(:disabled) { border-color: var(--lc); background: var(--bg); }
#chatsList .dl-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#chatsList .dl-filter[aria-pressed="true"] { border-color: var(--lc); background: color-mix(in srgb, var(--lc) 22%, var(--bg)); font-weight: 600; }
.dl-filter .dl-teller { min-width: 18px; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); font-size: 11px; text-align: center; }
.dl-filter[aria-pressed="true"] .dl-teller { background: var(--lc); color: var(--bg); }

/* Venster (Labels… en verwijderen bevestigen) */
.dl-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.dl-venster { width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px 20px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.dl-venster-kop { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.dl-venster-kop h2 { margin: 0; font-size: 17px; }
button.dl-sluit { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -10px 0 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); box-shadow: none; }
button.dl-sluit:hover { color: var(--text); background: color-mix(in srgb, var(--muted) 14%, transparent); box-shadow: none; }
.dl-uitleg { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.dl-uitleg strong { color: var(--text); }
.dl-keuzes { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px 12px; }
.dl-keuze { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.dl-keuze:hover { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.dl-keuze input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dl-vink { flex: 0 0 20px; width: 20px; height: 20px; border: 2px solid var(--control-border); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; }
.dl-keuze input:checked + .dl-vink { border-color: var(--accent); background: var(--accent); }
.dl-keuze input:checked + .dl-vink::after { content: ""; width: 10px; height: 5px; border: 2px solid var(--opposite-text); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.dl-keuze input:focus-visible + .dl-vink { outline: 2px solid var(--accent); outline-offset: 2px; }
.dl-keuze .dl-chip { font-size: 14px; line-height: 22px; padding: 2px 10px; }
.dl-keuze.is-bezig { opacity: .6; cursor: progress; }
.dl-keuze-status { margin-left: auto; color: var(--muted); font-size: 12px; }
.dl-voet { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.dl-voet-rechts { justify-content: flex-end; }
.dl-voet button, .dl-beheer-link { min-height: 44px; }
.dl-beheer-link { display: inline-flex; align-items: center; color: var(--accent); font-size: 14px; }
.dl-hint { color: var(--muted); font-size: 13px; flex: 1 1 12em; }

/* Instellingen > Labels */
.dl-beheer-kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.dl-beheer-kop h2 { margin: 0; font-size: 16px; }
.dl-beheer-kop button, .dl-rij-acties button, .dl-form button { min-height: 44px; }
.dl-lijst { display: flex; flex-direction: column; }
.dl-rij { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.dl-rij-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.dl-rij-info .dl-chip { font-size: 14px; line-height: 22px; padding: 2px 10px; }
.dl-gebruik { color: var(--muted); font-size: 13px; }
.dl-rij-acties { display: flex; gap: 8px; }
.dl-rij.is-bewerken { display: block; }
.dl-form { padding: 12px 0; }
.dl-kleuren { margin: 8px 0 10px; padding: 0; border: 0; }
.dl-kleuren legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.dl-palet { display: flex; flex-wrap: wrap; gap: 4px; }
.dl-palet-kleur { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }
.dl-palet-kleur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dl-palet-kleur span { width: 26px; height: 26px; border-radius: 50%; background: var(--lc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.dl-palet-kleur input:checked + span { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--text); }
.dl-palet-kleur input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 5px; }
.dl-voorbeeld { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.dl-fout { color: var(--error); min-height: 1em; }
.dl-leeg p { margin: 8px 0; color: var(--muted); }

@media (max-width: 650px) {
  .chat-kop-info { flex-wrap: nowrap; }
  .chat-kop-chips .dl-chip { max-width: 7.5em; }
  .dl-overlay { align-items: flex-end; padding: 0; }
  .dl-venster { width: 100%; border-radius: 14px 14px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .dl-rij-acties { width: 100%; }
  .dl-rij-acties button { flex: 1; }
  #chatsList .dl-filter { height: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  .dl-venster { animation: dl-in .18s ease-out; }
  @keyframes dl-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Paletknoppen: algemene instellingen-labelmarges niet overnemen */
.dl-palet > label.dl-palet-kleur, .dl-palet > label.dl-palet-kleur + label.dl-palet-kleur { margin: 0; display: inline-flex; }
/* Labelfilter in Alle dossiers: wrappen binnen de beschikbare breedte (ux258); vaste knopbreedtes blijven */
.chats-filter-onder:has(> .dl-filters:not([hidden])) { flex-wrap: wrap; }
.chats-filter-onder > .dl-filters { flex: 1 1 100%; min-width: 0; max-width: 100%; }
@media (min-width: 651px) { .chats-filter-onder > .dl-filters { flex: 1 1 auto; min-width: 0; max-width: 100%; } }
/* Algemene label-regel uit styles.css (marges, blokweergave) niet laten doorwerken in de kiezer */
.dl-keuzes > label.dl-keuze, .dl-keuzes > label.dl-keuze:first-of-type { margin: 0; display: flex; font-size: inherit; color: inherit; font-weight: inherit; }
/* OF-filter: korte uitleg zodra er twee of meer labels gekozen zijn */
.dl-filter-uitleg { flex: 1 1 100%; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* Ster vervangen door labels: Bewaard-filter echt verbergen (ai-chip zet display) */
#bewaardFilterChip[hidden] { display: none !important; }

/* Dossierstatus-opdracht (Jeroen 29-10 21:07): labels in Alle dossiers rechts uitgelijnd op regel 1, dus recht boven
   'monteur · datum' op regel 2 ("aan de rechterkant uitgelijnd, dus boven de naam"). Extra specifiek omdat mobbin.css
   (later geladen) margin: 0 zet. */
#chatsList .mb-rij .mb-rij-titel > .mb-rij-chips { margin-left: auto; justify-content: flex-end; }

/* ux164 (Jeroen 31-10 01:06, punt 7): Labels als submenu in het ⋯-menu, zelfde opbouw als Status (dossierstatus.css ux148/ux150) */
.dl-menu-groep { position: relative; }
.chat-acties-menu .dl-menu-labels, .dm-menu .dl-menu-labels { width: 100%; }
.dl-menu-nu { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chat-acties-menu .dl-menu-groep.ds-groep-zwevend .ds-menu-status[aria-expanded]::after,
.chat-acties-menu .dl-menu-groep.ds-groep-zwevend .ds-menu-status[aria-expanded="true"]::after { transform: rotate(135deg) translate(-1px, 1px); margin-left: 8px; }
.chat-acties-menu .dl-menu-groep:not(.ds-groep-zwevend) .ds-menu-status[aria-expanded]::after { margin-left: 8px; }
.dl-sub.ds-sub-zwevend { max-height: min(60vh, 360px); overflow-y: auto; }
.dl-sub .ds-sub-naam { display: inline-flex; min-width: 0; }
.dl-sub .dl-chip { max-width: 100%; }
