:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #1f4f8f;
  --primary-dark: #173a69;
  --danger: #b91c1c;
  --warning: #b45309;
  --success: #047857;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 285px;
  background: #0f172a;
  color: white;
  padding: 26px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #60a5fa, #1d4ed8);
  font-weight: 800;
}
.brand span { display: block; color: #aeb7c7; font-size: 13px; margin-top: 3px; }
nav { display: flex; flex-direction: column; gap: 6px; }
nav a {
  color: #dbeafe;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
}
nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }

.content { flex: 1; padding: 34px; max-width: 1500px; }
.topbar { margin-bottom: 22px; }
h1 { margin: 0 0 6px 0; font-size: 34px; letter-spacing: -0.04em; }
h2 { margin: 0 0 18px 0; font-size: 20px; letter-spacing: -0.02em; }
.subtitle, .hint { color: var(--muted); }
.subtitle { margin: 0; }

.cards, .grid { display: grid; gap: 18px; margin-bottom: 18px; }
.cards.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.metric span { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.metric strong { display: block; margin-top: 10px; font-size: 30px; line-height: 1.05; }
.info { background: linear-gradient(180deg, #ffffff, #f8fafc); }
.action-card p { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.form-grid .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 7px; color: #374151; font-weight: 700; font-size: 14px; }
input, select, textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 12px;
  padding: 11px 12px; font: inherit; background: white; color: var(--text);
}
textarea { resize: vertical; }
.checkbox { flex-direction: row; align-items: center; font-weight: 600; }
.checkbox input { width: auto; }
.rule-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 16px;
}
.rule-box ol { margin-bottom: 0; }

.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button-row.spacious { margin: 10px 0 18px; }
.button, button.button {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.primary { background: var(--primary); color: white; border-color: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.success { background: #16a34a; color: white; border-color: #16a34a; }
.button.ghost { background: transparent; color: #475569; }
.inline-form { margin-top: 0; display: flex; gap: 8px; align-items: center; }
.inline-form input { max-width: 90px; padding: 7px 9px; }
.link-button {
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.link-button.danger { color: var(--danger); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: #f8fafc; }
tr:hover td { background: #fafafa; }
.muted-row { opacity: .55; }
.actions { display: flex; gap: 12px; white-space: nowrap; align-items: center; }
.actions form { display: inline; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e5e7eb;
  color: #374151;
}
.badge.hard { background: #fee2e2; color: #991b1b; }
.badge.soft { background: #fef3c7; color: #92400e; }
.badge.ok { background: #d1fae5; color: #065f46; }

.flash-wrap { margin-bottom: 18px; display: grid; gap: 10px; }
.flash { padding: 13px 16px; border-radius: 14px; font-weight: 700; }
.flash.success { background: #d1fae5; color: #065f46; }
.flash.error { background: #fee2e2; color: #991b1b; }

.checklist { padding-left: 18px; line-height: 1.7; }
.details { margin: 0; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

@media (max-width: 1000px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 22px; }
  .cards.four, .cards.three, .grid.two { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Version 1.1: Monatsplan je Versorgung */
.monthly-stack { display: grid; gap: 20px; }
.month-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.month-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border-bottom: 1px solid var(--line);
}
.month-card h3 { margin: 0 0 4px 0; font-size: 18px; }
.month-card p { margin: 0; color: var(--muted); font-size: 13px; }
.month-table th:first-child, .month-table td:first-child { min-width: 130px; width: 130px; }
.month-table th:nth-child(2), .month-table th:nth-child(3) { min-width: 280px; }
.weekend-row td:first-child { background: #f8fafc; }
.plan-cell {
  white-space: pre-wrap;
  font-weight: 700;
  line-height: 1.45;
  border-left: 4px solid transparent;
}
.plan-cell.complete { background: #ecfdf5; border-left-color: #10b981; color: #065f46; }
.plan-cell.partial { background: #fffbeb; border-left-color: #f59e0b; color: #92400e; }
.plan-cell.missing { background: #fef2f2; border-left-color: #ef4444; color: #991b1b; }
.plan-cell.empty { color: var(--muted); }
@media (max-width: 1000px) {
  .month-card-head { flex-direction: column; }
}

/* Version 1.4: Mitarbeiter-Monatsplan im Stil einer klassischen Dienstplanliste */
.roster-card { overflow: hidden; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 9px; font-size: 12px; background: #fff; color: #374151;
}
.legend-item strong { min-width: 22px; text-align: center; }
.legend-item.tag strong, .cell-service.tag { background: #fed7aa; color: #7c2d12; }
.legend-item.nacht strong, .cell-service.nacht { background: #bfdbfe; color: #1e3a8a; }
.legend-item.urlaub strong, .cell-service.urlaub { background: #fef08a; color: #713f12; }
.legend-item.krank strong, .cell-service.krank { background: #fecaca; color: #7f1d1d; }
.legend-item.frei strong, .cell-service.frei { background: #e5e7eb; color: #374151; }
.legend-item.fortbildung strong, .cell-service.fortbildung { background: #ddd6fe; color: #4c1d95; }
.legend-item.wunschfrei strong, .cell-service.wunschfrei { background: #f5d0fe; color: #701a75; }
.legend-item.special strong { background: #fecdd3; color: #881337; }
.legend-item strong { border-radius: 999px; padding: 2px 6px; }

.roster-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.roster-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; }
.roster-table th, .roster-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 5px; vertical-align: middle; }
.roster-table thead th { position: sticky; top: 0; z-index: 6; text-align: center; background: #f8fafc; }
.roster-table thead tr:nth-child(2) th { top: 30px; }
.roster-table .sticky-col { position: sticky; z-index: 5; background: #fff; }
.roster-table thead .sticky-col { z-index: 8; background: #f8fafc; }
.employee-head, .employee-cell { left: 0; min-width: 190px; max-width: 190px; }
.sticky-2 { left: 190px; min-width: 92px; max-width: 92px; }
.sticky-3 { left: 282px; min-width: 88px; max-width: 88px; }
.sticky-4 { left: 370px; min-width: 72px; max-width: 72px; }
.sticky-5 { left: 442px; min-width: 96px; max-width: 96px; }
.sticky-6 { left: 538px; min-width: 96px; max-width: 96px; }
.roster-table .day-head, .roster-table .day-num { min-width: 48px; max-width: 48px; }
.roster-table .day-num { font-size: 14px; font-weight: 900; }
.roster-table .special-day { background: #ffe4e6 !important; color: #9f1239; }
.roster-cell { min-width: 48px; max-width: 48px; height: 50px; text-align: center; background: #fff; }
.roster-cell.special-col { background: #fff1f2; }
.roster-cell.tag { background: #ffedd5; }
.roster-cell.nacht { background: #dbeafe; }
.roster-cell.urlaub { background: #fef9c3; }
.roster-cell.krank { background: #fee2e2; }
.roster-cell.frei { background: #f3f4f6; }
.roster-cell.fortbildung { background: #ede9fe; }
.roster-cell.wunschfrei { background: #fae8ff; }
.summary-cell { text-align: center; font-size: 12px; }
.cell-service {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 8px; min-height: 34px; padding: 3px 2px; line-height: 1.05;
}
.cell-service + .cell-service { margin-top: 2px; }
.cell-service strong { font-size: 13px; }
.cell-service small { font-size: 9px; margin-top: 2px; max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-mark { color: #cbd5e1; }
.coverage-row th, .coverage-row td { background: #f8fafc; font-weight: 800; }
.coverage-cell { text-align: center; }
.coverage-cell.ok { background: #bbf7d0; color: #14532d; }
.coverage-cell.missing { background: #fecaca; color: #7f1d1d; }
.coverage-cell.empty { background: #f8fafc; color: #94a3b8; }
.coverage-cell.special-col { box-shadow: inset 0 0 0 999px rgba(244, 63, 94, .08); }

@media (max-width: 900px) {
  .employee-head, .employee-cell { min-width: 155px; max-width: 155px; }
  .sticky-2 { left: 155px; }
  .sticky-3 { left: 247px; }
  .sticky-4 { left: 335px; }
  .sticky-5 { left: 407px; }
  .sticky-6 { left: 503px; }
}

/* V1.5: Patienten-/WG-Monatsplan und Einzeldienstplaene */
.patient-head{min-width:220px;left:0;z-index:5}.sticky-p2{left:220px;z-index:5;min-width:92px}.patient-roster .roster-cell.missing{background:#fee2e2;color:#991b1b;font-weight:800}.patient-roster .roster-cell.tag{background:#ffedd5}.patient-roster .roster-cell.nacht{background:#dbeafe}.patient-roster .roster-cell.empty{background:#fff;color:#94a3b8}.individual-stack{display:grid;grid-template-columns:1fr;gap:18px}.individual-card{border:1px solid #e5e7eb;border-radius:18px;padding:18px;background:#fff}.mini-roster{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%}.mini-roster th{background:#0f172a;color:white;padding:6px;min-width:64px;text-align:center;border:1px solid #e5e7eb}.mini-roster td{height:64px;min-width:64px}.small-scroll{max-height:none}.legend-item.missing{background:#fee2e2;color:#991b1b}.cell-service.missing strong{font-size:12px}.button.danger{background:#fee2e2;color:#991b1b;border-color:#fecaca}.form-grid .wide{grid-column:1/-1}

/* Version 1.6: Bildschirmfüllende Monatsübersichten ohne horizontales Scrollen */
.roster-fit {
  width: 100%;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.roster-table-fit,
.mini-roster-fit {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: clamp(9px, 0.72vw, 12px);
}
.roster-table-fit th,
.roster-table-fit td,
.mini-roster-fit th,
.mini-roster-fit td {
  padding: 3px 2px;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden;
  text-overflow: clip;
}
.roster-table-fit .sticky-col,
.mini-roster-fit .sticky-col {
  position: static !important;
  left: auto !important;
}
.roster-table-fit .employee-head,
.roster-table-fit .employee-cell { width: 13%; }
.roster-table-fit .sticky-2 { width: 7%; }
.roster-table-fit .sticky-3 { width: 6%; }
.roster-table-fit .sticky-4 { width: 5%; }
.roster-table-fit .sticky-5 { width: 6%; }
.roster-table-fit .sticky-6 { width: 7%; }
.roster-table-fit .patient-head { width: 15%; }
.roster-table-fit .sticky-p2 { width: 7%; }
.roster-table-fit .day-head,
.roster-table-fit .day-num,
.roster-table-fit .roster-cell,
.mini-roster-fit th,
.mini-roster-fit td {
  width: auto;
  min-width: 0 !important;
  max-width: none !important;
}
.roster-table-fit .day-num { font-size: clamp(9px, 0.78vw, 12px); }
.roster-table-fit .roster-cell { height: 38px; }
.roster-table-fit .cell-service {
  min-height: 24px;
  padding: 2px 1px;
  border-radius: 5px;
}
.roster-table-fit .cell-service strong { font-size: clamp(9px, 0.75vw, 12px); }
.roster-table-fit .cell-service small {
  display: block;
  max-width: 100%;
  font-size: clamp(7px, 0.55vw, 9px);
}
.roster-table-fit .hint { font-size: clamp(7px, 0.6vw, 10px); }
.patient-roster.roster-table-fit .roster-cell { height: 32px; }
.mini-roster-fit td { height: 46px; }
@media (max-width: 1200px) {
  .content { padding: 20px; }
  .roster-card { padding: 14px; }
  .roster-table-fit { font-size: 9px; }
  .roster-table-fit .employee-head,
  .roster-table-fit .employee-cell { width: 12%; }
  .roster-table-fit .sticky-2 { width: 6%; }
  .roster-table-fit .sticky-3 { width: 5%; }
  .roster-table-fit .sticky-4 { width: 4.5%; }
  .roster-table-fit .sticky-5 { width: 5%; }
  .roster-table-fit .sticky-6 { width: 6%; }
}

/* Version 1.7: T/N-Bilanz */
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.neutral { background: #e5e7eb; color: #374151; }

/* Version 1.9: Datensicherung */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.warning-box {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  border-radius: 14px;
  padding: 14px 16px;
  line-height: 1.45;
}
.muted-card { background: linear-gradient(180deg, #ffffff, #f8fafc); }
.number-list { margin: 0; padding-left: 20px; line-height: 1.7; }
code {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 5px;
  border-radius: 6px;
}

/* Version 1.13: Versorgungsgruppen-Monatsplan */
.target-group-stack { display: grid; gap: 18px; }
.target-group-card { overflow: hidden; }
.compact-head { padding: 12px 14px; }
.grouped-roster .group-employee-head,
.grouped-roster .group-employee-cell { width: 13%; }
.grouped-roster .group-col-services { width: 7%; }
.grouped-roster .group-col-hours { width: 6%; }
.grouped-roster .group-col-capacity { width: 5%; }
.grouped-roster .group-col-status { width: 6%; }
.grouped-roster .group-col-tn { width: 7%; }
.grouped-roster .roster-cell { height: 34px; }
.grouped-roster .cell-service small { font-size: clamp(7px, 0.55vw, 9px); }
.grouped-roster tr.missing-row td:first-child,
.grouped-roster tr.missing-row .summary-cell { background: #fef2f2; color: #991b1b; font-weight: 800; }
.roster-cell.missing { background: #fee2e2; color: #991b1b; font-weight: 800; }
.cell-service.missing { background: #fecaca; color: #991b1b; }
@media (max-width: 1200px) {
  .grouped-roster .group-employee-head,
  .grouped-roster .group-employee-cell { width: 12%; }
  .grouped-roster .group-col-services { width: 6%; }
  .grouped-roster .group-col-hours { width: 5%; }
  .grouped-roster .group-col-capacity { width: 4.5%; }
  .grouped-roster .group-col-status { width: 5%; }
  .grouped-roster .group-col-tn { width: 6%; }
}

/* Version 1.14: bessere Mitarbeiter-Stammdatenbearbeitung */
.number-wide {
  min-width: 110px;
  max-width: 180px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.employees-table th:nth-child(2),
.employees-table td:nth-child(2) { min-width: 150px; }
.employees-table th:nth-child(4),
.employees-table td:nth-child(4) { min-width: 150px; }
.employees-table th:nth-child(5),
.employees-table td:nth-child(5) { min-width: 120px; }
.employees-table th:nth-child(6),
.employees-table td:nth-child(6) { min-width: 95px; }
.employees-table th:nth-child(7),
.employees-table td:nth-child(7) { min-width: 95px; }
.employees-table th:nth-child(8),
.employees-table td:nth-child(8) { min-width: 145px; }
.notes-cell { max-width: 220px; white-space: normal; }
.employee-actions {
  min-width: 150px;
  gap: 10px;
  align-items: center;
}
.edit-card { max-width: 980px; }
.employee-edit-form input[type="number"] {
  width: 160px;
  max-width: 100%;
}
.checkbox-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  align-self: end;
}
.option-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.option-row.option-row-compact {
  grid-column: auto;
  align-self: end;
  min-height: 46px;
}
.option-row .checkbox {
  margin: 0;
  white-space: nowrap;
}
.option-row-hint {
  font-size: 12px;
  font-weight: 600;
}
.qualification-choice input {
  accent-color: var(--primary);
}

/* Version 1.15: Stammdaten zentral aus Mitarbeiter- und Patientensicht */
.wide-edit-card { max-width: none; }
.inline-section-title {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #334155;
  font-weight: 900;
  letter-spacing: .02em;
}
.detail-grid { align-items: start; }
.mini-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.compact-table-wrap table { font-size: 13px; }
.compact-table-wrap th,
.compact-table-wrap td { padding: 8px 7px; }
.small-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 800;
}
@media (max-width: 1050px) {
  .detail-grid.grid.two { grid-template-columns: 1fr; }
  .option-row, .option-row.option-row-compact, .checkbox-stack {
    grid-column: 1 / -1;
    align-items: flex-start;
  }
}

/* V1.19: Zieltyp Patient/Einsatzort bei Einarbeitungen klar trennen */
.training-target-form .is-disabled {
  opacity: 0.48;
}
.training-target-form select:disabled,
.training-target-form input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.grid-form.compact-form { display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(220px, .9fr) minmax(220px, 1fr) auto; gap: 12px; align-items: end; }
.grid-form.compact-form label { display: grid; gap: 6px; font-weight: 800; color: #334155; }
.grid-form.compact-form input, .grid-form.compact-form select { width: 100%; }
@media (max-width: 900px) { .grid-form.compact-form { grid-template-columns: 1fr; } }
.button.warning { background: #f59e0b; color: #111827; border-color: #f59e0b; }

/* V1.29: Vertretungsassistent nach Freigabe */
.warning-card{border-color:#fbbf24;background:#fffbeb}.replacement-list{display:grid;gap:12px}.replacement-row{display:grid;grid-template-columns:minmax(280px,1fr) minmax(220px,320px) auto;gap:12px;align-items:end;border:1px solid #fde68a;background:#fff7ed;border-radius:14px;padding:12px}.replacement-main{display:grid;gap:4px}.replacement-select{margin:0}.replacement-select select{width:100%}@media(max-width:900px){.replacement-row{grid-template-columns:1fr}.replacement-row .button{width:100%}}
.patient-roster .roster-cell.krank,.patient-roster .roster-cell.urlaub,.patient-roster .roster-cell.fortbildung,.patient-roster .roster-cell.frei,.patient-roster .roster-cell.wunschfrei{font-weight:800}.patient-roster .roster-cell.krank{background:#fee2e2;color:#7f1d1d}.patient-roster .roster-cell.urlaub{background:#fef9c3;color:#713f12}.patient-roster .roster-cell.fortbildung{background:#ede9fe;color:#4c1d95}.patient-roster .roster-cell.frei{background:#f3f4f6;color:#374151}.patient-roster .roster-cell.wunschfrei{background:#fae8ff;color:#701a75}

/* V1.30: Klickbare Planbearbeitung und bessere Ausfall-Transparenz */
.clickable-plan-cell {
  cursor: pointer;
  position: relative;
  outline: 1px solid rgba(31,79,143,.08);
}
.clickable-plan-cell:hover {
  box-shadow: inset 0 0 0 2px rgba(31,79,143,.55);
  filter: saturate(1.08);
}
.clickable-plan-cell::after {
  content: "✎";
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 9px;
  color: rgba(15, 23, 42, .55);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
}
.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .30);
  padding: 22px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.modal-close {
  border: none;
  background: #f1f5f9;
  color: #334155;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.replacement-row:hover { border-color: #f59e0b; box-shadow: 0 10px 25px rgba(180, 83, 9, .10); }

/* V2.22.3: sichtbare Rueckmeldung und ausdrueckliche Bestaetigung im Vertretungsassistenten */
.replacement-override-confirm,
.replacement-feedback { grid-column: 1 / -1; }
.replacement-override-confirm {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 800;
}
.replacement-override-confirm[hidden],
.replacement-feedback[hidden] { display: none !important; }
.replacement-override-confirm small {
  font-weight: 600;
  line-height: 1.3;
}
.replacement-feedback {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 750;
}
.replacement-feedback.success { border-color: #86efac; background: #f0fdf4; color: #166534; }
.replacement-feedback.warning { border-color: #facc15; background: #fefce8; color: #854d0e; }
.replacement-feedback.error { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.replacement-row.is-saving { opacity: .78; }
.replacement-row.is-saved { border-color: #22c55e; background: #f0fdf4; }

/* V1.32: Native hidden must always win for modal overlays.
   Without this, .modal-backdrop { display:flex; } can override the hidden attribute
   in some browser/CSS combinations and open the manual edit dialog immediately. */
.modal-backdrop[hidden] {
  display: none !important;
}

/* V1.33: Abwesenheiten in Versorgungsplaenen und gefilterte Mitarbeiterauswahl */
.absence-mini-list{display:block;margin-top:2px;line-height:1.05}.absence-mini-list .cell-service{margin-top:2px}.js-employee-select-filtered option[disabled]{color:#94a3b8}.roster-cell.empty.clickable-plan-cell{background:#eef6ff}.roster-cell.empty.clickable-plan-cell .empty-mark{color:#1f4f8f;font-weight:800}
/* V1.35: Kapazitaetshinweise direkt in Versorgungsplaenen */
.capacity-summary .badge{display:inline-block;white-space:nowrap;font-size:10px;padding:3px 5px;border-radius:8px;}
.capacity-summary .hint{font-size:9px;white-space:nowrap;}
.grouped-roster .capacity-summary{min-width:70px;}

.sidebar-user {
  margin-top: 1rem;
  padding: .8rem;
  border-top: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.82);
  font-size: .85rem;
  line-height: 1.35;
}
.sidebar-user .hint { color: rgba(255,255,255,.65); }
.login-card { max-width: 540px; }
.audit-details { white-space: pre-wrap; word-break: break-word; font-size: .78rem; }
.inline-form { display: flex; gap: .75rem; align-items: end; }
.mini-stats { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .5rem; }
.mini-stats span { background: #f3f6fb; border: 1px solid #dce6f2; border-radius: 999px; padding: .35rem .65rem; }


.password-field {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.password-field input {
  flex: 1 1 auto;
  min-width: 0;
}
.password-field .password-toggle {
  white-space: nowrap;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.login-card .password-field {
  max-width: 100%;
}

/* V1.43: Mitarbeiter-Dienstplankarte nur fuer freigegebene Plaene */
.dienstplankarte-wrap { display: flex; justify-content: center; margin-bottom: 28px; }
.dienstplankarte {
  width: min(100%, 1050px);
  background: #f8fafc;
  border: 2px solid #111827;
  padding: 14px 16px 18px;
  box-shadow: var(--shadow);
  font-family: Arial, Helvetica, sans-serif;
}
.karte-title-row { display: flex; align-items: baseline; gap: 28px; border-bottom: 2px solid #111827; padding-bottom: 4px; }
.karte-title-row h2 { margin: 0; font-size: 34px; letter-spacing: -0.03em; }
.karte-period { font-size: 28px; }
.karte-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 1px solid #111827; border-right: 1px solid #111827; border-bottom: 1px solid #111827; }
.karte-meta div { padding: 4px 6px; border-bottom: 1px solid #d1d5db; font-size: 14px; }
.dienstplankarte-table { width: 100%; border-collapse: collapse; background: #f8fafc; font-size: 14px; }
.dienstplankarte-table th, .dienstplankarte-table td { border: 1px solid #111827; padding: 4px 6px; vertical-align: top; }
.dienstplankarte-table th { background: #e5e7eb; color: #111827; text-align: center; font-size: 13px; letter-spacing: 0; }
.dienstplankarte-table tr:hover td { background: inherit; }
.dienstplankarte-table .day-col { width: 90px; }
.dienstplankarte-table .time-col { width: 160px; white-space: nowrap; }
.day-cell strong { display: block; }
.day-cell span { display: block; font-size: 12px; line-height: 1.15; }
.dienstplankarte-table tr.sunday .day-cell,
.dienstplankarte-table tr.holiday .day-cell { background: #fecaca; color: #7f1d1d; }
.dienstplankarte-table tr.saturday .day-cell { background: #fef2f2; color: #7f1d1d; }
.karte-chip { display: inline-block; min-width: 118px; text-align: center; border: 1px solid #9ca3af; padding: 2px 6px; margin: 0 4px 2px 0; font-weight: 700; }
.karte-chip.service.tag { background: #fb923c; color: #111827; }
.karte-chip.service.nacht { background: #fed7aa; color: #111827; }
.karte-chip.absence.urlaub { background: #fef08a; color: #713f12; }
.karte-chip.absence.krank { background: #fecaca; color: #7f1d1d; }
.karte-chip.absence.fortbildung { background: #ddd6fe; color: #4c1d95; }
.karte-chip.absence.frei { background: #e5e7eb; color: #374151; }
.karte-chip.absence.wunschfrei { background: #f5d0fe; color: #701a75; }
.holiday-label { font-weight: 700; }
.karte-summary { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 4px 0; font-size: 14px; }
@media print {
  body { background: white; }
  .sidebar, .topbar, .employee-plan-intro, .no-print { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; max-width: none; }
  .dienstplankarte-wrap { margin: 0; display: block; }
  .dienstplankarte { width: 100%; box-shadow: none; border: 2px solid #000; page-break-inside: avoid; }
}

/* Version 1.44: Dashboard als Kachel-Zentrale */
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.20), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 56%, #eff6ff 100%);
}
.dashboard-hero h2 {
  font-size: 30px;
  margin-bottom: 8px;
}
.dashboard-hero p { max-width: 720px; margin: 0; color: var(--muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  margin-bottom: 10px;
  background: #dbeafe;
  color: #1e3a8a;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dashboard-status {
  min-width: 245px;
  border: 1px solid #dbeafe;
  background: rgba(255,255,255,.72);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 7px;
  box-shadow: 0 12px 28px rgba(30, 64, 175, .08);
}
.dashboard-status strong { font-size: 16px; }
.dashboard-status small { color: var(--muted); }
.dashboard-status-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.dashboard-status-link:hover,
.dashboard-status-link:focus-visible {
  transform: translateY(-2px);
  border-color: #93c5fd;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(30, 64, 175, .16);
  outline: none;
}
.dashboard-status-action {
  color: var(--primary);
  font-weight: 900;
  font-size: 13px;
}
.dashboard-section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 22px 0 12px;
}
.dashboard-section-title h2 { margin-bottom: 4px; }
.dashboard-section-title p { margin: 0; }
.dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.dash-tile {
  position: relative;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dash-tile::after {
  content: "";
  position: absolute;
  inset: auto -40px -48px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .08);
}
.dash-tile:hover {
  transform: translateY(-3px);
  border-color: #93c5fd;
  box-shadow: 0 24px 55px rgba(15, 23, 42, .12);
}
.dash-tile strong {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.dash-tile small {
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  max-width: 95%;
}
.tile-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #eff6ff;
  font-size: 23px;
}
.primary-tile {
  background: linear-gradient(135deg, #1f4f8f, #1d4ed8);
  color: #fff;
  border-color: #1d4ed8;
}
.primary-tile small { color: #dbeafe; }
.primary-tile .tile-icon { background: rgba(255,255,255,.16); }
.primary-tile::after { background: rgba(255,255,255,.12); }
.dashboard-lower { margin-top: 2px; }
.compact-list { line-height: 1.55; }
.demo-reset-form { margin-top: 14px; }
@media (max-width: 900px) {
  .dashboard-hero { flex-direction: column; align-items: stretch; }
  .dashboard-status { min-width: 0; }
  .dashboard-tiles { grid-template-columns: 1fr; }
}

/* V1.45: Rueckmeldung direkt im Bearbeitungsdialog */
.modal-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  line-height: 1.35;
  border: 1px solid var(--line);
}
.modal-feedback.success {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.modal-feedback.warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #facc15;
}
.modal-feedback.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.modal-feedback.info,
.modal-feedback:not(.success):not(.warning):not(.error) {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* V1.45: Admin-Ansicht der Mitarbeiter-Dienstplankarten */
.employee-card-admin-section .dienstplankarte-wrap {
  margin-top: 0;
}
.employee-card-panel[hidden] {
  display: none !important;
}
.inline-card-wrap {
  background: transparent;
  padding: 0;
}
.plan-bottom-jump select,
.employee-card-admin-section select {
  min-width: 280px;
}
@media print {
  .employee-card-admin-section .section-head,
  .employee-card-admin-section .button-row,
  .plan-bottom-jump { display: none !important; }
  .employee-card-panel[hidden] { display: none !important; }
}


/* V1.47: Druckmodus nur fuer die aktuell ausgewaehlte Mitarbeiter-Dienstplankarte */
@media print {
  body.print-current-employee-card { background: #fff !important; }
  body.print-current-employee-card .layout { display: block !important; }
  body.print-current-employee-card .content { padding: 0 !important; max-width: none !important; }
  body.print-current-employee-card main > * { display: none !important; }
  body.print-current-employee-card #mitarbeiter-dienstplankarten {
    display: block !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }
  body.print-current-employee-card #mitarbeiter-dienstplankarten .section-head,
  body.print-current-employee-card #mitarbeiter-dienstplankarten .button-row,
  body.print-current-employee-card #mitarbeiter-dienstplankarten > .hint,
  body.print-current-employee-card #mitarbeiter-dienstplankarten > .subtitle {
    display: none !important;
  }
  body.print-current-employee-card #mitarbeiter-dienstplankarten .employee-card-panels {
    display: block !important;
  }
  body.print-current-employee-card #mitarbeiter-dienstplankarten .employee-card-panel {
    display: none !important;
  }
  body.print-current-employee-card #mitarbeiter-dienstplankarten .employee-card-panel:not([hidden]) {
    display: block !important;
  }
  body.print-current-employee-card #mitarbeiter-dienstplankarten .dienstplankarte-wrap {
    display: block !important;
    margin: 0 !important;
  }
  body.print-current-employee-card #mitarbeiter-dienstplankarten .dienstplankarte {
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    border: 2px solid #000 !important;
    page-break-inside: avoid;
  }
}

/* Version 1.52: Jahresurlaubsanträge */
.year-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 14px; }
.year-vacation-table { border-collapse: separate; border-spacing: 0; font-size: 11px; min-width: 2600px; }
.year-vacation-table th, .year-vacation-table td { padding: 3px 4px; text-align: center; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }
.year-vacation-table .sticky-left { position: sticky; left: 0; z-index: 3; min-width: 180px; text-align: left; background: #fff; box-shadow: 2px 0 0 #e5e7eb; }
.year-vacation-table thead .sticky-left { z-index: 5; background: #f8fafc; }
.year-vacation-table .day-head { min-width: 34px; white-space: nowrap; background: #f8fafc; position: sticky; top: 0; z-index: 2; }
.year-vacation-table .special { background: #fee2e2; }
.year-cell { height: 26px; }
.year-cell a { display: block; text-decoration: none; color: #111827; font-weight: 900; }
.year-cell.eingereicht { background: #fde68a; }
.year-cell.genehmigt { background: #bbf7d0; }
.year-cell.entwurf { background: #dbeafe; }
.year-cell.abgelehnt { background: #fecaca; }
.vac-cell, .vac-special { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 24px; border-radius: 8px; padding: 3px 7px; font-weight: 900; margin-left: 10px; }
.vac-cell.eingereicht { background: #fde68a; }
.vac-cell.genehmigt { background: #bbf7d0; }
.vac-cell.entwurf { background: #dbeafe; }
.vac-special { background: #fee2e2; }
.legend-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; color: var(--muted); }
.vacation-periods table input { min-width: 130px; }
.vacation-form .mini-hint { color: var(--muted); font-size: 12px; }

/* Version 1.54: Urlaubsübersicht nach Versorgung gruppiert */
.grouped-vacation-table .vac-group-row td { background: #eef2ff; }
.grouped-vacation-table .vac-group-row .sticky-left { background: #e0e7ff; color: #111827; font-size: 12px; border-top: 2px solid #c7d2fe; border-bottom: 2px solid #c7d2fe; }
.grouped-vacation-table .vac-group-row .group-fill { border-top: 2px solid #c7d2fe; border-bottom: 2px solid #c7d2fe; }
.grouped-vacation-table .vac-group-row .group-fill.special { background: #fce7e7; }

/* Version 1.55: Urlaubsuebersicht filtern und Monatsansicht ohne horizontales Scrollen */
.year-scroll.month-compact {
  overflow-x: visible;
  overflow-y: auto;
  max-height: 72vh;
}
.month-vacation-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 10px;
}
.month-vacation-table th,
.month-vacation-table td {
  padding: 2px 1px;
  min-width: 0;
}
.month-vacation-table .sticky-left {
  width: 175px;
  min-width: 175px;
  max-width: 175px;
  white-space: normal;
}
.month-vacation-table .day-head {
  min-width: 0;
  width: auto;
  font-size: 9px;
  line-height: 1.15;
  white-space: normal;
}
.month-vacation-table .year-cell {
  height: 24px;
  font-size: 10px;
}
@media (max-width: 1200px) {
  .month-vacation-table .sticky-left {
    width: 145px;
    min-width: 145px;
    max-width: 145px;
  }
  .month-vacation-table {
    font-size: 9px;
  }
  .month-vacation-table .day-head,
  .month-vacation-table .year-cell {
    font-size: 8px;
  }
}


/* Version 1.56: Filter- und Auswahlfelder lesbar darstellen */
.section-head {
  flex-wrap: wrap;
}
.section-head .inline-form,
.inline-form.filter-form,
.inline-form.compact-filter {
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 12px;
}
.inline-form label {
  flex: 0 0 auto;
  min-width: 130px;
}
.inline-form input,
.inline-form select {
  max-width: none;
  width: 100%;
  min-width: 0;
}
.inline-form input[type="number"] {
  min-width: 105px;
  font-variant-numeric: tabular-nums;
}
.inline-form select {
  min-width: 150px;
}
.filter-form label {
  min-width: 150px;
}
.filter-form .filter-year {
  min-width: 118px;
  max-width: 135px;
}
.filter-form .filter-month {
  min-width: 145px;
}
.filter-form .filter-group {
  min-width: 230px;
}
.filter-form .filter-state {
  min-width: 210px;
}
.inline-form.compact-filter label {
  min-width: 260px;
}
.compact-form label {
  min-width: 180px;
}
.compact-form input,
.compact-form select,
.mini-form input,
.mini-form select {
  width: 100%;
  max-width: none;
}
@media (max-width: 900px) {
  .inline-form label,
  .filter-form label,
  .inline-form.compact-filter label,
  .filter-form .filter-year,
  .filter-form .filter-month,
  .filter-form .filter-group,
  .filter-form .filter-state {
    min-width: 100%;
    max-width: none;
  }
}
/* V1.57 Springer / Einarbeitung */
.legend-item.einarbeitung strong, .cell-service.einarbeitung { background: #ccfbf1; color: #115e59; }
.legend-item.extra strong, .cell-service.extra { background: #e0f2fe; color: #075985; border: 1px dashed #38bdf8; }
.roster-cell.einarbeitung { background: #f0fdfa; }
.roster-cell.extra { background: #f8fafc; color: #0369a1; }
.badge.soft { background: #e0f2fe; color: #075985; }

/* Version 1.58: Filter im Mitarbeiter-Monatsplan */
.filter-inline {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.filter-inline label {
  min-width: 220px;
}
.filter-inline select {
  min-width: 220px;
}
.employee-roster-row[hidden] {
  display: none !important;
}

/* Version 1.59: kombinierter Mitarbeiterfilter und Kapazitaetsbericht */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.kpi-grid.compact { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
}
.kpi span {
  display: block;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 1.35rem;
}
.empty-state {
  padding: 14px 16px;
  border-radius: 14px;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
}

/* Version 1.61: Cluster-Trennung */
.cluster-switch {
  margin: 14px 14px 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}
.cluster-switch label {
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cluster-switch select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}
.badge.cluster {
  background: #ede9fe;
  color: #5b21b6;
}
.row-selected {
  background: #eff6ff;
}

/* Version 1.62: linke Navigation kompakter und scrollbar, damit Abmelden erreichbar bleibt */
.sidebar {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px 16px;
  scrollbar-width: thin;
}
.brand { margin-bottom: 16px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.sidebar nav { gap: 3px; }
.sidebar nav a {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.2;
}
.cluster-switch { margin: 10px 0 8px; padding: 10px; }
.sidebar-user { margin-top: 8px; padding: .65rem 0 0; }
@media (max-height: 820px) {
  .sidebar { padding-top: 14px; padding-bottom: 14px; }
  .brand { margin-bottom: 10px; }
  .sidebar nav a { padding-top: 7px; padding-bottom: 7px; }
  .cluster-switch { padding: 8px; }
}

/* Version 1.65: Intelligente Mitarbeitersuche */
.mini-search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  margin: 3px auto 0;
  padding: 3px 6px;
  border-radius: 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-decoration: none;
  position: relative;
  z-index: 20;
  pointer-events: auto;
  border: 1px solid #bfdbfe;
}
.mini-search-link:hover { background: #bfdbfe; color: #1e40af; }
.clickable-plan-cell::after { pointer-events: none; }
.cluster-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.check-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.smart-search-wrap { overflow-x: auto; }
.smart-search-table { min-width: 1250px; }
.smart-search-table th, .smart-search-table td { vertical-align: top; }
.smart-search-table .day-head { text-align: center; min-width: 44px; }
.smart-day-cell {
  text-align: center;
  min-width: 44px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 11px;
}
.smart-day-cell.empty { color: #cbd5e1; }
.smart-day-cell.tag { background: #ffedd5; color: #7c2d12; }
.smart-day-cell.nacht { background: #dbeafe; color: #1e3a8a; }
.smart-day-cell.urlaub { background: #fef9c3; color: #713f12; }
.smart-day-cell.krank { background: #fee2e2; color: #991b1b; }
.smart-day-cell.frei { background: #f3f4f6; color: #374151; }
.smart-day-cell.fortbildung { background: #ede9fe; color: #4c1d95; }
.smart-day-cell.wunschfrei { background: #fae8ff; color: #701a75; }
.smart-day-cell.einarbeitung { background: #ccfbf1; color: #115e59; }
.smart-day-cell.target, .target-col { box-shadow: inset 0 0 0 999px rgba(37, 99, 235, .08); }
.smart-action-form { display: flex; flex-direction: column; gap: 6px; min-width: 96px; }
.button.tiny { padding: 5px 8px; font-size: 11px; border-radius: 9px; }
.button.tiny:disabled { opacity: .45; cursor: not-allowed; }

/* Version 1.67: Status-Mehrfachfilter und Suchbestaetigung */
.status-filter-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.status-check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font-weight: 800;
}
.smart-confirm-card { max-width: 920px; }
.confirm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.confirm-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
.confirm-grid dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 4px;
}
.confirm-grid dd { margin: 0; }

/* Version 1.70: einfaches Entfernen manueller Dienste */
.manual-delete-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.manual-delete-form .button { width: auto; }


/* Version 1.72: clusteruebergreifende Dienste in Mitarbeiteransichten */
.legend-item.crosscluster strong,
.cell-service.crosscluster { background: #ecfeff; color: #155e75; border: 1px solid #06b6d4; }
.cell-service .cluster-mini { color: #0e7490; font-weight: 700; }
.karte-chip.service.einarbeitung { background: #ccfbf1; color: #115e59; }

/* Version 1.73: Adressen, Einarbeitungshinweise und Versorgungseinheiten-Karten */
.service-target-block { margin-bottom: 5px; line-height: 1.25; }
.service-target-block:last-child { margin-bottom: 0; }
.service-target-block strong,
.service-location-name,
.service-address { display: block; }
.service-location-name { margin-top: 1px; font-size: 12px; font-weight: 700; color: #334155; }
.service-address { margin-top: 1px; font-size: 12px; color: #475569; }

.care-unit-card-panel[hidden] { display: none !important; }
.care-unit-card-admin-section select { min-width: 300px; }
.care-unit-plan-wrap { overflow-x: auto; }
.care-unit-plan-card {
  min-width: 1180px;
  background: #fff;
  border: 2px solid #111827;
  padding: 12px;
  font-family: Arial, Helvetica, sans-serif;
  page: careUnitLandscape;
}
.care-unit-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid #111827;
  padding-bottom: 5px;
}
.care-unit-title-row h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.care-unit-period { font-size: 20px; font-weight: 700; white-space: nowrap; }
.care-unit-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid #111827;
  border-right: 1px solid #111827;
}
.care-unit-meta div { padding: 4px 6px; border-bottom: 1px solid #cbd5e1; font-size: 12px; }
.care-unit-table-scroll { overflow-x: auto; }
.care-unit-plan-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 9px;
}
.care-unit-plan-table th,
.care-unit-plan-table td {
  border: 1px solid #111827;
  padding: 2px;
  text-align: center;
  vertical-align: middle;
}
.care-unit-plan-table thead th { background: #e5e7eb; color: #111827; font-weight: 800; }
.care-unit-plan-table .care-unit-employee-col { width: 170px; text-align: left; }
.care-unit-employee-cell { text-align: left !important; background: #fff; }
.care-unit-employee-cell strong,
.care-unit-employee-cell span { display: block; }
.care-unit-employee-cell span { margin-top: 2px; color: #475569; font-size: 8px; }
.care-unit-day-cell { height: 42px; overflow: hidden; }
.care-unit-day-cell.special-col,
.care-unit-plan-table th.special-day { background: #fecaca; }
.care-unit-service { display: block; margin: 0 0 2px; padding: 1px; line-height: 1.05; }
.care-unit-service:last-child { margin-bottom: 0; }
.care-unit-service strong,
.care-unit-service small { display: block; }
.care-unit-service small { margin-top: 1px; font-size: 7px; white-space: nowrap; }
.care-unit-service.tag { background: #fb923c; color: #111827; }
.care-unit-service.nacht { background: #fed7aa; color: #111827; }
.care-unit-service.einarbeitung { background: #ccfbf1; color: #115e59; }
.care-unit-service.urlaub { background: #fef08a; color: #713f12; }
.care-unit-service.krank { background: #fecaca; color: #7f1d1d; }
.care-unit-service.fortbildung { background: #ddd6fe; color: #4c1d95; }
.care-unit-service.frei { background: #e5e7eb; color: #374151; }
.care-unit-service.wunschfrei { background: #f5d0fe; color: #701a75; }
.coverage-row th { text-align: left; white-space: nowrap; font-size: 9px; }
.coverage-row.tag-row th { background: #bbf7d0; }
.coverage-row.nacht-row th { background: #bfdbfe; }
.coverage-row.training-row th { background: #ccfbf1; }
.coverage-cell strong,
.coverage-cell small { display: block; }
.coverage-cell small { font-size: 7px; }
.coverage-cell.ok { background: #86efac; }
.coverage-cell.hard { background: #fecaca; color: #7f1d1d; }
.coverage-cell.neutral { background: #f8fafc; color: #64748b; }
.coverage-cell.training { background: #ecfeff; color: #155e75; }
.care-unit-legend { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }

@page careUnitLandscape { size: A4 landscape; margin: 7mm; }
@media print {
  body.print-current-care-unit-card { background: #fff !important; }
  body.print-current-care-unit-card .layout { display: block !important; }
  body.print-current-care-unit-card .content { padding: 0 !important; max-width: none !important; }
  body.print-current-care-unit-card main > * { display: none !important; }
  body.print-current-care-unit-card #versorgungseinheiten-dienstplankarten {
    display: block !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }
  body.print-current-care-unit-card #versorgungseinheiten-dienstplankarten .section-head,
  body.print-current-care-unit-card #versorgungseinheiten-dienstplankarten .button-row,
  body.print-current-care-unit-card #versorgungseinheiten-dienstplankarten > .hint,
  body.print-current-care-unit-card #versorgungseinheiten-dienstplankarten > .subtitle { display: none !important; }
  body.print-current-care-unit-card .care-unit-card-panel { display: none !important; }
  body.print-current-care-unit-card .care-unit-card-panel:not([hidden]) { display: block !important; }
  body.print-current-care-unit-card .care-unit-plan-wrap { overflow: visible !important; }
  body.print-current-care-unit-card .care-unit-plan-card {
    min-width: 0 !important;
    width: 100% !important;
    border: 1.5px solid #000 !important;
    padding: 4px !important;
    box-shadow: none !important;
  }
  body.print-current-care-unit-card .care-unit-title-row h2 { font-size: 18px; }
  body.print-current-care-unit-card .care-unit-period { font-size: 14px; }
  body.print-current-care-unit-card .care-unit-meta div { font-size: 8px; padding: 2px 3px; }
  body.print-current-care-unit-card .care-unit-table-scroll { overflow: visible !important; }
  body.print-current-care-unit-card .care-unit-plan-table {
    min-width: 0 !important;
    font-size: 6.5px !important;
  }
  body.print-current-care-unit-card .care-unit-plan-table .care-unit-employee-col { width: 110px; }
  body.print-current-care-unit-card .care-unit-plan-table th,
  body.print-current-care-unit-card .care-unit-plan-table td { padding: 1px !important; }
  body.print-current-care-unit-card .care-unit-day-cell { height: 28px; }
  body.print-current-care-unit-card .care-unit-service small { font-size: 5.5px; }
  body.print-current-care-unit-card .care-unit-employee-cell span { font-size: 5.5px; }
  body.print-current-care-unit-card .care-unit-legend { gap: 3px; padding-top: 4px; }
  body.print-current-care-unit-card .care-unit-legend .legend-item { font-size: 6px; padding: 2px 4px; }
}


/* V1.76: Rollenhilfe in der Mitarbeiterverwaltung */
.role-help {
  margin-top: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}
.role-help summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 900;
  color: #1e3a5f;
  background: #eff6ff;
  list-style-position: inside;
}
.role-help[open] summary { border-bottom: 1px solid #cbd5e1; }
.role-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.role-help-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}
.role-help-grid h3 { margin: 0 0 7px; font-size: 15px; color: #0f172a; }
.role-help-grid p { margin: 0 0 7px; line-height: 1.45; font-weight: 500; }
.role-help-grid p:last-child { margin-bottom: 0; }
.role-help-note {
  margin: 0 14px 14px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .role-help-grid { grid-template-columns: 1fr; }
}

/* Version 1.79: integrierte Dokumentation */
.documentation-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
}
.documentation-hero h2 { margin-top: 6px; margin-bottom: 10px; font-size: 28px; }
.documentation-hero p { max-width: 850px; margin: 0; color: #475569; line-height: 1.65; }
.documentation-actions { display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.documentation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.documentation-topic {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}
.documentation-topic:hover { border-color: #93c5fd; transform: translateY(-1px); }
.documentation-topic strong { color: var(--primary); font-size: 15px; }
.documentation-topic span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.documentation-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.documentation-help h2 { margin-bottom: 6px; }
.documentation-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.documentation-meta span { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 7px 10px; font-size: 12px; color: #475569; }
.documentation-viewer-card { padding: 12px; overflow: hidden; }
.documentation-viewer { width: 100%; min-height: 78vh; border: none; border-radius: 12px; background: #f8fafc; }
@media (max-width: 1200px) {
  .documentation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .documentation-hero, .documentation-help { flex-direction: column; align-items: stretch; }
  .documentation-actions { min-width: 0; }
  .documentation-grid { grid-template-columns: 1fr; }
  .documentation-meta { justify-content: flex-start; }
  .documentation-viewer { min-height: 65vh; }
}

.documentation-quickstart {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr);
  gap: 26px;
  align-items: start;
}
.documentation-quickstart h2 { margin-top: 6px; margin-bottom: 0; }
.documentation-quickstart ol { margin: 0; padding-left: 22px; line-height: 1.6; }
.documentation-quickstart li + li { margin-top: 7px; }
.documentation-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.documentation-preview-card {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.documentation-preview-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
}
.documentation-preview-card figcaption {
  margin-top: 9px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .documentation-quickstart { grid-template-columns: 1fr; }
  .documentation-preview-grid { grid-template-columns: 1fr; }
}

/* Version 1.80: Notdienst schliesst offenen Pflichtplatz */
.legend-item.notdienst strong,
.cell-service.notdienst {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fb923c;
}
.roster-cell.notdienst,
.smart-day-cell.notdienst {
  background: #fff7ed;
  color: #9a3412;
}
.karte-chip.service.notdienst {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fb923c;
}
.care-unit-service.notdienst {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fb923c;
}
.coverage-row.emergency-row th {
  background: #fed7aa;
  color: #9a3412;
}
.coverage-cell.emergency {
  background: #fff7ed;
  color: #9a3412;
}
.warning-box.emergency-warning {
  border-color: #fb923c;
  background: #fff7ed;
  color: #9a3412;
}
.emergency-confirm-check {
  border-color: #fb923c;
  background: #fff7ed;
}

/* V1.81: Optimierungsmodi und Variantenvergleich */
.optimizer-mode-field select { font-weight: 800; }
.optimizer-mode-field small { min-height: 2.4em; }
.optimizer-summary-card { border-color: #93c5fd; background: linear-gradient(180deg, #eff6ff, #ffffff); }
.optimizer-recommendation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 16px;
  border: 1px solid #86efac;
  border-radius: 14px;
  background: #f0fdf4;
}
.optimizer-compare-table th,
.optimizer-compare-table td { vertical-align: middle; }
.optimizer-best-row td { background: #f0fdf4; }
.optimizer-best-row:hover td { background: #dcfce7; }
.badge.optimizer-mode-schnell { background: #e2e8f0; color: #334155; }
.badge.optimizer-mode-ausgewogen { background: #dbeafe; color: #1e40af; }
.badge.optimizer-mode-gruendlich { background: #ede9fe; color: #5b21b6; }
@media (max-width: 900px) {
  .optimizer-recommendation { align-items: flex-start; flex-direction: column; }
}


/* V1.85: eindeutige Mitarbeiterkürzel und administrativer Passwort-Reset */
.badge.warning { background: #fef3c7; color: #92400e; }
.password-reset-card { border-color: #f59e0b; background: linear-gradient(180deg, #fffbeb, #ffffff); }
.password-reset-card .section-head { align-items: flex-start; }
.password-reset-warning {
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fef9c3;
  color: #713f12;
  line-height: 1.45;
  font-weight: 600;
}
.password-change-card { max-width: 720px; }
@media (max-width: 700px) {
  .password-reset-card .section-head { flex-direction: column; }
}

/* V1.87: CP-SAT und Large Neighborhood Search */
.badge.optimizer-mode-lns { background: #dcfce7; color: #166534; }
.lns-card { border-color: #86efac; background: linear-gradient(180deg, #f0fdf4, #ffffff); }
.lns-form { margin-top: 14px; }
.lns-form .rule-box { display: grid; gap: 6px; }
.solver-stat { font-variant-numeric: tabular-nums; }

/* Version 1.91: global customer logo */
.brand-with-logo { align-items: center; }
.brand-logo-frame {
  width: 78px;
  height: 52px;
  flex: 0 0 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 5px;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.brand-logo-link { text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.brand-logo-link:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(0,0,0,.24); }
.brand-logo-image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.brand-copy { min-width: 0; }
.brand-manage-link {
  display: inline-block;
  margin-top: 5px;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.brand-manage-link:hover { color: #ffffff; text-decoration: underline; }
.branding-grid { align-items: stretch; }
.branding-upload-form { margin-top: 18px; }
.branding-preview-card { min-height: 300px; }
.branding-preview-frame {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 18px;
  border: 1px dashed #94a3b8;
  border-radius: 16px;
  background: #ffffff;
}
.branding-preview-frame img { max-width: 100%; max-height: 180px; object-fit: contain; }
.branding-preview-placeholder {
  width: 92px;
  height: 92px;
  margin: 20px auto;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #60a5fa, #1d4ed8);
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
}
@media (max-width: 700px) {
  .brand-logo-frame { width: 68px; flex-basis: 68px; }
}

/* V1.95 Fahrtkostenabrechnung */
.travel-settings-grid { align-items: start; }
.travel-metric-grid { margin: 1rem 0; }
.travel-intro-card .warning-box { margin-top: 1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form input { min-width: 220px; }
.travel-correction { margin-top: .45rem; }
.travel-correction summary { cursor: pointer; font-weight: 700; }
.travel-correction .mini-form { margin-top: .5rem; }

/* V1.97: Dashboard-Kennzahlen und persoenliche Fahrtkostenkarte */
.dashboard-metric-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  min-height: 126px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dashboard-metric-link:hover,
.dashboard-metric-link:focus-visible {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .11);
  outline: none;
}
.dashboard-metric-link small {
  margin-top: .3rem;
  color: var(--muted);
  font-weight: 700;
}
.dashboard-number-heading { margin-top: 24px; }
.dashboard-function-metrics { margin-bottom: 24px; }
.dashboard-metric-attention {
  border-color: #f59e0b;
  background: linear-gradient(145deg, #ffffff, #fffbeb);
}
.tile-number {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  font-weight: 900;
  font-size: 13px;
}
.tile-number.attention {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}
.travel-tile {
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
  border-color: #bbf7d0;
}
.travel-tile .tile-icon { background: #dcfce7; }

.fahrtkostenkarte { width: min(100%, 1180px); }
.fahrtkostenkarte-table .time-col { width: 125px; }
.fahrtkostenkarte-table .travel-number-col { width: 155px; }
.travel-route-block,
.travel-amount-block,
.travel-note-block {
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
}
.travel-route-block:last-child,
.travel-amount-block:last-child,
.travel-note-block:last-child { margin-bottom: 0; }
.travel-route-detail {
  display: block;
  color: #475569;
  font-size: 12px;
  line-height: 1.25;
}
.travel-amount-block span { display: block; font-size: 12px; }
.travel-excluded-chip {
  background: #e5e7eb !important;
  color: #475569 !important;
}
.fahrtkostenkarte-table tr.has-excluded-travel td:not(.day-cell) { background: #f8fafc; }
.travel-card-summary {
  justify-content: space-between;
  border-top: 1px solid #111827;
  margin-top: 8px;
  padding-top: 10px;
}
@media (max-width: 900px) {
  .fahrtkostenkarte { min-width: 980px; }
  .fahrtkostenkarte-wrap { overflow-x: auto; justify-content: flex-start; }
}
@media print {
  .fahrtkostenkarte { width: 100%; min-width: 0; }
  .fahrtkostenkarte-table { font-size: 10px; }
  .fahrtkostenkarte-table th,
  .fahrtkostenkarte-table td { padding: 2px 3px; }
  .fahrtkostenkarte .karte-title-row h2 { font-size: 26px; }
  .fahrtkostenkarte .karte-period { font-size: 20px; }
  .fahrtkostenkarte-wrap { overflow: visible; }
}

/* V1.98: Google-Maps-Verbindungsassistent */
.travel-google-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  margin: .8rem 0;
}
.travel-google-actions form { margin: 0; }
.travel-google-actions .button[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

/* V2.01: Sofortige visuelle Rueckmeldung nach AJAX-Speicherung. */
.roster-cell.manual-saved-cell {
  outline: 2px solid #16a34a;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.18);
}


/* Version 2.02: kompaktes, immer bedienbares Fenster fuer manuelle Dienste */
.manual-edit-modal-card {
  width: min(520px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 16px;
  overscroll-behavior: contain;
}
.manual-edit-modal-card .modal-head {
  position: sticky;
  top: -16px;
  z-index: 5;
  margin: -16px -16px 10px;
  padding: 14px 16px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.manual-edit-modal-card .form-stack { gap: 10px; }
.manual-edit-modal-card .hint { line-height: 1.35; }
.manual-edit-modal-card #manualEditAllowedHint {
  display: block;
  max-height: 96px;
  overflow-y: auto;
  padding-right: 4px;
}
.manual-modal-actions {
  position: sticky;
  bottom: -16px;
  z-index: 4;
  margin: 0 -16px -16px;
  padding: 10px 16px 14px;
  background: linear-gradient(to bottom, rgba(255,255,255,.93), #fff 28%);
  border-top: 1px solid var(--line);
}
.manual-emergency-confirm {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  border-radius: 12px;
  padding: 10px 12px;
}
.manual-emergency-confirm > span:first-child { display: flex; gap: 8px; align-items: flex-start; font-weight: 900; }
.manual-emergency-confirm input { width: auto; margin-top: 3px; }
@media (max-height: 760px) {
  .modal-backdrop { padding: 8px; align-items: start; }
  .manual-edit-modal-card { max-height: calc(100vh - 16px); padding: 12px; }
  .manual-edit-modal-card .modal-head { top: -12px; margin: -12px -12px 8px; padding: 10px 12px 8px; }
  .manual-modal-actions { bottom: -12px; margin: 0 -12px -12px; padding: 8px 12px 10px; }
  .manual-edit-modal-card .form-stack { gap: 7px; }
  .manual-edit-modal-card #manualEditAllowedHint { max-height: 72px; }
}

/* Version 2.06: Filter, Kapazitaetsuebersicht und Rueckkehrposition bei festen Teams */
.fixed-team-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0 18px;
  padding: 16px;
  border: 1px solid #dbe4ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.fixed-team-filter-grid label {
  min-width: 0;
}
.fixed-team-filter-search {
  grid-column: span 2;
}
.fixed-team-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  grid-column: span 2;
}
.fixed-team-table-wrap {
  scroll-margin-top: 18px;
}
.fixed-team-table .fixed-team-group-row td {
  padding: 0;
  border-bottom: 1px solid #cbd5e1;
  background: #f8fafc;
}
.fixed-team-table .fixed-team-group-row:hover td {
  background: #f8fafc;
}
.fixed-team-group-summary {
  padding: 14px 16px;
  border-top: 2px solid #dbeafe;
  scroll-margin-top: 18px;
}
.fixed-team-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fixed-team-group-title strong {
  font-size: 16px;
}
.fixed-team-capacity-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}
.fixed-team-capacity-strip > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.fixed-team-capacity-strip small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fixed-team-capacity-strip strong {
  font-size: 13px;
  line-height: 1.25;
}
.fixed-team-capacity-note {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}
.fixed-team-capacity-note.hard {
  background: #fee2e2;
  color: #991b1b;
}
.fixed-team-table tr[id^="assignment-"] {
  scroll-margin-top: 18px;
}
.fixed-team-table .mini-form {
  min-width: 235px;
}
.fixed-team-table .badge {
  margin: 2px 3px 2px 0;
}
@media (max-width: 1250px) {
  .fixed-team-filter-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
  .fixed-team-capacity-strip {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
  .fixed-team-filter-search,
  .fixed-team-filter-actions {
    grid-column: span 3;
  }
}
@media (max-width: 800px) {
  .fixed-team-filter-grid {
    grid-template-columns: 1fr;
  }
  .fixed-team-filter-search,
  .fixed-team-filter-actions {
    grid-column: auto;
  }
  .fixed-team-capacity-strip {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}
@media (max-width: 520px) {
  .fixed-team-capacity-strip {
    grid-template-columns: 1fr;
  }
}

.documentation-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.documentation-menu-grid > div {
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.documentation-menu-grid h3 {
  margin: 0 0 8px;
  font-size: 17px;
  color: #1e3a5f;
}
.documentation-menu-grid .checklist {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .documentation-menu-grid { grid-template-columns: 1fr; }
}

/* Version 2.07: Filterbare Mitarbeiteruebersicht und Rueckkehrposition */
.employee-list-head {
  gap: 16px;
  align-items: flex-start;
}
.employee-list-head .subtitle {
  margin-bottom: 0;
}
.employee-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0 18px;
  padding: 16px;
  border: 1px solid #dbe4ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.employee-filter-grid label {
  min-width: 0;
}
.employee-filter-search {
  grid-column: span 2;
}
.employee-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  grid-column: span 2;
}
.employee-table-wrap {
  scroll-margin-top: 18px;
}
.employee-list-row {
  scroll-margin-top: 18px;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.employee-list-row:target td {
  background: #eff6ff;
  box-shadow: inset 0 1px 0 #bfdbfe, inset 0 -1px 0 #bfdbfe;
}
.employee-empty-result {
  padding: 28px 18px !important;
  text-align: center;
}
@media (max-width: 1250px) {
  .employee-filter-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
  .employee-filter-search,
  .employee-filter-actions {
    grid-column: span 3;
  }
}
@media (max-width: 800px) {
  .employee-filter-grid {
    grid-template-columns: 1fr;
  }
  .employee-filter-search,
  .employee-filter-actions {
    grid-column: auto;
  }
}

/* Version 2.08: Planlauf-Sperre und Benutzeraktivitaet */
.planning-submit-overlay[hidden] { display: none; }
.planning-submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(5px);
}
.planning-submit-card {
  width: min(620px, 100%);
  border-radius: 22px;
  background: #fff;
  padding: 32px;
  text-align: center;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .35);
}
.planning-submit-card h2 { margin: 10px 0 12px; }
.planning-submit-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border: 6px solid #dbeafe;
  border-top-color: #245b9e;
  border-radius: 50%;
  animation: planning-spin 1s linear infinite;
}
@keyframes planning-spin { to { transform: rotate(360deg); } }
body.planning-submit-active { overflow: hidden; }

.user-activity-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.user-activity-intro p { max-width: 950px; }
.user-activity-metrics { margin-top: 18px; }
.user-activity-filter {
  display: grid;
  grid-template-columns: 180px 260px minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.user-activity-search { min-width: 0; }
.user-activity-filter-actions { margin: 0; align-self: end; }
.user-activity-table { min-width: 1080px; }
.user-activity-history-table { min-width: 980px; }
.user-activity-table td { vertical-align: top; }
.activity-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.activity-status.active { color: #166534; background: #dcfce7; }
.activity-status.inactive { color: #92400e; background: #fef3c7; }
.activity-status.logged_out { color: #475569; background: #e2e8f0; }
.user-agent-text {
  display: block;
  max-width: 420px;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: #64748b;
  font-size: 12px;
}
.user-activity-table details summary { cursor: pointer; color: #245b9e; font-size: 12px; margin-top: 5px; }
@media (max-width: 1100px) {
  .user-activity-filter { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .user-activity-filter-actions { grid-column: span 2; }
}
@media (max-width: 720px) {
  .user-activity-intro { flex-direction: column; }
  .user-activity-filter { grid-template-columns: 1fr; }
  .user-activity-filter-actions { grid-column: auto; }
}

/* V2.09: Lesemodus waehrend eines fremden Planlaufs */
.planning-readonly-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  color: #78350f;
}
.planning-readonly-banner strong { white-space: nowrap; }
.planning-readonly-banner span { line-height: 1.45; }

/* V2.09: bewusst einzeln waehlenbare Regelausnahmen */
.manual-rule-overrides {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
}
.manual-rule-overrides legend { padding: 0 5px; font-weight: 800; color: #92400e; }
.manual-rule-overrides label { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-weight: 650; }
.manual-rule-overrides input[type="checkbox"] { width: auto; margin-top: 3px; flex: 0 0 auto; }
.required-when-override { color: #b91c1c; font-weight: 800; }

/* V2.09: blockierende Festteam-Strukturpruefung */
.fixed-team-structure-conflict {
  border: 2px solid #dc2626;
  background: #fff7f7;
}
.fixed-team-structure-conflict h2 { color: #991b1b; }

/* V2.09: die letzten fuenf Vormonatstage in allen Dienstplanansichten */
.previous-context-col,
.roster-table th.previous-context-col,
.roster-table td.previous-context-col,
.care-unit-plan-table th.previous-context-col,
.care-unit-plan-table td.previous-context-col,
.coverage-cell.previous-context-col {
  background: #eef1f4 !important;
  color: #64748b !important;
  opacity: .78;
}
.previous-context-col .cell-service,
.previous-context-col .care-unit-service { filter: grayscale(.72); opacity: .8; }
.current-period-start { border-left: 3px solid #334155 !important; }
.dienstplankarte-table tr.previous-context-row td {
  background: #eef1f4 !important;
  color: #64748b;
}
.dienstplankarte-table tr.previous-context-row { opacity: .78; }
.legend-item.previous-context { background: #eef1f4; color: #475569; }
@media print {
  .previous-context-col,
  .dienstplankarte-table tr.previous-context-row td { background: #e5e7eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* V2.10: thematisch gegliederte Seitenleiste */
.nav-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav .nav-dashboard-wrap {
  margin: 0 0 5px;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.sidebar-nav .nav-link:hover {
  color: #ffffff;
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.08);
}
.sidebar-nav .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(147,197,253,.45);
  box-shadow: 0 7px 18px rgba(29,78,216,.27);
}
.sidebar-nav .nav-dashboard-wrap .nav-link {
  min-height: 39px;
  padding: 9px 11px;
  font-size: 14px;
  font-weight: 800;
  background: rgba(37,99,235,.18);
  border-color: rgba(96,165,250,.24);
}
.sidebar-nav .nav-dashboard-wrap .nav-link:hover,
.sidebar-nav .nav-dashboard-wrap .nav-link.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(147,197,253,.5);
}
.sidebar-nav .nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .92;
}
.sidebar-nav .nav-link.active .nav-icon {
  opacity: 1;
}
.sidebar-nav .nav-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 11px 9px 4px;
  color: #93c5fd;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.sidebar-nav .nav-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(147,197,253,.35), rgba(147,197,253,0));
}
.sidebar-nav .nav-section-title-first {
  margin-top: 2px;
}
.sidebar .cluster-switch {
  margin-top: 12px;
}
.sidebar .sidebar-user {
  margin-top: 10px;
}

@media (max-height: 820px) and (min-width: 1001px) {
  .sidebar-nav .nav-link {
    min-height: 30px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 12.5px;
  }
  .sidebar-nav .nav-dashboard-wrap .nav-link {
    min-height: 34px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .sidebar-nav .nav-section-title {
    margin-top: 8px;
    margin-bottom: 3px;
    font-size: 9.5px;
  }
}

@media (max-width: 1000px) {
  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .sidebar-nav .nav-dashboard-wrap,
  .sidebar-nav .nav-section-title {
    grid-column: 1 / -1;
  }
  .sidebar-nav .nav-dashboard-wrap {
    margin-bottom: 2px;
  }
  .sidebar-nav .nav-section-title {
    margin-top: 12px;
  }
}

@media (max-width: 560px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }
  .sidebar-nav .nav-dashboard-wrap,
  .sidebar-nav .nav-section-title {
    grid-column: auto;
  }
}

/* V2.11: browser- und zoomstabile Grundstruktur */
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
.layout {
  display: grid !important;
  grid-template-columns: minmax(250px, 285px) minmax(0, 1fr);
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
}
.sidebar {
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  flex: none !important;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 30;
}
.content {
  width: 100%;
  min-width: 0;
  max-width: none !important;
  padding: clamp(18px, 2.2vw, 34px);
  overflow-x: clip;
}
.content > *, .topbar, .card, .grid, .cards, .section-head, .form-grid { min-width: 0; max-width: 100%; }
.grid.two { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); }
.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { max-width: none; }
input, select, textarea, button { min-width: 0; }
.section-head > * { min-width: 0; }

/* V2.11: Login-Automatik und einmalige Zugangsdaten */
.credential-banner {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid #86efac;
  border-radius: 14px;
  background: #f0fdf4;
  color: #14532d;
}
.credential-banner > strong { display: block; margin-bottom: 10px; font-size: 16px; }
.credential-banner p { margin: 10px 0 0; font-size: 13px; }
.credential-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
}
.credential-grid code {
  display: block;
  overflow-wrap: anywhere;
  padding: 7px 9px;
  border-radius: 8px;
  background: #dcfce7;
  color: #14532d;
  font-size: 14px;
  user-select: all;
}
.login-auto-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* V2.11: kombinierte Monatsabrechnung */
.billing-metric-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.metric.emphasized { border-color: #93c5fd; background: #eff6ff; }
.billing-table-wrap { border: 1px solid var(--line); border-radius: 12px; }
.billing-summary-table { min-width: 1050px; }
.billing-detail-table { min-width: 1450px; }
.billing-grand-total { color: #0f4f8f; white-space: nowrap; }
.billing-grand-total strong { font-size: 16px; }
.billing-mini-stats { align-items: stretch; }
.billing-card-wrap { max-width: 100%; overflow-x: auto; }
.billing-card { min-width: 1180px; }
.billing-card-table-wrap { overflow-x: visible; }
.billing-card-table { min-width: 1140px; }
.billing-cell-block { min-width: 125px; line-height: 1.45; }
.billing-cell-block + .billing-cell-block { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #cbd5e1; }
.billing-card-summary { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.billing-summary-total { margin-left: auto; color: #0f4f8f; }
.surcharge-settings-page .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1250px) and (min-width: 1001px) {
  .layout { grid-template-columns: minmax(238px, 260px) minmax(0, 1fr); }
  .content { padding: 22px; }
  .grid.two, .travel-settings-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-wrap: wrap; }
}

@media (max-width: 1000px) {
  html, body { overflow-x: hidden; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    width: 100% !important;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .content { width: 100%; padding: 18px; }
  .grid.two, .travel-settings-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .billing-card { min-width: 1050px; }
}

@media (max-width: 620px) {
  .content { padding: 12px; }
  .card { padding: 16px; border-radius: 14px; }
  h1 { font-size: 28px; }
  .credential-grid { grid-template-columns: 1fr; gap: 4px; }
  .credential-grid code { margin-bottom: 8px; }
  .surcharge-settings-page .metric-grid { grid-template-columns: 1fr; }
  .button-row .button, .button-row form, .button-row form .button { width: 100%; }
}

@media print {
  .layout { display: block !important; }
  .content { overflow: visible; padding: 0; }
  .billing-card-wrap, .table-wrap { overflow: visible !important; }
  .billing-card { min-width: 0; }
}

/* V2.12: browserstabiles Desktop-Layout bei 100 % Zoom sowie kompakte Abrechnungsbearbeitung */
html {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.layout {
  grid-template-columns: clamp(220px, 16vw, 248px) minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
.layout > * { min-width: 0; }
.sidebar {
  width: auto !important;
  min-width: 0 !important;
  max-width: 248px !important;
  padding-left: clamp(12px, 1.25vw, 18px);
  padding-right: clamp(12px, 1.25vw, 18px);
}
.content {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: clamp(14px, 1.55vw, 24px) !important;
  overflow-x: hidden !important;
}
.content > *, .content section, .content article, .content form, .content fieldset {
  min-width: 0;
  max-width: 100%;
}
.topbar { min-width: 0; }
.topbar h1, .section-head h2, .section-head p { overflow-wrap: anywhere; }
.card {
  min-width: 0;
  max-width: 100%;
  padding: clamp(16px, 1.35vw, 20px);
}
.grid, .cards, .form-grid { min-width: 0; }
.grid > *, .cards > *, .form-grid > * { min-width: 0; }
.table-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.table-wrap > table { min-width: 100%; }
.actions { flex-wrap: wrap; white-space: normal; }
.actions form { margin: 0; }
.validation-warning { color: #b45309 !important; font-weight: 700; }

.billing-filter-card { scroll-margin-top: 12px; }
.billing-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.billing-filter-actions { flex-wrap: nowrap; }
.billing-employee-edit {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  scroll-margin-top: 12px;
}
.billing-employee-edit-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.billing-summary-table { min-width: 1160px; }
.selected-billing-row td { background: #eff6ff !important; }
.billing-run-actions { min-width: 170px; }
.billing-run-actions .link-button { white-space: nowrap; }
.billing-detail-table tr[id], .billing-summary-table tr[id] { scroll-margin-top: 16px; }

@media (max-width: 1180px) and (min-width: 921px) {
  .layout { grid-template-columns: 216px minmax(0, 1fr) !important; }
  .sidebar { max-width: 216px !important; padding-left: 12px; padding-right: 12px; }
  .content { padding: 14px !important; }
  .card { padding: 16px; }
  .sidebar-nav .nav-link { padding-left: 9px; padding-right: 9px; }
  .billing-filter-form { grid-template-columns: 1fr 1fr; }
  .billing-filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr) !important; }
  .sidebar {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
  }
  .content { width: auto !important; max-width: 100% !important; padding: 14px !important; }
  .billing-filter-form, .billing-employee-edit-form { grid-template-columns: 1fr; }
  .billing-filter-actions { grid-column: auto; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .content { padding: 10px !important; }
  .card { padding: 14px; }
  .billing-filter-actions .button, .billing-filter-actions a.button { width: 100%; }
}

/* V2.13: Zusatzdienst-Zellen als echte, sicher anklickbare Schaltflächen */
.manual-extra-button {
  width: 100%;
  margin: 0;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}
.manual-extra-button:hover,
.manual-extra-button:focus-visible {
  background: #bae6fd;
  color: #075985;
  outline: 2px solid rgba(14, 116, 144, .45);
  outline-offset: 1px;
}

/* V2.14: kompakte Planerstellung, geöffnete Pläne und getrennte Testumgebung */
.environment-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.environment-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  color: #78350f;
}
.environment-banner strong { white-space: nowrap; }

.generate-card { max-width: 1180px; margin-inline: auto; }
.compact-section-head { align-items: center; margin-bottom: 10px; }
.generate-form { gap: 12px 16px; }
.generate-mode-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 16px;
  align-items: stretch;
}
.manual-plan-choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}
.manual-plan-button { margin-top: 4px; background: #0f766e; color: #fff; border-color: #0f766e; }
.generate-settings-details,
.generate-explanations,
.manual-rule-details,
.lns-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.generate-settings-details > summary,
.generate-explanations > summary,
.manual-rule-details > summary,
.lns-card > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-weight: 900;
  color: var(--text);
}
.generate-settings-details > summary::-webkit-details-marker,
.generate-explanations > summary::-webkit-details-marker,
.manual-rule-details > summary::-webkit-details-marker,
.lns-card > summary::-webkit-details-marker { display: none; }
.generate-settings-details > summary::after,
.generate-explanations > summary::after,
.manual-rule-details > summary::after,
.lns-card > summary::after { content: '▾'; color: var(--muted); }
.generate-settings-details:not([open]) > summary::after,
.generate-explanations:not([open]) > summary::after,
.manual-rule-details:not([open]) > summary::after,
.lns-card:not([open]) > summary::after { content: '▸'; }
.generate-settings-grid { padding: 4px 14px 14px; }
.generate-explanations .rule-box { margin: 0 12px 12px; }
.generate-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.generate-actions { margin-top: 0; }

.optimization-metric strong {
  font-size: clamp(15px, 1.25vw, 22px);
  line-height: 1.15;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.lns-card { padding: 0; }
.lns-card > summary span { color: var(--muted); font-size: 13px; font-weight: 700; }
.lns-card-content { padding: 0 16px 16px; }

.manual-edit-modal-card {
  width: min(680px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  padding: 12px 14px;
  overflow-y: auto;
}
.manual-edit-modal-card .modal-head {
  top: -12px;
  margin: -12px -14px 8px;
  padding: 10px 14px 8px;
}
.manual-edit-modal-card .modal-head h2 { margin-bottom: 1px; }
.manual-edit-modal-card .modal-head .subtitle { margin: 0; font-size: 13px; }
.manual-edit-primary-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(210px, .75fr); gap: 10px; }
.manual-employee-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}
.manual-employee-search label { margin: 0; }
.manual-employee-search input[type="search"] { min-height: 36px; padding-block: 7px; }
.manual-employee-search .hint { padding-bottom: 8px; white-space: nowrap; font-weight: 800; }
.manual-edit-modal-card .form-stack { gap: 7px; }
.manual-edit-modal-card label { gap: 3px; }
.manual-edit-modal-card select,
.manual-edit-modal-card input[type="text"] { min-height: 36px; padding-block: 7px; }
.compact-candidate-hint { max-height: 48px !important; overflow: auto; }
.manual-rule-details { background: #f8fafc; }
.manual-rule-details > summary { padding: 8px 10px; font-size: 13px; }
.manual-rule-overrides { margin: 0; padding: 8px 10px 10px; border: 0; display: grid; gap: 5px; }
.manual-rule-overrides legend { display: none; }
.manual-rule-overrides label { font-size: 13px; }
.manual-emergency-confirm { padding: 8px 10px; }
.manual-modal-actions {
  position: static;
  margin: 2px 0 0;
  padding: 6px 0 0;
  background: none;
  border-top: 0;
}
.manual-delete-form { margin-top: 8px; }
.manual-delete-form .hint { display: none; }
.account-summary { display: grid; gap: 10px; margin: 0; }
.account-summary div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.account-summary dt { color: var(--muted); font-weight: 800; }
.account-summary dd { margin: 0; font-weight: 800; }

@media (max-width: 920px) {
  .generate-mode-row,
  .manual-edit-primary-grid,
  .manual-employee-search,
  .generate-checkbox-grid { grid-template-columns: 1fr; }
  .manual-employee-search .hint { padding-bottom: 0; white-space: normal; }
  .environment-banner { align-items: flex-start; flex-direction: column; gap: 3px; }
}
@media (max-height: 720px) {
  .manual-edit-modal-card { max-height: calc(100vh - 10px); padding: 9px 11px; }
  .manual-edit-modal-card .modal-head { top: -9px; margin: -9px -11px 6px; padding: 8px 11px 6px; }
  .manual-edit-modal-card .form-stack { gap: 5px; }
  .manual-rule-details > summary { padding: 6px 8px; }
  .manual-rule-overrides { padding: 6px 8px 8px; }
}

/* V2.15: E-Mail-Bestätigung, Benachrichtigungseinstellungen und Versandprotokoll */
.mail-status-chip,
.mail-queue-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .28rem .62rem;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.mail-status-chip.verified,
.mail-queue-status.sent { background: #d9f7e7; color: #087044; }
.mail-status-chip.pending,
.mail-queue-status.pending,
.mail-queue-status.retry { background: #fff0c7; color: #8a5a00; }
.mail-status-chip.neutral { background: #edf1f7; color: #526074; }
.mail-queue-status.sending { background: #dbeafe; color: #174ea6; }
.mail-queue-status.failed { background: #fee2e2; color: #a61b1b; }
.mail-master-switch { padding: .9rem 1rem; border: 1px solid #d7e0ec; border-radius: .75rem; background: #f7faff; }
.mail-master-switch span { display: grid; gap: .15rem; }
.mail-master-switch small { color: #667085; font-weight: 400; }
.mail-preference-box { border: 1px solid #d7e0ec; border-radius: .75rem; padding: .8rem 1rem .45rem; display: grid; gap: .55rem; }
.mail-preference-box legend { padding: 0 .4rem; font-weight: 800; }
.mail-verification-note { margin-top: .8rem; }
.mail-admin-top { align-items: start; }
.mail-config-summary dd { overflow-wrap: anywhere; }
.mail-process-form { margin-top: 1rem; }
.mail-log-head { align-items: end; gap: 1rem; }
.mail-log-filter { display: flex; flex-wrap: wrap; gap: .55rem; align-items: end; }
.mail-log-filter select { min-width: 10.5rem; }
.mail-log-filter input { min-width: min(22rem, 50vw); }
.mail-log-table { min-width: 1120px; }
.mail-log-table th:nth-child(1) { width: 145px; }
.mail-log-table th:nth-child(2) { width: 150px; }
.mail-log-table th:nth-child(3) { width: 250px; }
.mail-log-table th:nth-child(5) { width: 135px; }
.mail-log-table th:nth-child(6) { width: 155px; }
.mail-log-table th:nth-child(7) { width: 125px; }
.mail-error-text { display: block; margin-top: .35rem; color: #a61b1b; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-confirmation-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: #eef3f9; }
.mail-confirmation-card { width: min(34rem, 100%); background: white; border-radius: 1rem; box-shadow: 0 18px 55px rgba(16, 37, 66, .14); padding: 2.2rem; text-align: center; }
.mail-confirmation-card .brand-mark { margin: 0 auto 1rem; }
.mail-confirmation-card h1 { margin-bottom: .75rem; }
.mail-confirmation-card p { color: #526074; line-height: 1.6; margin-bottom: 1.4rem; }
.notice.compact ul { margin: .4rem 0 0 1.2rem; }
@media (max-width: 920px) {
  .mail-log-head { align-items: stretch; }
  .mail-log-filter { display: grid; grid-template-columns: 1fr; }
  .mail-log-filter input, .mail-log-filter select { min-width: 0; width: 100%; }
}


/* V2.16: kompakte Stammdatenformulare und abhängige E-Mail-Optionen */
.masterdata-create-layout { grid-template-columns: minmax(0, 1fr) !important; }
.masterdata-create-layout > .card { width: 100%; }
.mail-preference-box { transition: opacity .16s ease, background-color .16s ease, border-color .16s ease; }
.mail-preference-box.is-disabled { opacity: .56; background: #f3f5f8; border-color: #e3e7ed; }
.mail-preference-box.is-disabled .check-row { cursor: not-allowed; }
.mail-preference-guidance { margin: -.15rem 0 .2rem; padding-left: .15rem; }
.mail-preference-guidance[hidden] { display: none !important; }

/* V2.19: Passwort-Self-Service, Rundmails und informative Freigabeprüfung */
.login-help-row { grid-column: 1 / -1; margin-top: -.35rem; }
.login-help-row a { font-weight: 700; color: var(--primary, #1f5fae); text-decoration: none; }
.login-help-row a:hover { text-decoration: underline; }
.password-self-service-card { max-width: 760px; margin-inline: auto; }
.password-help-note { margin-top: 1rem; }
.account-password-note { align-self: stretch; }
.staff-broadcast-card { margin-bottom: 1rem; }
.staff-broadcast-form { align-items: start; }
.staff-audience-fieldset { border: 1px solid var(--border, #d8e0ea); border-radius: 12px; padding: .9rem 1rem; min-width: 0; }
.staff-audience-fieldset legend { font-weight: 800; padding: 0 .3rem; }
.staff-audience-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem 1rem; margin-bottom: .45rem; }
.release-review-grid { align-items: start; }
.release-warning-list { display: grid; gap: .65rem; }
.release-warning-list details { border: 1px solid var(--border, #d8e0ea); border-radius: 10px; padding: .7rem .85rem; background: #fffaf0; }
.release-warning-list summary { cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; }
.release-warning-list ul { margin: .65rem 0 0 1.1rem; }
.release-confirm-card { border-color: #e7b64c; }
.release-acknowledgement { margin-bottom: 1rem; align-items: flex-start; }
@media (max-width: 900px) {
  .staff-audience-options { grid-template-columns: 1fr; }
  .release-review-grid { grid-template-columns: 1fr; }
}

/* V2.20: dynamisches Handbuch und professionelle Videoanleitung */
.documentation-release-card code,
.documentation-empty-state code { overflow-wrap: anywhere; }
.documentation-video-card { display: grid; gap: 1rem; }
.documentation-video-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.documentation-video-head h2 { margin-bottom: .35rem; }
.documentation-video {
  display: block;
  width: 100%;
  max-height: min(72vh, 760px);
  border-radius: 14px;
  background: #0f172a;
  box-shadow: 0 14px 38px rgba(15, 23, 42, .18);
}
.documentation-empty-state {
  display: grid;
  gap: .4rem;
  min-height: 130px;
  align-content: center;
  justify-items: start;
  padding: 1.25rem;
  border: 1px dashed #b8c5d6;
  border-radius: 12px;
  background: #f7f9fc;
  color: #526074;
}
.documentation-empty-state strong { color: #172033; font-size: 1.05rem; }
@media (max-width: 760px) {
  .documentation-video-head { flex-direction: column; }
  .documentation-video-head .button { width: 100%; text-align: center; }
}

/* V2.20 Dokumentationszentrale: HTML/PDF, Upload, Versionierung, Rückfall und Rollen */
.documentation-center-hero,
.documentation-current-card,
.documentation-format-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.documentation-center-hero > div:first-child,
.documentation-current-card > div:first-child,
.documentation-format-card > div:first-child { min-width: 0; }
.documentation-center-hero h2,
.documentation-current-card h2,
.documentation-format-card h2 { margin-bottom: .45rem; }
.documentation-center-hero p,
.documentation-current-card p,
.documentation-format-card p { max-width: 78ch; line-height: 1.65; }
.documentation-release-head,
.documentation-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
}
.documentation-release-head > div:first-child,
.documentation-section-head > div:first-child { min-width: 0; }
.documentation-chip-row,
.documentation-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .7rem;
}
.documentation-file-chips { margin: .55rem 0 0; }
.documentation-file-chips span {
  display: inline-flex;
  border-radius: 999px;
  padding: .2rem .5rem;
  background: #e8eef7;
  color: #315274;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .03em;
}
.documentation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: flex-end;
}
.documentation-html-card { display: grid; gap: 1rem; }
.documentation-html-frame {
  width: 100%;
  min-height: 68vh;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 10px 28px rgba(15,23,42,.08);
}
.documentation-version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .9rem;
}
.documentation-version-item {
  display: grid;
  gap: .35rem;
  padding: 1rem;
  border: 1px solid #d7e0eb;
  border-radius: 13px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.documentation-version-item:hover,
.documentation-version-item:focus-visible {
  transform: translateY(-1px);
  border-color: #7aa2d6;
  box-shadow: 0 9px 24px rgba(28,72,120,.12);
}
.documentation-version-number { color: var(--primary); font-weight: 900; }
.documentation-version-item span:not(.documentation-version-number),
.documentation-version-item small { color: #64748b; }
.documentation-upload-form { align-items: start; }
.documentation-upload-form input[type="file"] { padding: .65rem; background: #f8fafc; }
.documentation-publish-now { align-self: end; min-height: 46px; }
.documentation-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.documentation-channel-card { display: grid; align-content: start; gap: .65rem; }
.documentation-channel-card h3 { margin: 0; }
.documentation-channel-card .button { justify-self: start; margin-top: .25rem; }
.documentation-empty-inline {
  padding: .8rem;
  border-radius: 10px;
  background: #f5f7fa;
  color: #64748b;
  line-height: 1.5;
}
.documentation-release-table th:nth-child(1) { width: 9%; }
.documentation-release-table th:nth-child(3) { width: 15%; }
.documentation-release-table th:nth-child(4) { width: 11%; }
.documentation-release-table th:nth-child(5) { width: 12%; }
.documentation-release-table th:nth-child(6) { width: 22%; }
.documentation-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.documentation-table-actions form { margin: 0; }
.documentation-table-actions .button { padding: .48rem .65rem; border-radius: 9px; font-size: .82rem; }
.documentation-legacy-notice code { overflow-wrap: anywhere; }
@media (max-width: 1050px) {
  .documentation-channel-grid { grid-template-columns: 1fr; }
  .documentation-center-hero,
  .documentation-current-card,
  .documentation-format-card,
  .documentation-release-head,
  .documentation-section-head { flex-direction: column; }
  .documentation-actions { justify-content: flex-start; }
  .documentation-release-table { min-width: 1050px; }
}
@media (max-width: 760px) {
  .documentation-html-frame { min-height: 72vh; }
  .documentation-actions,
  .documentation-actions .button { width: 100%; }
}

/* V2.20.4: verdichtete Planansicht, feste Schnellnavigation und Monatsansicht per Mitarbeiterklick */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.print-only { display: none !important; }
.plan-detail-page .plan-summary-strip {
  display: grid;
  grid-template-columns: repeat(11, minmax(92px, 1fr));
  gap: 5px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.plan-summary-strip .metric {
  min-width: 92px;
  height: 40px;
  min-height: 40px;
  padding: 4px 6px;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .055);
  display: grid;
  align-content: center;
  overflow: hidden;
}
.plan-summary-strip .metric > span:first-child {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 7px;
  line-height: 1;
  letter-spacing: .045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-summary-strip .metric > strong,
.plan-summary-strip .optimization-metric > strong {
  display: block;
  min-width: 0;
  max-height: 23px;
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.03;
  letter-spacing: -.015em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-summary-strip .optimization-metric > strong { font-size: 9px; line-height: 1.08; }
.plan-summary-strip .metric .hint {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.plan-top-jump {
  position: sticky;
  top: 8px;
  z-index: 70;
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .14);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.plan-jump-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 520px);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plan-jump-bar > strong { font-size: 13px; white-space: nowrap; }
.plan-jump-bar label { margin: 0; }
.plan-jump-bar select {
  min-height: 32px;
  padding: 5px 34px 5px 9px;
  border-radius: 9px;
  font-size: 12px;
}
.plan-detail-page .roster-table thead th { top: 54px; }
.plan-detail-page .target-group-card,
.plan-detail-page #versorgungseinheiten-dienstplankarten,
.plan-detail-page #mitarbeiter-monatsplan,
.plan-detail-page #mitarbeiter-dienstplankarten { scroll-margin-top: 62px; }
.target-roster-overview {
  padding: 8px 10px 10px;
}
.target-roster-overview .compact-section-head {
  min-height: 24px;
  margin-bottom: 3px;
  gap: 8px;
}
.target-roster-overview .compact-section-head h2 {
  margin: 0;
  font-size: 15px;
}
.target-roster-overview .compact-section-head .badge {
  padding: 2px 7px;
  font-size: 9px;
}
.compact-plan-legend {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, minmax(0, auto));
  grid-auto-columns: max-content;
  align-items: center;
  justify-content: start;
  gap: 3px 5px;
  max-width: 100%;
  margin: 2px 0 7px;
  padding: 0 0 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.compact-plan-legend .legend-item {
  min-height: 18px;
  padding: 1px 5px;
  gap: 3px;
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
}
.compact-plan-legend .legend-item strong {
  min-width: 17px;
  padding: 1px 4px;
}
.target-roster-overview .target-group-stack { gap: 8px; }
.target-roster-overview .month-card-head.compact-head {
  min-height: 31px;
  padding: 4px 8px;
  align-items: center;
  gap: 8px;
}
.target-roster-overview .month-card-head.compact-head > div { min-width: 0; }
.target-roster-overview .month-card-head.compact-head h3 {
  margin: 0 0 1px;
  font-size: 13px;
  line-height: 1.05;
}
.target-roster-overview .month-card-head.compact-head p {
  max-width: 100%;
  margin: 0;
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.target-roster-overview .month-card-head.compact-head .badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  font-size: 9px;
}
.employee-month-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.employee-month-trigger strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.employee-month-trigger-icon {
  display: inline !important;
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 10px !important;
  font-weight: 900;
  line-height: 1;
}
.employee-month-trigger:hover strong,
.employee-month-trigger:focus-visible strong { color: var(--primary); text-decoration: underline; }
.employee-month-trigger:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; border-radius: 3px; }
.care-unit-employee-cell .employee-month-trigger,
.care-unit-employee-cell .employee-month-trigger strong,
.care-unit-employee-cell .employee-month-trigger span { display: inline-flex; }
.employee-month-modal-open { overflow: hidden; }
.employee-month-modal-backdrop { padding: 12px; }
.employee-month-modal-card {
  width: min(1450px, calc(100vw - 24px));
  height: min(760px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.employee-month-modal-card .modal-head {
  margin: 0;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.employee-month-modal-card .modal-head h2 { margin: 0 0 2px; font-size: 18px; }
.employee-month-modal-card .modal-head .subtitle { font-size: 12px; }
.employee-month-modal-hint {
  margin: 0;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  background: #eff6ff;
  color: #334155;
  font-size: 11px;
  line-height: 1.35;
}
.employee-month-modal-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
  overscroll-behavior: contain;
}
.employee-month-modal-table {
  min-width: 1280px;
  width: 100%;
  table-layout: fixed;
  margin: 0;
}
.plan-detail-page .employee-month-modal-table thead th { top: 0; }
.employee-month-modal-table tbody tr { display: table-row !important; }
.employee-month-modal-table .roster-cell { height: 54px; }
.employee-month-modal-table .employee-cell { min-width: 190px; }
@media (max-width: 1000px) {
  .plan-detail-page .plan-summary-strip { grid-template-columns: repeat(11, minmax(96px, 1fr)); }
  .plan-top-jump { top: 4px; }
  .plan-jump-bar { grid-template-columns: 1fr; gap: 4px; }
  .plan-jump-bar > strong { display: none; }
  .plan-detail-page .roster-table thead th { top: 49px; }
  .target-roster-overview .month-card-head.compact-head { flex-direction: row; }
  .employee-month-modal-backdrop { padding: 5px; align-items: center; }
  .employee-month-modal-card {
    width: calc(100vw - 10px);
    height: calc(100vh - 10px);
    max-height: calc(100vh - 10px);
    border-radius: 12px;
  }
}
@media print {
  .print-only { display: block !important; }
  .plan-summary-strip .metric { height: auto; min-height: 0; }
  .plan-detail-page .roster-table thead th { top: 0; }
}
.content.plan-detail-content { overflow-x: visible !important; }
html.plan-detail-document,
body.plan-detail-body { overflow-x: visible !important; }
.employee-month-modal-card {
  height: auto;
  max-height: calc(100vh - 24px);
  grid-template-rows: auto auto minmax(0, auto);
}
.employee-month-modal-scroll { max-height: calc(100vh - 150px); }
@media (max-width: 1000px) {
  .employee-month-modal-card { height: auto; max-height: calc(100vh - 10px); }
  .employee-month-modal-scroll { max-height: calc(100vh - 132px); }
}

/* V2.20.5: Einzelversorgungs-Arbeitsansicht fuer die manuelle Nachbesetzung */
.target-group-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.target-group-head-actions .button.compact,
.care-editor-commandbar .button.compact,
.care-editor-action-cell .button.compact {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.1;
}
.care-editor-link { white-space: nowrap; }
.care-editor-document,
.care-editor-body { overflow: hidden; }
.care-editor-content {
  min-width: 0;
  height: calc(100vh - 84px);
  overflow: hidden;
  padding-bottom: 8px;
}
.care-editor-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  height: 100%;
}
.care-editor-commandbar {
  position: relative;
  z-index: 80;
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 6px 9px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15,23,42,.09);
}
.care-editor-commandbar-main,
.care-editor-focusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.care-editor-title-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.care-editor-title-block strong {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.care-editor-title-block span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.care-editor-command-status { display: flex; gap: 5px; align-items: center; }
.care-editor-focusbar {
  padding-top: 5px;
  border-top: 1px solid #e2e8f0;
}
.care-editor-focusbar > div:first-child { min-width: 0; }
.care-editor-focusbar strong {
  display: block;
  max-width: 72vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.care-editor-focusbar .hint { display: block; margin-top: 1px; font-size: 9px; }
.care-editor-focus-label {
  display: block;
  color: var(--primary);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.care-editor-workspace {
  display: grid;
  grid-template-rows: minmax(235px, 39%) minmax(300px, 61%);
  gap: 7px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.care-editor-care-pane,
.care-editor-employee-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}
.care-editor-care-pane { grid-template-rows: auto minmax(0,1fr); }
.care-editor-employee-pane { grid-template-rows: auto auto minmax(0,1fr); }
.care-editor-pane-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 4px 8px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.care-editor-pane-head > div:first-child { min-width: 0; }
.care-editor-pane-head h2,
.care-editor-employee-title h2 { margin: 0; font-size: 13px; line-height: 1.05; }
.care-editor-pane-head p { margin: 1px 0 0; color: var(--muted); font-size: 9px; line-height: 1.1; }
.care-editor-collapsible { position: relative; flex: 0 0 auto; }
.care-editor-collapsible > summary {
  cursor: pointer;
  list-style: none;
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.care-editor-collapsible > summary::-webkit-details-marker { display: none; }
.care-editor-collapsible[open] > summary { border-color: #7aa2d6; background: #eff6ff; }
.care-editor-collapsible[open] {
  position: absolute;
  right: 8px;
  top: 35px;
  z-index: 120;
  width: min(780px, calc(100vw - 290px));
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15,23,42,.18);
}
.care-editor-collapsible[open] > summary { display: inline-flex; margin-left: auto; }
.care-editor-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 7px 0;
  color: #475569;
  font-size: 9px;
}
.care-editor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0;
}
.care-editor-legend .legend-item { min-height: 18px; padding: 2px 5px; font-size: 8px; }
.care-editor-table-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.care-editor-care-scroll { background: #fff; }
.care-editor-care-table,
.care-editor-employee-table { min-width: 1280px; margin: 0; }
.care-editor-care-table thead th,
.care-editor-employee-table thead th {
  position: sticky;
  top: 0;
  z-index: 18;
}
.care-editor-care-table thead tr:nth-child(2) th,
.care-editor-employee-table thead tr:nth-child(2) th { top: 21px; }
.care-editor-care-table th,
.care-editor-care-table td,
.care-editor-employee-table th,
.care-editor-employee-table td { padding-top: 2px; padding-bottom: 2px; }
.care-editor-service-button {
  appearance: none;
  width: 100%;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.care-editor-service-button:hover,
.care-editor-service-button:focus-visible {
  transform: translateY(-1px);
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.16);
  outline: none;
}
.care-editor-service-button.is-selected {
  border-color: #0f4c81;
  box-shadow: 0 0 0 3px rgba(15,76,129,.24), 0 5px 14px rgba(15,23,42,.16);
  transform: translateY(-1px) scale(1.03);
  position: relative;
  z-index: 5;
}
.care-editor-employee-controls {
  position: relative;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(230px, 1.35fr) minmax(150px, .7fr) minmax(130px, .55fr) auto;
  gap: 6px;
  align-items: end;
  min-height: 45px;
  padding: 4px 8px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.care-editor-employee-title { align-self: center; min-width: 0; }
.care-editor-employee-title .hint { display: block; margin-top: 2px; font-size: 9px; }
.care-editor-employee-controls label { margin: 0; font-size: 8px; font-weight: 800; color: #475569; }
.care-editor-employee-controls input,
.care-editor-employee-controls select {
  min-height: 27px;
  margin-top: 2px;
  padding: 4px 26px 4px 7px;
  border-radius: 8px;
  font-size: 10px;
}
.care-editor-employee-controls .care-editor-collapsible[open] {
  top: 45px;
  right: 8px;
}
.care-editor-availability-summary {
  min-height: 24px;
  padding: 4px 8px;
  border-bottom: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a5f;
  font-size: 9px;
  line-height: 1.45;
}
.care-editor-employee-table .sticky-col { position: sticky; z-index: 22; background: #fff; }
.care-editor-employee-table thead .sticky-col { z-index: 45; }
.care-editor-employee-table .employee-head,
.care-editor-employee-table tbody td:first-child { left: 0; width: 154px; min-width: 154px; max-width: 154px; }
.care-editor-employee-table .care-editor-availability-head,
.care-editor-employee-table .care-editor-availability-cell { left: 154px; width: 170px; min-width: 170px; max-width: 170px; }
.care-editor-employee-table .care-editor-action-head,
.care-editor-employee-table .care-editor-action-cell { left: 324px; width: 78px; min-width: 78px; max-width: 78px; }
.care-editor-availability-cell { vertical-align: middle; }
.care-editor-availability-cell .badge { display: inline-flex; font-size: 8px; padding: 2px 5px; }
.care-editor-reason {
  display: block;
  margin-top: 2px;
  max-height: 27px;
  overflow: hidden;
  color: #64748b;
  font-size: 7.5px;
  line-height: 1.15;
}
.care-editor-employee-row.availability-regular .care-editor-availability-cell { background: #ecfdf5; }
.care-editor-employee-row.availability-emergency .care-editor-availability-cell { background: #fff7ed; }
.care-editor-employee-row.availability-unavailable .care-editor-availability-cell { background: #fef2f2; }
.care-editor-employee-row.availability-pending .care-editor-availability-cell { background: #f8fafc; }
.care-editor-employee-row[hidden] { display: none !important; }
.care-editor-action-cell .button { width: 100%; }
.care-editor-manual-modal { max-height: min(760px, 92vh); overflow-y: auto; }
/* V2.20.6: Kalenderachsen exakt koppeln und Mitarbeiterzeilen verdichten */
.care-editor-page {
  --care-editor-axis-width: 520px;
  --care-editor-day-min-width: 21px;
  --care-editor-table-min-width: max(1180px, calc(var(--care-editor-axis-width) + (var(--care-editor-day-count) * var(--care-editor-day-min-width))));
}
.care-editor-workspace {
  grid-template-rows: minmax(210px, 35%) minmax(330px, 65%);
}
.care-editor-pane-head {
  min-height: 29px;
  padding: 3px 7px;
}
.care-editor-pane-head h2,
.care-editor-employee-title h2 { font-size: 12px; }
.care-editor-pane-head p { font-size: 8px; }
.care-editor-table-scroll {
  scrollbar-gutter: stable;
}
.care-editor-care-table,
.care-editor-employee-table {
  width: 100%;
  min-width: var(--care-editor-table-min-width);
  max-width: none;
  table-layout: fixed;
}
.care-editor-care-table col.care-axis-top-name { width: 145px; }
.care-editor-care-table col.care-axis-top-services { width: 55px; }
.care-editor-care-table col.care-axis-top-hours { width: 50px; }
.care-editor-care-table col.care-axis-top-capacity { width: 90px; }
.care-editor-care-table col.care-axis-top-status { width: 120px; }
.care-editor-care-table col.care-axis-top-tn { width: 60px; }
.care-editor-employee-table col.care-axis-employee-name { width: 145px; }
.care-editor-employee-table col.care-axis-availability { width: 120px; }
.care-editor-employee-table col.care-axis-action { width: 65px; }
.care-editor-employee-table col.care-axis-capacity { width: 50px; }
.care-editor-employee-table col.care-axis-services { width: 48px; }
.care-editor-employee-table col.care-axis-istplan { width: 55px; }
.care-editor-employee-table col.care-axis-tn { width: 37px; }
.care-editor-care-table col.care-day-col,
.care-editor-employee-table col.care-day-col { width: auto; }
.care-editor-care-table .group-employee-head,
.care-editor-care-table .group-employee-cell { width: 145px; }
.care-editor-care-table .group-col-services { width: 55px; }
.care-editor-care-table .group-col-hours { width: 50px; }
.care-editor-care-table .group-col-capacity { width: 90px; }
.care-editor-care-table .group-col-status { width: 120px; }
.care-editor-care-table .group-col-tn { width: 60px; }
.care-editor-care-table thead th,
.care-editor-employee-table thead th {
  height: 18px;
  padding: 1px 2px;
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
}
.care-editor-care-table thead tr:nth-child(2) th,
.care-editor-employee-table thead tr:nth-child(2) th { top: 18px; }
.care-editor-care-table .roster-cell,
.care-editor-employee-table .roster-cell {
  height: 31px;
  padding: 1px;
}
.care-editor-care-table .cell-service,
.care-editor-employee-table .cell-service {
  min-height: 21px;
  padding: 1px;
  border-radius: 4px;
  line-height: 1;
}
.care-editor-care-table .cell-service strong,
.care-editor-employee-table .cell-service strong { font-size: 8px; }
.care-editor-care-table .cell-service small,
.care-editor-employee-table .cell-service small {
  margin-top: 1px;
  font-size: 6px;
  line-height: 1;
}
.care-editor-employee-controls {
  min-height: 39px;
  padding: 3px 7px;
}
.care-editor-employee-controls input,
.care-editor-employee-controls select {
  min-height: 24px;
  margin-top: 1px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 9px;
}
.care-editor-availability-summary {
  min-height: 19px;
  padding: 2px 7px;
  font-size: 8px;
  line-height: 1.35;
}
.care-editor-employee-table .employee-head,
.care-editor-employee-table tbody td:first-child {
  left: 0;
  width: 145px;
  min-width: 145px;
  max-width: 145px;
}
.care-editor-employee-table .care-editor-availability-head,
.care-editor-employee-table .care-editor-availability-cell {
  left: 145px;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}
.care-editor-employee-table .care-editor-action-head,
.care-editor-employee-table .care-editor-action-cell {
  left: 265px;
  width: 65px;
  min-width: 65px;
  max-width: 65px;
}
.care-editor-employee-table tbody tr { height: 33px; }
.care-editor-employee-table tbody td {
  height: 33px;
  max-height: 33px;
  padding: 1px 2px;
  overflow: hidden;
  line-height: 1;
  white-space: nowrap;
}
.care-editor-compact-employee strong {
  display: inline-block;
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  font-size: 9px;
}
.care-editor-compact-employee .hint {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 7px;
  line-height: 1;
}
.care-editor-springer-badge {
  min-width: 15px;
  padding: 1px 4px;
  font-size: 7px;
  vertical-align: middle;
}
.care-editor-availability-cell {
  vertical-align: middle;
  white-space: normal !important;
}
.care-editor-availability-cell .badge {
  display: inline-flex;
  max-width: 112px;
  padding: 1px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7px;
}
.care-editor-reason {
  display: block;
  max-width: 112px;
  max-height: none;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 6.5px;
  line-height: 1;
}
.care-editor-action-cell .button {
  min-height: 22px;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 8px;
}
.care-editor-compact-summary {
  padding-left: 1px !important;
  padding-right: 1px !important;
  font-size: 7.5px;
  white-space: nowrap;
}
.care-editor-compact-summary strong { font-size: 7.5px; }
.care-editor-compact-summary .badge {
  max-width: 100%;
  padding: 1px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 7px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .care-editor-content { height: calc(100vh - 74px); }
  .care-editor-title-block span { display: none; }
  .care-editor-command-status .badge.soft { display: none; }
  .care-editor-employee-controls {
    grid-template-columns: minmax(150px, .8fr) minmax(200px, 1.3fr) minmax(135px, .7fr) minmax(115px, .55fr) auto;
  }
  .care-editor-collapsible[open] { width: calc(100vw - 245px); }
}
@media (max-width: 900px) {
  .care-editor-document,
  .care-editor-body { overflow: auto; }
  .care-editor-content { height: auto; overflow: visible; }
  .care-editor-page { height: auto; }
  .care-editor-workspace { grid-template-rows: auto auto; overflow: visible; }
  .care-editor-care-pane { height: 44vh; min-height: 330px; }
  .care-editor-employee-pane { height: 62vh; min-height: 430px; }
  .care-editor-commandbar-main,
  .care-editor-focusbar { align-items: flex-start; flex-wrap: wrap; }
  .care-editor-employee-controls { grid-template-columns: 1fr 1fr; }
  .care-editor-employee-title { grid-column: 1 / -1; }
  .care-editor-collapsible[open] { position: fixed; top: 90px; left: 12px; right: 12px; width: auto; }
}
@media print {
  .care-editor-commandbar,
  .care-editor-employee-controls,
  .care-editor-availability-summary,
  .care-editor-action-head,
  .care-editor-action-cell { display: none !important; }
  .care-editor-document,
  .care-editor-body,
  .care-editor-content { overflow: visible !important; height: auto !important; }
  .care-editor-page,
  .care-editor-workspace,
  .care-editor-care-pane,
  .care-editor-employee-pane { display: block !important; height: auto !important; overflow: visible !important; }
  .care-editor-table-scroll { overflow: visible !important; }
}

/* V2.21.1: Einzelversorgung - Versorgungsplan vertikal priorisieren, Kopf und Mitarbeiterbereich weiter verdichten */
@media screen and (min-width: 901px) {
  .care-editor-content {
    display: flex !important;
    flex-direction: column;
    height: 100vh !important;
    max-height: 100vh;
    padding-top: 10px !important;
    padding-bottom: 7px !important;
    overflow: hidden !important;
  }
  .care-editor-content > .topbar {
    flex: 0 0 auto;
    min-height: 0;
    margin: 0 0 5px;
  }
  .care-editor-content > .topbar h1 {
    margin: 0;
    font-size: 19px;
    line-height: 1.05;
    letter-spacing: -.025em;
  }
  .care-editor-content > .topbar .subtitle { display: none; }
  .care-editor-content > .environment-banner {
    flex: 0 0 auto;
    min-height: 0;
    margin: 0 0 5px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 9px;
    line-height: 1.15;
  }
  .care-editor-content > .planning-readonly-banner,
  .care-editor-content > .flash-wrap {
    flex: 0 0 auto;
    margin-bottom: 5px;
  }
  .care-editor-page {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    gap: 4px;
  }
  .care-editor-commandbar {
    gap: 2px;
    padding: 3px 6px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(15,23,42,.07);
  }
  .care-editor-commandbar-main,
  .care-editor-focusbar { gap: 6px; }
  .care-editor-commandbar .button.compact,
  .care-editor-action-cell .button.compact {
    min-height: 23px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 8.5px;
  }
  .care-editor-title-block { gap: 5px; }
  .care-editor-title-block strong {
    max-width: 34vw;
    font-size: 11px;
    line-height: 1;
  }
  .care-editor-title-block span {
    font-size: 8px;
    line-height: 1;
  }
  .care-editor-command-status { gap: 3px; }
  .care-editor-command-status .badge {
    padding: 2px 5px;
    font-size: 8px;
    line-height: 1.05;
  }
  .care-editor-focusbar {
    min-height: 22px;
    padding-top: 2px;
  }
  .care-editor-focus-label { font-size: 6.5px; line-height: 1; }
  .care-editor-focusbar strong {
    max-width: 67vw;
    font-size: 9.5px;
    line-height: 1.05;
  }
  .care-editor-focusbar .hint { display: none; }

  .care-editor-workspace {
    grid-template-rows: minmax(0, var(--care-editor-care-height, 69%)) minmax(148px, 1fr);
    gap: 4px;
  }
  .care-editor-care-pane,
  .care-editor-employee-pane { border-radius: 8px; }
  .care-editor-pane-head {
    min-height: 24px;
    padding: 2px 6px;
    gap: 5px;
  }
  .care-editor-pane-head h2,
  .care-editor-employee-title h2 {
    font-size: 10.5px;
    line-height: 1;
  }
  .care-editor-pane-head p {
    margin-top: 0;
    font-size: 7px;
    line-height: 1;
  }
  .care-editor-collapsible > summary {
    min-height: 21px;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 7.5px;
    line-height: 1;
  }
  .care-editor-collapsible[open] { top: 25px; }

  .care-editor-care-table thead th,
  .care-editor-employee-table thead th {
    height: 16px;
    padding: 1px;
    font-size: 7.5px;
  }
  .care-editor-care-table thead tr:nth-child(2) th,
  .care-editor-employee-table thead tr:nth-child(2) th { top: 16px; }
  .care-editor-care-table .roster-cell {
    height: 28px;
    padding: 1px;
  }
  .care-editor-care-table .cell-service {
    min-height: 19px;
    padding: 1px;
  }
  .care-editor-care-table .cell-service strong { font-size: 7.5px; }
  .care-editor-care-table .cell-service small { font-size: 5.7px; }
  .care-editor-care-table .group-employee-cell,
  .care-editor-care-table .summary-cell {
    padding-top: 1px;
    padding-bottom: 1px;
    font-size: 8px;
    line-height: 1.05;
  }
  .care-editor-care-table .group-employee-cell strong { font-size: 8.5px; }
  .care-editor-care-table .group-employee-cell .hint { font-size: 6.5px; }

  .care-editor-employee-controls {
    grid-template-columns: minmax(135px, .62fr) minmax(190px, 1.18fr) minmax(125px, .58fr) minmax(105px, .48fr) auto;
    gap: 4px;
    min-height: 32px;
    padding: 2px 6px;
    align-items: center;
  }
  .care-editor-employee-title .hint {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 7px;
  }
  .care-editor-employee-controls label {
    gap: 1px;
    font-size: 6.8px;
    line-height: 1;
  }
  .care-editor-employee-controls input,
  .care-editor-employee-controls select {
    min-height: 21px;
    height: 21px;
    margin-top: 0;
    padding: 1px 22px 1px 5px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1;
  }
  .care-editor-employee-controls .care-editor-collapsible[open] { top: 32px; }
  .care-editor-availability-summary {
    min-height: 16px;
    max-height: 16px;
    padding: 2px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 7px;
    line-height: 1.1;
  }
  .care-editor-employee-table tbody tr { height: 27px; }
  .care-editor-employee-table tbody td {
    height: 27px;
    max-height: 27px;
    padding: 1px;
  }
  .care-editor-employee-table .roster-cell { height: 27px; }
  .care-editor-employee-table .cell-service {
    min-height: 18px;
    padding: 0 1px;
  }
  .care-editor-employee-table .cell-service strong { font-size: 7px; }
  .care-editor-employee-table .cell-service small { font-size: 5.4px; }
  .care-editor-compact-employee strong { font-size: 8px; }
  .care-editor-compact-employee .hint { font-size: 6px; }
  .care-editor-availability-cell .badge { font-size: 6.5px; }
  .care-editor-reason { font-size: 5.8px; }
  .care-editor-action-cell .button {
    min-height: 19px;
    padding: 1px 3px;
    font-size: 7px;
  }
  .care-editor-compact-summary,
  .care-editor-compact-summary strong { font-size: 6.7px; }
  .care-editor-compact-summary .badge { font-size: 6.2px; }
}

@media screen and (min-width: 901px) and (max-height: 820px) {
  .care-editor-content { padding-top: 6px !important; padding-bottom: 5px !important; }
  .care-editor-content > .topbar { margin-bottom: 3px; }
  .care-editor-content > .topbar h1 { font-size: 16px; }
  .care-editor-commandbar { padding-top: 2px; padding-bottom: 2px; }
  .care-editor-workspace { grid-template-rows: minmax(0, var(--care-editor-care-height, 72%)) minmax(132px, 1fr); }
  .care-editor-employee-controls { min-height: 29px; }
}


/* V2.21.2 - kontrollierbare Rechtstext-Entwuerfe */
.app-legal-footer {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  margin: 28px 0 4px; padding: 14px 10px 4px; color: #667085; font-size: 12px;
}
.app-legal-footer a { color: #475467; text-decoration: none; }
.app-legal-footer a:hover { color: #1f5fbf; text-decoration: underline; }
.legal-draft-pill {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 7px;
  background: #fff3cd; color: #8a5a00; border: 1px solid #f1d58a;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.nav-link small { font-size: 9px; opacity: .75; }
.legal-public-body {
  min-height: 100vh; margin: 0; background: #f4f6f9; color: #182230;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.legal-public-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; padding: 16px max(24px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid #d9e0e8; background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
}
.legal-public-brand { display: flex; flex-direction: column; gap: 2px; }
.legal-public-brand strong { font-size: 18px; }
.legal-public-brand span { color: #667085; font-size: 12px; }
.legal-public-header nav { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-public-header nav a {
  padding: 8px 11px; border-radius: 8px; color: #344054; text-decoration: none; font-size: 13px; font-weight: 700;
}
.legal-public-header nav a:hover, .legal-public-header nav a.active { background: #eaf1fb; color: #174f9b; }
.legal-public-main { width: min(1040px, calc(100% - 32px)); margin: 28px auto 42px; }
.legal-preview-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 16px; padding: 12px 14px; border: 1px solid #e7b354; border-radius: 12px; background: #fff8e8;
}
.legal-preview-banner > div { display: flex; flex-direction: column; gap: 2px; }
.legal-preview-banner strong { color: #8a4f00; }
.legal-preview-banner span { color: #7a5a28; font-size: 12px; }
.legal-document {
  background: #fff; border: 1px solid #e1e6ed; border-radius: 16px;
  padding: clamp(22px, 4vw, 46px); box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}
.legal-document-head { padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid #e6eaf0; }
.legal-document-head h1 { margin: 3px 0 8px; font-size: clamp(28px, 4vw, 40px); }
.legal-document-head p:last-child { margin-bottom: 0; color: #667085; }
.legal-eyebrow { margin: 0; color: #1f5fbf !important; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.legal-document section { margin: 0 0 24px; }
.legal-document h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.legal-document p, .legal-document li { font-size: 14px; line-height: 1.65; color: #344054; }
.legal-document a { color: #175ca8; }
.legal-version-note { margin-top: 34px; padding-top: 16px; border-top: 1px solid #e6eaf0; color: #667085 !important; font-size: 12px !important; }
.legal-public-footer { display: flex; justify-content: center; gap: 16px; padding: 20px; color: #667085; font-size: 12px; }
.legal-review-card { border-top: 4px solid #e7b354; }
.legal-review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.legal-review-head h2 { margin: 8px 0 4px; }
.legal-status-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.legal-preview-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.legal-company-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.legal-company-summary > div { min-width: 0; padding: 10px 12px; border-radius: 9px; background: #f7f9fc; border: 1px solid #e6eaf0; }
.legal-company-summary span { display: block; margin-bottom: 3px; color: #667085; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.legal-company-summary strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.legal-review-list { display: grid; gap: 9px; }
.legal-review-item { padding: 12px 14px; border-radius: 10px; border: 1px solid #e5e9ef; background: #f8fafc; }
.legal-review-item.review { border-left: 4px solid #e0a12f; }
.legal-review-item.blocking { border-left: 4px solid #cf3f3f; background: #fff4f4; }
.legal-review-item strong { font-size: 13px; }
.legal-review-item p { margin: 4px 0 0; color: #667085; font-size: 12px; line-height: 1.5; }
.legal-config-example { overflow-x: auto; padding: 12px 14px; border-radius: 9px; background: #111827; color: #e5e7eb; font-size: 12px; }
@media (max-width: 760px) {
  .legal-public-header { position: static; align-items: flex-start; flex-direction: column; }
  .legal-public-main { width: min(100% - 20px, 1040px); margin-top: 12px; }
  .legal-preview-banner, .legal-review-head { align-items: stretch; flex-direction: column; }
  .legal-status-stack { align-items: flex-start; text-align: left; }
  .legal-company-summary { grid-template-columns: 1fr; }
  .legal-document { padding: 20px 17px; }
}

/* V2.21.3 - veröffentlichte Rechtstexte auf Login und in der Anwendung */
.app-legal-footer { flex-wrap: wrap; }
.legal-published-pill {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px;
  background: #e7f7ee; color: #17653a; border: 1px solid #b8e2c9;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.legal-review-card-published { border-top-color: #42a66c; }

/* V2.22.5 - scrollbare Versorgungen, schliessbare Legenden und stabile Arbeitsflaechen */
.plan-detail-page .target-group-roster-scroll {
  max-height: min(72vh, 760px);
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.plan-detail-page .target-group-roster-scroll:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
}
.plan-detail-page .target-group-roster-scroll .roster-table thead th {
  top: 0 !important;
  z-index: 12;
}
.plan-detail-page .target-group-roster-scroll .roster-table thead tr:nth-child(2) th {
  top: 21px !important;
}
.plan-detail-page .target-group-card {
  scroll-margin-top: 64px;
}

/* Das summary bleibt an seinem Platz. Nur der Inhalt wird als Popover geoeffnet.
   Dadurch bleibt derselbe Schalter jederzeit sichtbar und kann die Legende wieder
   schliessen. Ein zusaetzlicher Schliessen-Knopf dient Maus und Tastatur. */
.care-editor-collapsible[open] {
  position: relative;
  inset: auto;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.care-editor-collapsible[open] > summary {
  display: inline-flex;
  margin: 0;
}
.care-editor-popover {
  display: none;
}
.care-editor-collapsible[open] > .care-editor-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 180;
  display: block;
  width: min(780px, calc(100vw - 285px));
  max-height: min(320px, 48vh);
  padding: 8px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .20);
}
.care-editor-popover-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 5px;
}
.care-editor-popover-actions .button {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 9px;
}
.care-editor-employee-controls .employee-legend-details[open] > .care-editor-popover {
  right: 0;
  width: min(900px, calc(100vw - 285px));
}
@media (max-width: 900px) {
  .plan-detail-page .target-group-roster-scroll { max-height: 68vh; }
  .care-editor-collapsible[open] > .care-editor-popover,
  .care-editor-employee-controls .employee-legend-details[open] > .care-editor-popover {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 72px;
    width: auto;
    max-height: calc(100vh - 90px);
  }
}

@media print {
  .plan-detail-page .target-group-roster-scroll {
    max-height: none !important;
    overflow: visible !important;
    scrollbar-gutter: auto;
    border-top: 0;
  }
}

/* V2.22.6 - 25/75-Versorgungsraster, kompakte Regelmasken und lesbares Änderungsprotokoll */
.plan-detail-page .target-group-roster-scroll .grouped-roster {
  table-layout: fixed;
  width: 100%;
}
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-employee-head,
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-employee-cell { width: 10%; }
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-col-services { width: 3%; }
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-col-hours { width: 3%; }
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-col-capacity { width: 4%; }
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-col-status { width: 3%; }
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-col-tn { width: 2%; }
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-employee-cell,
.plan-detail-page .target-group-roster-scroll .grouped-roster .summary-cell {
  padding-left: 2px;
  padding-right: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-employee-cell strong,
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-employee-cell .hint,
.plan-detail-page .target-group-roster-scroll .grouped-roster .summary-cell .hint,
.plan-detail-page .target-group-roster-scroll .grouped-roster .summary-cell .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-detail-page .target-group-roster-scroll .grouped-roster .summary-cell .badge {
  padding-left: 3px;
  padding-right: 3px;
  font-size: clamp(7px, .48vw, 9px);
}
.plan-detail-page .target-group-roster-scroll .grouped-roster .group-col-tn {
  font-variant-numeric: tabular-nums;
  font-size: clamp(7px, .5vw, 9px);
}

.admin-rule-editor-card {
  padding: 15px 17px;
}
.admin-rule-editor-card > h2,
.admin-rule-editor-card .section-heading-row h2 {
  margin-bottom: 5px;
}
.admin-rule-editor-card .section-heading-row {
  margin-bottom: 9px;
}
.admin-rule-editor-card .section-heading-row p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.35;
}
.admin-rule-editor-card .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 12px;
  align-items: end;
}
.admin-rule-editor-card .form-grid label {
  margin: 0;
}
.admin-rule-editor-card .form-grid input,
.admin-rule-editor-card .form-grid select,
.admin-rule-editor-card .form-grid textarea {
  min-height: 38px;
}
.admin-rule-editor-card .form-grid textarea {
  min-height: 70px;
}
.admin-rule-editor-card .form-grid .full,
.admin-rule-editor-card .form-grid .wide {
  grid-column: 1 / -1;
}
.admin-rule-editor-card .form-grid > .button {
  justify-self: start;
  min-width: 180px;
}
.admin-rule-editor-card .rule-summary {
  min-height: 38px;
  padding: 5px 8px;
}
@media (max-width: 1050px) {
  .admin-rule-editor-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .admin-rule-editor-card .form-grid { grid-template-columns: 1fr; }
  .admin-rule-editor-card .form-grid .full,
  .admin-rule-editor-card .form-grid .wide { grid-column: auto; }
}

.audit-log-card { padding: 16px; }
.audit-log-head { margin-bottom: 10px; }
.audit-log-head h2 { margin: 0 0 3px; }
.audit-log-head .subtitle { margin: 0; max-width: 820px; }
.audit-log-table-wrap { max-height: 76vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.audit-friendly-table { min-width: 1120px; table-layout: fixed; }
.audit-friendly-table thead th { position: sticky; top: 0; z-index: 5; background: #f1f5f9; }
.audit-friendly-table th:nth-child(1) { width: 135px; }
.audit-friendly-table th:nth-child(2) { width: 150px; }
.audit-friendly-table th:nth-child(3) { width: 150px; }
.audit-friendly-table th:nth-child(4) { width: 300px; }
.audit-friendly-table th:nth-child(5) { width: auto; }
.audit-friendly-table td { vertical-align: top; padding: 9px 10px; }
.audit-time-cell strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.audit-user-cell strong,
.audit-user-cell span,
.audit-change-cell strong,
.audit-change-cell span { display: block; }
.audit-user-cell span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.audit-change-cell strong { margin-bottom: 3px; font-size: 12px; }
.audit-change-cell span { color: #475569; font-size: 11px; line-height: 1.35; }
.audit-area-badge { white-space: normal; line-height: 1.2; }
.audit-readable-details dl { display: grid; gap: 4px; margin: 0; }
.audit-readable-details dl > div { display: grid; grid-template-columns: minmax(115px, .7fr) minmax(0, 1.3fr); gap: 7px; }
.audit-readable-details dt { color: #64748b; font-size: 10px; font-weight: 800; }
.audit-readable-details dd { margin: 0; color: #1e293b; font-size: 10.5px; overflow-wrap: anywhere; }
.audit-technical-details { margin-top: 7px; }
.audit-technical-details summary { color: var(--primary); cursor: pointer; font-size: 10px; font-weight: 800; }
.audit-technical-details code { display: block; max-height: 150px; margin-top: 5px; padding: 7px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9px; line-height: 1.3; }

/* V2.22.7 - 25/75-Aufteilung auch in der Einzelversorgungs-Arbeitsansicht */
@media screen and (min-width: 901px) {
  .care-editor-page {
    /* Mitarbeiterinformationen = 25 %, Monatskalender = 75 %. */
    --care-editor-axis-width: 25%;
    --care-editor-table-min-width: 1180px;
  }

  /* Oberer Versorgungsplan: sechs Informationsspalten ergeben zusammen exakt 25 %. */
  .care-editor-care-table col.care-axis-top-name { width: 9%; }
  .care-editor-care-table col.care-axis-top-services { width: 3%; }
  .care-editor-care-table col.care-axis-top-hours { width: 2.5%; }
  .care-editor-care-table col.care-axis-top-capacity { width: 4%; }
  .care-editor-care-table col.care-axis-top-status { width: 4%; }
  .care-editor-care-table col.care-axis-top-tn { width: 2.5%; }
  .care-editor-care-table .group-employee-head,
  .care-editor-care-table .group-employee-cell { width: 9%; }
  .care-editor-care-table .group-col-services { width: 3%; }
  .care-editor-care-table .group-col-hours { width: 2.5%; }
  .care-editor-care-table .group-col-capacity { width: 4%; }
  .care-editor-care-table .group-col-status { width: 4%; }
  .care-editor-care-table .group-col-tn { width: 2.5%; }

  /* Unterer Mitarbeiter-Monatsplan: sieben Informationsspalten ergeben ebenfalls 25 %. */
  .care-editor-employee-table col.care-axis-employee-name { width: 7.5%; }
  .care-editor-employee-table col.care-axis-availability { width: 5%; }
  .care-editor-employee-table col.care-axis-action { width: 4.5%; }
  .care-editor-employee-table col.care-axis-capacity { width: 2%; }
  .care-editor-employee-table col.care-axis-services { width: 2%; }
  .care-editor-employee-table col.care-axis-istplan { width: 2.5%; }
  .care-editor-employee-table col.care-axis-tn { width: 1.5%; }

  /* Nicht fest vorgegebene Tagespalten teilen sich automatisch die verbleibenden 75 %. */
  .care-editor-care-table col.care-day-col,
  .care-editor-employee-table col.care-day-col { width: var(--care-editor-day-width); }

  /* Sticky-Offsets und reale Zellbreiten folgen derselben 25-Prozent-Achse. */
  .care-editor-employee-table .employee-head,
  .care-editor-employee-table tbody td:first-child {
    left: 0;
    width: 7.5%;
    min-width: 0;
    max-width: none;
  }
  .care-editor-employee-table .care-editor-availability-head,
  .care-editor-employee-table .care-editor-availability-cell {
    left: 7.5%;
    width: 5%;
    min-width: 0;
    max-width: none;
  }
  .care-editor-employee-table .care-editor-action-head,
  .care-editor-employee-table .care-editor-action-cell {
    left: 12.5%;
    width: 4.5%;
    min-width: 0;
    max-width: none;
  }

  .care-editor-care-table .group-employee-cell,
  .care-editor-care-table .summary-cell,
  .care-editor-employee-table .sticky-col,
  .care-editor-employee-table .summary-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .care-editor-care-table .group-employee-cell,
  .care-editor-care-table .summary-cell,
  .care-editor-employee-table .summary-cell {
    padding-left: 1px;
    padding-right: 1px;
    white-space: nowrap;
  }
  .care-editor-action-cell .button.compact {
    min-height: 19px;
    padding: 1px 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 7px;
    line-height: 1;
  }
}

/* V2.23 - QTime-Dienstplankartenimport */
.qtime-import-intro .compact-section-head,
.qtime-review-head .compact-section-head { align-items: flex-start; gap: 18px; }
.qtime-process-grid,
.qtime-summary-grid,
.qtime-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.qtime-process-grid > div,
.qtime-summary-grid > div,
.qtime-result-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.qtime-process-grid span,
.qtime-summary-grid span,
.qtime-result-grid span { color: var(--muted); font-size: 12px; }
.qtime-summary-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.qtime-summary-grid strong,
.qtime-result-grid strong { font-size: 20px; color: #173f73; }
.qtime-result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qtime-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.qtime-inline-grid label { margin: 0; }
.qtime-table-tools { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0; }
.qtime-table-tools label { flex: 1 1 420px; max-width: 620px; margin: 0; }
.qtime-table-tools input[type="search"] { width: 100%; }
.qtime-table-tools .hint { flex: 0 0 auto; padding-bottom: 9px; }
.qtime-review-table-wrap { max-height: 58vh; border: 1px solid var(--line); border-radius: 10px; }
.qtime-review-table { min-width: 1050px; font-size: 12px; }
.qtime-review-table thead th { position: sticky; top: 0; z-index: 2; background: #edf3fa; }
.qtime-review-table th,
.qtime-review-table td { padding: 8px 7px; vertical-align: top; }
.qtime-review-table td > small,
.qtime-review-table td .warning-text { display: block; margin-top: 4px; line-height: 1.25; }
.qtime-review-table select,
.qtime-review-table input[type="text"] { min-width: 150px; font-size: 12px; padding: 8px; }
.qtime-review-table input[type="number"] { min-width: 92px; width: 100%; font-size: 12px; padding: 8px; }
.qtime-excel-upload-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 10px 14px; }
.qtime-excel-upload-form label { margin: 0; }
.qtime-excel-upload-form .hint { grid-column: 1 / -1; margin: 0; }
.qtime-excel-upload-form input[type="file"] { width: 100%; }
.qtime-employee-review-table { min-width: 1380px; }
.qtime-inline-check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 6px; margin-top: 6px !important; font-size: 10px; color: var(--muted); }
.qtime-inline-check input { margin-top: 1px; flex: 0 0 auto; }
.qtime-confirm-row { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.qtime-confirm-row > input { margin-top: 3px; flex: 0 0 auto; }
.qtime-confirm-row span { display: flex; flex-direction: column; gap: 3px; }
.qtime-confirm-row small { color: var(--muted); }
.qtime-final-confirm .button-row { margin-top: 14px; }
.qtime-details > summary { cursor: pointer; font-size: 16px; font-weight: 700; }
.qtime-services-table-wrap { max-height: 55vh; }
.qtime-services-table-wrap small { display: block; color: var(--muted); }
.success-card { border-color: #86efac; background: linear-gradient(180deg, #f0fdf4, #ffffff); }

@media (max-width: 1100px) {
  .qtime-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qtime-process-grid, .qtime-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .qtime-summary-grid, .qtime-process-grid, .qtime-result-grid { grid-template-columns: 1fr 1fr; }
  .qtime-review-head .compact-section-head { flex-direction: column; }
  .qtime-excel-upload-form { grid-template-columns: 1fr; }
  .qtime-excel-upload-form .hint { grid-column: auto; }
}

/* V2.24.1: Wohnadresse direkt in „Mein Konto“ */
.account-address-card { margin-top: 1rem; }
.account-address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: .8rem 0 1rem;
}
.account-address-grid > div {
  min-width: 0;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #f8fafc;
}
.account-address-grid h3 { margin: 0 0 .5rem; font-size: 1rem; }
.account-address-value { font-style: normal; line-height: 1.55; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .account-address-grid { grid-template-columns: 1fr; }
}


/* V2.25.2 - QTime-Massenanlage von Mitarbeiterkonten */
.qtime-account-result-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.qtime-access-download-row { align-items: center; margin-top: 14px; }
.qtime-employee-review-table { min-width: 1740px; }
.qtime-login-cell { min-width: 128px; }
.qtime-login-toggle { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.qtime-login-toggle input { width: 18px; height: 18px; }
.qtime-username-cell { min-width: 235px; }
.qtime-username-cell strong { display: block; overflow-wrap: anywhere; }
.qtime-initial-password-box { margin-bottom: 15px; padding: 15px; border: 1px solid #9fc4ef; border-radius: 12px; background: #f4f9ff; }
.qtime-initial-password-box > div:first-child > strong { color: #173f73; }
.qtime-password-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.qtime-password-grid label { margin: 0; }
@media (max-width: 1100px) {
  .qtime-account-result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .qtime-account-result-grid, .qtime-password-grid { grid-template-columns: 1fr; }
}


/* V2.25.3 - Einmalige, einblendbare QTime-Initialpassworteingabe */
.qtime-password-grid { grid-template-columns: minmax(280px, 720px); }
.qtime-password-field { margin-top: .35rem; }
.qtime-password-field .password-toggle { min-width: 92px; }
@media (max-width: 760px) {
  .qtime-password-grid { grid-template-columns: minmax(0, 1fr); }
}

/* V2.26 - automatisch responsive Mobiloberfläche und PWA */
[hidden] { display: none !important; }
.mobile-app-header,
.mobile-nav-backdrop,
.mobile-drawer-close,
.mobile-bottom-nav,
.mobile-drawer-tools,
.mobile-area-switch,
.mobile-admin-overview,
.mobile-plan-view,
.mobile-plan-focus,
.mobile-landscape-hint { display: none; }

.service-route-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  color: #145da7;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.service-route-link:hover { text-decoration: underline; }

.mobile-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 16px;
  background: radial-gradient(circle at top left, rgba(96,165,250,.18), transparent 34%), linear-gradient(135deg,#fff,#f4f8fd);
}
.mobile-home-hero h2,
.mobile-task-hero h2 { margin-bottom: 7px; font-size: 28px; }
.mobile-home-hero p,
.mobile-task-hero p { margin: 0; color: var(--muted); line-height: 1.5; }
.mobile-next-service {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #93c5fd;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30,64,175,.08);
}
.mobile-next-service > span,
.mobile-quick-card > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.mobile-next-service > strong { color: #173f73; font-size: 17px; }
.mobile-next-service > b { font-size: 22px; }
.mobile-next-service address { color: #475569; font-size: 13px; font-style: normal; }
.mobile-next-service .button-row { margin-top: 6px; }
.mobile-next-service-empty { border-color: #cbd5e1; }

.mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.mobile-quick-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  padding: 15px;
  border: 1px solid #dbe3ee;
  border-radius: 15px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(15,23,42,.055);
}
.mobile-quick-card svg {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  background: #eaf2fc;
  fill: none;
  stroke: #175ca8;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mobile-quick-card strong { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.mobile-quick-card.attention { border-color: #f2c15b; background: #fffbeb; }
.mobile-quick-card.danger { border-color: #fca5a5; background: #fff5f5; }

.mobile-week-list,
.mobile-task-list { display: grid; gap: 8px; }
.mobile-week-day {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.mobile-week-day.saturday,
.mobile-week-day.sunday,
.mobile-week-day.holiday { border-left: 4px solid #ef8f8f; }
.mobile-week-date { display: flex; flex-direction: column; color: #334155; }
.mobile-week-date span { font-size: 20px; font-weight: 900; }
.mobile-week-content { display: grid; gap: 7px; min-width: 0; }
.mobile-week-service { display: grid; gap: 3px; }
.mobile-week-service .karte-chip { min-width: 0; width: fit-content; }
.mobile-week-service small { color: #64748b; }
.mobile-free-day { align-self: center; color: #94a3b8; }

.mobile-task-hero { margin-bottom: 14px; }
.mobile-task-metrics .mobile-quick-card { grid-template-columns: minmax(0,1fr) auto; }
.mobile-task-metrics .mobile-quick-card strong { grid-row: 1 / span 2; grid-column: 2; color: #173f73; font-size: 28px; }
.mobile-task-section { margin-bottom: 14px; scroll-margin-top: 76px; }
.mobile-task-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.mobile-task-row:hover { border-color: #93b9e6; background: #f8fbff; }
.mobile-task-row.danger { border-color: #fecaca; background: #fff7f7; }
.mobile-task-row > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.mobile-task-row small { color: #64748b; overflow-wrap: anywhere; }
.mobile-task-row > b { color: #1f5fae; font-size: 23px; }
.mobile-task-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eaf2fc;
  color: #175ca8;
}
.mobile-task-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1120px) {
  .mobile-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  html:not(.dp-force-desktop),
  html:not(.dp-force-desktop) body { min-width: 0 !important; overflow-x: hidden !important; }
  html:not(.dp-force-desktop) body {
    padding-top: calc(58px + env(safe-area-inset-top));
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    background: #f2f5f9;
  }
  html:not(.dp-force-desktop) body.mobile-nav-open { overflow: hidden !important; }
  html:not(.dp-force-desktop) .mobile-app-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: calc(58px + env(safe-area-inset-top));
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    border-bottom: 1px solid rgba(203,213,225,.9);
    background: rgba(255,255,255,.97);
    box-shadow: 0 4px 18px rgba(15,23,42,.09);
    backdrop-filter: blur(12px);
  }
  html:not(.dp-force-desktop) .mobile-header-brand,
  html:not(.dp-force-desktop) .mobile-header-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
  html:not(.dp-force-desktop) .mobile-brand-mark,
  html:not(.dp-force-desktop) .mobile-logo-frame {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    overflow: hidden;
    border-radius: 11px;
    background: linear-gradient(135deg,#2f76c7,#174b87);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
  }
  html:not(.dp-force-desktop) .mobile-logo-frame { padding: 4px; border: 1px solid #dbe3ee; background: #fff; }
  html:not(.dp-force-desktop) .mobile-logo-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
  html:not(.dp-force-desktop) .mobile-brand-copy { display: flex; flex-direction: column; min-width: 0; }
  html:not(.dp-force-desktop) .mobile-brand-copy strong { font-size: 15px; line-height: 1.15; }
  html:not(.dp-force-desktop) .mobile-brand-copy small { color: #64748b; font-size: 10px; }
  html:not(.dp-force-desktop) .mobile-menu-button,
  html:not(.dp-force-desktop) .mobile-drawer-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #173f73;
  }
  html:not(.dp-force-desktop) .mobile-menu-button svg,
  html:not(.dp-force-desktop) .mobile-drawer-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  html:not(.dp-force-desktop) .mobile-connection-status {
    padding: 5px 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 10px;
    font-weight: 850;
  }
  html:not(.dp-force-desktop) .layout {
    display: block !important;
    width: 100% !important;
    min-height: calc(100vh - 126px) !important;
  }
  html:not(.dp-force-desktop) .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 150 !important;
    display: block !important;
    width: min(88vw, 370px) !important;
    max-width: 370px !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: 18px 0 48px rgba(2,6,23,.3);
    overscroll-behavior: contain;
  }
  html:not(.dp-force-desktop) body.mobile-nav-open .sidebar { transform: translateX(0); }
  html:not(.dp-force-desktop) .mobile-drawer-close { position: absolute; top: calc(13px + env(safe-area-inset-top)); right: 13px; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; }
  html:not(.dp-force-desktop) .sidebar .brand { padding-right: 48px; margin-bottom: 14px; }
  html:not(.dp-force-desktop) .sidebar-nav { display: flex !important; grid-template-columns: none !important; flex-direction: column; gap: 3px; }
  html:not(.dp-force-desktop) .sidebar-nav .nav-dashboard-wrap,
  html:not(.dp-force-desktop) .sidebar-nav .nav-section-title { grid-column: auto; }
  html:not(.dp-force-desktop) .sidebar-nav .nav-link { min-height: 43px; padding: 10px 11px; font-size: 14px; }
  html:not(.dp-force-desktop) .mobile-area-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 12px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
  }
  html:not(.dp-force-desktop) .mobile-area-switch a { padding: 8px 7px; border-radius: 9px; color: #cbd5e1; text-align: center; text-decoration: none; font-size: 12px; font-weight: 800; }
  html:not(.dp-force-desktop) .mobile-area-switch a.active { background: #fff; color: #173f73; }
  html:not(.dp-force-desktop) .mobile-drawer-tools { display: grid; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.15); }
  html:not(.dp-force-desktop) .mobile-tool-button {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: #e5eefc;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
  }
  html:not(.dp-force-desktop) .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(2,6,23,.54);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  html:not(.dp-force-desktop) body.mobile-nav-open .mobile-nav-backdrop { opacity: 1; pointer-events: auto; }
  html:not(.dp-force-desktop) .content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    overflow-x: clip !important;
  }
  html:not(.dp-force-desktop) .topbar { margin: 2px 2px 12px; }
  html:not(.dp-force-desktop) .topbar h1 { margin: 0; font-size: 24px; line-height: 1.2; }
  html:not(.dp-force-desktop) .topbar .subtitle { display: none; }
  html:not(.dp-force-desktop) .environment-banner,
  html:not(.dp-force-desktop) .planning-readonly-banner { flex-direction: column; gap: 4px; padding: 10px 12px; }
  html:not(.dp-force-desktop) .planning-readonly-banner strong { white-space: normal; }
  html:not(.dp-force-desktop) .flash-wrap { margin-bottom: 11px; }
  html:not(.dp-force-desktop) .flash { padding: 11px 12px; border-radius: 11px; font-size: 13px; }
  html:not(.dp-force-desktop) .card { padding: 14px; border-radius: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
  html:not(.dp-force-desktop) .section-head { gap: 10px; margin-bottom: 10px; }
  html:not(.dp-force-desktop) .section-head h2 { margin-bottom: 4px; }
  html:not(.dp-force-desktop) input,
  html:not(.dp-force-desktop) select,
  html:not(.dp-force-desktop) textarea { min-height: 46px; font-size: 16px; }
  html:not(.dp-force-desktop) input[type="checkbox"],
  html:not(.dp-force-desktop) input[type="radio"] { min-height: 20px; min-width: 20px; }
  html:not(.dp-force-desktop) button,
  html:not(.dp-force-desktop) .button,
  html:not(.dp-force-desktop) a.button { min-height: 44px; }
  html:not(.dp-force-desktop) .app-legal-footer { margin-bottom: 8px; padding-bottom: 10px; }

  html:not(.dp-force-desktop) .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 125;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid #d5dde8;
    background: rgba(255,255,255,.98);
    box-shadow: 0 -6px 24px rgba(15,23,42,.1);
    backdrop-filter: blur(12px);
  }
  html:not(.dp-force-desktop) .mobile-bottom-nav a,
  html:not(.dp-force-desktop) .mobile-bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 52px;
    padding: 3px 1px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
  }
  html:not(.dp-force-desktop) .mobile-bottom-nav a.active,
  html:not(.dp-force-desktop) .mobile-bottom-nav button[aria-expanded="true"] { background: #eaf2fc; color: #174f91; }
  html:not(.dp-force-desktop) .mobile-bottom-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

  html:not(.dp-force-desktop) .mobile-admin-overview { display: grid; gap: 8px; margin-bottom: 12px; }
  html:not(.dp-force-desktop) .mobile-admin-primary {
    display: grid;
    gap: 3px;
    padding: 15px;
    border-radius: 15px;
    background: linear-gradient(135deg,#174f91,#256db9);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(23,79,145,.22);
  }
  html:not(.dp-force-desktop) .mobile-admin-primary span { color: #dbeafe; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
  html:not(.dp-force-desktop) .mobile-admin-primary strong { font-size: 18px; }
  html:not(.dp-force-desktop) .mobile-admin-primary small { color: #dbeafe; }
  html:not(.dp-force-desktop) .mobile-admin-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  html:not(.dp-force-desktop) .mobile-admin-actions a { display: grid; gap: 2px; padding: 10px 7px; border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; color: #475569; text-align: center; text-decoration: none; }
  html:not(.dp-force-desktop) .mobile-admin-actions strong { color: #173f73; font-size: 20px; }
  html:not(.dp-force-desktop) .mobile-admin-actions span { font-size: 10px; }
  html:not(.dp-force-desktop) .dashboard-hero { display: none; }
  html:not(.dp-force-desktop) .dashboard-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  html:not(.dp-force-desktop) .dashboard-metrics .metric { padding: 11px; }
  html:not(.dp-force-desktop) .dashboard-metrics .metric span { font-size: 9px; }
  html:not(.dp-force-desktop) .dashboard-metrics .metric strong { margin-top: 5px; font-size: 21px; }
  html:not(.dp-force-desktop) .dashboard-section-title { margin: 17px 2px 9px; }
  html:not(.dp-force-desktop) .dashboard-section-title p { display: none; }
  html:not(.dp-force-desktop) .dashboard-tiles { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  html:not(.dp-force-desktop) .dash-tile { min-height: 130px; padding: 13px; }
  html:not(.dp-force-desktop) .dash-tile small { font-size: 10px; line-height: 1.35; }
  html:not(.dp-force-desktop) .dashboard-lower { display: none; }

  html:not(.dp-force-desktop) .mobile-home-hero { grid-template-columns: 1fr; gap: 12px; }
  html:not(.dp-force-desktop) .mobile-home-hero h2,
  html:not(.dp-force-desktop) .mobile-task-hero h2 { font-size: 23px; }
  html:not(.dp-force-desktop) .mobile-quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  html:not(.dp-force-desktop) .mobile-quick-card { grid-template-columns: 28px minmax(0,1fr); padding: 11px; }
  html:not(.dp-force-desktop) .mobile-quick-card svg { width: 27px; height: 27px; padding: 5px; }
  html:not(.dp-force-desktop) .mobile-task-metrics .mobile-quick-card { grid-template-columns: minmax(0,1fr) auto; }
  html:not(.dp-force-desktop) .mobile-week-card .section-head,
  html:not(.dp-force-desktop) .mobile-task-section .section-head { flex-direction: row; align-items: flex-start; }
  html:not(.dp-force-desktop) .mobile-task-section .section-head .button { width: auto; min-width: fit-content; padding-inline: 10px; font-size: 11px; }

  html:not(.dp-force-desktop) .table-wrap:has(> table.mobile-data-table) { overflow: visible !important; border: 0; }
  html:not(.dp-force-desktop) table.mobile-data-table { display: block; width: 100%; min-width: 0 !important; border: 0; }
  html:not(.dp-force-desktop) table.mobile-data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html:not(.dp-force-desktop) table.mobile-data-table tbody { display: grid; gap: 10px; width: 100%; }
  html:not(.dp-force-desktop) table.mobile-data-table tbody tr {
    display: block;
    width: 100%;
    padding: 7px 11px;
    border: 1px solid #dbe3ee;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(15,23,42,.045);
  }
  html:not(.dp-force-desktop) table.mobile-data-table tbody tr.muted-row { opacity: .68; }
  html:not(.dp-force-desktop) table.mobile-data-table tbody td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 9px;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    background: transparent !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  html:not(.dp-force-desktop) table.mobile-data-table tbody td:last-child { border-bottom: 0; }
  html:not(.dp-force-desktop) table.mobile-data-table tbody td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
  }
  html:not(.dp-force-desktop) table.mobile-data-table tbody td[data-mobile-full="1"] { display: block; }
  html:not(.dp-force-desktop) table.mobile-data-table tbody td[data-mobile-full="1"]::before { display: none; }
  html:not(.dp-force-desktop) table.mobile-data-table .actions { display: flex; gap: 7px; }
  html:not(.dp-force-desktop) table.mobile-data-table .actions::before { flex: 0 0 38%; }
  html:not(.dp-force-desktop) table.mobile-data-table .actions .button,
  html:not(.dp-force-desktop) table.mobile-data-table .actions .link-button { width: auto; min-height: 38px; }

  html:not(.dp-force-desktop) .employee-plan-intro .section-head { align-items: stretch; }
  html:not(.dp-force-desktop) .employee-plan-intro .mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  html:not(.dp-force-desktop) .employee-plan-intro .mini-stats span { min-width: 0; border-radius: 10px; padding: 8px; font-size: 11px; }
  html:not(.dp-force-desktop) .dienstplankarte-wrap { display: block; margin-bottom: 14px; overflow: visible; }
  html:not(.dp-force-desktop) .dienstplankarte { width: 100%; min-width: 0; padding: 11px; border: 1px solid #b9c5d4; border-radius: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.07); font-family: inherit; }
  html:not(.dp-force-desktop) .dienstplankarte .karte-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border: 0; }
  html:not(.dp-force-desktop) .dienstplankarte .karte-title-row h2 { font-size: 21px; }
  html:not(.dp-force-desktop) .dienstplankarte .karte-period { font-size: 14px; font-weight: 800; text-align: right; }
  html:not(.dp-force-desktop) .dienstplankarte .karte-meta { grid-template-columns: 1fr 1fr; margin: 9px 0; border: 1px solid #dbe3ee; border-radius: 10px; overflow: hidden; }
  html:not(.dp-force-desktop) .dienstplankarte .karte-meta div { border-color: #e8edf3; font-size: 10px; }
  html:not(.dp-force-desktop) .mobile-plan-view {
    position: sticky;
    top: calc(64px + env(safe-area-inset-top));
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 4px;
    margin: 9px 0;
    padding: 4px;
    border: 1px solid #d7e0eb;
    border-radius: 12px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 5px 16px rgba(15,23,42,.08);
  }
  html:not(.dp-force-desktop) .mobile-plan-view button { min-height: 38px; padding: 6px; border: 0; border-radius: 9px; background: transparent; color: #64748b; font: inherit; font-size: 12px; font-weight: 800; }
  html:not(.dp-force-desktop) .mobile-plan-view button.active { background: #1f5fae; color: #fff; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] { display: block; width: 100%; min-width: 0; border: 0; background: transparent; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] thead { display: none; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody { display: grid; gap: 9px; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 11px;
    padding: 11px;
    border: 1px solid #dbe3ee;
    border-left: 4px solid #94a3b8;
    border-radius: 12px;
    background: #fff;
  }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody tr.has-service { border-left-color: #ed8b2c; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody tr.has-absence { border-left-color: #b6901f; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody tr.sunday,
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody tr.holiday { border-top-color: #f4a5a5; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] td {
    display: block;
    width: 100% !important;
    min-width: 0;
    padding: 7px 0;
    border: 0;
    background: transparent !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] td::before { display: block; margin-bottom: 3px; color: #64748b; content: attr(data-label); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] .day-cell { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; border-bottom: 1px solid #e5eaf0; color: #26364a; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] .day-cell::before { display: none; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] td:nth-child(2),
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] td:nth-child(4),
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] td:nth-child(5) { grid-column: 1 / -1; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] td:empty { display: none; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] .karte-chip { min-width: 0; width: fit-content; }
  html:not(.dp-force-desktop) .dienstplankarte .karte-summary { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 10px 2px 0; }
  html:not(.dp-force-desktop) .mobile-plan-empty { margin-top: 10px; }

  html:not(.dp-force-desktop) .plan-top-jump { top: calc(64px + env(safe-area-inset-top)); }
  html:not(.dp-force-desktop) .mobile-plan-focus {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
  }
  html:not(.dp-force-desktop) .mobile-plan-focus-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 13px;
    background: linear-gradient(135deg,#174f91,#256db9);
    color: #fff;
  }
  html:not(.dp-force-desktop) .mobile-plan-focus-head > div { display: grid; gap: 2px; }
  html:not(.dp-force-desktop) .mobile-plan-focus-head span { color: #dbeafe; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  html:not(.dp-force-desktop) .mobile-plan-focus-head a { min-width: fit-content; padding: 8px 9px; border-radius: 9px; background: #fff; color: #174f91; font-size: 11px; font-weight: 850; text-decoration: none; }
  html:not(.dp-force-desktop) .mobile-plan-focus-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  html:not(.dp-force-desktop) .mobile-plan-focus-list > a {
    display: flex;
    justify-content: space-between;
    gap: 7px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid #dbe3ee;
    border-radius: 11px;
    background: #fff;
    color: inherit;
    text-decoration: none;
  }
  html:not(.dp-force-desktop) .mobile-plan-focus-list > a > span { display: grid; gap: 2px; min-width: 0; }
  html:not(.dp-force-desktop) .mobile-plan-focus-list strong,
  html:not(.dp-force-desktop) .mobile-plan-focus-list small { overflow-wrap: anywhere; }
  html:not(.dp-force-desktop) .mobile-plan-focus-list small { color: #64748b; font-size: 9px; }
  html:not(.dp-force-desktop) .mobile-plan-focus-list .badge { flex: 0 0 auto; padding: 3px 6px; font-size: 9px; }
  html:not(.dp-force-desktop) .plan-jump-bar { grid-template-columns: 1fr; }
  html:not(.dp-force-desktop) .plan-summary-strip { grid-template-columns: repeat(4,minmax(92px,1fr)); }
  html:not(.dp-force-desktop) .modal-backdrop { padding: 8px; }
  html:not(.dp-force-desktop) .manual-edit-modal-card { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  html:not(.dp-force-desktop) .qtime-review-table-wrap,
  html:not(.dp-force-desktop) .audit-log-table-wrap { max-height: 68dvh; }
  html:not(.dp-force-desktop) .care-editor-page,
  html:not(.dp-force-desktop) .plan-detail-page { --mobile-planner-hint: 1; }
  html:not(.dp-force-desktop) .mobile-landscape-hint {
    display: block;
    margin: 0 0 8px;
    padding: 9px 11px;
    border: 1px solid #9fc4ef;
    border-radius: 10px;
    background: #eef6ff;
    color: #244b78;
    font-size: 11px;
    line-height: 1.4;
  }
  html:not(.dp-force-desktop) .care-editor-workspace,
  html:not(.dp-force-desktop) .plan-grid,
  html:not(.dp-force-desktop) .roster-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html:not(.dp-force-desktop) body.is-offline .mobile-app-header { border-bottom-color: #ef9a9a; }
}

@media (max-width: 560px) {
  html:not(.dp-force-desktop) .content { padding: 9px !important; }
  html:not(.dp-force-desktop) .mobile-week-day { grid-template-columns: 65px minmax(0,1fr); gap: 8px; }
  html:not(.dp-force-desktop) .mobile-task-row { grid-template-columns: 34px minmax(0,1fr) auto; gap: 8px; }
  html:not(.dp-force-desktop) .mobile-task-icon { width: 34px; height: 34px; }
  html:not(.dp-force-desktop) .mobile-task-section .section-head { flex-direction: column; }
  html:not(.dp-force-desktop) .mobile-task-section .section-head .button { width: 100%; }
  html:not(.dp-force-desktop) .mobile-plan-focus-list { grid-template-columns: 1fr; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody tr { grid-template-columns: 1fr; }
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] td { grid-column: 1 / -1 !important; }
}

@media (max-width: 920px) and (orientation: landscape) and (min-width: 620px) {
  html:not(.dp-force-desktop) .dienstplankarte-table[data-mobile-plan-table] tbody { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html:not(.dp-force-desktop) .mobile-week-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 920px) {
  html.dp-force-desktop,
  html.dp-force-desktop body { min-width: 1180px !important; overflow-x: auto !important; }
  html.dp-force-desktop body { padding: 0 !important; }
  html.dp-force-desktop .layout { display: grid !important; grid-template-columns: 248px minmax(0,1fr) !important; min-height: 100vh !important; }
  html.dp-force-desktop .sidebar {
    position: sticky !important;
    inset: 0 auto auto 0 !important;
    display: block !important;
    width: 248px !important;
    max-width: 248px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 18px 14px !important;
    overflow-y: auto !important;
    transform: none !important;
  }
  html.dp-force-desktop .content { width: auto !important; max-width: none !important; padding: 20px !important; overflow: visible !important; }
  html.dp-force-desktop .mobile-app-header,
  html.dp-force-desktop .mobile-bottom-nav,
  html.dp-force-desktop .mobile-nav-backdrop,
  html.dp-force-desktop .mobile-drawer-close,
  html.dp-force-desktop .mobile-area-switch { display: none !important; }
  html.dp-force-desktop .mobile-drawer-tools { display: grid; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.15); }
  html.dp-force-desktop .mobile-tool-button { min-height: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font-weight: 800; }
}

@media print {
  .mobile-app-header,
  .mobile-bottom-nav,
  .mobile-nav-backdrop,
  .mobile-drawer-close,
  .mobile-drawer-tools,
  .mobile-area-switch,
  .mobile-plan-view,
  .mobile-plan-focus,
  .mobile-landscape-hint,
  .mobile-admin-overview { display: none !important; }
}
