:root {
  --ink: #1c1a17;
  --muted: #5c564c;
  --line: #d2ddd8;
  --accent: #0f6a5a;
  --accent-soft: rgba(15, 106, 90, 0.12);
  --fd: #1f6f8b;
  --sd: #9a4d1c;
  --we: #5b4b8a;
  --vac: #7a6a3a;
  --off: #5a6570;
  --surface: rgba(255, 255, 255, 0.72);
  --bg0: #efe8dc;
  --bg1: #f7f4ef;
  --bg2: #e7f0ed;
}

* { box-sizing: border-box; }

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 {
  padding: 0 0 5rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(247, 244, 239, 0.88);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem 0.7rem;
}

.header-rule-alert {
  margin: 0.55rem 0 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;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.header-user {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
  line-height: 1.25;
  flex-shrink: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.55rem;
}
.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-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;
}
.header-logout--icon {
  vertical-align: middle;
}
.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;
}
.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;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.nav-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.nav-tools .print-action {
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nav-links .btn .icon-print,
.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-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;
}

.nav form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  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: wrap;
  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;
}
.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 i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.3rem;
  vertical-align: -0.05rem;
}

.legend .fd { background: var(--fd); }
.legend .sd { background: var(--sd); }
.legend .we { background: var(--we); }
.legend .vac { background: var(--vac); }
.legend .off { background: var(--off); }
.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: #d5ebf3; color: #13485a; font-weight: 700; }
.compact td.cell-m { background: #c5ddd4; color: #1a4d40; font-weight: 700; }
.compact td.cell-sd { background: #f3e0d2; color: #6d3410; font-weight: 700; }
.compact td.cell-we { background: #ddd5ef; color: #3d3164; font-weight: 700; }
.compact td.cell-vacation { background: #ebe3c9; color: #5a4c22; font-weight: 700; }
.compact td.cell-off { background: #dce2e7; color: #44515c; font-weight: 600; }

.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; }

.compact tr.is-weekend td.cell-fd { background: #cfe3f0; }
.compact tr.is-weekend td.cell-m { background: #bdd4cb; }
.compact tr.is-weekend td.cell-sd { background: #ecd4c3; }
.compact tr.is-weekend td.cell-we { background: #d5ccee; }
.compact tr.is-weekend td.cell-vacation { background: #e6dec0; }
.compact tr.is-weekend td.cell-off { background: #d3dae0; }

.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, .badge.M { background: var(--fd); }
.badge.SD, .badge.S1, .badge.S2, .badge.S3 { background: var(--sd); }
.badge.WE, .badge.WEF, .badge.WES { background: var(--we); }
.badge.VAC { background: var(--vac); }
.badge.OFF { background: var(--off); }

.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));
  }

  .app-header {
    padding: 0.75rem 0.75rem calc(0.65rem + env(safe-area-inset-top, 0px) * 0.15);
  }

  .brand {
    flex-wrap: wrap;
  }

  .brand h1 {
    font-size: 1.15rem;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    width: 100%;
  }

  .nav-links .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .nav-tools {
    width: 100%;
    margin-left: 0;
  }

  .nav-tools .print-action {
    flex: 1 1 auto;
    justify-content: center;
  }

  .nav form,
  .nav-tools form,
  .nav select,
  .nav-tools select {
    width: 100%;
  }

  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); }
.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-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;
}
.app-header .brand {
  margin-bottom: 0.55rem;
}
.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-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;
}
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.55px),
    rgba(198, 40, 40, 0.85) 0,
    rgba(198, 40, 40, 0.85) calc(50% + 0.55px),
    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;
}
.mark-ok { color: #1f7a3f; }
.mark-unsure { color: #b42318; }
.mark-important { color: #b42318; }
.mark-important[hidden] { display: none !important; }

.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-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
}
.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-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-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-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;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line, #d9d2c5);
  font-variant-numeric: tabular-nums;
}
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;
  }
}

