:root {
  color-scheme: light;
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2e2517;
  background: #f7f4ee;
  --border: #ddd5c4;
  --muted: #7a6e5f;
  --ink: #2e2517;
  --blue: #4d7c5a;
  --blue-dark: #3a6045;
  --green: #3d8a5f;
  --amber: #b7791f;
  --red: #c2413a;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f4ee;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  font-weight: 700;
}

h3 {
  font-size: 15px;
  margin: 18px 0 10px;
}

.eyebrow {
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.subtle,
.muted,
.empty {
  color: var(--muted);
}

.toolbar,
.button-row,
.tabs,
.ratio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

select,
input {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf7f2;
  color: var(--ink);
  padding: 0 10px;
}

button,
.button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

/* ── Brand / logo header ────────────────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  /* Subtiele verticale scheidingslijn tussen branding en filters */
  border-right: 1px solid var(--border);
  padding-right: 24px;
  margin-right: 4px;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  max-width: 280px;
}

.brand-logo {
  height: 44px;
  width: auto;
  flex-shrink: 0;
  display: block;
  background: transparent;
  border: none;
  box-shadow: none;
  object-fit: contain;
}

@media (max-width: 1050px) {
  .brand-logo {
    height: 44px;
  }
}

@media (max-width: 700px) {
  .brand-logo {
    height: 38px;
  }
}

/* ── Metrics grid ───────────────────────────────────────────────────────────── */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric,
.quality-stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(46,37,23,0.05);
}

.metric span,
.quality-stat span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong,
.quality-stat strong {
  font-size: 25px;
  font-weight: 800;
}

/* ── Klikbare KPI-kaarten ───────────────────────────────────────────────────── */

.metric-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
}

.metric-clickable:hover {
  background: #eef6f0;
  border-color: #a8c8b5;
  box-shadow: 0 3px 10px rgba(61, 138, 95, 0.13);
}

.metric-clickable:active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(77, 124, 90, 0.2);
}

/* ── Score-toggle knop ──────────────────────────────────────────────────────── */

.score-toggle-btn {
  width: 100%;
  margin-top: 14px;
  background: #f0f5f2;
  border: 1px solid #c4d9cc;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
}

.score-toggle-btn:hover {
  background: #e3f0e8;
  border-color: var(--blue);
}

.score-details {
  margin-top: 4px;
}

/* ── Notices ────────────────────────────────────────────────────────────────── */

.notice {
  border-left: 4px solid var(--amber);
  background: #fff8e8;
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin: 12px 0;
}

.notice.error {
  border-left-color: var(--red);
  background: #fff0ef;
}

/* ── Pill-stijl navigatietabs ───────────────────────────────────────────────── */

.tabs {
  margin: 16px 0;
  background: #ede9e0;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
}

.tab {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 600;
}

.tab.active {
  color: white;
  background: var(--blue);
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(61,138,95,0.25);
}

.tab:not(.active):hover {
  background: rgba(46,37,23,0.06);
}

/* ── Layout primitives ──────────────────────────────────────────────────────── */

.split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  align-items: start;
}

.settings-grid,
.quality-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(46,37,23,0.06);
}

.panel.wide,
.panel.side {
  min-width: 0;
}

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

/* ── Schedule filters ───────────────────────────────────────────────────────── */

.schedule-filters {
  display: grid;
  grid-template-columns: 150px 150px minmax(220px, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.schedule-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.filter-search input {
  width: 100%;
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

.table-wrap.compact {
  max-height: 420px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
}

.compact-table {
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #f5f1e8;
  font-weight: 700;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: #f2ede6;
}

.selected-row {
  background: #e5ede8;
  box-shadow: inset 4px 0 0 var(--blue);
}

/* ── Read-only rijen: ingevuld in Shiftbase ─────────────────────────────────── */

.filled-row {
  background: #f9f7f3;
  color: var(--muted);
  font-style: italic;
}

.filled-row.filled,
.filled-row--filled {
  opacity: 0.82;
}

.filled-row.partiallyFilled,
.filled-row--partiallyFilled {
  background: #fffbf0;
  opacity: 0.92;
  font-style: normal;
}

.filled-label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-style: normal;
  color: var(--muted);
  font-size: 0.9em;
}

.filled-name {
  font-style: normal;
  color: var(--muted);
}

/* ── ScheduleView: brononderscheid (Shiftbase vs. planner) ──────────────────── */

/* Gedeelde pill-stijl voor bron-icoontjes (emoji-formaat) */
.source-pill {
  font-style: normal;
  font-size: 13px;
  padding: 1px 5px;
  min-height: 20px;
  line-height: 1;
}

/* ✏️ Planner-voorstel: subtiel groen */
.source-proposal {
  background: #e8f5ee;
  color: var(--green);
}

/* ◑ Deels ingevuld: amber */
.source-partial {
  background: #fff4df;
  color: var(--amber);
}

/* 🔒 Shiftbase bestaand: grijs/neutraal */
.source-shiftbase {
  background: #ede9e0;
  color: var(--muted);
}

/* Wrapper die icoontje + naam naast elkaar zet */
.row-source-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* Voorstelrij: lichte standaard achtergrond */
.proposal-row {
  background: #ffffff;
}

/* Gedeeltelijk ingevulde voorstelrij: subtiel amber-tint */
.partial-proposal {
  background: #fffdf7;
}

/* ── Rij-count in de kop van ScheduleView ───────────────────────────────────── */

.schedule-counts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink);
}

/* ── Weergave-modus selector ────────────────────────────────────────────────── */

.schedule-filters--view-mode {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: #f0f5f2;
  border: 1px solid #c4d9cc;
  border-radius: 8px;
}

.view-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
}

.view-mode-option input[type="radio"] {
  min-height: unset;
  height: 15px;
  width: 15px;
  padding: 0;
  accent-color: var(--blue);
}

/* ── Dekking-toggles boven de tabel ─────────────────────────────────────────── */

.schedule-filters--coverage {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #f5f1e8;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.filter-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.coverage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.coverage-toggle input[type="checkbox"] {
  min-height: unset;
  height: 15px;
  width: 15px;
  padding: 0;
  accent-color: var(--blue);
}

/* ── Badges / pills ─────────────────────────────────────────────────────────── */

.badge,
.pill,
.severity {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #ede9e0;
  color: #4a3f31;
}

.pill.danger {
  background: #fff0ef;
  color: var(--red);
}

.pill.muted-pill {
  background: #ede9e0;
  color: var(--muted);
}

.pill.staffing {
  background: #e5ede8;
  color: var(--green);
}

.badge.ochtend {
  background: #e8f5ee;
  color: var(--green);
}

.badge.avond {
  background: #fff4df;
  color: var(--amber);
}

.badge.nacht {
  background: #ecebff;
  color: #5746af;
}

.badge.dag,
.badge.middag {
  background: #e5ede8;
  color: var(--blue);
}

/* ── Text states ────────────────────────────────────────────────────────────── */

.open,
.warning-text,
.negative {
  color: var(--red);
  font-weight: 700;
}

/* Plus-/minuren saldokleuren */
.balance-high-plus  { color: #c0392b; font-weight: 700; }  /* > +24 u: rood */
.balance-plus       { color: #e67e22; font-weight: 700; }  /* +8..+24 u: oranje */
.balance-neutral    { color: #27ae60; font-weight: 700; }  /* -8..+8 u: groen */
.balance-light-minus { color: #2980b9; }                   /* -24..-8 u: lichtblauw */
.balance-deep-minus  { color: #1a252f; font-weight: 700; } /* < -24 u: donkerblauw */

.positive {
  color: var(--green);
  font-weight: 700;
}

/* ── Shift explanation panel ────────────────────────────────────────────────── */

.shift-title {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.hours-balance-chip {
  background: var(--surface-2, #f0f0f0);
  border-radius: 4px;
  color: var(--muted);
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
}

.explanation {
  line-height: 1.5;
  margin-bottom: 14px;
}

.score-list,
.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.score-list {
  display: grid;
  gap: 10px;
}

.score-list li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: start;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.score-list p {
  color: var(--muted);
  margin-top: 2px;
}

.points {
  font-variant-numeric: tabular-nums;
}

.candidate-panel {
  margin-top: 16px;
}

.candidate-list,
.risk-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.candidate,
.risk-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.candidate p,
.risk-list p {
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

.candidate.excluded {
  background: #f8f5ef;
  opacity: 0.78;
}

.candidate-score {
  font-weight: 800;
  color: var(--green);
}

.candidate-score.excluded {
  color: var(--red);
}

.warning-box {
  margin-top: 16px;
  border: 1px solid #f0c36a;
  background: #fff8e8;
  border-radius: 8px;
  padding: 12px;
}

.warning-box ul,
.request-box ul {
  margin: 8px 0 0 18px;
}

.request-box {
  margin: 14px 0;
  border: 1px solid #a8c8b5;
  background: #f0f6f2;
  border-radius: 8px;
  padding: 12px;
}

/* ── Lists & conflict items ─────────────────────────────────────────────────── */

.conflict-list,
.pattern-grid {
  display: grid;
  gap: 12px;
}

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

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

.pattern-item,
.request-item,
.conflict {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.pattern-item {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pattern-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pattern-card-header h3 {
  margin: 0 0 4px;
}

.pattern-card-header p {
  line-height: 1.45;
}

.pattern-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.agreement-count {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.pattern-section {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.pattern-section h4 {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  margin: 0;
}

.pattern-overview {
  margin-top: 0;
}

.pattern-subsection {
  display: grid;
  gap: 8px;
}

.section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.placeholder-section {
  gap: 4px;
}

.preferred-days-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
}

.preferred-day-option {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 5px;
}

.contract-override,
.day-off-add,
.days-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contract-override label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
}

.day-off-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.day-off-entry {
  align-items: center;
  background: #f8f5ef;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 34px;
  padding: 5px 8px;
}

.day-off-entry span {
  overflow-wrap: anywhere;
}

.contract-manual {
  color: var(--blue);
}

.contract-config {
  color: var(--green);
}

.contract-fallback,
.under-contract {
  color: var(--amber);
}

.over-contract {
  color: var(--red);
}

/* ── Verzoeken ──────────────────────────────────────────────────────────────── */

.request-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.request-item.prefer_shift,
.request-item.prefer_work {
  border-left: 4px solid var(--green);
}

.request-item.avoid_shift,
.request-item.prefer_day_off {
  border-left: 4px solid var(--amber);
}

.request-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.request-item p {
  line-height: 1.5;
  margin-bottom: 6px;
}

.request-item small {
  color: var(--muted);
}

.request-match {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.request-match.matched {
  color: var(--green);
}

/* ── Conflicten ─────────────────────────────────────────────────────────────── */

.conflict {
  display: grid;
  gap: 6px;
}

.conflict.error {
  border-left: 4px solid var(--red);
}

.conflict.warning {
  border-left: 4px solid var(--amber);
}

.conflict.info {
  border-left: 4px solid var(--blue);
}

/* ── Patroonkaart details list ──────────────────────────────────────────────── */

.pattern-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 12px 0 0;
}

.pattern-item dl div {
  display: grid;
  gap: 2px;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 0;
  font-weight: 650;
}

/* ── Compact rooster: status-labels en inline override ─────────────────────── */

.status-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status-ok     { color: var(--green); }
.status-warning { color: var(--amber); }
.status-danger  { color: var(--red); }
.status-partial { color: #c97a1a; }
.status-risk    { color: var(--amber); }
.status-open    { color: var(--muted); }

.inline-override {
  min-height: 28px;
  height: 28px;
  font-size: 13px;
  padding: 0 6px;
  width: 100%;
  max-width: 190px;
  border-radius: 6px;
}

/* ── Kwaliteitsrapport ──────────────────────────────────────────────────────── */

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 10px;
}

.ratio-row span,
.plain-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8f5ef;
}

.plain-list {
  display: grid;
  gap: 8px;
}

.block-text {
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Databronnen ────────────────────────────────────────────────────────────── */

.source-list {
  display: grid;
  gap: 10px;
}

.source-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #f8f5ef;
}

.source-item p {
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}

.source-item .source-meta {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.source-item.shiftbase {
  border-left: 4px solid var(--green);
}

.source-item.manual {
  border-left: 4px solid var(--blue);
}

.source-item.mock,
.source-item.planning-rules {
  border-left: 4px solid var(--amber);
}

.source-item.missing {
  border-left: 4px solid var(--red);
}

/* ── Kwaliteitsproblemen ────────────────────────────────────────────────────── */

.quality-issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.quality-issue {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.quality-issue p {
  color: var(--muted);
  margin-top: 4px;
}

.quality-issue.error {
  border-left: 4px solid var(--red);
}

.quality-issue.warning {
  border-left: 4px solid var(--amber);
}

.quality-issue.info {
  border-left: 4px solid var(--blue);
}

/* ── Instellingen secties ───────────────────────────────────────────────────── */

.settings-root {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-section-header {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 20px;
  margin-bottom: 14px;
}

.settings-section-header:first-child {
  border-top: none;
  margin-top: 0;
}

.settings-section-header h3 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.settings-section-content {
  margin-bottom: 4px;
}

/* ── Instellingen ───────────────────────────────────────────────────────────── */

.setup-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.setup-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #f8f5ef;
  display: grid;
  gap: 3px;
}

.setup-item span {
  color: var(--muted);
  font-size: 12px;
}

.setup-item strong {
  font-size: 14px;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 1050px) {
  .split-view,
  .settings-grid,
  .quality-layout {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .quality-grid,
  .pattern-grid,
  .request-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preference-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  /* Scheidingslijn vervalt zodra de filters onder de branding staan */
  .brand {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }

  .brand-subtitle {
    max-width: none;
  }

  .summary-grid,
  .quality-grid,
  .pattern-grid,
  .request-grid {
    grid-template-columns: 1fr;
  }

  .schedule-filters {
    grid-template-columns: 1fr;
  }

  .pattern-card-header {
    flex-direction: column;
  }

  .pattern-card-actions {
    justify-content: flex-start;
  }

  table {
    min-width: 760px;
  }
}

/* ── Team-groepen in Patronen-tab ───────────────────────────────────────────── */

.team-group {
  border-top: 1px solid var(--border);
}

.team-group:first-child {
  border-top: none;
}

.team-group-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 0;
  user-select: none;
}

.team-group .pattern-grid {
  padding-bottom: 20px;
  /* Binnen een teamgroep staan inklapbare kaarten: altijd één kolom zodat
     ingeklapte rijen netjes onder elkaar staan. */
  grid-template-columns: 1fr;
}

/* ── Inklapbare medewerkerkaarten in Patronen-tab ──────────────────────────── */

/* <details>-wrapper: neemt de border/radius over van het vroegere .pattern-item */
.pattern-item-details {
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Summary-rij: naam links, badges rechts */
.employee-summary {
  align-items: center;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 14px;
  user-select: none;
}

.employee-summary:hover {
  background-color: #f2ede6;
}

/* Als de kaart open is: alleen bovenste hoeken afronden */
.pattern-item-details[data-open] > .employee-summary {
  border-radius: 7px 7px 0 0;
}

/* Naam + driehoek-indicator */
.employee-summary-name {
  align-items: center;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
}

.employee-summary-name::before {
  color: var(--muted);
  content: "▶";
  display: inline-block;
  font-size: 9px;
  min-width: 10px;
}

.pattern-item-details[data-open] > .employee-summary .employee-summary-name::before {
  content: "▼";
}

/* Badges rechts van de summary-rij */
.employee-summary-meta {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

/* Team-badge naast de naam */
.employee-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  white-space: nowrap;
}

/* Notitie-indicator (✎) */
.note-indicator {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  white-space: nowrap;
}

/* De <article> binnen een open kaart: geen eigen border meer (die zit op de <details>) */
.pattern-item-details > .pattern-item {
  border: none;
  border-radius: 0 0 7px 7px;
  border-top: 1px solid var(--border);
}

/* ── Compacte samenvatting links in de summary-rij ─────────────────────────── */
.employee-summary-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.employee-summary-line {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Compacte veld-rijen in de kaart ──────────────────────────────────────── */
.compact-field-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.compact-field-row--align-top {
  align-items: flex-start;
}

.compact-label {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  min-width: 100px;
}

.compact-field-group {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.compact-field-group--wrap {
  flex-wrap: wrap;
}

/* ── Chips ────────────────────────────────────────────────────────────────── */
.chips-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rule-chip {
  align-items: center;
  background: #f0ece5;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  gap: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.rule-chip--pos {
  background: #e6f4ea;
  border-color: #aad4b0;
  color: #2a6b32;
}

.rule-chip--neg {
  background: #fff3e0;
  border-color: #f0b672;
  color: #7a4800;
}

.rule-chip--block {
  background: #fdecea;
  border-color: #f0a09a;
  color: #8b1a14;
}

.chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  opacity: 0.6;
  padding: 0 0 0 2px;
}

.chip-remove:hover {
  opacity: 1;
}

/* ── Dienstrijen (voorkeur / vermijden / blokkeren) ───────────────────────── */
.dienst-row {
  align-items: flex-start;
  display: flex;
  gap: 8px;
}

.dienst-label {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  min-width: 72px;
  padding-top: 4px;
}

/* ── Checkboxes ───────────────────────────────────────────────────────────── */
.checkbox-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.checkbox-label {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 5px;
}

/* ── Notitie-textarea ─────────────────────────────────────────────────────── */
.notes-textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  resize: vertical;
  width: 100%;
}

/* ── Loginpagina ─────────────────────────────────────────────────────────── */
.login-page {
  align-items: center;
  background: var(--bg, #faf7f2);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: #fff;
  border: 1px solid var(--border, #e8e0d4);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  max-width: 400px;
  padding: 40px 36px 36px;
  width: 100%;
}

.login-logo {
  margin-bottom: 20px;
  min-height: 40px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}

.login-subtitle {
  color: var(--muted, #8a7d6b);
  font-size: 13px;
  margin: 0 0 24px;
}

.login-error {
  background: #fdecea;
  border: 1px solid #f0a09a;
  border-radius: 6px;
  color: #8b1a14;
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 700;
  gap: 5px;
}

.login-input {
  border: 1px solid var(--border, #e8e0d4);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  width: 100%;
}

.login-input:focus {
  border-color: var(--accent, #c87941);
  outline: none;
}

.login-button {
  margin-top: 4px;
  width: 100%;
}

/* Gebruikersmenu rechtsboven in de toolbar */
.user-menu {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
}

.user-name {
  color: var(--muted, #8a7d6b);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.user-role {
  color: var(--muted, #8a7d6b);
  font-size: 11px;
  opacity: 0.75;
  white-space: nowrap;
}

.readonly-notice {
  background: #fff8e1;
  border: 1px solid #f0d070;
  border-radius: 6px;
  color: #6b5700;
  font-size: 13px;
  margin-bottom: 8px;
  padding: 8px 14px;
}
.admin-add-form {
  background: var(--surface-alt, #f0ebe2);
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.admin-form-row input,
.admin-form-row select {
  flex: 1 1 160px;
  min-width: 120px;
}

.admin-inline-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.small-select {
  font-size: 0.85em;
  padding: 2px 6px;
}

.small-input {
  font-size: 0.85em;
  padding: 2px 6px;
  width: 160px;
}

button.small {
  font-size: 0.82em;
  padding: 3px 10px;
}

.pill.danger {
  background: #fee2e2;
  color: #b91c1c;
}
