/* =============================================================
   ResqShift — Oberfläche nach dem Vorbild des Praktikantenplanners
   Prinzip wie dort: neutrale Bedienung, farbig sind nur die Daten.
   Wachenfarben kommen aus der Datenbank (wache.farbe).
   Information nie nur über Farbe: Kürzel stehen als Text in der
   Zelle, PA-Markierungen unterscheiden sich in der Form, Warnungen
   tragen ein Zeichen.
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
* { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body); font-size: var(--text-base); color: var(--text-main); line-height: 1.5;
  background: var(--bg-body); min-height: 100vh; overflow-x: hidden;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3 { color: var(--text-main); line-height: 1.25; letter-spacing: -0.011em; font-weight: 600; }
h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--text-xl); }
a { color: var(--c-link); text-decoration: none; font-weight: 500; }
a:hover { color: #1d4ed8; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }
.tabular, td { font-variant-numeric: tabular-nums; }

.sprung { position: absolute; left: 8px; top: -60px; z-index: 2000; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius-md); }
.sprung:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------- Kopfleiste */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: var(--space-4);
  height: var(--kopf); padding: 0 var(--space-5);
  background: var(--kopf-grund);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.brand img { width: 34px; height: 34px; display: block; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.brand:hover .brand-name { color: #fff; }
.app-nav { display: flex; align-items: center; gap: var(--space-1); margin-left: var(--space-6); }
.app-nav a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 500; color: rgba(255,255,255,.7);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.app-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.app-nav svg { width: 15px; height: 15px; }
.user-zone {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.75); font-size: var(--text-sm);
}
.user-name { font-weight: 500; }
.user-action {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); font-size: var(--text-sm); font-weight: 500;
}
.user-action:hover { background: rgba(255,255,255,.16); color: #fff; }
.topbar :focus-visible { outline-color: #fff; }

/* ---------------------------------------------------------- Grundbausteine */
.app-main { padding: var(--space-5); }
.card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: var(--space-6); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 32px; padding: 6px 12px; border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--text-main); font-size: var(--text-sm); font-weight: 500; line-height: 1;
  white-space: nowrap; user-select: none; cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: #fff; }
.btn-secondary { background: var(--bg-surface); border-color: var(--border-medium); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--c-50); border-color: var(--c-400); color: var(--text-main); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--c-100); color: var(--text-main); }
.btn-sm { height: 26px; padding: 4px 8px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-symbol { width: 32px; padding: 0; }

/* ---------------------------------------------------------- Werkzeugleiste */
.werkzeugleiste { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.leiste-oben { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.monat-wahl { display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--c-50); }
.mw-pfeil { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 100%; border: 0; background: transparent; color: var(--text-muted); }
.mw-pfeil:hover { color: var(--text-main); background: var(--c-100); }
.mw-titel { min-width: 132px; text-align: center; font-weight: 600; font-size: var(--text-base); }
.mw-heute { height: 100%; padding: 0 12px; border: 0; border-left: 1px solid var(--border-light); background: transparent; font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.mw-heute:hover { background: var(--c-100); color: var(--text-main); }
.wachen-filter { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.wf {
  height: 30px; padding: 0 10px; border-radius: var(--radius-full); border: 1.5px solid transparent;
  background: var(--c-100); color: var(--text-secondary); font-size: var(--text-xs); font-weight: 600;
}
.wf:hover { filter: brightness(.96); }
.wf[aria-pressed="true"] { border-color: var(--c-900); color: var(--c-900); box-shadow: 0 0 0 2px rgba(15,23,42,.12); }
.werkzeuge { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.tool-action {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--border-medium); border-radius: var(--radius-sm); background: var(--bg-surface);
  color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500; cursor: pointer; user-select: none;
}
.tool-action:hover { background: var(--c-50); color: var(--text-main); }
.tool-action input { width: 14px; height: 14px; accent-color: var(--c-success); }
.tool-action:has(input:checked) { border-color: var(--c-success); background: var(--c-success-soft); color: var(--c-success); }

.legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--c-100); }
.lg-gruppe { display: inline-flex; align-items: center; gap: 6px; }
.lg-titel { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.lg-pills { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.lg-pill { padding: 3px 8px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 700; color: var(--c-900); line-height: 1.3; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.lg-trenner { width: 1px; align-self: stretch; background: var(--border-light); }
.lg-zeichen { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-secondary); }
.lg-zelle { position: relative; display: inline-block; width: 26px; height: 18px; border-radius: 4px; background: var(--c-200); }

.warnleiste {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: var(--space-4);
  padding: 10px 14px; border: 1px solid var(--c-danger-border); background: var(--c-danger-soft);
  border-radius: var(--radius-lg); color: var(--c-danger); font-size: var(--text-sm);
}
.warnleiste strong { font-weight: 700; }
.warn-zeichen { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--c-danger); color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* ---------------------------------------------------------- Kalender */
.calendar-wrap {
  background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); overflow: auto; max-height: calc(100vh - var(--kopf) - 210px);
}
.raster table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.raster thead th {
  position: sticky; top: 0; z-index: 25; background: var(--c-50);
  box-shadow: inset 0 -1px 0 var(--border-light), inset 1px 0 0 var(--border-light);
  width: var(--spalte-tag); min-width: var(--spalte-tag); padding: 0.5rem; text-align: left; font-weight: 400;
}
.raster thead th .tg { display: block; font-size: 1rem; font-weight: 600; line-height: 1.1; color: var(--text-main); font-variant-numeric: tabular-nums; }
.raster thead th .wt { display: block; font-size: 0.7rem; color: var(--text-muted); line-height: 1.2; }
.raster thead th .zahl { display: block; margin-top: 2px; font-size: 0.65rem; font-weight: 700; color: var(--c-success); }
.raster thead th.we { background: var(--c-100); }
.raster thead th.ft { background: var(--c-feiertag-kopf); }
.raster thead th.ft .tg, .raster thead th.ft .wt { color: #c2410c; }
.raster thead th.heute { background: var(--c-heute); box-shadow: inset 0 -2px 0 var(--c-heute-rand), inset 1px 0 0 var(--border-light); }
.raster thead th.heute .tg, .raster thead th.heute .wt { color: var(--c-heute-rand); font-weight: 700; }
.raster thead th.name-col {
  position: sticky; left: 0; z-index: 35; width: var(--spalte-name); min-width: var(--spalte-name);
  padding: 0.85rem 0.75rem; font-size: var(--text-sm); font-weight: 600; color: var(--text-main);
  box-shadow: inset -1px 0 0 var(--border-light), inset 0 -1px 0 var(--border-light);
}

.raster td.name-cell {
  position: sticky; left: 0; z-index: 5; background: var(--bg-surface);
  padding: 0.4rem 0.5rem; border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--c-100);
  width: var(--spalte-name); min-width: var(--spalte-name); max-width: var(--spalte-name);
}
.raster tr:hover td.name-cell { background: var(--c-50); }
.pill {
  position: relative; display: block; padding: 5px 10px; border-radius: var(--radius-md);
  font-size: var(--text-sm); line-height: 1.3; color: var(--c-900);
}
.pill .pn { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 12px; }
.pill .pm { display: block; font-size: 0.7rem; color: rgba(15,23,42,.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill .status { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--c-success); box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.pill .status.fehler { background: var(--c-danger); }
.pill .status.ohne { background: var(--c-400); }

.raster td.z {
  border-left: 1px solid var(--border-light); border-bottom: 1px solid var(--c-100);
  height: var(--zeile); width: var(--spalte-tag); min-width: var(--spalte-tag); max-width: var(--spalte-tag);
  padding: 0; text-align: center; vertical-align: middle; position: relative;
}
.raster td.we { background: var(--c-50); }
.raster td.ft { background: var(--c-feiertag); }
.raster td.heute { background: var(--c-heute); }
.raster td.ungeplant { background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(148,163,184,.14) 5px 6px); }
.z-btn {
  all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; cursor: pointer; position: relative;
}
.z-btn:hover { box-shadow: inset 0 0 0 2px var(--c-900); }
.z-btn:focus-visible { box-shadow: inset 0 0 0 2px var(--c-link); }

.shift {
  position: relative; display: inline-block; width: 90%; padding: 0.3rem 0.1rem; border-radius: 5px;
  font-size: 0.72rem; font-weight: 600; text-align: center; color: var(--c-900);
  box-shadow: 0 1px 2px rgba(15,23,42,.08); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shift-grau { background: var(--c-200); }
/* Urlaub türkis wie im Urlaubsplaner: kräftig genehmigt, hell mit gestricheltem Rand beantragt, geplant siehe .sim-urlaub */
.shift-urlaub { background: #2dd4bf; color: #134e4a; box-shadow: none; }
.shift-beantragt { background: #f0fdfa; color: #0f766e; border: 1px dashed #14b8a6; box-shadow: none; }
.shift-krank { background: var(--c-100); color: var(--text-muted); box-shadow: none; }
.shift-unbekannt { background: var(--c-danger-soft); color: var(--c-danger); border: 1px solid var(--c-danger-border); }
.shift-prak { background: var(--bg-surface); border: 1.5px solid var(--c-500); }
.shift-hand { outline: 1px dashed var(--c-600); outline-offset: 1px; }
.vergangen .shift { opacity: .8; }

/* PA im Tagdienst auf dem Fahrzeug: Ring, eigener PA: gefüllter Punkt */
.pa-mark { position: absolute; top: 3px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--c-900); }
.pa-mark.eigen { background: var(--c-success); box-shadow: 0 0 0 1.5px #fff; }

/* Doppelbelegung */
.raster td.konflikt { background: var(--c-danger-soft); box-shadow: inset 0 0 0 2px var(--c-danger); }
.konflikt-text { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700; color: var(--c-danger); }

/* Freie Plätze */
.zeige-frei td.frei { background: var(--c-frei); }
.zeige-frei td.frei .z-btn::before { content: "frei"; font-size: 0.65rem; font-weight: 600; color: var(--c-success); }
.zeige-frei td.frei-pa { background: var(--c-frei-pa); }
.zeige-frei.nur-pa td.frei:not(.frei-pa) { background: transparent; }
.zeige-frei.nur-pa td.frei:not(.frei-pa) .z-btn::before { content: none; }

/* Gruppen (aufklappbar wie im Planner) */
.gruppe td { padding: 0; }
.gruppe td.g-label {
  position: sticky; left: 0; z-index: 10; background: var(--bg-surface);
  box-shadow: inset -1px 0 0 var(--border-light); width: var(--spalte-name); min-width: var(--spalte-name); max-width: var(--spalte-name);
}
.gruppe td.g-rest { background: var(--c-50); border-bottom: 1px solid var(--border-light); }
.g-kopf {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 14px 8px 0; border-bottom: 1px solid var(--border-light); cursor: pointer; white-space: nowrap; overflow: hidden;
}
.g-kopf:focus-visible { box-shadow: inset 0 0 0 2px var(--c-link); }
.g-bar { width: 3px; align-self: stretch; background: var(--c-300); border-radius: 0 2px 2px 0; }
.g-pfeil { color: var(--text-faint); display: inline-flex; transition: transform var(--transition-fast); }
.g-pfeil svg { width: 14px; height: 14px; }
.g-kopf[aria-expanded="false"] .g-pfeil { transform: rotate(-90deg); }
.g-titel { font-size: var(--text-sm); font-weight: 600; color: var(--text-main); }
.g-sub { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.g-sub::before { content: "·"; margin-right: 6px; color: var(--text-faint); }
.leer { color: var(--text-faint); font-style: italic; }

/* ---------------------------------------------------------- Seiten: Personen, Abruf */
.seite { max-width: 1180px; margin: 0 auto; }
.seite-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.seite-kopf p { color: var(--text-muted); font-size: var(--text-sm); margin-top: 2px; }
.seite .card { padding: 0; margin-bottom: var(--space-5); overflow: hidden; }
.card-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-light); }
.card-kopf h2 { font-size: var(--text-lg); }
.card-kopf p { color: var(--text-muted); font-size: var(--text-xs); margin-top: 2px; }
.tabelle { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tabelle th { text-align: left; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--c-50); padding: 9px 14px; border-bottom: 1px solid var(--border-light); }
.tabelle td { padding: 9px 14px; border-bottom: 1px solid var(--c-100); vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tr:hover td { background: var(--c-25); }
.tabelle .inaktiv td { color: var(--text-faint); }
.wache-pill { display: inline-block; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 700; color: var(--c-900); }
.ok { color: var(--c-success); font-weight: 600; }
.fehler { color: var(--c-danger); font-weight: 600; }
.unter { color: var(--text-muted); font-size: var(--text-xs); }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.kachel { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.kachel .wert { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kachel .bez { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.hinweis-karte { max-width: 520px; margin: 12vh auto; }
.hinweis-karte h1 { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
.hinweis-karte p { color: var(--text-secondary); margin-bottom: var(--space-4); }

/* ---------------------------------------------------------- Blatt (Details, Formulare) */
.blatt {
  position: fixed; top: calc(var(--kopf) + 12px); right: 12px; bottom: 12px; z-index: 1050;
  width: min(420px, calc(100vw - 24px)); background: var(--bg-surface);
  border: 1px solid var(--border-light); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-light); }
.blatt-kopf h2 { font-size: var(--text-lg); }
.blatt-inhalt { padding: var(--space-4) var(--space-5) var(--space-6); overflow: auto; }
.blatt-inhalt .zeile { padding: 10px 0; border-bottom: 1px solid var(--c-100); }
.blatt-inhalt .zeile:last-child { border-bottom: 0; }
.blatt-inhalt .titel { font-weight: 600; }
.blatt-inhalt .warnleiste { margin: 10px 0; }
.feld { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-4); }
.feld > label, .feld > .feld-titel { font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); }
.feld input[type="text"], .feld input[type="url"], .feld input[type="date"], .feld select {
  height: 36px; padding: 6px 10px; border: 1px solid var(--border-medium); border-radius: var(--radius-md); background: #fff;
  font-size: var(--text-base);
}
.feld input:focus, .feld select:focus { outline: none; border-color: var(--c-link); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.feld .hilfe { font-size: var(--text-xs); color: var(--text-muted); }
.auswahl-liste { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 6px; }
.auswahl-liste label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; }
.auswahl-liste label:hover { background: var(--c-50); }
.auswahl-liste .gruppen-titel { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 6px 6px 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); cursor: pointer; }
.formfehler { color: var(--c-danger); font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-3); }
.aktionen { display: flex; gap: var(--space-2); margin-top: var(--space-4); }

/* ---------------------------------------------------------- Abruf-Anzeige unten rechts (wie im Planner) */
.sync-widget {
  position: fixed; bottom: 16px; right: 16px; z-index: 1000;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px;
  background: rgba(10, 22, 40, .94); color: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 500; box-shadow: 0 4px 16px rgba(2,6,23,.25); user-select: none;
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.25); }
.sync-widget.alt .sync-dot { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.sync-widget.fehler .sync-dot { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }
.sync-label { white-space: nowrap; }
.sync-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; }
.sync-btn:hover { background: rgba(255,255,255,.18); }
.sync-btn svg { width: 14px; height: 14px; }
.sync-widget.laeuft .sync-btn svg { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- Handy */
@media (max-width: 900px) {
  .app-nav span, .user-name, .user-action span { display: none; }
  .app-nav { margin-left: var(--space-2); }
  .app-nav a { padding: 8px; }
  .topbar { gap: var(--space-2); padding: 0 var(--space-3); }
  .app-main { padding: var(--space-3); }
  :root { --spalte-name: 150px; --spalte-tag: 46px; --zeile: 42px; }
  .pill { padding: 4px 8px; }
  .werkzeuge { margin-left: 0; }
  .calendar-wrap { max-height: calc(100vh - var(--kopf) - 260px); }
  .sync-widget { bottom: 10px; right: 10px; padding: 6px 8px 6px 10px; font-size: 11px; }
}
@media (max-width: 600px) {
  .legende .lg-gruppe, .legende .lg-trenner { display: none; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------- Statistik */
.seite-breit { max-width: 1320px; }
.hinweise { padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); }
.hinweise h2 { font-size: var(--text-base); margin-bottom: 6px; }
.hinweise ul { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); color: var(--text-secondary); }
.ampel { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.ampel svg { width: 14px; height: 14px; }
.ampel-gut { background: var(--c-success-soft); color: var(--c-success); border: 1px solid var(--c-success-border); }
.ampel-warn { background: var(--c-warning-soft); color: var(--c-warning); border: 1px solid var(--c-warning-border); }
.ampel-rot { background: var(--c-danger-soft); color: var(--c-danger); border: 1px solid var(--c-danger-border); }
.ampel-neu, .ampel-unvollstaendig { background: var(--c-100); color: var(--text-secondary); border: 1px solid var(--border-light); }
.kachel .wert.gut { color: var(--c-success); } .kachel .wert.warn { color: var(--c-warning); } .kachel .wert.rot { color: var(--c-danger); }

.seite .card.hinweise { padding: var(--space-4) var(--space-5); }
.hinweise li { display: flex; align-items: flex-start; gap: 10px; }
.stat-karte .card-kopf h2 { font-size: var(--text-base); }
.stat-zeile {
  display: grid; grid-template-columns: 240px minmax(150px, 1fr) minmax(150px, 1fr) minmax(130px, 0.8fr) 120px 150px 90px;
  align-items: center; gap: var(--space-4); padding: 10px var(--space-5); border-bottom: 1px solid var(--c-100);
}
.stat-kopfzeile { padding-top: 8px; padding-bottom: 8px; background: var(--c-50); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.meter-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.meter-wert { font-size: var(--text-sm); font-weight: 600; }
.meter-wert .soll { color: var(--text-muted); font-weight: 500; }
.meter-prozent { font-size: var(--text-xs); color: var(--text-muted); }
.meter { position: relative; height: 8px; border-radius: var(--radius-full); background: #dbeafe; }
.meter-fuellung { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-full); background: var(--c-link); }
.meter.warn { background: #fde68a; } .meter.warn .meter-fuellung { background: var(--c-warning); }
.meter.rot { background: #fecaca; } .meter.rot .meter-fuellung { background: var(--c-danger); }
.meter.neutral { background: var(--c-200); } .meter.neutral .meter-fuellung { background: var(--c-600); }
.meter-zeit { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--c-900); border-radius: 1px; box-shadow: 0 0 0 2px #fff; }
.meter-erwartet {
  position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 2; padding: 2px 7px;
  border-radius: var(--radius-sm); background: var(--c-900); color: #fff; font-size: var(--text-xs); font-weight: 600;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
.meter-erwartet::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--c-900); }
.meter-erwartet.links { transform: translateX(-12px); } .meter-erwartet.links::after { left: 12px; }
.meter-erwartet.rechts { transform: translateX(calc(-100% + 12px)); } .meter-erwartet.rechts::after { left: auto; right: 8px; margin-left: 0; }
.meter-block:hover .meter-erwartet, .meter:focus-visible .meter-erwartet { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .meter-erwartet { transition: none; } }
.stat-begleitung { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; }
.stat-begleitung b { font-size: var(--text-sm); color: var(--text-main); }
.stat-details { background: var(--c-25); border-bottom: 1px solid var(--border-light); }
.stat-teile { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); padding: var(--space-4) var(--space-5) var(--space-2); font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.6; }
.stat-teile b { color: var(--text-main); font-size: var(--text-sm); }
.stat-details-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-5) var(--space-3); }
.stat-details-fuss .btn { margin-left: auto; }
.ak-monate { border-top: 1px solid var(--border-light); overflow-x: auto; background: var(--bg-surface); }
.ak-monate .tabelle td, .ak-monate .tabelle th { text-align: right; white-space: nowrap; }
.ak-monate .tabelle td:first-child, .ak-monate .tabelle th:first-child { text-align: left; }
.leer-wert { color: var(--text-faint); }
@media (max-width: 1180px) {
  .stat-zeile { grid-template-columns: 200px repeat(3, minmax(0, 1fr)); }
  .stat-kopfzeile { display: none; }
  .stat-begleitung, .stat-zeile > div:nth-last-child(2), .stat-zeile > div:last-child { grid-column: span 1; }
  .stat-teile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .stat-zeile { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-zeile .pill { grid-column: 1 / -1; }
  .stat-teile { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------- Praktikanten */
.pill-prak { background: var(--bg-surface); border: 2px solid var(--c-300); padding: 3px 8px; }
.feld-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.feld input[type="time"] { height: 36px; padding: 6px 10px; border: 1px solid var(--border-medium); border-radius: var(--radius-md); background: #fff; font-size: var(--text-base); }
.auswahl-liste input[type="radio"]:disabled + span { color: var(--text-faint); text-decoration: line-through; }
.zaehler-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-light); background: var(--c-25); font-size: var(--text-sm); }
.zaehler-leiste label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.zaehler-leiste input { height: 30px; padding: 4px 8px; border: 1px solid var(--border-medium); border-radius: var(--radius-md); background: #fff; }
.feld-titel { font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); }

/* Fahrzeuge oben als Auswahl zum Eintragen (Azubi-Ansicht mit Praktikanten), wie im alten Planner */
.pinsel-leiste { display: contents; }
.lg-pinsel { border: 0; cursor: pointer; }
.lg-pinsel:hover { filter: brightness(.95); }
.lg-pinsel[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--c-900), 0 0 0 4px rgba(15,23,42,.15); }
.lg-pinsel:disabled { opacity: .35; cursor: not-allowed; filter: none; }
.modus-wahl.klein { height: 26px; }
.modus-wahl.klein button { padding: 0 10px; font-size: var(--text-xs); }
.raster.mit-pinsel td.prak-tag .z-btn { cursor: cell; }
.pill-btn.pill-prak { background: var(--bg-surface); border: 2px solid var(--c-300); padding: 3px 8px; }
.raster td.ausserhalb { background: var(--c-100); }
.raster td.ausserhalb .z-btn { cursor: default; }
.raster td.ausserhalb .z-btn:hover { box-shadow: none; }
/* Stunden von Hand angepasst: kleines h unten rechts */
.std-mark {
  position: absolute; right: 3px; bottom: 2px; padding: 0 3px; border-radius: 3px;
  background: var(--c-900); color: #fff; font-size: 9px; font-weight: 700; line-height: 11px;
}
.raster tr.gruppe td.rechts-titel {
  background: var(--c-50); font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border-light);
}
@media (max-width: 600px) {
  .legende .pinsel-leiste { display: flex; align-items: center; gap: 6px 14px; flex: 1 0 100%; overflow-x: auto; padding: 2px 2px 6px; }
  .legende .pinsel-leiste .lg-gruppe { display: inline-flex; flex-shrink: 0; }
  .legende .pinsel-leiste .lg-pills { flex-wrap: nowrap; }
  .legende .pinsel-leiste .lg-pinsel { padding: 6px 10px; font-size: 0.75rem; }
  /* Azubi-Ansicht am Handy: Soll, Ist, Konto bzw. der Zähler stehen am Zeilenende statt fest über den Tagen */
  #raster .r1, #raster .r2, #raster .r3 { right: auto; }
}

/* ---------------------------------------------------------- Simulation */
#ansicht-simulation .werkzeugleiste .tool-action { margin-left: 0; }
.sim-info { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--c-100); font-size: var(--text-xs); color: var(--text-muted); }
.vorgaben-karte { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.vorgabe-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.vorgabe-form select, .vorgabe-form input { height: 30px; padding: 4px 8px; border: 1px solid var(--border-medium); border-radius: var(--radius-md); background: #fff; }
.vorgabe-form label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.sim-raster { max-height: calc(100vh - var(--kopf) - 330px); }
.shift.sim-neu { box-shadow: 0 0 0 1.5px var(--c-900), 0 1px 2px rgba(15,23,42,.08); }
.shift.sim-fest { opacity: .5; }
.shift.sim-fest.shift-urlaub, .shift.sim-fest.shift-beantragt { opacity: 1; }
.shift.sim-vorgabe { background: var(--bg-surface); color: var(--text-muted); border: 1px dashed var(--c-400); box-shadow: none; }
.pa-mark.vielleicht { width: 10px; height: 10px; background: #fff; box-shadow: none; border: 1.5px dashed var(--c-700); }
.pa-mark.eigen.vielleicht { background: var(--c-success-soft); border: 1.5px dashed var(--c-success); }
.lg-muster { width: auto; padding: 2px 6px; font-size: 0.65rem; }
.sim-legende { margin: var(--space-3) 0 var(--space-4); border-top: 0; padding-top: 0; }
.sim-tabelle { padding: 0; overflow: hidden; }
.sim-tabelle .wochen { font-size: var(--text-xs); }
.woche { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--c-100); white-space: nowrap; }
.woche.fehler { background: var(--c-danger-soft); color: var(--c-danger); }
.shift.sim-tafel { background: var(--c-150); color: var(--text-muted); box-shadow: none; }

/* ---------------------------------------------------------- Spalten rechts: Soll, Ist, Konto bzw. Urlaub */
.raster thead th.rechts-col, .raster td.rechts-zelle {
  position: sticky; z-index: 6; width: 62px; min-width: 62px; max-width: 62px;
  text-align: right; padding: 0 10px; background: var(--bg-surface); font-variant-numeric: tabular-nums;
}
.raster thead th.rechts-col { z-index: 30; background: var(--c-50); font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); }
.raster td.rechts-zelle { font-size: var(--text-sm); border-bottom: 1px solid var(--c-100); }
.raster .r1 { right: 0; } .raster .r2 { right: 62px; } .raster .r3 { right: 124px; } .raster .r4 { right: 186px; }
.raster thead th.r3, .raster td.r3, .raster td.rechts-zelle.r4, .raster thead th.r4 { box-shadow: inset 1px 0 0 var(--border-light); }
.raster thead th.r3:not(:has(~ .r4)) { box-shadow: inset 1px 0 0 var(--border-light); }
.raster td.g-rest.rechts-leer { background: var(--c-50); }
.konto { font-weight: 600; }
.konto.minus { color: var(--c-danger); }
.konto.plus { color: var(--c-success); }
.pill-btn { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; position: relative; padding: 5px 10px; border-radius: var(--radius-md); font-size: var(--text-sm); line-height: 1.3; color: var(--c-900); }
.pill-btn:hover { filter: brightness(.96); box-shadow: 0 0 0 2px var(--c-900) inset; }
.pill-btn:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }
.blatt-werte { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0; font-size: var(--text-sm); color: var(--text-secondary); }
.blatt-werte b { color: var(--text-main); font-weight: 600; }
.blatt-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 8px 0 4px; font-size: var(--text-xs); }
.blatt-form label { display: flex; flex-direction: column; gap: 3px; color: var(--text-secondary); font-weight: 600; }
.blatt-form input { height: 30px; padding: 4px 8px; border: 1px solid var(--border-medium); border-radius: var(--radius-md); font-size: var(--text-sm); width: 140px; }
.pdf-knoepfe { display: flex; flex-direction: column; gap: 8px; }
.pdf-knoepfe .btn { justify-content: flex-start; }
.modus-wahl { display: inline-flex; border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; height: 34px; }
.modus-wahl button { border: 0; background: var(--bg-surface); padding: 0 12px; font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.modus-wahl button + button { border-left: 1px solid var(--border-light); }
.modus-wahl button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.shift.sim-urlaub { background: #ccfbf1; color: #115e59; border: 1px solid #5eead4; box-shadow: none; }
.urlaub-zahl { color: #0f766e !important; }
.shift.sim-urlaub.sim-konflikt { border-color: var(--c-danger); box-shadow: 0 0 0 1px var(--c-danger); }
.g-wahl { border: 0; padding: 0; margin: 0 0 var(--space-4); min-width: 0; }
.g-wahl legend { padding: 0; margin-bottom: 4px; }
.g-gruppe { display: flex; margin-top: var(--space-2); padding: 6px 0; font-weight: 600; }
.g-namen { display: flex; flex-direction: column; padding-left: 24px; border-bottom: 1px solid var(--c-100); padding-bottom: var(--space-2); }
.g-namen .check { padding: 5px 0; }
.g-option { display: flex; padding: 6px 0; }
.raster.breit thead th.rechts-col, .raster.breit td.rechts-zelle { width: 80px; min-width: 80px; max-width: 80px; }
.raster.breit .r2 { right: 80px; } .raster.breit .r3 { right: 160px; } .raster.breit .r4 { right: 240px; }
