/* HR Shell und Komponenten — minimalistisch, dicht, ohne Dekoration ohne Funktion. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--hr-font-stack);
  font-size: var(--hr-font-sm);
  color: var(--hr-text);
  background: var(--hr-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--hr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Icons erben Farbe und richten sich optisch an der Textzeile aus. */
svg.icon { flex: none; vertical-align: -0.125em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--hr-surface);
  padding: var(--hr-space-2) var(--hr-space-3); z-index: 200; border-radius: var(--hr-radius-sm);
}
.skip-link:focus { left: var(--hr-space-2); }

/* ---- Grundgerüst: Sidebar + Topbar + Inhalt ---- */
.app {
  display: grid;
  grid-template-columns: var(--hr-sidebar-width) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--hr-surface);
  border-right: 1px solid var(--hr-border-soft);
  padding: var(--hr-space-4) var(--hr-space-3);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: var(--hr-z-sidebar);
}
.sidebar-brand {
  position: relative;
  display: flex; align-items: center; gap: var(--hr-space-1);
  padding: 0 var(--hr-space-2) var(--hr-space-4);
  border-bottom: 1px solid var(--hr-border-soft);
  margin-bottom: var(--hr-space-3);
}
/* Der Firmenkopf ist ein Link auf die Startseite — ohne Unterstrich, aber mit
   sichtbarem Hover- und Fokuszustand. */
.firmen-knopf {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: var(--hr-space-2);
  padding: var(--hr-space-1); margin: calc(-1 * var(--hr-space-1));
  border-radius: var(--hr-radius-md); color: inherit; text-decoration: none;
  transition: background var(--hr-dauer-schnell) var(--hr-ease);
}
.firmen-knopf:hover { background: var(--hr-surface-muted); }
.firmen-knopf:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.marke {
  width: 28px; height: 28px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hr-primary-flaeche); color: #fff;
  border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  box-shadow: inset 0 -6px 12px rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
/* Hochgeladenes Logo ersetzt das Kürzel-Quadrat (branding.js). */
.marke.marke-logo { background: transparent; box-shadow: none; }
.marke.marke-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sidebar-brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; min-width: 0; }
/* Firmennamen sind oft lang. Zwei Zeilen lesen sich besser als ein harter
   Abschnitt mitten im Wort; erst danach wird gekürzt. */
.sidebar-brand strong {
  font-size: var(--hr-font-sm); font-weight: 650; letter-spacing: 0.01em; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
/* Nur der Untertitel unter dem Firmennamen — nicht jeder span im Kopf: die
   Firmenauswahl liegt im selben Block und würde sonst blass mitgefärbt. */
.sidebar-brand-text > span {
  color: var(--hr-text-soft); font-size: var(--hr-font-xs);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Firmenauswahl: erscheint nur, wenn das Konto mehr als eine Firma sehen darf. */
.firmen-wechsel {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: var(--hr-radius-sm);
  background: transparent; color: var(--hr-text-soft); cursor: pointer;
  transition: background var(--hr-dauer-schnell) var(--hr-ease), color var(--hr-dauer-schnell) var(--hr-ease);
}
.firmen-wechsel:hover { background: var(--hr-surface-muted); color: var(--hr-text); }
.firmen-wechsel:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.firmen-wechsel[aria-expanded="true"] { background: var(--hr-surface-muted); color: var(--hr-text); }

.firmen-liste {
  /* Fest positioniert statt absolut: Die Seitenleiste scrollt (overflow-y)
     und würde eine breitere Liste sonst am Rand abschneiden. Die Koordinaten
     setzt app.js beim Aufklappen. */
  position: fixed; z-index: var(--hr-z-modal);
  min-width: 280px; max-width: 380px;
  background: var(--hr-surface); border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-md); box-shadow: var(--hr-shadow-panel);
  padding: var(--hr-space-1); max-height: 60vh; overflow-y: auto;
}
.firmen-liste-eintrag {
  display: flex; align-items: center; gap: var(--hr-space-2); width: 100%;
  padding: var(--hr-space-2); border: 0; border-radius: var(--hr-radius-sm);
  background: transparent; color: var(--hr-text); text-align: left; cursor: pointer;
  font: inherit;
}
.firmen-liste-eintrag:hover { background: var(--hr-surface-muted); }
.firmen-liste-eintrag:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.firmen-liste-eintrag[aria-selected="true"] { background: var(--hr-primary-soft); }
.firmen-liste-eintrag[aria-selected="true"] .icon { color: var(--hr-primary); flex: none; }
.firmen-liste-eintrag .marke { width: 26px; height: 26px; font-size: 11px; border-radius: 7px; flex: none; }
.firmen-liste-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.firmen-liste-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firmen-liste-heimat { color: var(--hr-text-soft); font-size: var(--hr-font-xs); }

.nav-gruppe { margin: var(--hr-space-3) 0 var(--hr-space-1); padding: 0 var(--hr-space-2); }
/* Normale Schreibung statt VERSALIEN: Wortbilder bleiben erkennbar,
   das Auge liest statt zu buchstabieren. Gilt für alle Beschriftungen. */
.nav-gruppe-titel {
  font-size: var(--hr-font-xs); font-weight: 600;
  color: var(--hr-text-soft); margin: 0 0 var(--hr-space-1);
}
.nav-eintrag {
  display: flex; align-items: center; justify-content: space-between; gap: var(--hr-space-2);
  padding: 7px var(--hr-space-2); margin: 1px 0;
  border-radius: var(--hr-radius-sm); color: var(--hr-text); cursor: pointer;
  transition: background var(--hr-dauer-schnell) var(--hr-ease), color var(--hr-dauer-schnell) var(--hr-ease);
}
.nav-eintrag-inhalt { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-eintrag-inhalt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-eintrag .icon { color: var(--hr-text-soft); transition: color var(--hr-dauer-schnell) var(--hr-ease); }
.nav-eintrag:hover { background: var(--hr-surface-muted); text-decoration: none; }
.nav-eintrag:hover .icon { color: var(--hr-text-muted); }
.nav-eintrag.aktiv { background: var(--hr-primary-soft); color: var(--hr-primary); font-weight: 600; }
.nav-eintrag.aktiv .icon { color: var(--hr-primary); }
.nav-zaehler {
  background: var(--hr-primary-flaeche); color: #fff; border-radius: 999px;
  font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px;
}

.hauptbereich { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--hr-topbar-height);
  display: flex; align-items: center; gap: var(--hr-space-3);
  padding: 0 var(--hr-space-5);
  background: var(--hr-surface);
  border-bottom: 1px solid var(--hr-border-soft);
  position: sticky; top: 0; z-index: var(--hr-z-topbar);
}
.topbar-suche { flex: 1; max-width: 420px; position: relative; }
.topbar-suche::before {
  /* Lupe als CSS-Maske — selbsttragend, ohne zusätzliches Markup. */
  content: ""; position: absolute; left: 10px; top: 50%; width: 15px; height: 15px;
  transform: translateY(-50%); background: var(--hr-text-soft); pointer-events: none;
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>') center / contain no-repeat;
}
.topbar-suche input {
  width: 100%; height: var(--hr-input-height); padding: 0 12px 0 32px;
  border: 1px solid var(--hr-border); border-radius: var(--hr-radius-md);
  font: inherit; background: var(--hr-bg); color: inherit;
  transition: border-color var(--hr-dauer-schnell) var(--hr-ease), box-shadow var(--hr-dauer-schnell) var(--hr-ease), background var(--hr-dauer-schnell) var(--hr-ease);
}
.topbar-suche input:focus { outline: none; background: var(--hr-surface); border-color: var(--hr-primary); box-shadow: var(--hr-ring); }
.topbar-rechts { margin-left: auto; display: flex; align-items: center; gap: var(--hr-space-3); }
.topbar-benutzer { display: inline-flex; align-items: center; gap: var(--hr-space-2); color: var(--hr-text-muted); }
.topbar-benutzer-link {
  display: inline-flex; align-items: center; gap: var(--hr-space-2);
  color: inherit; text-decoration: none;
  padding: 3px var(--hr-space-2); margin: -3px calc(-1 * var(--hr-space-2));
  border-radius: var(--hr-radius-md);
  transition: background var(--hr-dauer-schnell) var(--hr-ease), color var(--hr-dauer-schnell) var(--hr-ease);
}
.topbar-benutzer-link:hover { background: var(--hr-surface-muted); color: var(--hr-text); text-decoration: none; }
.topbar-benutzer-link:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
/* Gesichter statt Datensätze: Profilbild, sonst Initialen auf einem ruhigen,
   aus der Person abgeleiteten Ton (avatar.js). Größe und Farbe setzt das
   Modul inline — hier stehen Form, Typografie und Verhalten. */
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: var(--hr-primary-soft); color: var(--hr-primary);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(38, 32, 24, 0.07);
}
.avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.avatar-klein { font-size: 10px; }
.avatar-gross { font-size: 15px; }
.avatar-riesig { font-size: 30px; font-weight: 500; letter-spacing: 0.04em; }
.avatar-rest { background: var(--hr-surface-muted); color: var(--hr-text-muted); font-size: 11px; }

/* Gestapelte Gesichter (Team, Anwesende). */
.avatar-gruppe { display: inline-flex; align-items: center; }
.avatar-gruppe .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--hr-surface), inset 0 0 0 1px rgba(38, 32, 24, 0.07); }
.avatar-gruppe .avatar:first-child { margin-left: 0; }

/* Person in Listen und Tabellen: Gesicht, Name, leiser Zusatz. */
.person-zeile { display: inline-flex; align-items: center; gap: var(--hr-space-2); min-width: 0; }
.person-zeile-text { display: flex; flex-direction: column; gap: var(--hr-space-1); line-height: 1.35; min-width: 0; }
.person-zeile-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-zeile-zusatz { color: var(--hr-text-soft); font-size: var(--hr-font-xs); }

.inhalt { padding: var(--hr-space-5); max-width: 1400px; width: 100%; }
/* Ansichtswechsel: kurzer, ruhiger Einstieg — Inhalt steigt 4 px auf und blendet ein. */
.inhalt.einblenden { animation: ansichtEin var(--hr-dauer) var(--hr-ease) both; }
@keyframes ansichtEin {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.seiten-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--hr-space-4); margin-bottom: var(--hr-space-4); }
.seiten-titel { margin: 0; font-size: var(--hr-font-xl); line-height: 1.2; letter-spacing: -0.02em; }
.seiten-beschreibung { margin: var(--hr-space-1) 0 0; color: var(--hr-text-muted); }
.seiten-aktionen { display: flex; gap: var(--hr-space-2); flex-wrap: wrap; }

/* ---- Vertikaler Rhythmus ----
   Zwei Blöcke übereinander brauchen Luft. Statt sie an jeder Fundstelle
   einzeln zu setzen, bekommt jeder Stapel eine Grundregel: Wer einem
   sichtbaren Geschwister folgt, rückt nach. Ränder benachbarter Geschwister
   fallen zusammen — ein größerer, absichtlich gesetzter Abstand bleibt also
   erhalten, und wer schon einen Rand hat, bekommt keinen zweiten dazu.

   `:where(:not([hidden]))` hält die Regel bei Spezifität 0,1,0: Sie greift
   überall, wo nichts anderes gesagt ist, und verliert gegen jede benannte
   Regel. Ausgeblendete Geschwister zählen nicht mit, sonst begänne eine
   Karte mit einem Rand, den niemand sieht. */
.stapel > :where(:not([hidden])) ~ :where(:not([hidden])),
.karte > :where(:not([hidden])) ~ :where(:not([hidden])),
.modal > :where(:not([hidden])) ~ :where(:not([hidden])) {
  margin-top: var(--hr-space-3);
}

/* Eng: mehrere Zeilen in einer Tabellenzelle. Dort wäre der volle Abstand
   zu viel, gar keiner zu wenig — das Datum säße auf dem Namen. */
.stapel.eng > :where(:not([hidden])) ~ :where(:not([hidden])) { margin-top: var(--hr-space-1); }

/* Ein reines Inline-Element nimmt keinen senkrechten Rand an. Im Stapel steht
   aber jedes Kind für sich — also bekommt der Hinweis auch eine eigene Zeile.
   (Inline-Flex-Kinder wie `.person-zeile` brauchen das nicht: Sie sind
   atomare Inline-Kästen und nehmen den Rand von sich aus an.) */
.stapel > .feld-hinweis { display: block; }

/* Ein zweiter Abschnitt in derselben Karte fängt sichtbar neu an — sonst
   klebt seine Überschrift an der Tabelle darüber. */
.karten-titel:not(:first-child) { margin-top: var(--hr-space-5); }

/* ---- Karten & Raster ---- */
.karte {
  background: var(--hr-surface);
  border: 1px solid var(--hr-border-soft);
  border-radius: var(--hr-radius-lg);
  box-shadow: var(--hr-shadow-soft);
  padding: var(--hr-space-4);
  transition: box-shadow var(--hr-dauer) var(--hr-ease);
}
.karte + .karte { margin-top: var(--hr-space-3); }
/* Im Raster besorgt `gap` den Abstand. Ohne diese Ausnahme käme er doppelt —
   und Karten nebeneinander würden unterschiedlich hoch, weil ein Rand die
   gestreckte Zellenhöhe verkürzt. */
.raster > .karte { margin-top: 0; }
.karten-titel { margin: 0 0 var(--hr-space-3); font-size: var(--hr-font-md); font-weight: 650; }
.raster { display: grid; gap: var(--hr-space-3); }
.raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .raster-3, .raster-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .raster-2, .raster-3, .raster-4 { grid-template-columns: 1fr; } }

.kennzahl { display: flex; flex-direction: column; gap: 2px; }
/* Der Hinweis ist ein eigener Gedanke, nicht die zweite Zeile des Labels. */
.kennzahl .feld-hinweis { margin-top: var(--hr-space-1); }
.kennzahl-wert { font-size: var(--hr-font-xl); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kennzahl-label { color: var(--hr-text-muted); font-size: var(--hr-font-xs); }

/* ---- Tabellen: dicht, ruhig, scrollfähig ---- */
.tabelle-huelle { overflow-x: auto; }
table.tabelle { width: 100%; border-collapse: collapse; font-size: var(--hr-font-sm); }
.tabelle th {
  text-align: left; font-weight: 600; color: var(--hr-text-muted);
  font-size: var(--hr-font-sm);
  padding: var(--hr-space-2); border-bottom: 1px solid var(--hr-border);
  white-space: nowrap;
}
.tabelle td {
  padding: var(--hr-space-2); border-bottom: 1px solid var(--hr-border-soft);
  height: var(--hr-row-height); vertical-align: middle;
}
.tabelle tbody tr { transition: background var(--hr-dauer-schnell) var(--hr-ease); }
.tabelle tbody tr:hover { background: var(--hr-surface-muted); }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* Schmale Geräte: Jede Zeile wird eine Karte, jede Zelle trägt ihre
   Überschrift. Vorher lagen Frist, Saldo oder „Fehlt“ rechts außerhalb des
   Bildes (Zyklus 7). Nur Datentabellen aus tabelle() — Raster wie Plantafel
   und Kalender behalten ihre Spalten. */
@media (max-width: 640px) {
  /* Ganz weg statt nur unsichtbar: Die Sortierknöpfe nahmen sonst unsichtbar
     den Fokus an (Zyklus 8). Die Überschrift trägt jede Zelle selbst. */
  table.tabelle.stapelbar thead { display: none; }
  table.tabelle.stapelbar, table.tabelle.stapelbar tbody, table.tabelle.stapelbar tr { display: block; width: 100%; }
  table.tabelle.stapelbar tr { padding: var(--hr-space-2) 0; border-bottom: 1px solid var(--hr-border); }
  table.tabelle.stapelbar td {
    display: block; height: auto; padding: 2px var(--hr-space-1); border-bottom: 0;
    text-align: left; overflow-wrap: anywhere;
  }
  table.tabelle.stapelbar td::after { content: ""; display: table; clear: both; }
  table.tabelle.stapelbar td[data-titel]::before {
    content: attr(data-titel); float: left; width: 38%; padding-right: var(--hr-space-2);
    color: var(--hr-text-muted); font-size: var(--hr-font-xs); line-height: 1.9;
  }
}

/* Spaltenköpfe sortieren per Klick: Der Knopf erbt die Kopf-Optik, das
   Doppelpfeil-Zeichen sagt „hier lässt sich sortieren", der einzelne Pfeil
   zeigt die aktive Richtung. */
.sortier-knopf {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 3px;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
}
.sortier-knopf:focus-visible { outline: 2px solid var(--hr-primary); outline-offset: 2px; border-radius: var(--hr-radius-sm); }
.sortier-zeichen { display: inline-flex; opacity: 0.35; }
.sortier-knopf:hover .sortier-zeichen { opacity: 0.8; }
th[aria-sort] .sortier-zeichen { opacity: 1; color: var(--hr-primary); }
.tabelle th.zahl .sortier-knopf { flex-direction: row-reverse; }

/* Kontextmenü (Rechtsklick): dieselbe ruhige Optik wie die Firmenliste. */
.kontextmenue {
  position: fixed; z-index: var(--hr-z-modal);
  min-width: 180px; max-width: 320px;
  background: var(--hr-surface); border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-md); box-shadow: var(--hr-shadow-panel);
  padding: var(--hr-space-1); display: flex; flex-direction: column;
}
.kontextmenue-eintrag {
  all: unset; cursor: pointer; display: flex; align-items: center; gap: var(--hr-space-2);
  padding: var(--hr-space-2) var(--hr-space-3); border-radius: var(--hr-radius-sm);
  font-size: var(--hr-font-sm); color: var(--hr-text);
}
.kontextmenue-eintrag:hover, .kontextmenue-eintrag:focus-visible { background: var(--hr-surface-muted); }
.kontextmenue-eintrag.gefahr { color: var(--hr-danger); }
.kontextmenue-trenner { height: 1px; background: var(--hr-border-soft); margin: var(--hr-space-1) 0; }

/* Befehlspalette (Strg+K): ein Feld, das überallhin führt. */
.palette-hintergrund {
  position: fixed; inset: 0; z-index: var(--hr-z-modal);
  background: var(--hr-overlay);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh;
}
.palette {
  width: min(560px, calc(100vw - 32px));
  background: var(--hr-surface); border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-lg); box-shadow: var(--hr-shadow-panel);
  display: flex; flex-direction: column; overflow: hidden;
}
.palette-suchzeile {
  display: flex; align-items: center; gap: var(--hr-space-2);
  padding: var(--hr-space-3) var(--hr-space-4); border-bottom: 1px solid var(--hr-border-soft);
  color: var(--hr-text-muted);
}
.palette-eingabe {
  all: unset; flex: 1; font-size: var(--hr-font-md); color: var(--hr-text);
}
.palette-liste { max-height: 46vh; overflow-y: auto; padding: var(--hr-space-1); }
.palette-eintrag {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: var(--hr-space-2);
  padding: var(--hr-space-2) var(--hr-space-3); border-radius: var(--hr-radius-sm);
  font-size: var(--hr-font-sm); color: var(--hr-text);
}
.palette-eintrag.aktiv, .palette-eintrag:hover { background: var(--hr-surface-muted); }
.palette-text { flex: 1; }
.palette-hinweis { color: var(--hr-text-muted); font-size: var(--hr-font-xs); }
.palette-leer { padding: var(--hr-space-4); color: var(--hr-text-muted); font-size: var(--hr-font-sm); }
.palette-fusszeile {
  padding: var(--hr-space-2) var(--hr-space-4); border-top: 1px solid var(--hr-border-soft);
  color: var(--hr-text-soft); font-size: var(--hr-font-xs);
}

/* Ziehen und Ablegen: greifbare Blöcke, deutlich markierte Ziele. */
.plan-block[draggable="true"] { cursor: grab; }
.plan-block.wird-gezogen { opacity: 0.45; cursor: grabbing; }
td.plan-zelle.drop-ziel {
  outline: 2px dashed var(--hr-primary); outline-offset: -2px;
  background: var(--hr-primary-soft);
}
td.plan-zelle.auswahl { background: var(--hr-primary-soft); }

/* Ablagefläche für Dateien: klicken oder fallen lassen. */
.ablageflaeche {
  border: 1.5px dashed var(--hr-border); border-radius: var(--hr-radius-md);
  padding: var(--hr-space-4); text-align: center; color: var(--hr-text-muted);
  font-size: var(--hr-font-sm); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: var(--hr-space-2);
  transition: border-color var(--hr-dauer-schnell) var(--hr-ease), background var(--hr-dauer-schnell) var(--hr-ease);
}
.ablageflaeche:hover, .ablageflaeche:focus-visible { border-color: var(--hr-primary); }
.ablageflaeche.datei-darueber { border-color: var(--hr-primary); background: var(--hr-primary-soft); color: var(--hr-text); }
.ablageflaeche strong { color: var(--hr-text); }

/* ---- Formulare ---- */
.formular { display: grid; gap: var(--hr-space-3); }
/* `hidden` muss auch dann gelten, wenn die Klasse ein `display` setzt: Ohne
   diese Regel bleibt ein ausgeblendetes Feld sichtbar, weil `.feld { display:
   flex }` das eingebaute `display: none` überschreibt. */
[hidden] { display: none !important; }

.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld label { font-size: var(--hr-font-xs); color: var(--hr-text-muted); font-weight: 600; }
/* .eingabe: dasselbe Kleid für einzelne Felder OHNE .feld-Block —
   Suchfelder und Filter in Werkzeugleisten (Teamkalender, Schichtplan). */
.feld input, .feld select, .feld textarea, .eingabe {
  height: var(--hr-input-height);
  padding: 0 var(--hr-space-2);
  border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-sm);
  font: inherit; color: inherit; background: var(--hr-surface);
  width: 100%;
  transition: border-color var(--hr-dauer-schnell) var(--hr-ease), box-shadow var(--hr-dauer-schnell) var(--hr-ease);
}
.feld input:focus, .feld select:focus, .feld textarea:focus, .eingabe:focus {
  outline: none; border-color: var(--hr-primary); box-shadow: var(--hr-ring);
}
.feld.fehlerhaft input:focus, .feld.fehlerhaft select:focus, .feld.fehlerhaft textarea:focus {
  border-color: var(--hr-danger); box-shadow: 0 0 0 3px rgba(159, 45, 45, 0.12);
}
.feld textarea { height: auto; min-height: 72px; padding: var(--hr-space-2); resize: vertical; }
.feld input:disabled, .feld select:disabled { background: var(--hr-surface-muted); color: var(--hr-text-muted); }
.feld .feld-hinweis { color: var(--hr-text-soft); font-size: var(--hr-font-xs); }

/* Ein Ankreuzfeld ist kein Textfeld: Ohne diese Ausnahme erbt es Höhe,
   Rahmen und volle Breite der Texteingabe und steht als großes leeres
   Quadrat unter seiner Beschriftung. Kästchen und Text gehören nebeneinander,
   ein Hinweis darunter. */
.feld:has(> input[type="checkbox"]),
.feld:has(> input[type="radio"]) { flex-flow: row wrap; align-items: center; gap: var(--hr-space-2); }
.feld input[type="checkbox"],
.feld input[type="radio"],
.kontrollzeile input[type="checkbox"] {
  flex: none; width: 16px; height: 16px; min-height: 0;
  padding: 0; margin: 0; border-radius: 4px; accent-color: var(--hr-primary);
}
/* Nur wo die Beschriftung im Markup vor dem Kästchen steht, wird getauscht —
   sonst rutschte das Kästchen hinter seinen eigenen Text. */
.feld:has(> input[type="checkbox"]) > input[type="checkbox"],
.feld:has(> input[type="radio"]) > input[type="radio"] { order: 1; }
.feld:has(> input[type="checkbox"]) > label,
.feld:has(> input[type="radio"]) > label {
  order: 2; font-size: var(--hr-font-sm); font-weight: 500; color: var(--hr-text);
}
.feld:has(> input[type="checkbox"]) > .feld-hinweis,
.feld:has(> input[type="radio"]) > .feld-hinweis { order: 3; flex-basis: 100%; }
/* Eine Beschriftung, die ihr Kästchen selbst umschließt, ist kein Feldname,
   sondern die Zeile daneben — normale Schriftgröße, Kästchen und Text in
   einer Reihe. */
.feld > label:has(input) {
  display: inline-flex; align-items: center; gap: var(--hr-space-2);
  font-size: var(--hr-font-sm); font-weight: 500; color: var(--hr-text);
}
.feld.fehlerhaft input, .feld.fehlerhaft select, .feld.fehlerhaft textarea { border-color: var(--hr-danger); }
.feld .feld-fehler { color: var(--hr-danger); font-size: var(--hr-font-xs); }

/* ---- Buttons ---- */
.btn {
  min-height: var(--hr-input-height);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 var(--hr-space-3);
  border-radius: var(--hr-radius-md);
  border: 1px solid var(--hr-border);
  background: var(--hr-surface); color: var(--hr-text);
  font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
  transition: background var(--hr-dauer-schnell) var(--hr-ease),
              border-color var(--hr-dauer-schnell) var(--hr-ease),
              box-shadow var(--hr-dauer-schnell) var(--hr-ease),
              transform var(--hr-dauer-schnell) var(--hr-ease);
}
.btn:hover { background: var(--hr-surface-muted); }
.btn:active { transform: translateY(0.5px); box-shadow: none; }
.btn .icon { margin-left: -2px; opacity: 0.9; }
/* Weiß auf der Knopffläche, nicht auf dem Schriftton: Im dunklen Schema ist
   der Schriftton hell und trüge weiße Schrift nur mit 4,15:1, beim
   Überfahren mit 2,97:1 (Z25-OBF-2). Der Hover dunkelt ab. */
.btn.primaer {
  background: var(--hr-primary-flaeche); border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(31, 79, 122, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn.primaer:hover { background: var(--hr-primary-hover); }
.btn.gefahr { color: var(--hr-danger); border-color: var(--hr-danger); background: var(--hr-surface); }
.btn.gefahr:hover { background: var(--hr-danger-soft); }
.btn.klein { min-height: 28px; padding: 0 var(--hr-space-2); font-size: var(--hr-font-xs); border-radius: var(--hr-radius-sm); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---- Status-Badges (monochrome Grundhaltung, dezente Signale) ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--hr-font-xs); font-weight: 600;
  background: var(--hr-surface-muted); color: var(--hr-text-muted);
  white-space: nowrap;
}
/* Statuspunkt: macht Zustände auf einen Blick scannbar, ohne zu schreien. */
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.75; flex: none; }
.badge-reihe { display: inline-flex; gap: 4px; flex-wrap: wrap; }
/* Erklärender Zusatz neben einer Pille — sonst klebt der Text an ihr. */
.badge-zusatz { margin-left: var(--hr-space-2); }

/* ---- Diagramme (Analysen) ---- */
.diagramm-huelle { position: relative; margin-bottom: var(--hr-space-4); }
.badge.gruen { background: var(--hr-success-soft); color: var(--hr-success); }
.badge.gelb { background: var(--hr-warning-soft); color: var(--hr-warning); }
.badge.rot { background: var(--hr-danger-soft); color: var(--hr-danger); }
.badge.blau { background: var(--hr-primary-soft); color: var(--hr-primary); }

/* ---- Leere Zustände & Fehlerzustände als gestaltete Zustände ---- */
.leer {
  padding: var(--hr-space-6); text-align: center; color: var(--hr-text-muted);
  border: 1px dashed var(--hr-border); border-radius: var(--hr-radius-lg);
  background: color-mix(in srgb, var(--hr-surface-muted) 40%, transparent);
}
.leer::before {
  /* Posteingangs-Symbol als CSS-Maske — jeder Leerzustand wirkt gestaltet. */
  content: ""; display: block; width: 26px; height: 26px; margin: 0 auto var(--hr-space-2);
  background: var(--hr-text-soft);
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/></svg>') center / contain no-repeat;
}
.leer strong { display: block; color: var(--hr-text); margin-bottom: var(--hr-space-1); }
.fehlerbox {
  background: var(--hr-danger-soft); border: 1px solid var(--hr-danger);
  color: var(--hr-danger); border-radius: var(--hr-radius-md);
  padding: var(--hr-space-3); margin-bottom: var(--hr-space-3);
}

/* ---- Modal ---- */
.modal-hintergrund {
  position: fixed; inset: 0; background: var(--hr-overlay);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh var(--hr-space-4) var(--hr-space-4);
  z-index: var(--hr-z-modal);
  animation: schleierEin var(--hr-dauer-schnell) var(--hr-ease) both;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.modal {
  background: var(--hr-surface); border-radius: var(--hr-radius-lg);
  box-shadow: var(--hr-shadow-panel);
  width: min(640px, 100%); max-height: 84vh; overflow-y: auto;
  padding: var(--hr-space-5);
  animation: modalEin var(--hr-dauer) var(--hr-ease) both;
}
@keyframes schleierEin { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalEin {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.modal-kopf { display: flex; justify-content: space-between; align-items: center; gap: var(--hr-space-3); margin-bottom: var(--hr-space-3); }
.modal-kopf h2 { margin: 0; font-size: var(--hr-font-lg); letter-spacing: -0.01em; }
.modal-schliessen {
  width: 30px; height: 30px; min-height: 0; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--hr-text-soft);
  border-radius: var(--hr-radius-sm); cursor: pointer;
  transition: background var(--hr-dauer-schnell) var(--hr-ease), color var(--hr-dauer-schnell) var(--hr-ease);
}
.modal-schliessen:hover { background: var(--hr-surface-muted); color: var(--hr-text); }
.modal-fuss { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--hr-space-2); margin-top: var(--hr-space-4); }
/* Die Knöpfe bleiben am unteren Rand, auch wenn der Inhalt scrollt — auf dem
   Handy lagen „Genehmigen“ und „Speichern“ sonst unterhalb des Sichtbaren
   (Zyklus 6). Der negative Rand hebt das Polster des Dialogs auf, damit kein
   Inhalt unter der Leiste durchscheint. */
/* Auch in Formular-Dialogen: Dort steht die Leiste im <form>, nicht direkt
   im Dialog — die Regel griff dort bis Zyklus 7 nicht. */
.modal > .modal-fuss,
.modal > form > .modal-fuss {
  grid-column: 1 / -1;
  position: sticky; bottom: calc(-1 * var(--hr-space-5)); z-index: 1;
  margin: var(--hr-space-4) calc(-1 * var(--hr-space-5)) calc(-1 * var(--hr-space-5));
  padding: var(--hr-space-3) var(--hr-space-5) var(--hr-space-5);
  background: var(--hr-surface); border-top: 1px solid var(--hr-border-soft);
}

/* ---- Toast ---- */
.toast-bereich {
  position: fixed; bottom: var(--hr-space-4); right: var(--hr-space-4);
  display: flex; flex-direction: column; gap: var(--hr-space-2);
  z-index: var(--hr-z-toast);
}
.toast {
  display: flex; align-items: flex-start; gap: var(--hr-space-2);
  /* Immer invertiert zum Schema: dunkle Karte bei Tag, helle bei Nacht. */
  background: var(--hr-text); color: var(--hr-bg); border-radius: var(--hr-radius-md);
  padding: 10px var(--hr-space-3); box-shadow: var(--hr-shadow-panel);
  max-width: 360px; line-height: 1.45;
  animation: toastEin var(--hr-dauer) var(--hr-ease) both;
}
.toast .icon { margin-top: 2px; opacity: 0.85; flex: none; }
.toast.fehler { background: var(--hr-danger); max-width: 420px; }
.toast-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toast-hinweis { margin-top: 4px; opacity: 0.85; font-size: var(--hr-font-xs); }
/* Ohne Abblendung: Die Fehlernummer muss man abschreiben können — mit
   opacity 0.7 lag sie hell bei 4,1:1, dunkel bei 3,6:1 (Z25-OBF-2). */
.toast-nummer {
  margin-top: 6px; font-family: var(--hr-mono);
  font-size: 11px; letter-spacing: 0.02em;
}
/* Kopieren und Schließen: ruhige Symbole, die den Text nicht überstrahlen. */
.fehler-kopieren, .toast-schliessen {
  flex: none; border: none; background: none; padding: 3px; margin: -2px 0 0 0;
  color: inherit; opacity: 0.7; cursor: pointer; border-radius: var(--hr-radius-sm);
  transition: opacity var(--hr-dauer-schnell) var(--hr-ease), background var(--hr-dauer-schnell) var(--hr-ease);
}
.fehler-kopieren:hover, .toast-schliessen:hover { opacity: 1; background: rgba(255, 255, 255, 0.16); }
.fehler-kopieren:disabled { cursor: default; opacity: 1; }
.fehler-kopieren:focus-visible, .toast-schliessen:focus-visible { outline: 2px solid #fff; outline-offset: 1px; opacity: 1; }
/* In der Fehlerbox einer Ansicht steht das Symbol auf hellem Grund. */
.fehlerbox .fehler-kopieren { color: var(--hr-danger); }
.fehlerbox .fehler-kopieren:hover { background: rgba(0, 0, 0, 0.06); }
.fehlerbox .fehler-kopieren:focus-visible { outline-color: var(--hr-danger); }
/* Auf der Anmeldeseite trägt der Knopf Text statt Symbol — dort steht er
   allein in der Meldung und braucht eine eigene Zeile. */
#login-fehler .fehler-kopieren {
  display: block; margin-top: 6px; padding: 0;
  font: inherit; font-size: var(--hr-font-xs); text-decoration: underline;
}
.fehlerbox-kopf { display: flex; align-items: flex-start; gap: var(--hr-space-2); }
.fehlerbox-kopf > div { flex: 1 1 auto; min-width: 0; }
.fehlerbox-nummer {
  margin-top: 6px; font-family: var(--hr-mono);
  font-size: 11px; color: var(--hr-text-muted);
}
/* Wortgleiche Meldung noch einmal: kurz aufblitzen statt ein zweites Mal
   stapeln — so sieht man, dass es wieder passiert ist. */
.toast.erneut { animation: toastErneut 600ms var(--hr-ease) both; }
@keyframes toastErneut {
  0% { transform: none; }
  30% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.erneut { animation: none; }
}
@keyframes toastEin {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---- Tabs, Filterzeile, Werkzeugleiste ---- */
.tabs { display: flex; gap: var(--hr-space-1); border-bottom: 1px solid var(--hr-border-soft); margin-bottom: var(--hr-space-4); }
.tab {
  padding: var(--hr-space-2) var(--hr-space-3); cursor: pointer;
  border: none; background: none; font: inherit; color: var(--hr-text-muted);
  border-bottom: 2px solid transparent; font-weight: 600;
  transition: color var(--hr-dauer-schnell) var(--hr-ease), border-color var(--hr-dauer-schnell) var(--hr-ease);
}
/* Der Strich der aktiven Lasche soll die Linie der Leiste überdecken. Das
   gilt nur in der Leiste — außerhalb (Filterreihen) zöge es die Lasche in
   die Zeile darunter. */
.tabs > .tab { margin-bottom: -1px; }
.tab:hover { color: var(--hr-text); }
.tab.aktiv { color: var(--hr-primary); border-bottom-color: var(--hr-primary); }
/* Zeilenabstand größer als Spaltenabstand: Bricht die Zeile um, sollen die
   Reihen nicht enger stehen als die Felder nebeneinander wirken. */
.filterzeile { display: flex; gap: var(--hr-space-3) var(--hr-space-2); flex-wrap: wrap; align-items: end; margin-bottom: var(--hr-space-3); }
.filterzeile .feld { min-width: 160px; }
/* Exportknöpfe im Berichts-Baukasten: rechtsbündig als ruhige Gruppe. */
.export-gruppe { display: inline-flex; gap: var(--hr-space-1); align-items: center; margin-left: auto; }
.bericht-kpis { margin-bottom: var(--hr-space-3); }

/* ---- Kalender-/Planungsraster (Basis; Module verfeinern) ---- */
.plan-raster { display: grid; gap: 1px; background: var(--hr-border-soft); border: 1px solid var(--hr-border-soft); border-radius: var(--hr-radius-sm); overflow: hidden; }
.plan-zelle { background: var(--hr-surface); min-height: 44px; padding: 4px 6px; font-size: var(--hr-font-xs); }
.plan-zelle.kopf { background: var(--hr-surface-muted); font-weight: 600; color: var(--hr-text-muted); }
.plan-zelle.wochenende { background: var(--hr-bg); }
.plan-block {
  display: block; width: 100%; text-align: left; font: inherit; line-height: inherit;
  border: 0; border-radius: 4px; padding: 2px 6px; margin: 1px 0;
  background: var(--hr-primary-soft); color: var(--hr-primary);
  border-left: 3px solid var(--hr-primary);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-block:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.plan-block.abwesend { background: var(--hr-warning-soft); color: var(--hr-warning); border-left-color: var(--hr-warning); }
.plan-block.offen { background: var(--hr-surface-muted); color: var(--hr-text-muted); border-left-color: var(--hr-border); }

/* ---- Login ---- */
.login-buehne {
  /* Spalte, nicht Reihe: Die Fußzeile ist ein Geschwister der Karte. In einer
     Reihe stellte sie sich daneben und schob die Karte aus der Mitte — auf
     schmalen Geräten quetschte sie sie auf halbe Breite. */
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--hr-space-4);
  padding: var(--hr-space-5) var(--hr-space-4);
  /* Kaum wahrnehmbarer Lichtverlauf: gibt der Bühne Tiefe, ohne zu dekorieren. */
  background: radial-gradient(1100px 500px at 50% -10%, rgba(31, 79, 122, 0.06), transparent 70%), var(--hr-bg);
}
.login-karte { width: min(400px, 100%); animation: ansichtEin 240ms var(--hr-ease) both; }
.login-marke { text-align: center; margin-bottom: var(--hr-space-4); }
.marke-gross { width: 44px; height: 44px; font-size: 17px; border-radius: 12px; margin-bottom: var(--hr-space-2); box-shadow: var(--hr-shadow-mid), inset 0 -8px 16px rgba(255, 255, 255, 0.12); }
.login-marke strong { display: block; font-size: 24px; letter-spacing: 0.06em; }
.login-marke p { color: var(--hr-text-muted); margin: var(--hr-space-1) 0 0; }
.login-hinweis {
  margin: var(--hr-space-3) 0 0; padding-top: var(--hr-space-3);
  border-top: 1px solid var(--hr-border-soft);
  color: var(--hr-text-muted); font-size: var(--hr-font-sm); text-align: center;
}

/* Grundeinstellungen (Karte „Anwendung"): Farb- und Logo-Anzeige. */
.farb-anzeige { display: inline-flex; align-items: center; gap: var(--hr-space-2); font-family: var(--hr-mono); font-size: var(--hr-font-sm); }
.farb-punkt {
  width: 16px; height: 16px; border-radius: 5px; flex: none;
  border: 1px solid rgba(16, 24, 40, 0.15);
}
.logo-klein {
  height: 22px; max-width: 60px; object-fit: contain;
  vertical-align: middle; margin-right: var(--hr-space-2);
}
.logo-vorschau { margin-top: var(--hr-space-2); }
.logo-vorschau img {
  max-height: 56px; max-width: 160px; object-fit: contain;
  padding: var(--hr-space-2); border: 1px solid var(--hr-border-soft); border-radius: var(--hr-radius-sm);
  background: var(--hr-surface-muted);
}
.kontrollzeile { display: flex; align-items: center; gap: var(--hr-space-2); padding: 2px 0; font-size: var(--hr-font-sm); }
input[type="color"] {
  padding: 2px; height: var(--hr-input-height); width: 64px;
  border: 1px solid var(--hr-border); border-radius: var(--hr-radius-sm);
  background: var(--hr-surface); cursor: pointer;
}

/* ---- Mobile ---- */
/* Basisregel VOR der Media-Query, damit die mobile Regel in der Kaskade gewinnt. */
.menue-knopf { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  /* Unter der Kopfleiste, nicht dahinter: Sie liegt höher und verdeckte
     sonst Firmenname und Firmenwechsel oben im Menü (Zyklus 6). */
  /* Zugeklappt ist die Leiste nicht nur aus dem Bild, sondern auch aus der
     Tab-Reihenfolge und dem Vorlesebaum: Sonst lagen 19 unsichtbare Ziele
     vor dem Inhalt (Z25-OBF-8). Die Sichtbarkeit schaltet erst nach dem
     Hinausgleiten um, damit die Bewegung zu sehen bleibt. */
  .sidebar { position: fixed; left: 0; top: var(--hr-topbar-height); bottom: 0; height: auto; transform: translateX(-100%); visibility: hidden; transition: transform 0.15s ease, visibility 0s linear 0.15s; width: var(--hr-sidebar-width); }
  .sidebar.offen { transform: translateX(0); visibility: visible; transition: transform 0.15s ease; box-shadow: var(--hr-shadow-panel); }
  .inhalt { padding: var(--hr-space-3); }
  .topbar { padding: 0 var(--hr-space-3); }
  .menue-knopf { display: inline-flex; }
  .tabs { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  /* Auf schmalen Geräten drängeln sich Suche, Name und Abmelden in eine
     56-px-Leiste. Der Name steht schon im Gesicht daneben — er weicht, damit
     die Suche wieder lesbar wird. */
  .topbar { gap: var(--hr-space-2); }
  .topbar-benutzer span:not(.avatar) { display: none; }
}

/* ---- Firmen: Übersicht, Profil und Anlage-Assistent ---- */
.karten-zeile {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--hr-space-3); margin-bottom: var(--hr-space-3); flex-wrap: wrap;
}
.karten-zeile .karten-titel { margin: 0; }

.firmen-kacheln { margin-bottom: var(--hr-space-3); }
.firmen-kachel {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--hr-surface); border: 1px solid var(--hr-border-soft);
  border-radius: var(--hr-radius-lg); box-shadow: var(--hr-shadow-soft);
  padding: var(--hr-space-4);
  transition: box-shadow var(--hr-dauer) var(--hr-ease), border-color var(--hr-dauer-schnell) var(--hr-ease);
}
.firmen-kachel:hover { box-shadow: var(--hr-shadow-mid); border-color: var(--hr-border); }
.firmen-kachel:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.firmen-kachel-kopf {
  display: flex; align-items: center; gap: var(--hr-space-2);
  margin-bottom: var(--hr-space-4);
}
.firmen-kachel-titel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.firmen-kachel-titel strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firmen-kachel-titel span { color: var(--hr-text-soft); font-size: var(--hr-font-xs); }

.firmen-detail-kopf {
  display: flex; align-items: center; gap: var(--hr-space-3);
  margin-bottom: var(--hr-space-2); flex-wrap: wrap;
}
.firmen-detail-kopf > div { flex: 1; min-width: 200px; }
.firmen-detail-kopf p { margin: 2px 0 0; }

.pruef-meldung {
  margin: var(--hr-space-3) 0 var(--hr-space-1);
  padding: var(--hr-space-2) var(--hr-space-3);
  border-radius: var(--hr-radius-md); font-size: var(--hr-font-sm);
}
.pruef-meldung.gut { background: var(--hr-success-soft); color: var(--hr-success); }
.pruef-meldung.warnung { background: var(--hr-warning-soft); color: var(--hr-warning); }

/* Beschriftete Werteliste (Stammdaten): zwei Spalten, Zahlen bündig. */
.daten-liste {
  display: grid; grid-template-columns: minmax(140px, max-content) 1fr;
  gap: var(--hr-space-1) var(--hr-space-4); margin: 0;
}
.daten-liste dt { color: var(--hr-text-muted); font-size: var(--hr-font-sm); }
.daten-liste dd { margin: 0; font-size: var(--hr-font-sm); overflow-wrap: anywhere; }

/* Zweispaltiges Formular für lange Profile; ein Abschnitt trennt die Bereiche. */
.formular.zweispaltig { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hr-space-3); }
.formular.zweispaltig .feld-breit,
.formular.zweispaltig .formular-abschnitt { grid-column: 1 / -1; }
.formular-abschnitt {
  margin: var(--hr-space-3) 0 0; font-size: var(--hr-font-md); font-weight: 650;
  color: var(--hr-text);
  border-top: 1px solid var(--hr-border-soft); padding-top: var(--hr-space-3);
}
.formular.zweispaltig .formular-abschnitt:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
@media (max-width: 720px) { .formular.zweispaltig { grid-template-columns: 1fr; } }

/* Eingabe mit Knopf daneben (Abteilung, E-Mail zur Liste hinzufügen). */
.eingabe-mit-knopf { display: flex; gap: var(--hr-space-2); }
.eingabe-mit-knopf input { flex: 1; min-width: 0; }

/* Chips: gesammelte Einträge, jeder einzeln wieder entfernbar. */
.chip-liste { display: flex; flex-wrap: wrap; gap: var(--hr-space-2); margin-bottom: var(--hr-space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--hr-space-1);
  padding: 4px 4px 4px 10px; border-radius: 999px;
  background: var(--hr-surface-muted); color: var(--hr-text); font-size: var(--hr-font-sm);
}
.chip-weg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--hr-text-soft); cursor: pointer;
}
.chip-weg:hover { background: var(--hr-danger-soft); color: var(--hr-danger); }
.chip-weg:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }

/* Ankreuzfelder mit Beschriftung in einer Reihe (Rollenauswahl). */
.auswahl-reihe { display: flex; flex-wrap: wrap; gap: var(--hr-space-2); margin-top: var(--hr-space-1); }
.auswahl-chip {
  display: inline-flex; align-items: center; gap: var(--hr-space-2);
  padding: 6px 10px; border: 1px solid var(--hr-border); border-radius: var(--hr-radius-md);
  font-size: var(--hr-font-sm); cursor: pointer;
}
.auswahl-chip:hover { background: var(--hr-surface-muted); }
.auswahl-chip:has(input:checked) { background: var(--hr-primary-soft); border-color: var(--hr-primary); }

/* Schlichte Aufzählung in Dialogen: was mitgeht, was im Weg steht. */
.liste-schlicht {
  list-style: none; margin: var(--hr-space-2) 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
  font-size: var(--hr-font-sm); color: var(--hr-text-soft);
}
.liste-schlicht li { padding: 2px 0; border-bottom: 1px solid var(--hr-border-soft); }
.liste-schlicht li:last-child { border-bottom: 0; }

/* Assistent: Schrittleiste über dem jeweiligen Formular. */
.assistent { max-height: 60vh; overflow-y: auto; padding-right: var(--hr-space-1); }
.assistent-schritte {
  display: flex; gap: var(--hr-space-2); list-style: none; margin: 0 0 var(--hr-space-4); padding: 0;
  flex-wrap: wrap;
}
.assistent-schritte li {
  padding: 4px 12px; border-radius: 999px; font-size: var(--hr-font-xs); font-weight: 600;
  background: var(--hr-surface-muted); color: var(--hr-text-soft);
}
.assistent-schritte li.aktiv { background: var(--hr-primary-flaeche); color: #fff; }
.assistent-schritte li.erledigt { background: var(--hr-success-soft); color: var(--hr-success); }
.assistent-zusammenfassung {
  margin-top: var(--hr-space-4); padding: var(--hr-space-3);
  background: var(--hr-surface-muted); border-radius: var(--hr-radius-md);
}
.assistent-zusammenfassung h3 { margin: 0 0 var(--hr-space-2); font-size: var(--hr-font-sm); }
.assistent-zusammenfassung ul { margin: 0; padding-left: var(--hr-space-4); font-size: var(--hr-font-sm); }

/* ---- Fußzeile: Rechtliches und Programmstand ----
   Sie soll da sein, wenn man sie sucht, und sonst nicht auffallen. Deshalb
   kleine Schrift, gedämpfte Farbe, keine Linie darüber und keine Fläche. */
.fusszeile {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: var(--hr-space-2);
  padding: var(--hr-space-4) var(--hr-space-4) var(--hr-space-5);
  font-size: 11px; color: var(--hr-text-soft);
}
.fusszeile-verweis {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-decoration: none;
  transition: color var(--hr-dauer-schnell) var(--hr-ease);
}
.fusszeile-verweis:hover { color: var(--hr-text-muted); text-decoration: underline; }
.fusszeile-verweis:focus-visible {
  outline: none; border-radius: var(--hr-radius-sm); box-shadow: var(--hr-ring-fokus);
}
.fusszeile-trenner { opacity: 0.5; }
.fusszeile-version { font-variant-numeric: tabular-nums; }
/* Der Abstand zur Karte kommt vom `gap` der Bühne. */
.fusszeile-anmeldung { margin-top: 0; }

/* ---- Rechtstext im Modal ---- */
.rechtstext-modal { max-width: 760px; }
.rechtstext {
  padding: 0 var(--hr-space-4) var(--hr-space-4);
  max-height: 70vh; overflow-y: auto;
  font-size: var(--hr-font-sm); line-height: 1.65;
}
.rechtstext-hinweis {
  margin: 0 0 var(--hr-space-4);
  padding: var(--hr-space-2) var(--hr-space-3);
  background: var(--hr-warning-soft); color: var(--hr-warning);
  border-radius: var(--hr-radius-md); font-size: var(--hr-font-xs);
}
.rechtstext h2 {
  font-size: var(--hr-font-md); margin: var(--hr-space-5) 0 var(--hr-space-2);
  padding-top: var(--hr-space-3); border-top: 1px solid var(--hr-border-soft);
}
.rechtstext > div > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.rechtstext h3 { font-size: var(--hr-font-sm); margin: var(--hr-space-4) 0 var(--hr-space-1); }
.rechtstext h4 { font-size: var(--hr-font-sm); margin: var(--hr-space-3) 0 var(--hr-space-1); color: var(--hr-text-muted); }
.rechtstext p { margin: 0 0 var(--hr-space-3); }
.rechtstext ul, .rechtstext ol { margin: 0 0 var(--hr-space-3); padding-left: var(--hr-space-5); }
.rechtstext li { margin-bottom: var(--hr-space-1); }
.rechtstext a { color: var(--hr-primary); }
.rechtstext blockquote {
  margin: 0 0 var(--hr-space-3); padding-left: var(--hr-space-3);
  border-left: 2px solid var(--hr-border); color: var(--hr-text-muted);
}
.rechtstext hr { border: 0; border-top: 1px solid var(--hr-border-soft); margin: var(--hr-space-4) 0; }
/* Tabellen im Rechtstext scrollen für sich, damit das Modal nicht breiter wird. */
.rechtstext table {
  width: 100%; border-collapse: collapse; margin: 0 0 var(--hr-space-3);
  font-size: var(--hr-font-xs);
}
.rechtstext th, .rechtstext td {
  padding: var(--hr-space-2); border-bottom: 1px solid var(--hr-border-soft);
  text-align: left; vertical-align: top;
}
.rechtstext th { color: var(--hr-text-muted); font-weight: 600; }

/* ---- Formatierbares Eingabefeld (Rechtstexte pflegen) ---- */
.editor { border: 1px solid var(--hr-border); border-radius: var(--hr-radius-md); overflow: hidden; }
.editor-leiste {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: var(--hr-space-1); background: var(--hr-surface-muted);
  border-bottom: 1px solid var(--hr-border);
}
.editor-knopf {
  min-width: 30px; height: 28px; padding: 0 var(--hr-space-2);
  border: 1px solid transparent; border-radius: var(--hr-radius-sm);
  background: transparent; color: var(--hr-text-muted); cursor: pointer;
  font-size: var(--hr-font-xs); font-weight: 600; line-height: 1;
}
.editor-knopf:hover { background: var(--hr-surface); color: var(--hr-text); border-color: var(--hr-border); }
.editor-knopf:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.editor-knopf[aria-pressed="true"] { background: var(--hr-primary-soft); color: var(--hr-primary); }
.editor-trenner { width: 1px; margin: 4px 2px; background: var(--hr-border); }
.editor-flaeche {
  min-height: 320px; max-height: 55vh; overflow-y: auto;
  padding: var(--hr-space-3) var(--hr-space-4);
  background: var(--hr-surface); font-size: var(--hr-font-sm); line-height: 1.6;
}
.editor-flaeche:focus { outline: none; }
.editor:focus-within { border-color: var(--hr-primary); box-shadow: var(--hr-ring); }
/* Im Editor gilt dieselbe Darstellung wie später im Modal — was man sieht,
   ist was erscheint. */
.editor-flaeche h2 { font-size: var(--hr-font-md); margin: var(--hr-space-4) 0 var(--hr-space-2); }
.editor-flaeche h3 { font-size: var(--hr-font-sm); margin: var(--hr-space-3) 0 var(--hr-space-1); }
.editor-flaeche p { margin: 0 0 var(--hr-space-3); }
.editor-flaeche ul, .editor-flaeche ol { margin: 0 0 var(--hr-space-3); padding-left: var(--hr-space-5); }
.editor-flaeche table { width: 100%; border-collapse: collapse; margin: 0 0 var(--hr-space-3); font-size: var(--hr-font-xs); }
.editor-flaeche th, .editor-flaeche td { padding: var(--hr-space-1) var(--hr-space-2); border: 1px solid var(--hr-border-soft); text-align: left; }
.editor-fuss {
  display: flex; align-items: center; justify-content: space-between; gap: var(--hr-space-3);
  padding: var(--hr-space-1) var(--hr-space-2); background: var(--hr-surface-muted);
  border-top: 1px solid var(--hr-border); font-size: var(--hr-font-xs); color: var(--hr-text-soft);
}

/* Zeile je Rechtstext in den Einstellungen. */
.rechtstext-zeile {
  display: flex; align-items: center; gap: var(--hr-space-3); flex-wrap: wrap;
  padding: var(--hr-space-3) 0; border-bottom: 1px solid var(--hr-border-soft);
}
.rechtstext-zeile:last-of-type { border-bottom: 0; }
.rechtstext-zeile-text { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: var(--hr-space-1); }

/* Ein Modal mit Editor darf breiter sein: Rechtstexte in einer schmalen
   Spalte zu setzen macht das Redigieren unnötig mühsam. */
.modal:has(.editor) { max-width: 900px; width: 92vw; }

/* ---- Sicherungen: Wiederherstellungspunkte auf einen Blick ----
   Die Zeitachse beantwortet die eine Frage, mit der man hierherkommt: „Auf
   welchen Zeitpunkt kann ich zurück?" Eine Spur je Umfang, ein Feld je Tag,
   gefüllt heißt: hier gibt es einen Stand. Anklickbar sind nur die gefüllten. */
.zeitachse { display: flex; flex-direction: column; gap: var(--hr-space-3); }
.zeitachse-reihe { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: var(--hr-space-3); align-items: center; }
.zeitachse-name { display: flex; align-items: center; gap: var(--hr-space-2); min-width: 0; }
.zeitachse-name strong { font-size: var(--hr-font-sm); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeitachse-spur { display: flex; gap: 2px; align-items: stretch; }
.zeitachse-tag {
  flex: 1 1 0; min-width: 5px; height: 30px; padding: 0; border: 0;
  border-radius: 3px; background: var(--hr-surface-muted); cursor: default;
  transition: transform var(--hr-dauer-schnell) var(--hr-ease), background var(--hr-dauer-schnell) var(--hr-ease);
}
.zeitachse-tag.hat { background: color-mix(in srgb, var(--hr-primary) 35%, var(--hr-surface)); cursor: pointer; }
.zeitachse-tag.viele { background: var(--hr-primary); }
.zeitachse-tag.hat:hover { transform: scaleY(1.15); }
.zeitachse-tag.hat:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.zeitachse-tag.heute { box-shadow: inset 0 0 0 1px var(--hr-text-soft); }
.zeitachse-skala { display: flex; justify-content: space-between; font-size: 11px; color: var(--hr-text-soft); margin-top: 2px; }
.zeitachse-leer { font-size: var(--hr-font-sm); color: var(--hr-text-muted); }
/* Schmale Geräte: Name und Knopf oben, die Spur darunter über die ganze
   Breite — sonst schob sie die Seite seitwärts (Zyklus 6). */
@media (max-width: 640px) {
  .zeitachse-reihe { grid-template-columns: minmax(0, 1fr) auto; }
  .zeitachse-reihe > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .zeitachse-spur { gap: 1px; }
  .zeitachse-tag { min-width: 2px; }
}

/* Hinweisleiste über der Ansicht: ein Satz, der zum Handeln auffordert. */
.hinweisleiste {
  display: flex; align-items: center; gap: var(--hr-space-2); flex-wrap: wrap;
  padding: var(--hr-space-2) var(--hr-space-3); margin-bottom: var(--hr-space-3);
  border-radius: var(--hr-radius-md); font-size: var(--hr-font-sm);
  background: var(--hr-warning-soft); color: var(--hr-warning);
}
.hinweisleiste.ruhig { background: var(--hr-surface-muted); color: var(--hr-text-muted); }
.hinweisleiste .btn { margin-left: auto; }

/* Auswahl mit Tragweite: zwei Karten statt zweier Radioknöpfe. */
.wahl-karten { display: grid; gap: var(--hr-space-2); }
.wahl-karte {
  display: grid; grid-template-columns: auto 1fr; gap: var(--hr-space-2) var(--hr-space-3);
  padding: var(--hr-space-3); border: 1px solid var(--hr-border); border-radius: var(--hr-radius-md);
  cursor: pointer;
}
.wahl-karte:hover { background: var(--hr-surface-muted); }
.wahl-karte:has(input:checked) { border-color: var(--hr-primary); background: var(--hr-primary-soft); }
.wahl-karte strong { font-size: var(--hr-font-sm); }
.wahl-karte span { grid-column: 2; font-size: var(--hr-font-xs); color: var(--hr-text-muted); }

/* Vorschau einer Rückspielung: die Summe zuerst, die Einzelheiten darunter. */
.vorschau-summe {
  padding: var(--hr-space-3); border-radius: var(--hr-radius-md);
  background: var(--hr-surface-muted); font-size: var(--hr-font-sm); margin-bottom: var(--hr-space-3);
}
.vorschau-zahlen { display: flex; gap: var(--hr-space-4); margin-top: var(--hr-space-2); flex-wrap: wrap; }
.vorschau-zahl { display: flex; flex-direction: column; }
.vorschau-zahl b { font-size: var(--hr-font-lg); font-variant-numeric: tabular-nums; }
.vorschau-zahl small { font-size: 11px; color: var(--hr-text-muted); }
.vorschau-zahl.zurueck b { color: var(--hr-success); }
.vorschau-zahl.aendern b { color: var(--hr-primary); }
.vorschau-zahl.entfernen b { color: var(--hr-danger); }

/* Punkte eines Tages: kompakte Liste im Modal. */
.punkt-liste { display: flex; flex-direction: column; gap: var(--hr-space-2); }
.punkt {
  display: grid; grid-template-columns: 1fr auto; gap: var(--hr-space-2); align-items: center;
  padding: var(--hr-space-2) var(--hr-space-3); border: 1px solid var(--hr-border-soft);
  border-radius: var(--hr-radius-md);
}
.punkt-text { min-width: 0; }
.punkt-text strong { display: block; font-size: var(--hr-font-sm); }
.punkt-text small { color: var(--hr-text-muted); font-size: var(--hr-font-xs); }
.punkt-aktionen { display: flex; gap: var(--hr-space-1); }

/* Zeilenaktionen in dichten Tabellen: nur Symbole, Bedeutung im Titel. */
.zeilen-aktionen { display: flex; gap: 2px; justify-content: flex-end; }
.zeilen-aktion {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--hr-radius-sm);
  background: transparent; color: var(--hr-text-muted); cursor: pointer;
}
.zeilen-aktion:hover { background: var(--hr-surface-muted); color: var(--hr-text); }
.zeilen-aktion.gefahr:hover { background: var(--hr-danger-soft); color: var(--hr-danger); }
.zeilen-aktion:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }

/* --- Teamkalender: Zeitleiste mit durchgehenden Abwesenheitsbalken --- */
/* Ein einziges Grid: Spalte 1 die Namen (haftend), dahinter eine Spalte je
   Tag. Kalenderwochen, Tagesköpfe, Tageszellen und Balken werden über
   grid-row/grid-column platziert; Balken liegen über den Tageszellen. */
.tk-kopfzeile { align-items: center; }
.tk-monatstitel { min-width: 138px; text-align: center; font-variant-numeric: tabular-nums; }
.tk-suche { max-width: 200px; margin-left: auto; }
.tk-artwahl { max-width: 200px; }
.tk-nurmit { display: inline-flex; align-items: center; gap: 6px; font-size: var(--hr-font-sm); color: var(--hr-text-muted); cursor: pointer; white-space: nowrap; }
.tk-huelle { overflow-x: auto; border: 1px solid var(--hr-border); border-radius: var(--hr-radius-md); }
.tk {
  display: grid;
  grid-template-columns: minmax(190px, 230px) repeat(var(--tk-tage, 31), minmax(28px, 1fr));
  min-width: calc(190px + var(--tk-tage, 31) * 28px);
  background: var(--hr-surface);
  font-size: var(--hr-font-xs);
}
.tk-ecke, .tk-name { position: sticky; left: 0; z-index: 3; background: var(--hr-surface); border-right: 1px solid var(--hr-border); }
.tk-name { display: flex; align-items: center; padding: 4px 10px; min-height: calc(var(--tk-bahnen, 1) * 30px + 10px); border-top: 1px solid var(--hr-border-soft); }
.tk-zaehler { color: var(--hr-text-muted); font-size: var(--hr-font-xs); }
/* Telefon: Die Namensspalte nahm fast die halbe Breite (Zyklus 7). */
@media (max-width: 640px) {
  .tk {
    grid-template-columns: minmax(112px, 128px) repeat(var(--tk-tage, 31), minmax(28px, 1fr));
    min-width: calc(112px + var(--tk-tage, 31) * 28px);
  }
  .tk-name { padding: 4px 6px; min-width: 0; overflow: hidden; }
}
.tk-kw {
  padding: 3px 8px; color: var(--hr-text-muted); border-left: 1px solid var(--hr-border);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
.tk-tag {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 3px 0 4px; border-top: 1px solid var(--hr-border-soft); line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.tk-tag .tk-wt { color: var(--hr-text-muted); }
.tk-tag.frei { background: var(--hr-surface-muted); }
.tk-tag.heute .tk-nr {
  background: var(--hr-primary-flaeche); color: #fff; border-radius: 999px;
  min-width: 20px; text-align: center; padding: 1px 4px;
}
.tk-zelle {
  position: relative; border-top: 1px solid var(--hr-border-soft); border-left: 1px solid var(--hr-border-soft);
  min-height: calc(var(--tk-bahnen, 1) * 30px + 10px);
}
.tk-zelle.frei { background: var(--hr-surface-muted); }
.tk-zelle.heute { background: rgba(var(--hr-primary-rgb), 0.05); box-shadow: inset 2px 0 0 rgba(var(--hr-primary-rgb), 0.45); }
.tk-zelle.auswahl { background: var(--hr-primary-soft); }
.tk-dicht { min-height: 30px; display: flex; align-items: center; justify-content: center; color: var(--hr-text-muted); }
.tk-name.tk-dicht { justify-content: flex-start; }
.tk-leer { padding: 18px 14px; color: var(--hr-text-muted); border-top: 1px solid var(--hr-border-soft); }
.tk-balken {
  z-index: 2; align-self: start; margin: calc(5px + var(--tk-bahn, 0) * 30px) 3px 0;
  height: 24px; display: flex; align-items: center; padding: 0 8px;
  border: 1px solid; border-left-width: 4px; border-radius: var(--hr-radius-sm);
  font: inherit; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; text-align: left; min-width: 0;
}
.tk-balken:hover { filter: brightness(0.96); }
.tk-balken:focus-visible { outline: none; box-shadow: var(--hr-ring-fokus); }
.tk-balken.offen { border-style: dashed; background-image: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)); }
.tk-balken.links-offen { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.tk-balken.rechts-offen { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
/* Ziehbare Balken (HR): Mitte verschiebt, Kantengriffe verlängern/verkürzen. */
.tk-balken.ziehbar { cursor: grab; position: relative; }
.tk-balken.ziehbar.im-zug { cursor: grabbing; opacity: 0.75; filter: none; }
.tk-griff {
  position: absolute; top: 0; bottom: 0; width: 8px; cursor: col-resize;
  opacity: 0; transition: opacity 0.12s;
}
.tk-griff.links { left: 0; border-left: 2px solid currentColor; }
.tk-griff.rechts { right: 0; border-right: 2px solid currentColor; }
.tk-balken.ziehbar:hover .tk-griff, .tk-balken.ziehbar.im-zug .tk-griff { opacity: 0.7; }
.tk-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 2px 2px 0; font-size: var(--hr-font-xs); color: var(--hr-text-muted); }
.tk-legende-art { display: inline-flex; align-items: center; gap: 6px; }
.tk-punkt { width: 12px; height: 12px; border-radius: 4px; border: 1px solid; flex: none; }
.tk-punkt.offen { border-style: dashed; border-color: var(--hr-text-muted); background: var(--hr-surface); }

/* Schichtplan: Abwesenheits-Marker, Besetzungs-Fußzeile. */
td.plan-zelle.zelle-abwesend { background: var(--hr-surface-muted); }
.plan-abwesend { display: block; font-size: var(--hr-font-xs); font-style: italic; color: var(--hr-text-muted); padding: 2px 0; }
.plan-besetzung td { border-top: 2px solid var(--hr-border-soft); }
.besetzung { font-weight: 600; font-variant-numeric: tabular-nums; }
.besetzung.fehlt { color: var(--hr-danger); }
.besetzung.voll { color: var(--hr-text-muted); }

/* Reiner Icon-Knopf (z. B. Hell/Dunkel-Umschalter in der Topbar). */
.btn.nur-icon { padding: 0; width: 30px; height: 30px; justify-content: center; }

/* Heute-Markierung im Schichtplan — dasselbe Muster wie im Teamkalender. */
.plan-heute {
  background: var(--hr-primary-flaeche); color: #fff; border-radius: 999px; padding: 1px 8px;
  display: inline-block;
}
td.plan-zelle.heute-spalte { background: rgba(var(--hr-primary-rgb), 0.05); }

/* Startseite anpassen: eine Zeile je Modul — Kästchen, Name, Schieber. */
.modul-liste { display: flex; flex-direction: column; gap: 4px; }
.modul-zeile {
  display: flex; align-items: center; gap: var(--hr-space-2);
  padding: 4px 6px; border-radius: var(--hr-radius-sm);
}
.modul-zeile:hover { background: var(--hr-surface-muted); }
.modul-zeile label { flex: 1; cursor: pointer; }
.modul-schieber { display: flex; gap: 4px; }

/* ---- Schichtplan: Ansichten-Umschalter (Tag/Woche/Monat/Vorlage/Liste) ---- */
.umschalter {
  display: inline-flex; flex-wrap: wrap; max-width: 100%;
  border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-md); overflow: hidden; flex: 0 1 auto;
}
.umschalter-knopf {
  /* Oberkante mit -1px in den Rahmen gezogen: bricht die Gruppe auf schmalen
     Schirmen um, trennt die Zeilen eine Linie — in einer Zeile schluckt sie
     der Rahmen. */
  border: 0; border-right: 1px solid var(--hr-border);
  border-top: 1px solid var(--hr-border); margin-top: -1px;
  background: var(--hr-surface); color: var(--hr-text-muted);
  font: inherit; font-size: var(--hr-font-sm); padding: 4px 10px;
  cursor: pointer; white-space: nowrap;
  transition: background var(--hr-dauer-schnell) var(--hr-ease), color var(--hr-dauer-schnell) var(--hr-ease);
}
.umschalter-knopf:last-child { border-right: 0; }
.umschalter-knopf:hover { background: var(--hr-surface-muted); color: var(--hr-text); }
.umschalter-knopf.aktiv { background: var(--hr-text); color: var(--hr-bg); }
.umschalter-knopf:focus-visible { box-shadow: var(--hr-ring); position: relative; z-index: 1; }

/* ---- Schichtplan: Tagesansicht als Zeitachse ---- */
.za-huelle { overflow-x: auto; }
/* Nur die Tagesansicht des Schichtplans — die Zeitachse der Sicherungen
   trägt dieselbe Klasse und hat keine eigene Scroll-Hülle (Zyklus 6). */
.za-huelle .zeitachse { min-width: 760px; }
.za-zeile { display: flex; align-items: stretch; border-top: 1px solid var(--hr-border-soft); min-height: 44px; }
.za-zeile.za-kopf { border-top: 0; min-height: 24px; color: var(--hr-text-muted); font-size: var(--hr-font-xs); }
.za-name { flex: 0 0 220px; display: flex; align-items: center; padding: 4px var(--hr-space-2); min-width: 0; }
.za-spur { position: relative; flex: 1; min-width: 0; }
.za-marke { position: absolute; top: 4px; transform: translateX(-50%); }
.za-linie { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--hr-border-soft); }
.za-deckung { display: grid; flex: 1; min-width: 0; align-items: center; }
.za-deckung span { text-align: center; font-variant-numeric: tabular-nums; }
.za-deckung span.ohne { color: var(--hr-text-soft); }
.za-balken {
  position: absolute; top: 7px; bottom: 7px;
  display: flex; align-items: center; min-width: 0;
  border: 0; border-left: 3px solid var(--hr-primary); border-radius: 4px;
  background: var(--hr-primary-soft); color: var(--hr-primary);
  font: inherit; font-size: var(--hr-font-xs); padding: 0 6px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.za-balken.offen { background: var(--hr-surface-muted); color: var(--hr-text-muted); border-left-color: var(--hr-border); }
.za-balken.konflikt { background: var(--hr-warning-soft); color: var(--hr-warning); border-left-color: var(--hr-warning); }
.za-balken.entwurf { border-style: solid; outline: 1px dashed var(--hr-border); outline-offset: -1px; }
.za-balken:focus-visible { box-shadow: var(--hr-ring); }

/* ---- Schichtplan: Monatsansicht ---- */
.monat-huelle { overflow-x: auto; }
.monat-raster {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  min-width: 760px; background: var(--hr-border-soft);
  border: 1px solid var(--hr-border-soft); border-radius: var(--hr-radius-md); overflow: hidden;
}
.monat-wt { background: var(--hr-surface-muted); color: var(--hr-text-muted); font-size: var(--hr-font-xs); font-weight: 600; padding: 4px 6px; }
.monat-zelle {
  background: var(--hr-surface); border: 0; font: inherit; text-align: left;
  min-height: 92px; padding: 4px 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; align-items: stretch;
}
.monat-zelle:hover { background: var(--hr-surface-muted); }
.monat-zelle:focus-visible { box-shadow: var(--hr-ring); position: relative; z-index: 1; }
.monat-zelle.aussen { background: var(--hr-bg); color: var(--hr-text-muted); }
.monat-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font-size: var(--hr-font-xs); }
.monat-zahl { font-weight: 600; }
.monat-kopf .besetzung { font-size: var(--hr-font-xs); }
.monat-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.monat-mehr { font-size: var(--hr-font-xs); color: var(--hr-text-muted); }

/* Kompakte Schicht-Chips (Monat und „Nach Vorlage"). */
.plan-chip {
  display: block; width: 100%; min-width: 0; text-align: left;
  border: 0; border-left: 3px solid var(--hr-primary); border-radius: 4px;
  background: var(--hr-primary-soft); color: var(--hr-primary);
  font: inherit; font-size: var(--hr-font-xs); padding: 1px 6px; margin: 1px 0;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
span.plan-chip { cursor: default; }
.plan-chip.offen { background: var(--hr-surface-muted); color: var(--hr-text-muted); border-left-color: var(--hr-border); }
.plan-chip.konflikt { background: var(--hr-warning-soft); color: var(--hr-warning); border-left-color: var(--hr-warning); }
.plan-chip.entwurf { outline: 1px dashed var(--hr-border); outline-offset: -1px; }
.plan-chip:focus-visible { box-shadow: var(--hr-ring); }

/* ---- Schrittfolge (Bilanzbericht) ----
   Der Weg vom Zeitraum bis zur freigegebenen Datei hat eine Reihenfolge, und
   die ist die Sache selbst. Die Nummer macht sie sichtbar, ohne zu schreien. */
.schritt-kopf {
  display: flex; align-items: flex-start; gap: var(--hr-space-3);
  margin-top: var(--hr-space-5); padding-top: var(--hr-space-4);
  border-top: 1px solid var(--hr-border);
}
.karte > .schritt-kopf:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.schritt-nummer {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: 999px;
  background: var(--hr-surface-muted); color: var(--hr-text-muted);
  font-size: var(--hr-font-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}
.schritt-titel { margin: 2px 0 0; font-size: var(--hr-font-md); font-weight: 650; }
.schritt-kopf .feld-hinweis { margin: 2px 0 0; }

/* Blätterleiste unter einer Liste: zurück, Seitennummer, weiter.
   Bewusst schlicht und rechtsbündig — sie ist Navigation, nicht Inhalt. */
.blaetterleiste { display: flex; align-items: center; justify-content: flex-end; gap: var(--hr-space-3); margin-top: var(--hr-space-3); }
.blaetterleiste .seiten-beschreibung { margin: 0; }

/* Zusätzliche Bestätigung (Stufe 2): Geheimnis und Wiederherstellungscodes.
   Dicktengleich und gesperrt gesetzt — sie werden abgetippt, nicht gelesen,
   und 0/O und 1/l dürfen sich dabei nicht ähneln. */
.geheimnis-gross {
  font-family: var(--hr-mono); font-size: var(--hr-font-lg);
  letter-spacing: 0.08em; overflow-wrap: anywhere; user-select: all;
}
ul.geheimnis-gross { font-size: var(--hr-font-md); }
.umbruch { overflow-wrap: anywhere; }
