:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --ink: #1e2a2f;
  --muted: #627078;
  --line: #d9e0e3;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --soft: #e7f3f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 0;
}

.brand-logo.portaal-logo {
  width: 86px;
  height: 54px;
  border-radius: 4px;
}

.login-brand .brand-logo.portaal-logo {
  width: 112px;
  height: 72px;
}

.portaal-header-logo {
  width: 112px;
  height: 42px;
  object-fit: contain;
  margin-left: auto;
  margin-right: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.page-title {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.profile-button {
  min-height: 42px;
  width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  text-decoration: none;
  margin-left: auto;
}

.toast {
  position: fixed;
  top: 78px;
  right: 24px;
  z-index: 100;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid #8fb7b1;
  border-radius: 8px;
  color: #123b35;
  background: #e4f4ef;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.header-actions + .profile-button {
  margin-left: 0;
}

.profile-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-button:hover,
.profile-button.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--soft);
}

.menu {
  position: relative;
}

.menu summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  list-style: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary span {
  width: 20px;
  height: 2px;
  display: block;
  background: var(--ink);
}

.menu nav {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 230px;
  max-height: min(680px, calc(100vh - 92px));
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(30, 42, 47, 0.12);
  background: #fff;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}

nav a.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.home-button {
  min-height: 96px;
  display: flex;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.home-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.home-side-nav {
  position: sticky;
  top: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.home-side-nav h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.home-side-nav nav {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.home-side-nav nav a {
  margin-right: 8px;
}

.home-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.home-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-welcome h1 {
  font-size: 28px;
}

.home-top-actions,
.table-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.home-card,
.home-form-card {
  padding: 18px;
}

.home-card table {
  width: 100%;
  table-layout: auto;
  margin-top: 12px;
}

.home-inbox-table th:nth-child(1),
.home-inbox-table td:nth-child(1) {
  width: 112px;
  white-space: nowrap;
}

.home-inbox-table th:nth-child(2),
.home-inbox-table td:nth-child(2) {
  width: 84px;
  white-space: nowrap;
}

.home-inbox-table th:nth-child(3),
.home-inbox-table td:nth-child(3) {
  width: auto;
}

.home-inbox-table th:nth-child(4),
.home-inbox-table td:nth-child(4),
.home-actions-table th:last-child,
.home-actions-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.home-action-cell {
  text-align: right;
}

.home-action-cell form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.home-deadline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap;
}

.home-deadline.deadline-overdue {
  border-color: #b42318;
  color: #7a1b13;
  background: #fde2df;
}

.home-deadline.deadline-today {
  border-color: #c05621;
  color: #7c2d12;
  background: #ffedd5;
}

.home-deadline.deadline-future {
  border-color: #ca8a04;
  color: #713f12;
  background: #fef3c7;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.card-header-row h2 {
  margin: 0;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.button.secondary:hover {
  color: var(--accent-dark);
  background: var(--soft);
}

.recipient-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.check-list.compact {
  max-height: 190px;
  overflow-y: auto;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  font-weight: 400;
}

.user-group-option,
.user-group-badge {
  border-radius: 6px;
}

.user-group-option {
  padding: 4px 6px;
}

.user-group-badge {
  display: inline-flex;
  align-items: center;
  margin: 2px 4px 2px 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.user-group-admin {
  border-color: #9a3412;
  color: #7c2d12;
  background: #ffedd5;
}

.user-group-sampler {
  border-color: #047857;
  color: #065f46;
  background: #d1fae5;
}

.user-group-sorter {
  border-color: #1d4ed8;
  color: #1e3a8a;
  background: #dbeafe;
}

.user-group-extra-1 {
  border-color: #7c3aed;
  color: #4c1d95;
  background: #ede9fe;
}

.user-group-extra-2 {
  border-color: #be123c;
  color: #881337;
  background: #ffe4e6;
}

.user-group-extra-3 {
  border-color: #0f766e;
  color: #134e4a;
  background: #ccfbf1;
}

.user-group-extra-4 {
  border-color: #a16207;
  color: #713f12;
  background: #fef3c7;
}

.user-group-extra-5 {
  border-color: #4338ca;
  color: #312e81;
  background: #e0e7ff;
}

@media (max-width: 860px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-side-nav {
    position: static;
  }

  .home-welcome,
  .recipient-picker {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .home-top-actions {
    justify-content: flex-start;
  }
}

.dashboard-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.dashboard-tabs a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-tabs a.active,
.dashboard-tabs a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--soft);
}

.dashboard-tabs.sub-tabs {
  gap: 4px;
  margin-top: -6px;
  margin-bottom: 14px;
}

.dashboard-tabs.sub-tabs a {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
  border-color: transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
}

.dashboard-tabs.sub-tabs a.active,
.dashboard-tabs.sub-tabs a:hover {
  border-color: #bfd8e8;
  color: var(--accent-dark);
  background: #eef6fb;
}

.masterdata-tabs + .sub-tabs {
  margin-top: -2px;
}

.dashboard-section {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-filter {
  grid-template-columns: repeat(3, 120px) max-content;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-card {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-card span {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-card strong {
  display: block;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
}

.dashboard-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-ok {
  border-color: #7bc99a;
  background: #edf8ef;
}

.dashboard-warn {
  border-color: #f0b35a;
  background: #fff7ed;
}

.dashboard-card.placeholder {
  border-style: dashed;
}

.workflow-rules-intro {
  display: grid;
  gap: 14px;
}

.workflow-trigger-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.workflow-trigger-grid .dashboard-card {
  min-height: 0;
}

.workflow-trigger-grid .dashboard-card strong {
  font-size: 18px;
}

.workflow-trigger-grid .dashboard-card p {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.dashboard-table table {
  table-layout: fixed;
}

.dashboard-table th:nth-child(2),
.dashboard-table th:nth-child(3),
.dashboard-table th:nth-child(4),
.dashboard-table td:nth-child(2),
.dashboard-table td:nth-child(3),
.dashboard-table td:nth-child(4) {
  width: 120px;
}

.waterfall-start td {
  background: #edf8ef;
  font-weight: 800;
}

.waterfall-up td {
  background: #eef6ff;
}

.waterfall-down td {
  background: #fff7ed;
}

.waterfall-subtotal td {
  border-top: 2px solid #cbd5e1;
  background: #f8fafc;
  font-weight: 800;
}

.waterfall-chart {
  min-height: 420px;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: stretch;
}

.waterfall-axis {
  min-height: 340px;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  align-items: flex-end;
  padding: 28px 8px 34px 0;
  border-right: 5px solid #344955;
  color: #344955;
  font-size: 18px;
  font-weight: 900;
}

.waterfall-columns {
  position: relative;
  min-height: 340px;
  display: grid;
  grid-template-columns: repeat(9, minmax(70px, 1fr));
  gap: 20px;
  align-items: end;
  padding: 28px 10px 34px;
  border-bottom: 5px solid #344955;
}

.waterfall-column {
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  text-align: center;
}

.waterfall-column strong {
  color: #344955;
  font-size: 22px;
  font-weight: 900;
}

.waterfall-column span {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.waterfall-plot {
  position: relative;
  height: 260px;
}

.waterfall-floating-bar {
  position: absolute;
  right: 0;
  left: 0;
  min-height: 6px;
  border-radius: 2px;
}

.waterfall-plot .waterfall-floating-bar {
  position: absolute;
}

.waterfall-start .waterfall-floating-bar,
.waterfall-subtotal .waterfall-floating-bar {
  background: #cbd5e1;
}

.waterfall-cancelled .waterfall-floating-bar,
.waterfall-missed .waterfall-floating-bar {
  background: #f0525a;
}

.waterfall-shifted .waterfall-floating-bar {
  background: #f6d365;
}

.waterfall-replanned .waterfall-floating-bar {
  background: #f59e0b;
}

.waterfall-taken .waterfall-floating-bar {
  background: #5bb978;
}

.waterfall-up .waterfall-floating-bar {
  background: #93c5fd;
}

.waterfall-down .waterfall-floating-bar {
  background: #f0525a;
}

.waterfall-black .waterfall-floating-bar {
  background: #111827;
}

.waterfall-open .waterfall-floating-bar {
  background: #cbd5e1;
}

.dashboard-month-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-month-waterfall {
  grid-template-columns: 1fr;
}

.dashboard-month-waterfall .empty-axis {
  display: none;
}

.dashboard-month-waterfall .waterfall-columns {
  width: min(100%, 1080px);
  justify-self: center;
  gap: 10px;
  padding-left: 0;
  padding-right: 0;
  border-bottom: 0;
}

.dashboard-month-waterfall .waterfall-column {
  padding: 0;
}

.dashboard-month-waterfall .waterfall-floating-bar {
  left: 0;
  right: 0;
  min-height: 0;
}

.dashboard-month-waterfall .waterfall-column span {
  min-height: 40px;
}

.dashboard-month-report-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.dashboard-month-report-table th,
.dashboard-month-report-table td {
  width: auto;
}

.dashboard-month-report-table col.dashboard-month-label-col {
  width: 180px;
}

.dashboard-month-report-table col.dashboard-month-value-col {
  width: calc((100% - 180px) / 10);
}

.dashboard-month-report-table th:first-child,
.dashboard-month-report-table td:first-child {
  width: 180px;
  text-align: left;
}

.dashboard-month-report-table th:not(:first-child),
.dashboard-month-report-table td:not(:first-child) {
  text-align: center;
}

.dashboard-table.dashboard-month-report-table th:nth-child(n+2),
.dashboard-table.dashboard-month-report-table td:nth-child(n+2) {
  width: auto;
}

.dashboard-month-report-table {
  overflow-x: hidden;
}

.dashboard-month-report-table .dashboard-feature-link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-month-total-row td,
.dashboard-month-total-row th {
  border-top: 2px solid #94a3b8;
  background: #f8fafc;
  font-weight: 800;
}

.dashboard-month-feature-row td,
.dashboard-month-feature-row th {
  border-top: 3px solid #475569;
  vertical-align: top;
}

.dashboard-month-feature-row td {
  white-space: normal;
  line-height: 1.45;
}

.dashboard-month-group-a th,
.dashboard-month-group-a td {
  background: #ffffff;
}

.dashboard-month-group-b th,
.dashboard-month-group-b td {
  background: #f5f8fa;
}

.dashboard-month-overslag-feature-row th,
.dashboard-month-overslag-feature-row td {
  border-bottom-color: #cbd5e1;
  vertical-align: top;
  white-space: normal;
  line-height: 1.45;
}

.dashboard-feature-link {
  display: inline-block;
  margin: 0 6px 4px 0;
  font-size: 11px;
  white-space: nowrap;
}

.login-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(460px, calc(100vw - 32px));
}

.login-brand {
  margin-bottom: 18px;
}

.login-panel .grid-form {
  grid-template-columns: 1fr;
}

.login-panel .wide {
  grid-column: auto;
}

.login-panel button {
  width: 100%;
}

.compact-search {
  max-width: 240px;
}

.portaal-planning-table {
  min-width: 1120px;
}

.portaal-planning-table th:nth-child(1),
.portaal-planning-table td:nth-child(1) {
  width: 90px;
}

.portaal-planning-table th:nth-child(2),
.portaal-planning-table td:nth-child(2) {
  width: 130px;
}

.portaal-planning-table th:nth-child(3),
.portaal-planning-table td:nth-child(3) {
  width: 120px;
}

.portaal-planning-table th:nth-child(4),
.portaal-planning-table td:nth-child(4) {
  width: 190px;
}

.portaal-planning-table th:nth-child(5),
.portaal-planning-table td:nth-child(5) {
  width: 150px;
}

.portaal-planning-table th:nth-child(6),
.portaal-planning-table td:nth-child(6) {
  width: 180px;
}

.portaal-planning-table th:nth-child(7),
.portaal-planning-table td:nth-child(7) {
  width: 120px;
}

.portaal-bron-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.6fr);
  gap: 16px;
  align-items: start;
}

.portaal-bron-planning {
  grid-row: span 3;
}

.portaal-bron-overview,
.portaal-bron-results {
  grid-column: 2;
}

.portaal-bron-results table {
  min-width: 1320px;
}

.portaal-bron-results-full {
  width: 100%;
}

.portaal-bron-results-full table {
  min-width: 1320px;
}

.portaal-overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.portaal-histogram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  align-items: start;
}

.portaal-histogram-row {
  display: block;
  min-width: 0;
}

.portaal-histogram {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 180px;
  padding: 12px 8px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.portaal-histogram-bin {
  position: relative;
  flex: 1 1 6px;
  min-width: 3px;
  height: 100%;
}

.portaal-histogram-bin span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  margin: 0;
}

.portaal-histogram-bin .all {
  z-index: 1;
  background: #d9dee4;
}

.portaal-histogram-bin .source {
  z-index: 2;
  right: 8%;
  left: 8%;
  background: var(--accent);
  box-shadow: 0 0 0 1px #064e3b;
}

.portaal-histogram-bin .source[data-count="0"] {
  display: none;
}

.portaal-histogram-bin .source:not([data-count="0"]) {
  border-radius: 2px 2px 0 0;
}

.portaal-histogram-axis {
  position: relative;
  height: 24px;
  margin: 4px 8px 0;
  border-top: 1px solid #cbd5e1;
}

.portaal-histogram-axis span {
  position: absolute;
  top: 5px;
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.portaal-histogram-legend,
.portaal-benchmark-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.portaal-histogram-legend span,
.portaal-benchmark-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.portaal-histogram-legend i,
.portaal-benchmark-legend i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.portaal-histogram-legend i.source,
.portaal-benchmark-legend i.source {
  background: var(--accent);
}

.portaal-histogram-legend i.all,
.portaal-benchmark-legend i.all {
  background: #d9dee4;
}

.portaal-histogram-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.portaal-histogram-stats article {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.portaal-histogram-stats span {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.portaal-histogram-stats strong {
  color: var(--ink);
  font-size: 18px;
}

.portaal-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.compact-period-form {
  grid-template-columns: minmax(150px, 180px) max-content;
  gap: 8px;
}

@media (max-width: 980px) {
  .portaal-bron-grid,
  .portaal-bron-results {
    display: block;
  }

  .portaal-bron-grid > * + * {
    margin-top: 16px;
  }
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.notification-list {
  display: grid;
  gap: 12px;
}

.profile-form {
  grid-template-columns: minmax(0, 1fr);
  max-width: 620px;
}

.profile-readonly {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.profile-readonly div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.profile-readonly span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-readonly strong {
  display: block;
  overflow-wrap: anywhere;
}

.notification-option {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.rooster-overview .rooster-summary-row {
  cursor: pointer;
}

.rooster-overview .rooster-summary-row:hover,
.rooster-overview .rooster-summary-row.open {
  background: var(--soft);
}

.week-merged {
  width: 110px;
  vertical-align: top;
  background: #edf4f6;
}

.rooster-table-wrap {
  overflow-x: auto;
}

.rooster-table {
  width: 100%;
  min-width: 1320px;
  table-layout: fixed;
}

.rooster-table th,
.rooster-table td {
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rooster-table th:nth-child(1) { width: 58px; }
.rooster-table th:nth-child(2) { width: 72px; }
.rooster-table th:nth-child(3) { width: 122px; }
.rooster-table th:nth-child(4) { width: 110px; }
.rooster-table th:nth-child(5) { width: 118px; }
.rooster-table th:nth-child(6) { width: 108px; }
.rooster-table th:nth-child(7) { width: 98px; }
.rooster-table th:nth-child(8) { width: 116px; }
.rooster-table th:nth-child(9) { width: 50px; }
.rooster-table th:nth-child(10) { width: 68px; }
.rooster-table th:nth-child(11) { width: 108px; }
.rooster-table th:nth-child(12) { width: 62px; }
.rooster-table th:nth-child(13) { width: auto; }

.rooster-person-row th {
  padding: 9px 12px;
  border-top: 2px solid #4f6f78;
  color: #18343c;
  background: #dcebed;
  font-size: 16px;
  text-align: left;
}

.rooster-merged-cell {
  vertical-align: top;
  background: #f0f5f6;
}

.rooster-table tr.rooster-date-a > td:not(.rooster-week-cell) {
  background: #f8fbfc;
}

.rooster-table tr.rooster-date-b > td:not(.rooster-week-cell) {
  background: #eef4f5;
}

.rooster-filter-form input {
  width: 92px;
}

.registration-form-list .bulk-delete-actions {
  padding: 10px 12px;
}

.registration-form-list tbody tr[data-href] {
  cursor: pointer;
}

.registration-form-list tbody tr[data-href]:hover {
  background: var(--soft);
}

.registration-form-list th:nth-child(3),
.registration-form-list td:nth-child(3),
.registration-form-list th:nth-child(4),
.registration-form-list td:nth-child(4) {
  width: 110px;
}

.registration-builder-header > h2,
.registration-builder-header form > h2 {
  margin: 24px 0 10px;
  font-size: 18px;
}

.registration-group-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-height: none;
}

.registration-question-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.registration-question-card {
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.registration-question-card.is-dragging {
  opacity: 0.55;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}

.registration-question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.registration-question-heading strong {
  color: #334155;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.registration-question-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.registration-question-drag {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid var(--line);
  color: #475569;
  background: #fff;
  cursor: grab;
}

.registration-question-drag:active {
  cursor: grabbing;
}

.registration-question-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(210px, 1.2fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: end;
}

.registration-question-grid .wide {
  grid-column: 1 / -1;
}

.registration-required {
  min-height: 42px;
  padding-bottom: 9px;
}

.secondary-button {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.registration-task-list th:nth-child(2),
.registration-task-list td:nth-child(2) {
  width: 100px;
}

.registration-task-list th:nth-child(3),
.registration-task-list td:nth-child(3) {
  width: 190px;
}

.registration-task-list .table-action-cell {
  width: 110px;
  text-align: right;
}

.registration-fill-panel {
  max-width: 860px;
  margin-right: auto;
  margin-left: auto;
}

.registration-fill-panel h2 {
  margin: 0 0 18px;
}

.registration-fill-form {
  display: grid;
  gap: 0;
}

.registration-fill-question {
  display: grid;
  gap: 7px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
}

.registration-fill-question > span {
  font-weight: 800;
}

.registration-fill-question input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.registration-fill-question[hidden] {
  display: none;
}

.registration-fill-form > .form-actions {
  margin-top: 18px;
}

.success {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #7bc99a;
  border-radius: 6px;
  color: #166534;
  background: #edf8ef;
  font-weight: 700;
}

@media (max-width: 760px) {
  .registration-question-grid {
    grid-template-columns: 1fr;
  }

  .registration-question-grid .wide {
    grid-column: auto;
  }
}

.rooster-detail-row > td {
  padding: 14px;
  background: #fbfcfd;
}

.rooster-detail-content {
  display: grid;
  gap: 14px;
}

.rooster-detail-table {
  margin-top: 4px;
}

.rooster-timeline-wrap {
  display: grid;
  gap: 8px;
  padding-bottom: 22px;
}

.rooster-lane {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(420px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.rooster-lane-label {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.rooster-lane.route-lane .rooster-lane-label {
  background: #eef6f8;
}

.rooster-timeline {
  position: relative;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.rooster-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(30, 42, 47, 0.18);
  padding: 8px;
  color: #173039;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.rooster-segment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rooster-segment.travel {
  background: #dbeafe;
  border-color: #93c5fd;
}

.rooster-segment.wait {
  background: #fef3c7;
  border-color: #fbbf24;
}

.rooster-segment.sample {
  background: #dcfce7;
  border-color: #86efac;
}

.rooster-segment.sample-window {
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.rooster-axis {
  position: relative;
  min-height: 28px;
  margin-left: min(220px, 32%);
}

.rooster-time-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.rooster-time-marker i {
  display: block;
  width: 1px;
  height: 8px;
  margin: 0 auto 2px;
  background: var(--muted);
}

.rooster-time-marker:first-child {
  transform: translateX(0);
}

.rooster-time-marker:last-child {
  transform: translateX(-100%);
}

.permission-form {
  display: grid;
  gap: 8px;
}

.permission-toolbar {
  position: sticky;
  top: 76px;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  padding: 8px 0;
  background: var(--bg);
}

.permission-form h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.permission-matrix {
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.permission-matrix th:not(:first-child),
.permission-matrix td {
  min-width: 180px;
  text-align: center;
}

.permission-matrix th:first-child {
  min-width: 210px;
}

.permission-matrix thead th {
  position: sticky;
  top: 122px;
  z-index: 6;
  background: #fff;
  box-shadow: inset 0 -1px 0 var(--line);
}

.permission-matrix th:first-child,
.permission-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
}

.permission-matrix thead th:first-child {
  z-index: 7;
}

.permission-matrix .permission-page-row th:first-child {
  background: #f4f8fb;
  font-weight: 800;
}

.permission-matrix .permission-page-row th,
.permission-matrix .permission-page-row td {
  background: #f4f8fb;
}

.permission-matrix .permission-page-row th,
.permission-matrix .permission-page-row td {
  border-top: 3px solid #b9c8ce;
}

.permission-matrix .permission-function-row th:first-child {
  padding-left: 28px;
  color: var(--muted);
  font-weight: 650;
  background: #fff;
}

.permission-kind {
  display: inline-flex;
  min-width: 96px;
  margin-right: 8px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.matrix-group-name {
  min-width: 0;
  color: var(--muted);
  text-transform: none;
}

.matrix-group-name input {
  margin-top: 6px;
  text-transform: none;
}

.permission-overview-wrap {
  padding: 12px;
}

.permission-read-matrix {
  width: max-content;
  min-width: 0;
  font-size: 12px;
}

.permission-read-matrix th,
.permission-read-matrix td {
  padding: 4px 6px;
  border-right: 1px solid #e2e8ec;
  line-height: 1.15;
}

.permission-read-matrix th:last-child,
.permission-read-matrix td:last-child {
  border-right: 0;
}

.permission-read-matrix th:not(:first-child),
.permission-read-matrix td {
  min-width: 26px;
  width: 26px;
  text-align: center;
}

.permission-read-matrix th:first-child {
  min-width: 220px;
  max-width: 320px;
  white-space: normal;
}

.permission-read-matrix thead th {
  position: static;
}

.permission-read-matrix .permission-group-name-row th {
  height: 168px;
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
  background: #fff;
}

.permission-read-matrix .vertical-group-header {
  min-width: 26px;
  width: 26px;
  padding: 0 2px 8px;
}

.permission-read-matrix .vertical-group-header a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 150px;
  max-height: 150px;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: normal;
  overflow: hidden;
}

.permission-read-matrix .vertical-group-header a:hover {
  text-decoration: underline;
}

.permission-read-matrix .permission-page-row th,
.permission-read-matrix .permission-page-row td {
  border-top: 2px solid #b9c8ce;
}

.permission-read-matrix .permission-function-row th:first-child {
  padding-left: 20px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}

.permission-read-matrix td {
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
}

.permission-edit-table {
  width: 100%;
}

.permission-edit-table .permission-page-row th,
.permission-edit-table .permission-page-row td {
  border-top: 2px solid #b9c8ce;
  background: #f4f8fb;
}

.permission-edit-table th:first-child {
  text-align: left;
}

.permission-edit-table .permission-function-row th:first-child {
  padding-left: 28px;
  color: var(--muted);
  font-weight: 500;
}

.activity-tree-table .tree-parent-row th {
  padding-top: 14px;
  border-top: 2px solid #b9c8ce;
  background: #f4f8fb;
  color: var(--accent-dark);
  font-size: 15px;
  text-align: left;
}

.activity-tree-table .tree-child-row td:first-child {
  padding-left: 28px;
  font-weight: 700;
}

.matrix-admin {
  justify-content: center;
  margin-top: 8px;
  color: var(--muted);
  text-transform: none;
}

.competency-section {
  margin-bottom: 18px;
}

.competency-section h2 {
  margin: 0;
  padding: 14px 16px 0;
  font-size: 18px;
}

.competency-matrix th,
.competency-matrix td {
  text-align: center;
  vertical-align: middle;
}

.competency-matrix thead th {
  min-width: 96px;
  height: auto;
  vertical-align: middle;
}

.competency-matrix th:first-child,
.competency-matrix td:first-child {
  min-width: 160px;
  text-align: left;
}

.competency-matrix thead th:first-child {
  height: auto;
  vertical-align: middle;
}

.rotated-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  line-height: 1.1;
  transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.competency-matrix thead th[draggable="true"] {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.planning-drag-handle.drag-active {
  cursor: grabbing;
  color: #0f766e;
  background: #d9efec;
}

.competency-matrix thead th.dragging {
  opacity: 0.55;
}

.competency-matrix input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.competency-list .drag-handle {
  width: 34px;
  color: var(--muted);
  cursor: grab;
  font-weight: 800;
  text-align: center;
}

.competency-list tr.dragging td {
  background: var(--soft);
}

.competency-list .compact-row-form {
  grid-template-columns: minmax(220px, 1fr) 180px max-content;
}

main {
  width: min(1680px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.panel,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 18px;
}

.document-folder-card {
  max-width: 980px;
}

.document-table {
  width: 100%;
}

.document-table td:last-child {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.document-right-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #8d99a6;
  border-radius: 999px;
  color: #4a5568;
  background: #edf2f7;
  font-size: 12px;
  font-weight: 800;
}

.document-viewer h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.document-viewer pre {
  max-height: 72vh;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.grid-form,
.inline-form {
  display: grid;
  gap: 14px;
}

.grid-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.inline-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.availability-filter {
  grid-template-columns: minmax(180px, 1fr) repeat(3, 96px) max-content;
  align-items: end;
}

.availability-filter label {
  min-width: 0;
}

.availability-filter label.wide {
  grid-column: auto;
}

.availability-filter input,
.availability-filter select {
  min-height: 34px;
  padding: 0 8px;
}

.availability-filter button {
  white-space: nowrap;
}

.planning-filter {
  grid-template-columns: repeat(3, 120px) max-content;
}

.planning-filter button {
  white-space: nowrap;
}

.planningtool-run-form {
  grid-template-columns: 110px 110px 110px 170px max-content max-content;
}

.planningtool-run-form button {
  white-space: nowrap;
}

.sub-tabs + .panel,
.sub-tabs + .table-wrap {
  margin-top: 18px;
}

.table-wrap + .table-wrap,
.panel + .table-wrap,
.table-wrap + .panel {
  margin-top: 22px;
}

.table-wrap h2 {
  margin: 0;
  padding: 16px 18px 6px;
  font-size: 18px;
  text-align: left;
}

.hours-entry-form {
  grid-template-columns: minmax(150px, 1fr) 150px 148px 148px 148px minmax(170px, 1fr) max-content;
}

.hours-entry-form .wide {
  grid-column: 1 / -2;
}

.compact-action-form {
  grid-template-columns: max-content;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-group {
  display: grid;
  gap: 8px;
}

.wide {
  grid-column: span 2;
}

.full-wide {
  grid-column: 1 / -1;
}

.mail-section {
  display: grid;
  gap: 8px;
}

.mail-section h2 {
  margin: 0;
  font-size: 18px;
}

.generated-salutation {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.embedded-table {
  margin-bottom: 0;
}

.window-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  padding-right: 4px;
  white-space: nowrap;
}

.travel-matrix th,
.travel-matrix td {
  min-width: 110px;
  text-align: center;
  vertical-align: middle;
}

.travel-matrix th:first-child {
  min-width: 180px;
  text-align: left;
}

.travel-matrix input {
  text-align: center;
}

.matrix-disabled {
  background: #eef2f5;
  border-color: #dde5ec;
}

.panel-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-heading-row h2 {
  margin-bottom: 4px;
}

.rule-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.rule-list li {
  margin: 6px 0;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.info-icon .tooltip-content {
  right: 0;
  left: auto;
  bottom: auto;
  top: calc(100% + 8px);
  max-width: min(360px, calc(100vw - 64px));
  white-space: normal;
}

.planningtool-hours-table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
}

.planningtool-hours-table th,
.planningtool-hours-table td {
  width: auto;
  white-space: nowrap;
}

.planningtool-hours-table th:first-child,
.planningtool-hours-table td:first-child {
  min-width: 160px;
}

.availability-standards {
  display: grid;
  grid-template-columns: minmax(180px, 260px);
  gap: 14px;
  margin-bottom: 14px;
}

.availability-max-table {
  margin-bottom: 18px;
}

.availability-max-table input {
  max-width: 120px;
}

.week-max-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  float: right;
  margin-left: 18px;
  vertical-align: middle;
}

.week-max-inline label {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.week-max-inline input {
  width: 78px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.time-wheel {
  display: grid;
  grid-template-columns: 64px auto 64px;
  align-items: center;
  gap: 6px;
  width: max-content;
  min-height: 40px;
}

.time-wheel input {
  width: 64px;
  min-height: 40px;
  padding: 0 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.time-wheel span {
  color: var(--muted);
  font-weight: 800;
}

.quarter-time-wheel {
  grid-template-columns: 48px 8px 48px;
  gap: 4px;
}

.quarter-time-wheel input {
  width: 48px;
  min-height: 34px;
  padding: 0 4px;
}

.disabled-time-wheel {
  opacity: 0.55;
}

.disabled-time-wheel input {
  color: #64748b;
  background: #e5e7eb;
  cursor: not-allowed;
}

.embedded-table .quarter-time-wheel {
  width: 112px;
}

.embedded-table th:nth-child(4),
.embedded-table th:nth-child(5),
.embedded-table td:nth-child(4),
.embedded-table td:nth-child(5) {
  width: 126px;
  min-width: 126px;
}

.column-filter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  position: relative;
  vertical-align: middle;
  line-height: 22px;
}

.column-filter details {
  position: relative;
}

.column-filter summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  line-height: 1;
}

.column-filter.active-filter summary {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.14);
}

.filter-active-indicator {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 6px;
  height: 6px;
  display: block;
  border: 1px solid #fff;
  border-radius: 999px;
  background: var(--accent);
}

.column-filter summary::-webkit-details-marker {
  display: none;
}

.filter-popover {
  position: absolute;
  top: 28px;
  left: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  min-width: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
  color: var(--ink);
  text-transform: none;
}

th .filter-popover {
  width: 260px;
  min-width: 260px;
  text-align: left;
}

.table-wrap th:nth-child(2) .column-filter {
  min-width: 120px;
}

.filter-options {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-actions button {
  min-height: 32px;
}

.filter-actions a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.filter-fieldset {
  display: grid;
  gap: 8px;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.filter-fieldset legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.histogram-wrap {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.histogram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.histogram-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.histogram-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.histogram {
  display: grid;
  grid-template-columns: repeat(40, minmax(12px, 1fr));
  align-items: end;
  min-height: 210px;
  padding: 12px 10px 4px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  overflow-x: auto;
}

.histogram-bin {
  display: grid;
  grid-template-rows: 170px 18px;
  align-items: end;
  justify-items: center;
  min-width: 14px;
}

.histogram-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  justify-content: flex-start;
  width: 80%;
  min-height: 1px;
}

.histogram-stack span {
  display: block;
  min-height: 2px;
}

.histogram-bin small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.bron-weegbrug-table {
  margin-bottom: 28px;
}

.bron-weegbrug-analysis {
  scroll-margin-top: 18px;
}

.bron-histogram-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 12px;
}

.bron-histogram-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  gap: 10px;
  align-items: stretch;
  min-height: 240px;
}

.bron-histogram-filters .filter-fieldset {
  min-width: 0;
  align-content: start;
}

.bron-filter-weekday,
.bron-filter-vracht {
  max-height: 240px;
}

.bron-filter-weekday,
.bron-filter-vracht {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.bron-filter-scroll {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.bron-histogram-filters button {
  grid-column: 1 / -1;
}

input[type="file"] {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  line-height: 1;
}

input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #f8faf9;
  font: inherit;
  cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
  min-height: 28px;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #f8faf9;
  font: inherit;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.availability-form {
  display: grid;
  gap: 14px;
  overflow-x: auto;
}

.availability-form table {
  min-width: 620px;
}

.availability-form th:nth-child(2),
.availability-form th:nth-child(3),
.availability-form th:nth-child(4),
.availability-form td:nth-child(2),
.availability-form td:nth-child(3),
.availability-form td:nth-child(4) {
  width: 48px;
  text-align: center;
}

.availability-form td:nth-child(5) input {
  width: 100%;
}

.availability-row-available td {
  background: #edf8ef;
}

.availability-row-unavailable td {
  background: #fff7ed;
}

.availability-week-row td {
  padding: 7px 10px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: #e8eef2 !important;
  color: #334155;
}

.availability-week-row strong {
  font-weight: 800;
}

.availability-admin-wrap {
  margin-top: 18px;
}

.availability-admin-wrap h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.availability-admin-table td:not(:first-child),
.availability-admin-table th:not(:first-child) {
  min-width: 72px;
  text-align: center;
}

.availability-cell-available {
  background: #dff3e4;
}

.availability-cell-unavailable {
  background: #fff0dc;
}

.shift-list {
  display: inline;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.muted-inline {
  display: inline;
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.freeze-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.comment-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 11px;
  margin-left: 6px;
  border: 2px solid #64748b;
  border-radius: 7px;
  vertical-align: -1px;
}

.comment-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: -5px;
  width: 5px;
  height: 5px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(35deg);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--soft);
  border-color: var(--accent);
}

textarea {
  min-height: 78px;
  padding-top: 10px;
  resize: vertical;
}

button {
  min-height: 40px;
  align-self: end;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.button-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-dark);
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

a.icon-button,
button.icon-button {
  min-height: 30px;
  width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  text-decoration: none;
}

a.icon-button:hover,
button.icon-button:hover {
  background: var(--soft);
}

button.danger-icon {
  color: #b42318;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.row-actions form {
  margin: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  grid-column: 1 / -1;
}

.form-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 4px;
  grid-column: 1 / -1;
}

.inline-actions {
  padding: 12px 14px;
}

.invoice-section {
  margin-top: 18px;
}

.invoice-section h2 {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}

.invoice-section table {
  table-layout: fixed;
}

.invoice-section th:first-child,
.invoice-section td:first-child {
  width: 46px;
}

.action-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.action-link:hover {
  text-decoration: underline;
}

.stacked-link {
  display: inline-block;
  text-decoration: none;
}

.stacked-link strong,
.stacked-link > span {
  text-decoration: none;
}

.stacked-link strong {
  display: block;
  font-weight: 800;
}

.stacked-link > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}

.stacked-link:hover strong,
.stacked-link:hover > span,
.stacked-link:focus strong,
.stacked-link:focus > span {
  text-decoration: underline;
}

.stacked-link .tooltip-content,
.stacked-link:hover .tooltip-content,
.stacked-link:focus .tooltip-content,
.stacked-link .tooltip-content span,
.stacked-link:hover .tooltip-content span,
.stacked-link:focus .tooltip-content span,
.stacked-link .tooltip-content strong,
.stacked-link:hover .tooltip-content strong,
.stacked-link:focus .tooltip-content strong {
  text-decoration: none;
}

.tooltip {
  position: relative;
}

.tooltip-content {
  display: grid;
  gap: 3px;
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 12px 28px rgba(30, 42, 47, 0.14);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tooltip-content span {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.tooltip-content strong {
  font-weight: 800;
}

.tooltip:hover .tooltip-content,
.tooltip:focus .tooltip-content {
  opacity: 1;
  transform: translateY(0);
}

.error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f0b4aa;
  border-radius: 6px;
  color: #8f2d20;
  background: #fff1ee;
  font-weight: 700;
}

.notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #a7d8c9;
  border-radius: 6px;
  color: #115e59;
  background: #effaf7;
  font-weight: 700;
}

.muted-text {
  color: var(--muted);
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--soft);
}

.payload-preview {
  max-width: 420px;
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  white-space: pre-wrap;
  font-size: 12px;
}

.result-list {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--ink);
}

.danger-zone {
  border-color: #f0b4aa;
}

.danger-zone h2 {
  margin: 0 0 14px;
  color: #8f2d20;
  font-size: 18px;
}

.danger-button {
  background: #b42318;
}

.danger-button:hover {
  background: #8f1d14;
}

.bulk-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 8px 12px 0;
}

.delete-row-form {
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px 6px 0;
  margin: 0;
}

.icon-only-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  min-height: 36px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.table-wrap {
  overflow-x: auto;
}

.planning-table-wrap {
  overflow-x: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.planning-table {
  table-layout: fixed;
  font-size: 13px;
}

.planning-table th,
.planning-table td {
  padding: 9px 7px;
  overflow-wrap: anywhere;
}

.planning-table th {
  vertical-align: middle;
}

.planning-table th:nth-child(1),
.planning-table td:nth-child(1) {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  padding-right: 3px;
  padding-left: 3px;
  text-align: center;
}

.planning-table th:nth-child(2),
.planning-table td:nth-child(2) {
  width: 7%;
}

.planning-table th:nth-child(3),
.planning-table td:nth-child(3) {
  width: 7%;
}

.planning-table th:nth-child(3) .column-filter > span {
  white-space: nowrap;
}

.planning-table th:nth-child(4),
.planning-table td:nth-child(4) {
  width: 12%;
}

.planning-table th:nth-child(5),
.planning-table td:nth-child(5) {
  width: 11%;
}

.planning-table th:nth-child(6),
.planning-table td:nth-child(6) {
  width: 10%;
}

.planning-table th:nth-child(7),
.planning-table td:nth-child(7) {
  width: 5%;
  text-align: left;
}

.planning-table th:nth-child(8),
.planning-table td:nth-child(8) {
  width: 9%;
}

.planning-table th:nth-child(9),
.planning-table td:nth-child(9) {
  width: auto;
  min-width: 260px;
}

.planning-table th:nth-child(10),
.planning-table td:nth-child(10) {
  width: 10%;
}

.planning-table th:nth-child(11),
.planning-table td:nth-child(11) {
  width: 9%;
}

.planning-table th:nth-child(12),
.planning-table td:nth-child(12) {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-right: 3px;
  padding-left: 3px;
  text-align: center;
}

.planning-table th:nth-child(13),
.planning-table td:nth-child(13) {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
}

.planning-table th:nth-child(14),
.planning-table td:nth-child(14) {
  width: 24px;
  min-width: 24px;
  max-width: 24px;
}

.planning-window-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.planning-sampler-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.sampler-start-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.box-truck-icon {
  font-size: 15px;
  line-height: 1;
}

.waitplace-indicator {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 26px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.waitplace-roof {
  position: relative;
  display: block;
  width: 26px;
  height: 8px;
  margin-bottom: -1px;
}

.waitplace-roof::before,
.waitplace-roof::after {
  content: "";
  position: absolute;
  bottom: 1px;
  width: 14px;
  height: 2px;
  background: currentColor;
}

.waitplace-roof::before {
  left: 1px;
  transform: rotate(-24deg);
  transform-origin: right center;
}

.waitplace-roof::after {
  right: 1px;
  transform: rotate(24deg);
  transform-origin: left center;
}

.planning-table td.drag-cell {
  position: relative;
  padding: 0;
}

.planning-drag-handle {
  position: absolute;
  inset: -2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  border-left: 1px solid #cbd5e1;
  color: #64748b;
  background: rgba(226, 232, 240, 0.55);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.drag-chevron {
  display: block;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.drag-chevron.up {
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.drag-chevron.down {
  transform: rotate(225deg);
  margin-top: 2px;
}

.planning-drag-handle:active {
  cursor: grabbing;
}

.planning-table th:nth-child(1) input,
.planning-table td:nth-child(1) input {
  margin: 0 auto;
}

.note-cell {
  text-align: center;
}

.planning-row-icons {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.document-icon {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 16px;
  border: 2px solid #64748b;
  border-radius: 2px;
  cursor: help;
}

.document-icon::before,
.document-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  width: 7px;
  height: 1px;
  background: #64748b;
}

.document-icon::before {
  top: 5px;
}

.document-icon::after {
  top: 9px;
}

.planning-comment {
  margin-left: 0;
  cursor: help;
}

.planning-comment .tooltip-content,
.planning-log .tooltip-content {
  left: auto;
  right: 0;
}

.planning-log .tooltip-content {
  width: 460px;
  max-width: min(460px, 75vw);
}

.hours-table th,
.hours-table td {
  vertical-align: middle;
}

.hours-table th:nth-child(1),
.hours-table td:nth-child(1) {
  width: 36px;
  text-align: center;
}

.hours-table input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.hours-table th:nth-child(2),
.hours-table td:nth-child(2) {
  width: 100px;
}

.hours-table th:nth-child(3),
.hours-table td:nth-child(3) {
  width: 150px;
}

.hours-table th:nth-child(4),
.hours-table td:nth-child(4),
.hours-table th:nth-child(5),
.hours-table td:nth-child(5),
.hours-table th:nth-child(6),
.hours-table td:nth-child(6) {
  width: 70px;
  white-space: nowrap;
}

.hours-table th:nth-child(7),
.hours-table td:nth-child(7) {
  width: 150px;
}

.hours-table th:nth-child(8),
.hours-table td:nth-child(8) {
  width: auto;
  min-width: 280px;
}

.hours-table th:nth-child(9),
.hours-table td:nth-child(9),
.hours-table th:nth-child(10),
.hours-table td:nth-child(10) {
  width: 95px;
}

.hours-table th:nth-child(11),
.hours-table td:nth-child(11) {
  width: 78px;
  text-align: right;
}

.clickable-row {
  cursor: pointer;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #fbfcfc;
  font-size: 12px;
  text-transform: uppercase;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.mail-indicators {
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  flex: 0 0 auto;
}

.mail-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  color: #64748b;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.mail-cell {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.log-cell span {
  margin-top: 0;
  color: var(--ink);
}

.log-cell span + span {
  margin-top: 6px;
}

tr:last-child td {
  border-bottom: 0;
}

.planning-table tr.date-group-a td {
  background: #ffffff;
}

.planning-table tr.date-group-b td {
  background: #f5f8fa;
}

.planning-table tr.week-separator td {
  padding: 8px 14px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: #e8eef2;
  color: #334155;
  font-size: 15px;
  text-align: left;
}

.planning-table tr.week-separator strong {
  font-weight: 800;
}

tr[id] {
  scroll-margin-top: 92px;
}

tr[draggable="true"] {
  cursor: grab;
}

tr.dragging td {
  background: var(--soft);
}

.row-highlight td {
  background: #fff3b0 !important;
}

.num {
  text-align: right;
}

mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--soft);
  font-weight: 700;
}

.hours-status-open {
  color: #7c5b00;
  background: #fff2b8;
}

.hours-status-ok {
  color: #115e59;
  background: #d9f4e8;
}

.status-pill {
  min-height: 28px;
  line-height: 1;
  position: relative;
  overflow: hidden;
  justify-content: center;
  width: 118px;
  text-align: center;
  border: 1px solid #64748b;
  color: #1f2933;
  background: #eef2f4;
  isolation: isolate;
}

.status-pill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: 100%;
  background: currentColor;
  opacity: 0.18;
}

.status-pill span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 26px;
  color: inherit;
  text-align: center;
}

.status-opdracht,
.status-herplannen {
  border-color: #b7791f;
  color: #744210;
  background: #fff;
}

.status-opdracht::before,
.status-herplannen::before {
  width: 33.333%;
  background: #f6d365;
  opacity: 1;
}

.changed-planning-date {
  color: #c2410c;
  font-weight: 800;
}

.planning-generation {
  color: #c2410c;
  font-weight: 800;
}

.status-voorstel {
  border-color: #b7791f;
  color: #744210;
  background: #fff;
}

.status-voorstel::before {
  width: 66.666%;
  background: #f6d365;
  opacity: 1;
}

.status-gepland {
  border-color: #b7791f;
  color: #744210;
  background: #fff;
}

.status-gepland::before {
  width: 100%;
  background: #f6d365;
  opacity: 1;
}

.status-genomen,
.status-gesorteerd,
.status-voltooid {
  border-color: #276749;
  color: #1c4532;
  background: #fff;
}

.status-genomen::before {
  width: 33.333%;
  background: #74c69d;
  opacity: 1;
}

.status-gesorteerd::before {
  width: 66.666%;
  background: #74c69d;
  opacity: 1;
}

.status-voltooid::before {
  width: 100%;
  background: #74c69d;
  opacity: 1;
}

.status-gemist---nvw {
  border-color: #b42318;
  color: #7a271a;
  background: #fecdca;
}

.status-gefactureerd,
.status-gemist---gefactureerd,
.status-gemist---vw,
.status-teruggestuurd {
  border-color: #8d99a6;
  color: #4a5568;
  background: #edf2f7;
}

.status-geannuleerd {
  border-color: #c05621;
  color: #7b341e;
  background: #fed7aa;
}

.portaal-planning-table {
  width: 100%;
  min-width: 1180px;
}

.portaal-planning-table th,
.portaal-planning-table td {
  vertical-align: middle;
}

.portaal-planning-table th:nth-child(1),
.portaal-planning-table td:nth-child(1) {
  width: 112px !important;
}

.portaal-planning-table th:nth-child(2),
.portaal-planning-table td:nth-child(2) {
  width: 150px !important;
}

.portaal-planning-table th:nth-child(3),
.portaal-planning-table td:nth-child(3) {
  width: 94px !important;
}

.portaal-planning-table th:nth-child(4),
.portaal-planning-table td:nth-child(4) {
  width: 190px !important;
}

.portaal-planning-table th:nth-child(5),
.portaal-planning-table td:nth-child(5) {
  width: 166px !important;
}

.portaal-planning-table th:nth-child(6),
.portaal-planning-table td:nth-child(6) {
  width: 160px !important;
}

.portaal-planning-table th:nth-child(7),
.portaal-planning-table td:nth-child(7) {
  width: 120px !important;
}

.portaal-planning-table th:nth-child(8),
.portaal-planning-table td:nth-child(8) {
  width: auto !important;
  min-width: 260px;
}

.portaal-week-form {
  display: flex;
  justify-content: flex-start;
  align-items: end;
  gap: 10px;
}

.portaal-week-form label {
  width: 104px;
}

.portaal-week-form button {
  width: auto;
}

.portaal-result-period-form {
  display: flex;
  justify-content: flex-start;
  align-items: end;
  gap: 10px;
}

.portaal-result-period-form label {
  width: 112px;
}

.portaal-result-filter-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.portaal-result-filter-form > label:not(.portaal-multiselect-label) {
  flex: 0 0 148px;
}

.portaal-result-filter-form button[type="submit"] {
  flex: 0 0 auto;
  width: auto;
}

.portaal-multiselect-label {
  position: relative;
  display: grid;
  flex: 0 1 180px;
  gap: 6px;
  min-width: 130px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portaal-multiselect {
  position: relative;
}

.portaal-multiselect summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 30px 8px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.portaal-multiselect summary::after {
  position: absolute;
  right: 10px;
  content: "▾";
  color: var(--muted);
}

.portaal-multiselect summary::-webkit-details-marker {
  display: none;
}

.portaal-multiselect-popover {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 9px;
  width: max(260px, 100%);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.portaal-multiselect-search {
  min-height: 34px;
  padding: 6px 8px;
}

.portaal-multiselect-all {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.portaal-multiselect-options {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
}

.portaal-multiselect-option {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.portaal-unit-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-self: flex-end;
  margin-left: auto;
}

button.portaal-unit-button {
  width: 46px !important;
  min-width: 46px;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #fff !important;
  color: var(--ink) !important;
}

button.portaal-unit-button:hover,
button.portaal-unit-button.active {
  border-color: var(--accent);
  background: #fff !important;
  color: var(--accent-dark) !important;
}

button.portaal-unit-button.active {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.portaal-bin-size-control {
  width: 98px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
}

.portaal-bin-size-control input {
  min-height: 30px;
  padding: 4px 6px;
}

.portaal-results-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.portaal-results-table th:first-child,
.portaal-results-table td:first-child {
  width: 132px;
}

.portaal-results-table th:nth-child(2),
.portaal-results-table td:nth-child(2),
.portaal-results-table th:nth-child(3),
.portaal-results-table td:nth-child(3) {
  width: 64px;
  text-align: right;
}

.portaal-results-table th.vertical-header {
  width: 34px;
  height: 132px;
  padding: 4px 3px;
  vertical-align: bottom;
  text-align: center;
}

.portaal-results-table th.vertical-header > span {
  display: inline-block;
  width: 124px;
  margin: 0;
  color: inherit;
  font-size: 10px;
  line-height: 1.15;
  text-align: left;
  transform: rotate(-90deg) translateX(-5px);
  transform-origin: left center;
  white-space: normal;
  overflow-wrap: normal;
}

.portaal-results-table td {
  text-align: right;
  white-space: nowrap;
  padding-right: 4px;
  padding-left: 4px;
}

.portaal-results-table td:first-child {
  text-align: left;
  white-space: normal;
}

.portaal-results-table th:not(:first-child),
.portaal-results-table td:not(:first-child) {
  width: 34px;
  max-width: 42px;
}

.portaal-bron-results-table th:nth-child(1),
.portaal-bron-results-table td:nth-child(1) {
  width: 82px;
  max-width: 82px;
}

.portaal-bron-results-table th:nth-child(2),
.portaal-bron-results-table td:nth-child(2) {
  width: 132px;
  max-width: 132px;
  text-align: left;
}

.portaal-bron-results-table .portaal-kenmerk-link,
.portaal-bron-results-table .portaal-kenmerk-link strong {
  font-size: inherit;
}

.portaal-bron-results-full table {
  min-width: 100%;
}

.portaal-bron-results-table th:nth-child(3),
.portaal-bron-results-table td:nth-child(3) {
  width: 116px;
  max-width: 116px;
  text-align: left;
}

.portaal-total-row td {
  position: sticky;
  top: 0;
  z-index: 1;
  border-top: 2px solid #8fb7b1;
  border-bottom: 2px solid #8fb7b1;
  background: #e4f4ef !important;
  color: #123b35;
}

.portaal-results-table:not(.portaal-bron-results-table) th:nth-child(1),
.portaal-results-table:not(.portaal-bron-results-table) td:nth-child(1) {
  width: 132px !important;
  max-width: 132px !important;
}

.portaal-results-table:not(.portaal-bron-results-table) th:nth-child(2),
.portaal-results-table:not(.portaal-bron-results-table) td:nth-child(2),
.portaal-results-table:not(.portaal-bron-results-table) th:nth-child(3),
.portaal-results-table:not(.portaal-bron-results-table) td:nth-child(3) {
  width: 42px !important;
  max-width: 42px !important;
}

.portaal-bron-results-table th:nth-child(1),
.portaal-bron-results-table td:nth-child(1) {
  width: 82px !important;
  max-width: 82px !important;
}

.portaal-bron-results-table th:nth-child(2),
.portaal-bron-results-table td:nth-child(2) {
  width: 132px !important;
  max-width: 132px !important;
  text-align: left;
}

.portaal-bron-results-table th:nth-child(3),
.portaal-bron-results-table td:nth-child(3) {
  width: 116px !important;
  max-width: 116px !important;
  text-align: left;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable::after {
  content: "↕";
  margin-left: 6px;
  color: #94a3b8;
  font-size: 11px;
}

th.sortable[data-sort-dir="asc"]::after {
  content: "↑";
  color: var(--accent-dark);
}

th.sortable[data-sort-dir="desc"]::after {
  content: "↓";
  color: var(--accent-dark);
}

.portaal-kenmerk-link {
  color: var(--accent-dark);
  text-decoration: none;
}

.portaal-kenmerk-link:hover {
  text-decoration: underline;
}

.portaal-bron-link strong {
  color: var(--accent-dark);
}

.portaal-bron-link > span {
  color: var(--muted);
  font-weight: 400;
}

.portaal-kenmerk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.portaal-kenmerk-table {
  grid-row: span 2;
}

.portaal-kenmerk-layout {
  display: grid;
  gap: 16px;
}

.portaal-kenmerk-results-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.portaal-kenmerk-results-table th.vertical-header {
  width: 34px !important;
  max-width: 38px !important;
  height: 132px;
  padding: 4px 2px;
}

.portaal-kenmerk-results-table th.vertical-header > span {
  width: 124px;
  transform: rotate(-90deg) translateX(-6px);
  transform-origin: left center;
}

.portaal-kenmerk-results-table th:nth-child(1),
.portaal-kenmerk-results-table td:nth-child(1) {
  width: 82px !important;
  max-width: 82px !important;
  text-align: left;
}

.portaal-kenmerk-results-table th:nth-child(2),
.portaal-kenmerk-results-table td:nth-child(2) {
  width: 112px !important;
  max-width: 112px !important;
  text-align: left;
}

.portaal-kenmerk-results-table th:nth-child(3),
.portaal-kenmerk-results-table td:nth-child(3) {
  width: 96px !important;
  max-width: 96px !important;
  text-align: left;
}

.portaal-kenmerk-results-table th:nth-child(n+4),
.portaal-kenmerk-results-table td:nth-child(n+4) {
  width: 34px !important;
  max-width: 38px !important;
}

.portaal-pie-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.portaal-pie {
  width: 220px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.portaal-pie-legend {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow-y: auto;
}

.portaal-pie-legend-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
}

.portaal-pie-legend-item span {
  width: 12px;
  height: 12px;
  margin: 0;
  border-radius: 3px;
}

.portaal-pie-legend-item em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .portaal-kenmerk-grid,
  .portaal-pie-wrap {
    display: block;
  }

  .portaal-kenmerk-grid > * + *,
  .portaal-pie-legend {
    margin-top: 16px;
  }
}

.portaal-week-separator td {
  padding: 8px 14px !important;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: #e8eef2 !important;
  color: #334155;
  font-size: 15px;
  text-align: left !important;
}

.portaal-status-pill {
  border-width: 1px;
}

.portaal-status-pill::before {
  width: 100% !important;
  opacity: 1;
}

.portaal-status-analyse-beschikbaar {
  border-color: #276749;
  color: #1c4532;
  background: #fff;
}

.portaal-status-analyse-beschikbaar::before {
  background: #74c69d;
}

.portaal-status-inhalen {
  border-color: #b42318;
  color: #7a271a;
  background: #fff;
}

.portaal-status-inhalen::before {
  background: #fecdca;
}

.portaal-status-monster-genomen {
  border-color: #b7791f;
  color: #744210;
  background: #fff;
}

.portaal-status-monster-genomen::before {
  background: #f6d365;
}

.portaal-status-gepland {
  border-color: #c05621;
  color: #7b341e;
  background: #fff;
}

.portaal-status-gepland::before {
  background: #fed7aa;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 22px 18px;
  }

  .brand {
    align-items: start;
  }

  .grid-form,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}

/* Portaal refinements: keep these late so they override older portal table rules. */
.portaal-planning-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}

.portaal-planning-table th,
.portaal-planning-table td {
  vertical-align: top;
}

.portaal-planning-table th:nth-child(1),
.portaal-planning-table td:nth-child(1) {
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  white-space: nowrap;
}

.portaal-planning-table th:nth-child(2),
.portaal-planning-table td:nth-child(2) {
  width: 150px !important;
  max-width: 150px !important;
}

.portaal-planning-table th:nth-child(3),
.portaal-planning-table td:nth-child(3) {
  width: 132px !important;
  max-width: 132px !important;
}

.portaal-planning-table th:nth-child(4),
.portaal-planning-table td:nth-child(4) {
  width: 126px !important;
  max-width: 126px !important;
}

.portaal-planning-table th:nth-child(5),
.portaal-planning-table td:nth-child(5) {
  width: 104px !important;
  max-width: 104px !important;
}

.portaal-planning-table th:nth-child(6),
.portaal-planning-table td:nth-child(6) {
  width: 142px !important;
  max-width: 142px !important;
}

.portaal-planning-table th:nth-child(7),
.portaal-planning-table td:nth-child(7) {
  width: 96px !important;
  max-width: 96px !important;
}

.portaal-planning-table th:nth-child(8),
.portaal-planning-table td:nth-child(8) {
  width: 136px !important;
  min-width: 136px !important;
  max-width: 136px !important;
}

.portaal-planning-table th:nth-child(9),
.portaal-planning-table td:nth-child(9) {
  width: 132px !important;
  max-width: 132px !important;
}

.portaal-planning-table th:nth-child(10),
.portaal-planning-table td:nth-child(10) {
  width: 128px !important;
  max-width: 128px !important;
}

.portaal-planning-table th:nth-child(11),
.portaal-planning-table td:nth-child(11) {
  width: auto !important;
  min-width: 160px !important;
}

.portaal-results-table thead tr {
  height: 210px;
}

.portaal-results-table th.vertical-header {
  position: relative;
  width: 34px !important;
  max-width: 38px !important;
  height: 210px;
  padding: 0 0 24px;
  overflow: visible;
  vertical-align: middle;
  text-align: center;
}

.portaal-results-table th.vertical-header > span {
  position: absolute;
  left: 50%;
  top: calc(50% - 10px);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 190px;
  height: 20px;
  margin: 0;
  text-align: left;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center center;
  white-space: nowrap;
}

.portaal-results-table th.sortable.vertical-header::after {
  position: absolute;
  right: 0;
  left: 0;
  bottom: 5px;
  margin: 0;
  transform: none;
  width: auto;
  text-align: center;
  line-height: 1;
  pointer-events: none;
}

.portaal-histogram-plot {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}

.portaal-histogram {
  min-width: 0;
}

.portaal-histogram-yaxis {
  position: relative;
  height: 180px;
  padding: 12px 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.portaal-histogram-yaxis span {
  position: absolute;
  display: block;
  margin: 0;
  line-height: 1;
  transform: translateY(50%);
}

.portaal-histogram-yaxis.source {
  color: var(--accent-dark);
  text-align: right;
}

.portaal-histogram-yaxis.source span {
  right: 0;
}

.portaal-histogram-yaxis.all {
  color: #64748b;
}

.portaal-histogram-yaxis.all span {
  left: 0;
}

.portaal-histogram-axis {
  margin-left: 58px !important;
  margin-right: 58px !important;
}

.portaal-invoice-table {
  margin-top: 18px;
}

.portaal-kenmerk-results-table {
  width: max-content !important;
  min-width: 100%;
}

.portaal-kenmerk-results-table th:nth-child(1),
.portaal-kenmerk-results-table td:nth-child(1) {
  width: 68px !important;
  min-width: 68px !important;
  max-width: 68px !important;
}

.portaal-kenmerk-results-table th:nth-child(2),
.portaal-kenmerk-results-table td:nth-child(2) {
  width: 148px !important;
  min-width: 148px !important;
  max-width: 148px !important;
}

.portaal-kenmerk-results-table th:nth-child(3),
.portaal-kenmerk-results-table td:nth-child(3) {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
}

.portaal-kenmerk-results-table th:nth-child(n+4),
.portaal-kenmerk-results-table td:nth-child(n+4) {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  padding-right: 2px;
  padding-left: 2px;
}

.portaal-pie-card {
  width: min(100%, 620px);
}

.portaal-benchmark-controls {
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.9fr) minmax(150px, 1fr) minmax(240px, 1.4fr) auto;
}

.portaal-benchmark-result {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.portaal-benchmark-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
}

.portaal-benchmark-card-header h2 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portaal-mini-chart {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.portaal-trend-chart {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.portaal-distribution-chart {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.portaal-distribution-chart svg,
.portaal-trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.portaal-distribution-chart text,
.portaal-trend-chart text {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.portaal-distribution-bar-all {
  fill: #d9dee4;
}

.portaal-distribution-bar-source {
  fill: var(--accent);
  stroke: #064e3b;
  stroke-width: 1;
}

.portaal-chart-y-label-source {
  fill: #0f766e !important;
}

.portaal-chart-y-label-compare {
  fill: #64748b !important;
}

.portaal-chart-secondary-axis {
  stroke: #94a3b8;
}

.portaal-trend-x-axis {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.portaal-trend-y-axis {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.portaal-trend-week-label,
.portaal-trend-year-label,
.portaal-trend-y-label,
.portaal-chart-x-label,
.portaal-chart-y-label {
  dominant-baseline: middle;
}

.portaal-trend-year-label {
  font-weight: 800;
}

.portaal-trend-card {
  margin-top: 0;
}

.portaal-benchmark-legend {
  justify-content: flex-end;
  margin: 10px 0 12px;
}

.portaal-benchmark-result .portaal-histogram-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.portaal-benchmark-result .portaal-histogram-stats article {
  padding: 7px 8px;
  border-radius: 5px;
}

.portaal-benchmark-result .portaal-histogram-stats span {
  margin: 3px 0 0;
  color: #111827;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.15;
  text-transform: none;
}

.portaal-benchmark-result .portaal-histogram-stats strong {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.portaal-benchmark-result .portaal-bin-size-control {
  align-items: center;
  gap: 5px;
  color: #111827;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
}

.portaal-benchmark-result .portaal-bin-size-control input {
  width: 62px;
  min-width: 62px;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.portaal-pie-wrap {
  grid-template-columns: 220px minmax(220px, 1fr);
}

.portaal-pie-svg {
  width: 220px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.portaal-pie-svg path,
.portaal-pie-svg circle {
  cursor: help;
  transition: filter 0.12s ease, opacity 0.12s ease;
}

.portaal-pie-svg path:hover,
.portaal-pie-svg circle:hover {
  filter: brightness(1.08);
  opacity: 0.88;
}

.portaal-pie-legend-item {
  grid-template-columns: 14px minmax(0, 1fr) !important;
}

.portaal-report-actions {
  align-items: center;
  justify-content: flex-end;
}

.portaal-report-slide {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-color: #d7e1e7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.portaal-report-header {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 92px;
  gap: 18px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.portaal-report-header img {
  max-width: 100%;
  max-height: 54px;
  object-fit: contain;
}

.portaal-report-header div {
  display: grid;
  gap: 3px;
}

.portaal-report-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.portaal-report-header strong {
  color: var(--ink);
  font-size: 24px;
}

.portaal-report-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.portaal-report-section-title {
  margin: 0 0 -4px;
  color: var(--ink);
  font-size: 17px;
}

.portaal-report-metadata-section {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.portaal-report-metadata-section h3 {
  margin: 0 0 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid #bfd0d6;
  color: var(--ink);
  font-size: 16px;
}

.portaal-report-metadata-section div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portaal-report-metadata span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.portaal-report-metadata strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.portaal-report-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.portaal-report-results {
  min-width: 0;
  width: 100%;
}

.portaal-report-results h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.portaal-report-results table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.portaal-report-results th,
.portaal-report-results td {
  border: 1px solid var(--line);
  padding: 7px 5px;
  text-align: center;
  vertical-align: middle;
}

.portaal-report-results thead th {
  height: 118px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: #e3eef0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.1;
}

.portaal-report-results thead th.portaal-report-unit-header {
  width: 58px;
  writing-mode: horizontal-tb;
  transform: none;
}

.portaal-report-results tbody th {
  width: 58px;
  background: #f1f5f7;
  color: var(--ink);
}

.portaal-report-pie {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.portaal-report-pie .portaal-pie-svg {
  width: 230px;
}

.portaal-report-pie .portaal-pie-legend {
  width: 100%;
  grid-template-columns: 1fr;
}

.portaal-report-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.portaal-report-appendix {
  margin-top: 18px;
  padding: 22px;
}

.portaal-report-appendix h2 {
  margin-top: 0;
}

.portaal-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.portaal-photo-placeholder {
  display: grid;
  gap: 7px;
  place-items: center;
  min-height: 170px;
  padding: 18px;
  border: 1px dashed #9fb0bc;
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
  text-align: center;
}

.portaal-photo-placeholder strong {
  color: var(--ink);
}

.portaal-photo-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 42px;
  border: 2px solid #9fb0bc;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.portaal-bron-results-table th:nth-child(3),
.portaal-bron-results-table td:nth-child(3) {
  width: 154px !important;
  min-width: 154px !important;
  max-width: 154px !important;
}

.portaal-bron-results-table .portaal-status-pill {
  width: 138px;
}
