.agenda {
  container-type: inline-size;
  --agenda-work: #265477;
  --agenda-work-bg: #edf5fc;
  --agenda-rental: #79501b;
  --agenda-rental-bg: #fbf2e3;
}

.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.agenda-period {
  color: var(--ink);
  font-size: .98rem;
  font-weight: 720;
}

.agenda-week-controls, .agenda-day-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agenda-week-controls button, .agenda-day-controls button {
  min-height: 44px;
  padding-inline: 9px;
  font-size: .86rem;
}

.agenda-day-controls { display: none; }
.agenda-selected-day {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.agenda-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.agenda-day {
  min-width: 0;
  min-height: 131px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fa;
  padding: 7px;
}

.agenda-day header {
  display: grid;
  gap: 2px;
  margin-bottom: 7px;
}

.agenda-day header h3 {
  margin: 0;
  color: var(--ink);
  font-size: .91rem;
  line-height: 1.25;
  text-transform: capitalize;
  overflow-wrap: anywhere;
}

.agenda-day header time {
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.35;
}

.agenda-day[aria-current] { border-color: #8db4cb; }
.agenda-day[aria-current] header h3 { color: #1f5578; }

.agenda-block {
  display: grid;
  gap: 3px;
  margin: 5px 0;
  border: 1px solid #caddeb;
  border-left: 3px solid #487398;
  border-radius: 6px;
  background: var(--agenda-work-bg);
  color: var(--agenda-work);
  padding: 5px 6px;
  font-size: .81rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.agenda-block[data-kind="Verhuur"] {
  border-color: #e8d6b9;
  border-left-color: #ae7a38;
  background: var(--agenda-rental-bg);
  color: var(--agenda-rental);
}

.agenda-block:hover strong { text-decoration: underline; }
.agenda-block-selected { outline: 2px solid currentColor; outline-offset: 1px; }
.agenda-block strong { font-size: .86rem; }
.agenda-time { font-variant-numeric: tabular-nums; font-weight: 740; }
.agenda-kind { font-weight: 680; }
.agenda-empty { margin: 0; color: var(--muted); font-size: .84rem; }

.dispatch { color: #243f4c; }
.dispatch-queues { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.dispatch-queue {
  min-width: 0; background: #f4f8f6; border-top: 2px solid #4b856f;
  border-radius: 5px; padding: 11px 13px;
}
.dispatch-queue[data-planning-group="blocked"] { background: #faf5ec; border-top-color: #ad7740; }
.dispatch-queue[data-planning-group="unknown"] { margin-top: 12px; background: #f4f6f8; border-top-color: #81939e; }
.dispatch-queue header { display: flex; align-items: center; justify-content: space-between; gap: 5px 10px; flex-wrap: wrap; }
.dispatch-queue header h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .99rem; }
.dispatch-queue header a { font-size: .84rem; text-underline-offset: 2px; min-height: 34px; display: inline-flex; align-items: center; }
.dispatch-count { font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #425763; }
.dispatch-queue p { margin: 6px 0 1px; font-size: .875rem; }
.dispatch-previews { list-style: none; margin: 0; padding: 0; }
.dispatch-preview {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start;
  gap: 3px 10px; border-top: 1px solid #d9e3df; padding: 7px 0 6px;
}
.dispatch-preview:last-child { padding-bottom: 1px; }
.dispatch-preview-order { min-width: 0; overflow-wrap: anywhere; }
.dispatch-preview-order a {
  color: #1c465a; font-size: .9rem; font-weight: 670; text-underline-offset: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dispatch-preview-order small { color: #536975; font-size: .78rem; }
.dispatch-preview .dispatch-phase { font-size: .78rem; text-align: right; color: #405769; }
.dispatch-preview-material, .dispatch-preview .dispatch-conflict { grid-column: 1 / -1; line-height: 1.35; overflow-wrap: anywhere; }
.dispatch-preview .dispatch-conflict { color: #924325; font-weight: 650; }
.dispatch-phase { color: #304d5c; font-weight: 650; }
.dispatch-filters { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 18px; }
.dispatch-filters a {
  display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 6px 11px;
  color: #37545f; border: 1px solid #d2dfe1; border-radius: 20px;
  font-size: .9rem; text-decoration: none; font-weight: 600;
}
.dispatch-filters a:hover { background: #f0f5f6; }
.dispatch-filters a[aria-current] { color: #fff; border-color: #284f5c; background: linear-gradient(105deg,#254956,#34616b); }
.dispatch-filters b { font-variant-numeric: tabular-nums; }
.dispatch-list { margin: 0; padding: 0; list-style: none; }
.dispatch-cols, .dispatch-row {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(145px,.68fr);
  gap: clamp(16px,2.8vw,46px); align-items: center;
}
.dispatch-cols { border-bottom: 1px solid #d4dfe3; padding: 4px 6px 10px; font-weight: 600; font-size: .86rem; color: #526a76; }
.dispatch-row { border-bottom: 1px solid #e0e7e8; padding: 14px 6px; }
.dispatch-row:last-child { border-bottom: 0; padding-bottom: 5px; }
.dispatch-row > div { display: grid; justify-items: start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.dispatch-order a { color: #1c465a; font-size: 1rem; font-weight: 670; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dispatch-row small { line-height: 1.4; font-size: .875rem; color: #536975; }
.dispatch-slot { font-size: .93rem; }
.dispatch-slot a { font-size: .88rem; text-underline-offset: 2px; }
.dispatch-slot .dispatch-conflict { color: #924325; font-weight: 600; }
.dispatch-status,.agenda-readiness { color: var(--material-tone,#566975); font-weight: 650; }
.dispatch-status::before,.agenda-readiness::before {
  content: ''; display: inline-block; width: .49em; height: .49em; margin: 0 .48em .09em 0;
  border-radius: 50%; background: var(--material-tone,#566975);
}
[data-readiness="ready"] { --material-tone: #227057; }
[data-readiness="shortage"] { --material-tone: #924325; }
[data-readiness="waiting"] { --material-tone: #78551f; }
.agenda-readiness { border-top: 1px solid #c7d8dd; margin-top: 3px; padding-top: 5px; font-size: .875rem; }
.dispatch [data-page-list] > label { margin: 0 0 16px; max-width: 32rem; }
@media (max-width: 700px) {
  .dispatch-queues { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .dispatch-queue { padding: 5px 9px 8px; }
  .dispatch-queue header a { min-height: 42px; }
  .dispatch-queue[data-planning-group="unknown"] { margin-top: 8px; }
  .dispatch-preview-extra { display: none; }
  .dispatch-cols { display: none; }
  .dispatch-filters { gap: 6px; }
  .dispatch-filters a { min-height: 44px; font-size: .875rem; }
  .dispatch-row { grid-template-columns: minmax(0,1fr) minmax(0,.84fr); align-items: start; gap: 10px 16px; padding: 16px 0; }
  .dispatch-order { grid-column: 1 / -1; }
  .dispatch-slot { border-left: 1px solid #d7e2e5; padding-left: 14px; }
  .dispatch-order a { display: inline-block; padding-block: 5px; }
  .dispatch-slot a { display: inline-flex; align-items: center; min-height: 44px; }
}

@container (max-width: 720px) {
  .agenda-toolbar { margin-bottom: 9px; }
  .agenda-day-controls { display: flex; margin-bottom: 9px; }
  .agenda-week { grid-template-columns: minmax(0, 1fr); }
  .agenda-day { display: none; min-height: 88px; padding: 10px; }
  .agenda-day-active { display: block; }
  .agenda-day header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 9px; }
  .agenda-day header h3 { font-size: 1rem; }
  .agenda-day header time { font-size: .85rem; }
  .agenda-block { min-height: 44px; padding: 7px 9px; font-size: .87rem; }
  .agenda-block strong { font-size: .95rem; }
}
