/* Sons of Bavaria – Dienstplaner. Helles, ruhiges Design nach Apple-Prinzipien: klare Hierarchie, weiche Flächen,
   sofortiges Feedback, Bewegung nur zur Orientierung (und ohne Bewegung bei „Bewegung reduzieren“). */
:root {
  --navy: #0b1d2e;
  --navy-2: #13293f;
  --accent: #0071e3;
  --accent-2: #0077ed;
  --accent-soft: #e8f1fd;
  --bg: #f5f5f7;
  --card: #ffffff;
  --fill: #f5f5f7;
  --fill-2: #ececf0;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, .08);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --ok: #1f7a35;
  --ok-c: #34c759;
  --ok-soft: #e7f6ea;
  --warn: #a64b00;
  --warn-c: #ff9500;
  --warn-soft: #fff3e0;
  --bad: #c9001a;
  --bad-c: #ff3b30;
  --bad-soft: #ffebea;
  --holiday: #fff7d6;
  --weekend: #f2f2f5;
  --today: #e8f1fd;
  /* Planungsfarben */
  --c-hier: #ffffff;
  --c-va: #0a84ff;
  --c-obj: #af52de;
  --c-urlaub: #ff9500;
  --c-krank: #ffcc00;
  --c-frei: #ff3b30;
  --c-nv: #ff9f9a;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 0 0 1px rgba(0, 0, 0, .035), 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .045);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .2), 0 2px 10px rgba(0, 0, 0, .08);
  /* kritisch gedämpfte Bewegung (keine Überschwinger) */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.4, 0, 1, 1);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-head: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI Variable Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.47; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Laufweite je Größe: große Schrift enger, kleine Schrift minimal weiter */
h1, h2, h3 { margin: 0 0 .5em; font-family: var(--font-head); color: var(--text); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.12; letter-spacing: -.022em; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -.012em; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -.006em; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right, .r { text-align: right; }
.center, .c { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-line; }
.warn-text { color: var(--warn); font-size: 11.5px; } .ok-text { color: var(--ok); font-size: 11.5px; } .bad-text { color: var(--bad); }
.warn-list { min-width: 260px; font-size: 12px; color: var(--warn); line-height: 1.35; }
::selection { background: rgba(0, 113, 227, .2); }
.page { animation: page-in .22s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Kopf und Navigation (durchscheinende Leiste, Inhalt läuft darunter) ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 8px 20px;
  background: rgba(255, 255, 255, .78); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--hair); transition: box-shadow .2s var(--ease); }
body.scrolled .topbar { box-shadow: 0 1px 0 var(--hair), 0 8px 24px rgba(0, 0, 0, .06); }
.topbar .logo { height: 38px; display: block; }
.topbar .title { font-family: var(--font-head); font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); text-align: right; }
.topbar .user b { color: var(--text); display: block; font-size: 13px; }
.topbar .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #0b1d2e, #2c5179); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
/* Menü bleibt einzeilig: fehlt der Platz, lässt es sich seitlich wischen statt in eine zweite Zeile zu springen */
.topbar > * { flex-shrink: 0; }
.nav { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; flex-shrink: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--text); padding: 7px 12px; font-weight: 500; font-size: 13.5px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease); }
.nav a:hover { background: var(--fill-2); text-decoration: none; }
.nav a:active { transform: scale(.97); }
.nav a.active { background: var(--text); color: #fff; }
.nav .badge-count { background: var(--bad-c); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 17px; font-weight: 600; }
.subnav { display: flex; justify-content: center; padding: 12px 20px 0; }
.subnav .seg { max-width: 100%; overflow-x: auto; }
main { padding: 20px 24px 40px; max-width: 1840px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Automatische Abmeldung: dezent am oberen Rand, rot */
.idle-timer { position: fixed; top: 3px; right: 14px; z-index: 40; font-size: 10.5px; font-weight: 500; color: var(--bad); font-variant-numeric: tabular-nums;
  letter-spacing: .01em; opacity: .75; pointer-events: none; }
.idle-timer.soon { opacity: 1; font-weight: 700; }

/* Segment-Schalter (Unternavigation, Reiter) */
.seg { display: inline-flex; gap: 2px; background: var(--fill-2); padding: 3px; border-radius: 12px; flex-wrap: nowrap; }
.seg a, .seg button { border: 0; background: transparent; color: var(--text); padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; font-family: inherit;
  line-height: 1.3; box-shadow: none; transition: background .15s var(--ease), box-shadow .15s var(--ease); }
.seg a:hover, .seg button:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.seg a.active, .seg button.active { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }

/* ---------- Karten / Raster ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.card > .card-head { padding: 15px 18px 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card > .card-head h2, .card > .card-head h3 { margin: 0; font-size: 16px; }
.card > .card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card > .card-body { padding: 6px 18px 18px; }
.card > .card-head + .card-body { padding-top: 4px; }
.card > .card-body:first-child { padding-top: 18px; }
.card .card-tools, .card-tools { padding: 10px 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--fill); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.card-tools input, .card-tools select, .page-head input, .page-head select { width: auto; }
.card .table-wrap { margin: 0 -18px; padding: 0 18px; }
/* Hervorgehobene Karte (z. B. unbesetzte Schichten): rote Kante und roter Titel */
.card.card-alert { box-shadow: inset 4px 0 0 var(--bad-c), var(--shadow); }
.card-alert .alert-title, .alert-title { color: var(--bad); }
.card.notice { max-width: 640px; margin: 40px auto; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; position: relative; }
.stat .v { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.stat.bad::before { background: var(--bad-c); } .stat.warn::before { background: var(--warn-c); } .stat.ok::before { background: var(--ok-c); }
a > .stat, .stat-link .stat { transition: box-shadow .15s var(--ease), transform .1s var(--ease); }
a > .stat:hover { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
a > .stat:active { transform: scale(.985); }
.stat-link { text-decoration: none !important; color: inherit; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; min-width: 140px; text-align: center; font-weight: 600; color: var(--text); }
.tile:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

/* ---------- Buttons & Formulare: Rückmeldung sofort beim Drücken ---------- */
button, .btn { font-family: inherit; font-size: 13px; font-weight: 500; border: 1px solid var(--hair); background: #fff; color: var(--text); padding: 7px 14px; border-radius: var(--radius-s); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; white-space: nowrap; box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
  transition: background .12s var(--ease), border-color .12s var(--ease), box-shadow .12s var(--ease), transform .1s var(--ease); -webkit-tap-highlight-color: transparent; }
button:hover, .btn:hover { background: var(--fill); text-decoration: none; }
button:active:not(:disabled), .btn:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-2); }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #333336; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: rgba(215, 0, 21, .2); }
.btn-ok { color: var(--ok); }
.btn-ok:hover { background: var(--ok-soft); }
.btn-small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 4px 8px; }
.btn-plain { border: 0; background: transparent; box-shadow: none; color: var(--accent); padding: 4px 6px; }
.btn-plain:hover { background: var(--accent-soft); }

label { font-weight: 500; font-size: 12.5px; color: var(--muted); }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; background: #fff; width: 100%;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease); }
select { appearance: none; -webkit-appearance: none; padding-right: 28px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .2); }
/* Pflichtfeld nicht ausgefüllt: sofort sichtbar am Feld */
[aria-invalid='true'] { border-color: var(--bad-c) !important; box-shadow: 0 0 0 3px rgba(255, 59, 48, .18) !important; }
button:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 113, 227, .35); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0 6px 0 0; vertical-align: middle; accent-color: var(--accent); box-shadow: none; flex: none; }
input[type=color] { padding: 2px; height: 34px; width: 60px; }
input[readonly] { background: var(--fill); }
input:disabled, select:disabled, textarea:disabled { background: var(--fill); color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
textarea { min-height: 76px; resize: vertical; }
/* Passwortfeld mit Augen-Symbol */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; box-shadow: none; color: var(--muted); padding: 6px 8px; border-radius: 8px; }
.pw-eye:hover { background: var(--fill-2); color: var(--text); }
.pw-eye:active:not(:disabled) { transform: translateY(-50%) scale(.92); }
.pw-eye[aria-pressed='true'] { color: var(--accent); }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.form.cols-1 { grid-template-columns: 1fr; }
.form.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form .field.full { grid-column: 1 / -1; }
.form .field .help { font-size: 12px; color: var(--muted); }
.form .field.req > label::after { content: ' *'; color: var(--bad); }
.form .field.check { justify-content: center; }
.form .field.check label { color: var(--text); font-size: 14px; font-weight: 400; display: flex; align-items: center; }
.form .section { grid-column: 1 / -1; font-weight: 600; color: var(--text); font-size: 13px; padding: 10px 0 0; margin-top: 4px; border-top: 1px solid var(--hair); }
.form .section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form .checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; }
.form .checks label { color: var(--text); font-weight: 400; font-size: 14px; display: inline-flex; align-items: center; }
.field .tpl-row { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.field .tpl-row select { max-width: 260px; font-size: 12.5px; padding: 5px 26px 5px 8px; background-color: var(--fill); border-color: transparent; }
.switch-label { display: inline-flex; align-items: center; gap: 2px; color: var(--text); font-weight: 400; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.hint { background: var(--accent-soft); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #0b3b6e; }
.hint.warn { background: var(--warn-soft); color: #7a3e00; }
.hint.bad { background: var(--bad-soft); color: #8c0010; }
.hint.ok { background: var(--ok-soft); color: #1d5e2c; }
.hint ul { margin: 4px 0 0 18px; padding: 0; }
a.hint:hover { filter: brightness(.98); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap; position: sticky; top: 0; background: #fff; z-index: 1; letter-spacing: .01em; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tbody tr:hover td { background: #fafafc; }
.tbl tr.sel td { background: #eef5ff !important; }
.tbl tfoot td { font-weight: 700; background: var(--fill); border-top: 1px solid var(--hair); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.weekend td { background: #fafafc; }
.tbl tr.holiday td { background: var(--holiday); }
.tbl tr.group td { background: var(--fill); font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 6px 10px; }
.tbl tr.row-bad td { background: #fff6f5; }
.tbl tr.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad-c); }
.tbl tr.row-bad:hover td { background: var(--bad-soft); }
.tbl tr.row-muted td { color: var(--muted); }
.tbl tr.unread td { background: #f4f9ff; }
.tbl input, .tbl select { padding: 5px 7px; font-size: 13px; border-radius: 8px; }
.tbl select { padding-right: 24px; background-position: right 7px center; }
/* Tabellen außerhalb von Karten bekommen eine eigene Kartenfläche */
.tbl-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 8px; margin-bottom: 18px; }
.card .tbl-card, .modal .tbl-card, .tab-body .tbl-card, details .tbl-card { box-shadow: none; border-radius: 0; padding: 0; margin-bottom: 0; background: transparent; }
.card .tbl-card { margin: 0 -18px; padding: 0 18px; }
.tbl-tools { display: flex; gap: 10px; align-items: center; padding: 4px 0 10px; flex-wrap: wrap; }
.tbl-tools .search { margin-left: auto; width: 260px; border-radius: 999px; background: var(--fill); border-color: transparent; padding-left: 14px; }
.tbl-tools .search:focus { background: #fff; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.pers-nr { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--fill-2); border-radius: 6px; padding: 0 6px; line-height: 17px; font-variant-numeric: tabular-nums; }
.plan-h { font-size: 11px; line-height: 1.3; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--fill-2); color: var(--text); white-space: nowrap; line-height: 1.45; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.dark { background: var(--text); color: #fff; }
.status-badge { background: color-mix(in srgb, var(--status) 14%, #fff); color: color-mix(in srgb, var(--status) 78%, #000); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status) 30%, transparent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; flex: none; }
.dot.gruen { background: var(--ok-c); } .dot.orange { background: var(--warn-c); } .dot.rot { background: var(--bad-c); } .dot.grau { background: #c7c7cc; }
/* Veranstaltungsliste: Name und Status mit klarem Abstand, Status immer in eigener Zeile */
.va-cell { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.va-title { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.va-sub { font-size: 13px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* Statusanzeige je Tag (Besetzung): Farben laut Planung */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 16px; }
.st svg { width: 14px; height: 14px; flex: none; }
.st.hier { background: var(--c-hier); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.st.va { background: var(--c-va); color: #fff; }
.st.objekt { background: var(--c-obj); color: #fff; }
.st.urlaub, .st.sonderurlaub, .st.unbezahlt { background: var(--c-urlaub); color: #fff; }
.st.krank { background: var(--c-krank); color: #3d3000; }
.st.festes_frei { background: var(--c-frei); color: #fff; }
.st.nicht_verfuegbar { background: var(--c-nv); color: #5c0b06; }
.st.beantragt { opacity: .6; }
.ico-glasses { display: inline-block; width: 18px; height: 18px; vertical-align: middle; flex: none; }

/* ---------- Reiter ---------- */
.tabs { display: inline-flex; gap: 2px; background: var(--fill-2); padding: 3px; border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; box-shadow: none; padding: 6px 14px; border-radius: 9px; font-weight: 500; }
.tabs button:hover { background: rgba(255, 255, 255, .6); }
.tabs button.active { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.side-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.side-menu { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding-bottom: 8px; position: sticky; top: 70px; }
.side-menu .head { padding: 16px; text-align: center; border-bottom: 1px solid var(--hair); margin-bottom: 6px; }
.side-menu .head .photo { width: 112px; height: 112px; object-fit: cover; border-radius: 50%; background: var(--fill); display: block; margin: 12px auto 10px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--hair); }
.side-menu a { display: block; padding: 7px 12px; margin: 1px 8px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 13.5px; transition: background .12s var(--ease); }
.side-menu a.active { background: var(--accent); color: #fff; }
.side-menu a:hover:not(.active) { background: var(--fill); text-decoration: none; }

/* ---------- Dialoge: erscheinen aus dem angeklickten Element und verschwinden auf demselben Weg ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .16); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 48px 14px; overflow-y: auto;
  animation: fade .18s var(--ease); }
.modal { background: #fff; width: 100%; max-width: 640px; border-radius: 20px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, .06); animation: pop .26s var(--ease); }
.modal-bg.closing { animation: fade-out .14s var(--ease-out) forwards; }
.modal-bg.closing .modal { animation: pop-out .14s var(--ease-out) forwards; }
.modal.wide { max-width: 980px; }
.modal.xwide { max-width: 1320px; }
.modal.moved { max-height: calc(100vh - 8px); display: flex; flex-direction: column; }
.modal.dragging { opacity: .96; box-shadow: 0 30px 80px rgba(0, 0, 0, .28); user-select: none; }
.modal .m-head { padding: 16px 22px 6px; display: flex; align-items: center; gap: 10px; cursor: move; user-select: none; touch-action: none; border-radius: 20px 20px 0 0; }
.modal .m-head .grip { color: #c7c7cc; font-size: 15px; line-height: 1; margin-left: -6px; }
.modal .m-head:hover .grip { color: var(--muted); }
.modal .m-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.modal .m-head .x { margin-left: auto; border: 0; background: var(--fill-2); color: var(--muted); font-size: 18px; width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 50%; box-shadow: none; }
.modal .m-head .x:hover { background: var(--line); color: var(--text); }
.modal .m-body { padding: 10px 22px 18px; max-height: calc(100vh - 210px); overflow-y: auto; }
.modal .m-foot { padding: 12px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--hair); }
.modal .m-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.96); } }
/* Pop-up mit Reitern („Weiter“) */
.stepper .steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.step-pill { border: 0; box-shadow: none; background: var(--fill); color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 999px; font-weight: 600; font-size: 12.5px; gap: 8px; }
.step-pill .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--muted); font-size: 11.5px; box-shadow: inset 0 0 0 1px var(--line); }
.step-pill.done { color: var(--text); }
.step-pill.done .n { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.step-pill.active { background: var(--accent); color: #fff; }
.step-pill.active .n { background: #fff; color: var(--accent); box-shadow: none; }
.step-pill:hover:not(.active) { background: var(--fill-2); }
.step-body { min-height: 220px; }
.step-pane { animation: page-in .2s var(--ease); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(29, 29, 31, .9); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); color: #fff; padding: 11px 18px; border-radius: 14px;
  min-width: 240px; max-width: 520px; box-shadow: var(--shadow-lg); white-space: pre-line; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .26s var(--ease); }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-c); margin-top: 6px; flex: none; }
.toast.err::before { background: var(--bad-c); }
.toast.warn::before { background: var(--warn-c); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Planungsraster (Objekt / Staffing / Monat) ---------- */
.grid-plan { border-collapse: separate; border-spacing: 0; background: #fff; font-size: 12px; }
.grid-plan th, .grid-plan td { border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 3px 3px; text-align: center; }
.grid-plan th { background: #fff; font-weight: 600; color: var(--muted); position: sticky; top: 0; z-index: 2; font-size: 11px; }
.grid-plan th.name, .grid-plan td.name { text-align: left; min-width: 210px; position: sticky; left: 0; background: #fff; z-index: 1; padding: 6px 10px; }
.grid-plan th.name { z-index: 3; }
.grid-plan .we { background: var(--weekend); }
.grid-plan .ft { background: var(--holiday); }
.grid-plan th.today { color: #fff; background: var(--accent); border-radius: 0; }
.grid-plan td.today { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.grid-plan td.cell { min-width: 42px; height: 38px; cursor: pointer; vertical-align: middle; transition: background .1s var(--ease); }
.grid-plan td.cell:hover { background: var(--accent-soft); }
.grid-plan .group-row td { background: var(--fill); color: var(--text); font-weight: 600; text-align: left; padding: 7px 10px; font-size: 12.5px; position: sticky; left: 0; }
.grid-plan .group-row.sub td { background: #f3eefa; }
.grid-plan .cust-row td.name { font-weight: 600; cursor: pointer; }
.grid-plan .cust-row td { background: #fbfbfd; }
.grid-plan .cust-row td.name:hover { color: var(--accent); }
.grid-plan .obj-row td.name { padding-left: 30px; }
.caret { display: inline-block; width: 16px; transition: transform .2s var(--ease); color: var(--muted); }
.caret.open { transform: rotate(90deg); }
.chip { display: block; font-size: 10.5px; line-height: 1.15; color: #fff; padding: 3px 2px; margin: 1px 0; border-radius: 6px; white-space: nowrap; position: relative; cursor: pointer; }
.chip:active { transform: scale(.96); }
.chip.va { background: var(--c-va); }
.chip.obj { background: var(--c-obj); }
.chip.this { background: var(--c-hier); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.chip.geplant { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .25) 0 4px, transparent 4px 8px); }
.chip.this.geplant { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .05) 0 4px, transparent 4px 8px); }
.chip.verdeckt { outline: 2px solid #1d1d1f; outline-offset: -2px; }
.chip.abs { background: var(--c-urlaub); font-weight: 700; font-size: 11px; padding: 4px 2px; }
.chip.abs.U, .chip.abs.SU, .chip.abs.UU { background: var(--c-urlaub); }
.chip.abs.K { background: var(--c-krank); color: #3d3000; }
.chip.abs.F { background: var(--c-frei); }
.chip.abs.NV { background: var(--c-nv); color: #5c0b06; }
.chip.abs.beantragt { opacity: .55; }
.chip svg { width: 13px; height: 13px; vertical-align: -2px; }
.amp { display: block; font-weight: 600; padding: 4px 0; color: #fff; border-radius: 7px; margin: 0 1px; }
.amp.gruen { background: var(--ok-c); } .amp.orange { background: var(--warn-c); } .amp.rot { background: var(--bad-c); } .amp.leer { color: #c7c7cc; background: transparent; font-weight: 400; }

/* ---------- Intraday ---------- */
.intraday { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.intraday .pool { border-right: 1px solid var(--hair); max-height: 78vh; overflow-y: auto; background: #fbfbfd; }
.intraday .pool .pool-head { background: rgba(251, 251, 253, .9); backdrop-filter: blur(10px); padding: 12px; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--hair); }
.intraday .pool .pool-head input { margin-top: 8px; border-radius: 999px; background: #fff; }
.pool-sec { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 10px 12px 4px; text-transform: uppercase; letter-spacing: .04em; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; }
.pool-sub { font-size: 12.5px; font-weight: 600; padding: 6px 12px; color: var(--c-obj); display: flex; align-items: center; gap: 6px; }
.p-item { padding: 7px 12px; margin: 2px 6px; border-radius: 10px; cursor: grab; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; transition: background .12s var(--ease), box-shadow .12s var(--ease); }
.p-item:hover { background: #fff; box-shadow: var(--shadow); }
.p-item:active { transform: scale(.985); }
.p-item .dot { margin-top: 4px; }
.p-item small { display: block; }
.p-item.firm { color: var(--c-obj); font-weight: 600; }
.pick-list .p-item { cursor: pointer; flex-direction: column; gap: 0; }
.intraday .board { overflow: auto; max-height: 78vh; }
.board-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--hair); background: rgba(255, 255, 255, .92); position: sticky; left: 0; top: 0; z-index: 4; }
.tl { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.tl th, .tl td { border-bottom: 1px solid var(--hair); padding: 0; height: 30px; }
.tl .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 6px; background: #fff; border-right: 1px solid var(--hair); }
.tl thead th { background: #fff; position: sticky; top: 52px; z-index: 3; font-weight: 600; color: var(--muted); }
.tl thead th.slot { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; height: 46px; min-width: 16px; font-weight: 500; }
.tl td.slot { min-width: 16px; border-left: 1px solid #f4f4f6; }
.tl td.slot.hour { border-left-color: #dcdce1; }
.tl tr.cnt td.slot { text-align: center; font-size: 10px; color: var(--muted); }
.tl tr.cnt td.slot.under { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.tl tr.cnt td.slot.okc { background: var(--ok-soft); color: var(--ok); }
.tl tr.grp td { background: var(--fill); color: var(--text); font-weight: 600; padding: 6px 8px; font-size: 12.5px; }
.tl tr.grp td .actions { float: right; display: inline-flex; gap: 4px; }
.tl tr.grp td button { padding: 2px 8px; font-size: 11.5px; border-radius: 7px; }
.tl tr.shift.sel td { background: #eef5ff; }
.tl tr.shift.focus td.meta { background: #fff8d6; }
.tl tr.shift.drop td { background: var(--accent-soft); }
.tl .bar-cell { position: relative; }
.tl .bar { position: absolute; top: 4px; bottom: 4px; color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 4px; overflow: hidden; white-space: nowrap;
  border-radius: 7px; cursor: pointer; z-index: 0; padding: 0 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); transition: filter .12s var(--ease); }
.tl .bar:hover { filter: brightness(1.05); }
.tl .bar.offen { background: #ff6961; }
.tl .bar.geplant { background: var(--warn-c); }
.tl .bar.bestaetigt { background: var(--ok-c); }
.tl .bar.sub { background: var(--c-obj); }
.tl .bar.verdeckt { box-shadow: inset 0 0 0 2px #1d1d1f; }
.tl .bar .x { margin-left: 4px; background: rgba(0, 0, 0, .25); border-radius: 50%; width: 15px; height: 15px; line-height: 15px; text-align: center; font-size: 10px; flex: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.legend i.hier { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.leg-abs { display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 5px; font-size: 11px; font-weight: 700; text-align: center; line-height: 15px; }

/* ---------- Urlaubsplanung (Jahr): Kapazität je Monat ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cap-month { display: block; text-align: left; background: #fff; border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; white-space: normal; cursor: pointer; }
.cap-month:hover { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); background: #fff; }
.cap-month.active { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.cap-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; width: 100%; }
.cap-badge { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.cap-badge.l0 { background: var(--ok-soft); color: var(--ok); } .cap-badge.l1 { background: #fff6cc; color: #7a5b00; }
.cap-badge.l2 { background: var(--warn-soft); color: var(--warn); } .cap-badge.l3 { background: var(--bad-soft); color: var(--bad); }
.cap-strip { display: grid; grid-template-columns: repeat(31, 1fr); gap: 2px; }
.cap-strip i, .legend i[class^='cap-'] { display: block; height: 16px; border-radius: 3px; }
.cap-strip i.l0, .cap-l0 { background: #e3f4e7; } .cap-strip i.l1, .cap-l1 { background: #ffe58a; } .cap-strip i.l2, .cap-l2 { background: #ffb44d; }
.cap-strip i.l3, .cap-l3 { background: #ff6b5f; } .cap-strip i.lx, .cap-lx { background: #ececf0; }
.cap-foot { font-size: 11.5px; margin-top: 8px; line-height: 1.35; }
.legend i.cap-l0, .legend i.cap-l1, .legend i.cap-l2, .legend i.cap-l3, .legend i.cap-lx { width: 14px; height: 10px; }
.grid-plan tr.cap-row td { font-weight: 700; font-size: 11px; }
.grid-plan tr.cap-row td.cap-l1 { background: #fff2b8; } .grid-plan tr.cap-row td.cap-l2 { background: #ffd8a8; } .grid-plan tr.cap-row td.cap-l3 { background: #ffc9c4; color: var(--bad); }
.grid-plan tr.cap-row td.cap-l0 { background: #eef8f1; } .grid-plan tr.cap-row td.cap-lx { background: var(--weekend); color: var(--muted); font-weight: 400; }
.vac-table th, .vac-table td { white-space: nowrap; }
.vac-cell { min-width: 44px; }
.vac-pill { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 6px; background: var(--c-urlaub); color: #fff; font-weight: 700; font-size: 11px; line-height: 17px; text-align: center; margin-left: 2px; }
.vac-pill.req { opacity: .5; } .vac-pill.k { background: var(--c-krank); color: #3d3000; }

/* ---------- Wachbuch ---------- */
.wb-session { border: 1px solid var(--hair); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; background: #fff; }
.wb-session.offen { border-color: rgba(52, 199, 89, .5); box-shadow: inset 4px 0 0 var(--ok-c); }
.wb-session .wb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.wb-session .wb-note { font-size: 13px; padding: 6px 0; white-space: pre-line; }
.wb-session .tbl td { padding: 6px 8px; }
.wb-live { box-shadow: 0 0 0 2px rgba(52, 199, 89, .35), var(--shadow); }
.read-receipt { color: var(--ok); font-size: 11.5px; font-weight: 600; margin-top: 3px; }

/* ---------- Nachrichten / Posteingang ---------- */
.msg-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 12px; }
.msg-card.unread { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.msg-card.gesendet { background: #fbfbfd; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.msg-text { white-space: pre-line; margin-bottom: 10px; }
.quote { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin-bottom: 12px; white-space: pre-line; color: var(--muted); }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.attachment { display: inline-flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }

/* ---------- Protokoll ---------- */
.proto-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 18px 4px; }
.proto-summary > span { margin-right: 6px; }
.chip-btn { border: 0; box-shadow: none; background: var(--fill); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.chip-btn .n { margin-left: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-btn.active { background: var(--accent); color: #fff; }
.chip-btn.active .n { color: rgba(255, 255, 255, .8); }
.proto-day { margin: 10px 18px; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; }
.proto-day > summary { padding: 9px 14px; background: var(--fill); cursor: pointer; list-style: none; }
.proto-day > summary::-webkit-details-marker { display: none; }
.proto-day > summary::before { content: '›'; display: inline-block; width: 14px; color: var(--muted); transition: transform .2s var(--ease); }
.proto-day[open] > summary::before { transform: rotate(90deg); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px; }

/* ---------- Aufklappbare Gruppen, Info-Listen ---------- */
details.fold { margin-bottom: 12px; }
details.fold > summary { cursor: pointer; padding: 12px 16px; list-style: none; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '›'; display: inline-block; width: 16px; color: var(--muted); transition: transform .2s var(--ease); }
details.fold[open] > summary::before { transform: rotate(90deg); }
.card details.fold > summary { padding: 8px 0; }
dl.info-list { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
dl.info-list dt { color: var(--muted); }
dl.info-list dd { margin: 0; }
.obj-switch { margin-bottom: 14px; max-width: 100%; overflow-x: auto; }
.rate-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--fill); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.meter-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.meter { flex: 1; height: 6px; background: var(--fill-2); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--ok-c); transition: width .3s var(--ease); }
.meter i.warn { background: var(--warn-c); } .meter i.bad { background: var(--bad-c); }
.qual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 12px; }
.qual-grid fieldset { border: 1px solid var(--hair); border-radius: 12px; padding: 8px 12px; margin: 0; }
.qual-grid legend { font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.qual-grid label { display: flex; align-items: center; color: var(--text); font-weight: 400; font-size: 13.5px; padding: 3px 0; }
/* Kunden: Objektplan als Tagesliste */
.day-list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.day-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--hair); align-items: start; }
.day-row:last-child { border-bottom: 0; }
.day-row.today { background: var(--today); }
.day-date { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.day-shifts { display: flex; flex-wrap: wrap; gap: 6px; }
.shift-pill { display: inline-flex; gap: 8px; align-items: baseline; background: var(--fill); border-radius: 10px; padding: 5px 10px; font-size: 13px; }

/* ---------- Kalender (Monatsansicht) ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--hair); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal .wd { background: #fff; text-align: center; padding: 8px; font-weight: 600; font-size: 12px; color: var(--muted); }
.cal .day { min-height: 116px; background: #fff; padding: 6px; font-size: 12px; }
.cal .day.other { background: #fafafc; color: #b0b0b6; }
.cal .day.we { background: #fbfbfd; }
.cal .day.ft { background: var(--holiday); }
.cal .day.today .dn > span:first-child { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; }
.cal .day .dn { font-weight: 600; display: flex; justify-content: space-between; gap: 4px; }
.cal .day .dn small { font-weight: 400; color: #8a6d00; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev { display: flex; align-items: center; margin-top: 4px; padding: 3px 6px; background: var(--accent-soft); border-radius: 6px; border-left: 3px solid var(--accent); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev:hover { text-decoration: none; background: #d9e8fb; }

/* ---------- Mitarbeiter-Portal ---------- */
.shift-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 12px; position: relative; }
.shift-card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--warn-c); }
.shift-card.bestaetigt::before { background: var(--ok-c); }
.shift-card .when { font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.shift-card dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 13.5px; }
.shift-card dt { color: var(--muted); }
.shift-card dd { margin: 0; white-space: pre-line; }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 10%, #dfe9f7 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #e9e3f5 0%, transparent 55%), var(--bg); }
.login-box { background: rgba(255, 255, 255, .86); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); width: 100%; max-width: 400px;
  padding: 32px 30px; border-radius: 24px; box-shadow: var(--shadow-lg); animation: pop .32s var(--ease); }
.login-box img { width: 100%; max-width: 280px; display: block; margin: 0 auto 18px; }
.login-box h1 { font-size: 24px; text-align: center; }
.login-box .form { grid-template-columns: 1fr; }
.login-box > button { width: 100%; justify-content: center; padding: 11px; margin-top: 14px; font-size: 15px; border-radius: 12px; }

/* ---------- Druck ---------- */
.print-only { display: none; }
.print-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.print-page { background: #fff; padding: 28px; max-width: 1000px; margin: 0 auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.print-page .ph { display: flex; align-items: center; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; gap: 14px; }
.print-page .ph img { height: 60px; }
.print-page .ph .addr { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); }
.tbl-write td.box { min-width: 64px; border-left: 1px solid var(--hair); position: relative; }
.ausweis { width: 85.6mm; height: 54mm; border: 1px solid #333; border-radius: 3mm; display: grid; grid-template-columns: 26mm 1fr; gap: 3mm; padding: 3mm; font-size: 8pt; background: #fff; position: relative; overflow: hidden; }
.ausweis .band { position: absolute; left: 0; right: 0; top: 0; height: 9mm; background: var(--navy); color: #fff; display: flex; align-items: center; padding-left: 3mm; font-weight: 700; letter-spacing: .5px; font-size: 9pt; gap: 2mm; }
.ausweis .band img { height: 7mm; background: #fff; padding: .5mm; }
.ausweis .foto { margin-top: 8mm; width: 26mm; height: 33mm; object-fit: cover; border: 1px solid #999; background: #eee; }
.ausweis .data { margin-top: 9mm; }
.ausweis .data b { font-size: 10pt; display: block; }

/* Vorlagen der Firma (Stundennachweise, Wachbericht) im A4-Format */
.tpl { color: #111; }
.tpl-page { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto 18px; padding: 12mm 12mm 16mm; box-shadow: var(--shadow); position: relative; font-size: 9.5pt; line-height: 1.3; }
.tpl-head { width: 100%; border-collapse: collapse; margin-bottom: 4mm; }
.tpl-head td { vertical-align: middle; padding: 2mm; border-bottom: 2px solid var(--navy); }
.tpl-head .logo img { height: 18mm; display: block; }
.tpl-head .title { text-align: center; }
.tpl-head .title .t { font-size: 16pt; font-weight: 800; letter-spacing: .06em; color: var(--navy); }
.tpl-head .title .s { font-size: 9pt; color: #444; }
.tpl-head .firm { text-align: right; font-size: 8pt; color: #333; white-space: nowrap; }
.tpl-info { width: 100%; border-collapse: collapse; margin-bottom: 4mm; }
.tpl-info th { text-align: left; font-weight: 600; width: 19%; padding: 1.5mm 2mm; border: 1px solid #999; background: #f2f4f7; font-size: 8.5pt; }
.tpl-info td { padding: 1.5mm 2mm; border: 1px solid #999; width: 31%; }
.tpl-grid { width: 100%; border-collapse: collapse; }
.tpl-grid th { background: #e9edf2; border: 1px solid #888; padding: 1.5mm 1mm; font-size: 8pt; font-weight: 700; text-align: center; hyphens: auto; }
.tpl-grid td { border: 1px solid #888; padding: 1mm 1.5mm; height: 8.2mm; vertical-align: middle; }
.tpl-grid td.write, .tpl-grid td.val { position: relative; min-width: 15mm; text-align: center; }
.tpl-grid .soll { position: absolute; top: .6mm; left: 1mm; font-size: 6.5pt; color: #888; line-height: 1; }
.tpl-grid td.sig { width: 30mm; }
.tpl-grid tfoot td { font-weight: 700; background: #f2f4f7; }
.tpl-grid .soll-sum { font-weight: 400; color: #777; font-size: 7.5pt; }
.tpl-grid .star { font-weight: 800; }
.tpl-text { font-size: 8.5pt; margin: 4mm 0; }
.tpl-small { font-size: 7.5pt; color: #444; margin: 2mm 0; }
.tpl-sign { width: 100%; border-collapse: collapse; margin-top: 12mm; font-size: 8pt; }
.tpl-sign td { width: 46%; vertical-align: top; text-align: center; }
.tpl-sign td.gap { width: 8%; }
.tpl-sign .line, .tpl-control .line { border-top: 1px solid #333; margin-bottom: 1mm; height: 0; margin-top: 12mm; }
.tpl-sign .sub { color: #666; font-size: 7pt; }
.tpl-foot { position: absolute; left: 12mm; right: 12mm; bottom: 6mm; text-align: center; font-size: 7.5pt; color: #666; border-top: 1px solid #ccc; padding-top: 1.5mm; }
.hinweise { font-size: 8pt; }
.hinweise .hw-head { display: flex; flex-direction: column; gap: 1mm; border-bottom: 2px solid var(--navy); padding-bottom: 2mm; margin-bottom: 3mm; }
.hinweise .hw-head b { font-size: 12pt; letter-spacing: .04em; color: var(--navy); }
.hinweise .hw-head span { color: #555; font-size: 8pt; }
.hinweise h3 { font-size: 9pt; margin: 3mm 0 1mm; color: var(--navy); }
.hinweise p { margin: 0 0 1.5mm; text-align: justify; }
.wachbericht .wb-top { display: flex; align-items: center; gap: 8mm; border-bottom: 2px solid var(--navy); padding-bottom: 3mm; }
.wachbericht .wb-top img { height: 18mm; }
.wb-fields { border-collapse: collapse; flex: 1; }
.wb-fields th { text-align: left; font-weight: 600; padding: 1mm 3mm 1mm 0; white-space: nowrap; width: 34mm; }
.wb-fields td { border-bottom: 1px solid #777; padding: 1mm 2mm; }
.wb-title { text-align: center; font-size: 18pt; letter-spacing: .08em; margin: 4mm 0; color: var(--navy); }
.wb-sub { font-size: 10pt; margin: 4mm 0 1.5mm; }
.tpl-lines { width: 100%; border-collapse: collapse; }
.tpl-lines td { border-bottom: 1px solid #999; height: 7.2mm; font-size: 8.5pt; }
.tpl-control { width: 100%; border-collapse: collapse; }
.tpl-control td { width: 50%; border: 1px solid #888; padding: 2mm 3mm; vertical-align: top; font-size: 8pt; }
.tpl-control .ctl { display: flex; gap: 8mm; margin-top: 3mm; }

@media print {
  body { background: #fff; }
  .topbar, .nav, .subnav, .no-print, .toasts, .idle-timer { display: none !important; }
  main { padding: 0; max-width: none; }
  .page { animation: none; }
  .print-page { box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
  .print-only { display: block; }
  .card, .stat, .shift-card, .msg-card, .day-list { box-shadow: none; border: 1px solid #ddd; }
  .tbl th { position: static; }
  a { color: inherit; }
  details.fold > summary::before { display: none; }
  @page { margin: 12mm; }
  .tpl-page { box-shadow: none; margin: 0; width: auto; min-height: 0; padding: 0 0 12mm; page-break-after: always; break-after: page; }
  .tpl-page:last-child { page-break-after: auto; break-after: auto; }
  .tpl-foot { position: static; margin-top: 6mm; }
  .tpl-grid thead { display: table-header-group; }
  .tpl-grid tr { break-inside: avoid; }
}

/* ---------- Bewegung, Transparenz, Kontrast nach Systemeinstellung ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  button:active:not(:disabled), .btn:active, .nav a:active, .chip:active, .p-item:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .toast, .login-box, .intraday .pool .pool-head { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar { background: #fff; } .toast { background: #1d1d1f; } .login-box { background: #fff; }
}
@media (prefers-contrast: more) {
  :root { --hair: rgba(0, 0, 0, .28); --muted: #4a4a4f; --line: #8e8e93; }
  .card, .stat, .modal, .msg-card { box-shadow: 0 0 0 1px #6e6e73; }
}

/* ---------- Mittlere Breiten (kleine Notebooks) ---------- */
@media (max-width: 1440px) {
  .topbar .title { display: none; }
  .nav a { padding: 7px 10px; }
}
@media (max-width: 1300px) {
  .topbar .user > div { display: none; }
  .nav a { padding: 7px 9px; }
}

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .topbar .title { display: none; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
}
@media (max-width: 900px) {
  main { padding: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form, .form.cols-3 { grid-template-columns: 1fr; }
  .side-layout, .intraday { grid-template-columns: 1fr; }
  .side-menu { position: static; }
  .topbar .logo { height: 30px; }
  .topbar .user > div { display: none; }
  .tbl-tools .search { width: 100%; margin-left: 0; }
  .shift-card dl, dl.info-list { grid-template-columns: 1fr; }
  .shift-card dt { margin-top: 4px; }
  .day-row { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
  .modal-bg { padding: 12px 6px; }
  .tpl-page { width: auto; min-height: 0; }
}
