/* ── Root & Layout ────────────────────────────────────────────────────────── */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f5f6f8;
}

#app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

#app-sidebar {
  width: 220px;
  min-width: 220px;
  background: #f3f4f7;
  border-right: 1px solid #e4e6ec;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

#app-sidebar.sidebar-collapsed {
  width: 56px;
  min-width: 56px;
}

/* Brand */
#sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 10px;
  border-bottom: 1px solid #e4e6ec;
  margin-bottom: 6px;
  min-height: 52px;
}

#app-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}

#sidebar-brand-text {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
  letter-spacing: -0.01em;
}

#btn-sidebar-collapse {
  background: none;
  border: 1px solid #e4e6ec;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  font-size: 11px;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.2s;
}

#app-sidebar.sidebar-collapsed #btn-sidebar-collapse {
  transform: rotate(180deg);
}

/* Hide text in collapsed sidebar */
#app-sidebar.sidebar-collapsed #sidebar-brand-text,
#app-sidebar.sidebar-collapsed .sidebar-label,
#app-sidebar.sidebar-collapsed .sidebar-section-label {
  display: none;
}

/* Section labels */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px 3px;
  white-space: nowrap;
  overflow: hidden;
}

/* Nav items */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 12px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  text-align: left;
  font-size: 13px;
  color: #1f2937;
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.1s;
}

.sidebar-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-nav-active,
.sidebar-nav-item.sidebar-nav-active {
  color: #1f5fbf;
  background: rgba(31, 95, 191, 0.08);
  border-left-color: #1f5fbf;
  font-weight: 600;
}

/* Toggle-button active state (workload, legend) */
.sidebar-nav-item.active {
  color: #1f5fbf;
  background: rgba(31, 95, 191, 0.06);
  border-left-color: #1f5fbf;
}

.sidebar-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #e4e6ec;
  padding-top: 4px;
  padding-bottom: 6px;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */

#app-main {
  flex: 1;
  min-width: 0;
  background: #f5f6f8;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#plan-type-color-bar {
  height: 3px;
  border-radius: 2px;
  background: #1f5fbf;
  margin: -16px -20px 0;
  transition: background 0.2s ease;
}

/* ── Page Header ──────────────────────────────────────────────────────────── */

#app-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  min-height: 36px;
}

.kw-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.kw-date-range {
  font-size: 13px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1;
}

.page-header-spacer {
  flex: 1;
}

/* Status pill — right-aligned in page header */
.kw-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.kw-status-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kw-status-pill .pill-obj {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.kw-status-pill.pill-optimal {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.kw-status-pill.pill-optimal .pill-dot { background: #10b981; }

.kw-status-pill.pill-feasible {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.kw-status-pill.pill-feasible .pill-dot { background: #f59e0b; }

.kw-status-pill.pill-infeasible {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.kw-status-pill.pill-infeasible .pill-dot { background: #ef4444; }

.kw-status-pill.pill-stale {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.kw-status-pill.pill-stale .pill-dot { background: #f59e0b; }

.kw-status-pill.pill-draft {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}
.kw-status-pill.pill-draft .pill-dot { background: #9ca3af; }

/* ── Toolbar ──────────────────────────────────────────────────────────────── */

#app-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
}

.toolbar-btn {
  background: #ffffff;
  border: 1px solid #e1e4ea;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12.5px;
  cursor: pointer;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.1s;
}

.toolbar-btn:hover:not(:disabled) {
  background: #f5f6f8;
}

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

.toolbar-btn-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.toolbar-btn-danger:hover:not(:disabled) {
  background: #fef2f2;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: #e1e4ea;
  margin: 0 4px;
  flex-shrink: 0;
}

.toolbar-spacer {
  flex: 1;
}

/* ── Split Button ─────────────────────────────────────────────────────────── */

#solve-split-wrap {
  position: relative;
  display: inline-flex;
}

.solve-split-btn {
  display: inline-flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.split-main {
  background: #1f5fbf;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border-right: 1px solid rgba(255,255,255,0.2);
  font-family: inherit;
}

.split-main:hover {
  background: #1a52a8;
}

.split-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.split-chevron {
  background: #1f5fbf;
  color: #fff;
  border: none;
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

.split-chevron:hover {
  background: #1a52a8;
}

.split-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  padding: 4px;
  z-index: 200;
}

.split-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  cursor: pointer;
  color: #111827;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
}

.split-menu-item:hover {
  background: #f5f6f8;
}

.split-menu-icon {
  width: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  text-align: center;
}

.split-menu-sub {
  font-size: 11px;
  color: #6b7280;
  margin-top: 1px;
}

.split-menu-divider {
  height: 1px;
  background: #e1e4ea;
  margin: 4px 0;
}

/* ── Coverage Bar ─────────────────────────────────────────────────────────── */

#coverage-bar {
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 38px;
}

/* ── Solver Log ───────────────────────────────────────────────────────────── */

#solver-log-container {
  /* no extra margin — gap on #app-main handles spacing */
}

#solver-log-alert {
  font-size: 0.85em;
  margin-bottom: 0;
}

/* ── KW Overview Panel ────────────────────────────────────────────────────── */

#week-overview-container {
  /* intentionally empty — always visible, no extra margin needed */
}

.week-overview-bar {
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
  padding: 10px 12px;
}

/* Year navigation row */
.vc-year-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.vc-year-nav-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 4px;
  color: #111827;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.vc-year-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.vc-year-chip {
  padding: 3px 11px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: #111827;
  border: 1px solid #e1e4ea;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.vc-year-chip:hover {
  background: #f5f6f8;
}

.vc-year-chip-active {
  background: #1f5fbf;
  color: #fff;
  border-color: #1f5fbf;
}

.vc-year-chip-active:hover {
  background: #1a52a8;
}

.vc-kw-counter {
  margin-left: auto;
  font-size: 11.5px;
  color: #6b7280;
  white-space: nowrap;
}

/* Shared scroll area: month row + card row scroll together */
.vc-scroll-area {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.vc-scroll-area::-webkit-scrollbar { height: 4px; }
.vc-scroll-area::-webkit-scrollbar-track { background: transparent; }
.vc-scroll-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.vc-scroll-area::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Month labels row */
.vc-month-row {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
}

.vc-month-label {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

/* Week cards row */
.week-overview-cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
}

.week-card {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  width: 36px;
  height: 44px;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid #e1e4ea;
  background: #fafbfc;
  cursor: pointer;
  line-height: 1.2;
  gap: 2px;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.week-card-stale-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc3545;
  border: 1.5px solid white;
  pointer-events: none;
}

.week-card:hover {
  border-color: #9ca3af;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.week-card-active {
  border-color: #1f5fbf !important;
  box-shadow: 0 0 0 2px rgba(31,95,191,0.2);
}

.week-card-label {
  font-size: 11px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.week-card-status {
  font-size: 10px;
  font-weight: 600;
  margin-top: 1px;
}

.week-card-missing {
  background: #fafbfc;
  border-color: #e9ecef;
  cursor: default;
  opacity: 0.45;
}

.week-card-draft    { background: #f1f3f5; }
.week-card-draft .week-card-status { color: #adb5bd; }

.week-card-optimal  { background: #d1e7dd; border-color: #a3cfbb; }
.week-card-optimal .week-card-status  { color: #0f5132; }
.week-card-optimal .week-card-label   { color: #0f5132; }

.week-card-feasible { background: #fff3cd; border-color: #ffecb5; }
.week-card-feasible .week-card-status { color: #664d03; }

.week-card-infeasible { background: #f8d7da; border-color: #f5c2c7; }
.week-card-infeasible .week-card-status { color: #842029; }

.week-card-critical { background: #ffe5d0; border-color: #f0a070; }
.week-card-critical .week-card-status { color: #922e0e; }
.week-card-critical .week-card-label  { color: #922e0e; }

.week-card-stale { background: #fff0c2; border-color: #ffc107 !important; }
.week-card-stale .week-card-label  { color: #664d03; }
.week-card-stale .week-card-status { color: #b45309; }

/* ── Schedule Table ───────────────────────────────────────────────────────── */

#schedule-board-container {
  overflow-x: auto;
}

#schedule-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
  overflow: hidden;
}

#schedule-table .col-day {
  width: 90px;
}

#schedule-table thead th {
  background: #f8f9fb;
  color: #374151;
  font-weight: 600;
  font-size: 0.85em;
  padding: 8px 10px;
  text-align: center;
  border-right: 1px solid #e1e4ea;
  border-bottom: 1px solid #d1d5db;
  white-space: nowrap;
}

#schedule-table thead th.day-col-header {
  text-align: left;
  width: 80px;
  background: #f8f9fb;
}

#schedule-table thead th.location-col-header {
  text-align: center;
  border-left: 2px solid #d1d5db;
  background: #f0f2f5;
  cursor: context-menu;
  color: #111827;
}

#schedule-table thead th.location-col-header:hover {
  background: #e8eaed;
}

#schedule-table thead th.shift-col-header {
  text-align: center;
  font-weight: 500;
  border-left: 1px solid #e1e4ea;
  background: #f5f6f8;
  position: relative;
  padding-right: 14px;
  overflow: hidden;
  color: #6b7280;
}

.col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  background: transparent;
  z-index: 1;
}

.col-resize-handle:hover,
.col-resize-handle:active {
  background: rgba(0, 0, 0, 0.12);
}

#schedule-table tbody tr:hover td {
  background-color: rgba(0, 0, 0, 0.015);
}

#schedule-table tbody td {
  padding: 0;
  border-right: 1px solid #e1e4ea;
  border-bottom: 1px solid #e1e4ea;
  vertical-align: top;
}

#schedule-table tbody td.row-header {
  padding: 6px 10px;
  font-size: 0.82em;
  font-weight: 600;
  background: #f8f9fb;
  color: #495057;
  white-space: nowrap;
  vertical-align: middle;
}

#schedule-table tbody td.row-header .day-name-label {
  font-weight: 700;
  color: #111827;
  display: block;
}

#schedule-table tbody td.row-header .date-label {
  color: #6c757d;
  font-size: 0.85em;
  white-space: nowrap;
}

/* ── Slot Cells — STATUS COLORS PRESERVED ─────────────────────────────────── */

.slot-cell {
  min-height: 60px;
  padding: 4px;
  transition: background-color 0.15s;
  position: relative;
}

.slot-cell.slot-ok {
  background-color: #d1e7dd;
}

.slot-cell.slot-warning {
  background-color: #fff3cd;
}

.slot-cell.slot-critical {
  background-color: #f8d7da;
}

.slot-cell.slot-empty {
  background-color: #f8f9fa;
}

.slot-cell.slot-closed {
  background-color: #d9848a;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 5px,
    rgba(0,0,0,0.06) 5px,
    rgba(0,0,0,0.06) 10px
  );
}

.slot-cell.drag-over {
  outline: 2px dashed #1f5fbf !important;
  background-color: #dbeafe !important;
}

/* ── Doctor Badges ────────────────────────────────────────────────────────── */

.doctor-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: grab;
  user-select: none;
  margin: 2px;
  font-size: 0.78em;
  padding: 3px 7px;
  border-radius: 12px;
  font-weight: 600;
  transition: opacity 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.doctor-badge:active {
  cursor: grabbing;
  opacity: 0.7;
}

.doctor-badge.sortable-chosen {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0.85;
}

.doctor-badge.sortable-ghost {
  opacity: 0.3;
}

.doctor-badge .pin-icon {
  font-size: 0.75em;
  opacity: 0.8;
}

.doctor-badge .comment-btn {
  background: none;
  border: none;
  padding: 0 0 0 2px;
  cursor: pointer;
  font-size: 0.8em;
  opacity: 0.6;
  line-height: 1;
  color: inherit;
}

.doctor-badge .comment-btn:hover {
  opacity: 1;
}

/* ── Coverage Badges ──────────────────────────────────────────────────────── */

.coverage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78em;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: default;
}

.coverage-badge-ok {
  background-color: #198754;
  color: white;
}

.coverage-badge-warning {
  background-color: #ffc107;
  color: #212529;
}

.coverage-badge-critical {
  background-color: #dc3545;
  color: white;
}

/* ── Ampel Dot ────────────────────────────────────────────────────────────── */
.ampel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

/* ── Doctor Role Tags (in list modal) ────────────────────────────────────── */

.doctor-role-tag {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e9ecef;
  color: #495057;
  letter-spacing: 0.03em;
}

/* ── Workload Bar ─────────────────────────────────────────────────────────── */

#workload-bar-container {
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
  padding: 12px;
}

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

.workload-label {
  width: 80px;
  font-size: 0.82em;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #495057;
}

.workload-track {
  flex: 1;
  background: #e9ecef;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.workload-bar {
  height: 8px;
  border-radius: 4px;
  background: #1f5fbf;
  transition: width 0.4s ease;
}

.workload-count {
  width: 28px;
  font-size: 0.78em;
  color: #6c757d;
  text-align: right;
}

/* ── Modals ───────────────────────────────────────────────────────────────── */

.modal-tabs .nav-link {
  font-size: 0.875em;
}

.avail-matrix {
  border-collapse: collapse;
  width: 100%;
}

.avail-matrix th,
.avail-matrix td {
  text-align: center;
  padding: 6px 8px;
  border: 1px solid #dee2e6;
  font-size: 0.83em;
}

.avail-matrix th {
  background: #f1f3f5;
  font-weight: 600;
}

.avail-matrix input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Absences bar ─────────────────────────────────────────────────────────── */

.absences-bar {
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82em;
}

.absences-label {
  font-weight: 600;
  color: #495057;
  margin-right: 4px;
  white-space: nowrap;
}

.absence-entry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f3f5;
  border-radius: 8px;
  padding: 2px 8px 2px 6px;
  white-space: nowrap;
}

.absence-shortid {
  font-weight: 700;
  color: #212529;
}

.absence-fullname {
  color: #6c757d;
  font-size: 0.9em;
}

.absence-days {
  display: inline-flex;
  gap: 2px;
  margin-left: 2px;
}

.absence-day-badge {
  background: #ffc107;
  color: #212529;
  font-weight: 600;
  font-size: 0.85em;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Bench (Verfügbare Ärzte) ────────────────────────────────────────────── */

.bench-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.bench-pill {
  cursor: grab;
  user-select: none;
  transition: opacity 0.15s, transform 0.1s;
}

.bench-pill:active {
  cursor: grabbing;
}

/* Highlight bench pill when dragging over a valid target */
.drag-over-ready .bench-pill {
  opacity: 0.6;
}

/* ── Closed Periods ───────────────────────────────────────────────────────── */

.closed-period-entry {
  background: #fde8e8;
}

.closed-period-date {
  color: #842029;
  font-weight: 600;
  font-size: 0.9em;
}

/* ── Color Legend ─────────────────────────────────────────────────────────── */

#legend-container {
  /* always in flow, toggled via d-none */
}

.legend-bar {
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.82em;
}

.legend-label {
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #495057;
  white-space: nowrap;
}

.legend-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.legend-swatch-ok      { background-color: #d1e7dd; }
.legend-swatch-warning { background-color: #fff3cd; }
.legend-swatch-critical { background-color: #f8d7da; }
.legend-swatch-empty   { background-color: #f8f9fa; }
.legend-swatch-closed  { background-color: #d9848a; }

/* ── Vacation Periods ────────────────────────────────────────────────────── */

.vac-period-form {
  background: #f8f9fa;
}

.vac-period-form input[type="date"] {
  font-size: 0.875rem;
}

#vac-period-list .list-group-item {
  border-left: none;
  border-right: none;
  font-size: 0.875rem;
}

#vac-period-list .list-group-item:first-child {
  border-top: none;
}

/* ── Urlaubskapazitäts-Matrix ────────────────────────────────────────────── */

.vac-mx-scroll-wrapper {
  overflow-x: auto;
  max-height: 60vh;
  overflow-y: auto;
  padding-bottom: 18px;
}

.vac-mx-table {
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.vac-mx-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  white-space: nowrap;
  padding: 4px 6px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}

.vac-mx-week-head {
  min-width: 36px;
  max-width: 36px;
}

.vac-mx-week-head[data-week-id] {
  cursor: pointer;
}

.vac-mx-week-head[data-week-id]:hover {
  filter: brightness(0.88);
  outline: 2px solid rgba(0, 0, 0, 0.20);
  outline-offset: -2px;
}

.vac-mx-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  border-right: 2px solid #dee2e6 !important;
}

.vac-mx-table thead .vac-mx-sticky {
  z-index: 4;
}

.vac-mx-name-col {
  min-width: 110px;
  white-space: nowrap;
  padding: 4px 8px !important;
}

.vac-mx-days-badge {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.68rem;
  font-weight: 400;
  color: #6c757d;
}

.vac-mx-cell {
  padding: 2px 3px !important;
  text-align: center;
  vertical-align: middle;
}

.vac-mx-period {
  display: block;
  height: 14px;
  border-radius: 3px;
  cursor: pointer;
}

.vac-mx-period.approved {
  background: #0d6efd;
}

.vac-mx-period.pending {
  background: repeating-linear-gradient(
    45deg,
    #ffc107,
    #ffc107 4px,
    #fff3cd 4px,
    #fff3cd 8px
  );
  border: 1px solid #ffc107;
}

.vac-mx-pending-row td {
  background: #fffdf0;
  padding: 3px 6px !important;
  font-size: 0.8rem;
}

.vac-mx-pending-cell {
  white-space: nowrap;
}

.vac-mx-count-badge {
  font-size: 0.60rem;
  font-weight: 600;
  color: #495057;
  line-height: 1;
  margin-top: 2px;
}

.vac-mx-count-zero {
  font-weight: 400;
  color: #ced4da;
}

.btn-xs {
  padding: 1px 6px;
  font-size: 0.72rem;
  line-height: 1.4;
  border-radius: 3px;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── History Panel ────────────────────────────────────────────────────────── */

.history-panel {
  font-size: 0.8em;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-state .empty-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

/* ── Spinner overlay ──────────────────────────────────────────────────────── */

.solving-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

/* ── Bulk-Solve Modal ─────────────────────────────────────────────────────── */

.bulk-week-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bulk-month-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bulk-month-label {
  min-width: 36px;
  font-size: 11px;
  font-weight: 600;
  color: #6c757d;
  padding-top: 5px;
}

.bulk-week-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bulk-week-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.bulk-week-item input[type="checkbox"] {
  display: none;
}

.bulk-kw-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.1s;
}

.bulk-week-item input:checked + .bulk-kw-badge {
  outline: 2px solid #1f5fbf;
  outline-offset: 1px;
}

.bulk-badge-missing    { background: #e9ecef; color: #6c757d; border-color: #dee2e6; }
.bulk-badge-draft      { background: #cfe2ff; color: #084298; border-color: #b6d4fe; }
.bulk-badge-optimal    { background: #d1e7dd; color: #0f5132; border-color: #a3cfbb; }
.bulk-badge-feasible   { background: #fff3cd; color: #664d03; border-color: #ffecb5; }
.bulk-badge-infeasible { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
.bulk-badge-stale      { background: #fff3cd; color: #664d03; border-color: #fd7e14; }

/* Log */
.bulk-log {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  font-family: monospace;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bulk-log-entry   { padding: 1px 0; }
.bulk-log-pending { color: #6c757d; }
.bulk-log-ok      { color: #198754; }
.bulk-log-error   { color: #dc3545; }

/* ── Print ────────────────────────────────────────────────────────────────── */

@media print {
  #app-sidebar,
  #app-toolbar,
  #app-page-header,
  #solver-log-container,
  #workload-bar-container,
  #coverage-bar,
  #week-overview-container,
  .btn,
  .modal,
  #toast-container {
    display: none !important;
  }

  #app-layout {
    display: block;
  }

  #app-main {
    padding: 0;
  }

  #schedule-board-container {
    margin: 0;
    overflow: visible;
  }

  #schedule-table {
    font-size: 11px;
    border: 1px solid #999;
  }

  #schedule-table thead th {
    background: #333 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .doctor-badge {
    border: 1px solid #000;
    padding: 1px 3px;
    background: #eee !important;
    color: #000 !important;
    border-radius: 3px;
  }

  .slot-cell.slot-ok {
    background-color: #d1e7dd !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .slot-cell.slot-warning {
    background-color: #fff3cd !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .slot-cell.slot-critical {
    background-color: #f8d7da !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .slot-cell.slot-closed {
    background-color: #d9848a !important;
    background-image: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.sidebar-nav-manage { opacity: 0.7; font-size: 12px; }
