/* Gestaltung des Hub-Portals nach dem Mockup (Main.dc.html): Eisblau/Flieder-Hintergrund, runde Formen, Schrift Host
   Grotesk (eingecheckt, OFL) mit system-ui als Rückfall, Ziffern tabellarisch. Die Ampel ist die einzige Signalfarbe.
   Keine Stile in den Vorlagen (CSP ohne unsafe-inline): alles steht hier oder in den Stildateien der Apps. */

@font-face {
  font-family: "Host Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("vendor/host-grotesk-5.3.0/host-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Host Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("vendor/host-grotesk-5.3.0/host-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Host Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("vendor/host-grotesk-5.3.0/host-grotesk-latin-600-normal.woff2") format("woff2");
}

:root {
  --grund: #f8f9fc;
  --eisblau: #d9e8f6;
  --flieder: #e6e0f7;
  --text: #223037;
  --nebentext: #606b71;
  --text-ruhig: #454c50;
  --dunkel: #232323;
  --linie: rgba(34, 48, 55, 0.12);
  --linie-fein: rgba(34, 48, 55, 0.08);
  --glas: rgba(255, 255, 255, 0.72);
  --schatten: 0 8px 32px rgba(34, 48, 55, 0.08);
  --fokus: #4b5ba8;
  --rot: #b42318;
  --rot-grund: #fde7e4;
  --gelb: #8a5a00;
  --gelb-grund: #fff0c9;
  --gruen: #1f6b3a;
  --gruen-grund: #e2f3e7;
  --neutral: #3f4b57;
  --neutral-grund: #e6ebef;
  /* Farbe als Signal in der rechten Spalte der Fallansicht (Entwurf C, Design 2026-11-19 §4.3). Kontrast gemessen: Schrift auf
     Kachel, Karte und Aufgabenzeile mindestens 4,5 : 1; Streifen (Schmuck) gegen --grund mindestens 3 : 1 (#e0a100 aus dem
     Entwurf hat nur 2,2 : 1, deshalb das dunklere Gelb). */
  --kachel-grund: #eef3fa;     /* heller als --eisblau */
  --aufgabe-grund: #fffaf0;
  --aufgabe-linie: #f1d58a;
  --sperre-grund: #fff5f3;     /* heller als --rot-grund */
  --sperre-linie: var(--rot);
  --streifen-rot: var(--rot);
  --streifen-gelb: #b87d00;
  --streifen-gruen: var(--gruen);
  --streifen-neutral: var(--neutral);
  --fokus-dunkel: #3a4891;     /* Hauptknopf beim Überfahren (blau) */
  --rot-dunkel: #8f1a10;       /* „Fall ablehnen“ beim Überfahren */
}

*, *::before, *::after { box-sizing: border-box; }

html { background-color: var(--grund); }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--grund);
  background-image:
    radial-gradient(900px 460px at 12% -120px, var(--eisblau) 0%, rgba(217, 232, 246, 0) 70%),
    radial-gradient(820px 420px at 92% -100px, var(--flieder) 0%, rgba(230, 224, 247, 0) 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: "Host Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

a { color: var(--text); }
a:hover { color: var(--fokus); }

:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }

h1 { margin: 14px 0 0; font-size: 48px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; }
h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }

/* nur für Vorleser sichtbar */
.unsichtbar {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Sprunglink: erst bei Fokus sichtbar (Tastatur) */
.sprunglink {
  position: absolute; left: 16px; top: -100px; z-index: 20; padding: 10px 18px; border-radius: 100px;
  background: var(--dunkel); color: #ffffff; font-weight: 500; text-decoration: none;
}
.sprunglink:focus { top: 8px; }
#hauptbereich:focus { outline: none; }
.produktname { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--nebentext); }

/* ---------------------------------------------------------------- Rahmen */
.seite { max-width: 1296px; margin: 0 auto; padding: 40px 32px 32px; }
.seite-schmal { max-width: 640px; margin-top: 48px; }

.karte {
  background: var(--glas);
  border: 1px solid #ffffff;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), var(--schatten);
}
.seite-schmal.karte { padding: 32px; }
.seite-schmal h1 { font-size: 32px; margin-top: 0; }

/* Kopfleiste, Banner und Fußzeile stehen auf allen Seiten gleich breit: Fensterbreite minus 24 px je Seite, ohne Höchstbreite.
   Nur der Hauptbereich (`.seite`) bleibt höchstens 1296 px breit und mittig (Spec 2026-11-19 §4.4). */
.kopf-rahmen { position: sticky; top: 0; z-index: 5; padding: 16px 24px 0; }

.kopfleiste {
  margin: 0; min-height: 56px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 6px 8px 6px 24px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 100px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 8px 32px rgba(34, 48, 55, 0.1);
}

.marke { font-weight: 500; font-size: 18px; letter-spacing: -0.03em; text-decoration: none; }

.mandant-pille {
  min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--linie); border-radius: 100px; font-weight: 500;
}

/* Mandantenauswahl (Menü-Knopf, Spec 12 §10.3): der Knopf ist die Pille; das Menü liegt darunter. Ein Mandant: Pille nur als Text. */
.mandant-wahl { position: relative; }
.mandant-knopf { gap: 8px; min-height: 44px; font: inherit; font-weight: 500; color: inherit; cursor: pointer; }
.mandant-knopf:hover { background: #ffffff; }
.mandant-pfeil { flex: none; color: var(--nebentext); }
.mandant-menue {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; min-width: 100%; width: max-content; max-width: min(360px, calc(100vw - 32px));
  margin: 0; padding: 6px; list-style: none;
  background: rgba(255, 255, 255, 0.97); border: 1px solid var(--linie); border-radius: 20px; box-shadow: 0 8px 32px rgba(34, 48, 55, 0.16);
}
.mandant-menue[hidden] { display: none; }
.mandant-eintrag {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 14px 4px 10px; border-radius: 14px;
  color: var(--text); text-decoration: none; overflow-wrap: anywhere;
}
.mandant-eintrag:hover, .mandant-eintrag:focus-visible { background: var(--eisblau); color: var(--text); }
.mandant-eintrag[aria-current="true"] { font-weight: 600; }
.mandant-haken { flex: none; width: 1.2em; text-align: center; color: var(--gruen); }
.mandant-eintrag .mandant-name { flex: 1 1 auto; }
.mandant-rolle { flex: none; margin-left: auto; padding-left: 12px; font-size: 13px; font-weight: 400; color: var(--nebentext); }
.konto-rolle { margin-left: 8px; color: var(--nebentext); font-size: 14px; }
.mandant-ohne-js { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }

.navigation { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 300px; justify-content: center; }
.nav-eintrag {
  display: flex; align-items: center; gap: 8px; padding: 0 18px; min-height: 44px; border-radius: 100px;
  color: var(--nebentext); font-weight: 500; text-decoration: none;
}
.nav-eintrag:hover { color: var(--text); background: rgba(255, 255, 255, 0.6); }
.nav-aktiv, .nav-aktiv:hover { background: var(--dunkel); color: #ffffff; }
.nav-zahl { background: rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 0 8px; font-size: 12px; }
.nav-eintrag:not(.nav-aktiv) .nav-zahl { background: var(--linie-fein); }
.nav-gesperrt { color: var(--nebentext); cursor: not-allowed; }
.nav-firmen-ki::after { content: " \2197"; }  /* Pfeil: der Verweis öffnet einen neuen Tab */
.nur-lesehilfe { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.person { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; font-size: 13px; }
.person-konto { font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.abmelden form { margin: 0; }

/* ---------------------------------------------------------------- Knöpfe und Felder */
.knopf {
  min-height: 44px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--dunkel); color: #ffffff; border: 0; border-radius: 100px;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  box-shadow: 0 9px 16px -6px rgba(0, 0, 0, 0.25);
}
.knopf:hover { color: #ffffff; background: #000000; }
.knopf-hell { background: #ffffff; color: var(--text); border: 1px solid rgba(34, 48, 55, 0.14); box-shadow: none; }
.knopf-hell:hover { background: #ffffff; color: var(--fokus); }

.feld {
  min-height: 44px; padding: 0 16px; font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--linie); border-radius: 100px;
}

input[type="email"], input[type="password"], input[type="text"] {
  min-height: 44px; padding: 0 16px; font: inherit; color: var(--text); width: 100%;
  background: #ffffff; border: 1px solid var(--linie); border-radius: 14px;
}
.seite-schmal button { min-height: 44px; padding: 0 20px; border-radius: 100px; border: 0; font: inherit; font-weight: 500;
  background: var(--dunkel); color: #ffffff; cursor: pointer; }

/* ---------------------------------------------------------------- Ampel (einzige Signalfarbe; immer Text und Symbol) */
.ampel {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 10px; border-radius: 100px;
  font-weight: 500; white-space: nowrap;
}
.ampel svg { flex: none; }
.ampel-rot { color: var(--rot); background: var(--rot-grund); }
.ampel-gelb { color: var(--gelb); background: var(--gelb-grund); }
.ampel-gruen { color: var(--gruen); background: var(--gruen-grund); }
.ampel-stichprobe { color: var(--neutral); background: var(--neutral-grund); }
.ampel-ohne { color: var(--nebentext); background: rgba(34, 48, 55, 0.05); }

/* ---------------------------------------------------------------- Betriebshinweise (Banner unter der Navigation) */
.banner {
  margin: 16px 24px 0; padding: 12px 20px;
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255, 255, 255, 0.85); border: 1px solid var(--linie); border-radius: 20px; color: var(--text);
}
.banner-symbol { flex: none; margin-top: 3px; color: var(--neutral); }
.banner-liste { margin: 0; padding: 0; list-style: none; font-weight: 500; }
.banner-erklaerung { display: block; font-weight: 400; color: var(--text-ruhig); }

/* ---------------------------------------------------------------- Seite Über / Versionen (nur Plattform-Admin) */
.ueber-karte { padding: 20px 28px; margin-bottom: 20px; }
.ueber-karte h2 { margin-top: 0; }
.ueber-liste { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.ueber-liste dt { color: var(--nebentext); }
.ueber-liste dd { margin: 0; overflow-wrap: anywhere; }
.ueber-tabelle { width: 100%; border-collapse: collapse; }
.ueber-tabelle th, .ueber-tabelle td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--linie); overflow-wrap: anywhere; }
.hinweis-kasten { padding: 10px 16px; border-radius: 16px; background: var(--neutral-grund); color: var(--text); font-weight: 500; }
.hinweis-gut { background: var(--gruen-grund); color: var(--gruen); }
.hinweis-warnung { background: var(--gelb-grund); color: var(--gelb); }

/* ---------------------------------------------------------------- Fußzeile mit Version (Seitenrahmen angemeldeter Personen) */
.fusszeile a { display: inline-flex; align-items: center; min-height: 44px; }
.fusszeile { margin: 0; padding: 0 24px 32px; font-size: 13px; color: var(--nebentext); }

/* ---------------------------------------------------------------- Seitenraster (Fallansicht, Spec 12 §4.1)
   `body.seite-voll` (Block `body_attribute` in base.html; nur die Fallseite): Kopfleiste, Banner, Hauptbereich und Fußzeile stehen
   untereinander, der Hauptbereich nimmt den Rest der Höhe (`flex: 1; min-height: 0`), kein fester Abzug: Banner und ein
   umbrechender Titel passen sich von selbst an. Die Seite scrollt auf breiten Bildschirmen nicht; schmal und niedrig (Handy,
   Fenster unter 560 px Höhe) bleibt es eine gewöhnliche, scrollende Seite. */
body.seite-voll .seite { padding-top: 12px; padding-bottom: 8px; }
@media (min-width: 960px) and (min-height: 560px) {
  body.seite-voll { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  body.seite-voll > .kopf-rahmen, body.seite-voll > .banner, body.seite-voll > .fusszeile { flex: none; }
  body.seite-voll .kopf-rahmen { padding: 12px 24px 0; }
  body.seite-voll .banner { margin: 8px 24px 0; padding: 8px 16px; }
  body.seite-voll > .seite {
    flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; max-width: none; margin: 0; padding: 4px 24px 4px;
  }
  body.seite-voll .fusszeile { margin: 0; padding: 2px 24px 6px; line-height: 1.4; }
  /* Konflikt- und Fehlerseiten ersetzen per HTMX den Hauptbereich (kein `#fall-raster` mehr) und können höher sein als das Fenster:
     dann scrollt der Hauptbereich selbst. Die Fallansicht (mit Raster) bleibt fest, die Seite scrollt dort nie. */
  body.seite-voll > .seite:not(:has(#fall-raster)) { overflow-y: auto; }
}

/* Mittlere Breiten (Laptop 1366 px): alle Menüpunkte (auch DATEV-Login, Betreiber, Firmen-KI) bleiben in einer Zeile. Enger werden nur
   die Abstände, nie die Schrift; die Ziele bleiben 44 px hoch. */
@media (min-width: 721px) and (max-width: 1599px) {
  .kopfleiste { column-gap: 12px; }
  .navigation { gap: 2px; }
  .nav-eintrag { padding: 0 10px; }
}

@media (max-width: 720px) {
  .kopf-rahmen { padding: 8px 8px 0; }
  .kopfleiste { border-radius: 24px; padding: 8px 12px; }
  .mandant-wahl { position: static; }  /* das Menü richtet sich nach der Kopfleiste (backdrop-filter), nicht nach der Pille */
  .mandant-menue { left: 8px; right: 8px; width: auto; max-width: none; }
  .seite { padding: 24px 16px; }
  h1 { font-size: 36px; }
  .banner { margin: 12px 8px 0; }
  .fusszeile { padding: 0 16px 24px; }
}

/* Reiterleiste (Statistik, Einstellungen): eine Zeile Pillen ohne Rahmen um die Leiste; schmal umbrechen. Eigener Klassenname,
   weil `.reiter` in invoice/fall.css die Reiterknöpfe der Fallansicht meint (Rahmen, Radius, höchstens 24em) und auf Seiten, die
   fall.css laden, sonst die ganze Leiste einrahmt. Aktiver Reiter fett und unterstrichen (Farbe trägt nie allein die Bedeutung). */
.reiter-leiste { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0 8px; padding: 0; border: 0; background: none; max-width: none; }
.reiter-eintrag {
  min-height: 44px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 100px;
  border: 1px solid var(--linie); background: rgba(255, 255, 255, 0.6); color: var(--text); font-weight: 500; text-decoration: none;
}
.reiter-eintrag:hover { background: #ffffff; color: var(--fokus); }
.reiter-aktiv, .reiter-aktiv:hover {
  background: var(--dunkel); color: #ffffff; border-color: var(--dunkel); font-weight: 600;
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px;
}

/* Fragefelder (W5 Teil 2 Task 15, core/_fragefeld.html): Antwort als reiner Text, Zeilen über white-space, nie HTML. */
.fragefeld-karte, .fragefeld-seite { padding: 20px 24px; }
.fragefeld-karte { margin-top: 20px; }
.fragefeld-titel { margin: 0 0 6px; font-size: 18px; font-weight: 500; }
.fragefeld-formular { display: grid; gap: 6px; margin-top: 8px; }
.fragefeld-label { font-weight: 500; }
.fragefeld-eingabe { width: 100%; min-height: 64px; resize: vertical; font: inherit; }
.fragefeld-formular .knopf { justify-self: start; }
.fragefeld-status, .fragefeld-meldung, .fragefeld-weiter { margin: 8px 0 0; }
.fragefeld-meldung { font-weight: 500; }
.fragefeld-eingabe-hinweis, .fragefeld-hinweis, .fragefeld-herkunft, .fragefeld-hinweiszeile, .fragefeld-kennzeichen, .fragefeld-laden {
  margin: 4px 0 0; font-size: 13px; color: var(--text-ruhig);
}
.fragefeld-laden { display: none; }
.fragefeld-formular.htmx-request .fragefeld-laden { display: block; }
.fragefeld-antwort { margin-top: 12px; padding: 12px 16px; border-radius: 16px; background: var(--neutral-grund); }
.fragefeld-text { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.fragefeld-zurueck { margin: 0 4px 12px; }
@media (max-width: 720px) { .fragefeld-karte, .fragefeld-seite { padding: 16px; } }
