/* Metha App CSS Bundle – generiert, nicht von Hand editieren */
/* Quellen: assets/app.css, assets/header-2.css, assets/timesheet.css, assets/plan_print.css */
/* Generiert: 2026-11-18T08:52:34+00:00 */

/* ==== assets/app.css ==== */
:root {
  --ink: #1c1a17;
  --muted: #5c564c;
  --line: #d2ddd8;
  --accent: #0f6a5a;
  --accent-soft: rgba(15, 106, 90, 0.12);
  /* Pastell / dezent (Standard) */
  --fd: #f5e6a8;
  --fd-ink: #5c4a0c;
  --sd: #f5c4c0;
  --sd-ink: #7a1f1a;
  --nd: #c5d4f0;
  --nd-ink: #1a3a6e;
  --td: #efe8c8;
  --td-ink: #5c4a0c;
  --we: #ddd5ef;
  --we-ink: #3d3164;
  --vac: #f5c6d8;
  --vac-ink: #7a1f4a;
  --off: #c8e6c9;
  --off-ink: #1b5e20;
  --sick: #dcc8ec;
  --sick-ink: #4a148c;
  --surface: rgba(255, 255, 255, 0.72);
  --bg0: #efe8dc;
  --bg1: #f7f4ef;
  --bg2: #e7f0ed;
  --mine-ring: #0f6a5a;
  --mine-glow: rgba(15, 106, 90, 0.22);
  --header-bg: rgba(247, 244, 239, 0.88);
}

body[data-color-world="bold"] {
  --fd: #c9a227;
  --fd-ink: #ffffff;
  --sd: #c62828;
  --sd-ink: #ffffff;
  --nd: #1565c0;
  --nd-ink: #ffffff;
  --td: #7a5c0c;
  --td-ink: #ffffff;
  --we: #3d2d7a;
  --we-ink: #ffffff;
  --vac: #c2185b;
  --vac-ink: #ffffff;
  --off: #2e7d32;
  --off-ink: #ffffff;
  --sick: #6a1b9a;
  --sick-ink: #ffffff;
}

body[data-theme="dark"] {
  --ink: #e8e6e1;
  --muted: #a8a297;
  --line: #3a4540;
  --accent: #3dba9f;
  --accent-soft: rgba(61, 186, 159, 0.18);
  --surface: rgba(28, 32, 30, 0.82);
  --bg0: #141816;
  --bg1: #1a201c;
  --bg2: #1e2824;
  --mine-ring: #5ee0c0;
  --mine-glow: rgba(94, 224, 192, 0.28);
  --header-bg: rgba(22, 28, 26, 0.92);
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* App-Links: dezent, Markenfarbe, ohne Layout-Sprung */
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover {
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Buttons / Nav / Logo / Badges behalten eigene Styles */
a.btn,
button.btn,
a.cta-key,
a.logo-home,
a.header-logout,
a.header-wish-badge,
a.print-action,
a.card-link,
a.sheet-link,
a.nav-toggle {
  text-decoration: none;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(15, 106, 90, 0.12), transparent 55%),
    linear-gradient(160deg, var(--bg0) 0%, var(--bg1) 45%, var(--bg2) 100%);
}

body[data-theme="dark"] {
  background:
    radial-gradient(1000px 420px at 12% -8%, rgba(61, 186, 159, 0.14), transparent 55%),
    linear-gradient(160deg, var(--bg0) 0%, var(--bg1) 50%, var(--bg2) 100%);
}

/* Helle Flächen im Darkmode: Text immer dunkel (Buttons, Selects, Kalenderregister) */
body[data-theme="dark"] .btn:not(.btn-primary),
body[data-theme="dark"] .btn-disabled,
body[data-theme="dark"] select,
body[data-theme="dark"] .login-form input,
body[data-theme="dark"] .login-form select,
body[data-theme="dark"] .dept-pick-option,
body[data-theme="dark"] .stack-form input[type="date"],
body[data-theme="dark"] .stack-form input[type="text"],
body[data-theme="dark"] .stack-form textarea,
body[data-theme="dark"] .duty-extra-memo textarea {
  color: #1c1a17;
}
body[data-theme="dark"] .btn:not(.btn-primary):hover {
  color: #0a4f43;
  border-color: #0f6a5a;
}
body[data-theme="dark"] .btn.is-active:not(.btn-primary):not(.btn-admin):not(.btn-superadmin) {
  color: #0a4f43;
  background: rgba(15, 106, 90, 0.14);
  border-color: #0f6a5a;
}
body[data-theme="dark"] .btn.btn-primary,
body[data-theme="dark"] .login-form .btn-primary,
body[data-theme="dark"] .push-prefs-form .btn-primary {
  background: #2a9b82;
  color: #0b1f1a;
  font-weight: 650;
}
body[data-theme="dark"] .btn-admin,
body[data-theme="dark"] .btn-admin:hover,
body[data-theme="dark"] .btn-admin.is-active {
  color: #534400;
}
body[data-theme="dark"] .btn-superadmin,
body[data-theme="dark"] .btn-superadmin:hover,
body[data-theme="dark"] .btn-superadmin.is-active {
  color: #5c2e00;
}

/* Kalenderregister (Kopfzeile + Datums-Spalte) bleibt hell → dunkle Schrift */
body[data-theme="dark"] .compact-wrap {
  background: rgba(243, 247, 245, 0.92);
}
body[data-theme="dark"] .compact thead th,
body[data-theme="dark"] .compact .sticky-col,
body[data-theme="dark"] .compact tbody th.sticky-col {
  color: #1c1a17;
  background: #f3f7f5;
}
body[data-theme="dark"] .compact thead th {
  color: #3d3830;
}
body[data-theme="dark"] .compact .day-hours,
body[data-theme="dark"] .compact .sticky-col .meta {
  color: #5c564c;
}
body[data-theme="dark"] .compact tr.is-weekend td,
body[data-theme="dark"] .compact tr.is-weekend th.sticky-col {
  background: #e8e2f4;
  color: #1c1a17;
}
body[data-theme="dark"] .day-head {
  background: rgba(15, 106, 90, 0.12);
}
body[data-theme="dark"] .day-head h3 {
  color: #e8e6e1;
}
body[data-theme="dark"] .day-head .meta {
  color: #a8a297;
}

body {
  padding: 0 0 5rem;
}

.header-rule-alert {
  margin: 0.55rem 0.75rem 0;
  padding: 0.45rem 0.75rem;
  border: 2px solid #b42318;
  background: #fff8f7;
  color: #7a1f1f;
  box-shadow: 0 1px 0 rgba(180, 35, 24, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}
.header-rule-alert[hidden] {
  display: none;
}
.header-rule-alert__title {
  display: inline;
  font-size: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 0;
  color: #912018;
  white-space: nowrap;
}
.header-rule-alert__list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
}
.header-rule-alert__list li {
  margin: 0;
  white-space: nowrap;
}
.header-rule-alert__list li + li::before {
  content: '·';
  margin-right: 0.65rem;
  opacity: 0.7;
}
.header-rule-alert__text {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
}
.header-rule-alert__hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #912018;
  opacity: 0.92;
  white-space: nowrap;
}

.header-user {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
  line-height: 1.25;
  flex-shrink: 0;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.55rem;
  white-space: nowrap;
}
.header-user > * {
  flex-shrink: 0;
}
.header-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #0a4f43;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
body[data-theme="dark"] .header-user-avatar {
  background: #0f6a5a;
  color: #ffffff;
}
.header-user strong {
  color: var(--ink);
  font-weight: 600;
}
.header-user-email {
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 400;
  margin-left: 0.2rem;
}
.header-user-email::before {
  content: "(";
}
.header-user-email::after {
  content: ")";
}
.header-user small {
  color: var(--accent);
  font-weight: 600;
  margin-left: 0.15rem;
}
.header-messages {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid transparent;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.header-messages:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  text-decoration: none;
}
.header-messages-icon {
  display: block;
  flex-shrink: 0;
}
.header-messages-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  box-shadow: 0 0 0 1.5px var(--surface, #fff);
}
.msg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 1rem;
}
.msg-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.45rem;
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.msg-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.msg-tab-badge {
  min-width: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.15rem;
  text-align: center;
}
.msg-tab.is-active .msg-tab-badge {
  background: #fff;
  color: #c0392b;
}
.msg-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 0.85rem;
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.msg-filter {
  padding: 0.35rem 0.85rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-right: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
}
.msg-filter:last-child {
  border-right: 0;
}
.msg-filter.is-active {
  background: var(--accent-soft, #e8f5f1);
  color: var(--accent);
}
.msg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.msg-list--compact {
  gap: 0.25rem;
}
.msg-row {
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius: 0.4rem;
  background: var(--surface, #fff);
  overflow: hidden;
}
.msg-row.is-unread {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.msg-row.is-open {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.msg-row__line {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.55rem;
  padding: 0.35rem 0.55rem;
  min-height: 2.1rem;
  white-space: nowrap;
}
.msg-row__time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.msg-row__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.msg-row__title {
  flex-shrink: 0;
  font-size: 0.9rem;
}
.msg-row__preview {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}
.msg-row__open {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.msg-row__open--swap {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-delete-form {
  flex-shrink: 0;
  margin: 0;
}
.msg-row__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.msg-row__delete:hover {
  background: color-mix(in srgb, #c0392b 14%, transparent);
  color: #c0392b;
}
.msg-row__detail {
  padding: 0.55rem 0.7rem 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
  white-space: normal;
  font-size: 0.9rem;
}
.msg-row__detail-actions {
  margin: 0.65rem 0 0;
}
.msg-toggle-form {
  flex-shrink: 0;
  margin: 0;
}
.msg-toggle {
  position: relative;
  width: 2.1rem;
  height: 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, #ccc);
  cursor: pointer;
  vertical-align: middle;
}
.msg-toggle.is-on {
  background: var(--accent);
}
.msg-toggle__knob {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.msg-toggle.is-on .msg-toggle__knob {
  transform: translateX(0.9rem);
}
.swap-admin-block {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--accent-soft, #e8f5f1) 55%, #fff);
}
.swap-admin-block h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.swap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.swap-row {
  border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  border-radius: 0.45rem;
  padding: 0.45rem 0.65rem;
  background: var(--surface, #fff);
}
.swap-row.is-focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.swap-row__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  white-space: nowrap;
  font-size: 0.9rem;
}
.swap-status {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: lowercase;
}
.swap-status--is-pending {
  background: color-mix(in srgb, #e67e22 22%, #fff);
  color: #a85a0a;
}
.swap-status--is-ok {
  background: color-mix(in srgb, var(--accent) 20%, #fff);
  color: var(--accent);
}
.swap-status--is-bad {
  background: color-mix(in srgb, #c0392b 18%, #fff);
  color: #922b21;
}
.swap-dir {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.swap-summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.swap-row__actions {
  margin-top: 0.45rem;
  gap: 0.4rem;
}
.swap-own-duty,
.swap-colleague-duty {
  margin: 0.35rem 0 0.75rem;
  font-weight: 600;
}
.vac-balance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.5rem 0 0;
}
.vac-balance__item {
  min-width: 5.5rem;
}
.vac-balance__label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.vac-balance__item strong {
  font-size: 1.25rem;
}
.vac-balance__item--accent strong {
  color: var(--accent);
}
.vac-kind {
  border: 0;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.vac-kind legend {
  font-weight: 600;
  margin-bottom: 0.35rem;
  padding: 0;
}
.vac-kind__opt,
.vac-check {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.95rem;
}
.vac-preview {
  margin: 0.75rem 0;
  padding: 0.65rem 0.8rem;
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.vac-preview p {
  margin: 0.2rem 0;
}
body.vacation-cal-page main {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
body.vacation-cal-page .panel {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.vac-cal-wrap {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}
.vac-cal-month {
  width: 100%;
  min-width: 0;
}
.vac-cal-month h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.vac-cal-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.vac-cal-table {
  border-collapse: collapse;
  font-size: 0.7rem;
  width: max-content;
  min-width: 100%;
  max-width: none;
}
.vac-cal-table th,
.vac-cal-table td {
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  text-align: center;
  min-width: 1.2rem;
  padding: 0.05rem 0.075rem;
}
.vac-cal-table .vac-cal-name {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface, #fff);
  z-index: 1;
  min-width: 7rem;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.05rem 0.075rem 0.05rem 0.18rem;
}
.vac-cal-table tbody td {
  background: var(--surface, #fff);
}
.vac-cal-table .is-we {
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}
.vac-cal-table tbody td.is-we {
  background: color-mix(in srgb, var(--muted) 10%, var(--surface, #fff));
}
.vac-cal-table td.is-u {
  background: color-mix(in srgb, #c2185b 35%, #fff);
  font-weight: 700;
  color: #880e4f;
}
.vac-cal-table td.is-s {
  background: color-mix(in srgb, #6a1b9a 32%, #fff);
  font-weight: 700;
  color: #4a148c;
}
.vac-cal-table td.is-p {
  background: color-mix(in srgb, #e67e22 30%, #fff);
  font-weight: 700;
  color: #a85a0a;
}
.vac-cal-table td.is-half {
  font-size: 0.85em;
}
.vac-cal-legend {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  font-weight: 700;
  font-size: 0.8rem;
}
.vac-cal-legend--u {
  background: color-mix(in srgb, #c2185b 35%, #fff);
  color: #880e4f;
}
.vac-cal-legend--p,
.vac-cal-legend--ph {
  background: color-mix(in srgb, #e67e22 30%, #fff);
  color: #a85a0a;
}
.vac-cal-legend--half {
  background: color-mix(in srgb, #c2185b 28%, #fff);
  color: #880e4f;
}
.vac-cal-legend--s {
  background: color-mix(in srgb, #6a1b9a 28%, #fff);
  color: #4a148c;
}
.vac-cal-legend--hol {
  background: color-mix(in srgb, #ef6c00 35%, #fff);
  color: #e65100;
}
.vac-cal-table thead th {
  background: color-mix(in srgb, var(--ink) 12%, var(--surface, #fff));
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid color-mix(in srgb, var(--ink) 28%, transparent);
}
.vac-cal-table thead th.is-we {
  background: color-mix(in srgb, var(--ink) 18%, var(--surface, #fff));
}
.vac-cal-table thead .vac-cal-name {
  background: color-mix(in srgb, var(--ink) 12%, var(--surface, #fff));
  z-index: 2;
}
.vac-cal-table tfoot th,
.vac-cal-table tfoot td {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, #1565c0 22%, var(--surface, #fff));
  border-top: 2px solid color-mix(in srgb, #1565c0 50%, transparent);
  color: #0d47a1;
}
.vac-cal-table tfoot .vac-cal-name {
  background: color-mix(in srgb, #1565c0 22%, var(--surface, #fff));
  z-index: 2;
}
.vac-cal-table tfoot .is-we {
  background: color-mix(in srgb, #1565c0 32%, var(--surface, #fff));
}
.vac-cal-table tfoot td.is-sum-off {
  background: color-mix(in srgb, #c2185b 32%, #fff);
  color: #880e4f;
}
.vac-cal-table tfoot td.is-sum-none {
  background: color-mix(in srgb, #c62828 34%, #fff);
  color: #b71c1c;
}
.vac-cal-table tbody td.is-hol:not(.is-u):not(.is-p) {
  background: color-mix(in srgb, #ef6c00 28%, var(--surface, #fff));
  color: #e65100;
}
.vac-cal-table tbody td.is-we.is-hol:not(.is-u):not(.is-p) {
  background: color-mix(in srgb, #ef6c00 22%, color-mix(in srgb, var(--muted) 10%, var(--surface, #fff)));
}
.vac-cal-table thead th.is-hol {
  background: color-mix(in srgb, #ef6c00 32%, var(--surface, #fff));
  color: #e65100;
  font-weight: 800;
  border-bottom-color: color-mix(in srgb, #ef6c00 55%, transparent);
}
.vac-cal-table tfoot td.is-hol:not(.is-sum-off):not(.is-sum-none) {
  background: color-mix(in srgb, #ef6c00 35%, color-mix(in srgb, #1565c0 18%, var(--surface, #fff)));
  color: #e65100;
}
body[data-theme="dark"] .vac-cal-table thead th,
body[data-theme="dark"] .vac-cal-table thead .vac-cal-name {
  background: color-mix(in srgb, var(--bg1) 75%, #000);
}
body[data-theme="dark"] .vac-cal-table thead th.is-hol {
  background: color-mix(in srgb, #ef6c00 40%, #111);
  color: #ffb74d;
}
body[data-theme="dark"] .vac-cal-table tfoot th,
body[data-theme="dark"] .vac-cal-table tfoot td,
body[data-theme="dark"] .vac-cal-table tfoot .vac-cal-name {
  background: color-mix(in srgb, #1565c0 35%, #111);
  color: #90caf9;
}
.header-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.header-logout:hover {
  text-decoration: underline;
}
.header-logout-icon {
  display: block;
  flex-shrink: 0;
  transform: rotate(180deg);
}
.header-logout--icon {
  vertical-align: middle;
  width: 2rem;
  height: 2rem;
  justify-content: center;
  border-radius: 0.45rem;
  border: 1px solid transparent;
  color: var(--accent);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.header-logout--icon:hover {
  text-decoration: none;
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}
.theme-switch-form {
  display: inline-flex;
  margin: 0;
}
.header-theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}
.header-theme-toggle:hover {
  border-color: var(--accent);
}
.header-wish-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.15rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 92, 28, 0.35);
  color: #9a4d1c;
  background: rgba(154, 77, 28, 0.08);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}
.header-wish-badge:hover {
  background: rgba(154, 77, 28, 0.16);
  text-decoration: none;
  color: #9a4d1c;
}
.header-wish-badge.is-active {
  border-color: rgba(196, 92, 28, 0.55);
  background: rgba(196, 92, 28, 0.18);
}
.header-wish-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #c45c1c;
  color: #fff;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.nav-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-left: auto;
}
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0.45rem 0.75rem 0;
  padding: 0.35rem 0.15rem;
}

.nav-tools .print-action {
  flex: 0 0 auto;
}

.print-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  cursor: pointer;
}
.print-action:hover {
  text-decoration: underline;
}
.print-action .icon-print {
  display: block;
  flex-shrink: 0;
}

.btn .icon-print {
  display: inline-block;
  vertical-align: -0.2em;
  margin-right: 0.3rem;
  flex-shrink: 0;
}

.plan-month-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0 0 0.65rem;
}
.plan-month-bar .plan-month-title {
  margin: 0;
  flex: 1 1 auto;
  text-align: center;
}
.plan-month-select-form {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  margin: 0;
  min-width: 0;
}
.plan-month-select {
  max-width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.25rem 0.55rem;
  min-height: 2.2rem;
}
.plan-month-bar .month-adj {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.3;
}
.plan-month-bar .month-adj:hover {
  color: var(--accent);
  text-decoration: underline;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}
.panel-toolbar h2 {
  margin: 0;
  flex: 1 1 auto;
}
.panel-toolbar .print-action {
  flex: 0 0 auto;
}

.btn, .btn-disabled, select {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  border-radius: 0;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.btn-disabled { opacity: 0.4; }

/* Admin = gelb, Super-Admin = orange */
.btn-admin {
  background: #fff6cc;
  border-color: #e0c84a;
  color: #6a5800;
}
.btn-admin:hover {
  border-color: #c9a800;
  color: #534400;
  background: #ffef9a;
}
.btn-admin.is-active {
  background: #ffe566;
  border-color: #c9a800;
  color: #534400;
}
.btn-superadmin {
  background: #ffe0c2;
  border-color: #e8954a;
  color: #7a3d00;
}
.btn-superadmin:hover {
  border-color: #d07020;
  color: #5c2e00;
  background: #ffd1a3;
}
.btn-superadmin.is-active {
  background: #ffb86b;
  border-color: #d07020;
  color: #5c2e00;
}
.header-user small.badge-admin {
  color: #6a5800;
  background: #fff6cc;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}
.header-user small.badge-superadmin {
  color: #7a3d00;
  background: #ffe0c2;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.view-as-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.view-as-select {
  min-width: 9rem;
  max-width: 12rem;
  min-height: 2rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
}
.view-as-active {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
}
.header-user small.badge-viewas {
  color: #5c2e00;
  background: #ffd1a3;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  margin-left: 0;
}
.header-user small.badge-dept {
  color: #1d4a5c;
  background: #d7eaf1;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}
.persona-switch-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.persona-switch-select {
  min-width: 8rem;
  max-width: 12rem;
  min-height: 2rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
}
.header-lang-select {
  min-width: 6.5rem;
  max-width: 10rem;
}
.footer-link-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.footer-link-btn:hover {
  color: var(--accent, #0f6a5a);
}
#error-report-dialog {
  max-width: 28rem;
  width: calc(100% - 1.5rem);
}
.persona-switch-submit {
  min-height: 2rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.view-as-exit {
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
}

select { min-width: 10rem; }

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
}
.legend--below-plan {
  margin-top: 0.75rem;
}

.legend i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.3rem;
  vertical-align: -0.05rem;
}

.legend .fd { background: var(--fd); color: var(--fd-ink); }
.legend .sd { background: var(--sd); color: var(--sd-ink); }
.legend .nd { background: var(--nd); color: var(--nd-ink); }
.legend .we { background: var(--we); color: var(--we-ink); }
.legend .vac { background: var(--vac); color: var(--vac-ink); }
.legend .off { background: var(--off); color: var(--off-ink); }
.legend .sick { background: var(--sick); color: var(--sick-ink); }
.legend .count-ok-swatch { background: #b7e0c2; }
.legend .count-warn-swatch { background: #f0d39a; }
.legend .count-bad-swatch { background: #efb4a8; }

.compact-wrap {
  overflow: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  margin-top: 0.75rem;
}

.compact {
  border-collapse: collapse;
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.compact th,
.compact td {
  border: 1px solid var(--line);
  padding: 0.28rem 0.15rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* MA-Spalten: feste Breite */
.compact thead th:not(.sticky-col):not(.count-col),
.compact tbody td:not(.count-col) {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  box-sizing: border-box;
}

.compact thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f7f5;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.72rem;
}

.compact .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f3f7f5;
  text-align: left;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  width: 5.8rem;
  min-width: 5.8rem;
  max-width: 5.8rem;
  font-weight: 600;
  white-space: normal;
  line-height: 1.15;
  overflow: hidden;
}

.compact .sticky-col .day-full,
.compact .sticky-col .day-short {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.compact .sticky-col .day-full {
  display: inline-block;
}
.compact .day-short {
  display: none;
}

.compact .day-hours {
  display: inline;
  margin-top: 0;
  font-size: 0.52rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact .day-hours.is-closed {
  font-style: italic;
  opacity: 0.85;
}

.compact td .cell-shift-time,
.compact .cell-edit .cell-shift-time {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.58rem;
  font-weight: 500;
  line-height: 1.1;
  color: inherit;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.compact .cell-edit .cell-shift-time[hidden] {
  display: none;
}

.compact thead .sticky-col {
  z-index: 4;
}

.compact tbody th.sticky-col {
  background: #f7f4ef;
}

.compact tr.is-weekend td,
.compact tr.is-weekend th.sticky-col {
  background: #e8e2f4;
}

.compact tr.is-today th.sticky-col {
  box-shadow: inset 3px 0 0 var(--accent);
}

.compact td.cell-fd { background: var(--fd); color: var(--fd-ink); font-weight: 700; }
.compact td.cell-m { background: var(--td); color: var(--td-ink); font-weight: 700; }
.compact td.cell-sd { background: var(--sd); color: var(--sd-ink); font-weight: 700; }
.compact td.cell-nd { background: var(--nd); color: var(--nd-ink); font-weight: 700; }
.compact td.cell-we { background: var(--we); color: var(--we-ink); font-weight: 700; }
.compact td.cell-vacation { background: var(--vac); color: var(--vac-ink); font-weight: 700; }
.compact td.cell-off { background: var(--off); color: var(--off-ink); font-weight: 600; }
.compact td.cell-cancelled,
.compact td.cell-cancelled.cell-editable {
  background: var(--sick) !important;
  color: var(--sick-ink) !important;
  font-weight: 700;
}

.compact td[data-shift-color] {
  background: var(--shift-bg) !important;
  color: var(--shift-fg, #1c1a17) !important;
  font-weight: 700;
}
.compact td.empty-cell { background: transparent; }

/* Eigene Spalte / eigene Tage hervorheben */
.compact th.is-me-col {
  box-shadow: inset 0 -3px 0 var(--mine-ring);
  position: relative;
}
.compact th.is-me-col::after {
  content: "";
  position: absolute;
  left: 0.2rem;
  right: 0.2rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 1px;
  background: var(--mine-ring);
  opacity: 0.85;
}
.compact td.cell-mine {
  outline: 2px solid var(--mine-ring);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px var(--mine-glow);
  position: relative;
  z-index: 1;
}
.compact td.cell-mine.empty-cell {
  background: var(--mine-glow) !important;
  outline-style: dashed;
}

.compact tr.is-weekend td.cell-fd { filter: brightness(0.96); }
.compact tr.is-weekend td.cell-m { filter: brightness(0.96); }
.compact tr.is-weekend td.cell-sd { filter: brightness(0.96); }
.compact tr.is-weekend td.cell-nd { filter: brightness(0.96); }
.compact tr.is-weekend td.cell-we { filter: brightness(0.96); }
.compact tr.is-weekend td.cell-vacation { filter: brightness(0.96); }
.compact tr.is-weekend td.cell-off { filter: brightness(0.96); }

.compact .count-col {
  width: 2.8rem;
  min-width: 2.8rem;
  max-width: 2.8rem;
  font-weight: 700;
}

.compact td.count-ok { background: #b7e0c2 !important; color: #1d5a2f; }
.compact td.count-warn { background: #f0d39a !important; color: #6a4a10; }
.compact td.count-bad { background: #efb4a8 !important; color: #6e2618; }

.hours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}

.hours-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  padding: 0.55rem 0.65rem;
}

.hours-card strong { display: block; font-size: 0.95rem; }
.hours-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.sheet-note {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.sheet-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-variant-numeric: tabular-nums;
}

.sheet th,
.sheet td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  white-space: nowrap;
}

.sheet th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.sheet td .sub {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.sheet a.sheet-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.sheet a.sheet-link:hover {
  text-decoration: underline;
}

.sheet-note a {
  color: var(--accent);
}

.sheet td.pos { color: var(--accent); font-weight: 600; }
.sheet td.neg { color: #8a3b2b; font-weight: 600; }

.day {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  margin-bottom: 0.7rem;
  overflow: hidden;
}

.day.is-today {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.day-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.65rem 0.8rem;
  background: rgba(15, 106, 90, 0.06);
  border-bottom: 1px solid var(--line);
}

.day-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.day-head .meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.duty-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.duty-list li {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.duty-list li:last-child { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}

.badge.FD, .badge.F1, .badge.F2 { background: var(--fd); color: var(--fd-ink); }
.badge.TD, .badge.M { background: var(--td); color: var(--td-ink); }
.badge.SD, .badge.S1, .badge.S2, .badge.S3 { background: var(--sd); color: var(--sd-ink); }
.badge.ND, .badge.N1, .badge.N2 { background: var(--nd); color: var(--nd-ink); }
.badge.WE, .badge.WEF, .badge.WES { background: var(--we); color: var(--we-ink); }
.badge.VAC, .badge.U { background: var(--vac); color: var(--vac-ink); }
.badge.OFF { background: var(--off); color: var(--off-ink); }
.badge.K, .badge.SICK { background: var(--sick); color: var(--sick-ink); }

.person { font-weight: 600; }
.times {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.hours {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.empty {
  padding: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.install-hint {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 920px;
  margin: 0 auto;
  background: #123d36;
  color: #f4f7f5;
  padding: 0.75rem 0.9rem;
  display: none;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
}

.install-hint.show { display: flex; }
.install-hint.update-hint {
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  background: #0f6a5a;
  z-index: 40;
}
.install-hint.push-hint { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
.install-hint button {
  border: 0;
  background: #fff;
  color: #123d36;
  font: inherit;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  min-height: 2.4rem;
}
#push-deny {
  background: transparent;
  color: #f4f7f5;
  border: 1px solid rgba(244, 247, 245, 0.45);
}
.app-version-meta {
  text-align: center;
  color: var(--muted, #6a7a76);
  font-size: 0.72rem;
  margin: 0.5rem 1rem 1.25rem;
}

.scroll-hint {
  display: none;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .nav-tools {
    width: 100%;
    margin-left: 0;
    margin-top: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
  }

  .nav-tools .print-action {
    flex: 0 0 auto;
  }

  .nav-tools form {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    width: auto;
  }

  .nav-tools select {
    width: 100%;
    min-width: 0;
  }

  select {
    min-width: 0;
    width: 100%;
  }

  main {
    padding: 0.75rem;
  }

  .panel {
    padding: 0.75rem;
  }

  .legend {
    font-size: 0.78rem;
    gap: 0.4rem 0.65rem;
  }

  .scroll-hint {
    display: block;
  }

  .compact-wrap {
    max-height: min(70vh, 32rem);
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }

  .compact {
    font-size: 0.72rem;
  }

  .compact th,
  .compact td {
    padding: 0.32rem 0.1rem;
  }

  .compact thead th:not(.sticky-col):not(.count-col),
  .compact tbody td:not(.count-col) {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
  }

  .compact .sticky-col {
    width: 2.6rem;
    min-width: 2.6rem;
    max-width: 2.6rem;
    font-size: 0.7rem;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }

  .compact .count-col {
    width: 2.4rem;
    min-width: 2.4rem;
    max-width: 2.4rem;
  }

  .compact .day-full,
  .compact .sticky-col .day-full {
    display: none;
  }

  .compact .day-short,
  .compact .sticky-col .day-short {
    display: inline-block;
  }

  .compact .day-hours {
    font-size: 0.48rem;
  }

  .sheet {
    min-width: 520px;
    font-size: 0.8rem;
  }

  .day-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .duty-list li {
    grid-template-columns: 2.8rem minmax(0, 1fr) auto;
    gap: 0.4rem 0.5rem;
  }

  .duty-list li .times {
    word-break: break-word;
  }

  .install-hint {
    left: 0.5rem;
    right: 0.5rem;
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    flex-wrap: wrap;
    padding: 0.65rem 0.75rem;
  }
}

@media (min-width: 720px) {
  .duty-list li {
    grid-template-columns: 3.6rem 1.2fr 1.4fr auto;
  }
  .times { margin-top: 0; }
}

.flash {
  margin: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.flash-ok { border-color: #2f7d4a; color: #1d5c36; background: rgba(47, 125, 74, 0.1); }
.flash-err { border-color: #a33; color: #7a1f1f; background: rgba(170, 50, 50, 0.1); }
.access-denied-panel {
  max-width: 36rem;
  border-color: color-mix(in srgb, #c62828 45%, var(--line));
  background: color-mix(in srgb, #c62828 6%, var(--surface, #fff));
}
.access-denied-panel h2 {
  color: #b71c1c;
  margin-bottom: 0.5rem;
}
.access-denied-panel__msg {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}
.flash-warn { border-color: #b8860b; color: #6b4e00; background: rgba(184, 134, 11, 0.12); }
.flash-status { border-color: #1d4ed8; color: #1e3a8a; background: rgba(29, 78, 216, 0.1); }

.billing-gate {
  margin: 1rem;
  max-width: 40rem;
}
.billing-gate__lead {
  font-size: 1.05rem;
  line-height: 1.45;
}
.billing-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}
.booking-page {
  padding: 1rem;
  max-width: 40rem;
}
.booking-auto-plan {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
}
.booking-auto-plan h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
.booking-form fieldset {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
}
.booking-plan {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.45rem 0;
  cursor: pointer;
}
.booking-form textarea {
  width: 100%;
  margin-top: 0.35rem;
}

.account-page {
  padding: 1rem;
  max-width: 52rem;
}
.account-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.22rem;
  margin: 0 0 1rem;
  width: fit-content;
  max-width: 100%;
  background: rgba(28, 26, 23, 0.045);
  border: 1px solid rgba(28, 26, 23, 0.05);
  border-radius: 0.7rem;
}
.account-subnav .btn:not(.btn-admin):not(.btn-superadmin) {
  border-radius: 0.5rem;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  min-height: 2.15rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.account-subnav .btn:not(.btn-admin):not(.btn-superadmin):hover {
  background: #fff;
  border-color: transparent;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(28, 26, 23, 0.1);
}
.account-subnav .btn:not(.btn-admin):not(.btn-superadmin).is-active {
  background: #fff;
  border-color: transparent;
  color: var(--accent);
  font-weight: 650;
  box-shadow:
    0 1px 2px rgba(28, 26, 23, 0.06),
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}
.account-subnav .btn-admin {
  border-radius: 0.5rem;
  background: #fff6cc;
  border-color: #e0c84a;
  color: #6a5800;
  box-shadow: none;
  min-height: 2.15rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.account-subnav .btn-admin:hover {
  border-color: #c9a800;
  color: #534400;
  background: #ffef9a;
  box-shadow: 0 1px 3px rgba(106, 88, 0, 0.18);
}
.account-subnav .btn-admin.is-active {
  background: #ffe566;
  border-color: #c9a800;
  color: #534400;
  box-shadow: 0 1px 3px rgba(106, 88, 0, 0.2);
}
.account-subnav .btn-superadmin {
  border-radius: 0.5rem;
  background: #ffe0c2;
  border-color: #e8954a;
  color: #7a3d00;
  box-shadow: none;
  min-height: 2.15rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.account-subnav .btn-superadmin:hover {
  border-color: #d07020;
  color: #5c2e00;
  background: #ffd1a3;
  box-shadow: 0 1px 3px rgba(122, 61, 0, 0.18);
}
.account-subnav .btn-superadmin.is-active {
  background: #ffb86b;
  border-color: #d07020;
  color: #5c2e00;
  box-shadow: 0 1px 3px rgba(122, 61, 0, 0.22);
}
body[data-theme="dark"] .account-subnav {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}
body[data-theme="dark"] .account-subnav .btn:not(.btn-admin):not(.btn-superadmin):hover,
body[data-theme="dark"] .account-subnav .btn:not(.btn-admin):not(.btn-superadmin).is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #e8f0ec;
  box-shadow: none;
}
body[data-theme="dark"] .account-subnav .btn:not(.btn-admin):not(.btn-superadmin).is-active {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
@media (max-width: 720px) {
  .account-subnav {
    width: 100%;
  }
}
.account-summary {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}
.account-summary .is-warn {
  color: #a33;
  font-weight: 700;
}
.account-form fieldset {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
}
.account-form label {
  display: block;
  margin: 0.45rem 0;
  font-weight: 600;
  font-size: 0.92rem;
}
.account-form input,
.account-form select,
.account-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--surface);
  color: var(--ink);
}
.account-form-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}
.account-form-row--street {
  grid-template-columns: minmax(0, 1fr) 5.5rem;
}
.account-form-row--loc {
  grid-template-columns: 5rem minmax(0, 1fr) minmax(8rem, 11rem);
}
.form-input-zip,
.account-form-row--loc > label:first-child input[name="zip"] {
  width: 5rem;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 560px) {
  .account-form-row,
  .account-form-row--street,
  .account-form-row--loc {
    grid-template-columns: 1fr;
  }
  .form-input-zip,
  .account-form-row--loc > label:first-child input[name="zip"] {
    width: 5rem;
  }
}

.account-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.account-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--surface, #fff) 88%, var(--bg1, #f7f4ef));
}
.account-list-main {
  flex: 1 1 14rem;
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}
.account-list-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}
.account-list-title strong {
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}
.account-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  color: var(--muted, #5c564c);
  font-size: 0.9rem;
}
.account-list-pay {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted, #5c564c);
}
.account-list-pay img {
  display: block;
  height: 1.35rem;
  width: auto;
  max-width: 2.6rem;
  object-fit: contain;
}
.account-list-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.account-list-amount {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  margin-right: 0.25rem;
}
.account-list-action {
  padding: 0.35rem 0.7rem;
  font-size: 0.88rem;
}
.account-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  border: 1px solid transparent;
}
.account-badge.is-ok {
  color: #0b5c45;
  background: color-mix(in srgb, #0f6a5a 14%, #fff);
  border-color: color-mix(in srgb, #0f6a5a 28%, transparent);
}
.account-badge.is-info {
  color: #1a4f7a;
  background: color-mix(in srgb, #2f6f9f 14%, #fff);
  border-color: color-mix(in srgb, #2f6f9f 28%, transparent);
}
.account-badge.is-bad {
  color: #8a2a2a;
  background: color-mix(in srgb, #b33 12%, #fff);
  border-color: color-mix(in srgb, #b33 26%, transparent);
}
.account-badge.is-muted {
  color: var(--muted, #5c564c);
  background: color-mix(in srgb, var(--line) 35%, #fff);
  border-color: var(--line);
}

/* daik.de Betreiber-Hinweis (Bestellbestätigung) */
.daik-operator-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0.95rem;
  border: 1px dashed var(--line, #ccc);
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--surface, #f7f6f3) 88%, #fff);
  color: var(--muted, #5c564c);
  font-size: 0.88rem;
  line-height: 1.45;
}
.daik-operator-note__logo {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  opacity: 0.92;
}
.daik-operator-note__logo img {
  display: block;
  height: 2rem;
  width: auto;
  max-width: 7.5rem;
  object-fit: contain;
}
.daik-operator-note__text {
  flex: 1 1 12rem;
  margin: 0;
  min-width: 0;
}
.daik-operator-note__text strong {
  color: var(--text, #222);
  font-weight: 600;
}

@media (max-width: 560px) {
  .account-list-aside {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
}

.checkout-page {
  padding: 1rem;
  max-width: 40rem;
}
.checkout-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.checkout-step {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  background: var(--surface);
}
.checkout-step.is-active {
  border-color: var(--accent, #0f6a5a);
  font-weight: 700;
}
.checkout-form fieldset {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
}
.checkout-interval {
  background: color-mix(in srgb, var(--accent, #0f6a5a) 6%, var(--surface, #fff));
}
.checkout-interval-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.checkout-interval-opt {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--surface, #fff);
  align-items: center;
}
.checkout-interval-opt:has(input:checked) {
  border-color: var(--accent, #0f6a5a);
  box-shadow: inset 0 0 0 1px var(--accent, #0f6a5a);
}
@media (max-width: 480px) {
  .checkout-interval-row { grid-template-columns: 1fr; }
}
.checkout-plan {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.55rem 0;
  cursor: pointer;
}
.checkout-plan-price {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--accent, #0f6a5a) 8%, var(--surface, #fff));
}
.checkout-price {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}
.checkout-price-alt {
  display: block;
  margin-top: 0.25rem;
}
.checkout-hint {
  margin: 0.75rem 0 1rem;
  line-height: 1.45;
}
.checkout-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.75rem 0;
  cursor: pointer;
}
.checkout-summary {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
}
.checkout-pay-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}
.checkout-pay-methods {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
}
.checkout-pay-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.checkout-pay-btn:hover,
.checkout-pay-btn:focus-visible {
  border-color: color-mix(in srgb, var(--accent, #0f6a5a) 55%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #0f6a5a) 40%, transparent);
  background: color-mix(in srgb, var(--accent, #0f6a5a) 8%, var(--surface, #fff));
}
.checkout-pay-btn:focus-visible {
  outline: 2px solid var(--accent, #0f6a5a);
  outline-offset: 2px;
}
.checkout-pay-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 5.5rem;
  flex-shrink: 0;
}
.checkout-pay-logos img {
  display: block;
  height: 1.85rem;
  width: auto;
  max-width: 4.5rem;
  object-fit: contain;
}
.checkout-pay-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.checkout-pay-label strong {
  font-size: 1rem;
  line-height: 1.25;
}
.checkout-pay-label small {
  line-height: 1.35;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
}

/* Logo / Home */
.logo-home {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}
.logo-m {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.55rem;
  object-fit: cover;
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-text strong {
  font-size: 1.05rem;
  font-weight: 700;
}
.logo-text small {
  color: var(--muted);
  font-size: 0.78rem;
}
.logo-home--hero {
  margin: 0 0 1.5rem;
}
.logo-home--hero .logo-m {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.85rem;
}
.logo-home--hero .logo-text strong {
  font-size: 1.45rem;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}
.login-shell {
  width: 100%;
  max-width: 24rem;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.login-form label.login-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
}
.login-form label.login-check input {
  width: auto;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
}
.login-form input {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #fff;
  color: var(--ink);
}
.login-form select {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #fff;
  color: var(--ink);
}
.dept-pick {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dept-pick legend {
  padding: 0;
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.dept-pick-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.dept-pick-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dept-pick-option input {
  width: auto;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
}
.dept-pick-name {
  font-weight: 650;
  color: var(--ink);
}
.dept-pick-role {
  font-size: 0.82rem;
  color: var(--muted);
}
.login-form .btn-primary,
.btn.btn-primary {
  background: var(--accent);
  color: #f4f7f5;
  border: 0;
  font: inherit;
  padding: 0.7rem 1rem;
  border-radius: 0.4rem;
  cursor: pointer;
  min-height: 2.6rem;
}
.login-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.login-hint {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
.login-secondary {
  margin-top: 0.75rem;
  text-align: center;
}
.login-register-cta {
  margin: 0.65rem 0 0;
  font-size: 0.92rem;
}
.login-register-cta a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.login-footer {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}
.login-footer a {
  color: var(--ink);
  text-decoration: none;
}
.login-footer a:hover,
.login-footer a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.login-footer-sep {
  color: var(--muted);
  opacity: 0.7;
}
.login-debug {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--accent);
  border-radius: 0.5rem;
  background: rgba(15, 106, 90, 0.08);
  color: var(--ink);
  font-size: 0.95rem;
}
.login-debug code {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.login-debug--mail code {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  word-break: break-all;
}
.login-debug-list {
  margin: 0.5rem 0 0.35rem;
  padding-left: 1.15rem;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.45;
}
.login-debug-ok { color: #0f6a5a; }
.login-debug-err { color: #8b2e1f; }
.login-debug--mail .meta {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  text-align: left;
}
.flash-err { border-color: #a33; color: #8b2e1f; background: rgba(168, 51, 51, 0.08); }

.upload-panel { margin: 0.75rem 1rem 1rem; }
.upload-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.upload-btn { position: relative; overflow: hidden; cursor: pointer; }
.upload-btn input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-hint { margin: 0; flex: 1 1 14rem; }
.upload-status { margin: 0; flex: 1 1 100%; color: var(--accent, #0f6a5a); font-weight: 600; }

.plan-status-bar {
  margin: 0.75rem 1rem 0;
  padding: 0.65rem 0.9rem;
}
.plan-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0;
}
.plan-status-label {
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
}
.plan-status-hint {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.plan-status-print {
  margin-left: auto;
  flex: 0 0 auto;
}
.plan-status-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  vertical-align: middle;
}
.plan-status-select {
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
  cursor: pointer;
}
.plan-status-select.plan-status-wish { color: #9a4d1c; border-color: rgba(154, 77, 28, 0.35); }
.plan-status-select.plan-status-draft { color: #5c564c; }
.plan-status-select.plan-status-published { color: #0f6a5a; border-color: rgba(15, 106, 90, 0.35); }
.plan-status {
  display: inline-block;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  background: var(--accent-soft);
  color: var(--accent);
}
.plan-status-wish { background: rgba(154, 77, 28, 0.12); color: #9a4d1c; }
.plan-status-draft { background: rgba(92, 86, 76, 0.14); color: #5c564c; }
.plan-status-published { background: rgba(15, 106, 90, 0.14); color: #0f6a5a; }

.plan-auto-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.plan-auto-form {
  margin: 0;
  display: inline-flex;
}

.wish-comments-panel {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.wish-comments-panel h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}
.wish-comments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.wish-comments-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.55rem;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
}
.wish-comments-meta {
  font-size: 0.86rem;
  color: var(--muted);
}
.wish-comments-meta code {
  font-size: 0.9em;
  color: var(--ink);
}
.wish-comments-bang {
  display: inline-block;
  font-weight: 800;
  color: #a33;
}
.wish-comments-note {
  font-size: 0.95rem;
  color: var(--ink);
  white-space: pre-wrap;
}

.cell-edit {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.12rem;
  max-width: 100%;
}
.cell-edit .cell-shift-time {
  flex: 1 0 100%;
  text-align: center;
}
.cell-time-info {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  padding: 0;
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  opacity: 0.85;
}
button.cell-time-info {
  cursor: pointer;
}
.cell-time-info.is-static {
  cursor: help;
}
.cell-time-info[hidden] {
  display: none;
}
.cell-time-info:hover,
.cell-time-info:focus {
  opacity: 1;
  outline: none;
}
td .cell-code + .cell-time-info {
  margin-left: 0.12rem;
  vertical-align: middle;
}
.cell-cancelled .cell-duty-select,
.cell-duty-select.is-cancelled,
.cell-code.is-cancelled {
  position: relative;
  z-index: 1;
}
.badge.is-cancelled,
.legend-cancelled,
.duty-list li.is-cancelled .badge,
.duty-list li.is-cancelled .person,
.duty-list li.is-cancelled .times,
.duty-list li.is-cancelled .hours {
  color: #b42318 !important;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
td.cell-cancelled,
td.cell-cancelled.cell-editable {
  position: relative;
  overflow: hidden;
  background: var(--sick) !important;
  color: var(--sick-ink) !important;
}
td.cell-cancelled::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 0.7px),
    rgba(198, 40, 40, 0.9) 0,
    rgba(198, 40, 40, 0.9) calc(50% + 0.7px),
    transparent 0
  );
}
.legend-cancelled {
  display: inline-block;
  width: 1.35rem;
  height: 1.1rem;
  margin-right: 0.35rem;
  vertical-align: middle;
  border: 1px solid var(--line);
  background:
    linear-gradient(
      to top right,
      transparent calc(50% - 0.55px),
      rgba(198, 40, 40, 0.85) 0,
      rgba(198, 40, 40, 0.85) calc(50% + 0.55px),
      transparent 0
    ),
    #d5ebf3;
  text-decoration: none !important;
  color: transparent !important;
  font-size: 0;
}
.cell-edit .cell-duty-select,
.cell-edit-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  width: 40px;
  max-width: 40px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  box-shadow: none;
  outline: none;
}
.cell-edit .cell-duty-select:hover,
.cell-edit .cell-duty-select:focus,
.cell-edit .cell-duty-select:active,
.cell-edit-form select:hover,
.cell-edit-form select:focus,
.cell-edit-form select:active {
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  width: auto;
  min-width: 40px;
  max-width: 4.5rem;
  padding: 0.1rem 0.15rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 5;
}
.cell-edit .cell-duty-select:disabled {
  opacity: 0.55;
  cursor: wait;
}
.cell-editable {
  padding: 0.15rem !important;
  text-align: center;
  vertical-align: middle;
  overflow: visible;
}

.mark-ok, .mark-unsure, .mark-important {
  display: inline-block;
  margin-left: 0.15rem;
  font-weight: 700;
  font-size: 0.85em;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.mark-ok { color: #1f7a3f; }
.mark-unsure { color: #b42318; }
.mark-important { color: #b42318; }
.mark-important[hidden] { display: none !important; }

/* Tausch/Frei: große Hintergrundgrafik in der Zelle */
.compact td.has-swap-open,
.compact td.has-swap-done,
td.has-swap-open,
td.has-swap-done {
  position: relative;
}
.mark-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  margin: 0;
  display: block;
  font-size: 1.85rem;
  line-height: 1;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0.28;
}
.mark-swap--open {
  color: #a85a0a;
  opacity: 0.34;
  font-size: 1.7rem;
}
.mark-swap--done {
  color: var(--accent, #2a6f4e);
  opacity: 0.3;
  font-size: 2rem;
}
.cell-code,
.cell-shift-time,
.cell-time-info,
.cell-edit .cell-duty-select,
.cell-edit .cell-shift-time,
.cell-edit .cell-time-info,
.cell-edit .mark-important {
  position: relative;
  z-index: 1;
}

.duty-extra-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0.5rem;
  font-weight: 600;
  cursor: pointer;
}
.duty-extra-check input {
  width: 1.05rem;
  height: 1.05rem;
}
.duty-extra-memo {
  display: block;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.duty-extra-memo textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  min-height: 4.5rem;
  box-sizing: border-box;
}

.duty-dialog {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0;
  max-width: min(28rem, 94vw);
  width: 100%;
  background: #f7f4ef;
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(28, 26, 23, 0.18);
  overflow-x: hidden;
  box-sizing: border-box;
}
.duty-dialog::backdrop {
  background: rgba(28, 26, 23, 0.45);
}
.duty-dialog-inner {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
.duty-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.duty-dialog-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.duty-dialog-close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 0.2rem;
}
.duty-dialog-times,
.duty-dialog-hist {
  margin-top: 0.85rem;
}
.duty-dialog-times h3,
.duty-dialog-hist h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  color: var(--accent);
}
.duty-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.55rem 0 0.75rem;
}
.duty-time-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.duty-time-grid input {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: #fff;
  color: var(--ink);
}
.duty-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.duty-dialog-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.duty-dialog-msg {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
}
.duty-dialog-msg.is-ok { color: #1d5a2f; }
.duty-dialog-msg.is-err { color: #8b2e1f; }
.duty-history-subhead {
  margin: 0.65rem 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted, #666);
}
.duty-history-subhead:first-child {
  margin-top: 0;
}
.duty-history-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
}
.duty-history-ul--swaps {
  max-height: none;
  margin-bottom: 0.35rem;
}
.duty-history-ul li {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.duty-history-ul code {
  font-weight: 700;
}
.duty-history-ul code.hist-k,
.duty-history-ul li.is-hist-k code.hist-k {
  color: #b42318;
  font-weight: 800;
}
.duty-history-ul li.is-hist-k {
  background: rgba(180, 35, 24, 0.06);
  border-radius: 0.35rem;
}
.duty-history-ul .hist-snap {
  display: inline;
}
.duty-history-ul .hist-set-planned {
  margin-left: 0.2rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: #fff;
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  vertical-align: baseline;
}
.duty-history-ul .hist-set-planned:hover {
  border-color: var(--accent, #2a6f4e);
  color: var(--accent, #2a6f4e);
}
.duty-history-ul .hist-undo-last {
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.2;
  border: 1px solid #d4a59a;
  border-radius: 0.25rem;
  background: #fff;
  color: #8b2e1f;
  cursor: pointer;
  vertical-align: baseline;
}
.duty-history-ul .hist-undo-last:hover {
  border-color: #8b2e1f;
  background: rgba(139, 46, 31, 0.06);
}
.duty-history-ul .hist-planned-badge {
  margin-left: 0.2rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 0.25rem;
  background: rgba(42, 111, 78, 0.12);
  color: #1d5a2f;
  vertical-align: baseline;
}
.duty-history-ul li.is-hist-planned {
  background: rgba(42, 111, 78, 0.05);
  border-radius: 0.35rem;
}

.push-prefs-panel {
  margin: 0.75rem 1rem 1.5rem;
}
.push-prefs-intro {
  margin: 0.65rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--accent, #2a6f4e);
  background: color-mix(in srgb, var(--accent, #2a6f4e) 8%, #fff);
  border-radius: 0 0.4rem 0.4rem 0;
  color: var(--ink, #1a1a1a);
  font-size: 0.92rem;
  line-height: 1.45;
}
.push-browser-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
}
.push-browser-box .meta {
  margin: 0;
  flex: 1 1 12rem;
}
.push-prefs-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.push-prefs-group {
  margin: 0;
  padding: 0.85rem 1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface);
}
.push-prefs-group legend {
  padding: 0 0.35rem;
  font-weight: 700;
  color: var(--accent);
}
.push-pref-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0 0 0.75rem;
  cursor: pointer;
}
.push-pref-row input {
  margin-top: 0.25rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.push-pref-row strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
}
.push-pref-row small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.push-pref-row.is-placeholder {
  opacity: 0.78;
}
.push-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(92, 86, 76, 0.12);
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  vertical-align: middle;
}
.push-prefs-matrix-wrap {
  margin: 0.35rem 0 0.65rem;
  overflow-x: auto;
}
.push-prefs-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.push-prefs-matrix th,
.push-prefs-matrix td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.push-prefs-matrix thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}
.push-prefs-matrix__ch {
  width: 4.5rem;
  text-align: center !important;
  white-space: nowrap;
}
.push-prefs-matrix td strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
}
.push-prefs-matrix td small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}
.push-prefs-matrix__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.push-prefs-matrix__check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.push-prefs-matrix tr.is-placeholder {
  opacity: 0.78;
}
.push-schedule-times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0.25rem 0 0.85rem 1.65rem;
}
.push-schedule-times[hidden] {
  display: none !important;
}
.push-schedule-times label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}
.push-schedule-times input[type="time"],
.push-schedule-times select {
  min-height: 2rem;
  min-width: 5.5rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.push-prefs-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.push-prefs-form .btn-primary {
  background: var(--accent);
  color: #f4f7f5;
  border: 0;
}

.stack-form label {
  display: block;
  margin-bottom: 0.75rem;
}
.stack-form input[type="date"],
.stack-form input[type="text"],
.stack-form textarea,
.stack-form select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line, #d9d2c5);
  border-radius: 6px;
  background: #fff;
}
/* Einheitliche Datentabellen (App) – nicht für Dienstplan/Stundenzettel */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface, #fff);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.04);
}
.table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table),
.panel table.data-table,
.panel table.data,
table.data-table,
table.data {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  background: #fff;
}
.table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table) thead th,
.panel table.data-table thead th,
.panel table.data thead th,
table.data-table thead th,
table.data thead th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg1) 82%, #fff);
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
  white-space: nowrap;
}
.table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table) td,
.panel table.data-table td,
.panel table.data td,
table.data-table td,
table.data td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  vertical-align: top;
  color: var(--ink);
}
.table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table) tbody tr:nth-child(even) td,
.panel table.data-table tbody tr:nth-child(even) td,
.panel table.data tbody tr:nth-child(even) td,
table.data-table tbody tr:nth-child(even) td,
table.data tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--bg1) 55%, #fff);
}
.table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table) tbody tr:hover td,
.panel table.data-table tbody tr:hover td,
.panel table.data tbody tr:hover td,
table.data-table tbody tr:hover td,
table.data tbody tr:hover td {
  background: color-mix(in srgb, var(--accent-soft) 55%, #fff);
}
.table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table) tbody tr:last-child td,
.panel table.data-table tbody tr:last-child td,
.panel table.data tbody tr:last-child td,
table.data-table tbody tr:last-child td,
table.data tbody tr:last-child td {
  border-bottom: 0;
}
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table),
body[data-theme="dark"] table.data-table,
body[data-theme="dark"] table.data {
  background: color-mix(in srgb, var(--surface) 90%, #000);
}
body[data-theme="dark"] .table-wrap > table:not(.compact):not(.plan-sheet):not(.ts-table):not(.plan-rules-matrix):not(.vac-cal-table) thead th,
body[data-theme="dark"] table.data-table thead th,
body[data-theme="dark"] table.data thead th {
  background: color-mix(in srgb, var(--bg1) 70%, #000);
}
tr.is-holiday {
  background: rgba(180, 90, 40, 0.06);
}

/* Wünsche / Support */
.wish-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.wish-list-head h2 {
  margin: 0;
}
.wish-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.wish-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.wish-card {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line, #d9d2c5);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}
.wish-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
}
.wish-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.wish-status-badge,
.wish-prio-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.wish-prio-badge.wish-prio--must {
  background: rgba(180, 40, 40, 0.14);
  color: #9b1c1c;
}
.wish-prio-badge.wish-prio--can {
  background: rgba(154, 77, 28, 0.14);
  color: #9a4d1c;
}
.wish-prio-badge.wish-prio--nice {
  background: rgba(80, 90, 110, 0.12);
  color: #4a5568;
}
.wish-status--open .wish-status-badge,
.wish-status-badge.wish-status--open {
  background: rgba(154, 77, 28, 0.14);
  color: #9a4d1c;
}
.wish-status--progress .wish-status-badge,
.wish-status-badge.wish-status--progress {
  background: rgba(30, 90, 160, 0.14);
  color: #1e5aa0;
}
.wish-status--done .wish-status-badge,
.wish-status-badge.wish-status--done {
  background: rgba(47, 125, 74, 0.14);
  color: #1d5c36;
}
.wish-card__date {
  color: var(--muted, #6b7280);
  font-size: 0.82rem;
}
.wish-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.wish-card__body {
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
  line-height: 1.45;
}
.wish-card__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted, #6b7280);
}
.wish-card__admin-note {
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: rgba(15, 106, 90, 0.06);
  font-size: 0.9rem;
}
.wish-status-form {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line, #d9d2c5);
  max-width: 28rem;
}
.wish-status-form .btn {
  margin-top: 0.25rem;
}
@media (max-width: 640px) {
  .wish-list-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==== assets/header-2.css ==== */
#header-2 {
  container-type: inline-size;
  container-name: header-2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.35rem;
  margin: 0.55rem 0.75rem 0;
  padding: 0.7rem 0.85rem 0.65rem;
  border: 1px solid rgba(28, 26, 23, 0.09);
  border-radius: 0.9rem;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(28, 26, 23, 0.05),
    0 10px 28px rgba(28, 26, 23, 0.09);
}

/* 1) Logo immer links */
#header-2 > div:first-child {
  order: 1;
  flex: 0 0 auto;
  min-width: 0;
}

/* 2) Nav rechts; Burger nur mobil */
#header-2 > .app-nav__burger {
  display: none;
  order: 2;
  flex: 0 0 auto;
  margin-left: auto;
}
#header-2 > nav.app-nav {
  order: 3;
  flex: 0 1 auto;
  margin-left: auto;
  min-width: 0;
  overflow: visible;
}

/* 3) Meta: standardmäßig volle 2. Zeile, mobil rechts */
#header-2 > .header-2__meta,
#header-2 > div:nth-child(2) {
  order: 4;
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
}

/* Genug Platz: Meta zwischen Logo und Nav, zentriert */
@container header-2 (min-width: 40rem) {
  #header-2 > .header-2__meta,
  #header-2 > div:nth-child(2) {
    order: 2;
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
  #header-2 > nav.app-nav {
    order: 3;
    margin-left: 0;
  }
}

/* —— Logo (scoped) —— */
#header-2 a.logo-home {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}
#header-2 .logo-m {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.55rem;
  object-fit: cover;
  flex-shrink: 0;
}
#header-2 .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
#header-2 .logo-text strong {
  font-size: 1.05rem;
  font-weight: 700;
}
#header-2 .logo-text small {
  color: var(--muted);
  font-size: 0.78rem;
}

/* —— Meta / Nutzer —— */
#header-2 .header-user {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.55rem;
  min-width: 0;
  max-width: 100%;
}
@container header-2 (min-width: 40rem) {
  #header-2 .header-user {
    justify-content: center;
  }
}
#header-2 .header-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #0a4f43;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  flex-shrink: 0;
}
body[data-theme="dark"] #header-2 .header-user-avatar {
  background: #0f6a5a;
}
#header-2 .header-logout--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid transparent;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
#header-2 .header-logout--icon:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
#header-2 .persona-switch-select,
#header-2 .view-as-select {
  max-width: min(12rem, 42vw);
}

/* —— Navigation —— */
#header-2 .app-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}
#header-2 > .app-nav__burger {
  appearance: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  width: 2.35rem;
  height: 2.15rem;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
#header-2 .app-nav__burger-bars,
#header-2 .app-nav__burger-bars::before,
#header-2 .app-nav__burger-bars::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
#header-2 .app-nav__burger-bars {
  position: relative;
  transition: background 0.2s ease;
}
#header-2 .app-nav__burger-bars::before,
#header-2 .app-nav__burger-bars::after {
  content: "";
  position: absolute;
  left: 0;
  transition: transform 0.2s ease, top 0.2s ease;
}
#header-2 .app-nav__burger-bars::before { top: -5px; }
#header-2 .app-nav__burger-bars::after { top: 5px; }
/* Offen: Striche zum X */
#header-2 > .app-nav__burger[aria-expanded="true"] .app-nav__burger-bars {
  background: transparent;
}
#header-2 > .app-nav__burger[aria-expanded="true"] .app-nav__burger-bars::before {
  top: 0;
  transform: rotate(45deg);
}
#header-2 > .app-nav__burger[aria-expanded="true"] .app-nav__burger-bars::after {
  top: 0;
  transform: rotate(-45deg);
}
#header-2 .app-nav__menu.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
  padding: 0.22rem;
  background: rgba(28, 26, 23, 0.045);
  border: 1px solid rgba(28, 26, 23, 0.05);
  border-radius: 0.7rem;
  overflow: visible;
}
#header-2 .app-nav__item {
  position: relative;
}
#header-2 .app-nav__menu .btn:not(.btn-admin):not(.btn-superadmin),
#header-2 .app-nav__trigger:not(.btn-admin):not(.btn-superadmin) {
  border-radius: 0.5rem;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  min-height: 2.15rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
#header-2 .app-nav__menu .btn:not(.btn-admin):not(.btn-superadmin):hover,
#header-2 .app-nav__trigger:not(.btn-admin):not(.btn-superadmin):hover {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(28, 26, 23, 0.1);
}
#header-2 .app-nav__menu .btn:not(.btn-admin):not(.btn-superadmin).is-active,
#header-2 .app-nav__item.is-active > .app-nav__trigger:not(.btn-admin):not(.btn-superadmin) {
  background: #fff;
  color: var(--accent);
  font-weight: 650;
  box-shadow:
    0 1px 2px rgba(28, 26, 23, 0.06),
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}
#header-2 .app-nav__menu .btn-admin,
#header-2 .app-nav__trigger.btn-admin {
  border-radius: 0.5rem;
  background: #fff6cc;
  border-color: #e0c84a;
  color: #6a5800;
  box-shadow: none;
  min-height: 2.15rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 600;
}
#header-2 .app-nav__menu .btn-superadmin,
#header-2 .app-nav__trigger.btn-superadmin {
  border-radius: 0.5rem;
  background: #ffe0c2;
  border-color: #e8954a;
  color: #7a3d00;
  box-shadow: none;
  min-height: 2.15rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 600;
}
#header-2 .app-nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
#header-2 .app-nav__caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
}
#header-2 .app-nav__flyout {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 11.5rem;
  max-height: min(70vh, 28rem);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  padding-top: 0.15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 34, 31, 0.14);
  z-index: 50;
}
#header-2 .app-nav__item.has-flyout[data-nav-group="admin"] > .app-nav__flyout,
#header-2 .app-nav__item.has-flyout[data-nav-group="konto"] > .app-nav__flyout {
  left: auto;
  right: 0;
}
#header-2 .app-nav__flyout::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  height: 6px;
}
/* Flyouts nur Desktop (Hover / Fokus) */
@media (min-width: 721px) {
  #header-2 .app-nav__item.has-flyout:hover > .app-nav__flyout,
  #header-2 .app-nav__item.has-flyout:focus-within > .app-nav__flyout {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }
}
#header-2 .app-nav__sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}
#header-2 .app-nav__sublink:hover,
#header-2 .app-nav__sublink:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}
#header-2 .app-nav__sublink.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
#header-2 .app-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--cta, #c45c26);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* Mobil: Burger; Navi zugeklappt, Slide down/up */
@media (max-width: 720px) {
  #header-2 > .app-nav__burger {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }
  #header-2 > nav.app-nav#h2-app-nav {
    display: grid !important;
    grid-template-rows: 0fr;
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    opacity: 0;
    transform: translateY(-0.45rem);
    pointer-events: none;
    transition:
      grid-template-rows 0.36s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.28s ease,
      transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }
  #header-2.is-nav-open > nav.app-nav#h2-app-nav {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  #header-2 > .header-2__meta,
  #header-2 > div:nth-child(2) {
    order: 4;
  }
  #header-2 .app-nav__menu.nav-links {
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    gap: 0.15rem;
    min-height: 0;
    overflow: hidden;
  }
  #header-2.is-nav-open .app-nav__menu.nav-links {
    overflow: visible;
  }
  #header-2 .app-nav__item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
  }
  #header-2 .app-nav__item > .btn,
  #header-2 .app-nav__item > .app-nav__trigger {
    width: 100%;
    justify-content: flex-start;
  }
  /* Gruppenname als Label, kein Dropdown-Caret */
  #header-2 .app-nav__item.has-flyout > .app-nav__trigger {
    pointer-events: none;
    font-weight: 700;
    color: var(--muted);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    min-height: 1.75rem;
    padding: 0.25rem 0.65rem 0.1rem;
  }
  #header-2 .app-nav__caret {
    display: none;
  }
  #header-2 .app-nav__flyout,
  #header-2 .app-nav__item.has-flyout:hover > .app-nav__flyout,
  #header-2 .app-nav__item.has-flyout:focus-within > .app-nav__flyout {
    display: flex !important;
    position: static;
    left: auto;
    right: auto;
    min-width: 0;
    max-height: none;
    width: 100%;
    margin: 0;
    padding: 0 0 0.25rem;
    flex-direction: column;
    gap: 0.1rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  #header-2 .app-nav__flyout::before {
    display: none;
  }
  #header-2 .app-nav__sublink {
    padding-left: 1.35rem;
    white-space: normal;
  }
}

body[data-theme="dark"] #header-2 {
  background: #1a211e;
  border-color: rgba(255, 255, 255, 0.08);
}
body[data-theme="dark"] #header-2 .app-nav__menu.nav-links {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}
body[data-theme="dark"] #header-2 .app-nav__flyout {
  background: #1a211e;
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==== assets/timesheet.css ==== */
.timesheet-page main {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem;
}

.ts-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
}

.ts-sheet {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  page-break-after: always;
}

.ts-sheet:last-child {
  page-break-after: auto;
}

.ts-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
}

.ts-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.ts-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ts-meta {
  text-align: right;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.ts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.ts-table th,
.ts-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.4rem 0.35rem;
  vertical-align: top;
}

.ts-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.ts-table td.note {
  color: var(--muted);
  font-size: 0.78rem;
}

.ts-table td.empty {
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.ts-table tr.is-weekend td {
  background: #e8e2f4;
}

.ts-table tr.is-holiday td {
  background: #f3e0c8;
  font-weight: 600;
}

.ts-table tr.is-vacation td {
  background: #ebe3c9;
}

.ts-table tr.is-cancelled td {
  color: #7a2e26;
  background: rgba(180, 35, 24, 0.07);
}

/* K am Wochenende/Feiertag: Tagesfarbe behalten, K nur über Text/Badge */
.ts-table tr.is-cancelled.is-weekend td {
  background: #e8e2f4;
  color: #7a2e26;
}

.ts-table tr.is-cancelled.is-holiday td {
  background: #f3e0c8;
  color: #7a2e26;
  font-weight: 600;
}

.ts-table tr.is-cancelled td.ts-planned {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: #b42318;
}

.ts-table tr.is-cancelled td.ts-worked,
.ts-table tr.is-cancelled td.ts-time,
.ts-table tr.is-cancelled td.ts-break,
.ts-table tr.is-cancelled td.ts-hours,
.ts-table tr.is-cancelled td.ts-k {
  text-decoration: none;
  color: inherit;
}

.ts-k-badge {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #b42318;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
}

.ts-table td.ts-time.is-hours-basis,
.ts-table td.ts-hours.is-hours-basis {
  font-weight: 600;
}

.ts-basis-hint {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a4b12;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ts-table tr.is-cancelled .ts-basis-hint {
  color: #8a1f16;
}

.ts-legend {
  margin: 0.65rem 0 0;
  line-height: 1.45;
}

.ts-table tr.is-free td {
  color: var(--muted);
}

.ts-table td.free-mark {
  color: var(--muted);
  letter-spacing: 0.08em;
}

.surcharge-day {
  border: 1px solid var(--line);
  margin-bottom: 0.85rem;
  background: rgba(255,255,255,0.55);
  overflow: hidden;
}

.surcharge-day header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.surcharge-day header h3 {
  margin: 0;
  font-size: 0.98rem;
}

.surcharge-day header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.surcharge-day.is-weekend header {
  background: #e8e2f4;
}

.surcharge-day.is-holiday header {
  background: #f3e0c8;
}

.surcharge-summary th:first-child,
.surcharge-summary td.surcharge-emp {
  width: 28%;
  vertical-align: top;
}

.surcharge-line-list {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
}

.surcharge-col-day { width: 20%; }
.surcharge-col-range { width: 40%; }
.surcharge-col-hours { width: 20%; }
.surcharge-col-pct { width: 20%; }

.surcharge-line-list th,
.surcharge-line-list td {
  padding: 0.2rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--line, #ddd);
  vertical-align: top;
  line-height: 1.35;
}

.surcharge-line-list th {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted, #5a554e);
  border-bottom-color: var(--line, #ccc);
}

.surcharge-line-list th:last-child,
.surcharge-line-list td.surcharge-line-pct {
  text-align: right;
}

.surcharge-line-list tr:last-child td {
  border-bottom: 0;
}

.surcharge-line-day {
  font-weight: 700;
  white-space: nowrap;
}

.surcharge-line-time,
.surcharge-line-hours {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.surcharge-line-pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.surcharge-line-sum {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.surcharge-print-page .print-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 1rem 1rem;
}

.surcharge-print-page .surcharge-print-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.surcharge-print-page .surcharge-print-head {
  margin-bottom: 1rem;
}

.surcharge-print-page .surcharge-print-head h1 {
  margin: 0;
  font-size: 1.25rem;
}

.surcharge-day .ts-table {
  margin: 0;
}

.sheet tr.sum-row td {
  border-top: 2px solid var(--accent);
  padding-top: 0.55rem;
}

.ts-summary {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.ts-summary table {
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.ts-summary th,
.ts-summary td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.ts-summary th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
}

.ts-summary td {
  text-align: right;
  font-weight: 600;
}

.ts-summary tr.emphasis td,
.ts-summary tr.emphasis th {
  color: var(--ink);
}

.ts-summary tr.total th,
.ts-summary tr.total td {
  border-bottom: 0;
  border-top: 2px solid var(--accent);
  color: var(--accent);
  font-size: 1rem;
  padding-top: 0.55rem;
}

.ts-formula {
  margin: 0.35rem 0 0;
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
}

.ts-sign {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.5rem;
  align-items: end;
  page-break-inside: avoid;
}

.ts-sign-date {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.ts-sign-line {
  border-top: 1px solid #1c1a17;
  padding-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .timesheet-page main {
    padding: 0.75rem;
  }

  .ts-sheet {
    padding: 0.75rem;
  }

  .ts-head {
    flex-direction: column;
    gap: 0.5rem;
  }

  .ts-meta {
    text-align: left;
    font-size: 0.9rem;
  }

  .ts-table {
    font-size: 0.75rem;
    min-width: 520px;
  }

  .ts-table th,
  .ts-table td {
    padding: 0.35rem 0.28rem;
  }

  /* Zuschlagsnotiz auf schmalen Displays ausblenden */
  .ts-table th:nth-child(6),
  .ts-table td:nth-child(6),
  .ts-table td.note {
    display: none;
  }

  .shift-label-full {
    display: none;
  }

  .ts-summary table {
    max-width: none;
    margin-left: 0;
  }

  .ts-sign {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .surcharge-day header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .surcharge-summary {
    min-width: 0;
  }
}

@media print {
  body:has(.timesheet-page),
  body.timesheet-page {
    background: #fff;
    padding: 0;
  }

  body:has(.timesheet-page) .no-print,
  body:has(.timesheet-page) .install-hint,
  body:has(.timesheet-page) #header-2,
  body.timesheet-page .no-print,
  body.timesheet-page .install-hint,
  body.timesheet-page #header-2 {
    display: none !important;
  }

  .timesheet-page main {
    max-width: none;
    padding: 0;
  }

  .timesheet-page .panel {
    border: 0;
    box-shadow: none;
    background: #fff;
    padding: 0;
    margin: 0;
  }

  .timesheet-page .panel > h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
  }

  .surcharge-summary {
    width: 100%;
    border-collapse: collapse;
  }

  .surcharge-summary > thead > tr > th,
  .surcharge-summary > tbody > tr > td {
    border: 1px solid #222;
    padding: 0.35rem 0.45rem;
    vertical-align: top;
  }

  .surcharge-line-list {
    table-layout: fixed;
    width: 100%;
  }

  .surcharge-line-list th,
  .surcharge-line-list td {
    border-bottom: 1px solid #ccc;
    padding: 0.1rem 0.3rem;
    font-size: 0.85rem;
  }

  .surcharge-line-list th:last-child,
  .surcharge-line-list td.surcharge-line-pct {
    text-align: right;
  }

  .surcharge-line-list thead {
    display: table-header-group;
  }

  .surcharge-summary a.sheet-link {
    color: #000;
    text-decoration: none;
  }

  .surcharge-print-page .print-toolbar {
    display: none !important;
  }

  .surcharge-print-page .surcharge-print-main {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .ts-sheet {
    border: 0;
    background: #fff;
    padding: 0;
    margin: 0 0 1.5rem;
  }

  .ts-sign {
    margin-top: 2.5rem;
  }

  .ts-sign-line {
    border-top-color: #000;
  }
}

/* ==== assets/plan_print.css ==== */
/* Monatsplan Druck / PDF – Namen oben, Datum links · A4 Hochformat */
/* Wichtig: nur auf body.plan-print scopen (liegt im App-Bundle). */

html:has(body.plan-print) {
  font-size: 11px;
}

body.plan-print {
  --ink: #12201c;
  --muted: #5a6b66;
  --line: #c5d0cc;
  --we: #ddd5ef;
  --fd: #f5e6a8;
  --m: #c5ddd4;
  --sd: #f5c4c0;
  --nd: #c5d4f0;
  --we-duty: #ddd5ef;
  --vac: #f5c6d8;
  --off: #c8e6c9;
  --sick: #dcc8ec;
  --cancel: #b33;
  --preview-max: 800px;
  box-sizing: border-box;
  margin: 0;
  padding: 1.25rem 1rem 2.5rem;
  color: var(--ink);
  background: #e8eeec;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.plan-print *,
body.plan-print *::before,
body.plan-print *::after {
  box-sizing: border-box;
}

.print-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  width: 100%;
  max-width: var(--preview-max);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.print-toolbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.print-toolbar .btn .icon-print {
  flex-shrink: 0;
}

.print-toolbar .btn-primary {
  background: #0f6a5a;
  border-color: #0f6a5a;
  color: #fff;
}

.print-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.print-page {
  width: 100%;
  max-width: var(--preview-max);
  margin: 0 auto;
  padding: 1rem 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(18, 32, 28, 0.08);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin: 0 0 0.75rem;
}

.sheet-head .brand {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #0f6a5a;
}

.sheet-head h1 {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet-head .meta,
.sheet-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.sheet-meta {
  text-align: right;
}

.sheet-meta p {
  margin: 0.1rem 0;
}

.empty-msg {
  padding: 1.5rem;
  border: 1px solid var(--line);
}

.sheet-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
}

.plan-sheet {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--print-font-size, 0.72rem);
  font-variant-numeric: tabular-nums;
}

.plan-sheet th,
.plan-sheet td {
  border: 1px solid var(--line);
  padding: 0.18rem 0.08rem;
  text-align: center;
  vertical-align: middle;
  overflow: hidden;
}

.plan-sheet .day-col {
  width: 4.2rem;
  min-width: 4rem;
  max-width: 4.6rem;
  text-align: left;
  padding: 0.18rem 0.3rem;
  font-weight: 600;
  font-size: 0.72rem;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}

.plan-sheet thead th {
  font-weight: 600;
  background: #f3f7f5;
  color: var(--muted);
  line-height: 1.15;
  padding: 0.3rem 0.1rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.plan-sheet thead .day-col {
  z-index: 3;
  background: #f3f7f5;
  color: var(--ink);
}

.plan-sheet thead .name-head {
  vertical-align: bottom;
  height: auto;
  min-height: 2.6em;
  padding: 0.3rem 0.15rem 0.35rem;
  white-space: normal;
}

.plan-sheet thead .name-head .name-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.05em;
  line-height: 1.15;
  font-size: inherit;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.plan-sheet thead .name-head .name-line {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-sheet tr.is-we .day-col,
.plan-sheet tr.is-we td {
  background: var(--we);
}

.plan-sheet tr.is-we .day-col {
  font-weight: 700;
}

.plan-sheet td.fd {
  background: var(--fd);
}

.plan-sheet td.m {
  background: var(--m);
}

.plan-sheet td.sd {
  background: var(--sd);
}

.plan-sheet td.we {
  background: var(--we-duty);
}

.plan-sheet td.vacation {
  background: var(--vac);
}

/* Dienstfarben aus Admin (inkl. Kontrasttext schwarz/weiß) */
.plan-sheet td.has-shift-color {
  background: var(--shift-bg) !important;
  color: var(--shift-fg, #1c1a17) !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.plan-sheet td.has-shift-color .print-code {
  color: inherit;
}
.plan-sheet tr.is-we td.has-shift-color {
  background: var(--shift-bg) !important;
}

.plan-sheet td.cancelled .print-code {
  color: #b42318;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.plan-sheet td.cancelled.has-shift-color .print-code {
  color: var(--shift-fg, #1c1a17);
  opacity: 0.92;
}

.plan-sheet td.cancelled .print-k,
.print-k {
  color: #b42318;
  font-weight: 700;
  margin-left: 0.12em;
  text-decoration: none;
}

.legend-cancel-sample .print-code {
  color: #b42318;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.plan-sheet td.cancelled {
  color: #b42318;
}

.plan-sheet td.duty,
.plan-sheet td.vacation {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.legend-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.95em;
  line-height: 1.2;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.sheet-foot {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 8pt;
}

.sheet-foot p {
  margin: 0;
}

.sheet-foot .legend-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--ink);
  font-size: 8pt;
}

.legend-shifts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.2rem 0.75rem;
}

.legend-shifts li {
  margin: 0;
  line-height: 1.3;
}

.legend-shifts strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 2.2rem;
  display: inline-block;
}

.legend-shifts .legend-label {
  margin-left: 0.2rem;
}

.legend-shifts .legend-time {
  margin-left: 0.35rem;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
}

.legend-shifts .legend-cancel {
  text-decoration: line-through;
  color: var(--cancel);
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 7mm;
  }

  html:has(body.plan-print) {
    font-size: var(--print-font-size, 10pt);
  }

  body.plan-print {
    background: #fff;
    padding: 0;
    display: block;
    font-size: var(--print-font-size, 10pt);
  }

  .no-print {
    display: none !important;
  }

  .print-page {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet-head {
    margin-bottom: 0.35rem;
  }

  .sheet-head h1 {
    font-size: 1.15em;
  }

  .sheet-wrap {
    overflow: visible;
    border: 0;
    width: 90%;
    margin: 0 auto;
  }

  .plan-sheet {
    width: 100%;
    font-size: var(--print-font-size, 10pt);
  }

  .plan-sheet .day-col {
    width: 4.5rem;
    min-width: 4.2rem;
    font-size: var(--print-font-size, 10pt);
    position: static;
  }

  .plan-sheet thead th {
    position: static;
  }

  .plan-sheet thead .name-head {
    height: auto;
    min-height: 2.4em;
  }

  .plan-sheet thead .name-head .name-lines {
    font-size: var(--print-font-size, 10pt);
  }

  .plan-sheet th,
  .plan-sheet td {
    padding: 4px 8px;
    font-size: var(--print-font-size, 10pt);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheet-foot {
    font-size: 8pt;
    width: 90%;
    margin: 0.55rem auto 0;
  }

  .sheet-foot .legend-title,
  .legend-shifts {
    font-size: 8pt;
  }

  .legend-shifts {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.12rem 0.5rem;
  }
}

