﻿:root {
  color-scheme: light;
  --cavero-purple: #5b2c7a;
  --cavero-purple-soft: #f1e9f7;
  --cavero-purple-strong: #45225d;
  --cavero-accent-soft: #fff7dc;
  --cavero-accent: #d0a24a;
  --cavero-accent-strong: #5b2c7a;

  --color-bg-page: #f5f4f8;
  --color-bg-surface: #ffffff;
  --color-bg-elevated: #e8edf5;
  --color-bg-card: #ffffff;
  --color-bg-form: #ffffff;
  --color-bg-field: #f3f6fa;
  --color-bg-surface-soft: #eef2f7;
  --color-bg-soft: #fffdf5;
  --color-bg-soft-strong: #fffaf0;
  --color-bg-soft-warm: #fff9f1;
  --color-bg-soft-warm-strong: #fffdf6;
  --color-bg-soft-danger: #fff4f7;
  --color-bg-soft-success: #f3fbf7;
  --color-bg-soft-neutral: #faf9fc;
  --color-bg-side-start: #ffffff;
  --color-bg-side-end: #f8fafc;
  --color-bg-badge-warning: #fef3c7;
  --color-bg-badge-danger: #fee2e2;
  --color-bg-badge-neutral: #f3f4f6;

  --color-text-default: #1f2937;
  --color-text-strong: #111827;
  --color-text-muted: #6b7280;
  --color-text-subtle: #4b5563;
  --color-text-nav: #374151;
  --color-text-side: #3f3650;
  --color-text-warning: #5e4a22;
  --color-text-accent-muted: #5b4a68;
  --color-text-white: #ffffff;
  --color-text-danger: #b42318;
  --color-text-beheer-warning: #b56a1f;
  --color-text-beheer-danger: #a63b52;
  --color-text-beheer-success: #2f7a55;

  --color-border-default: #e4e0ea;
  --color-border-chrome: #e8edf5;
  --color-border-input: #c5ceda;
  --color-border-hairline: #edf1f6;
  --color-border-table: #e4e8ef;
  --color-border-soft: #eef1f6;
  --color-border-split: #e4dfeb;
  --color-border-side: #ded3ea;
  --color-border-neutral: #e5e7eb;
  --color-border-warning-soft: #f0d89a;

  --color-tone-warning: #c96a1a;
  --color-tone-danger: #b53a53;
  --color-tone-neutral: #6a5b7a;
  --color-tone-success: #2f7a55;

  --color-warning-strong: #f59e0b;
  --color-danger-strong: #dc2626;

  --color-btn-new-start: #6a2d91;
  --color-btn-new-end: #51296d;
  --color-btn-new-start-hover: #5f2a82;
  --color-btn-new-end-hover: #45225d;

  --color-overlay-surface: rgba(255, 255, 255, 0.98);
  --color-shadow-dropdown: rgba(15, 23, 42, 0.12);
  --color-shadow-card: rgba(31, 41, 55, 0.04);
  --shadow-level-1: 0 8px 24px -16px rgba(15, 23, 42, 0.12);
  --shadow-level-2: 0 14px 30px -18px rgba(15, 23, 42, 0.24);
  --shadow-level-3: 0 22px 46px -24px rgba(15, 23, 42, 0.3);
  --shadow-field-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --color-shadow-brand-btn: rgba(81, 41, 109, 0.26);
  --color-shadow-outline: rgba(91, 44, 122, 0.05);
  --color-focus-ring: rgba(91, 44, 122, 0.18);
  --color-inset-side: rgba(91, 44, 122, 0.24);
  --color-border-task-hover: rgba(208, 162, 74, 0.75);

  --color-link: var(--cavero-purple-strong);
  --color-link-hover: var(--cavero-purple);
  --color-nav-hover-bg: #f3eef8;
  --color-nav-hover-text: var(--cavero-purple-strong);
  --color-nav-active-bg: #f6f2fb;
  --color-nav-active-text: #41285b;
  --color-nav-active-ring: rgba(91, 44, 122, 0.18);
  --color-section-accent: var(--cavero-purple);
  --color-metric-accent: var(--cavero-purple);
  --color-table-header-bg: #d8e1ec;
  --color-table-header-text: #4e5a6d;
  --color-table-row-bg: var(--color-bg-surface);
  --color-table-row-alt-bg: #fbfcfe;
  --color-panel-header-bg: var(--color-bg-elevated);
  --color-panel-header-text: var(--color-text-strong);

  --status-success-bg: #e8f7ef;
  --status-success-text: #1f6a45;
  --status-success-border: #b9e5ca;
  --status-warning-bg: #fff4e5;
  --status-warning-text: #8a5a18;
  --status-warning-border: #f0c991;
  --status-danger-bg: #fdeaec;
  --status-danger-text: #9f243f;
  --status-danger-border: #efb3bf;
  --status-neutral-bg: #edf1f6;
  --status-neutral-text: #4b5563;
  --status-neutral-border: #cfd7e3;
  --status-permission-bg: #eee7ff;
  --status-permission-text: #5b2c7a;
  --status-permission-border: #b99cdd;

  --border: var(--color-border-default);
  --text: var(--color-text-default);
}

[data-theme="dark"] {
  color-scheme: dark;
  --cavero-purple-soft: #352d46;
  --cavero-accent-soft: #3d3321;
  --cavero-purple: #9f7aea;

  --color-bg-page: #1b2029;
  --color-bg-surface: #242b36;
  --color-bg-elevated: #2d3543;
  --color-bg-card: #242b36;
  --color-bg-form: #2a3240;
  --color-bg-field: #313a49;
  --color-bg-surface-soft: #2d3543;
  --color-bg-soft: #2d3543;
  --color-bg-soft-strong: #333c4b;
  --color-bg-soft-warm: #302d35;
  --color-bg-soft-warm-strong: #36323b;
  --color-bg-soft-danger: #362b33;
  --color-bg-soft-success: #26352f;
  --color-bg-soft-neutral: #2a3240;
  --color-bg-side-start: #2d3543;
  --color-bg-side-end: #242b36;
  --color-bg-badge-warning: #4a3d2a;
  --color-bg-badge-danger: #4a2d36;
  --color-bg-badge-neutral: #343d4e;

  --color-text-default: #e4e9f1;
  --color-text-strong: #f3f6fb;
  --color-text-muted: #aeb8c8;
  --color-text-subtle: #c6d0de;
  --color-text-nav: #d5ddeb;
  --color-text-side: #d8e0ed;
  --color-text-warning: #ffe1ab;
  --color-text-accent-muted: #d4bedc;
  --color-text-white: #f5f7fb;
  --color-text-danger: #ffb4a9;
  --color-text-beheer-warning: #ffcb8f;
  --color-text-beheer-danger: #ff9ab2;
  --color-text-beheer-success: #84d7b0;

  --color-border-default: #3a4456;
  --color-border-chrome: #434f63;
  --color-border-input: #4b5870;
  --color-border-hairline: rgba(156, 170, 191, 0.16);
  --color-border-table: #3f495c;
  --color-border-soft: #3a4456;
  --color-border-split: #455063;
  --color-border-side: #445064;
  --color-border-neutral: #4a556a;
  --color-border-warning-soft: #6a5736;

  --color-tone-warning: #ffaf53;
  --color-tone-danger: #ff7b9a;
  --color-tone-neutral: #99a8c6;
  --color-tone-success: #73c9a2;

  --color-warning-strong: #ffb84d;
  --color-danger-strong: #ff6b85;

  --color-btn-new-start: #7f4db3;
  --color-btn-new-end: #5c3a86;
  --color-btn-new-start-hover: #8e5bc2;
  --color-btn-new-end-hover: #6d4898;

  --color-overlay-surface: rgba(36, 43, 54, 0.98);
  --color-shadow-dropdown: rgba(5, 8, 15, 0.55);
  --color-shadow-card: rgba(7, 10, 16, 0.35);
  --shadow-level-1: 0 12px 28px -16px rgba(5, 8, 15, 0.45);
  --shadow-level-2: 0 18px 38px -20px rgba(5, 8, 15, 0.6);
  --shadow-level-3: 0 26px 54px -26px rgba(5, 8, 15, 0.75);
  --shadow-field-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --color-shadow-brand-btn: rgba(20, 14, 30, 0.45);
  --color-shadow-outline: rgba(148, 113, 201, 0.2);
  --color-focus-ring: rgba(148, 113, 201, 0.35);
  --color-inset-side: rgba(148, 113, 201, 0.22);
  --color-border-task-hover: rgba(208, 162, 74, 0.45);

  --color-link: #c6d2e3;
  --color-link-hover: #e2eaf6;
  --color-nav-hover-bg: #313948;
  --color-nav-hover-text: #eef2f9;
  --color-nav-active-bg: rgba(123, 88, 177, 0.2);
  --color-nav-active-text: #f2edff;
  --color-nav-active-ring: rgba(159, 125, 211, 0.5);
  --color-section-accent: var(--color-text-subtle);
  --color-metric-accent: var(--color-text-strong);
  --color-table-header-bg: var(--color-bg-elevated);
  --color-table-header-text: #d5ddeb;
  --color-table-row-bg: var(--color-bg-surface);
  --color-table-row-alt-bg: #2a3342;
  --color-panel-header-bg: var(--color-bg-elevated);
  --color-panel-header-text: var(--color-text-strong);

  --status-success-bg: #1f3a2f;
  --status-success-text: #9be4bf;
  --status-success-border: #2f5e4a;
  --status-warning-bg: #443724;
  --status-warning-text: #ffd39b;
  --status-warning-border: #6b5637;
  --status-danger-bg: #4b2a34;
  --status-danger-text: #ffb4c3;
  --status-danger-border: #71404e;
  --status-neutral-bg: #394253;
  --status-neutral-text: #d5ddeb;
  --status-neutral-border: #586479;
  --status-permission-bg: #3d2d52;
  --status-permission-text: #e8d7ff;
  --status-permission-border: #956fc0;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--color-bg-page);
  line-height: 1.55;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -120px;
  background: var(--color-text-strong);
  color: var(--color-text-white);
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--color-bg-surface);
  z-index: 1000;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--cavero-accent-strong);
  outline-offset: 2px;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  color: var(--color-link-hover);
}

.alert-info {
  background-color: var(--cavero-accent-soft);
  border-color: var(--color-border-warning-soft);
  color: var(--color-text-warning);
}

tr th,
tr td {
  border: 1px solid var(--color-border-hairline);
}

tr th {
  background-color: var(--color-table-header-bg);
}

h1, .page-title {
  font-size: 2.2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h2, .section-title {
  font-size: 1.45rem;
  line-height: 1.2;
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 700;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-level-1);
}

.site-header-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--color-bg-surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
}

.nav-toggle-line {
  width: 1rem;
  height: 2px;
  background: var(--cavero-purple);
  border-radius: 99px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.site-brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-surface);
  overflow: hidden;
}

.site-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.settings-logo-preview {
  width: 8rem;
  height: 8rem;
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.5rem;
  background: var(--color-bg-surface);
  overflow: hidden;
}

.settings-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.settings-logo-empty {
  min-height: 4rem;
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--color-border-subtle);
  border-radius: 0.5rem;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
}

.site-brand-name {
  font-weight: 700;
  color: var(--cavero-purple);
  line-height: 1.1;
}

.site-brand-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-left: auto;
}

.topnav-link {
  text-decoration: none;
  color: var(--color-text-nav);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topnav-link:hover {
  background: var(--color-nav-hover-bg);
  color: var(--color-nav-hover-text);
}

.topnav-link.active {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-text);
  box-shadow: inset 0 -2px 0 var(--cavero-purple), inset 0 0 0 1px var(--color-nav-active-ring);
}

.site-nav-dropdown {
  position: relative;
  padding-bottom: 0;
}

.topnav-dropdown-toggle {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.topnav-dropdown-caret {
  font-size: 0.8rem;
  opacity: 0.8;
}

.site-nav-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.45rem;
}

.site-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 13rem;
  max-width: min(18rem, calc(100vw - 2rem));
  display: none;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--color-overlay-surface);
  box-shadow: 0 18px 40px var(--color-shadow-dropdown);
  z-index: 20;
}

.site-nav-dropdown-help .site-nav-dropdown-menu {
  left: auto;
  right: 0;
}

.site-nav-dropdown-meldingen .site-nav-dropdown-menu {
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
}

.site-nav-dropdown-meldingen .site-nav-dropdown-item {
  white-space: nowrap;
}

.site-nav-dropdown-search .site-nav-dropdown-menu {
  left: auto;
  right: 0;
  min-width: 18rem;
  padding: 0.65rem;
}

.search-menu-toggle {
  min-width: 2.55rem;
  justify-content: center;
  gap: 0;
}

.global-search-form .form-control {
  min-width: 0;
}

[data-theme="dark"] .global-search-form .form-control::placeholder,
[data-theme="dark"] #global-search-query::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

.site-nav-dropdown:hover .site-nav-dropdown-menu,
.site-nav-dropdown:focus-within .site-nav-dropdown-menu {
  display: grid;
  gap: 0.2rem;
}

.site-nav-dropdown-item,
.site-nav-dropdown-item:visited {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  color: var(--color-text-nav);
  text-decoration: none;
  font-weight: 600;
}

.site-nav-dropdown-item.site-nav-dropdown-group-link {
  margin-top: 0.35rem;
  border-top: 1px solid var(--color-border-hairline);
  padding-top: 0.7rem;
  color: var(--color-text-strong);
  font-weight: 500;
}

.site-nav-dropdown-item.site-nav-dropdown-subitem {
  padding-left: 1.35rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.site-nav-dropdown-submenu {
  width: 100%;
}

.site-nav-dropdown-submenu > .site-nav-dropdown-group-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.35rem;
  border-top: 1px solid var(--color-border-hairline);
  border-radius: 12px;
  padding-top: 0.7rem;
  color: var(--color-text-strong);
  font-weight: 500;
}

/* Declared after the variant color rules above so hover always wins, regardless of item variant. */
.site-nav-dropdown-item:hover {
  background: var(--color-nav-hover-bg);
  color: var(--color-nav-hover-text);
}

.site-nav-dropdown-menu-nested {
  top: -0.45rem;
  left: calc(100% + 0.35rem);
  min-width: 15rem;
  margin: 0;
}

.site-nav-dropdown-menu > .site-nav-dropdown-submenu > .site-nav-dropdown-menu-nested {
  display: none;
}

.site-nav-dropdown-menu > .site-nav-dropdown-submenu:hover > .site-nav-dropdown-menu-nested,
.site-nav-dropdown-menu > .site-nav-dropdown-submenu:focus-within > .site-nav-dropdown-menu-nested {
  display: grid;
}

.site-nav-dropdown-submenu.opens-left > .site-nav-dropdown-menu-nested {
  left: auto;
  right: calc(100% + 0.35rem);
}

.site-nav-dropdown-submenu > .topnav-link .topnav-dropdown-caret {
  margin-left: auto;
  font-size: 0.7rem;
}

.site-nav-dropdown-submenu::after {
  content: "";
  position: absolute;
  top: 0;
  right: -0.45rem;
  bottom: 0;
  width: 0.55rem;
}

.site-nav-dropdown-submenu.opens-left::after {
  right: auto;
  left: -0.45rem;
}

.settings-section-nav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border: 1px solid var(--color-border-chrome);
  background: var(--color-bg-elevated);
}

.settings-section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--color-border-chrome);
  background: var(--color-bg-surface);
  color: var(--color-text-subtle);
  font-weight: 600;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.settings-section-link-external {
  cursor: pointer;
}

.settings-section-link:hover,
.settings-section-link:focus-visible,
.settings-section-link.is-active {
  background: var(--color-bg-card);
  color: var(--color-text-strong);
  text-decoration: none;
  box-shadow: inset 0 -2px 0 var(--cavero-purple);
}

.admin-landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.admin-landing-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--color-border-chrome);
  background: var(--color-bg-surface);
  color: var(--color-text-default);
  text-decoration: none;
}

.admin-landing-link:hover,
.admin-landing-link:focus-visible {
  border-color: var(--cavero-purple);
  background: var(--color-bg-elevated);
  color: var(--color-text-default);
  text-decoration: none;
}

.admin-landing-link strong {
  color: var(--color-text-strong);
}

.admin-landing-link span {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}


@media (max-width: 700px) {
  .admin-landing-grid {
    grid-template-columns: 1fr;
  }
}

.site-nav-dropdown-user {
  margin-left: 0.15rem;
}

.user-menu-toggle {
  min-width: 2.55rem;
  justify-content: center;
  gap: 0;
}

.user-menu-toggle .fa-user {
  font-size: 0.9rem;
  line-height: 1;
}

.user-menu-toggle.is-impersonating {
  color: #0f766e;
  background: color-mix(in srgb, #0f766e 18%, transparent);
  box-shadow: inset 0 -2px 0 #0f766e;
}

.user-menu-toggle.is-impersonating:hover,
.user-menu-toggle.is-impersonating:focus-visible,
.user-menu-toggle.is-impersonating[aria-expanded="true"] {
  color: #14b8a6;
  background: color-mix(in srgb, #0f766e 28%, transparent);
}

.site-nav-dropdown-user .site-nav-dropdown-menu {
  display: none;
}

.site-nav-dropdown-user:hover .site-nav-dropdown-menu,
.site-nav-dropdown-user:focus-within .site-nav-dropdown-menu {
  display: grid;
}

.site-nav-dropdown-user.open .site-nav-dropdown-menu {
  display: grid;
}

.site-nav-dropdown-menu-user {
  left: auto;
  right: 0;
  min-width: 19rem;
  padding: 0.65rem 0.75rem;
  gap: 0.6rem;
}

.user-menu-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.1rem 0.15rem 0.35rem;
  border-bottom: 1px solid var(--color-border-hairline);
}

.user-menu-group {
  display: grid;
  gap: 0.45rem;
}

.user-menu-group-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-subtle);
}

.user-menu-identity {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.15rem 0.8rem 0.35rem;
  color: var(--color-text-strong);
  line-height: 1.25;
}

.user-menu-identity strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.user-menu-identity span {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.user-menu-account-actions {
  display: grid;
  gap: 0.5rem;
}

.user-menu-account-actions form {
  margin: 0;
}

.user-menu-impersonation-alert {
  display: grid;
  gap: 0.35rem;
  margin: 0.65rem;
  padding: 0.75rem;
  border: 1px solid #0f766e;
  border-left-width: 3px;
  background: color-mix(in srgb, #0f766e 16%, var(--color-bg-elevated));
  color: var(--color-text-strong);
}

.user-menu-impersonation-alert span {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.btn-stop-impersonation {
  width: 100%;
  justify-content: center;
  margin-top: 0.35rem;
}

.reason-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(10 15 24 / 72%);
}

.reason-modal-card {
  width: min(100%, 36rem);
  border: 1px solid var(--color-border-chrome);
  border-radius: 0.8rem;
  background: var(--color-bg-form);
  box-shadow: var(--shadow-level-3);
}

.reason-modal-header,
.reason-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--color-border-chrome);
}

.reason-modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-chrome);
  border-bottom: 0;
}

.reason-modal-body {
  padding: 1.1rem;
}

.site-nav-dropdown-menu-user .role-switch-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.site-nav-dropdown-menu-user .role-switch-label {
  grid-column: 1 / -1;
  font-size: 0.78rem;
}

.site-nav-dropdown-menu-user .role-switch-select {
  min-width: 0;
  width: 100%;
}

.site-nav-dropdown-menu-user .theme-switch {
  width: fit-content;
}

.role-switch-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.role-switch-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.role-switch-select {
  width: auto;
  min-width: 9.5rem;
}

.site-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.page-toolbar-actions-only {
  justify-content: flex-end;
}

.content {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 2rem 0 2.25rem;
  flex: 1;
}

.page-hero {
  margin-bottom: 1.5rem;
}

.home-wireframe-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-layout .grid-stack {
  min-height: 0 !important;
}

.dashboard-block {
  min-width: 0;
}

.dashboard-layout-toolbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.dashboard-edit-toggle {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

/* Reviewkalender toolbar: periode-label gecentreerd tussen weergave en schaal. */
.review-cal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Eigen display zodat het hidden-attribuut werkt (Bootstrap d-flex zou hidden overschrijven). */
.review-cal-toolbar {
  display: flex;
}
.review-cal-toolbar[hidden] {
  display: none;
}

/* Het label neemt de vrije ruimte en centreert zichzelf; bij een smaller scherm
   schaalt het mee zonder over de knoppen te vallen. */
.review-cal-period-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-default);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Op smalle schermen mag de toolbar onder de weergave-schakelaar vallen en het
   label links uitgelijnd worden, zodat er nooit overlap ontstaat. */
@media (max-width: 1100px) {
  .review-cal-header {
    flex-wrap: wrap;
  }
  .review-cal-period-label {
    order: 3;
    flex-basis: 100%;
    text-align: left;
    margin-top: 0.25rem;
  }
}

/* Actielink onderaan een dashboard-widget: dezelfde look als 'Dashboard aanpassen',
   rechts uitgelijnd binnen de kaart. */
.dashboard-widget-action {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 0.5rem;
}

/* Reviewkalender: week-/maand-/jaarweergave */
.review-calendar {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: 0.6rem;
  padding: 1rem;
  box-shadow: var(--shadow-level-1);
}

.review-cal-grid {
  display: grid;
  gap: 4px;
}

.review-cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.review-cal-month { grid-template-columns: repeat(7, minmax(0, 1fr)); }

.review-cal-headrow { margin-bottom: 4px; }
.review-cal-dayhead {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-align: center;
  padding: 0.25rem 0;
}

.review-cal-day {
  position: relative;
  min-height: 4.5rem;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--color-border-soft);
  border-radius: 0.4rem;
  background: var(--color-bg-surface);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.review-cal-day:hover { border-color: var(--cavero-purple); }
.review-cal-day.is-out { opacity: 0.4; background: var(--color-bg-soft); }
.review-cal-day.is-today { border-color: var(--cavero-purple); box-shadow: inset 0 0 0 1px var(--cavero-purple); }
.review-cal-day.is-selected { background: var(--cavero-purple-soft); border-color: var(--cavero-purple); }

.review-cal-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-strong);
}

.review-cal-count {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--cavero-purple);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Jaarweergave: mini-maanden */
.review-cal-year {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1rem;
}

.review-cal-minimonth {
  border: 1px solid var(--color-border-soft);
  border-radius: 0.5rem;
  padding: 0.6rem;
  background: var(--color-bg-surface);
}

.review-cal-minimonth-title {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--color-text-strong);
  text-align: left;
  cursor: pointer;
}
.review-cal-minimonth-title:hover { color: var(--cavero-purple-strong); }

.review-cal-minigrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.review-cal-miniday {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  border-radius: 0.25rem;
  color: var(--color-text-default);
  cursor: pointer;
}
.review-cal-miniday.is-out { opacity: 0.3; }
.review-cal-miniday.is-today { outline: 1px solid var(--cavero-purple); font-weight: 700; }
.review-cal-miniday.is-selected { background: var(--cavero-purple-soft); }
.review-cal-miniday.has-events { background: var(--cavero-purple-soft); font-weight: 700; color: var(--cavero-purple-strong); }

/* Hover-popover met dagdetails */
.review-cal-popover {
  position: absolute;
  z-index: 1050;
  min-width: 16rem;
  max-width: 22rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-chrome);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-level-2);
  padding: 0.6rem;
}

.review-cal-popover-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.review-cal-popover-item {
  display: block;
  padding: 0.3rem 0.35rem;
  border-radius: 0.3rem;
  color: var(--color-text-default);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.3;
}
.review-cal-popover-item:hover { background: var(--cavero-purple-soft); color: var(--cavero-purple-strong); }

/* Actieve weergave-knoppen */
[data-review-view].active,
[data-cal-scale].active {
  background: var(--cavero-purple);
  border-color: var(--cavero-purple);
  color: #fff;
}

.dashboard-layout-toolbar-editing {
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border-chrome);
  border-radius: 0.45rem;
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-level-1);
}

.dashboard-layout-toolbar-actions,
.dashboard-add-block-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-widget-edit-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0.35rem 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--color-border-chrome);
  border-bottom: 0;
  border-radius: 0.35rem 0.35rem 0 0;
  background: var(--color-bg-elevated);
}

.dashboard-layout.is-editing .dashboard-block {
  cursor: grab;
}

.dashboard-layout.is-editing {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-layout.is-editing .dashboard-block:active {
  cursor: grabbing;
}

.dashboard-layout .grid-stack-placeholder > .placeholder-content {
  border: 1px dashed var(--cavero-purple);
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--cavero-purple-soft) 60%, transparent);
}

/* De panel moet zijn volledige content-hoogte kunnen aannemen zodat Gridstack (sizeToContent)
   de werkelijke benodigde hoogte meet. flex:none + height:auto voorkomt dat de panel wordt
   geklemd op de celhoogte en de inhoud laat overlopen of afkappen. */
.dashboard-layout .grid-stack > .grid-stack-item.dashboard-block > .grid-stack-item-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* In de leesweergave vult de kaart de volledige celhoogte, zodat er geen lege ruimte
   onder de kaart ontstaat wanneer de opgeslagen rasterhoogte groter is dan de inhoud.
   Alleen buiten de bewerkmodus; daar blijft de celhoogte leidend voor slepen/herschalen. */
.dashboard-layout:not(.is-editing) .grid-stack > .grid-stack-item.dashboard-block > .grid-stack-item-content > .wireframe-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.dashboard-layout.is-editing .grid-stack > .grid-stack-item.dashboard-block > .grid-stack-item-content > .wireframe-panel {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
}

.dashboard-widget-edit-header strong {
  margin-right: auto;
}

.dashboard-widget-remove {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
}

.dashboard-widget-remove .icon {
  width: 0.85rem;
  height: 0.85rem;
}

.dashboard-widget-remove:hover,
.dashboard-widget-remove:focus-visible {
  border-color: var(--color-border-chrome);
  color: var(--color-text-danger);
  background: var(--status-danger-bg);
}

.dashboard-widget-picker {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  z-index: 20;
  width: min(24rem, calc(100vw - 3rem));
  padding: 0.75rem;
  border: 1px solid var(--color-border-chrome);
  border-radius: 0.45rem;
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-level-1);
}

.dashboard-widget-picker.is-hidden {
  display: none;
}

.dashboard-widget-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.dashboard-block.is-hidden,
.dashboard-hidden-blocks {
  display: none;
}

.dashboard-add-blocks {
  grid-column: 1 / -1;
}

[data-theme="dark"] .dashboard-layout-toolbar-editing,
[data-theme="dark"] .dashboard-widget-edit-header,
[data-theme="dark"] .dashboard-widget-picker {
  background: var(--color-bg-elevated);
  border-color: var(--color-border-chrome);
}

@media (max-width: 640px) {
  .dashboard-layout-toolbar,
  .dashboard-layout-toolbar-editing {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-layout-toolbar-actions,
  .dashboard-widget-edit-header,
  .dashboard-add-block-list {
    width: 100%;
  }

  .dashboard-widget-edit-header strong {
    flex-basis: 100%;
    margin-right: 0;
  }

  .dashboard-widget-picker {
    top: 4.5rem;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
  }
}

.grid-stack-static .grid-stack-item {
  cursor: default;
}

.grid-stack-static .grid-stack-item > .ui-resizable-handle {
  display: none !important;
}

.dashboard-block > .wireframe-panel {
  height: auto;
}

.home-wireframe-row {
  display: grid;
  gap: 1rem;
}

.home-wireframe-row-two {
  grid-template-columns: 1fr 1fr;
}

.home-wireframe-row-three {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.home-wireframe-row-bottom {
  grid-template-columns: 2fr 1fr;
}

.home-wireframe-row-bottom {
  margin-top: 0.15rem;
}

.dashboard-open-meldingen {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* De grid met stoplichtpanelen neemt de vrije ruimte tussen de header en de
   actielink in, zodat de panelen meegroeien met de widgethoogte. */
.dashboard-open-meldingen .dashboard-open-meldingen-grid {
  flex: 1 1 auto;
  min-height: 0;
  align-content: stretch;
}

.dashboard-open-meldingen .dashboard-open-meldingen-grid .dashboard-status-card {
  min-height: 0;
  height: 100%;
}

/* De actielink blijft altijd volledig zichtbaar onderaan de widget. */
.dashboard-open-meldingen .dashboard-widget-action {
  flex: 0 0 auto;
  margin-top: 0.5rem;
  padding-top: 0;
}

.dashboard-open-meldingen-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
}

.wireframe-panel {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  padding: 0.9rem 1rem 0.8rem;
  box-shadow: var(--shadow-level-1);
  height: 100%;
}

.wireframe-panel-hero {
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, var(--color-bg-soft-neutral) 0%, var(--color-bg-surface) 100%);
}

.wireframe-eyebrow {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.wireframe-title {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  color: var(--color-text-strong);
}

.wireframe-subtitle {
  margin: 0.5rem 0 0;
  max-width: 34rem;
  color: var(--color-text-subtle);
  font-size: 1rem;
  line-height: 1.5;
}

.wireframe-panel-header {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.8rem;
}

.wireframe-attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.wireframe-attention-card,
.page-surface .wireframe-attention-list li + li {
  margin-top: 0;
}

.wireframe-attention-card {
  display: flex;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--status-neutral-bg);
  min-height: 7.5rem;
  box-sizing: border-box;
}

.wireframe-attention-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 0.15rem;
  width: 100%;
  height: 100%;
  padding: 0.9rem 1rem;
  color: var(--color-text-default);
  text-decoration: none;
  box-sizing: border-box;
}

.wireframe-attention-link-static {
  pointer-events: none;
}

.wireframe-attention-label {
  display: block;
  width: 100%;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: left;
  word-break: break-word;
}

.wireframe-attention-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 2.3rem;
  min-height: 2rem;
  padding: 0.1rem 0.45rem;
  margin-top: 0.45rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

.wireframe-attention-success {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
}

.wireframe-attention-success .wireframe-attention-label,
.wireframe-attention-success .wireframe-attention-value {
  color: var(--status-success-text);
}

.wireframe-attention-warning {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-border);
}

.wireframe-attention-warning .wireframe-attention-label,
.wireframe-attention-warning .wireframe-attention-value {
  color: var(--status-warning-text);
}

.wireframe-attention-danger {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
}

.wireframe-attention-danger .wireframe-attention-label,
.wireframe-attention-danger .wireframe-attention-value {
  color: var(--status-danger-text);
}

.wireframe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.wireframe-list-compact {
  gap: 0.15rem;
}

.wireframe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.45rem;
  border-bottom: 1px solid var(--color-border-soft);
}

.wireframe-item:last-child {
  border-bottom: 0;
}

.wireframe-item-news {
  align-items: flex-start;
  padding: 0.35rem 0;
  min-height: unset;
}

.wireframe-item-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.wireframe-item-label,
.wireframe-item-label a {
  color: var(--color-text-default);
  font-size: 0.96rem;
  line-height: 1.3;
  font-weight: 700;
}

.wireframe-item-description {
  color: var(--color-text-subtle);
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.wireframe-item-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-neutral);
  background: var(--color-bg-badge-neutral);
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text-strong);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wireframe-item-value:hover,
.wireframe-item-value:focus-visible {
  text-decoration: none;
  background: var(--color-bg-soft-neutral);
  border-color: var(--color-border-chrome);
  transform: translateY(-1px);
}

.wireframe-item-danger .wireframe-item-value {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--color-text-danger);
}

.wireframe-item-warning .wireframe-item-value {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-border);
  color: var(--color-text-beheer-warning);
}

.wireframe-panel-links .wireframe-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.wireframe-link-list li {
  display: flex;
  align-items: center;
  min-height: 2.4rem;
  border-bottom: 1px solid var(--color-border-soft);
}
.dashboard-review-signals .dashboard-review-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.dashboard-review-signals .summary-block {
  padding: 1rem 1rem 0.95rem;
}
.dashboard-review-signals .summary-label {
  font-size: 0.74rem;
}
.dashboard-review-signals .summary-value {
  font-size: 1.35rem;
  margin-top: 0.2rem;
}

.summary-block-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.summary-block-link:hover {
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-level-2);
}

.summary-block-link:focus-visible {
  outline: 3px solid var(--cavero-accent-strong);
  outline-offset: 1px;
}

.dashboard-status-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 0.4rem;
  border: 1px solid transparent;
  padding: 0.9rem 1rem;
  box-shadow: none;
  min-width: 0;
  overflow: hidden;
}

.dashboard-status-card .summary-label {
  color: var(--color-text-default);
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  font-size: clamp(0.72rem, 1.4vw, 0.95rem);
}

.dashboard-status-card .summary-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 2.3rem;
  min-height: 2rem;
  padding: 0.1rem 0.45rem;
  margin: 0.45rem 0 0;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 0.35rem;
  background: rgb(255 255 255 / 8%);
  color: var(--color-text-strong);
  font-size: 1.35rem;
  line-height: 1;
}

.dashboard-status-card.summary-tone-success {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
}

.dashboard-status-card.summary-tone-warning {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-border);
}

.dashboard-status-card.summary-tone-danger {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
}

.dashboard-status-card.summary-tone-success .summary-label,
.dashboard-status-card.summary-tone-success .summary-value {
  color: var(--status-success-text);
}

.dashboard-status-card.summary-tone-warning .summary-label,
.dashboard-status-card.summary-tone-warning .summary-value {
  color: var(--status-warning-text);
}

.dashboard-status-card.summary-tone-danger .summary-label,
.dashboard-status-card.summary-tone-danger .summary-value {
  color: var(--status-danger-text);
}

.wireframe-link-list li:last-child {
  border-bottom: 0;
}

.wireframe-link-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-text-default);
  text-decoration: none;
}

.wireframe-link-list a::before {
  content: none;
}

@media (max-width: 900px) {
  .home-wireframe-row-two,
  .home-wireframe-row-three,
  .dashboard-open-meldingen-grid {
    grid-template-columns: 1fr;
  }
}

.page-title {
  margin: 0;
}

.page-intro {
  margin: 0.6rem 0 0;
  max-width: 66ch;
  color: var(--color-text-subtle);
  font-size: 1.02rem;
}

.page-surface {
  background: transparent;
}

.editor-surface {
  background: var(--color-bg-form);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-level-1);
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.breadcrumb-nav {
  margin-bottom: 0.35rem;
}

.breadcrumb {
  --bs-breadcrumb-divider-color: var(--color-text-muted);
  --bs-breadcrumb-item-active-color: var(--color-text-default);
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--cavero-purple);
  text-decoration: none;
}

.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem 1.1rem;
  background: var(--color-bg-form);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-level-1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}

.filter-group-search {
  min-width: min(420px, 100%);
  flex: 1;
}

.filter-bar-privacy .filter-group-search {
  min-width: 0;
  flex: 1 1 auto;
}

.filter-bar-privacy {
  flex-wrap: nowrap;
}

.filter-bar-privacy .filter-group {
  min-width: 140px;
  flex: 0 0 auto;
}

.filter-bar-privacy .filter-group-search {
  min-width: 220px;
}

.filter-bar-privacy .filter-actions {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Keep the clear button on the same line for this specific filter bar. */
.filter-bar-privacy.filter-bar-actions-wrapped .filter-actions {
  flex-basis: auto;
  margin-left: auto !important;
  justify-content: flex-end;
  padding-top: 0;
  border-top: 0;
}

.search-input-shell {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.search-input-shell .form-control {
  min-height: 2.35rem;
}

.search-input-shell .form-control::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

.search-icon-btn {
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-subtle);
}

.required-mark {
  color: var(--color-text-danger);
  font-weight: 700;
  margin-left: 0.1rem;
}

.alert.validation-summary-valid {
  display: none;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-bar.filter-bar-actions-wrapped .filter-actions {
  flex-basis: 100%;
  margin-left: 0 !important;
  justify-content: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-split);
}

.filter-bar.filter-bar-actions-wrapped .filter-actions .btn {
  box-shadow: 0 0 0 1px var(--color-shadow-outline);
}

/* Privacy analyses filter bar must keep actions inline without divider. */
.filter-bar.filter-bar-privacy.filter-bar-actions-wrapped .filter-actions {
  flex-basis: auto !important;
  margin-left: auto !important;
  justify-content: flex-end;
  padding-top: 0 !important;
  border-top: 0 !important;
}

.filter-import {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.csv-import-form {
  display: inline;
}

.csv-import-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.4rem !important;
}

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex: 0 0 auto;
  fill: currentColor;
  vertical-align: -0.125em;
}

.icon-rotate-90 {
  transform: rotate(90deg);
}

.icon-rotate-180 {
  transform: rotate(180deg);
}

.table-sort-icon {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
}

.filter-import .form-control {
  min-width: 220px;
}

.table-shell {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-level-1);
}

.table-compact {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.table-compact th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-table-header-text);
  background: var(--color-table-header-bg);
  border-bottom: 1px solid var(--color-border-soft);
}

.js-register-index-shell .table-compact th {
  font-size: 0.75rem;
}

.table-compact th,
.table-compact td {
  padding: 1rem 0.95rem;
  vertical-align: top;
}

.permission-group-row th {
  padding-top: 1.25rem;
  padding-bottom: 0.45rem;
  border-bottom: 0;
  background: transparent;
  color: var(--color-text-accent-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-sort-link {
  color: inherit;
  text-decoration: none;
}

.table-sort-link:hover,
.table-sort-link:focus {
  color: var(--cavero-purple);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.table-pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.table-pagination-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.table-pagination-total {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.audit-json {
  max-width: 34rem;
  max-height: 18rem;
  overflow: auto;
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  border: 1px solid var(--color-border-chrome);
  background: var(--color-bg-soft);
  color: var(--color-text-default);
  font-size: 0.76rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.table-pagination .btn.disabled,
.table-pagination .btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.help-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #0b1020 38%, transparent);
}

.help-overlay-card {
  position: relative;
  width: min(760px, calc(100% - 2rem));
  margin: 5vh auto 0;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  box-shadow: var(--shadow-level-2);
  padding: 0;
}

.overlay-window-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-chrome);
  background: color-mix(in srgb, var(--color-bg-elevated) 56%, var(--color-bg-card));
  border-radius: 12px 12px 0 0;
}

.overlay-window-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--color-text-strong);
  font-weight: 600;
}

.overlay-window-entity {
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.overlay-window-separator {
  color: var(--color-text-muted);
}

.overlay-window-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-window-content {
  padding: 0.8rem 1.1rem 1rem;
}

.entity-preview-overlay-card {
  width: min(1180px, calc(100% - 2rem));
}

.entity-preview-overlay-body {
  margin-top: 0.45rem;
}

.entity-preview-loading {
  padding: 1rem 0.1rem;
}

.help-viewer {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  background: var(--color-bg-card);
  overflow: hidden;
}

.help-viewer-tabs {
  display: flex;
  gap: 0.15rem;
  padding: 0.5rem 0.5rem 0;
  background: color-mix(in srgb, var(--color-bg-elevated) 56%, var(--color-bg-card));
  border-bottom: 1px solid var(--color-border-chrome);
}

.help-viewer-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--color-text-subtle);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
}

.help-viewer-tab:hover {
  color: var(--color-text-strong);
}

.help-viewer-tab.active {
  background: var(--color-bg-card);
  border-color: var(--color-border-chrome);
  color: var(--color-text-strong);
}

.help-viewer-body {
  display: flex;
  min-height: 32rem;
}

.help-viewer-nav {
  width: 24rem;
  flex: 0 0 auto;
  border-right: 1px solid var(--color-border-chrome);
  padding: 0.75rem;
  overflow-y: auto;
  max-height: 70vh;
}

.help-viewer-panel {
  display: none;
}

.help-viewer-panel.active {
  display: block;
}

.help-viewer-content {
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  max-height: 70vh;
}

.help-viewer-content-title {
  margin-top: 0;
}

.help-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-subtle);
  margin-bottom: 0.75rem;
}

.help-breadcrumb-separator {
  color: var(--color-text-muted);
}

.help-tree,
.help-tree-children,
.help-index-list,
.help-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-tree-children {
  margin: 0.15rem 0 0.35rem 0.8rem;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 1px solid var(--color-border-chrome);
  border-radius: 0 6px 6px 0;
  background: transparent;
}

.help-tree-children .help-tree-link {
  position: relative;
  margin-left: 0.15rem;
  padding: 0.25rem 0.45rem;
  border-left: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 0.95em;
}

.help-tree-children .help-tree-link::before {
  content: none;
}

.help-tree-subpage {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.help-tree-node {
  margin: 0.1rem 0;
}

.help-tree-branch > summary {
  display: grid;
  grid-template-columns: 1.3rem minmax(0, 1fr);
  align-items: start;
  cursor: pointer;
  list-style: none;
}

.help-tree-branch > summary::-webkit-details-marker {
  display: none;
}

.help-tree-toggle {
  width: 0.8rem;
  height: 0.8rem;
  grid-column: 1;
  margin: 0.65rem 0.3rem 0 0.1rem;
  color: var(--color-text-muted);
  transition: transform 140ms ease;
}

.help-tree-branch[open] .help-tree-toggle {
  transform: rotate(90deg);
}

.help-tree-link {
  display: block;
  min-width: 0;
  grid-column: 2;
  white-space: normal;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  color: var(--color-text-nav);
  text-decoration: none;
  font-weight: 500;
}

.help-tree-link:hover {
  background: var(--color-nav-hover-bg);
  color: var(--color-nav-hover-text);
}

.help-tree-link.active {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-text);
  font-weight: 600;
}

.help-index-list li,
.help-search-results li {
  margin-bottom: 0.35rem;
}

.help-search-snippet {
  margin: 0.15rem 0 0 0.4rem;
  color: var(--color-text-subtle);
  font-size: 0.85rem;
}

.help-search-form {
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .help-viewer-body {
    flex-direction: column;
  }

  .help-viewer-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border-chrome);
    max-height: 40vh;
  }

  .help-viewer-content {
    max-height: none;
  }
}

.entity-preview-static {
  display: block;
  min-height: calc(1.5em + 0.75rem + 2px);
  white-space: pre-wrap;
}

.register-readonly-value {
  min-height: 0 !important;
  height: fit-content !important;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--color-bg-field) 72%, transparent);
  color: var(--color-text-default);
  white-space: normal;
  overflow-wrap: anywhere;
}

.register-readonly-value p:last-child {
  margin-bottom: 0;
}

.register-readonly-list {
  margin: 0;
  padding-left: 1.25rem;
}

/* DocumentLink-veld: bestaande link + SharePoint-upload */
.document-link-field {
  display: grid;
  gap: 0.5rem;
}

.document-link-current {
  display: flex;
  align-items: center;
  min-height: 0;
}

.document-link-current-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.document-link-upload {
  max-width: 100%;
}

.document-link-progress {
  height: 0.5rem;
}

.document-link-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 12, 24, 0.45);
}

.document-link-picker-card {
  width: min(640px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border-chrome);
  border-radius: 0.9rem;
  background: var(--color-bg-form);
  box-shadow: 0 1.5rem 3rem rgba(15, 12, 24, 0.35);
}

.document-link-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.document-link-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.document-link-picker-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-link-picker-crumb {
  border: 0;
  background: none;
  padding: 0;
  color: var(--cavero-purple-strong);
  font: inherit;
  cursor: pointer;
}

.document-link-picker-crumb:hover,
.document-link-picker-crumb:focus-visible {
  text-decoration: underline;
}

.document-link-picker-list {
  overflow-y: auto;
  min-height: 6rem;
  max-height: 50vh;
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--color-border-input);
  border-radius: 0.5rem;
  padding: 0.35rem;
  background: var(--color-bg-field);
}

.document-link-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--color-text);
  text-align: left;
}

.document-link-picker-item:hover,
.document-link-picker-item:focus-visible {
  background: color-mix(in srgb, var(--cavero-purple-soft) 42%, var(--color-bg-surface));
}

.document-link-picker-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-link-picker-meta {
  flex: 0 0 auto;
  font-size: 0.8rem;
}

.document-link-picker-empty {
  padding: 1rem;
}

.document-link-picker-actions {
  display: flex;
  justify-content: flex-end;
}

.register-readonly-main {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.register-readonly-field {
  align-self: start;
}

.entity-preview-richtext {
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border-input);
  border-radius: 0.5rem;
  background: var(--color-bg-field);
  box-shadow: var(--shadow-field-inset);
}

.entity-preview-readonly .entity-form-grid {
  align-items: start;
}

.entity-preview-readonly .relation-modal-set > .d-flex.gap-2,
.entity-preview-readonly .relation-modal-set > .d-flex.justify-content-between.align-items-center.gap-2.flex-wrap {
  align-items: flex-start !important;
}

.entity-readonly [data-rel-open],
.entity-readonly .relation-modal-backdrop,
.entity-readonly .relation-edit-icon,
.entity-readonly .btn-copy-icon,
.entity-readonly [data-rel-remove-id] {
  display: none !important;
}

.relation-fixed-context > .d-flex,
.relation-fixed-context > .relation-modal-backdrop {
  display: none !important;
}

.relation-modal-set {
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  background: var(--color-bg-form);
  box-shadow: var(--shadow-level-1);
  padding: 0.9rem;
}

.relation-modal-summary {
  margin-top: 0.45rem;
  font-size: 0.84rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.relation-linked-items {
  margin-top: 0.45rem;
}

.relation-linked-shell {
  border-radius: 10px;
}

.relation-linked-table {
  font-size: 0.88rem;
}

.entity-form .relation-linked-table th,
.entity-form .relation-modal-table th {
  font-size: 0.75rem;
}

.relation-linked-table th,
.relation-linked-table td {
  padding: 0.6rem 0.7rem;
  vertical-align: middle;
}

.relation-linked-table th:last-child,
.relation-linked-table td:last-child {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.diensten-tab-row {
  margin-top: 1rem;
  margin-bottom: 0;
}

.diensten-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 -1px;
  padding: 0.25rem 0.35rem 0;
  border: 1px solid var(--color-border-chrome);
  border-bottom: 0;
  border-radius: 0.8rem 0.8rem 0 0;
  background: color-mix(in srgb, var(--color-bg-elevated) 68%, var(--color-bg-surface));
}

.diensten-tab-btn {
  flex: 0 0 auto;
  border: 1px solid var(--color-border-chrome);
  border-bottom: 0;
  background: color-mix(in srgb, var(--color-bg-surface) 68%, var(--color-bg-elevated));
  color: var(--color-text-subtle);
  border-radius: 0.45rem 0.45rem 0 0;
  padding: 0.42rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.diensten-tab-icon {
  font-size: 0.86rem;
  opacity: 0.9;
}

.diensten-tab-btn:hover,
.diensten-tab-btn:focus-visible {
  color: var(--color-text);
  border-color: color-mix(in srgb, var(--cavero-purple) 30%, var(--color-border-chrome));
  background: color-mix(in srgb, var(--cavero-purple-soft) 42%, var(--color-bg-surface));
}

.diensten-tab-btn .badge {
  min-width: 1.45rem;
  text-align: center;
  font-weight: 700;
  border: 1px solid var(--color-border-chrome);
  background: color-mix(in srgb, var(--color-bg-surface-soft) 80%, var(--color-bg-surface)) !important;
  color: var(--color-text-muted) !important;
}

.diensten-tab-btn.is-active {
  color: var(--color-text-strong);
  border-color: var(--color-border-chrome);
  border-bottom-color: var(--color-bg-form);
  background: var(--color-bg-form);
  box-shadow: inset 0 2px 0 var(--cavero-purple);
  position: relative;
  z-index: 2;
  margin-bottom: 0;
}

:root:not([data-theme="dark"]) .diensten-tab-btn.is-active {
  border-color: color-mix(in srgb, var(--color-border-chrome) 88%, var(--cavero-purple) 12%);
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--cavero-purple) 78%, transparent);
}

.diensten-tab-btn.is-active .badge {
  background: color-mix(in srgb, var(--cavero-purple-soft) 86%, var(--color-bg-surface)) !important;
  color: var(--cavero-purple-strong) !important;
  border-color: color-mix(in srgb, var(--cavero-purple) 35%, var(--color-border-chrome));
}

:root:not([data-theme="dark"]) .diensten-tab-btn.is-active .badge {
  background: color-mix(in srgb, var(--cavero-purple-soft) 84%, var(--color-bg-surface)) !important;
  color: var(--cavero-purple-strong) !important;
  border-color: color-mix(in srgb, var(--cavero-purple) 28%, var(--color-border-chrome));
}

[data-theme="dark"] .diensten-tab-btn {
  border-color: var(--color-border-chrome);
  background: color-mix(in srgb, var(--color-bg-elevated) 78%, var(--color-bg-surface));
}

[data-theme="dark"] .diensten-tab-btn.is-active {
  color: var(--color-text-strong);
  border-color: var(--color-border-chrome);
  border-bottom-color: var(--color-bg-form);
  background: var(--color-bg-form);
  box-shadow: inset 0 2px 0 var(--cavero-purple);
}

[data-theme="dark"] .diensten-tab-btn.is-active .badge {
  background: color-mix(in srgb, var(--cavero-purple) 24%, var(--color-bg-surface)) !important;
  border-color: color-mix(in srgb, var(--cavero-purple) 42%, var(--color-border-chrome));
  color: var(--color-text-strong) !important;
}

.diensten-tab-pane {
  display: none;
}

.diensten-tab-pane.is-active {
  display: block;
  margin-top: -1px;
  padding: 1rem;
  border: 1px solid var(--color-border-chrome);
  border-top: 1px solid var(--color-border-chrome);
  border-radius: 0 0.8rem 0.8rem 0.8rem;
  background: var(--color-bg-form);
}

.diensten-tab-pane.is-active.d-none {
  display: block !important;
}

[data-theme="dark"] .diensten-tab-pane.is-active {
  border-color: var(--color-border-chrome);
  background: var(--color-bg-form);
}

.diensten-tab-pane > .relation-modal-set {
  margin-top: 0;
}

.supplier-comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.supplier-comment {
  border: 1px solid var(--color-border-chrome);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-bg-surface) 82%, var(--color-bg-elevated));
  padding: 0.75rem 0.8rem;
}

.supplier-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.supplier-comment-meta {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.25;
}

.supplier-comment-meta time {
  font-size: 0.74rem;
  color: var(--color-text-subtle);
}

.supplier-comment-body {
  margin-top: 0.45rem;
}

.supplier-comment-delete {
  margin-left: auto;
  flex: 0 0 auto;
}

.btn-delete-icon.relation-edit-icon {
  color: var(--color-text-subtle);
}

.btn-delete-icon.relation-edit-icon:hover,
.btn-delete-icon.relation-edit-icon:focus,
.btn-delete-icon.relation-edit-icon:focus-visible,
.btn-delete-icon.relation-edit-icon:active {
  border-color: var(--color-border-chrome);
  background: color-mix(in srgb, var(--cavero-purple) 12%, transparent);
  color: var(--cavero-purple-strong);
}

.relation-linked-empty {
  margin-top: 0.5rem;
  font-size: 0.84rem;
  color: var(--color-text-muted);
}

.relation-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: color-mix(in srgb, #0b1020 42%, transparent);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 0.9rem 1rem;
}

.relation-modal-card {
  width: min(1100px, 100%);
  max-height: 92vh;
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  box-shadow: var(--shadow-level-2);
  display: flex;
  flex-direction: column;
}

.relation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border-split);
}

.relation-modal-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border-split);
  background: var(--color-bg-soft);
}

.relation-modal-table-wrap {
  overflow: auto;
  padding: 0 1rem 1rem;
}

.relation-modal-table {
  margin-bottom: 0;
  width: 100%;
  table-layout: fixed;
}

.relation-modal-table th,
.relation-modal-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.relation-modal-table th:first-child,
.relation-modal-table td:first-child {
  width: 3.25rem;
}

.relation-modal-table .relation-item-name {
  font-weight: 600;
  color: var(--color-text-strong);
}

.relation-modal-table .relation-item-meta {
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: var(--color-text-muted);
}

.relation-modal-empty {
  padding: 0.8rem 0.1rem 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.relation-modal-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.65rem;
}

.relation-modal-pagination-label {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  min-width: 7.5rem;
  text-align: center;
}

.relation-modal-selected-row td {
  background: color-mix(in srgb, var(--color-bg-elevated) 55%, var(--color-table-row-bg));
}

.relation-modal-divider-row td {
  border-top: 2px solid var(--color-border-split);
}

.relation-modal-actions {
  border-top: 1px solid var(--color-border-split);
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.table-compact td {
  background: var(--color-table-row-bg);
}

.privacy-analyses-table .analysis-title-col {
  width: 19%;
  max-width: 250px;
}

.table-compact tbody tr:nth-child(even) td {
  background: var(--color-table-row-alt-bg);
}

[data-theme="dark"] .table-compact td {
  color: var(--color-text-strong);
}

[data-theme="dark"] .table-compact td .row-meta {
  color: var(--color-text-muted);
}

.table-compact tbody tr + tr td {
  border-top: 1px solid var(--color-border-hairline);
}

.table-compact tbody tr:hover td {
  background: color-mix(in srgb, var(--color-bg-elevated) 56%, var(--color-table-row-bg));
}

:root:not([data-theme="dark"]) .table-compact tbody tr:hover td {
  background: color-mix(in srgb, var(--color-bg-elevated) 48%, var(--color-table-row-bg));
}

.editor-surface,
.filter-bar,
.table-shell,
.summary-block,
.intro-block,
.panel-block,
.task-card,
.small-kpi-block,
.group-collapse,
.card,
.relation-picker,
.tiptap-shell,
.entity-form-side,
.sidebar {
  border-color: color-mix(in srgb, var(--color-border-chrome) 62%, transparent);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--color-bg-soft-strong);
}

.clickable-row:focus-visible {
  outline: 3px solid var(--cavero-accent-strong);
  outline-offset: -3px;
  background: var(--cavero-accent-soft);
}

.row-title {
  font-weight: 600;
  color: var(--color-text-strong);
}

a.row-title,
a.table-link.row-title {
  color: var(--color-text-strong);
  font-weight: 700;
}

a.entity-preview-link {
  text-decoration: none;
}

.table-secondary-text {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: normal;
}

a.row-title:hover,
a.table-link.row-title:hover {
  color: var(--color-link-hover);
}

.row-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.text-muted {
  color: var(--color-text-muted) !important;
}

.news-card-summary {
  color: var(--color-text-default);
  max-width: 72rem;
}

.news-card-meta {
  color: var(--color-text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--status-neutral-bg);
  color: var(--status-neutral-text);
  border: 1px solid var(--status-neutral-border);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  background: var(--status-neutral-bg);
  color: var(--status-neutral-text);
  border: 1px solid var(--status-neutral-border);
}

.status-chip--inline {
  min-width: 6rem;
  justify-content: center;
}

.badge.status-chip {
  --bs-badge-color: inherit;
  color: inherit;
}

[data-status-tone="success"] {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}

[data-status-tone="warning"] {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-color: var(--status-warning-border);
}

[data-status-tone="danger"] {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: var(--status-danger-border);
}

[data-status-tone="neutral"] {
  background: var(--status-neutral-bg);
  color: var(--status-neutral-text);
  border-color: var(--status-neutral-border);
}

[data-status-tone="permission"] {
  background: var(--status-permission-bg);
  color: var(--status-permission-text);
  border-color: var(--status-permission-border);
  box-shadow: 0 0 0 1px var(--status-permission-border), 0 0.2rem 0.55rem rgba(91, 44, 122, 0.18);
  font-weight: 700;
}

.audit-action-chip {
  white-space: nowrap;
}

.audit-action-chip[data-status-tone="impersonation"] {
  color: #0f766e;
  border-color: #0f766e;
  background: color-mix(in srgb, #0f766e 18%, var(--color-bg-surface));
  font-weight: 800;
}

.audit-impersonation-row td {
  background: color-mix(in srgb, #0f766e 8%, var(--color-table-row-bg));
  box-shadow: inset 3px 0 0 #0f766e;
}

td[data-status-tone] {
  font-weight: 600;
}

.group-section {
  margin-bottom: 1.25rem;
}

.group-header {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-section-accent);
  margin-bottom: 0.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-block {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-level-1);
}

.summary-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.summary-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-metric-accent);
  margin: 0.2rem 0;
}

.summary-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.reports-panels {
  grid-template-columns: minmax(0, 1fr);
}

.reports-table-shell {
  overflow-x: auto;
  overflow-y: hidden;
}

.reports-table-shell .table {
  min-width: 980px;
}

.intro-block {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-level-1);
}

.links-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--cavero-purple-soft);
  color: var(--cavero-purple);
  text-decoration: none;
  font-weight: 600;
}

.panel-block {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-level-1);
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-heading {
  margin-bottom: 0.9rem;
}

.task-launcher {
  margin-bottom: 1.5rem;
}

.task-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.task-action-btn {
  width: 100%;
  min-height: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-align: center;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.task-card {
  display: block;
  text-decoration: none;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 14px;
  padding: 1rem 1rem 1.1rem;
  color: inherit;
  min-height: 146px;
  box-shadow: var(--shadow-level-1);
}

.task-card:hover {
  border-color: color-mix(in srgb, var(--color-border-task-hover) 40%, var(--color-border-chrome));
  background: linear-gradient(180deg, var(--color-bg-soft-warm-strong) 0%, var(--color-bg-surface) 100%);
  box-shadow: var(--shadow-level-2);
}

.task-kicker {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-section-accent);
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.task-title {
  font-size: 1.06rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.task-text {
  color: var(--color-text-subtle);
  font-size: 0.94rem;
}

.stack-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stack-list li {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-task-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.dashboard-task-link:hover .row-title {
  color: var(--color-link-hover);
}

.dashboard-task-link:hover .row-meta {
  color: var(--color-text-accent-muted);
}

.stack-list li:last-child {
  border-bottom: 0;
}

.small-kpi-block {
  margin-top: 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-level-1);
}

.small-kpi-block-top {
  margin-top: 0;
  margin-bottom: 1rem;
}

.compact-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.compact-grid-top {
  gap: 0.5rem;
}

.compact-card {
  padding: 0.45rem 0.6rem;
  min-height: 4.4rem;
}

.compact-card .summary-label {
  font-size: 0.68rem;
}

.compact-card .summary-value {
  font-size: 1.05rem;
  margin: 0.08rem 0 0;
}

.group-collapse {
  margin-bottom: 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  box-shadow: var(--shadow-level-1);
}

.group-summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-section-accent);
}

.group-summary::-webkit-details-marker {
  display: none;
}

.group-summary-count {
  color: var(--color-text-muted);
  font-weight: 600;
}

.summary-tone-warning {
  border-left: 4px solid var(--color-tone-warning);
  background: linear-gradient(180deg, var(--color-bg-soft-warm) 0%, var(--color-bg-surface) 100%);
}

.summary-tone-danger {
  border-left: 4px solid var(--color-tone-danger);
  background: linear-gradient(180deg, var(--color-bg-soft-danger) 0%, var(--color-bg-surface) 100%);
}

.summary-tone-neutral {
  border-left: 4px solid var(--color-tone-neutral);
  background: linear-gradient(180deg, var(--color-bg-soft-neutral) 0%, var(--color-bg-surface) 100%);
}

.summary-tone-success {
  border-left: 4px solid var(--color-text-beheer-success);
  background: linear-gradient(180deg, var(--color-bg-soft-success) 0%, var(--color-bg-surface) 100%);
}

.beheerstatus-groen {
  color: var(--color-text-beheer-success);
}

.beheerstatus-oranje {
  color: var(--color-text-beheer-warning);
}

.beheerstatus-rood {
  color: var(--color-text-beheer-danger);
}

.mt-3 {
  margin-top: 1rem;
}

/* Uniforme actiestijl: icoon + actietekst zonder knop-uitstraling (zoals 'Dashboard aanpassen').
   Canonieke implementatie: .action-link (+ .action-link-primary / .action-link-danger).
   De legacy btn-actieclasses delen exact dezelfde look zodat er nooit een mix ontstaat,
   ook niet bij knoppen die vanuit JavaScript worden aangemaakt. */
.action-link,
.dashboard-edit-toggle-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: none;
  font: inherit;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.action-link .icon,
.dashboard-edit-toggle-link .icon {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
}

.action-link:hover,
.action-link:focus-visible,
.dashboard-edit-toggle-link:hover,
.dashboard-edit-toggle-link:focus-visible {
  color: var(--cavero-purple-strong);
  background: var(--cavero-purple-soft);
  border-color: var(--color-border-chrome);
}

.action-link-primary {
  color: var(--cavero-purple-strong);
  font-weight: 600;
}

.action-link-primary:hover,
.action-link-primary:focus-visible {
  color: var(--cavero-purple-strong);
  background: var(--cavero-purple-soft);
  border-color: var(--cavero-purple);
}

.action-link-danger {
  color: var(--color-text-danger);
}

.action-link-danger:hover,
.action-link-danger:focus-visible {
  color: var(--status-danger-text);
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
}

.action-link:disabled,
.action-link.disabled,
.action-link[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

/* Legacy actieknoppen: identieke interactiestijl, geen rechthoekige knop-uitstraling meer. */
.btn.btn-outline-secondary,
.btn.btn-secondary,
.btn.btn-stop-impersonation {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: none;
  font: inherit;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.btn.btn-outline-secondary:hover,
.btn.btn-outline-secondary:focus,
.btn.btn-outline-secondary:focus-visible,
.btn.btn-outline-secondary:active,
.btn.btn-secondary:hover,
.btn.btn-secondary:focus,
.btn.btn-secondary:focus-visible,
.btn.btn-secondary:active,
.btn.btn-stop-impersonation:hover,
.btn.btn-stop-impersonation:focus,
.btn.btn-stop-impersonation:focus-visible {
  color: var(--cavero-purple-strong);
  background: var(--cavero-purple-soft);
  border-color: var(--color-border-chrome);
  box-shadow: none;
}

.btn.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.btn.btn-primary,
.btn.btn-primary:active {
  background-color: transparent !important;
  border-color: transparent !important;
  color: var(--cavero-purple-strong) !important;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:focus-visible {
  background-color: var(--cavero-purple-soft) !important;
  border-color: var(--cavero-purple) !important;
  color: var(--cavero-purple-strong) !important;
}

.btn.btn-outline-danger,
.btn.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: none;
  font: inherit;
  color: var(--color-text-danger);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.btn.btn-outline-danger:hover,
.btn.btn-outline-danger:focus,
.btn.btn-outline-danger:focus-visible,
.btn.btn-outline-danger:active,
.btn.btn-danger:hover,
.btn.btn-danger:focus,
.btn.btn-danger:focus-visible,
.btn.btn-danger:active {
  color: var(--status-danger-text);
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  box-shadow: none;
}

.btn.btn-outline-secondary:disabled,
.btn.btn-outline-secondary.disabled,
.btn.btn-primary:disabled,
.btn.btn-primary.disabled,
.btn.btn-outline-danger:disabled,
.btn.btn-outline-danger.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-danger);
}

.btn-delete-icon.btn-sm {
  min-width: 2rem;
  min-height: 1.95rem;
  padding: 0.25rem 0.45rem;
}

.btn-delete-icon:hover,
.btn-delete-icon:focus,
.btn-delete-icon:active {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.btn-delete-icon i {
  font-size: 0.95rem;
  line-height: 1;
}

.btn-impersonate-icon {
  color: #0f766e;
  border-color: #0f766e;
  background: transparent;
}

.btn-impersonate-icon:hover,
.btn-impersonate-icon:focus,
.btn-impersonate-icon:focus-visible,
.btn-impersonate-icon:active {
  color: #ffffff;
  border-color: #0f766e;
  background: #0f766e;
}

.btn-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
}

.btn-edit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cavero-purple);
}

.btn-edit-icon.btn-sm {
  min-width: 2rem;
  min-height: 1.95rem;
  padding: 0.25rem 0.45rem;
}

.btn-copy-icon.btn-sm {
  min-width: 2rem;
  min-height: 1.95rem;
  padding: 0.25rem 0.45rem;
}

.btn-copy-icon:hover,
.btn-copy-icon:focus,
.btn-copy-icon:active {
  border-color: var(--cavero-purple);
  background: var(--cavero-purple);
  color: var(--color-text-white);
}

.btn-edit-icon:hover,
.btn-edit-icon:focus,
.btn-edit-icon:active {
  border-color: var(--cavero-purple);
  background: var(--cavero-purple);
  color: var(--color-text-white);
}

.btn-copy-icon i {
  font-size: 0.95rem;
  line-height: 1;
}

.table-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
}

.js-register-index-shell .table-shell {
  overflow-x: auto;
}

.js-register-index-shell .table-actions-column {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 5.5rem;
  white-space: nowrap;
  background: var(--color-bg-card);
}

.js-register-index-shell .table-compact th.table-actions-column {
  z-index: 2;
  background: var(--color-table-header-bg);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(1) brightness(2.2);
  opacity: 0.95;
}

[data-theme="dark"] .btn-close:hover,
[data-theme="dark"] .btn-close:focus,
[data-theme="dark"] .btn-close:active {
  opacity: 1;
}

[data-theme="dark"] .btn-outline-secondary {
  color: var(--color-text-muted);
  border-color: transparent;
  background: transparent;
}

[data-theme="dark"] .btn-outline-secondary:hover,
[data-theme="dark"] .btn-outline-secondary:focus,
[data-theme="dark"] .btn-outline-secondary:active {
  color: var(--cavero-purple-strong);
  border-color: var(--color-border-chrome);
  background: var(--cavero-purple-soft);
}

.btn.btn-register-new {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cavero-purple-strong);
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.btn.btn-register-new:hover,
.btn.btn-register-new:focus,
.btn.btn-register-new:focus-visible,
.btn.btn-register-new:active {
  color: var(--cavero-purple-strong);
  background: var(--cavero-purple-soft);
  border-color: var(--cavero-purple);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--color-bg-field);
  color: var(--color-text-default);
  border-color: var(--cavero-purple);
  box-shadow: 0 0 0 0.2rem var(--color-focus-ring);
}

.entity-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  gap: 1.25rem;
  align-items: start;
}

.entity-form-grid.contract-dossier {
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
}

.contract-dossier > .diensten-tab-row {
  grid-column: 1 / -1;
}

.contract-dossier > .entity-form-main {
  grid-column: 1;
  margin-top: -1rem;
}

.contract-main-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.contract-main-fields.diensten-tab-pane {
  display: none;
}

.contract-main-fields.diensten-tab-pane.is-active {
  display: grid;
}

.contract-main-fields > * {
  min-width: 0;
}

.contract-main-fields .contract-field-heading,
.contract-main-fields .contract-field-description,
.contract-main-fields .contract-field-document-location {
  grid-column: 1 / -1;
}

.contract-main-fields .contract-field-number {
  grid-column: span 4;
}

.contract-main-fields .contract-field-title {
  grid-column: span 8;
}

.contract-main-fields .contract-field-type,
.contract-main-fields .contract-field-counterparty,
.contract-main-fields .contract-field-start-date,
.contract-main-fields .contract-field-end-date {
  grid-column: span 6;
}

.contract-subregister-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.contract-subregister-fields > * {
  min-width: 0;
}

.contract-subregister-fields .contract-subregister-span-2 { grid-column: span 2; }
.contract-subregister-fields .contract-subregister-span-3 { grid-column: span 3; }
.contract-subregister-fields .contract-subregister-span-4 { grid-column: span 4; }
.contract-subregister-fields .contract-subregister-span-5 { grid-column: span 5; }
.contract-subregister-fields .contract-subregister-span-6 { grid-column: span 6; }
.contract-subregister-fields .contract-subregister-span-8 { grid-column: span 8; }
.contract-subregister-fields .contract-subregister-span-12 { grid-column: 1 / -1; }

.contract-dossier > .entity-form-side {
  grid-column: 2;
  margin-top: -1rem;
}

.contract-dossier .diensten-tab-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 0 0 -1px;
  padding: 0.4rem 0.55rem 0;
  border: 1px solid var(--color-border-chrome);
  border-bottom: 0;
  border-radius: 0.8rem 0.8rem 0 0;
  background: color-mix(in srgb, var(--color-bg-elevated) 68%, var(--color-bg-surface));
}

.contract-dossier .diensten-tab-btn {
  flex: 0 1 auto;
  min-width: max-content;
  white-space: nowrap;
  border-radius: 0.55rem 0.55rem 0 0;
  padding: 0.48rem 0.55rem;
  gap: 0.4rem;
}

.contract-dossier .diensten-tab-pane.is-active {
  margin-top: -1px;
  padding: 1rem;
  border: 1px solid var(--color-border-chrome);
  border-radius: 0 0.8rem 0.8rem 0.8rem;
  background: var(--color-bg-form);
}

.contract-dossier .contract-main-fields > div + div {
  margin-top: 0.85rem;
}

@media print {
  .contract-dossier .diensten-tab-nav {
    display: none !important;
  }

  .contract-dossier .diensten-tab-pane {
    display: block !important;
    padding-top: 0;
    border-top: 0;
  }
}

.contract-governance-panel {
  position: sticky;
  top: 1rem;
}

.entity-form-main,
.entity-form-side {
  display: grid;
  gap: 1rem;
}

.entity-form-side {
  align-content: start;
  min-width: 0;
  padding: 1rem;
  background: linear-gradient(180deg, var(--color-bg-form) 0%, var(--color-bg-side-end) 100%);
  border: 1px solid var(--color-border-chrome);
  box-shadow: inset 2px 0 0 var(--color-inset-side), var(--shadow-level-1);
  position: sticky;
  top: 1rem;
}

:root:not([data-theme="dark"]) .entity-form-side {
  background: linear-gradient(180deg, var(--color-bg-side-start) 0%, var(--color-bg-side-end) 100%);
  border-color: var(--color-border-side);
}

:root:not([data-theme="dark"]) .entity-form-side .register-form-heading-label {
  color: var(--color-text-muted);
}

.entity-form-side .form-label {
  font-weight: 600;
  color: var(--color-text-side);
}

.entity-form-side > div,
.entity-form-side > section {
  min-width: 0;
}

.entity-form-side .entity-preview-static {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.metadata-value-link {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-link);
}

.metadata-value-link:hover,
.metadata-value-link:focus-visible {
  color: var(--color-link-hover);
}

.entity-form-side .register-form-heading {
  margin-top: 0.95rem;
  padding-top: 0.65rem;
}

.entity-form-side .register-form-heading:first-child {
  margin-top: 0;
  padding-top: 0;
}

.entity-form-side .register-form-heading-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-accent-muted);
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.checkbox-list-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0;
  font-weight: 400;
}

.user-role-checkbox-list {
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border-input);
  border-radius: 0.25rem;
  background: var(--color-bg-field);
}

.user-role-checkbox-list .checkbox-list-item + .checkbox-list-item {
  margin-top: 0.45rem;
}

.user-active-field {
  display: flex;
  align-items: flex-start;
  padding-top: 2rem;
}

.processing-picker {
  margin-top: 0.2rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--color-border-input);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--color-bg-field);
  box-shadow: var(--shadow-field-inset);
}

.processing-picker:focus-within {
  border-color: var(--cavero-purple);
  box-shadow: 0 0 0 0.2rem var(--color-focus-ring), var(--shadow-field-inset);
}

.processing-picker-search,
.processing-picker-select {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background-color: transparent;
}

.processing-picker-search {
  min-height: 2.5rem;
  color: var(--color-text-default);
}

.processing-picker-select {
  border-top: 1px solid var(--color-border-input);
  color: var(--color-text-default);
  background-image: var(--bs-form-select-bg-img);
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.25rem;
}

.processing-picker-search::placeholder {
  color: var(--color-text-subtle);
  opacity: 1;
}

.processing-picker-search:focus,
.processing-picker-select:focus {
  box-shadow: none;
}

.processing-picker-help {
  color: var(--color-text-muted);
}

.processing-context-card {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border-input);
  background: var(--color-bg-field);
  box-shadow: var(--shadow-field-inset);
}

.processing-context-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.processing-context-value {
  color: var(--color-text-default);
}

[data-theme="dark"] .processing-context-card {
  border-color: var(--color-border-chrome);
  background: var(--color-bg-elevated);
}

[data-theme="dark"] .processing-picker {
  border-color: var(--color-border-chrome);
  background: var(--color-bg-field);
}

[data-theme="dark"] .processing-picker-select {
  border-top-color: var(--color-border-chrome);
}

[data-theme="dark"] .processing-picker-search::placeholder {
  color: var(--color-text-subtle);
  opacity: 1;
}

[data-theme="dark"] .processing-picker-help {
  color: var(--color-text-muted);
}

.form-control,
.form-select {
  background-color: var(--color-bg-field);
  border-color: var(--color-border-input);
  color: var(--color-text-default);
  box-shadow: var(--shadow-field-inset);
}

/* Bootstrap switches select caret via [data-bs-theme="dark"],
   but this app uses [data-theme="dark"]. Mirror that behavior here. */
[data-theme="dark"] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d5ddeb' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.entity-form-side .form-control,
.entity-form-side .form-select {
  background-color: var(--color-bg-field);
}

.processing-retention-textarea {
  width: 100%;
  max-width: 100%;
  min-height: 7rem;
  resize: vertical;
}

.entity-form-actions-top {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.entity-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table thead {
  background: var(--color-panel-header-bg);
  color: var(--color-panel-header-text);
}

.card {
  border-color: var(--color-border-chrome);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-level-1);
}

.card-header {
  background: var(--color-panel-header-bg);
  color: var(--color-panel-header-text);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border-chrome);
  padding: 1.5rem 1rem;
  box-shadow: var(--shadow-level-1);
}

.brand {
  padding: 0.5rem 0.75rem 1.25rem;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cavero-purple);
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.sidebar .nav-link {
  color: var(--color-text-nav);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}

.sidebar .nav-link:hover {
  background: var(--cavero-purple-soft);
  color: var(--cavero-purple);
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--border);
}

.card {
  border-radius: 12px;
}

.badge.bg-warning {
  background-color: var(--color-warning-strong) !important;
}

.badge.bg-danger {
  background-color: var(--color-danger-strong) !important;
}

.badge.bg-neutral {
  background-color: var(--color-border-neutral) !important;
  color: var(--color-text-nav) !important;
}

.bg-warning { background-color: var(--color-bg-badge-warning) !important; }
.bg-danger { background-color: var(--color-bg-badge-danger) !important; }
.bg-neutral { background-color: var(--color-bg-badge-neutral) !important; }

.relation-picker {
  border: 1px solid var(--color-border-chrome);
  border-radius: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg-card);
  box-shadow: var(--shadow-level-1);
}

.relation-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
  background: var(--color-bg-soft);
  flex-wrap: wrap;
}

.relation-picker-search {
  flex: 1;
  min-width: 220px;
}

.relation-picker-summary {
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  font-weight: 600;
}

.relation-picker-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.4rem;
}

.relation-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.relation-picker-item:hover {
  background: var(--color-bg-soft-strong);
}

.relation-picker-item input {
  margin-top: 0;
}

.relation-picker-item label {
  margin: 0;
  cursor: pointer;
  flex: 1;
}

.relation-picker-empty {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 0.65rem 0.5rem;
}

.incident-description-editor {
  min-height: 220px;
  resize: vertical;
}

.incident-rich-preview p:last-child,
.incident-rich-preview ul:last-child,
.incident-rich-preview ol:last-child,
.incident-rich-preview blockquote:last-child {
  margin-bottom: 0;
}

.incident-rich-preview {
  font-size: 0.85rem;
  line-height: 1.4;
}

.tiptap-shell {
  border: 1px solid var(--color-border-chrome);
  border-radius: 8px;
  background: var(--color-bg-form);
  overflow: hidden;
  box-shadow: var(--shadow-level-1);
}

:root:not([data-theme="dark"]) .tiptap-shell {
  background: var(--color-bg-form);
  border-color: var(--color-border-chrome);
  box-shadow: var(--shadow-level-1);
}

.tiptap-editor,
.tiptap-editor .ProseMirror {
  background: var(--color-bg-field);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .tiptap-editor,
[data-theme="dark"] .tiptap-editor .ProseMirror {
  color: var(--color-text-default);
}

.tiptap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
  background: var(--color-bg-soft);
}

:root:not([data-theme="dark"]) .tiptap-toolbar {
  background: color-mix(in srgb, var(--color-bg-elevated) 55%, var(--color-bg-form));
  border-bottom-color: var(--color-border-split);
}

.tiptap-toolbar .btn {
  min-width: 2.2rem;
}

[data-theme="dark"] .tiptap-toolbar .btn.btn-outline-secondary {
  color: var(--color-text-strong);
  border-color: var(--color-border-input);
  background: var(--color-bg-elevated);
}

[data-theme="dark"] .tiptap-toolbar .btn.btn-outline-secondary:hover,
[data-theme="dark"] .tiptap-toolbar .btn.btn-outline-secondary:focus {
  color: var(--color-text-white);
  border-color: var(--cavero-purple);
  background: var(--cavero-purple);
}

[data-theme="dark"] .tiptap-toolbar .btn.btn-outline-secondary.active,
[data-theme="dark"] .tiptap-toolbar .btn.btn-outline-secondary[aria-pressed="true"],
[data-theme="dark"] .tiptap-toolbar .btn.btn-outline-secondary:active {
  color: var(--color-text-white);
  border-color: var(--cavero-purple);
  background: var(--cavero-purple);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.tiptap-toolbar .btn svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.tiptap-editor {
  min-height: 250px;
  padding: 1rem;
}

.tiptap-editor .ProseMirror {
  min-height: 250px;
  outline: none;
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.tiptap-editor .ProseMirror > * + * {
  margin-top: 0.75rem;
}

.tiptap-editor .ProseMirror p {
  margin-bottom: 0.75rem;
}

.tiptap-editor .ProseMirror h1,
.tiptap-editor .ProseMirror h2,
.tiptap-editor .ProseMirror h3 {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.tiptap-editor .ProseMirror blockquote {
  border-left: 4px solid var(--cavero-purple-soft);
  padding-left: 1rem;
  color: var(--color-text-subtle);
}

.tiptap-editor .ProseMirror ul,
.tiptap-editor .ProseMirror ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.tiptap-editor .ProseMirror ul li::marker {
  color: var(--cavero-accent-strong);
}

.tiptap-editor .ProseMirror ul li + li {
  margin-top: 0.2rem;
}

.page-surface ul li::marker {
  color: var(--cavero-accent-strong);
}

[data-theme="dark"] .tiptap-editor .ProseMirror ul li::marker,
[data-theme="dark"] .page-surface ul li::marker {
  color: var(--cavero-purple);
}

.page-surface ul li + li {
  margin-top: 0.2rem;
}

.tiptap-editor .ProseMirror a {
  color: var(--color-link);
  text-decoration: underline;
}

.tiptap-toolbar .btn.active {
  background: var(--cavero-purple);
  color: var(--color-text-white);
  border-color: var(--cavero-purple);
}

.site-footer {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cavero-accent-strong);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-switch-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.theme-switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-surface);
  box-shadow: 0 4px 14px var(--color-shadow-card);
  color: var(--color-text-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.28rem 0.45rem;
  min-width: 7.6rem;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.theme-switch-track {
  position: relative;
  width: 2.45rem;
  height: 1.38rem;
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-soft);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-switch-thumb {
  position: absolute;
  top: 0.12rem;
  left: 0.14rem;
  width: 0.95rem;
  height: 0.95rem;
  background: var(--cavero-purple);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-switch-state {
  min-width: 3.2rem;
  text-align: left;
}

.theme-switch-toggle:hover {
  border-color: var(--cavero-purple);
  color: var(--cavero-purple);
}

.theme-switch-toggle.is-dark .theme-switch-track {
  background: var(--cavero-purple-soft);
  border-color: var(--cavero-purple);
}

.theme-switch-toggle.is-dark .theme-switch-thumb {
  transform: translateX(1.03rem);
  background: var(--cavero-purple-strong);
}

[data-theme="dark"] .theme-switch {
  box-shadow: 0 6px 18px var(--color-shadow-dropdown);
}

[data-theme="dark"] .theme-switch-toggle {
  box-shadow: 0 6px 18px var(--color-shadow-dropdown);
}

@media (max-width: 992px) {
  .site-header {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-header-menu {
    display: none;
    width: 100%;
    margin-left: 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .site-header-menu.open {
    display: flex;
  }

  .site-nav {
    margin-left: 0;
    justify-content: flex-start;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .topnav-link {
    display: block;
    border-radius: 10px;
  }

  .site-nav-dropdown > .topnav-link {
    display: flex;
    align-items: center;
  }

  .site-nav-dropdown {
    width: 100%;
  }

  .topnav-dropdown-caret {
    margin-left: auto;
    padding: 0.4rem;
    transition: transform 0.15s ease;
  }

  .site-nav-dropdown.open .topnav-dropdown-caret {
    transform: rotate(180deg);
  }

  .site-nav-dropdown-menu {
    position: static;
    display: none;
    margin-top: 0;
    min-width: 0;
    box-shadow: none;
  }

  .site-nav-dropdown-menu-nested {
    position: static;
    min-width: 0;
    margin-left: 0.65rem;
    padding: 0.25rem 0 0.25rem 0.45rem;
    border-left: 1px solid var(--color-border-chrome);
    background: transparent;
  }

  .site-nav-dropdown-submenu > .topnav-link {
    display: flex;
    align-items: center;
  }

  .settings-section-nav {
    flex-wrap: wrap;
  }

  .site-nav-dropdown.open .site-nav-dropdown-menu {
    display: grid;
  }

  .site-nav-dropdown-menu-user {
    right: auto;
    padding: 0.55rem 0;
    border: 0;
    background: transparent;
  }

  .site-nav-dropdown-search .site-nav-dropdown-menu {
    min-width: 0;
    padding: 0.55rem 0.65rem;
  }

  .user-menu-title {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .site-nav-dropdown-menu-user .user-menu-group {
    padding: 0 0.65rem;
  }

  .site-nav-dropdown-menu-user .role-switch-form {
    grid-template-columns: 1fr;
  }

  .site-nav-dropdown-menu-user .role-switch-form .btn {
    justify-self: start;
  }

  .site-header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .task-grid,
  .task-action-grid,
  .dashboard-grid,
  .dashboard-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content,
  .site-footer {
    width: min(100% - 2rem, 1200px);
  }

  .entity-form-grid {
    grid-template-columns: 1fr;
  }

  .contract-dossier > .entity-form-main,
  .contract-dossier > .entity-form-side {
    grid-column: 1;
  }

  .entity-form-side {
    position: static;
    top: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

}

.narrow-viewport-notice {
  display: none;
}

@media (max-width: 767px) {
  .content-narrow-restricted .page-hero,
  .content-narrow-restricted .page-surface {
    display: none;
  }

  .content-narrow-restricted .narrow-viewport-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    margin-top: 1.5rem;
    padding: 3rem 1.5rem;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: 12px;
    box-shadow: var(--shadow-level-1);
  }

  .narrow-viewport-notice i {
    font-size: 2rem;
    color: var(--cavero-purple);
  }

  .narrow-viewport-notice h2 {
    margin: 0;
  }

  .narrow-viewport-notice p {
    margin: 0;
    max-width: 32rem;
    color: var(--color-text-subtle);
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.85rem 1rem;
  }

  .site-nav {
    gap: 0.25rem;
  }

  .topnav-link {
    padding: 0.45rem 0.65rem;
  }

  .content,
  .site-footer {
    width: min(100% - 1rem, 1200px);
  }

  .content {
    padding-top: 1.25rem;
  }

  .task-grid,
  .task-action-grid,
  .dashboard-grid,
  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-bar.filter-bar-actions-wrapped .filter-actions {
    justify-content: flex-start;
  }

  .filter-import {
    width: 100%;
  }

  .filter-import .form-control {
    min-width: 0;
    flex: 1;
  }

  .filter-bar-privacy {
    flex-wrap: wrap;
  }

  .filter-bar-privacy .filter-group-search,
  .filter-bar-privacy .filter-actions {
    flex-basis: 100%;
  }

  .filter-bar-privacy .filter-actions {
    justify-content: flex-start;
  }
}

*,
*::before,
*::after {
  border-radius: 0 !important;
}

.print-document-root {
  display: none;
}

@media print {
  body.print-mode {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body.print-mode .page-shell {
    display: none !important;
  }

  body.print-mode .print-document-root {
    display: block !important;
  }

  body.print-mode .print-document {
    color: #000000;
    background: #ffffff;
    padding: 0;
  }

  body.print-mode .print-document-header {
    margin-bottom: 1rem;
    break-inside: avoid;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  body.print-mode .print-document-entity {
    margin: 0 0 0.12rem;
    font-size: 10pt;
    color: #6b7280;
    line-height: 1.25;
  }

  body.print-mode .print-document-register {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #555555;
    margin-top: 0.15rem;
  }

  body.print-mode .print-document-title {
    margin: 0;
    font-size: 24pt;
    font-weight: 800;
    line-height: 1.1;
    color: #4b5563;
  }

  body.print-mode .print-document-subtitle {
    margin-top: 0.26rem;
    font-size: 9.4pt;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #374151;
  }

  body.print-mode .print-document-grid {
    display: block;
  }

  body.print-mode .print-document-column {
    min-width: 0;
    align-self: start;
  }

  body.print-mode .print-section {
    margin-bottom: 1rem;
    page-break-inside: avoid;
  }

  body.print-mode .print-section--main {
    break-inside: auto;
    page-break-inside: auto;
  }

  body.print-mode .print-section-title {
    margin: 0 0 0.45rem;
    font-size: 12pt;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #4b5563;
    page-break-after: avoid;
  }

  body.print-mode .print-summary-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 1rem;
  }

  body.print-mode .print-summary-table td {
    width: 50%;
    vertical-align: top;
    border: 0;
    padding: 0.35rem 0.55rem 0.45rem;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #ffffff !important;
  }

  body.print-mode .print-summary-card-title {
    margin: 0 0 0.3rem;
    font-size: 8pt;
    font-weight: 700;
    color: #555555;
  }

  body.print-mode .print-summary-card-fields {
    display: block;
  }

  body.print-mode .print-field-row {
    display: block;
    padding: 0.2rem 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-mode .print-field-stack > .print-field-row {
    padding: 0 0 0.85rem;
    border-bottom: 0;
  }

  body.print-mode .print-field-row--meta {
    border: 0;
    background: transparent;
    padding: 0.12rem 0 0.38rem;
  }

  body.print-mode .print-field-label {
    font-size: 8pt;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: #7b7b7b;
    margin-bottom: 0.08rem;
    min-width: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  body.print-mode .print-field-value {
    font-size: 15pt;
    line-height: 1.4;
    min-width: 0;
    color: #5a5a5a;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  body.print-mode .print-field-row--meta .print-field-value {
    font-size: 9pt;
    color: #4b5563;
  }

  body.print-mode .print-field-value p:last-child,
  body.print-mode .print-field-value ul:last-child,
  body.print-mode .print-field-value ol:last-child,
  body.print-mode .print-field-value blockquote:last-child {
    margin-bottom: 0;
  }

  body.print-mode .print-field-value a {
    color: #000000;
    text-decoration: none;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  body.print-mode .print-field-value .status-chip,
  body.print-mode .print-field-value .pill {
    border: 1px solid #d0d7e2;
    background: #f3f6fb;
    color: #1f2937;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    padding: 0.13rem 0.5rem;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  body.print-mode .print-status-chip[data-status-tone="success"] {
    background: #e8f7ef;
    border-color: #b9e5ca;
    color: #1f6a45;
  }

  body.print-mode .print-status-chip[data-status-tone="warning"] {
    background: #fff4e5;
    border-color: #f0c991;
    color: #8a5a18;
  }

  body.print-mode .print-status-chip[data-status-tone="danger"] {
    background: #fdeaec;
    border-color: #efb3bf;
    color: #9f243f;
  }

  body.print-mode .print-status-chip[data-status-tone="neutral"] {
    background: #edf1f6;
    border-color: #cfd7e3;
    color: #4b5563;
  }

  body.print-mode .print-section table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
  }

  body.print-mode .print-section table thead {
    display: table-header-group;
  }

  body.print-mode .print-section table th,
  body.print-mode .print-section table td {
    border: 1px solid #d1d5db;
    padding: 0.3rem 0.45rem;
    vertical-align: top;
    color: #000000;
    background: #ffffff !important;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    font-size: 9.6pt;
  }

  body.print-mode .print-section table thead th {
    font-weight: 700;
    background: #f8fafc !important;
    white-space: nowrap;
  }

  body.print-mode .print-section table .print-col--compact {
    min-width: 78px;
    white-space: nowrap;
  }

  body.print-mode .print-section table .print-col--wide {
    width: 40%;
    max-width: 40%;
  }

  body.print-mode .print-section table col.print-colgroup-wide {
    width: 40%;
  }

  body.print-mode .print-section table .relation-item-name {
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 0.08rem;
  }

  body.print-mode .print-section table .relation-item-meta {
    color: #6b7280;
    line-height: 1.35;
  }

  body.print-mode .print-section table a {
    color: #000000;
    text-decoration: none;
    word-break: normal;
    overflow-wrap: break-word;
  }

  body.print-mode .print-relations-stack {
    display: block;
  }

  body.print-mode .print-section--relation {
    margin-top: 0.7rem;
  }

  body.print-mode .print-document-empty {
    color: #444444;
    font-style: italic;
  }

  body.print-mode .page-hero,
  body.print-mode .page-toolbar,
  body.print-mode .toolbar-actions,
  body.print-mode .breadcrumb-nav,
  body.print-mode .filter-bar,
  body.print-mode .help-overlay,
  body.print-mode .entity-form-actions,
  body.print-mode .tiptap-toolbar,
  body.print-mode .relation-modal-backdrop,
  body.print-mode .relation-modal-actions,
  body.print-mode .relation-modal-filters,
  body.print-mode .relation-modal-pagination,
  body.print-mode .js-print-button,
  body.print-mode .js-help-overlay-open,
  body.print-mode .js-filter-toggle,
  body.print-mode .skip-link,
  body.print-mode .site-header,
  body.print-mode .site-footer {
    display: none !important;
  }

}

@media print {
  @page {
    margin: 14mm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .skip-link,
  .site-header,
  .site-footer,
  .nav-toggle,
  .site-header-menu,
  .page-toolbar,
  .toolbar-actions,
  .breadcrumb-nav,
  .filter-bar,
  .help-overlay,
  .entity-form-actions,
  .js-help-overlay-open,
  .js-filter-toggle,
  .js-print-button,
  .relation-modal-backdrop,
  .relation-modal-actions,
  .relation-modal-filters,
  .relation-modal-pagination,
  .relation-modal-set [data-rel-open],
  .relation-modal-set [data-rel-close],
  .relation-modal-set [data-rel-page],
  .relation-modal-set [data-rel-checkbox],
  .relation-modal-set .btn-delete-icon,
  .relation-modal-set .btn-close,
  .tiptap-toolbar,
  .text-danger,
  .required-mark,
  .validation-summary-errors,
  .alert.validation-summary-valid,
  .form-text {
    display: none !important;
  }

  .page-shell,
  .content,
  .page-surface,
  .editor-surface,
  .panel-block {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .page-hero {
    padding: 0 0 0.8rem;
    margin: 0 0 1rem;
  }

  .page-title {
    font-size: 18pt;
  }

  .page-intro {
    font-size: 10.5pt;
    color: #333333 !important;
  }

  .entity-form-grid {
    display: block;
  }

  .entity-form-main,
  .entity-form-side {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .entity-form-main > div,
  .entity-form-side > div,
  .entity-form-main > section,
  .entity-form-side > section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0.85rem;
  }

  .entity-form-main > section,
  .entity-form-side > section {
    border: 0 !important;
    padding: 0 !important;
    margin-top: 0.35rem;
  }

  .entity-form-main label,
  .entity-form-side label,
  .form-label,
  .form-check-label {
    font-weight: 700;
    color: #000000 !important;
  }

  .form-control,
  .form-select,
  textarea,
  .form-check-input {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #000000 !important;
  }

  .form-control,
  .form-select,
  textarea {
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    appearance: none;
    -webkit-appearance: none;
  }

  .form-select {
    background-image: none !important;
  }

  .form-control::placeholder,
  .form-select::placeholder,
  textarea::placeholder {
    color: transparent !important;
  }

  .tiptap-shell {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .tiptap-editor,
  .tiptap-editor .ProseMirror {
    background: transparent !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  .tiptap-editor .ProseMirror {
    white-space: normal;
    overflow: visible;
  }

  .row-meta,
  .text-muted,
  .panel-block p,
  .panel-block li,
  .panel-block td,
  .panel-block th {
    color: #222222 !important;
  }

  .relation-modal-set .relation-linked-items {
    display: block !important;
  }

  .relation-modal-set .relation-linked-shell,
  .relation-modal-set .relation-linked-table {
    box-shadow: none !important;
    border-color: #cccccc !important;
  }

  .relation-modal-set .relation-linked-table th:last-child,
  .relation-modal-set .relation-linked-table td:last-child {
    display: none !important;
  }

  .relation-modal-set .relation-linked-table td {
    background: transparent !important;
  }

  .relation-modal-set .relation-linked-table a {
    color: #000000 !important;
    text-decoration: none !important;
  }

  .news-card-summary,
  .news-card-meta {
    color: #222222 !important;
  }
}

.account-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  background: var(--color-bg-page);
}

.account-layout-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.account-layout-header {
  width: min(100%, 30rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.account-layout-theme {
  flex: 0 0 auto;
}

.account-layout-theme .theme-switch-toggle {
  min-width: 6.6rem;
}

.account-layout-brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cavero-purple);
}

.account-layout-brand-sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.account-layout-hero {
  text-align: center;
  max-width: 30rem;
}

.account-layout-card {
  width: 100%;
  max-width: 30rem;
}

.account-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-chrome);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-level-2);
}

@media (max-width: 520px) {
  .account-layout-header {
    align-items: flex-start;
  }

  .account-layout-brand {
    align-items: flex-start;
    text-align: left;
  }
}


/* ==========================================================================
   Uren-maandmatrix (module Uren)
   ========================================================================== */
.uren-matrix-scroll {
  overflow-x: auto;
}

.uren-matrix {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.uren-matrix .uren-row-header {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--color-surface, #fff);
  min-width: 12rem;
  text-align: left;
  font-weight: 600;
  box-shadow: 1px 0 0 0 var(--color-border, #d1d5db);
}

.uren-matrix thead .uren-row-header {
  z-index: 4;
}

.uren-matrix .uren-day-header {
  text-align: center;
  min-width: 3.25rem;
  font-weight: 600;
}

/* Weekrij met weeknummers boven de dagkoppen. */
.uren-week-row .uren-week-cell {
  border-bottom: none;
  padding: 0.1rem 0.25rem 0;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  text-align: center;
}

.uren-week-number {
  letter-spacing: 0.02em;
}

/* Duidelijke weekscheiding op maandag. */
.uren-week-start {
  border-left: 2px solid var(--color-border, #d1d5db) !important;
}

.uren-day-number {
  display: block;
}

.uren-day-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-text-muted, #6b7280);
  text-transform: lowercase;
}

.uren-day-input {
  width: 3.4rem;
  text-align: right;
  padding: 0.15rem 0.25rem;
}

.uren-cell-weekend {
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.045));
}

.uren-cell-weekend .uren-day-input {
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.045));
}

.uren-cell-holiday {
  background: color-mix(in srgb, #d97706 9%, transparent);
}

.uren-cell-holiday .uren-day-input {
  background: color-mix(in srgb, #d97706 14%, var(--color-surface, #fff));
}

.uren-cell-holiday .uren-day-number {
  color: #b45309;
  font-weight: 700;
}

[data-theme="dark"] .uren-cell-holiday {
  background: color-mix(in srgb, #d97706 18%, transparent);
}

[data-theme="dark"] .uren-cell-holiday .uren-day-input {
  background: color-mix(in srgb, #d97706 22%, var(--color-surface-raised, #1f2937));
}

[data-theme="dark"] .uren-cell-holiday .uren-day-number {
  color: #fbbf24;
}

.uren-row-total,
.uren-day-total,
.uren-grand-total,
.uren-total-header {
  font-weight: 700;
  text-align: right;
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.04));
}

.uren-matrix tfoot td,
.uren-matrix tfoot th {
  border-top: 2px solid var(--color-border, #d1d5db);
}

.uren-fill-workdays {
  display: block;
  padding: 0;
  font-size: 0.75rem;
}

.uren-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.uren-totals .summary-block {
  min-width: 9rem;
}

.uren-rating-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.uren-rating-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.uren-day-input[data-has-comment="true"] {
  border-color: var(--color-metric-accent, #7c3aed);
}

/* Actieve cel: subtiele rij- en kolomhighlight voor oriëntatie tijdens invoer. */
.uren-matrix tr.uren-active-row td,
.uren-matrix tr.uren-active-row th {
  background: color-mix(in srgb, var(--color-metric-accent, #7c3aed) 6%, transparent);
}

/* De sticky boekingsregel-kolom blijft ondoorzichtig, ook bij een actieve rij,
   zodat invulvakjes er niet doorheen komen. */
.uren-matrix tr.uren-active-row th.uren-row-header {
  background: var(--color-surface, #fff);
}

[data-theme="dark"] .uren-matrix tr.uren-active-row th.uren-row-header {
  background: var(--color-surface-raised, #1f2937);
}

.uren-matrix td.uren-active-col,
.uren-matrix th.uren-active-col {
  background: color-mix(in srgb, var(--color-metric-accent, #7c3aed) 6%, transparent);
}

.uren-matrix input.uren-active-cell {
  outline: 2px solid var(--color-metric-accent, #7c3aed);
  outline-offset: -1px;
  background: var(--color-surface, #fff);
}

[data-theme="dark"] .uren-matrix input.uren-active-cell {
  background: var(--color-surface-raised, #1f2937);
}
