/* AccelNexus — Design-Sprache des Nexus-Kerns (System folgt, hell+dunkel).
   Familien-Basis Accelness-Blau #3f9fff auf Dunkel #040c18,
   Zweit-Akzent Smaragdgrün #34d399 — trägt die Semantik „verfügbar/eingeplant" (AccelDeals=Orange, AccelInbox=Teal, AccelCall=Violett).
   Diese Variablen sind die EINE Design-Quelle für App, Berichte und Webseite. */

:root {
  --brand: #3f9fff;
  --brand-strong: #1668c4; /* Füllfläche für weißen Text (≥4.5:1); --brand bleibt Akzent/Linie */
  --brand-ink: #1668c4;    /* Markenfarbe als SCHRIFT auf hellem Grund (≥4.5:1) — pro Theme gedreht */
  --accent: #34d399;
  --accent-ink: #0a6f49;   /* Akzent als SCHRIFT/Symbol; #34d399 schafft auf Weiß nur 1,9:1 */
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #eaf1f9;
  --text: #10233c;
  --text-muted: #5a6f8a;
  --border: #d4e0ee;
  --ok: #1fa971;
  --ok-ink: #0f6b47;       /* Ampel als SCHRIFT auf hellem Grund; #1fa971 schafft nur 3,0:1 */
  --warn: #d98a1f;
  --warn-ink: #8a5300;     /* dito, #d98a1f schafft nur 2,8:1 */
  --danger: #b93737;
  --radius: 12px;
  /* Typo-Treppe (Design-Fund 9): vier Stufen statt vierzehn Groessen. */
  --fs-page: 22px;
  --fs-card: 17px;
  --fs-body: 14px;
  --fs-small: 12.5px;
  --shadow: 0 2px 12px rgba(16, 35, 60, 0.08);
  --font: "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #040c18;
    --surface: #0b1626;
    --surface-2: #122036;
    --text: #e8f0fa;
    --text-muted: #8aa0bc;
    --border: #1d3050;
    --brand-ink: #3f9fff;  /* auf Dunkel tragen --brand und --accent selbst genug Kontrast */
    --accent-ink: #34d399;
    --ok-ink: #34d399;
    --warn-ink: #f0b45e;
    --danger: #f07575;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --bg: #040c18;
  --surface: #0b1626;
  --surface-2: #122036;
  --text: #e8f0fa;
  --text-muted: #8aa0bc;
  --border: #1d3050;
  --brand-ink: #3f9fff;
  --accent-ink: #34d399;
  --ok-ink: #34d399;
  --warn-ink: #f0b45e;
  --danger: #f07575;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

/* Globale Durchsetzung von [hidden] (Funktions-Fund 3, Design-Fund 6).
   Ohne diese Regel ueberstimmt jedes display:flex/inline-flex das Attribut —
   ausgeblendete Menuepunkte, Knoepfe und Toasts blieben sichtbar und klickbar.
   hidden="until-found" bleibt ausgenommen, damit die Browser-Suche es aufklappen kann. */
[hidden]:not([hidden="until-found"]) { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
}

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  /* Design-Fund 7: auf 1366x768 war die Leiste 1098px hoch — die letzten sechs
     Punkte waren nur ueber das Scrollen der GANZEN Seite erreichbar. Jetzt klebt
     sie und scrollt in sich. */
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Design-Fund 21: 19 gleichwertige Punkte ohne Gliederung. Drei leise Gruppen. */
.nav-gruppe {
  margin: 12px 0 2px;
  padding: 0 12px;
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-scroll > .nav-gruppe:first-child { margin-top: 0; }
.sidebar .nav-fuss { flex: 0 0 auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  padding: 6px 10px 16px;
}
.sidebar .logo img { width: 28px; height: 28px; border-radius: 7px; }

.nav-item {
  display: flex;
  text-decoration: none;   /* Design-Fund 20: <a class="nav-item"> war sonst unterstrichen */
  align-items: center;
  gap: 10px;
  padding: 12px;            /* hält die 44px Zeilenhöhe, seit die Icon-Spans schlanker sind */
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-strong); color: #fff; }
.nav-item svg { flex: 0 0 auto; }

/* Design-Fund 16: 960px liessen auf Full-HD 740px tote Flaeche links angeschlagen.
   Mehr Breite fuer Listen + mittig statt am linken Rand. */
main { flex: 1; min-width: 0; padding: 28px 32px; max-width: 1240px; margin-inline: auto; }
h1 { font-size: var(--fs-page); margin: 0 0 6px; }
h2 { font-size: var(--fs-card); margin: 0 0 6px; }
h3 { font-size: var(--fs-body); margin: 0 0 4px; }
h4 { font-size: var(--fs-body); margin: 0 0 4px; }
.muted { color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 18px;
}

/* Übersicht-Kacheln (Fund 7) — nur bestehende Design-Tokens. */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.dash-grid .card { margin-top: 0; }
.dash-num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.dash-line { margin-top: 6px; font-size: 14px; }
.dash-line.warn { color: var(--warn-ink); font-weight: 600; }
/* Design-Fund 15 / Funktions-Fund 15: die Kacheln waren eine Sackgasse —
   Zahlen und Zeilen ohne einen einzigen Link. Jetzt ist jede Zeile ihr
   Deep-Link, sichtbar als solcher. */
.dash-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  padding: 2px 4px;
  margin-left: -4px;
}
.dash-link:hover { background: var(--surface-2); color: var(--brand-ink); }
a.dash-num { display: block; }

label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; }
select, input, textarea {
  font: inherit;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
/* Textflaechen fielen frueher aus dem Design-System (Design-Fund 4): weisser
   System-Kasten mit Monospace mitten in der dunklen App. */
textarea { min-height: 84px; resize: vertical; line-height: 1.45; width: 100%; }

/* ===================================================================== */
/* Knopf-System — EINE Sprache für alle Knöpfe.                          */
/* Geometrie ist immer gleich (Höhe, Radius, Icon-Abstand), nur die       */
/* Farbe erzählt die Wichtigkeit. Blau (--brand) = Aktion. Grün           */
/* (--accent) bleibt ausschließlich Status („verfügbar/eingeplant",       */
/* Ampel, veröffentlicht) und taucht nie als Knopffarbe auf — sonst       */
/* liest sich jede Aktion wie eine Zustandsmeldung.                       */
/* Der nackte <button> IST die Zweitstufe: kein Browser-Default mehr,     */
/* der je nach Theme weiß/grau aus dem Design fällt.                      */
/* ===================================================================== */
button {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  line-height: 1.25;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
/* Alle Hover-Regeln tragen :enabled — sonst überschriebe der Zweitstufen-Hover
   den getönten/gefüllten Look eines deaktivierten Knopfes (z. B. „KI-Vorschlag"
   während der Anfrage) und er wechselte beim Darüberfahren die Farbe. */
button:enabled:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-2));
}
/* AccelIcons legt ein 20px-SVG inline in den <span data-icon> — der Platz für
   Unterlängen darunter machte jeden Knopf MIT Icon 4px höher als einen reinen
   Textknopf (Plan-Leiste: „PDF" 42px neben „Diese Woche" 38px). Als Flex-Box
   fällt der Rest weg, alle Knöpfe sind gleich hoch. */
button [data-icon] { display: inline-flex; align-items: center; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, .nav-item:focus-visible, a:focus-visible,
select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Erste Stufe — die eine Haupt-Aktion einer Ansicht.
   Rahmen in Füllfarbe, damit sie exakt so hoch ist wie die Zweitstufe.
   .ki-accept = dieselbe Stufe, nur kompakt in der Vorschlagszeile. */
button.primary {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}
button.primary:enabled:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  filter: brightness(1.12);
}

/* Getönt — betonte Neben-Aktion (KI-Vorschlag, Wunsch einplanen). */
.btn-tinted, .btn-ki, .act-plan {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--brand-ink);
}
/* 18%, nicht mehr: darüber fällt die Schrift auf Hell unter 4,5:1. Die
   Abgrenzung zum Ruhezustand trägt zusätzlich der kräftigere Rahmen. */
.btn-tinted:enabled:hover, .btn-ki:enabled:hover, .act-plan:enabled:hover {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* Kompakt — Knöpfe, die in einer Tabellen- oder Listenzeile sitzen. */
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }

.page[hidden] { display: none; }
.overlay[hidden] { display: none; } /* Falle aus Baustein K: flex überstimmt hidden */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.page-head h1, .page-head h2 { margin: 0; }
.page-head + .card { margin-top: 12px; }

/* Dritte Stufe — beiläufige Aktion, trägt keine Fläche.
   --brand-ink statt --brand: reines #3f9fff schafft auf Weiß nur 2,8:1. */
.linklike {
  border: 1px solid transparent;
  text-decoration: none;   /* Design-Fund 20 */
  background: none;
  color: var(--brand-ink);
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 7px;
}
.linklike:hover:not(:disabled) {   /* :enabled greift bei <a> nie — Design-Fund 20 */
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-color: transparent;
  color: var(--brand-ink);
}
/* Löschen/Entfernen bleibt rot — auch im Hover, sonst springt die Bedeutung. */
.linklike.act-del, .chip .linklike { color: var(--danger); }
/* Design-Fund 20: auch hier :enabled -> :hover:not(:disabled), damit die
   Regel bei einem <a class="linklike"> ueberhaupt greift. */
.linklike.act-del:hover:not(:disabled),
.chip .linklike:hover:not(:disabled), .chip-x:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
table.data th { color: var(--text-muted); font-weight: 600; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

.empty-note { color: var(--text-muted); padding: 6px 0; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--surface-2);
  color: var(--text-muted);
}

/* Modal — Fallen aus Baustein K: [hidden] schlägt flex; gemeinsame
   .modal-body-Klasse (Scroll + Padding), Fußzeile bleibt sichtbar. */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(560px, calc(100vw - 32px));
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 20px 12px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}
.modal-body label:first-child { margin-top: 4px; }
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%;
  font: inherit;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.modal-body textarea { min-height: 70px; resize: vertical; }
/* Design-Fund 17: Das Raster 1fr 1fr setzte Label und Feld ABWECHSELND in die
   zwei Spalten — also Label links, Feld rechts, Feldspalte erst ab ~55 % der
   Dialogbreite. Das Auge lief im Zickzack und die Felder waren unnoetig
   schmal. Jetzt einspaltig mit dem Label UEBER dem Feld (UX-Leitfaden). */
.form-grid { display: block; }
.form-grid .span-2 { display: block; }
/* Zwischenueberschriften gliedern lange Formulare in Sinngruppen. */
.form-abschnitt {
  margin: 18px 0 2px;
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-grid > .form-abschnitt:first-child { margin-top: 4px; }
/* Funktions-Fund 34: der Deep-Link aus der Stammdaten-Aufgabe benennt jetzt
   die fehlenden Felder und markiert sie im Dialog. */
.hinweis-band {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--text);
  font-size: var(--fs-body);
}
input.feld-fehlt, select.feld-fehlt { border-color: var(--warn); }

/* Design-Fund 12: die ganze Zeile ist der Griff, nicht nur der 16-px-Stift. */
tr.zeile-klick { cursor: pointer; }
tr.zeile-klick:hover > td { background: var(--surface-2); }
/* Design-Fund 30: die Spaltenkoepfe „Erinnern" und „Auch aufs Handy" standen
   links, die Kaestchen darunter am linken Rand einer breiten Spalte — der
   Bezug war unklar. Kopf und Kaestchen stehen jetzt beide mittig. */
.card table th.mitte, .card table td.mitte { text-align: center; }

.btn-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }


.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.toast.error { border-left-color: var(--danger); }
.toast .icon-ok { color: var(--ok-ink); }
.toast.error .icon-ok { color: var(--danger); }

/* --- Tabellen, Chips, Inline-Formulare --- */
.card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.card table th, .card table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.card table th { color: var(--text-muted); font-weight: 600; }
.card table tr:last-child td { border-bottom: none; }
.card table tr.muted td { color: var(--text-muted); }

.row-actions { text-align: right; white-space: nowrap; }
/* Zeilen-Aktionen liegen auf der kompakten Skala (13px), damit Text-Links
   neben .act-plan/.ki-accept nicht größer wirken als der Knopf daneben. */
.row-actions .linklike { padding: 5px 7px; font-size: 13px; }
.row-actions .act-del { color: var(--danger); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip input[type="checkbox"] { width: auto; margin: 0; }
.chip .linklike { padding: 1px 4px; color: var(--danger); }

.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
/* Ein <select> waechst mit seiner laengsten Option — die Leistungs-Auswahl
   der Synonym-Zeile schob damit die GANZE Seite 148 px nach rechts
   (Design-Fund 1, im Browser nachgemessen). min-width:0 am Flex-Kind ist
   die Stolperfalle aus dem Skill. */
.inline-form input, .inline-form select { width: auto; min-width: 0; max-width: 100%; }
.inline-form select { text-overflow: ellipsis; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: baseline;
}

.form-grid label { margin: 12px 0 4px; }
.form-grid input[type="checkbox"] { width: auto; margin-top: 0; }

.ampel-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.ampel-dot.unter { background: var(--danger); }
.ampel-dot.soll { background: var(--accent); }
.ampel-dot.ueber { background: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.ai-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ai-ok { color: var(--ok-ink); }
/* N3: Werkzeug-Liste der Assistentin (Einstellungen → Sprachassistent) */
.sprach-werkzeuge { margin: 4px 0 12px; padding-left: 18px; }
.sprach-werkzeuge li { margin: 2px 0; }
.ai-err { color: var(--danger); }
/* --- Suite-Export (Einstellungen) --- */
.suite-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.suite-hint {
  display: flex; align-items: flex-start; gap: 8px; flex: 1 1 260px;
  font-size: 13px; color: var(--text-muted);
  padding: 8px 12px; border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.suite-hint svg { flex: 0 0 auto; color: var(--brand); margin-top: 1px; }

/* ================= V4-S2: Login, Sitzung, Nur-Lese-Banner ================= */

/* Anmeldeseite: zentrierte Karte auf App-Hintergrund */
.login-body { align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 400px; padding: 20px; margin-inline: auto; }
.login-card { display: flex; flex-direction: column; gap: 8px; padding: 26px; }
.login-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; }
.login-logo img { width: 32px; height: 32px; border-radius: 8px; }
.login-card h1 { margin: 6px 0 0; font-size: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.login-card form label { font-size: 13px; color: var(--text-muted); }
.login-card form button { margin-top: 8px; justify-content: center; }
.login-error { color: var(--danger); font-size: 13px; margin: 2px 0 0; }
.login-lang { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* Sitzung in der Seitenleiste (unten) */
.sidebar-user {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 10px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.sidebar-user #session-user { overflow-wrap: anywhere; }

/* Nur-Lese-Banner: [hidden] MUSS display:flex schlagen (Overlay-Stolperfalle) */
.readonly-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--warn);
  border-left: 4px solid var(--warn);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 16px 0 0;
}
.readonly-banner[hidden] { display: none; }
.readonly-banner [data-icon] { color: var(--warn-ink); display: inline-flex; }

/* Benutzerverwaltung (Einstellungen) */
.users-form { flex-wrap: wrap; }
.users-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.users-row:last-child { border-bottom: none; }
.users-row .users-name { font-weight: 600; min-width: 140px; }
.users-row .users-meta { color: var(--text-muted); font-size: 13px; }
.users-row .users-actions { margin-left: auto; display: flex; gap: 6px; }
.users-row.inactive .users-name { color: var(--text-muted); text-decoration: line-through; }

/* ---------------------------------------------- Handy-Zugänge (Büro-Seite) */
/* Der Anmelde-Link wird genau einmal angezeigt — deshalb visuell laut. */
.handy-link-box { border: 1px solid var(--warn); border-radius: 8px; padding: 10px; margin-bottom: 12px; background: color-mix(in srgb, var(--warn) 10%, transparent); }
.handy-link-box[hidden] { display: none; }
.handy-link-warn { margin: 0 0 6px; }
#handy-link-wert { width: 100%; font-family: ui-monospace, "Consolas", monospace; font-size: 0.85rem; }


/* Design-Fund 1: eine 9-Spalten-Tabelle passt nie in die Inhaltsbreite. Ohne
   eigenen Rahmen schiebt sie Inhalt UND Seitenleiste waagerecht aus dem Bild.
   Dieselbe Klasse benutzt nachweise.css bereits — eine Variante, nicht drei. */
.table-wrap { overflow-x: auto; min-width: 0; }

/* Der gemeinsame Bestaetigungs-Dialog (Design-Fund 19) ist schmaler als ein
   Formular-Modal — er traegt nur eine Frage und zwei Knoepfe. */
.modal.modal-schmal { max-width: 440px; }

/* Ein <a>, das wie der Primaer-Knopf aussieht (Design-Fund 29): ein gesperrter
   Zustand bekommt immer den naechsten Schritt als Knopf. Die Geometrie kommt
   aus dem Knopf-System, damit es sich nicht davon loest. */
a.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--brand-strong);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  min-height: 38px;
}
a.primary-link:hover { filter: brightness(1.08); }
.modal.modal-schmal .modal-body p { margin: 0; line-height: 1.5; }
/* Zahlenspalten rechtsbuendig mit gleichbreiten Ziffern (Design-Fund 12/30). */
.card table td.num, .card table th.num { text-align: right; font-variant-numeric: tabular-nums; }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------- V4·S7b: Angemeldete Geräte */

.ger-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.ger-zeile:first-child { border-top: 0; }
.ger-zeile > div:first-child { min-width: 0; overflow-wrap: anywhere; }
/* Ein gesperrtes Gerät bleibt sichtbar (nachvollziehbar), tritt aber zurück. */
.ger-zeile.inaktiv { opacity: .6; }

button.ger-sperren {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  white-space: nowrap;
}
button.ger-sperren:enabled:hover { filter: brightness(.92); }

/* ---------------------------------------------- V4-S10.3 Aufgaben-Automat
   Die Aufgaben-Seite kommt mit den vorhandenen Bausteinen aus (card, table,
   page-head). Neu sind nur vier Kleinigkeiten: die Knopfleiste im Kopf, die
   Abhak-Liste, die zwei Zustandsfarben und der Schutz gegen umbrechende
   Aktionsspalten. Farben ueber die Token, damit hell und dunkel stimmen. */
.page-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head-actions label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.page-head-actions label.inline input { width: auto; margin: 0; }
td.nowrap { white-space: nowrap; }
.auf-punkte { list-style: none; margin: 8px 0 0; padding: 0; }
.auf-punkt { padding: 6px 0; border-bottom: 1px solid var(--border); }
.auf-punkt:last-child { border-bottom: 0; }
.auf-punkt .warn { color: var(--warn-ink); font-weight: 600; }
.auf-punkt .ok { color: var(--ok-ink); font-weight: 600; }
#auf-liste .warn { color: var(--warn-ink); font-weight: 600; }

/* -------------------------------------- V5.2-Nachtrag · Klappkarten (5c)
   EIN Muster für die ganze App (helpers.js, window.AccelKlapp). Die Karte
   ist ein <details class="card klapp">; die Kopfzeile trägt Kernzahl/Status
   AUCH zugeklappt (Regel 1), eine Warnkarte bleibt offen (Regel 2, Klasse
   .klapp-warnung), Tastatur kommt von <summary> von Haus aus (Regel 4).
   Farben nur über die *-ink-Token, damit hell und dunkel stimmen. */
details.card.klapp { padding: 0; }
details.klapp > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: var(--radius);
}
details.klapp > summary::-webkit-details-marker { display: none; }
details.klapp > summary:hover { background: var(--surface-2); }
details.klapp > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
details.klapp[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 12px;
}
details.klapp > summary h2 { margin: 0; font-size: var(--fs-card); }
.klapp-pfeil {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 600;
  transition: transform .15s ease;
}
@media (prefers-reduced-motion: reduce) { .klapp-pfeil { transition: none; } }
details.klapp[open] > summary .klapp-pfeil { transform: rotate(90deg); }
/* Regel 1: die Kernzahl/der Status — rechtsbündig, Tabellenziffern. */
.klapp-status {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: var(--fs-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}
details.klapp > summary:hover .klapp-status { background: var(--surface); }
.klapp-status.warn {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  color: var(--warn-ink);
}
.klapp-status.ok {
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ok-ink);
}
/* Regel 2: der Hinweis „bleibt offen" neben dem Status einer Warnkarte. */
.klapp-schloss {
  flex: 0 0 auto;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--text-muted);
}
details.klapp-warnung > summary { cursor: default; }
.klapp-koerper { padding: 0 20px 20px; }
/* Verweiszeile für umgezogene Einstellungs-Karten (Stufe 1: entzerren). */
.klapp-verweis {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-top: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  color: var(--text-muted);
}
/* Umschalter innerhalb einer Seite (z. B. „Ein Tag / Zeitraum"). */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  padding: 6px 14px;
  white-space: nowrap;
}
.seg button[aria-pressed="true"] {
  background: var(--brand-strong);
  color: #fff;
  font-weight: 600;
}
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }


/* Zustands-Chips: ok (grün), warn (gelb) — Farben als Schrift über die -ink-Token. */
.chip.ok {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  color: var(--ok-ink);
}
.chip.warn {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  color: var(--warn-ink);
}

/* ================= N1.2 · Schale: Nav-Leerzustand, Leerzustände, Profil ==== */
/* Der Modul-Container in der Navigation ist leer, bis die Registry (N2)
   Einträge liefert — der Hinweis ist leise, kein Fehler. */
.nav-leer { margin: 2px 12px 6px; line-height: 1.4; }
/* Leerzustand mit Aktions-Knopf (UX-Leitfaden): Symbol, Satz, Weg. */
.leer-zustand {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 12px 12px; text-align: center;
}
.leer-zustand [data-icon] { color: var(--text-muted); display: inline-flex; }
.leer-zustand p { margin: 0; }
.leer-zustand button { margin-top: 8px; }
.dash-tile-body { min-height: 24px; }
/* Profil: Beschreibungsliste in zwei Spalten, Tabellenziffern. */
.profil-felder {
  display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px;
  margin: 10px 0 14px;
}
.profil-felder dt { color: var(--text-muted); font-weight: 600; }
.profil-felder dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .profil-felder { grid-template-columns: 1fr; gap: 0 0; margin-inline: auto; }
  .profil-felder dd { margin-bottom: 8px; }
}

/* ======================= N2 · Kern-Schicht: Stammdaten, Profile, Auswahl ==== */
/* Listen-Schablone: Suchzeile unter dem Seitenkopf — Suche links, Filter,
   Zähler rechts (UX-Leitfaden 1A). */
.kern-filter {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px;
}
.kern-filter input[type="search"] { flex: 1 1 220px; min-width: 160px; margin: 0; }
.kern-filter .inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.kern-filter .inline input { width: auto; margin: 0; }
.kern-filter > .muted { margin-left: auto; }
.page-head > div > h1 { margin-bottom: 4px; }
.page-head > div > p { margin: 0; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Zeilenklick öffnet die Detailkarte; die gewählte Zeile bleibt markiert. */
.kern-tabelle { width: 100%; }
.kern-tabelle .kern-zeile { cursor: pointer; }
.kern-tabelle .kern-zeile:hover td { background: var(--surface-2); }
.kern-tabelle .kern-zeile.gewaehlt td { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.kern-tabelle td, .kern-tabelle th { vertical-align: top; }
.kern-aktionen { display: flex; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.kern-aktionen .linklike { padding: 2px 4px; }
/* Der Farbpunkt eines Mitarbeiters (Dienstplan-Farbe) — klein, vor dem Namen. */
.ma-punkt {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent);
}
/* Kataloge (Abteilungen, Qualifikationen, Module): eine Zeile je Eintrag,
   Name links, Nebentext, Aktionen rechts — kein Tabellenrahmen. */
.katalog { display: flex; flex-direction: column; }
.katalog-zeile {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.katalog-zeile:last-child { border-bottom: none; }
.katalog-zeile .katalog-name { font-weight: 600; min-width: 160px; }
.katalog-zeile.inaktiv .katalog-name { color: var(--text-muted); text-decoration: line-through; }
.katalog-zeile .kern-aktionen { margin-left: auto; }
.katalog-zeile .module-schalter { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.katalog-zeile .module-schalter input { width: auto; margin: 0; }
/* Formular-Modal: Abschnitts-Überschriften und Hilfstext unter dem Feld. */
.modal-body h3.form-abschnitt {
  margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: var(--fs-body); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}
.modal-body .feld-hilfe { margin: 4px 0 0; }
.modal-body .form-feld > .inline { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-weight: 500; }
.modal-body .form-feld > .inline input { width: auto; margin: 0; }
.modal-body input[type="color"] { width: 64px; height: 36px; padding: 2px; }
/* Kurze Felder nebeneinander (PLZ + Ort + Land) — nur zusammengehörige. */
.form-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
/* Auswahl-Bauteil (js/kern/auswahl.js): Feld + schwebende Trefferliste. */
.auswahl { position: relative; display: block; flex: 1 1 220px; min-width: 0; }
.auswahl .auswahl-feld { width: 100%; margin: 0; }
.auswahl .auswahl-feld.auswahl-gewaehlt { border-color: var(--brand); font-weight: 600; }
.auswahl-liste {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; padding: 4px;
}
.auswahl-liste[hidden] { display: none; }
.auswahl-zeile {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.auswahl-zeile .muted { margin-left: auto; }
.auswahl-zeile:hover, .auswahl-zeile.aktiv { background: var(--surface-2); }
.auswahl-punkt { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.auswahl-leer { padding: 8px 10px; }
/* Profil-Matrix: Profile als Zeilen, Module als Spalten; Dreiwert je Zelle. */
.prof-tabelle select { width: auto; min-width: 0; margin: 0; font-size: var(--fs-small); }
.prof-tabelle th.prof-modul, .prof-tabelle td.prof-modul { text-align: center; }
.prof-tabelle th.prof-modul .muted { font-weight: 400; text-transform: none; letter-spacing: 0; }
/* Sperr-Panel: eine ruhige Karte in der Mitte — Schloss, Satz, Weg heraus. */
.sperre-karte {
  max-width: 520px; margin: 40px auto; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px;
}
.sperre-karte [data-icon] { color: var(--warn-ink); display: inline-flex; }
.sperre-karte h1 { margin: 4px 0 0; }
.sperre-karte p { margin: 0; }
.sperre-karte .ai-actions { justify-content: center; margin-top: 12px; }
.users-row select { width: auto; min-width: 0; margin: 0; font-size: var(--fs-small); }
.users-form select { max-width: 220px; margin: 0; }
