:root {
  color-scheme: light;
  font-family: Inter, Arial, sans-serif;
  --bg: #f3f4f6;
  --text: #111827;
  --card-bg: #fff;
  --border: #d1d5db;
  --table-border: #e5e7eb;
  --muted: #4b5563;
  --sticky-bg: #fff;
  --input-bg: #fff;
  --tab-bg: #e5e7eb;
  --holiday-bg: #fca5a5;
  --weekend-bg: #fcd34d;
  --department-row-bg: #e5e7eb;
  --self-row-accent: #2563eb;
  --marker-yellow: #fef08a;
  --marker-red: #fecaca;
  --marker-green: #bbf7d0;
  --marker-blue: #93c5fd;
  --settings-header-bg-dark: #243246;
  --settings-header-text-dark: #dbeafe;
  --dashboard-tab-active-bg-dark: rgba(96, 165, 250, 0.24);
  --dashboard-tab-active-text-dark: #dbeafe;
  --dashboard-tab-active-shadow-dark: inset 0 0 0 1px rgba(147, 197, 253, 0.35);
  --app-shell-max-width: 1900px;
  --app-shell-gutter: 1rem;
}

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

body.dark-mode {
  color-scheme: dark;
  --bg: #111827;
  --text: #f9fafb;
  --card-bg: #1f2937;
  --border: #374151;
  --table-border: #4b5563;
  --muted: #9ca3af;
  --sticky-bg: #1f2937;
  --input-bg: #374151; /* Etwas heller als der Karten-Hintergrund */
  --tab-bg: #374151;
  --holiday-bg: #7f1d1d;
  --weekend-bg: #92400e;
  --department-row-bg: #374151;
  --self-row-accent: #60a5fa;
  --button-primary: #2563eb;
  --button-secondary: #374151;
  --focus: #60a5fa;
}

/* Sichtbarkeit der Eingaben im Darkmode fixen */
body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
  background-color: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
.app {
  margin: 0 auto;
  max-width: calc(var(--app-shell-max-width) + (2 * var(--app-shell-gutter)));
  padding: 1rem var(--app-shell-gutter);
  width: 100%;
}
body.schedule-page .app {
  max-width: calc(var(--app-shell-max-width) + (2 * var(--app-shell-gutter)));
}
.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}
/* Staerkere Rahmen im Darkmode, damit Karten besser vom Hintergrund getrennt sind */
body.dark-mode .card {
  border: 1px solid var(--border);
}
/* Muss spaeter definierte Anzeige-Regeln (z. B. initiale Ladekarte) sicher ueberstimmen. */
.hidden { display: none !important; }
.stack { display: grid; gap: 0.6rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.swap-request-fields {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.mt { margin-top: 1rem; }
.align-end { display: flex; align-items: end; }
label { display: grid; gap: 0.25rem; font-size: 0.9rem; }
input, select, button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.95rem;
}
input, select, textarea { background: var(--input-bg); color: var(--text); }

@media (hover: none) and (pointer: coarse) {
  input[type="date"].mobile-date-placeholder:required:invalid::before {
    content: attr(data-date-placeholder);
    color: var(--muted);
  }

  input[type="date"].mobile-date-placeholder:required:invalid:focus::before {
    content: "";
  }
}

@media (max-width: 576px) {
  .swap-request-fields {
    grid-template-columns: 1fr;
  }

  .swap-request-fields input,
  .swap-request-fields select {
    width: 100%;
  }
}

button { cursor: pointer; background: #2563eb; color: white; border: none; }
button.secondary { background: #4b5563; }
.btn-group { display: inline-flex; gap: 0.35rem; align-items: center; }
.form-row { display: grid; gap: 0.35rem; margin-bottom: 0.5rem; }
button:focus, select:focus, input:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Suppress focus ring on mouse click (keyboard navigation still shows it) */
button:focus:not(:focus-visible) { outline: none; }

/* Anpassungen fuer Buttons im Darkmode (.btn-close ausschliessen, damit Bootstrap-SVG sichtbar bleibt) */
body.dark-mode button:not(.btn):not(.btn-close),
body.dark-mode .btn-primary {
  background: var(--button-primary);
  color: #fff;
}
body.dark-mode button.secondary:not(.btn-close),
body.dark-mode .btn-secondary {
  background: var(--button-secondary);
  color: #e5e7eb;
}
body.dark-mode .card { box-shadow: none; }

/* Darkmode: Modal vollstaendig stylen */
body.dark-mode .modal-content {
  background-color: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}
body.dark-mode .modal-header {
  background-color: var(--card-bg);
  border-bottom-color: var(--border);
}
body.dark-mode .modal-footer {
  background-color: var(--card-bg);
  border-top-color: var(--border);
}
body.dark-mode .modal-body {
  background-color: var(--card-bg);
}
body.dark-mode .table-light {
  --bs-table-bg: var(--department-row-bg);
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
}
body.dark-mode .list-group-item {
  background-color: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

/* Kleine Modal-Anpassungen */
.modal .modal-body { color: var(--text); }
.toolbar { display: flex; justify-content: space-between; align-items: center; }
.topbar { display:grid; gap:0.75rem; }
.app-navbar {
  --app-navbar-max-width: var(--app-shell-max-width);
  border-radius: 0 0 10px 10px;
  left: 50%;
  min-height: 74px;
  position: relative;
  transform: translateX(-50%);
  width: min(var(--app-navbar-max-width), calc(100vw - (2 * var(--app-shell-gutter))));
  z-index: 1030;
}
.app-navbar .dropdown-menu {
  z-index: 1031;
}
.app-navbar .container-fluid {
  min-height: 58px;
}
.app-navbar-logo {
  filter: brightness(0) invert(1);
  flex: 0 0 auto;
  height: 48px;
  width: auto;
}
.app-navbar .navbar-brand,
.app-navbar .navbar-toggler,
.app-navbar #theme-toggle-btn,
.app-navbar #notificationDropdown,
.app-navbar #logout-btn {
  flex-shrink: 0;
}
.controls { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: end; }
.controls-inline { margin-bottom: 0.6rem; }
.hint { font-size: 0.85rem; color: var(--muted); }
.error { color: #dc2626; }
.lists { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
ul { margin: 0; padding-left: 1rem; }
.table-wrap { overflow: auto; max-height: 75vh; }
#planning-panel .table-wrap {
  max-height: calc(100vh - 13rem);
  min-height: min(68vh, 720px);
}

/* Als Overlay reserviert der Speicherhinweis keinen Platz im Dokument. Dadurch
   bleibt die gerade bearbeitete Tabellenzeile beim ersten Editieren stehen. */
#pending-changes-bar {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1040;
  width: min(32rem, calc(100vw - 2rem));
  margin: 0 !important;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.22);
}
#calendar-panel #calendar-table,
#planning-panel #admin-calendar-table {
  min-width: 0;
  width: 100%;
}
#calendar-panel th.sticky,
#calendar-panel td.sticky,
#planning-panel th.sticky,
#planning-panel td.sticky {
  width: 1%;
  min-width: 8.5rem;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { border: 1px solid var(--table-border); padding: 0.35rem 0.45rem; text-align: center; }
/* Sticky column header (left) */
th.sticky, td.sticky {
  position: sticky;
  left: 0;
  background: var(--sticky-bg);
  z-index: 2;
  min-width: 140px;
  white-space: nowrap;
  text-align: left;
}
/* Sticky row header (top) – keeps day headers visible while scrolling vertically */
.table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--sticky-bg);
  z-index: 3;
}
/* Corner cell: sticky both horizontally and vertically */
.table-wrap thead th.sticky {
  z-index: 4;
}
th.day-header { min-width: 2.1rem; }
th.day-header small { display: block; font-size: 0.65rem; font-weight: 500; color: var(--muted); }
.weekend {
  background: transparent;
  box-shadow: inset 0 -4px 0 0 var(--weekend-bg);
}
.holiday,
.sunday {
  background: transparent;
  box-shadow: inset 0 -4px 0 0 var(--holiday-bg);
}
.cell-shift {
  border-radius: 6px;
  display: block;
  padding: 0.2rem;
  font-weight: 600;
}

/* Zellen-Markierungen */
.marker-yellow { background-color: var(--marker-yellow) !important; }
.marker-red    { background-color: var(--marker-red)    !important; }
.marker-green  { background-color: var(--marker-green)  !important; }
.marker-blue   { background-color: var(--marker-blue)   !important; }

.assignment-warning {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 0.65em;
  line-height: 1;
  display: inline;
  margin: 0;
  pointer-events: none;
}
td[data-emp] {
  position: relative;
}
.editable { position: relative; }
.editable:hover { outline: 2px solid #93c5fd; cursor: pointer; }

/* Ausstehende (noch nicht gespeicherte) Änderungen */
.has-pending-change { outline: 2px dashed #f59e0b !important; }
.cell-shift.pending-shift { opacity: 0.75; }
.pending-empty-cell {
  display: block;
  font-size: 0.75rem;
  color: #92400e;
  font-style: italic;
}
body.dark-mode .pending-empty-cell { color: #fcd34d; }
.cell-shift.free-day {
  background: #e5e7eb;
  color: #1f2937;
  border: 1px dashed #9ca3af;
}
.inline-assignment-editor {
  position: fixed;
  z-index: 1050;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  padding: 0.6rem;
  display: grid;
  gap: 0.35rem;
  min-width: 200px;
  max-width: 260px;
}
.inline-assignment-editor .inline-actions { display: flex; gap: 0.3rem; justify-content: flex-end; }

.multi-select-shift-picker { min-width: 260px; }
.multi-select-picker-header,
.assignment-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.6rem -0.6rem 0;
  padding: 0.65rem 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.multi-select-picker-header {
  cursor: grab;
  touch-action: none;
}
.multi-select-shift-picker.is-dragging .multi-select-picker-header { cursor: grabbing; }
.multi-select-shift-picker .color-picker .btn-check:checked + .btn,
.assignment-shift-picker .color-picker .btn-check:checked + .btn {
  position: relative;
  z-index: 2;
  border-color: #111827 !important;
  box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px #111827 !important;
}
body.dark-mode .multi-select-shift-picker .color-picker .btn-check:checked + .btn,
body.dark-mode .assignment-shift-picker .color-picker .btn-check:checked + .btn {
  border-color: #fff !important;
  box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px #fff !important;
}
.multi-select-preview,
.assignment-preview { margin-top: 0.25rem; }
.multi-select-preview-cell,
.assignment-preview-cell {
  width: 4.5rem;
  min-height: 2.35rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}
.multi-select-preview-cell .cell-shift,
.assignment-preview-cell .cell-shift { text-align: center; }

/* Multi-select mode panel */
.multi-select-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card-bg);
  border: 2px solid #3b82f6;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.multi-select-panel.hidden { display: none !important; }
.multi-select-panel .multi-select-count { font-size: 0.85rem; color: var(--muted); }

/* Cell selected in multi-select mode */
.cell-multi-selected {
  outline: 3px solid #3b82f6 !important;
  background-color: rgba(59,130,246,0.15) !important;
}

/* Active cell highlight animation when inline editor is open */
@keyframes cell-editing-pulse {
  0%   { box-shadow: inset 0 0 0 2px #3b82f6; }
  50%  { box-shadow: inset 0 0 0 3px #60a5fa, 0 0 6px 2px rgba(59,130,246,0.4); }
  100% { box-shadow: inset 0 0 0 2px #3b82f6; }
}
.cell-editing {
  animation: cell-editing-pulse 1.4s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
body.dark-mode .cell-editing {
  animation-name: cell-editing-pulse-dark;
}
@keyframes cell-editing-pulse-dark {
  0%   { box-shadow: inset 0 0 0 2px #60a5fa; }
  50%  { box-shadow: inset 0 0 0 3px #93c5fd, 0 0 8px 2px rgba(96,165,250,0.5); }
  100% { box-shadow: inset 0 0 0 2px #60a5fa; }
}


.toolbar-actions { display: flex; gap: 0.5rem; }

/* Bootstrap-nahe Tabs, aber mit besserem Darkmode-Kontrast */
.nav-tabs {
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.nav-tabs .nav-link {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-bottom-color: transparent;
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.55rem 0.9rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.nav-tabs .nav-link:hover {
  background-color: rgba(37, 99, 235, 0.06);
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.16);
}
.nav-tabs .nav-link.active {
  background-color: var(--card-bg);
  color: var(--button-primary);
  border-color: var(--border) var(--border) var(--card-bg);
  font-weight: 600;
}
body.dark-mode .nav-tabs {
  border-bottom-color: #4b5563;
}
body.dark-mode .nav-tabs .nav-link {
  color: #cbd5e1;
}
body.dark-mode .nav-tabs .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.26);
}
body.dark-mode .nav-tabs .nav-link.active {
  background-color: #334155;
  color: #f8fafc;
  border-color: #64748b #64748b #334155;
  box-shadow: inset 0 -2px 0 #60a5fa;
}

.tab-panel h3 {
  margin-top: 0;
}

.settings-shell {
  max-width: 1480px;
}
.settings-accordion {
  display: grid;
  gap: 0.8rem;
}
.settings-accordion .accordion-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0;
  background: var(--card-bg);
}
.settings-accordion .accordion-header-static {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.settings-accordion .accordion-body {
  padding: 1rem;
}
.settings-accordion .accordion-button {
  font-weight: 600;
}
.settings-accordion .accordion-button:not(.collapsed) {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}
body.dark-mode .settings-accordion .accordion-button,
body.dark-mode .settings-accordion .accordion-body {
  background: var(--card-bg);
  color: var(--text);
}
body.dark-mode .settings-accordion .accordion-header-static {
  background: var(--settings-header-bg-dark);
  color: var(--settings-header-text-dark);
}
.settings-accordion .accordion-collapse {
  transition: all 0.3s ease;
}
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem 1rem;
}
.settings-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0;
}
.settings-checkbox-row .form-check-input {
  margin-top: 0.2rem;
}

.request-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.request-tab-row .request-tab-btn {
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: transparent;
  color: var(--text);
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  box-shadow: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.request-tab-row .request-tab-btn:hover {
  background-color: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.22);
}
.request-tab-row .request-tab-btn.active {
  border-color: var(--self-row-accent);
  background: rgba(37, 99, 235, 0.12);
  color: var(--button-primary);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

.approval-history-employee-search {
  width: min(100%, 22rem);
}
body.dark-mode .request-tab-row .request-tab-btn {
  background: transparent;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.24);
}
body.dark-mode .request-tab-row .request-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.34);
  color: #f8fafc;
}
body.dark-mode .request-tab-row .request-tab-btn.active {
  background: #334155;
  color: #f8fafc;
  border-color: #64748b;
  box-shadow: inset 0 -2px 0 #60a5fa;
}

textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.95rem;
  min-height: 88px;
}

/* Ausrichtung vom Darkmode-Schalter */

@media (min-width: 992px) {
  .app {
    max-width: calc(var(--app-shell-max-width) + (2 * var(--app-shell-gutter)));
  }
}

@media (max-width: 768px) {
  :root {
    --app-shell-gutter: 0.5rem;
  }

  .app {
    padding: 0.5rem var(--app-shell-gutter);
  }

  .app-navbar {
    width: calc(100vw - (2 * var(--app-shell-gutter)));
  }

  .card {
    padding: 0.75rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  th.sticky,
  td.sticky {
    min-width: 110px;
  }

  th,
  td {
    padding: 0.15rem;
    font-size: 0.68rem;
  }

  th.day-header {
    min-width: 1.45rem;
  }

  th.day-header small {
    font-size: 0.55rem;
  }
}

.highlight-row {
    animation: fade-out-highlight 3s ease-out forwards;
}

@keyframes fade-out-highlight {
    from { background-color: #cff4fc; }
    to { background-color: transparent; }
}

body.dark-mode .highlight-row {
    animation-name: fade-out-highlight-dark;
}

@keyframes fade-out-highlight-dark {
    from { background-color: #0d3c4b; }
    to { background-color: transparent; }
}

.department-row td{background:var(--department-row-bg);font-weight:700;text-align:left;}
.self-row td:first-child{border-left:3px solid var(--self-row-accent)!important;}

#manage-users-dept-tabs .user-dept-tab { white-space: nowrap; }

.rotation-sequence-table th,
.rotation-sequence-table td{text-align:center;}
.rotation-sequence-table th{min-width:72px;}
.rotation-sequence-table td{min-width:110px;}
.rotation-sequence-table select{min-width:0;width:100%;}
.rotation-sequence-table .rotation-day-block + .rotation-day-block{border-top:0.75rem solid transparent;}
#rotation-template-form:fullscreen{
  background:var(--card-bg);height:100vh;overflow:auto;width:100vw;
}
#rotation-template-form:fullscreen .modal-body{overflow:auto;}
#rotation-template-form:fullscreen .rotation-sequence-wrap{max-height:none;overflow:visible;}
#rotation-template-form:fullscreen .rotation-sequence-table{table-layout:fixed;width:100%;}
#rotation-template-form:fullscreen .rotation-sequence-table th{min-width:0;width:8%;}
#rotation-template-form:fullscreen .rotation-sequence-table td{min-width:0;}
.modal label{display:grid;gap:0.25rem;margin-bottom:0.5rem;}

/* Antrag-Vorschauen verwenden dieselbe Tabellenoptik wie der Dienstplan. */
.schedule-preview-table th,
.schedule-preview-table td { vertical-align: middle; }
.schedule-preview-table .sticky { min-width: 140px; }
.schedule-preview-table .cell-shift { min-width: 3rem; }

/* Darkmode-Fix: Schließen-Button (X) in Modals sichtbar machen */
body.dark-mode .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Theme-Toggle-Button */
#theme-toggle-btn {
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.15s;
}
#theme-toggle-btn:hover {
  opacity: 1;
}

/* Footer */
.app-footer {
  text-align: center;
  color: var(--muted);
  padding: 1.25rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}
.app-footer .update-status,
.app-footer [data-update-status],
.app-footer #update-status,
.app-footer .version-status,
.app-footer .footer-update-status {
  display: none !important;
}

/* Benachrichtigungs-Dropdown: Overflow-Schutz auf Mobilgeräten */
#notification-list {
  overflow-x: hidden;
}
#notification-list .dropdown-item {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 95vw;
}

/* Benachrichtigungshistorie: Vorher/Nachher-Darstellung */
.shift-old {
  color: #dc2626;
  text-decoration: line-through;
}
.shift-new {
  color: #16a34a;
  font-weight: 600;
}

/* Moderne Admin-Split-Layout */
.admin-split-layout {
  display: flex;
  gap: 0;
  min-height: 400px;
  transition: all 0.3s ease;
}
.admin-list-panel {
  flex: 1;
  overflow-y: auto;
  transition: all 0.3s ease;
  min-width: 0;
  padding: 1rem;
}
.admin-side-panel {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease, padding 0.3s ease;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
}
.admin-side-panel.open {
  width: 360px;
  padding: 1rem;
  overflow-y: auto;
}
.admin-side-panel .side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.admin-side-panel h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Krankentage-Muster-Chart */
.sick-chart-card {
  padding: 0.75rem;
  border: 1px solid var(--border);
}
.sick-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.sick-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 90px;
  padding: 0.25rem 0.25rem 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
  overflow-x: auto;
}
.sick-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 18px;
}
.sick-bar {
  width: 14px;
  min-height: 4px;
  background: #3b82f6;
  border-radius: 4px 4px 2px 2px;
}
.sick-week-chart .sick-bar {
  width: 8px;
}
.sick-week-chart .sick-bar-item {
  min-width: 12px;
}
.sick-bar-label {
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
}
.sick-weekend-bar {
  display: flex;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}
.sick-weekday {
  background: #3b82f6;
}
.sick-weekend {
  background: #f97316;
}
@media (max-width: 768px) {
  .admin-side-panel.open {
    width: 100%;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .admin-split-layout {
    position: relative;
  }
}

/* Dashboard weekly tabs */
.dashboard-tab-btn {
  border: 1px solid transparent;
  background: var(--tab-bg);
  color: var(--text);
  border-radius: 6px 6px 0 0;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}
.dashboard-tab-btn.active {
  background: var(--card-bg);
  border: 1px solid var(--self-row-accent);
  border-bottom-width: 3px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
  font-weight: 600;
}
body.dark-mode .dashboard-tab-btn.active {
  background: var(--dashboard-tab-active-bg-dark);
  color: var(--dashboard-tab-active-text-dark);
  box-shadow: var(--dashboard-tab-active-shadow-dark);
}
.dashboard-week-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Feature: Verfügbarkeiten – Availability dots in planning calendar ──────── */
.avail-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 2px;
  flex-shrink: 0;
}
.avail-dot-avail     { background: #16a34a; }
.avail-dot-unavail   { background: #dc2626; }
.avail-dot-preferred { background: #2563eb; }

/* Interactive avail-dot (keyboard/touch accessible via Bootstrap tooltip) */
.avail-dot[tabindex] {
  cursor: help;
  outline: none;
}
.avail-dot[tabindex]:focus-visible {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

/* ── Feature: Konfliktprüfung – Conflict cell highlights ────────────────────── */
#check-conflicts-btn.has-background-conflicts {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.18rem rgba(220, 53, 69, 0.18);
  color: #dc3545;
  font-weight: 600;
}
#check-conflicts-btn.has-background-conflicts .conflict-button-badge {
  min-width: 1.55rem;
}

.conflict-cell {
  position: relative;
}
.conflict-under {
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
}
.conflict-over {
  outline: 2px solid #06b6d4;
  outline-offset: -2px;
}
.conflict-restriction,
.conflict-unavail {
  outline: 2px solid #dc2626;
  outline-offset: -2px;
}
.conflict-icon {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 0.65rem;
  line-height: 1;
  color: #dc2626;
  pointer-events: none;
}

/* Date header conflict indicators for global (under/over staffing) conflicts */
.conflict-header {
  position: relative;
}
.conflict-header-under {
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
  background-color: rgba(245, 158, 11, 0.12);
}
.conflict-header-over {
  outline: 2px solid #06b6d4;
  outline-offset: -2px;
  background-color: rgba(6, 182, 212, 0.12);
}
.conflict-header-icon {
  font-size: 0.6rem;
  cursor: help;
  margin-left: 2px;
  vertical-align: middle;
}

.schedule-month-banner {
  border-left: 0.35rem solid #991b1b;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.65rem;
}
.schedule-message-editor {
  background: color-mix(in srgb, var(--card-bg) 96%, #dc2626 4%);
  border: 1px solid color-mix(in srgb, var(--border) 70%, #dc2626 30%);
  padding: 0.75rem;
}
.cell-shift {
  min-width: 2.1rem;
  line-height: 1.15;
  white-space: nowrap;
}

/* Auswertung: kompaktere und besser lesbare Zeiterfassungs-Ansicht */
.hr-report-intro {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-bg) 88%, #3b82f6 12%);
  color: var(--text);
}
.hr-report-intro span {
  color: var(--muted);
}
.tt-upload-card {
  border: 1px solid var(--border);
  box-shadow: none;
}
.tt-upload-card .card-body {
  padding: 0.75rem !important;
}
.tt-upload-card #tt-mapping-box {
  max-height: 150px;
  overflow: auto;
}
.tt-compare-table {
  max-height: 60vh;
}
.tt-compare-table th,
.tt-compare-table td {
  text-align: left;
  vertical-align: middle;
}
.tt-compare-table .tt-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.tt-compare-table .tt-sort:hover {
  color: #2563eb;
}

/* Zeiterfassungs-Vergleich: kalenderartige Prüfmatrix mit klickbaren Auffälligkeiten */
.tt-compare-toolbar .btn {
  white-space: nowrap;
}
.tt-next-day {
  display: inline-block;
  margin-left: 0.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.72em;
  font-weight: 700;
}
.tt-row-deviation {
  --tt-status-bg: #fee2e2;
  --tt-status-border: #ef4444;
}
.tt-row-missing-punch {
  --tt-status-bg: #fef3c7;
  --tt-status-border: #f59e0b;
}
.tt-row-special {
  --tt-status-bg: #cffafe;
  --tt-status-border: #06b6d4;
}
.tt-row-unplanned,
.tt-row-unmapped {
  --tt-status-bg: #e5e7eb;
  --tt-status-border: #64748b;
}
.tt-row-ok {
  --tt-status-bg: #dcfce7;
  --tt-status-border: #22c55e;
}
.tt-compare-table tr.tt-row-deviation > td,
.tt-compare-table tr.tt-row-missing-punch > td,
.tt-compare-table tr.tt-row-special > td,
.tt-compare-table tr.tt-row-unplanned > td,
.tt-compare-table tr.tt-row-unmapped > td {
  background: color-mix(in srgb, var(--tt-status-bg) 68%, transparent);
}
.tt-calendar-wrap {
  max-height: none;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tt-compare-calendar {
  min-width: 1180px;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.tt-compare-calendar thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card-bg);
  text-align: center;
  min-width: 6.4rem;
  border-bottom: 1px solid var(--border);
}
.tt-compare-calendar .tt-calendar-person {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 13rem;
  max-width: 13rem;
  background: var(--card-bg);
  box-shadow: 1px 0 0 var(--border);
}
.tt-calendar-person span,
.tt-calendar-person small {
  display: block;
}
.tt-calendar-person small {
  color: var(--muted);
  font-weight: 400;
}
.tt-calendar-empty {
  background: color-mix(in srgb, var(--card-bg) 92%, #f8fafc 8%);
}
.tt-calendar-cell {
  position: relative;
  min-width: 6.4rem;
  max-width: 6.4rem;
  border-left: 4px solid var(--tt-status-border, var(--border));
  background: var(--tt-status-bg, var(--card-bg));
  vertical-align: top;
}
.tt-calendar-shift {
  font-weight: 700;
  line-height: 1.15;
}
.tt-calendar-time {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}
.tt-calendar-cell .badge {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

body.dark-mode .tt-compare-table .table,
body.dark-mode .tt-compare-calendar {
  --bs-table-bg: var(--card-bg);
  --bs-table-color: var(--text);
  --bs-table-striped-bg: rgba(255,255,255,0.035);
  --bs-table-striped-color: var(--text);
  --bs-table-hover-bg: rgba(96,165,250,0.12);
  --bs-table-hover-color: var(--text);
  --bs-table-border-color: var(--border);
  color: var(--text);
}
body.dark-mode .tt-compare-table thead th,
body.dark-mode .tt-compare-calendar thead th,
body.dark-mode .tt-compare-calendar .tt-calendar-person {
  background: #111827;
  color: var(--text);
}
body.dark-mode .tt-next-day {
  background: rgba(129, 140, 248, 0.25);
  color: #c7d2fe;
}
body.dark-mode .tt-row-deviation { --tt-status-bg: rgba(127, 29, 29, 0.65); --tt-status-border: #f87171; }
body.dark-mode .tt-row-missing-punch { --tt-status-bg: rgba(120, 53, 15, 0.65); --tt-status-border: #fbbf24; }
body.dark-mode .tt-row-special { --tt-status-bg: rgba(22, 78, 99, 0.65); --tt-status-border: #22d3ee; }
body.dark-mode .tt-row-unplanned,
body.dark-mode .tt-row-unmapped { --tt-status-bg: rgba(51, 65, 85, 0.75); --tt-status-border: #94a3b8; }
body.dark-mode .tt-row-ok { --tt-status-bg: rgba(20, 83, 45, 0.65); --tt-status-border: #4ade80; }
body.dark-mode .tt-calendar-empty { background: rgba(255,255,255,0.025); }
.tt-employee-search { max-width: 18rem; }
.tt-employee-chip { text-transform: none; }

/* Zeiterfassungs-Vergleich: moderne Detailkarten für Kalender-Hover und kompakte Tabelle */
.tt-detail-card {
  border: 1px solid color-mix(in srgb, var(--border) 70%, #60a5fa 30%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-bg) 94%, #eff6ff 6%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  color: var(--text);
  min-width: 18rem;
  max-width: 24rem;
  padding: 0.75rem;
  text-align: left;
}
.tt-detail-hover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.25rem) scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.tt-calendar-cell:hover .tt-detail-hover,
.tt-calendar-cell:focus-within .tt-detail-hover,
.tt-calendar-cell:focus .tt-detail-hover {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.tt-detail-hover::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: color-mix(in srgb, var(--card-bg) 94%, #eff6ff 6%);
}
.tt-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
}
.tt-detail-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  font-size: 0.82rem;
}
.tt-detail-grid span {
  color: var(--muted);
}
.tt-detail-reasons {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.tt-detail-table {
  min-width: min(100%, 18rem);
  max-width: none;
  box-shadow: none;
  padding: 0.6rem;
}
.tt-compare-table .table {
  font-size: 0.78rem;
}
.tt-compare-table th,
.tt-compare-table td {
  padding: 0.28rem 0.4rem;
}
.tt-compare-table td[data-label="Details"] {
  min-width: 18rem;
}
.tt-calendar-cell {
  position: relative;
}

body.dark-mode .tt-detail-card {
  background: color-mix(in srgb, #111827 92%, #2563eb 8%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}
body.dark-mode .tt-detail-hover::after {
  border-top-color: color-mix(in srgb, #111827 92%, #2563eb 8%);
}

@media (max-width: 760px) {
  .tt-compare-table {
    max-height: none;
    overflow: visible;
  }
  .tt-compare-table table,
  .tt-compare-table thead,
  .tt-compare-table tbody,
  .tt-compare-table tr,
  .tt-compare-table th,
  .tt-compare-table td {
    display: block;
    width: 100%;
  }
  .tt-compare-table thead {
    display: none;
  }
  .tt-compare-table tr {
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
    border-left: 5px solid var(--tt-status-border, var(--border));
    border-radius: 14px;
    overflow: hidden;
    background: var(--card-bg);
  }
  .tt-compare-table td {
    border: 0;
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    text-align: left !important;
  }
  .tt-compare-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }
  .tt-compare-table td[data-label="Details"] {
    display: block;
    min-width: 0;
    padding: 0.5rem;
  }
  .tt-compare-table td[data-label="Details"]::before {
    display: none;
  }
  .tt-detail-card {
    min-width: 0;
    max-width: 100%;
  }
  .tt-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard personal week pills */
.dashboard-plan-title {
  color: var(--text);
  font-weight: 700;
  padding: 0.45rem 0.25rem 0.55rem;
}
.dashboard-week-scroll {
  position: relative;
}
.dashboard-week-scroll-hint {
  align-items: center;
  color: var(--muted);
  display: none;
  font-size: 1rem;
  height: 1.4rem;
  justify-content: center;
  opacity: 0.65;
  pointer-events: none;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.15s ease, visibility 0.15s ease;
  width: 1.4rem;
  z-index: 2;
}
.dashboard-week-scroll-hint.is-hidden {
  opacity: 0;
  visibility: hidden;
}
.dashboard-day-pills {
  display: grid;
  grid-template-columns: repeat(7, minmax(76px, 1fr));
  gap: 0.3rem;
  min-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}
.dashboard-day-pill {
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-bg) 90%, #3b82f6 10%);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
  padding: 0.38rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.25rem;
  overflow: hidden;
}
.dashboard-day-pill.is-today {
  border-color: var(--self-row-accent);
  box-shadow: inset 0 0 0 1px var(--self-row-accent), 0 10px 24px rgba(37, 99, 235, 0.16);
}
.dashboard-day-pill.is-weekend {
  background: color-mix(in srgb, var(--card-bg) 86%, #f59e0b 14%);
}
.dashboard-day-pill.is-holiday {
  background: color-mix(in srgb, var(--card-bg) 84%, #ef4444 16%);
}
.dashboard-pill-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}
.dashboard-pill-day {
  font-size: 0.82rem;
  font-weight: 800;
}
.dashboard-pill-number {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}
.dashboard-pill-shift {
  text-align: center;
}
.dashboard-pill-shift .cell-shift {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.16rem 0.38rem;
  font-size: 0.76rem;
  font-weight: 800;
}
.dashboard-pill-time {
  color: var(--text);
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 0.16rem;
  text-shadow: 0 1px 2px color-mix(in srgb, var(--card-bg) 78%, transparent);
}
.dashboard-pill-empty {
  align-items: center;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-weight: 700;
  justify-content: center;
  min-height: 1.8rem;
  font-size: 0.86rem;
}
@media (max-width: 992px) {
  .dashboard-day-pills {
    grid-template-columns: repeat(7, minmax(76px, 1fr));
  }
  .dashboard-day-pill {
    min-height: 68px;
  }
}
@media (max-width: 576px) {
  .dashboard-week-scroll-hint {
    display: flex;
  }
  .dashboard-day-pills {
    grid-template-columns: repeat(7, minmax(4.85rem, 1fr));
    gap: 0.25rem;
  }
  .dashboard-day-pill {
    min-height: 64px;
    padding: 0.3rem 0.25rem;
  }
  .dashboard-pill-date {
    align-items: center;
    flex-direction: column;
    gap: 0.05rem;
  }
  .dashboard-pill-day {
    font-size: 0.76rem;
  }
  .dashboard-pill-number {
    font-size: 0.58rem;
  }
  .dashboard-pill-shift .cell-shift {
    min-width: 1.75rem;
    padding: 0.12rem 0.28rem;
    font-size: 0.68rem;
  }
  .dashboard-pill-time {
    font-size: 0.62rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .dashboard-pill-empty {
    border-radius: 8px;
    font-size: 0.62rem;
    min-height: 1.4rem;
  }
}

.quick-actions-card {
  overflow: hidden;
}
.quick-actions-title {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 0.75rem;
}
.quick-actions-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.quick-action-btn {
  --quick-accent: #3b82f6;
  --quick-accent-strong: #2563eb;
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--quick-accent) 28%, transparent), color-mix(in srgb, var(--quick-accent-strong) 12%, transparent)),
    color-mix(in srgb, var(--card-bg) 88%, var(--quick-accent));
  border: 1px solid color-mix(in srgb, var(--quick-accent) 58%, var(--border));
  border-radius: 16px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--quick-accent) 18%, transparent);
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  font-weight: 800;
  gap: 0.4rem;
  justify-content: center;
  line-height: 1.15;
  min-height: 5.25rem;
  padding: 0.85rem 0.55rem;
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.quick-action-btn:hover,
.quick-action-btn:focus-visible {
  background: linear-gradient(135deg, var(--quick-accent), var(--quick-accent-strong));
  border-color: color-mix(in srgb, var(--quick-accent) 75%, white);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--quick-accent) 34%, transparent);
  color: #fff;
  transform: translateY(-2px);
}
.quick-action-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--quick-accent) 38%, white);
  outline-offset: 2px;
}
.quick-action-icon {
  align-items: center;
  background: color-mix(in srgb, var(--quick-accent) 16%, transparent);
  border-radius: 999px;
  display: inline-flex;
  font-size: 1.35rem;
  height: 2.35rem;
  justify-content: center;
  width: 2.35rem;
}
.quick-action-btn:hover .quick-action-icon,
.quick-action-btn:focus-visible .quick-action-icon {
  background: rgba(255, 255, 255, 0.2);
}
.quick-action-btn--vacation { --quick-accent: #2563eb; --quick-accent-strong: #7c3aed; }
.quick-action-btn--swap { --quick-accent: #0891b2; --quick-accent-strong: #0f766e; }
.quick-action-btn--overtime { --quick-accent: #f59e0b; --quick-accent-strong: #ea580c; }
.quick-action-btn--requests { --quick-accent: #22c55e; --quick-accent-strong: #16a34a; }
@media (max-width: 420px) {
  .quick-actions-grid {
    gap: 0.5rem;
  }
  .quick-action-btn {
    border-radius: 14px;
    font-size: 0.82rem;
    min-height: 4.65rem;
    padding: 0.7rem 0.35rem;
  }
  .quick-action-icon {
    font-size: 1.1rem;
    height: 2rem;
    width: 2rem;
  }
}

/* Initialer Ladezustand und Login-Karte: kompakt halten, auch nach dem Ersetzen des Inhalts durch das Login-Formular. */
.app-loading-card {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-top: min(22vh, 12rem);
  max-width: 400px;
  min-height: 14rem;
  width: min(100%, 400px);
}
.app-loading-state,
#login-form,
#login-error {
  width: 100%;
}
#login-form input:not([type="checkbox"]),
#login-form button {
  width: 100%;
}
.app-loading-timeout {
  animation: app-loading-timeout-visible 0.01s linear 10s forwards;
  margin-top: 1rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
}
@keyframes app-loading-timeout-visible {
  to {
    max-height: 12rem;
    opacity: 1;
    visibility: visible;
  }
}

/* Darkmode-Kontrast fuer farbige Schnellaktionsbuttons auf der Startseite. */
body.dark-mode .quick-action-btn {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--quick-accent) 18%, transparent), color-mix(in srgb, var(--quick-accent-strong) 10%, transparent)),
    color-mix(in srgb, var(--card-bg) 92%, #020617);
  border-color: color-mix(in srgb, var(--quick-accent) 78%, var(--border));
  box-shadow: 0 10px 24px color-mix(in srgb, #000 42%, transparent);
  color: #f8fafc;
}
body.dark-mode .quick-action-btn .quick-action-icon {
  background: color-mix(in srgb, var(--quick-accent) 22%, #f8fafc);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 40%, transparent);
  color: color-mix(in srgb, var(--quick-accent) 72%, #020617);
}
body.dark-mode .quick-action-btn .quick-action-icon .bi {
  color: color-mix(in srgb, var(--quick-accent) 72%, #020617);
}
body.dark-mode .quick-action-btn:hover,
body.dark-mode .quick-action-btn:focus-visible {
  background: linear-gradient(135deg, var(--quick-accent), var(--quick-accent-strong));
  border-color: color-mix(in srgb, var(--quick-accent) 72%, #fff);
  box-shadow: 0 16px 32px color-mix(in srgb, #000 42%, transparent);
  color: #fff;
}
body.dark-mode .quick-action-btn:hover .quick-action-icon,
body.dark-mode .quick-action-btn:focus-visible .quick-action-icon {
  background: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
body.dark-mode .quick-action-btn:hover .quick-action-icon .bi,
body.dark-mode .quick-action-btn:focus-visible .quick-action-icon .bi {
  color: #fff;
}

/* Update-Historie/Patchnotes im Darkmode lesbar halten. */
body.dark-mode #update-history-accordion .accordion-item,
body.dark-mode #update-history-accordion .accordion-button,
body.dark-mode #update-history-accordion .accordion-body {
  background-color: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}
body.dark-mode #update-history-accordion .accordion-button:not(.collapsed) {
  background-color: color-mix(in srgb, var(--button-primary) 34%, var(--card-bg));
  color: #fff;
}
body.dark-mode #update-history-accordion pre {
  background-color: #111827 !important;
  border-color: var(--border) !important;
  color: #e5e7eb;
}

/* Persönliche Zeitübersicht ist ausschließlich für den Browser-Druck sichtbar. */
.personal-print-view {
  display: none;
}

@media print {
  @page { margin: 14mm; size: A4 landscape; }
  html, body, body.dark-mode, body.print-light-mode { background: #fff !important; color: #111827 !important; color-scheme: light !important; }
  body > *:not(.personal-print-view) { display: none !important; }
  .personal-print-view[aria-hidden="false"] {
    background: #fff !important;
    color: #111827;
    display: block !important;
    font-family: Arial, sans-serif;
    font-size: 9pt;
  }
  .personal-print-header {
    align-items: flex-end;
    border-bottom: 2px solid #1e3a5f;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8mm;
    padding-bottom: 4mm;
  }
  .personal-print-brand { align-items: center; display: flex; gap: 5mm; }
  .personal-print-brand img { height: 18mm; object-fit: contain; width: auto; }
  .personal-print-header h1 { font-size: 22pt; margin: 1mm 0 0; }
  .personal-print-kicker { color: #475569; font-size: 8pt; letter-spacing: .08em; text-transform: uppercase; }
  .personal-print-meta { line-height: 1.5; text-align: right; }
  .personal-print-balance {
    background: #eef4fa;
    border-left: 5px solid #1e3a5f;
    display: flex;
    justify-content: space-between;
    margin-bottom: 7mm;
    padding: 4mm 5mm;
  }
  .personal-print-balance span { font-size: 11pt; }
  .personal-print-balance strong { font-size: 15pt; }
  .personal-print-view section { break-inside: avoid; margin-bottom: 7mm; }
  .personal-print-view h2 { font-size: 13pt; margin: 0 0 2mm; }
  .personal-print-description { color: #475569; margin: -1mm 0 2mm; }
  .personal-print-certificate { font-size: 11pt; line-height: 1.55; margin: 0 0 8mm; }
  .personal-print-signature { display: flex; gap: 18mm; justify-content: flex-end; margin: 18mm 0 8mm; }
  .personal-print-signature span { border-top: 1px solid #334155; min-width: 55mm; padding-top: 2mm; }
  .personal-print-view table { border-collapse: collapse; width: 100%; }
  .personal-print-view th, .personal-print-view td { border: 1px solid #94a3b8; padding: 2.2mm; text-align: left; vertical-align: top; }
  .personal-print-view th { background: #e2e8f0 !important; color: #111827 !important; font-weight: 700; }
  .personal-print-view td { background: #fff !important; color: #111827 !important; }
  .personal-print-view tr { break-inside: avoid; }
  .personal-print-view .text-end { text-align: right; }
  .personal-print-view .print-empty { color: #64748b; padding: 5mm; text-align: center; }
  .personal-print-view footer { border-top: 1px solid #cbd5e1; color: #64748b; font-size: 8pt; margin-top: 8mm; padding-top: 2mm; }
}
