/* ==========================================================================
   Oberflaeche auf dem Optimizely Axiom Design System.

   Zwei Quellen, und sie beantworten verschiedene Fragen:

   - `axiom-tokens.css` sagt, WELCHE Werte es gibt. Erzeugt aus
     @optiaxiom/globals durch `bin/axiom-tokens.mjs` — hier steht kein
     einziger abgeschriebener Farbwert.
   - Das kompilierte Komponenten-CSS von @optiaxiom/react 3.1.7 sagt, WIE die
     Bauteile sie benutzen. Wo eine Regel von dort stammt, steht die
     Komponente daneben. Das ist der Unterschied, an dem man sonst scheitert:
     `bg.secondary` als Tabellenkopf waere ein gueltiges Token und trotzdem
     nicht Axiom — Axioms Kopfzelle hat gar keine Flaeche.

   Axiom ist eine React-Bibliothek; diese Oberflaeche ist Vanilla ohne
   Build-Schritt. Also dieselben Werte durch handgeschriebenes CSS, wie in
   praeferenz-hikel-app und print-hikel-app. `src/axiom.test.ts` prueft beides.

   Was hier NICHT steht, weil Axiom es nicht kennt:
   - kein zentrierter Inhalt: `LayoutContent` hat weder max-width noch
     margin:0 auto. Die maxSize-Tokens gehen nur bis 512px und sind fuer
     Dialoge und Karten.
   - keine erfundenen Haltepunkte: es gibt genau zwei, sm 37.5rem und
     md 56.25rem.
   - kein `flex-end` und kein `text-align: right`: Axiom kennt `end`.
   ========================================================================== */


/* ==========================================================================
   Namensbruecke zu rcs.hikel.de.

   `rcs` benutzt kurze Namen (--panel, --line, --accent-bg) und hat die Werte
   als Hex abgeschrieben. Hier stehen dieselben Namen, aber sie zeigen auf die
   **erzeugten** Tokens aus @optiaxiom/globals. Im hellen Modus kommt exakt
   derselbe Wert heraus wie in rcs; der Dunkelmodus faellt umsonst ab, weil
   Axioms Farben light-dark()-Paare sind.

   `--accent-fg` bleibt eine eigene Groesse, wie in rcs: die Akzentflaeche ist
   ein helles Limettengruen und traegt dunklen Text. Eine dunkle Markenfarbe
   braeuchte helle Schrift, und ohne diese Trennung waere jeder Knopf unlesbar.
   ========================================================================== */
:root {
  --bg: var(--ax-colors-bg-page);
  --panel: var(--ax-colors-bg-default);
  --panel-2: var(--ax-colors-bg-secondary);
  --line: var(--ax-colors-border-default);
  --line-soft: var(--ax-colors-border-secondary);

  --text: var(--ax-colors-fg-default);
  --muted: var(--ax-colors-fg-secondary);
  --muted-2: var(--ax-colors-fg-tertiary);
  --disabled: var(--ax-colors-fg-disabled);

  --accent: var(--ax-colors-fg-link-default);
  --accent-bg: var(--ax-colors-bg-accent);
  --accent-fg: var(--ax-colors-fg-black);
  --accent-bg-hover: var(--ax-colors-bg-accent-hovered);
  --accent-subtle: var(--ax-colors-bg-accent-subtle);

  /* Marken-Intents nach Axiom: subtile Flaeche plus passender Rand. Dieselbe
     Auswahl wie in rcs.hikel.de, dort von Hand abgeschrieben, hier aus dem
     erzeugten Satz. `fg.error` -- nicht `fg.error.strong`: das strong-Token
     ist so dunkel, dass "Loeschen" im Aktionsmenue nicht mehr als rote
     Warnung liest, sondern als normaler Eintrag. */
  --success-text: var(--ax-colors-fg-success-strong);
  --bg-success-subtle: var(--ax-colors-bg-success-subtle);
  --border-success: var(--ax-colors-border-success);
  --warn-text: var(--ax-colors-fg-warning-strong);
  --bg-warning-subtle: var(--ax-colors-bg-warning-subtle);
  --border-warning: var(--ax-colors-border-warning);
  --danger: var(--ax-colors-fg-error);
  --danger-border: var(--ax-colors-border-error);
  --bg-error-subtle: var(--ax-colors-bg-error-subtle);
  --bg-neutral: var(--ax-colors-bg-message-neutral);
  --info: var(--ax-colors-fg-information-strong);
  --bg-info-subtle: var(--ax-colors-bg-information-subtle);
  --focus: var(--ax-colors-border-focus);

  --radius-sm: var(--ax-borderRadius-sm);
  --radius: var(--ax-borderRadius-md);
  --radius-lg: var(--ax-borderRadius-lg);
  --radius-full: var(--ax-borderRadius-full);
  --shadow-md: var(--ax-boxShadow-md);
  --shadow-lg: var(--ax-boxShadow-lg);
}

/* Abstands-Skala. Steckt nicht in den Theme-Tokens, sondern in Axioms
   Utility-Schicht: 0, 2, 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80 px. */
:root {
  --raum-2: 2px;  --raum-4: 4px;   --raum-6: 6px;   --raum-8: 8px;
  --raum-10: 10px; --raum-12: 12px; --raum-16: 16px; --raum-20: 20px;
  --raum-24: 24px; --raum-32: 32px; --raum-40: 40px; --raum-48: 48px;
  --raum-64: 64px;
}

* { box-sizing: border-box; }

/*
 * `hidden` muss staerker sein als jede eigene display-Regel. `button` steht
 * hier auf `inline-block` und `label` auf `block`; ohne diese Zeile blieben
 * versteckte Felder und Knoepfe sichtbar — auf der Anmeldeseite standen so
 * das Feld fuer den zweiten Faktor und beide Fusslinks gleichzeitig da.
 */
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ax-colors-bg-page);
  color: var(--ax-colors-fg-default);
  font-family: var(--ax-fontFamily-sans);
  font-size: var(--ax-fontSize-md-fontSize);
  line-height: var(--ax-fontSize-md-lineHeight);
  -webkit-font-smoothing: antialiased;
}

/* Link. Nur im Inhalt: die Navigation und alles mit `.knopf` sind zwar auch
   Anker, aber keine Links im Sinne des Design-Systems — ohne die Eingrenzung
   faerbte `:visited` den besuchten Navigationseintrag violett.
   Der Fokusring ist hier `2px auto` mit 1px Abstand und damit ein anderer als
   am Knopf (`2px solid`, 2px Abstand). Das ist kein Versehen von Axiom,
   sondern steht so im kompilierten CSS beider Bauteile. */
main a:not(.knopf) {
  position: relative;
  color: var(--ax-colors-fg-link-default);
  text-decoration: none;
}
main a:not(.knopf):visited { color: var(--ax-colors-fg-link-visited); }
main a:not(.knopf):focus-visible {
  outline: 2px auto var(--ax-colors-border-focus);
  outline-offset: 1px;
}
@media (hover: hover) {
  main a:not(.knopf):hover {
    color: var(--ax-colors-fg-link-default-hovered);
    text-decoration: underline;
  }
}

/* ---------------------------------------------------------------- Geruest */

/*
 * Aufbau und Masse 1:1 aus rcs.hikel.de, damit beide Anwendungen gleich
 * aussehen. Wo rcs von Axioms eigenen Bauteilen abweicht, steht das daneben —
 * die Abweichung ist dann eine Entscheidung fuer die Einheitlichkeit der
 * Hikel-Anwendungen, nicht ein Versehen.
 */

.app-shell { display: flex; min-height: 100vh; background: var(--bg); }

/* rcs: 232px, eingeklappt 64. Axioms Nav misst 224 / 56. */
.sidebar {
  width: 232px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width .14s ease;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .nav-header { flex-direction: column; gap: 8px; padding: 12px 8px; }
.sidebar.collapsed .sidebar-toggle { margin-left: 0; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-header-text,
.sidebar.collapsed .nav-group-trigger,
.sidebar.collapsed .konto-text { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-badge { display: none; }

.nav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}
.nav-header-text { display: flex; flex-direction: column; min-width: 0; }
.nav-header-text strong { font-size: 14px; }
.nav-header-text small {
  font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logo {
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-weight: 800;
  padding: 8px 10px;
  border-radius: var(--radius);
  letter-spacing: 1px;
}
/* Die Bedienelemente der Huelle sind KEINE gewoehnlichen Knoepfe.

   rcs stylt nur `.btn` und laesst `button` in Ruhe; hier gilt die Grundregel
   fuer jedes `button`, und die traegt `min-height: size.lg` und ein Polster.
   Der Umschalter ist als Quadrat von 22px entworfen und wurde dadurch zu
   einem 26x40 grossen Kasten -- dieselbe Zeichnung, ein anderes Bild. Was
   hier steht, nimmt die Grundregel fuer die Huelle zurueck. */
.sidebar-toggle {
  margin-left: auto;
  width: 22px; height: 22px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer;
  position: relative;
  flex: none;
}
.sidebar-toggle::before {
  content: "";
  position: absolute; inset: 4px auto 4px 6px;
  width: 2px;
  background: var(--muted);
}

.nav-body { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group-trigger {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 8px 10px 4px;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel-2); }
/* rcs markiert den aktiven Eintrag mit accent.subtle und halbfett.
   Axioms NavItem nimmt dafuer bg.default.pressed. */
.nav-item.active { background: var(--accent-subtle); font-weight: 600; }
.nav-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Das Icon traegt die Markierung mit, damit der aktive Eintrag auch bei
   eingeklappter Leiste erkennbar bleibt. */
.nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  flex: none;
  font-size: 18px;
  color: var(--muted);
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item:hover .nav-icon { color: var(--text); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-separator { border: none; border-top: 1px solid var(--line); margin: 10px 4px; }
.nav-badge {
  margin-left: auto;
  background: var(--accent-bg);
  color: var(--accent-fg);
  border-radius: var(--radius-full);
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}

.nav-footer { border-top: 1px solid var(--line); padding: 8px; position: relative; }
.nav-account-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px;
  border: none; border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--text);
}
.nav-account-item:hover { background: var(--panel-2); }
.konto-text { display: flex; flex-direction: column; min-width: 0; }
.konto-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.konto-text small { font-size: 11px; color: var(--muted); }
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex: none;
}
.konto-menu {
  position: absolute;
  bottom: 100%; left: 8px; right: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 20;
}
.konto-menu-item {
  display: block; width: 100%;
  padding: 8px 10px;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
  text-decoration: none;

  min-height: 0;
}
.konto-menu-item:hover { background: var(--panel-2); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 17px; margin: 0; font-family: var(--ax-fontFamily-heading); font-weight: 600; }
.topbar .sub { margin: 0; font-size: 13px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

main { padding: 22px; }

h2 {
  margin: 22px 0 10px;
  font-family: var(--ax-fontFamily-heading);
  font-size: var(--ax-fontSize-lg-fontSize);
  line-height: 1.3;
  font-weight: 600;
}
h3 { margin: 0 0 10px; font-size: var(--ax-fontSize-md-fontSize); font-weight: 600; }
.unter { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

/* --- Verwaltungslisten, Knoepfe und Datentabelle, 1:1 aus rcs --- */

.uebersicht-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.uebersicht-titel { margin: 0 0 2px; font-size: 18px; font-family: var(--ax-fontFamily-heading); font-weight: 600; }
.uebersicht-kopf .hint { margin: 0; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.hint.warnung { color: var(--warn-text); background: none; border: 0; padding: 0; }

.tpl-status { font-size: 12px; min-height: 16px; color: var(--muted); }
.tpl-status.ok { color: var(--success-text); }
.tpl-status.err { color: var(--danger); }

.admin-liste { display: flex; flex-direction: column; gap: 8px; }
.admin-aktionen { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-form {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.admin-form h3 { margin: 0 0 12px; font-size: 13px; }
.admin-form label { display: block; margin-bottom: 10px; }

.btn, .btn-ghost, .btn-primary {
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius);
  /* fontSize.md wie im Nachbarprojekt. Axiom schreibt am ButtonRoot keine
     Schriftgroesse fest — das hier ist Angleichung, kein Regelverstoss. */
  font-size: 14px;
  width: auto;
}
.btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 9px 14px; min-height: 40px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
/* bg.accent traegt dunklen Text — weiss waere darauf unlesbar (1,2:1). */
.btn-primary, button.haupt, .knopf.haupt {
  background: var(--accent-bg); border: 1px solid var(--accent-bg); color: var(--accent-fg);
  padding: 9px 16px; min-height: 40px;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-bg-hover); border-color: var(--accent-bg-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px dashed var(--line); color: var(--muted); padding: 6px 10px; min-height: 0; }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn-ghost.danger { color: var(--danger); border-color: var(--danger-border); }

/* --- Aktionsmenue --- */
.ax-menue { position: relative; flex: none; }
.ax-menue-knopf {
  border: 1px solid transparent; background: none; color: var(--muted);
  border-radius: var(--radius-sm); padding: 0 7px;
  font-size: 16px; line-height: 22px; min-height: 0; cursor: pointer;
}
.ax-menue-knopf:hover { border-color: var(--line); background: var(--panel-2); color: var(--text); }
.ax-menue-liste {
  position: absolute; right: 0; top: 26px; z-index: 30;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: flex; flex-direction: column;
}
.ax-menue-liste[hidden] { display: none; }
.ax-menue-eintrag {
  border: none; background: none; text-align: left;
  font: inherit; font-size: 13px;
  padding: 6px 9px; min-height: 0;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
}
.ax-menue-eintrag:hover { background: var(--accent-subtle); }
.ax-menue-eintrag.danger { color: var(--danger); }
.ax-actions .ax-menue-knopf { color: var(--muted); }
.ax-tr:hover .ax-actions .ax-menue-knopf,
.ax-actions .ax-menue-knopf:hover,
.ax-actions .ax-menue-knopf[aria-expanded="true"] { color: var(--text); }

/* --- Anmeldeseite, 1:1 aus rcs --- */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background: var(--bg);
}
.auth-karte {
  width: 100%; max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}
.auth-marke { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-marke h1 { font-size: 18px; margin: 0; font-family: var(--ax-fontFamily-heading); font-weight: 600; }
.auth-marke .sub { margin: 0; font-size: 12px; color: var(--muted); }
.auth-karte label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.auth-karte input { margin-top: 4px; }
.auth-knopf { width: 100%; margin-top: 6px; justify-content: center; }
.auth-fehler { color: var(--danger); font-size: 13px; min-height: 18px; display: none; margin-bottom: 4px; }
.auth-erfolg {
  display: none;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent-subtle);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}
.auth-fuss { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.auth-link {
  background: none; border: none; padding: 0;
  font: inherit; font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  width: auto; min-height: 0;
}
.auth-link:hover { color: var(--text); }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

/* ------------------------------------------------------------- Bausteine */

/* Card: borderRadius.lg. */
.karte {
  background: var(--ax-colors-bg-default);
  border: 1px solid var(--ax-colors-border-tertiary);
  border-radius: var(--ax-borderRadius-lg);
  padding: var(--raum-16);
  position: relative;
}

/* Table. Die Kopfzelle hat KEINE Flaeche: fg.tertiary und eine Trennlinie.
   Zellen richten oben aus und brechen im Wort — auch Zahlenspalten stehen
   am Anfang, das Referenzbeispiel von DataTable macht es genauso. */
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: var(--raum-8) var(--raum-10);
  text-align: start;
  font-size: var(--ax-fontSize-sm-fontSize);
  line-height: var(--ax-fontSize-sm-lineHeight);
  font-weight: 600;
  color: var(--ax-colors-fg-tertiary);
  border-bottom: 1px solid var(--ax-colors-border-tertiary);
}
tbody th, tbody td {
  padding: var(--raum-8) var(--raum-10);
  text-align: start;
  vertical-align: top;
  word-break: break-word;
}
tbody th { font-weight: 400; color: var(--ax-colors-fg-secondary); }
/* TableCell: die Trennlinie sitzt oben, ab der zweiten Zeile. */
tbody tr:not(:first-child) > * { border-top: 1px solid var(--ax-colors-border-tertiary); }
@media (hover: hover) {
  tbody tr:hover { background-color: var(--ax-colors-bg-default-hovered); }
}
.zahl { font-variant-numeric: tabular-nums; }

.mono, code {
  font-family: var(--ax-fontFamily-mono);
  font-size: var(--ax-fontSize-sm-fontSize);
}
.umbruch { word-break: break-all; }

/* --------------------------------------------------------- Eingabefelder */

label {
  display: block;
  margin-bottom: var(--raum-4);
  font-size: var(--ax-fontSize-sm-fontSize);
  line-height: var(--ax-fontSize-sm-lineHeight);
  color: var(--ax-colors-fg-secondary);
}

/* Input: bg.default, border.default, 1px, borderRadius.md. Im Fokus ein
   Ring aus border.focus mit 2px Abstand, und die Kante wird border.control. */
input, select, textarea {
  width: 100%;
  padding: var(--raum-6) var(--raum-10);
  background-color: var(--ax-colors-bg-default);
  border: 1px solid var(--ax-colors-border-default);
  border-radius: var(--ax-borderRadius-md);
  color: var(--ax-colors-fg-default);
  font-family: inherit;
  font-size: var(--ax-fontSize-md-fontSize);
  line-height: var(--ax-fontSize-md-lineHeight);
  min-height: var(--ax-size-lg);
}
input::placeholder, textarea::placeholder { color: var(--ax-colors-fg-tertiary); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ax-colors-border-focus);
  outline-offset: 2px;
  border-color: var(--ax-colors-border-control);
}
textarea { font-family: var(--ax-fontFamily-mono); font-size: var(--ax-fontSize-sm-fontSize); min-height: 120px; }
input[type="checkbox"] { width: auto; min-height: 0; }

/* ---------------------------------------------------------------- Knoepfe */

/* ButtonRoot: borderRadius.md, Fokusring 2px border.focus mit 2px Abstand.
   Die Vorgabe ist die stille Variante; `.haupt` traegt bg.accent — und darauf
   IMMER fg.black. Die Akzentfarbe ist ein helles Limettengruen, Weiss darauf
   waere unlesbar. */
button, .knopf {
  display: inline-block;
  width: auto;
  min-height: var(--ax-size-lg);
  padding: var(--raum-6) var(--raum-12);
  border: 1px solid var(--ax-colors-border-default);
  border-radius: var(--ax-borderRadius-md);
  background-color: var(--ax-colors-bg-default);
  color: var(--ax-colors-fg-default);
  font-family: var(--ax-fontFamily-sans);
  font-size: var(--ax-fontSize-md-fontSize);
  line-height: var(--ax-fontSize-md-lineHeight);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
@media (hover: hover) {
  button:hover, .knopf:hover { background-color: var(--ax-colors-bg-default-hovered); }
}
button:active, .knopf:active { background-color: var(--ax-colors-bg-default-pressed); }
button:focus-visible, .knopf:focus-visible {
  outline: 2px solid var(--ax-colors-border-focus);
  outline-offset: 2px;
  z-index: 10;
}
button.haupt, .knopf.haupt {
  background-color: var(--ax-colors-bg-accent);
  border-color: var(--ax-colors-bg-accent);
  color: var(--ax-colors-fg-black);
}
@media (hover: hover) {
  button.haupt:hover, .knopf.haupt:hover {
    background-color: var(--ax-colors-bg-accent-hovered);
    border-color: var(--ax-colors-bg-accent-hovered);
  }
}
button.haupt:active, .knopf.haupt:active {
  background-color: var(--ax-colors-bg-accent-pressed);
  border-color: var(--ax-colors-bg-accent-pressed);
}
button[disabled], .knopf[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.32;                                       /* NavItem[data-disabled] */
  pointer-events: none;
}

/* ------------------------------------------------------------- Meldungen */

/* Alert und Banner: min-height size.sm, die Farbpaare aus Badge —
   je eine gedaempfte Flaeche und die kraeftige Schrift dazu. */
.hinweis, .warnung, .fehler {
  min-height: var(--ax-size-sm);
  margin: var(--raum-10) 0 0;
  padding: var(--raum-10) var(--raum-12);
  border-radius: var(--ax-borderRadius-md);
  font-size: var(--ax-fontSize-md-fontSize);
  line-height: var(--ax-fontSize-md-lineHeight);
}
.hinweis {
  background-color: var(--ax-colors-bg-information-subtle);
  color: var(--ax-colors-fg-information-strong);
}
.warnung {
  background-color: var(--ax-colors-bg-warning-subtle);
  color: var(--ax-colors-fg-warning-strong);
}
.fehler {
  background-color: var(--ax-colors-bg-error-subtle);
  color: var(--ax-colors-fg-error-strong);
}

.marke-gut { color: var(--ax-colors-fg-success-strong); }
.marke-warn { color: var(--ax-colors-fg-warning-strong); }
.marke-fehler { color: var(--ax-colors-fg-error-strong); }

.leer { padding: var(--raum-4) 0; color: var(--ax-colors-fg-tertiary); }

/* --------------------------------------------------------------- Anordnung */

.reihe { display: flex; gap: var(--raum-10); flex-wrap: wrap; align-items: end; }
.wachsen { flex: 1 1 200px; }

/* Grid: 16px Vorgabe-Abstand. Ganze Zahlen, deshalb repeat(...). */
.kennzahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--raum-16);
}
.kennzahlen div {
  background: var(--ax-colors-bg-default);
  border: 1px solid var(--ax-colors-border-tertiary);
  border-radius: var(--ax-borderRadius-lg);
  padding: var(--raum-12) var(--raum-16);
}
.kennzahlen b {
  display: block;
  font-family: var(--ax-fontFamily-heading);
  font-size: var(--ax-fontSize-xl-fontSize);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kennzahlen small {
  color: var(--ax-colors-fg-secondary);
  font-size: var(--ax-fontSize-sm-fontSize);
  line-height: var(--ax-fontSize-sm-lineHeight);
}

/* Progress ist bei Axiom ein Balken mit borderRadius.full. */
.balken {
  display: flex;
  height: var(--ax-size-sm);
  border-radius: var(--ax-borderRadius-full);
  overflow: hidden;
  background-color: var(--ax-colors-bg-secondary);
}
.balken span { display: block; min-width: 0; }
.legende {
  display: flex; gap: var(--raum-16); flex-wrap: wrap;
  margin-top: var(--raum-10);
  font-size: var(--ax-fontSize-sm-fontSize);
  line-height: var(--ax-fontSize-sm-lineHeight);
  color: var(--ax-colors-fg-secondary);
}
.punkt {
  display: inline-block; width: 10px; height: 10px;
  border-radius: var(--ax-borderRadius-xs);
  margin-right: var(--raum-6);
}

/* Code-Block. Axioms `Code` ist einzeilig und setzt Backticks davor und
   dahinter — fuer einen mehrzeiligen Block gibt es dort nichts, deshalb ist
   das hier eine eigene Entscheidung auf Axioms Werten. */
pre {
  margin: 0;
  overflow-x: auto;
  padding: var(--raum-12);
  background-color: var(--ax-colors-bg-secondary);
  border-radius: var(--ax-borderRadius-md);
  font-family: var(--ax-fontFamily-mono);
  font-size: var(--ax-fontSize-sm-fontSize);
  line-height: var(--ax-fontSize-sm-lineHeight);
}

/* --------------------------------------------------------- Haltepunkte */
/* Genau zwei, und beide sind Axioms: sm 37.5rem, md 56.25rem. */

@media screen and (max-width: 37.5rem) {
  .sidebar { width: 64px; }
  .sidebar .nav-label, .sidebar .nav-header-text,
  .sidebar .nav-group-trigger, .sidebar .konto-text { display: none; }
  .sidebar .nav-item { justify-content: center; }
  main { padding: 16px; }
  .topbar { padding: 12px 16px; }
}

/* Die Regeln zu `.ax-menue` stehen oben; hier folgen Tabelle und Marke --
   wortgleich aus rcs.hikel.de, damit beide Verwaltungsseiten dasselbe Bild
   ergeben. Einziger Unterschied: `bg.information.subtle` steht drueben als
   fester Wert #E2F5F5 und hier als Token, das im dunklen Modus mitgeht. */
/* --- DataTable -----------------------------------------------------------
   Anatomie: DataTable > DataTableBody (Zeilen, Zellen, DataTableAction) >
   DataTableFooter. Kopfzeile klebt, Zeilen gleich hoch, Aktionen erscheinen
   beim Ueberfahren. */
.ax-table {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  /* Breite Tabellen scrollen in sich, nicht die Seite. rcs braucht das nicht
     -- dort hat keine Tabelle mehr als drei Spalten. Hier hat die
     Mandantenliste sechs, und ohne diese Zeile schob die schmalste Spalte die
     ganze Seite nach rechts: `document.scrollWidth` stand auf 1337 bei 1280
     Fensterbreite, mit einem waagerechten Balken unter allem. */
  overflow-x: auto;
}
/* Nicht die Tabelle beschneiden -- sonst faellt das Aktionsmenue der letzten
   Zeile heraus. Die Rundung tragen Kopf und letzte Zeile selbst. */
.ax-table-head { border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; }
.ax-tr:last-child { border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px); }
.ax-table-head,
.ax-tr {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}
.ax-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 38px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.ax-th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}
.ax-tr {
  min-height: 46px;
  border-bottom: 1px solid var(--line);
}
.ax-tr:last-child { border-bottom: none; }
.ax-tr:hover { background: var(--panel-2); }
.ax-tr.gedimmt { opacity: .55; }
.ax-td { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.ax-td-stark { font-weight: 600; }
/* Zweite Zeile in einer Zelle: was zum Namen gehoert, aber keine eigene
   Spalte verdient -- die Absenderdomain unter dem Mandantennamen. */
.ax-td-unter { display: block; font-size: 12px; color: var(--muted); }
/* Axiom schreibt `end`, nicht `right` -- und laesst im DataTable-Beispiel
   selbst die Betragsspalte am Anfang stehen. `end` geht ausserdem mit der
   Schreibrichtung mit. */
.ax-th.rechts, .ax-td.rechts { text-align: end; }

/* DataTableAction: in jeder Zeile ein Menue, immer sichtbar. Es war frueher
   bis zum Ueberfahren unsichtbar -- bei einer Knopfreihe eine gute Idee, bei
   einem einzelnen Punkte-Knopf aber nur eine versteckte Funktion. Ruhig
   bleibt die Tabelle jetzt durch die gedaempfte Farbe. */
.ax-actions {
  display: flex;
  /* Axioms Props kennen start | end | center | stretch -- kein flex-end. */
  justify-content: end;
}

.ax-table-leer { padding: 20px 14px; font-size: 13px; color: var(--muted); text-align: center; }
.ax-table-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 11px;
  color: var(--muted);
}

/* Badge nach Axiom: Variante `subtle`, Intents neutral/information/
   success/warning/danger. Ohne Intent ist es neutral. */
.ax-marke {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 1px 9px;
  font-size: 11px;
  background: var(--bg-neutral);
  color: var(--text);
}
.ax-marke.success { background: var(--bg-success-subtle); border-color: var(--border-success); color: var(--success-text); }
.ax-marke.warning { background: var(--bg-warning-subtle); border-color: var(--border-warning); color: var(--warn-text); }
.ax-marke.danger  { background: var(--bg-error-subtle); border-color: var(--danger-border); color: var(--danger); }
.ax-marke.information { background: var(--bg-info-subtle); border-color: var(--info); color: var(--info); }

/* Auf schmalen Schirmen wird die Tabelle waagerecht scrollbar, statt die
   Spalten zu zerquetschen. */
@media (max-width: 720px) {
  .ax-table { overflow-x: auto; }
  .ax-table-head, .ax-tr { min-width: 640px; }
  .ax-actions { opacity: 1; }
}

/* --- Passwort kurz einblenden -------------------------------------------- */
/* Aus rcs.hikel.de uebernommen (styles.css, "Passwort kurz einblenden").
   Der Knopf liegt IM Feld, nicht daneben: daneben rutscht er im schmalen
   Fenster in die naechste Zeile und steht dann unter etwas, zu dem er nicht
   mehr sichtbar gehoert. */
.pw-huelle { position: relative; display: block; width: 100%; }
.pw-huelle input { width: 100%; padding-right: 40px; }
.pw-auge {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  /* Lesedauers Knopfregel setzt eine Mindesthoehe -- die sprengt hier das
     Feld. rcs hat sie nicht und braucht die Zeile deshalb nicht. */
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.pw-auge:hover { color: var(--text); background: var(--panel-2); }
.pw-auge:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* Im Formular sitzt das Feld unter seiner Beschriftung -- die Huelle darf den
   Abstand darunter nicht schlucken. */
label > .pw-huelle { margin: 0; }

/* --- Hilfe ---------------------------------------------------------------- */
/* Aus rcs.hikel.de uebernommen. Eine Schublade rechts: sie nimmt der
   Arbeitsflaeche Platz weg, statt sie zu verdecken -- man soll waehrend des
   Lesens weiterarbeiten koennen. */
.hilfe-knopf {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}
.hilfe-knopf:hover,
.hilfe-knopf[aria-expanded="true"] {
  border-color: var(--accent); color: var(--accent); background: var(--accent-subtle);
}

.hilfe-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100vh;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 20px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hilfe-panel[hidden] { display: none; }
/* Der Inhalt rueckt zur Seite, statt ueberdeckt zu werden. */
body.hilfe-offen .app-shell { padding-right: 380px; }
@media (max-width: 900px) { body.hilfe-offen .app-shell { padding-right: 0; } }

.hilfe-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hilfe-titel { margin: 0; font-size: 15px; }
.hilfe-zu {
  border: none; background: none; color: var(--muted);
  font-size: 15px; line-height: 1; min-height: 0; padding: 4px 6px;
  border-radius: var(--radius-sm); cursor: pointer;
}
.hilfe-zu:hover { background: var(--panel-2); color: var(--text); }
.hilfe-suche { width: 100%; }
.hilfe-inhalt { overflow-y: auto; padding-right: 4px; }

.hilfe-seite + .hilfe-seite { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.hilfe-seite h3 { margin: 4px 0 6px; font-size: 15px; }
.hilfe-seite h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hilfe-seite p, .hilfe-seite li { font-size: 13px; line-height: 1.55; }
.hilfe-wozu { margin: 0 0 10px; color: var(--text); }
.hilfe-seite ol, .hilfe-seite ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.hilfe-achtung li::marker { color: var(--warn-text); }
.hilfe-seite code {
  font-family: var(--ax-fontFamily-mono, ui-monospace, monospace);
  font-size: 12px; background: var(--panel-2); border-radius: var(--radius-sm); padding: 1px 4px;
}
.hilfe-weiter { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.hilfe-link {
  border: none; background: none; padding: 0; min-height: 0;
  font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline;
}
.hilfe-bild {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 4px 0 12px;
  /* Die Bilder sind 948 px breit und werden auf ~348 px heruntergerechnet;
     ohne diese Zeile faerbt der Browser den letzten Pixel der Kante mit ein
     und die Umrandung sieht doppelt aus. */
  display: block;
}
.hilfe-bild { cursor: zoom-in; }
/* Das vergroesserte Bild ueber allem -- auch ueber dem Panel (z-index 40). */
.hilfe-gross {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  /* Axioms eigenes Token fuer die Flaeche hinter einem Modal. */
  background: var(--ax-colors-bg-overlay);
  cursor: zoom-out;
}
.hilfe-gross img {
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--panel);
}
