/* Styling voor het werknemersportaal — bouwt voort op style.css */

html[data-theme="dark"] {
  --bg: #0a101c;
  --white: #121c2c;
  --text: #e8edf5;
  --muted: #9cabc0;
  --border: #28364a;
  --secondary: #1a3154;
  --primary: #5f8fff;
  --primary-dark: #82a7ff;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] body {
  color: var(--text);
}

.portaal {
  background: var(--bg);
  min-height: 100vh;
}

/* Layout met linkermenu (zijbalk) */
.portaal-layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.portaal-zijbalk {
  width: 240px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.zij-logo img {
  height: 44px;
  width: auto;
  display: block;
  margin-bottom: 10px;
  border-radius: 10px;
}

.zij-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.zij-nav a {
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.98rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.zij-nav a:hover {
  background: var(--secondary);
  color: var(--primary);
}

.zij-nav a.active {
  background: var(--primary);
  color: var(--white);
}

.zij-onder {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.zij-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  color: var(--text);
  transition: background-color 0.2s ease;
}

.zij-menu {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.portaal-menu-toggle { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.zij-user:hover,
.zij-user.active {
  background: var(--secondary);
}

.zij-user-naam {
  font-weight: 700;
}

.zij-user-rol {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.9rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--secondary);
}

.theme-toggle-icon {
  width: 1.15em;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
}

.theme-toggle-login {
  position: fixed;
  z-index: 2;
  top: 20px;
  right: 20px;
  background: var(--white);
}

.portaal-inhoud {
  flex: 1;
  min-width: 0;
  padding: 52px 32px 32px;
}

.inhoud-binnen {
  max-width: 1080px;
  margin: 0 auto;
}

.pagina-kop {
  margin-bottom: 24px;
}

.pagina-kop h1 {
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.pagina-kop p {
  color: var(--muted);
}

.pagina-kop-met-actie {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.pagina-kop-met-actie form {
  flex: 0 0 auto;
}

.portaal-hoofdactie {
  min-height: 48px;
  padding: 0 22px;
  font-size: 1rem;
}

/* Metrics */
.metric-blok-titel {
  font-size: 1.15rem;
  margin: 28px 0 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.metric {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(18, 45, 91, 0.12);
}

html[data-theme="dark"] .metric:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.38);
}

.metric-cijfer {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

.metric-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Grafieken */
.grafiek-card {
  margin-top: 16px;
}

.grafiek-titel {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-bar {
  fill: var(--primary);
  transition: fill 0.15s ease;
}

.chart-bar:hover {
  fill: var(--primary-dark);
}

.chart-as {
  stroke: var(--border);
  stroke-width: 2;
}

.chart-val {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-lab {
  fill: var(--muted);
  font-size: 12px;
}

.chart-leeg {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* Filterbalk */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.filterbar select,
.filterbar input[type="search"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--white);
  color: var(--text);
}

.filterbar input[type="search"] {
  flex: 1;
  min-width: 200px;
}

.sorteer-keuze {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-weight: 400;
}

.sorteer-keuze select {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 760px) {
  .sorteer-keuze { width: 100%; }
  .sorteer-keuze select { flex: 1 1 230px; }
}

/* Betaald-badge */
.betaald-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.betaald-ja {
  background: #eaf6ec;
  color: #1e6b2e;
}

.betaald-nee {
  background: #fdecd2;
  color: #8a5a00;
}

/* Schuif-toggle (bv. betaald) */
.form-veld label.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
  padding: 9px 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(18, 45, 91, 0.25);
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-slider {
  background: #2e9e4f;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle input:focus-visible + .toggle-slider {
  outline: 3px solid rgba(15, 95, 255, 0.28);
  outline-offset: 2px;
}

.toggle-tekst {
  font-weight: 600;
}

/* Zijbalk-link (wachtwoord wijzigen) */
.zij-link {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.zij-link:hover {
  color: var(--primary);
}

@media (max-width: 820px) {
  .portaal-layout {
    flex-direction: column;
  }
  .portaal-zijbalk {
    width: auto;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .zij-logo img {
    margin-bottom: 0;
  }
  .portaal-menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    margin-left: auto;
    place-content: center;
    gap: 5px;
    border: 0;
    border-radius: 11px;
    background: var(--secondary);
    cursor: pointer;
  }
  .portaal-menu-toggle > span:not(.sr-only) {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
  }
  .zij-menu {
    display: none;
    flex: 0 0 100%;
    gap: 14px;
    padding-top: 8px;
  }
  .portaal-zijbalk.menu-open .zij-menu { display: flex; }
  .zij-nav {
    flex-direction: column;
    margin-top: 0;
  }
  .zij-onder {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .portaal-inhoud {
    padding: 32px 20px 20px;
  }
}

/* Kaarten / secties in het portaal */
.portaal-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 22px;
}

.portaal-card h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* Inlog-scherm */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(15, 95, 255, 0.12), transparent 40%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}

.login-card .logo-img {
  height: 52px;
  width: auto;
  margin-bottom: 24px;
  border-radius: 12px;
}

.login-card h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-card p.sub {
  color: var(--muted);
  margin-bottom: 24px;
}

.form-veld {
  margin-bottom: 18px;
}

.form-veld label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.form-veld input,
.form-veld select,
.form-veld textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  background: var(--white);
}

.form-veld input:focus,
.form-veld select:focus,
.form-veld textarea:focus {
  outline: 3px solid rgba(15, 95, 255, 0.22);
  border-color: var(--primary);
}

.form-melding {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.form-melding.fout {
  background: #fdecec;
  border: 1px solid #f5c2c2;
  color: #a12020;
}

.form-melding.ok {
  background: #eaf6ec;
  border: 1px solid #b7e0bf;
  color: #1e6b2e;
}

/* Formulier gebruiker toevoegen */
.gebruiker-form {
  margin-top: 20px;
  max-width: 460px;
}

/* Tabellen */
.tabel-scroll {
  overflow-x: auto;
}

.portaal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.portaal-table th,
.portaal-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.95rem;
}

.portaal-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.portaal-table .rij-inactief {
  opacity: 0.55;
}

.jij {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 4px;
}

.rol-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--primary-dark);
  margin: 0 4px 4px 0;
}

/* Rol-keuze (vinkjes) in het toevoegformulier */
.rol-keuze {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-veld label.rol-optie {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin-bottom: 0;
  font-weight: 500;
  line-height: 18px;
  cursor: pointer;
}

.form-veld label.rol-optie input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  transform: translateY(-1px);
  accent-color: var(--primary);
  cursor: pointer;
}

.status {
  font-weight: 700;
  font-size: 0.85rem;
}

.status-actief {
  color: #1e6b2e;
}

.status-inactief {
  color: #a12020;
}

.tabel-acties {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.rol-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rol-beheer {
  min-width: 190px;
}

.rol-beheer summary {
  list-style: none;
  width: max-content;
}

.rol-beheer summary::-webkit-details-marker {
  display: none;
}

.rol-beheer[open] summary {
  margin-bottom: 10px;
}

.rol-beheer .rol-edit {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.rol-edit-vinkjes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rol-beheer .rol-edit-vinkjes {
  flex-direction: column;
  width: 100%;
}

.rol-edit-vinkjes label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
}

.rol-edit-vinkjes input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-form input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  width: 150px;
}

.btn-mini {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.btn-danger {
  background: #c0392b;
  color: var(--white);
}

.btn-danger:hover {
  background: #a93226;
}

/* Dossiers */
.status-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-nieuw {
  background: #fdecd2;
  color: #8a5a00;
}

.status-toegewezen {
  background: #e0ecff;
  color: #0a3fa8;
}

.status-afgerond {
  background: #eaf6ec;
  color: #1e6b2e;
}

.form-rij {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.portaal-main textarea {
  min-height: 96px;
  resize: vertical;
}

.knop-rij {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.record-nummer {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  align-self: center;
  min-height: 48px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--secondary);
  white-space: nowrap;
}
.record-nummer-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
}
.record-nummer strong {
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.betaald-nvt { background: #eef1f5; color: #596579; }

.document-type {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--primary-dark);
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}
.document-type-bonnetje { background: #eaf6ec; color: #1e6b2e; }
.document-type-factuur { background: #eaf0ff; color: #244f9b; }
.document-type-contract { background: #f0eaff; color: #6641a5; }
.document-type-overig { background: #eef1f5; color: #596579; }
.document-status-niet_behandeld { background: #fff2d8; color: #8a5a00; }
.document-status-behandeld { background: #eaf6ec; color: #1e6b2e; }
.tabel-subtekst { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; }
.documenten-table td:nth-child(3) { min-width: 190px; }
.documenten-table td:nth-child(7) { max-width: 230px; overflow-wrap: anywhere; }
.document-bestand input[type="file"] { padding: 10px; }
.document-bestand input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--secondary); color: var(--primary-dark); font: inherit; font-weight: 700; cursor: pointer; }
.document-preview { display: grid; place-items: center; padding: 18px; }
.document-preview img { display: block; max-width: 100%; max-height: 680px; border-radius: 10px; object-fit: contain; }
.document-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 18px; }
.document-preview-grid a { display: grid; place-items: center; min-height: 220px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.document-preview-grid img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.document-bestanden-card h2 { margin-bottom: 14px; }
.document-bestanden-lijst { display: grid; gap: 10px; }
.document-bestand-regel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.document-bestand-regel > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.document-bestand-regel strong,
.document-bestand-regel span { display: block; }
.document-bestand-regel span { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.document-bestand-acties { display: flex; flex: 0 0 auto; gap: 8px; }
.document-bestand-acties form { margin: 0; }
.document-opslaan { justify-content: flex-end; margin-top: 4px; }

.dossier-afronden { margin-left: auto; }
.klant-naam-rij > .form-veld { grid-column: 1 / -1; }

.info-lijst {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 18px;
  margin: 0;
}

.info-lijst dt {
  color: var(--muted);
  font-weight: 600;
}

.info-lijst dd {
  margin: 0;
}

/* Eigen profiel */
.profiel-melding {
  width: 100%;
}

.profiel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.profiel-grid .portaal-card {
  margin-bottom: 0;
  height: 100%;
}

.profiel-wachtwoord-card {
  grid-column: 1 / -1;
}

.profiel-form {
  margin-top: 20px;
}

.profiel-info {
  margin-top: 20px;
}

/* Donkere modus: contrast voor componenten met vaste lichte kleuren */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .zij-nav a.active,
html[data-theme="dark"] .btn-danger {
  color: #fff;
}

html[data-theme="dark"] .inline-form input {
  color: var(--text);
  background: var(--white);
}

html[data-theme="dark"] .form-melding.fout {
  background: #351c25;
  border-color: #663040;
  color: #ffabb8;
}

html[data-theme="dark"] .form-melding.ok {
  background: #142d24;
  border-color: #275641;
  color: #8cddb0;
}

html[data-theme="dark"] .betaald-ja,
html[data-theme="dark"] .status-afgerond {
  background: #173627;
  color: #8cddb0;
}

html[data-theme="dark"] .betaald-nee,
html[data-theme="dark"] .status-nieuw {
  background: #3a2b14;
  color: #f2c873;
}

html[data-theme="dark"] .status-toegewezen {
  background: #172e55;
  color: #9dbdff;
}

html[data-theme="dark"] .status-actief {
  color: #8cddb0;
}

html[data-theme="dark"] .status-inactief {
  color: #ffabb8;
}

@media (max-width: 560px) {
  .portaal-card { padding: 22px 20px; }

  .profiel-grid {
    grid-template-columns: 1fr;
  }

  .profiel-wachtwoord-card {
    grid-column: auto;
  }

  .pagina-kop h1 {
    font-size: 2rem;
  }

  .pagina-kop-met-actie {
    align-items: stretch;
    flex-direction: column;
  }

  .pagina-kop-met-actie .portaal-hoofdactie {
    width: 100%;
  }

  .form-rij {
    grid-template-columns: 1fr;
  }
  .info-lijst {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .info-lijst dd {
    margin-bottom: 10px;
  }
}

/* Dossierwerkproces */
.status-te_plannen { background: #fff4d6; color: #795900; }
.status-ingepland { background: #e0ecff; color: #0a3fa8; }
.status-in_uitvoering { background: #eee5ff; color: #6235a5; }
.status-geannuleerd { background: #f1f3f6; color: #5f6f89; }

.dossier-kop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin: 18px 0 28px;
}

.dossier-kop-regel,
.dossier-kop-acties,
.dossier-kerngegevens {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.dossier-kop-regel { gap: 12px; }
.dossier-kop-acties { align-items: flex-start; gap: 10px; }
.dossier-kerngegevens { gap: 8px 20px; margin-top: 12px; font-size: 0.92rem; font-weight: 700; }
.dossier-kerngegevens span::before { content: "•"; margin-right: 8px; color: var(--primary); }

.dossier-kop h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dossier-kop > div > p { margin: 7px 0 0; color: var(--muted); font-weight: 600; }

.meer-acties { position: relative; }
.meer-acties summary { list-style: none; }
.meer-acties summary::-webkit-details-marker { display: none; }
.meer-acties-menu {
  position: absolute;
  z-index: 4;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.meer-acties-menu button,
.meer-acties-menu a {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.meer-acties-menu button:hover,
.meer-acties-menu a:hover { background: var(--secondary); }
.meer-acties-menu .tekst-gevaar { color: #b52c2c; }

.dossier-twee-kolommen {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.dossier-twee-kolommen .portaal-card { height: calc(100% - 22px); }
.dossier-tussenactie { display: flex; justify-content: flex-end; margin: -4px 0 22px; }
.aanvraag-card { position: relative; display: flex; flex-direction: column; }
.aanvraag-card .bron-badge { align-self: flex-start; }
.aanvraag-omschrijving { display: flex; flex: 1; flex-direction: column; }
.aanvraag-omschrijving textarea { flex: 1; }

.bron-badge,
.optioneel {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 800;
  vertical-align: middle;
}

.optioneel { margin: 0 0 0 6px; font-size: 0.7rem; text-transform: uppercase; }
.contact-voorkeur { margin-top: 4px; color: var(--muted); }
.dossier-form textarea,
.uitvoering-card textarea { min-height: 120px; resize: vertical; }

[data-dienst-anders]:not([hidden]) { margin-top: 10px; }

.dossier-planning-velden { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dossier-planning-velden input[type="datetime-local"],
.dossier-planning-velden select { height: 50px; }
.uitvoering-velden { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.klant-adres-velden { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tekst-gevaar { color: #b52c2c; }
.klant-dossiers-kop { margin: 0 0 18px; }
.klant-dossiers-kop h2 { margin: 0; }
.bevestigingsmail-card .toggle { align-items: flex-start; }
.bevestigingsmail-card .toggle-slider { margin-top: 2px; }
.formulier-hulp { color: var(--muted); font-size: 0.84rem; font-weight: 500; }
.toggle input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

.prijs-invoer {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.prijs-invoer:focus-within { outline: 3px solid rgba(15, 95, 255, 0.22); border-color: var(--primary); }
.prijs-invoer span { padding-left: 14px; color: var(--muted); font-weight: 700; }
.prijs-invoer input { border: 0; outline: 0 !important; }

.administratie-samenvatting {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.administratie-samenvatting > div { display: flex; flex-direction: column; gap: 4px; }
.administratie-label { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.administratie-card .betaling-form {
  display: grid;
  grid-template-columns: minmax(140px, .75fr) minmax(175px, auto) minmax(175px, auto) minmax(240px, 1.4fr) auto;
  gap: 16px;
  align-items: end;
}
.betaalstatus {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
}
.betaalstatus::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.betaalstatus-betaald { color: #1e7a38; }
.betaalstatus-open { color: #a66800; }
.administratie-card .form-veld { margin-bottom: 0; }
.betaling-toggle .veld-label { display: block; min-height: 18px; margin-bottom: 6px; font-size: .95rem; font-weight: 700; }
.betaling-toggle .toggle { min-height: 50px; padding: 0; white-space: nowrap; }
.betaling-actie .btn { min-height: 50px; padding-inline: 20px; }
label.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }

@media (max-width: 1100px) and (min-width: 761px) {
  .administratie-card .betaling-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .betaling-reden { grid-column: 1 / -1; }
  .betaling-actie { grid-column: 1 / -1; }
  .betaling-actie .btn { width: 100%; }
}

.historie-lijst { margin: 22px 0 0; padding: 0; list-style: none; }
.historie-lijst li { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 20px; }
.historie-lijst li:not(:last-child)::before { content: ""; position: absolute; top: 13px; bottom: 0; left: 6px; width: 2px; background: var(--border); }
.historie-punt { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 4px; border: 3px solid var(--white); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.historie-lijst strong,
.historie-lijst li div span { display: block; }
.historie-lijst li div span { margin-top: 3px; color: var(--muted); font-size: 0.82rem; }

html[data-theme="dark"] .status-te_plannen { background: #3a2b14; color: #f2c873; }
html[data-theme="dark"] .status-ingepland { background: #172e55; color: #9dbdff; }
html[data-theme="dark"] .status-in_uitvoering { background: #30204a; color: #cbb0ff; }
html[data-theme="dark"] .status-geannuleerd { background: #252d39; color: #aeb9ca; }

@media (max-width: 760px) {
  .dossier-kop,
  .dossier-kop-acties { flex-direction: column; width: 100%; }
  .dossier-kop h1 { font-size: 2rem; }
  .dossier-twee-kolommen,
  .dossier-planning-velden,
  .uitvoering-velden,
  .klant-adres-velden,
  .administratie-samenvatting { grid-template-columns: 1fr; }
  .dossier-twee-kolommen .portaal-card { height: auto; }
  .dossier-tussenactie .btn { width: 100%; }
  .administratie-card .betaling-form { grid-template-columns: 1fr; align-items: stretch; }
  .betaling-actie .btn { width: 100%; }
  .document-opslaan .btn { width: 100%; }
  .document-bestand-regel { align-items: stretch; flex-direction: column; }
  .document-bestand-acties { flex-wrap: wrap; }
  .document-bestand-acties .btn { flex: 1 1 auto; }
}

/* Vinkjeslijst (meerdere werknemers toewijzen) */
.dossier-werknemers-veld {
  grid-column: 1 / -1;
}

.checkbox-lijst {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 4px 0 0;
}

.checkbox-optie {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.checkbox-optie:hover,
.checkbox-optie:has(input:checked) {
  border-color: var(--primary);
  background: var(--secondary);
}

.checkbox-optie:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(15, 95, 255, 0.2);
}

.checkbox-optie input {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin: 0;
  transform: translateY(2px);
  accent-color: var(--primary);
  cursor: pointer;
}

.leeg-tekst {
  color: var(--muted);
  font-size: 0.9rem;
}
