:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #d9dee5;
  --text: #1f2933;
  --muted: #6b7280;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --warn: #ea580c;
  --warn-bg: #ffedd5;
  --cancel: #6b7280;
  --cancel-bg: #e5e7eb;
  --row-bg: #fbfcfe;
  --row-alt-bg: #f1f4f9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
}

a { color: var(--primary); }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  cursor: help;
}
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
}
.brand-info-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-info-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.brand-info-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(540px, 92vw);
  max-height: 85vh;
  background: var(--surface);
  color: var(--text);
}
.brand-info-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.brand-info-content { display: flex; flex-direction: column; max-height: 85vh; }
.brand-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--border);
}
.brand-info-logo {
  display: block;
  max-width: 100%;
  width: 280px;
  height: auto;
}
.brand-info-body {
  padding: 14px 20px 22px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.55;
}
.brand-info-body p { margin: 0 0 10px 0; }
.brand-info-body p:last-child { margin-bottom: 0; }
.logout {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.logout:hover { color: var(--text); }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 24px;
  flex: 1;
}
.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
.topbar-link:hover { color: var(--text); background: var(--bg); }
.topbar-link.active { color: var(--text); background: var(--bg); }
.nav-icon { flex: 0 0 auto; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.active-club {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.club-logo-sm {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}
.club-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.club-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.club-option:hover { background: var(--bg); }
.club-option input[type="radio"] { margin: 0; }
.club-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
}
.club-name { font-weight: 600; flex: 1; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Flash */
.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-message, .flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

/* Auth card */
.card {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 24px;
}
.auth-card {
  max-width: 420px;
  margin: 64px auto;
}
.auth-card h1 { margin: 0 0 4px 0; font-size: 22px; }
.auth-card p.muted { margin-top: 0; }
.auth-logo {
  display: block;
  width: 360px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 16px;
}

label {
  display: block;
  margin: 12px 0;
  font-size: 14px;
  color: var(--text);
}
input[type="email"],
input[type="password"],
input[type="text"],
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

button, .primary, .secondary {
  font-size: 15px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
button.primary, .primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
button.secondary:hover { background: var(--bg); }

/* Veldplanner */
.veldplanner { display: flex; flex-direction: column; gap: 16px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.toolbar-field { flex: 1 1 220px; min-width: 200px; margin: 0; }
.toolbar-field select { min-width: 200px; }
.status { margin-left: auto; font-size: 13px; }

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
}

.grid-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: 75vh;
  --hour-width: 270px;
  --label-width: 180px;
  --track-width: calc(var(--hour-width) * 14);
}

.time-axis,
.row {
  display: grid;
  grid-template-columns: var(--label-width) var(--track-width);
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}

.time-axis {
  border-bottom: 1px solid var(--border);
  background: var(--row-bg);
  height: 36px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.axis-label-cell {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  border-right: 1px solid var(--border);
  background: var(--row-bg);
  position: sticky;
  left: 0;
  z-index: 4;
}

.axis-track {
  position: relative;
}
.axis-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.axis-tick:first-child { background: transparent; }
.axis-tick-label {
  position: absolute;
  top: 8px;
  left: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.rows { display: flex; flex-direction: column; }

.row {
  min-height: 78px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.row:nth-child(even) { background: var(--row-alt-bg); }
.row:last-child { border-bottom: none; }

.row-label {
  padding: 12px;
  font-weight: 600;
  color: var(--text);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 2;
}
.row:nth-child(even) .row-label { background: var(--row-alt-bg); }

.row-track {
  position: relative;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--hour-width) - 1px),
    var(--border) calc(var(--hour-width) - 1px),
    var(--border) var(--hour-width)
  );
}

.match-block {
  position: absolute;
  top: 8px;
  bottom: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  overflow: hidden;
  background: var(--ok-bg);
  color: #064e3b;
  border-color: #86efac;
  min-width: 80px;
}
.match-block:hover { filter: brightness(0.96); }
.match-block.ok { background: var(--ok-bg); border-color: #86efac; color: #064e3b; }
.match-block.deviating { background: var(--warn-bg); border-color: #fdba74; color: #7c2d12; }
.match-block.cancelled { background: var(--cancel-bg); border-color: #d1d5db; color: var(--cancel); text-decoration: line-through; }

/* Overlap-indicatie: rode linkerrand + diagonale streep-overlay */
.match-block.overlap {
  border-left: 4px solid #dc2626;
  box-shadow: 0 0 0 1px #fecaca inset;
}
.match-block.overlap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 8px,
    rgba(220, 38, 38, 0.08) 8px,
    rgba(220, 38, 38, 0.08) 10px
  );
  border-radius: inherit;
}
.overlap-icon {
  color: #dc2626;
  font-weight: 700;
  margin-left: 4px;
}

.block-half {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid currentColor;
  border-radius: 3px;
  vertical-align: middle;
  opacity: 0.7;
}
.row-label {
  gap: 8px;
}
.row-label-name { flex: 1; }
.overlap-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.row.has-overlap .row-label-name::after {
  content: "";
}

.block-time {
  font-weight: 700;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.block-teams {
  font-weight: 500;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.vs { color: var(--muted); font-weight: 400; }
.block-class {
  color: var(--muted);
  font-size: 11px;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compacte weergave voor halve velden — minder padding, geen class-label */
.match-block.size-compact {
  padding: 2px 8px;
  gap: 0;
  font-size: 12px;
  line-height: 1.25;
}
.match-block.size-compact .block-class { display: none; }

/* Kwart velden / nog smallere blokken — tijd + teams op 1 rij */
.match-block.size-tight {
  padding: 0 6px;
  gap: 6px;
  font-size: 11px;
  line-height: 1.15;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}
.match-block.size-tight .block-class { display: none; }
.match-block.size-tight .block-time {
  flex: 0 0 auto;
  width: auto;
}
.match-block.size-tight .block-teams {
  flex: 1 1 0;
  width: auto;
}

/* Match dialog */
.match-dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  min-width: 360px;
  max-width: 640px;
  width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.match-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }

.match-dialog-form {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.match-dialog-header {
  position: relative;
  padding: 20px 20px 16px 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}
.dialog-close:hover { color: var(--text); }

.match-dialog-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.team-home { text-align: center; }
.team-away { text-align: center; }
.team-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.team-logo.placeholder {
  background: var(--bg);
  border: 1px dashed var(--border);
}
.team-name {
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
  max-width: 180px;
}
.score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.score {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
}
.score-block .time {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.status-pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 8px;
}

.match-dialog-body {
  padding: 16px 20px 20px 20px;
  overflow-y: auto;
}

.dialog-section { margin-bottom: 16px; }
.dialog-section:last-child { margin-bottom: 0; }
.dialog-section h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.dialog-section dl {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
  font-size: 14px;
}
.dialog-section dt {
  color: var(--muted);
  font-weight: 500;
}
.dialog-section dd {
  margin: 0;
  word-break: break-word;
}
.dialog-ids { padding-top: 8px; border-top: 1px solid var(--border); }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.dialog-actions button { font-size: 14px; }

.edit-form .dialog-section { margin-bottom: 14px; }
.edit-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 4px 0;
}
.edit-form input,
.edit-form select,
.edit-form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.edit-form textarea { resize: vertical; min-height: 60px; }
.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 12px;
}
.score-grid { grid-template-columns: 1fr 1fr; max-width: 240px; }

.dialog-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 6px;
  font-size: 13px;
}

.cr-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  font-size: 13px;
  color: #7c2d12;
}
.cr-banner strong { font-size: 13px; }
.cr-restriction { font-style: italic; }

.required { color: #dc2626; }

.officials-section .official-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 12px;
  align-items: center;
  margin: 6px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.officials-section .official-row.read-only .official-value {
  padding: 6px 0;
  color: var(--text);
}
.officials-section .official-row select {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.officials-section .official-type {
  color: var(--muted);
  font-size: 13px;
}
.officials-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 10px;
}
.officials-actions button { font-size: 13px; }
.officials-actions .small { font-size: 12px; }

.officials-section .official-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.officials-section .official-controls select { width: 100%; }
.officials-section .toggle-search-btn {
  align-self: flex-start;
  font-size: 12px;
  color: var(--primary);
}
.officials-section .official-row.picked {
  align-items: center;
}
.officials-section .picked-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--ok-bg);
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}
.officials-section .picked-person .remove-picked-btn {
  margin-left: auto;
  font-size: 12px;
  color: #b91c1c;
}
.officials-section .referee-search {
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--row-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.referee-search-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.referee-search-controls .referee-search-input {
  flex: 1;
  min-width: 180px;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.referee-search-controls .referee-search-dob {
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.referee-search-hint { margin: 6px 0 0 0; }
.referee-search-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.referee-search-results {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.referee-search-hit {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.referee-search-hit:hover { border-color: var(--primary); background: var(--row-alt-bg); }

/* Scheidsrechters-drawer */
.officials-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 14px rgba(15, 23, 42, 0.08);
  transform: translateX(100%);
  transition: transform 220ms ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.officials-drawer.open { transform: translateX(0); }
.officials-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.officials-drawer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.officials-drawer-body {
  padding: 12px 16px 24px;
  overflow-y: auto;
  flex: 1;
}
.off-group { margin-bottom: 18px; }
.off-group-head h4 {
  margin: 0 0 2px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.off-count {
  background: var(--row-alt-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
}
.off-group-head p { margin: 0 0 8px 0; }
.off-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.off-card:hover { background: var(--row-bg); }
.off-card-knvb { border-left-color: var(--primary); }
.off-card-club { border-left-color: var(--ok); }
.off-card-none { border-left-color: var(--warn); }
.off-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.off-time { font-weight: 600; }
.off-field { font-size: 12px; }
.off-teams {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
}
.off-class { margin-top: 1px; }
.off-officials { margin-top: 6px; font-size: 13px; }
.off-line { display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.off-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}
.off-tag.knvb { background: #dbeafe; color: #1d4ed8; }
.off-tag.club { background: var(--ok-bg); color: #166534; }

.off-contacts {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.off-contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.off-contact-name { font-weight: 500; }
.off-contact-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.off-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--row-alt-bg);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}
.off-contact-link:hover { background: #dbeafe; color: var(--primary-dark); }
.off-contact-link svg { flex: 0 0 auto; }
.off-contact-link.off-contact-wa {
  background: #dcfce7;
  color: #166534;
}
.off-contact-link.off-contact-wa:hover {
  background: #25d366;
  color: #ffffff;
}

.dialog-warning {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #7c2d12;
  border-radius: 6px;
  font-size: 13px;
}
.dialog-warning strong { display: block; margin-bottom: 6px; }
.warning-list {
  margin: 0 0 10px 0;
  padding-left: 20px;
}
.warning-list li { margin-bottom: 4px; }
.warning-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.warning-actions button { font-size: 13px; padding: 6px 12px; }

/* Change-requests page */
.cr-page { display: flex; flex-direction: column; gap: 16px; }
.cr-title { margin: 0; font-size: 20px; flex: 1; }
.cr-toolbar { align-items: center; }
.cr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.cr-toggle input { width: auto; margin: 0; }

.cr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.cr-filter { display: flex; flex-direction: column; gap: 4px; font-size: 12px; margin: 0; min-width: 0; }
.cr-filter span { color: var(--muted); font-weight: 500; }
.cr-filter select,
.cr-filter input[type="search"] {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  min-width: 160px;
}
.cr-filter-check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  align-self: end;
  padding-bottom: 7px;
}
.cr-filter-check input { width: auto; margin: 0; }
.cr-filter-search { flex: 1 1 240px; }
.cr-filter-search input { width: 100%; min-width: 200px; }

.cr-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 12px;
}
.cr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cr-teams {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  flex-wrap: wrap;
}
.cr-team-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}
.cr-status-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.cr-status-pill.cr-ok { background: var(--ok-bg); border-color: #86efac; color: #064e3b; }
.cr-status-pill.cr-bad { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.cr-status-pill.cr-warn { background: var(--warn-bg); border-color: #fdba74; color: #7c2d12; }
.cr-status-pill.cr-muted { background: var(--cancel-bg); border-color: #d1d5db; color: var(--muted); }
.cr-status-pill.cr-neutral { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

.cr-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.cr-direction {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg);
}
.cr-direction.cr-dir-in { color: #1e3a8a; }
.cr-direction.cr-dir-out { color: #064e3b; }
.cr-action-badge {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cr-changes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
}
.cr-change {
  display: grid;
  grid-template-columns: 100px 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.cr-change-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
}
.cr-change-from { color: var(--muted); text-decoration: line-through; }
.cr-change-to { font-weight: 600; }
.cr-change-arrow { color: var(--muted); }

.cr-no-changes {
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
}

.cr-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cr-substatus {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.cr-substatus.cr-ok { background: var(--ok-bg); border-color: #86efac; color: #064e3b; }
.cr-substatus.cr-bad { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.cr-substatus.cr-warn { background: var(--warn-bg); border-color: #fdba74; color: #7c2d12; }
.cr-substatus.cr-muted { background: var(--cancel-bg); border-color: #d1d5db; color: var(--muted); }
.cr-substatus.cr-neutral { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

.cr-remarks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cr-remark {
  font-size: 13px;
  padding: 6px 10px;
  background: var(--bg);
  border-left: 3px solid var(--border);
  border-radius: 4px;
}
.cr-remark-who {
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 6px;
}

.cr-card-footer {
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.cr-raw {
  font-size: 11px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
  max-height: 70vh;
}

@media (max-width: 600px) {
  .match-dialog { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .match-dialog-form { max-height: 100vh; }
  .match-dialog-teams { grid-template-columns: 1fr; gap: 12px; }
  .team-name { max-width: none; }
}

/* Responsive: stack rows op mobiel */
@media (max-width: 720px) {
  .container { padding: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-field { width: 100%; }
  .status { margin-left: 0; }

  .time-axis { display: none; }
  .row {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 12px;
  }
  .row-label {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 8px 0;
    margin-bottom: 8px;
  }
  .row-track {
    position: static;
    background: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .match-block {
    position: static;
    width: 100% !important;
    left: auto !important;
    top: auto;
    bottom: auto;
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Teams-pagina */
.teams-page { display: flex; flex-direction: column; gap: 16px; }
.teams-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.teams-toolbar input[type="search"] {
  flex: 1;
  min-width: 240px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.teams-toolbar button { font-size: 13px; }
#teams-search-mode .mode-label { font-weight: 600; }
#teams-search-mode[data-mode="player"] { background: #dbeafe; color: var(--primary-dark); border-color: #bfdbfe; }

.teams-filters {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip {
  font: inherit;
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: var(--row-bg); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.teams-list { display: flex; flex-direction: column; gap: 18px; }
.team-group-title {
  margin: 0 0 8px 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.team-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.team-card:hover { border-color: var(--primary); }
.team-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.team-name { font-weight: 600; font-size: 14px; }
.team-code { font-size: 12px; }
.team-card-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12px;
  align-items: center;
}
.team-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--row-alt-bg);
  color: var(--muted);
}
.team-tag.tag-jeugd { background: #ffedd5; color: #9a3412; }
.team-tag.tag-senioren { background: #dcfce7; color: #166534; }
.team-tag.tag-gender { background: #e0e7ff; color: #3730a3; }
.team-meta { color: var(--muted); font-size: 12px; }

/* Team-dialog */
.team-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(960px, 95vw);
  max-height: 90vh;
  background: var(--surface);
  color: var(--text);
}
.team-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.team-dialog-form { display: flex; flex-direction: column; max-height: 90vh; }
.team-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.team-dialog-header h3 { margin: 0; font-size: 17px; }
.team-dialog-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
}

.players-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.players-header h4 { margin: 0; }
.button-link {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.button-link:hover { background: var(--primary-dark); }

.players-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.players-table th,
.players-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.players-table th {
  font-weight: 600;
  color: var(--muted);
  background: var(--row-bg);
  position: sticky;
  top: 0;
}
.players-table td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.comp-list, .staff-list, .player-hits {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comp-list li, .staff-list li, .player-hit {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.comp-list li:last-child, .staff-list li:last-child, .player-hit:last-child {
  border-bottom: none;
}
.player-hit {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.link-button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 0;
}
.link-button:hover { text-decoration: underline; }

/* Datum-input (flatpickr) */
#date-input,
.flatpickr-alt-input,
.flatpickr-mobile {
  display: inline-block;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  min-width: 160px;
  font-family: inherit;
}
.flatpickr-alt-input { cursor: pointer; }
.flatpickr-day.has-match:not(.flatpickr-disabled) {
  color: var(--primary-dark);
  font-weight: 600;
  position: relative;
}
.flatpickr-day.has-match:not(.flatpickr-disabled)::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.flatpickr-day.has-match.selected,
.flatpickr-day.has-match.selected:hover {
  color: #fff;
}
.flatpickr-day.has-match.selected::after { background: #fff; }
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: var(--border);
  background: transparent;
}