/* Bausteine der Oberfläche nach docs/gestaltung.md, Fassung 3, und dem Entwurf
   docs/oberflaeche/index.html, Fassung 3 (Plan Schritt 18a).
   Farben nur als Variablen aus gestaltung.css (PL-39). Jede Regel mit heller
   Schrift nennt ihre Grundfarbe selbst, damit der Kontrast nach PL-40 an der
   Regel nachrechenbar ist. Die Schrift Inter liegt noch nicht im Repository;
   bis dahin gilt die Ersatzschrift Arial, danach system-ui (docs/gestaltung.md,
   Abschnitt Schrift). Kein Abruf aus dem Internet. */

:root {
  --schrift: "Inter", Arial, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--seite); color: var(--text); font: 400 14px/1.45 var(--schrift); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
a { color: var(--quelle); }
.zahl, table { font-variant-numeric: tabular-nums; }

/* Fokusrahmen bei Bedienung mit der Tastatur (PL-51) */
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
/* In der Kopfleiste ist der Fokusrahmen --schrift-hell, weil --petrol auf
   --nachtblau unter 3:1 bleibt (docs/gestaltung.md, Fassung 4). Der Test zu
   PL-40 rechnet den Rahmen gegen --nachtblau und gegen --kopf-gewaehlt über
   --nachtblau, gleich welche Grundfarbe die Regel nennt. Die Regel setzt den
   Grund --nachtblau; der gewählte Eintrag der Navigation behält seinen Grund,
   weil seine Regel spezifischer ist. */
.kopfleiste :focus-visible { outline-color: var(--schrift-hell); background-color: var(--nachtblau); }

.sprung { position: absolute; left: -9999px; top: 8px; padding: 8px 12px; border-radius: 9px; z-index: 30;
  background: var(--karte); color: var(--nachtblau); }
.sprung:focus { left: 8px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopfleiste */
.kopfleiste { background: var(--nachtblau); color: var(--kopf-text); }
.kopfleiste-innen { max-width: 1360px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center;
  gap: 20px; flex-wrap: wrap; }
.marke-app { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none;
  background: var(--nachtblau); color: var(--schrift-hell); }
.zeichen-app { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700;
  font-size: 15px; background: var(--petrol); color: var(--schrift-hell); }
.name-app { font-size: 15px; font-weight: 700; line-height: 1.2; }
.kopfleiste .nebenzeile { display: block; font-size: 12px; font-weight: 400;
  background: var(--nachtblau); color: var(--kopf-leise); }
.navigation { display: flex; gap: 4px; }
.navigation a { text-decoration: none; font: 600 13px var(--schrift); padding: 0 12px; min-height: 44px;
  display: inline-flex; align-items: center; border-radius: 9px;
  background-color: var(--nachtblau); color: var(--kopf-text); }
.navigation a[aria-current="page"] { background-color: var(--kopf-gewaehlt); color: var(--schrift-hell); }
/* Angemeldetes Konto und Abmelden (Umsetzungsschritt A2 des PoC, PO-18) */
.konto { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.konto-name { font-size: 13px; font-weight: 600; background: var(--nachtblau); color: var(--kopf-text); }
.abmelden { margin: 0; }
.knopf-kopf { background: var(--nachtblau); color: var(--schrift-hell); border: 1px solid var(--kopf-leise); }
.knopf-kopf:hover { background: var(--kopf-gewaehlt); color: var(--schrift-hell); }

/* Fußzeile mit der Fassung der Software (PO-21) */
.fusszeile { border-top: 1px solid var(--linie); background: var(--seite); color: var(--text-leise); }
.fusszeile-innen { max-width: 1360px; margin: 0 auto; padding: 12px 24px; font-size: 12px; }

/* Seite */
.seite { max-width: 1360px; margin: 0 auto; padding: 20px 24px 80px; display: grid; gap: 16px; }
.brotkrumen { font-size: 12px; color: var(--text-leise); display: flex; gap: 6px; flex-wrap: wrap; }
.brotkrumen a { color: var(--quelle); }
.seitenkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.augenbraue { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-leise); margin-bottom: 4px; }
.seitenkopf h1 { font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--nachtblau); }
.zusammenhang { color: var(--text-leise); margin-top: 4px; }
.handlungen { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* Knöpfe und Eingaben */
.knopf { min-height: 44px; border-radius: 9px; padding: 0 16px; font: 600 13px var(--schrift); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.knopf-haupt { background: var(--petrol); color: var(--schrift-hell); border: 1px solid var(--petrol); }
.knopf-haupt:hover { background: var(--petrol-dunkel); border-color: var(--petrol-dunkel); }
.knopf-neben { background: var(--karte); color: var(--nachtblau); border: 1px solid var(--linie-kraeftig); }
.knopf-neben:hover { border-color: var(--nachtblau); }
.formular { display: grid; gap: 12px; }
.feld { display: grid; gap: 4px; align-content: start; }
.feld label { font-size: 12px; font-weight: 600; color: var(--text); }
input, select, textarea { min-height: 44px; border: 1px solid var(--rand-eingabe); border-radius: 9px;
  padding: 8px 10px; font: 400 14px var(--schrift); background: var(--karte); color: var(--text); }
textarea { min-height: 72px; resize: vertical; }
.fehlertext { color: var(--rot); font-size: 13px; font-weight: 600; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--rot); font-size: 13px; font-weight: 600; }
.zeilen { display: grid; gap: 8px; }
.zeile-wertetabelle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* Statusmarken und Quellmarken; jede Marke trägt Wort und Zeichen (PL-39) */
.statusmarke { display: inline-flex; align-items: center; gap: 5px; border-radius: 8px; padding: 2px 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap; }
.statusmarke .zeichen { font-size: 11px; }
.s-fehler { background: var(--rot-hell); color: var(--rot); }
.s-fehler .zeichen { color: var(--rot-zeichen); }
.s-warnung { background: var(--ocker-hell); color: var(--ocker); }
.s-warnung .zeichen { color: var(--ocker-zeichen); }
.s-ok { background: var(--gruen-hell); color: var(--gruen); }
.s-ok .zeichen { color: var(--gruen-zeichen); }
.s-hinweis { background: var(--quelle-hell); color: var(--quelle); }
.s-hinweis .zeichen { color: var(--quelle); }
.quellmarke { display: inline-block; font-size: 12px; border-radius: 6px; padding: 1px 6px; margin: 2px 4px 0 0;
  background: var(--quelle-hell); color: var(--quelle); }
.marken { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Karten und Meldungen */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; padding: 16px 18px;
  display: grid; gap: 10px; }
.karte h2 { font-size: 16px; font-weight: 700; color: var(--nachtblau); }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nebentext { font-size: 12px; color: var(--text-leise); }
.statusmeldung { border-radius: 14px; padding: 12px 16px; border: 1px solid var(--petrol-rand);
  background: var(--petrol-zart); color: var(--nachtblau); }
.hinweiskasten { border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 12px;
  align-items: start; border: 1px solid var(--rot-rand); background: var(--karte); color: var(--text); }
.hinweiskasten .zeichen { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; background: var(--rot-hell); color: var(--rot-zeichen); }
.hinweiskasten h2 { font-size: 15px; font-weight: 700; color: var(--nachtblau); }

/* Listen und Blättern (PL-44) */
.liste { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bestellkarte h2 { font-size: 18px; }
.bestellkarte .unten { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.blaettern { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Tabellen */
.tabellenrahmen { overflow-x: auto; border: 1px solid var(--linie); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; background: var(--karte); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linie-fein); vertical-align: top; }
th { font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--seite); color: var(--text-leise); }

/* Zusammenfassung der Bestellung */
.kopfdaten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.kopfdaten div { display: grid; gap: 2px; align-content: start; }
.kopfdaten dt { font-size: 12px; color: var(--text-leise); }
.kopfdaten dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ziel { display: block; font-weight: 600; color: var(--nachtblau); }
.herkunft { display: block; font-size: 12px; color: var(--text-leise); }
.vorschlaege { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.vorschlag { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-radius: 9px; padding: 6px 10px;
  background: var(--petrol-zart); color: var(--text); }
.vorschlag strong { color: var(--nachtblau); }
.befunde { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.befund { display: grid; gap: 4px; }

@media (max-width: 900px) {
  .kopfdaten, .zeile-wertetabelle { grid-template-columns: 1fr; }
  .konto { margin-left: 0; }
}

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.leiste { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sortierung { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* Handlungen der Prüfung (Plan Schritt 18b) */
.handlungsblock { display: grid; gap: 4px; justify-items: end; }
.sperrgrund { font-size: 12px; color: var(--text-leise); text-align: right; max-width: 420px; }
.knopf[disabled] { cursor: not-allowed; background: var(--stufe-erledigt); color: var(--text-leise);
  border-color: var(--linie-kraeftig); }
.handlung { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; border-top: 1px solid var(--linie-fein);
  padding-top: 10px; }
.befund { border-bottom: 1px solid var(--linie-fein); padding-bottom: 10px; }

/* Zusammenfassung und Verarbeitung (Plan Schritt 18c): Summen, Aufträge und Style-Instanzen, Wahl des Zielwerts */
.rechts { text-align: right; }
.auftrag { display: grid; gap: 10px; }
.auftrag-kopf { font-size: 15px; font-weight: 700; color: var(--nachtblau); }
.instanz { display: grid; gap: 10px; border-left: 3px solid var(--linie-kraeftig); padding-left: 12px; }
.instanz-kopf { font-size: 13px; font-weight: 600; }
.karte h4 { margin: 0; font-size: 16px; font-weight: 700; color: var(--nachtblau); }
.geltung { display: grid; gap: 4px; }
.geltung legend { font-size: 12px; font-weight: 600; }
.geltung label { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.geltung input[type="radio"] { min-height: 0; margin: 0; }

/* Haken „Warnung kommt wieder“ im Formular „Warnung bestätigen“ (Umsetzungsschritt N3b, PL-111) */
.haken { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.haken input[type="checkbox"] { min-height: 0; width: 20px; height: 20px; margin: 0; padding: 0; flex: none; }
.haken label { font-size: 13px; }
