/* ==========================================================================
   Straatwaarde Crew Planning - application styles.

   Sections, in order:
     1. base            resets and typography
     2. layout          page shell and containers
     3. navigation      the top bar
     4. controls        buttons, inputs, switches
     5. cards & panels
     6. planning grid   the desktop matrix
     7. planning cards  the mobile equivalent
     8. map
     9. tables          admin
    10. feedback        toasts, empty states, loading
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700&display=swap');

/* == 1. base =============================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Anything given an explicit display - .field, .switch, .nav__badge - would
   otherwise outrank the user-agent [hidden] rule and stay on screen after
   being hidden from script. One rule settles it for the whole app. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  font-weight: 700;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--brand-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* == 2. layout ============================================================= */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-7);
}

.page--narrow {
  max-width: 720px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.page-head__title {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.page-head__subtitle {
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.row--end {
  justify-content: flex-end;
}

.row--between {
  justify-content: space-between;
}

/* == 3. navigation ========================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--nav-height);
  padding: 0 var(--space-5);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav__brand span {
  color: var(--brand);
}

.nav__counts {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

/* The two year-to-date totals: booked shows and options. */
.count-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.count-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.count-chip--boeking::before {
  background: var(--ja);
}

.count-chip--optie::before {
  background: var(--optie);
}

.count-chip strong {
  color: var(--ink);
  font-size: var(--text-sm);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.nav__link:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.nav__link[aria-current='page'] {
  background: var(--brand-wash);
  color: var(--brand-bright);
}

.nav__badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}

/* Raised above .button, which is defined later and would otherwise win the
   specificity tie and keep the toggle visible on desktop. */
.nav .nav__toggle {
  display: none;
  margin-left: auto;
}

/* == 4. controls =========================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}

.button:hover:not(:disabled) {
  background: var(--brand-bright);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-muted);
}

.button--ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--brand);
  color: var(--ink);
}

.button--danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--nee) 45%, transparent);
  color: var(--nee);
}

.button--danger:hover:not(:disabled) {
  background: var(--nee-wash);
}

.button--small {
  padding: 0.35rem 0.7rem;
  font-size: var(--text-xs);
}

.button--block {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  line-height: 1.5;
}

.field__error {
  font-size: var(--text-xs);
  color: var(--nee);
}

.input,
.select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.input::placeholder {
  color: var(--ink-faint);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.input--inline {
  padding: 0.3rem 0.5rem;
  font-size: var(--text-sm);
  background: transparent;
  border-color: transparent;
}

.input--inline:hover:not(:disabled) {
  border-color: var(--line-strong);
}

/* A checkbox that reads as a switch. */
.switch {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  flex: 0 0 auto;
  position: relative;
  width: 40px;
  height: 23px;
  margin-top: 1px;
  border-radius: var(--radius-pill);
  background: var(--open);
  transition: background var(--normal) var(--ease);
}

.switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--normal) var(--ease);
}

.switch input:checked + .switch__track {
  background: var(--brand);
}

.switch input:checked + .switch__track::after {
  transform: translateX(17px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
}

.switch__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch__title {
  font-size: var(--text-sm);
  font-weight: 600;
}

.switch__hint {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  line-height: 1.5;
}

.switch input:disabled ~ .switch__text {
  opacity: 0.5;
}

/* The JA / OPTIE / NEE control, used on cards and in the open-requests list. */
.answer-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.answer {
  padding: 0.5rem 0.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}

.answer:hover:not(:disabled) {
  border-color: currentColor;
}

.answer--ja:hover:not(:disabled),
.answer--ja[aria-pressed='true'] {
  color: var(--ja);
  border-color: var(--ja);
}

.answer--optie:hover:not(:disabled),
.answer--optie[aria-pressed='true'] {
  color: var(--optie);
  border-color: var(--optie);
}

.answer--nee:hover:not(:disabled),
.answer--nee[aria-pressed='true'] {
  color: var(--nee);
  border-color: var(--nee);
}

.answer[aria-pressed='true'] {
  background: currentColor;
  font-weight: 700;
}

.answer--ja[aria-pressed='true'] {
  background: var(--ja);
  color: #fff;
}

.answer--optie[aria-pressed='true'] {
  background: var(--optie);
  color: var(--ink-inverse);
}

.answer--nee[aria-pressed='true'] {
  background: var(--nee);
  color: #fff;
}

.answer:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* == 5. cards & panels ===================================================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.panel__title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* The "next show" hero on the planning page. */
.next-show {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.next-show__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.next-show__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.7fr 2fr;
  gap: var(--space-5);
  margin-top: var(--space-4);
}

.next-show__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.next-show__key {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.next-show__value {
  font-size: var(--text-lg);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.next-show__value--muted {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--ink-muted);
}

/* == 6. planning grid ====================================================== */

/* The grid is its own scroll region rather than growing the page. Setting
   overflow-x alone would force overflow-y to auto anyway, and the sticky
   header would then anchor to this box while the page scrolled past it.
   Owning the scrolling outright is what makes the header actually pin. */
.grid-wrap {
  overflow: auto;
  max-height: calc(100vh - var(--nav-height) - var(--space-6));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overscroll-behavior: contain;
}

.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.grid th,
.grid td {
  padding: var(--space-3);
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.grid thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-raised);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-strong);
}

.grid th.th--person {
  min-width: 82px;
}

.grid th.th--person small {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.grid td:first-child,
.grid th:first-child {
  text-align: left;
  padding-left: var(--space-4);
}

.grid tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-hover) 60%, transparent);
}

.grid tbody tr:last-child td {
  border-bottom: none;
}

/* A 3px rail on the left of each row carrying the overall status. */
.grid td.cell--type {
  border-left: 3px solid transparent;
}

tr[data-status='ok'] td.cell--type {
  border-left-color: var(--ja);
}

tr[data-status='warn'] td.cell--type {
  border-left-color: var(--optie);
}

tr[data-status='danger'] td.cell--type {
  border-left-color: var(--nee);
}

/* The two blocks - stage crew and FOH - get a tinted wash instead of the
   solid fill production used, so the checkboxes stay readable. */
td.block--stage[data-status='ok'],
td.block--foh[data-status='ok'] {
  background: var(--ja-wash);
}

td.block--stage[data-status='warn'],
td.block--foh[data-status='warn'] {
  background: var(--optie-wash);
}

td.block--stage[data-status='danger'],
td.block--foh[data-status='danger'] {
  background: var(--nee-wash);
}

td.block--foh {
  border-left: 1px solid var(--line-strong);
}

.type-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.type-tag--boeking {
  background: var(--brand-wash);
  color: var(--brand-bright);
}

.type-tag--optie {
  background: color-mix(in srgb, var(--optie) 16%, transparent);
  color: var(--optie);
}

.callsheet-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

/* The three availability squares inside a grid cell. */
.marks {
  display: inline-flex;
  gap: 4px;
}

.mark {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}

.mark:hover:not(:disabled) {
  transform: scale(1.12);
}

.mark--ja[aria-pressed='true'] {
  background: var(--ja);
  border-color: var(--ja);
}

.mark--optie[aria-pressed='true'] {
  background: var(--optie);
  border-color: var(--optie);
}

.mark--nee[aria-pressed='true'] {
  background: var(--nee);
  border-color: var(--nee);
}

.mark:disabled {
  opacity: 0.45;
  cursor: default;
}

.mark:disabled:hover {
  transform: none;
}

/* == 7. planning cards (mobile) ============================================ */

.show-cards {
  display: none;
  flex-direction: column;
  gap: var(--space-4);
}

.show-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.show-card[data-status='ok'] {
  border-left-color: var(--ja);
}

.show-card[data-status='warn'] {
  border-left-color: var(--optie);
}

.show-card[data-status='danger'] {
  border-left-color: var(--nee);
}

.show-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.show-card__location {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
}

.show-card__when {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.show-card__section {
  margin-top: var(--space-4);
}

.show-card__section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
}

.crew-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--space-2);
}

.crew-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.crew-chip__name {
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-chip__bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--open);
}

.crew-chip__bar[data-answer='JA'] {
  background: var(--ja);
}

.crew-chip__bar[data-answer='OPTIE'] {
  background: var(--optie);
}

.crew-chip__bar[data-answer='NEE'] {
  background: var(--nee);
}

/* == 8. map ================================================================ */

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.map-toolbar__group {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.map-toolbar__spacer {
  margin-left: auto;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  cursor: pointer;
}

.checkline input {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

.slider-row output {
  min-width: 7rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

input[type='range'] {
  flex: 1;
  accent-color: var(--brand);
  min-width: 140px;
}

#map {
  height: min(70vh, 720px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  z-index: 0;
}

.pin {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
}

.pin--past {
  background: var(--brand-dim);
}

.pin--boeking {
  background: var(--ja);
}

.pin--optie {
  background: var(--optie);
}

.pin__distance {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
  text-shadow: 0 1px 2px var(--bg);
}

.leaflet-popup-content-wrapper {
  background: var(--surface-raised);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.leaflet-popup-tip {
  background: var(--surface-raised);
}

.leaflet-popup-content {
  margin: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.popup__title {
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: 2px;
}

.popup__meta {
  color: var(--ink-muted);
}

/* == 9. tables (admin) ===================================================== */

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.data-table th,
.data-table td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.data-table th.is-center,
.data-table td.is-center {
  text-align: center;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-hover) 50%, transparent);
}

.data-table input[type='checkbox'] {
  accent-color: var(--brand);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pill--ok {
  background: var(--ja-wash);
  color: var(--ja);
}

.pill--pending {
  background: var(--optie-wash);
  color: var(--optie);
}

.pill--off {
  background: var(--nee-wash);
  color: var(--nee);
}

/* == 10. feedback ========================================================== */

.toast-host {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 15rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  pointer-events: auto;
  animation: toast-in var(--normal) var(--ease);
}

.toast--success {
  border-left-color: var(--ja);
}

.toast--error {
  border-left-color: var(--nee);
}

.toast.is-leaving {
  animation: toast-out var(--fast) var(--ease) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}

.empty {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--ink-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.empty__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-hover) 37%,
    var(--surface) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

/* Centred single-purpose screens: sign in, choose a password. */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
}

.auth__card {
  width: 100%;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

.auth__brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--space-1);
}

.auth__brand span {
  color: var(--brand);
}

.auth__tagline {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: var(--space-5);
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.alert--error {
  background: var(--nee-wash);
  color: var(--nee);
  border: 1px solid color-mix(in srgb, var(--nee) 30%, transparent);
}

.alert--info {
  background: var(--brand-wash);
  color: var(--brand-bright);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}

/* Small stat tiles on the profile page. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--space-3);
}

.stat {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--brand-bright);
}

.stat__label {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* == responsive ============================================================ */

@media (max-width: 1080px) {
  .grid-wrap {
    display: none;
  }

  .show-cards {
    display: flex;
  }

  .next-show__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 1120px) {
  .nav {
    flex-wrap: wrap;
    height: auto;
    padding: var(--space-3) var(--space-4);
    row-gap: var(--space-3);
  }

  .nav__counts {
    order: 2;
  }

  .nav .nav__toggle {
    display: inline-flex;
    order: 3;
  }

  .nav__links {
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height var(--normal) var(--ease), opacity var(--fast) var(--ease);
  }

  .nav__links.is-open {
    max-height: 22rem;
    opacity: 1;
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
  }

  .nav__link {
    padding: var(--space-3);
  }

  .page {
    padding: var(--space-5) var(--space-4) var(--space-6);
  }

  h1 {
    font-size: var(--text-2xl);
  }

  .next-show__grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .map-toolbar__spacer {
    margin-left: 0;
  }

  .toast-host {
    left: var(--space-4);
    right: var(--space-4);
  }
}

@media print {
  .nav,
  .toast-host,
  .button {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* == 11. dialog ============================================================ */

.dialog {
  max-width: 26rem;
  padding: var(--space-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.dialog__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.dialog__body {
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
}

.dialog__detail {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--nee-wash);
  color: var(--nee);
  font-size: var(--text-sm);
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.button--danger-solid {
  background: var(--nee);
  border-color: var(--nee);
  color: #fff;
}

.button--danger-solid:hover:not(:disabled) {
  background: color-mix(in srgb, var(--nee) 85%, #000);
}

/* The cross that drops a show off the planning. Quiet until you go near it. */
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--fast) var(--ease), background var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

tr:hover .icon-button,
.show-card:hover .icon-button,
.icon-button:focus-visible {
  opacity: 1;
}

.icon-button:hover {
  background: var(--nee-wash);
  color: var(--nee);
}

/* Touch devices have no hover, so the control has to be visible from the off. */
@media (hover: none) {
  .icon-button {
    opacity: 1;
  }
}

/* == 12. overview ========================================================== */

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-5);
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
}

.hero__label {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero__location {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.1;
  text-transform: uppercase;
}

.hero__when {
  margin: var(--space-2) 0 var(--space-4);
  font-size: var(--text-lg);
  color: var(--ink-muted);
}

.hero__facts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fact__key {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.fact__value {
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.fact__value--muted {
  color: var(--ink-muted);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
}

.status-line::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-line[data-status='ok'] {
  background: var(--ja-wash);
  color: var(--ja);
}

.status-line[data-status='warn'] {
  background: var(--optie-wash);
  color: var(--optie);
}

.status-line[data-status='danger'] {
  background: var(--nee-wash);
  color: var(--nee);
}

.status-line[data-status='none'] {
  background: var(--brand-wash);
  color: var(--brand-bright);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-4);
}

.summary-card {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.summary-card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.summary-card__total {
  margin: var(--space-2) 0 var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1;
  color: var(--brand-bright);
}

.summary-card__unit {
  font-size: var(--text-sm);
  color: var(--ink-faint);
}

.breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.breakdown__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.breakdown__key {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
}

.breakdown__key::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--open);
}

.breakdown__row[data-kind='boeking'] .breakdown__key::before {
  background: var(--ja);
}

.breakdown__row[data-kind='optie'] .breakdown__key::before {
  background: var(--optie);
}

.breakdown__row[data-kind='done'] .breakdown__key::before {
  background: var(--brand-dim);
}

.breakdown__value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* == 13. charts ============================================================ */

.viz {
  margin: var(--space-4) 0 0;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.viz__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-3);
}

.viz__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.viz__legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  /* Text stays in ink, never the series colour; the swatch carries identity. */
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.viz__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.viz__plot {
  position: relative;
  /* Text inside an SVG shrinks with the SVG. Below this width the month
     labels stop being readable, so the chart scrolls sideways instead of
     scaling itself into illegibility. */
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

/* Scales on its own aspect ratio - a fixed height plus a stretched viewBox
   would squash the labels sideways. */
.viz__plot svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}

/* Recessive axes: present, never competing with the data. */
.viz__grid {
  stroke: var(--line);
  stroke-width: 1;
}

.viz__axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.viz__tick,
.viz__month {
  fill: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 12px;
}

.viz__tick {
  text-anchor: end;
}

.viz__bar {
  transition: opacity var(--fast) var(--ease);
}

.viz__hit {
  cursor: pointer;
  outline: none;
}

.viz__hit:hover + .viz__bar,
.viz__plot:has(.viz__hit:hover) .viz__bar {
  opacity: 0.75;
}

.viz__hit:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: -2px;
}

.viz__tooltip {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  min-width: 8rem;
  transform: translate(-50%, calc(-100% - 8px));
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: var(--text-xs);
  color: var(--ink);
  pointer-events: none;
  white-space: nowrap;
}

.viz__tooltip-detail {
  color: var(--ink-faint);
}

.viz__table {
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

.viz__table summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.viz__table summary:hover {
  color: var(--ink);
}

/* Colour is not the only channel, but in forced-colors it is gone entirely -
   the table view below the chart is the fallback there. */
@media (forced-colors: active) {
  .viz__bar {
    forced-color-adjust: none;
  }
}

/* A heading inside a breakdown block, for the personal numbers. */
.breakdown__heading {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Personal rows have no category colour, so they drop the dot. */
.breakdown__key--plain::before {
  display: none;
}

@media (max-width: 1120px) {
  .viz {
    padding: var(--space-4);
  }

  .viz__month {
    font-size: 10px;
  }
}

/* A breakdown value that is an instruction rather than a number. */
.breakdown__action {
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--brand-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* "First time here / forgot password?" - a quiet text button under the form. */
.auth__switch {
  background: none;
  border: none;
  padding: var(--space-1) 0;
  color: var(--ink-muted);
  font: inherit;
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth__switch:hover {
  color: var(--ink);
}

/* == 14. fixed crew and stand-ins ========================================= */

/* Stand-in columns read as secondary to the fixed crew. */
.grid th.th--stand-in {
  color: var(--ink-faint);
}

/* A stand-in who is not being asked about a show. */
.cell-idle {
  color: var(--ink-faint);
}

.assign {
  margin-top: 4px;
  min-height: 0;
}

.assign:empty {
  display: none;
}

.assign__tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.6;
}

.assign__tag--in {
  background: var(--ja-wash);
  color: var(--ja);
  border-color: color-mix(in srgb, var(--ja) 40%, transparent);
}

button.assign__tag--in {
  cursor: pointer;
}

button.assign__tag--in:hover {
  background: var(--nee-wash);
  color: var(--nee);
  border-color: color-mix(in srgb, var(--nee) 40%, transparent);
}

.assign__tag--pick {
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

.assign__tag--pick:hover {
  background: var(--brand-bright);
}

.assign__note {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--ja);
}

.crew-chip__role {
  font-size: 0.625rem;
  color: var(--ink-faint);
}

.crew-chip__role--in {
  color: var(--ja);
  font-weight: 600;
}

/* The same chip, but as the admin's way to take somebody off the show. It
   keeps the chip's look and gains a tap target big enough for a thumb. */
button.crew-chip__role {
  padding: 7px 8px;
  margin: -7px -8px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 0.625rem;
  font-weight: 600;
  cursor: pointer;
}

button.crew-chip__role--in:hover,
button.crew-chip__role--in:focus-visible {
  background: var(--nee-wash);
  color: var(--nee);
}

button.crew-chip__role:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 1px;
}

.open-places .row {
  margin-top: var(--space-2);
}

/* == 16. beheer: people ====================================================
   The users table says what it knows in words and tags; every change happens
   in the editor dialog, so the table needs no controls of its own.
   ========================================================================= */

.person {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.person__email {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  /* An address has nowhere to break, and on a narrow card it would otherwise
     run out the side. */
  overflow-wrap: anywhere;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* On: this applies. Quiet: it applies, but it is the unremarkable choice.
   Off: it does not apply - struck through, so it reads as off without colour
   being the only carrier. */
.tag--on {
  border-color: transparent;
  background: var(--brand-wash);
  color: var(--brand-bright);
}

.tag--quiet {
  color: var(--ink-muted);
}

.tag--off {
  border-style: dashed;
  color: var(--ink-faint);
  text-decoration: line-through;
}

/* --- the editor dialog --- */

.dialog--wide {
  max-width: 34rem;
  max-height: min(88vh, 48rem);
  overflow-y: auto;
}

.dialog__section {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.dialog__section:first-child {
  padding-top: 0;
  border-top: none;
}

.dialog__section-title {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* One control made of radio buttons, so the options read as exclusive. */
.segmented {
  display: flex;
  margin-top: var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented__option {
  flex: 1 1 0;
  position: relative;
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.segmented__option + .segmented__option {
  border-left: 1px solid var(--line-strong);
}

.segmented__option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segmented__option:hover {
  background: var(--surface-hover);
}

.segmented__option:has(input:checked) {
  background: var(--brand);
  color: #fff;
}

.segmented__option:has(input:focus-visible) {
  outline: 2px solid var(--brand-bright);
  outline-offset: -2px;
}

.segmented--disabled {
  opacity: 0.45;
}

.segmented--disabled .segmented__option {
  cursor: not-allowed;
}

/* Phones and small tablets: the people table is not a table any more. Five
   columns on a 375px screen meant sideways scrolling to find out who gets
   which mail, so each person becomes a card instead - same order, same tags,
   no scrolling. The markup stays a table, because on a laptop that is exactly
   what it should be. */
@media (max-width: 760px) {
  .data-table--people,
  .data-table--people tbody,
  .data-table--people tr,
  .data-table--people td {
    display: block;
  }

  .data-table--people thead {
    display: none;
  }

  .data-table--people tr {
    position: relative;
    margin-bottom: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .data-table--people tr:hover {
    background: var(--surface);
  }

  .data-table--people td {
    padding: 0;
    border-bottom: none;
  }

  .data-table--people td + td {
    margin-top: var(--space-3);
  }

  /* Room for the account pill, which sits in the top right corner. */
  .data-table--people .cell--who {
    padding-right: 7rem;
  }

  .data-table--people .cell--account {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    margin-top: 0;
    text-align: right;
  }

  /* Without the column heading, a row of tags needs to say what it is. */
  .data-table--people .cell--mail::before {
    content: 'Mail';
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  .data-table--people .cell--actions .row {
    justify-content: flex-start;
  }

  .data-table--people .cell--actions .button {
    flex: 1 1 auto;
  }
}

/* A table that turns into labelled cards on a narrow screen. The header row
   disappears, so each cell carries its own heading in data-label - which is
   why the label lives in the markup rather than here. Cells without one (an
   actions cell) simply have no heading.

   The people table does not use this: its cells are tags and buttons, not
   label/value pairs, so it has a layout of its own above. */
@media (max-width: 760px) {
  .data-table--stack,
  .data-table--stack tbody,
  .data-table--stack td {
    display: block;
  }

  .data-table--stack thead {
    display: none;
  }

  /* Two columns, so the four counters sit two by two instead of costing
     four lines each. Everything else spans the card. */
  .data-table--stack tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-4);
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .data-table--stack td {
    grid-column: 1 / -1;
  }

  .data-table--stack td.is-center {
    grid-column: auto;
  }

  .data-table--stack tr:hover {
    background: var(--surface);
  }

  .data-table--stack td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0.2rem 0;
    border-bottom: none;
    text-align: right;
  }

  .data-table--stack td.is-center {
    text-align: right;
  }

  .data-table--stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    text-align: left;
  }

  /* An actions cell has no label to sit opposite, so its button takes the
     width instead of hanging off the right edge. */
  .data-table--stack td:not([data-label]) {
    margin-top: var(--space-2);
  }

  .data-table--stack td:not([data-label]) .button {
    width: 100%;
  }

  /* Five counters at 8rem each fit two to a row, which strands the fifth.
     At 5rem three fit, so the sync result is two rows instead of three. */
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
    gap: var(--space-2);
  }

  .stat {
    padding: var(--space-3);
  }

  /* "Gearchiveerd" is wider than a third of a phone at the usual size, and a
     single word has nowhere to break. */
  .stat__label {
    font-size: 0.625rem;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
  }
}

/* What a show needs, shown on the row and on the card. A button when an admin
   may change it, a plain span otherwise - same look either way, because it is
   the same fact. */
.req-chip {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: none;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

button.req-chip {
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

button.req-chip:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

button.req-chip:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 1px;
}

/* "optie sinds ... - geboekt op ..." under a show on a card. Quiet: it is
   history, not something to act on. */
.show-card__history {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

/* "sinds 2025" next to a card's label: the period a number covers. Quiet, but
   present - a bare total reads as "this year" when it is not. */
.summary-card__scope {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}

/* The year tick boxes above the comparison chart. Each carries the colour its
   year has in the chart, so the legend and the control agree. */
.year-picker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  border: none;
  flex-wrap: wrap;
}

.year-picker__legend {
  padding: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.year-picker__year {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}

.year-picker__year input {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.year-picker__swatch {
  width: 10px;
  height: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

/* Three years is the cap: no fourth hue survives the colourblindness check. */
.year-picker__year--full {
  opacity: 0.45;
  cursor: not-allowed;
}

/* == 17. bekijk als ========================================================
   The bar an admin sees while looking at the site as somebody else. Loud on
   purpose, above everything, on every page: the only real risk of this feature
   is forgetting that you are not yourself.
   ========================================================================= */

.impersonation-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-5);
  background: var(--optie);
  color: #1a1a1a;
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
}

.impersonation-bar strong {
  font-weight: 800;
}

.impersonation-bar .button {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.impersonation-bar .button:hover:not(:disabled) {
  background: #000;
}

/* The nav is sticky too; with the bar present it sits under it. */
.has-impersonation-bar .nav {
  top: 0;
}

/* == 18. planning filter ===================================================
   Soort and jaar in one row beside the page title: one place to narrow the
   planning, rather than two controls in two corners.
   ========================================================================= */

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.filter-bar__group {
  display: flex;
  margin: 0;
  padding: 0;
  border: none;
}

.filter-bar__group .segmented__option {
  border: 1px solid var(--line-strong);
  border-right: none;
}

.filter-bar__group .segmented__option:first-of-type {
  border-radius: var(--radius) 0 0 var(--radius);
}

.filter-bar__group .segmented__option:last-of-type {
  border-right: 1px solid var(--line-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.filter-bar__legend {
  display: block;
  margin-bottom: var(--space-1);
  padding: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.filter-bar__year {
  display: block;
}

.filter-bar__year .input {
  padding: 0.45rem 0.6rem;
  font-size: var(--text-sm);
}

@media (max-width: 760px) {
  .filter-bar {
    width: 100%;
  }

  .filter-bar__group {
    flex: 1 1 auto;
  }
}

/* ---------------------------------------------------------------------------
   Tarieven: the day-rate calculator
   --------------------------------------------------------------------------- */

.panel__hint {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.knobs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-4);
}

.knobs__input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.knobs__input .input {
  width: 100%;
  min-width: 0;
}

.knobs__unit {
  font-size: var(--text-sm);
  color: var(--ink-faint);
}

.knobs__note {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-muted);
}

/* Tables here are wider than a phone; scrolling them beats shrinking the
   figures until nobody can read them. */
.table-wrap {
  overflow-x: auto;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.is-nowrap {
  white-space: nowrap;
}

.is-muted {
  color: var(--ink-muted);
}

.is-faint {
  opacity: 0.55;
}

/* Read from the crew's side of the table: green is more money than now, red
   is less. The sign is in the figure as well, so the colour is a hint and
   never the only thing saying it. */
.delta--plus {
  color: var(--ja);
}

.delta--minus {
  color: var(--nee);
}

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-5);
}

.rules__heading {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
}

.rules__list {
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--ink-muted);
}

.rules .knobs__note {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  /* In the stacked layout a cell is a flex row of label and value, so the
     second line has to be told to take a line of its own. */
  .data-table--stack td {
    flex-wrap: wrap;
  }

  .data-table--stack .cell-sub {
    flex: 1 0 100%;
    text-align: right;
  }

  .knobs {
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  }
}

/* The four money totals on Tarieven.
   .stat-grid on a phone is tuned for Beheer's five small counters (5rem
   columns, four to a row); a euro amount in the display face does not fit in
   80 pixels and spilled out of the card. Money gets wider cards and a
   smaller figure. */
.stat-grid--money .stat__detail {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}

@media (max-width: 760px) {
  .stat-grid--money {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .stat-grid--money .stat__value {
    font-size: var(--text-xl);
  }
}

@media (max-width: 360px) {
  .stat-grid--money .stat__value {
    font-size: var(--text-lg);
  }
}

/* ---------------------------------------------------------------------------
   End of the season: confetti and the sentence over it
   --------------------------------------------------------------------------- */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

.party {
  position: fixed;
  inset: 0;
  z-index: 71;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.party.is-open {
  opacity: 1;
}

.party__line {
  max-width: 24ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
  /* Over confetti and a blurred page, the text needs its own weight. */
  text-shadow: 0 2px 24px var(--bg), 0 1px 3px var(--bg);
  transform: translateY(10px) scale(0.98);
  transition: transform 220ms var(--ease);
}

.party.is-open .party__line {
  transform: none;
}

.party__hint {
  margin: var(--space-6) 0 0;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Somebody who asked for less motion gets the sentence without the fade,
   and confetti.js does not draw at all. */
@media (prefers-reduced-motion: reduce) {
  .party,
  .party__line {
    transition: none;
  }
}
