/* Belegarten, Familie korrektur (Rechnungskorrektur (Minderung oder Nachberechnung einer Rechnung)): Stilregeln, die nur diese Familie braucht. Gemeinsames der Belegarten (dk-ba-…) steht in
   oo.dokumente.arten.css, der Editor in oo.dokumente.editor.css, die Akte in oo.dokumente.akte.css, Allgemeines in oo.css – hier nie etwas
   davon überschreiben. Eigene Klassen mit der Vorsilbe dk-korrektur-, nur Marken aus oo.css (Farben, Ecken 3 px, Haarlinien).
   Schmal (unter 760 px, Handy bei 390 px): ohne waagerechtes Rollen, Ziele mindestens 44 px. Eingebunden in Dokument.razor. */

/* Titel und Hinweise der Teile (Zeilen, Optionen, Akte). */
.dk-korrektur-titel { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--tinte-2); }
.dk-korrektur-untertitel { margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--tinte-5); }
.dk-korrektur-hinweis { margin: 0 0 8px; color: var(--tinte-5); font-size: 13px; }
.dk-korrektur-warn { margin: 4px 0 0; color: var(--warn); font-size: 13px; }
.dk-korrektur-fehler { display: block; margin: 4px 0 0; color: var(--alarm); font-size: 13px; white-space: normal; text-align: left; }

/* Zeilen der Rechnung (statt der Positionen): breit ein Raster wie eine Tabelle, die Eingabe rechts. */
.dk-korrektur-zeilen { margin: 0 0 16px; }
.dk-korrektur-prozentzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; }
.dk-korrektur-prozentzeile .dk-korrektur-fehler { flex-basis: 100%; }
.dk-korrektur-tabelle { display: grid; border-top: 1px solid var(--linie); }
.dk-korrektur-kopf, .dk-korrektur-pos { display: grid; grid-template-columns: 36px minmax(0, 1fr) 110px 120px 150px; gap: 8px; align-items: start;
  padding: 5px 6px; border-bottom: 1px solid var(--linie); }
.dk-korrektur-kopf { color: var(--tinte-5); font-size: 13px; font-weight: 600; }
.dk-korrektur-pos.fest { color: var(--tinte-5); }
.dk-korrektur-tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.dk-korrektur-tabelle .name, .dk-korrektur-tabelle .menge { display: grid; min-width: 0; }
.dk-korrektur-poshinweis, .dk-korrektur-noch { font-size: 12px; }
.dk-korrektur-ein { width: 100%; text-align: right; }
.dk-korrektur-prozentzeile .dk-korrektur-ein { width: 90px; }
.dk-korrektur-ergebniszeilen ul { margin: 0; padding: 0; list-style: none; }
.dk-korrektur-ergebniszeile { display: flex; justify-content: space-between; gap: 12px; padding: 3px 6px; border-bottom: 1px solid var(--linie-fein); }
.dk-korrektur-ergebniszeile .name { min-width: 0; overflow-wrap: anywhere; }
.dk-korrektur-ergebniszeile .zahl { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Summen: rechts wie die Summen des Editors, darunter die vier Zeilen der Festschreibung, Guthaben und Sperrgründe. */
.dk-ed-summenzone > .dk-ba-statt-summen:has(.dk-korrektur-summen) { grid-column: 2; }
.dk-korrektur-summen { width: auto; }
.dk-korrektur-festschreibung { display: grid; gap: 2px; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--linie); }
.dk-korrektur-festschreibung .zeile { display: flex; justify-content: space-between; gap: 16px; min-height: 22px; }
.dk-korrektur-festschreibung .zeile > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dk-korrektur-festschreibung .gesamt { margin-top: 4px; padding-top: 6px; border-top: 2px solid var(--tinte-1); font-weight: 600; }
.dk-korrektur-guthaben { margin: 10px 0 0; padding: 7px 10px; border-radius: 3px; background: var(--warn-grund); color: var(--warn); }
.dk-korrektur-sperren { margin: 10px 0 0; padding: 7px 10px 7px 26px; border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-2); font-size: 13px; }

/* Optionen unter dem Blatt: Beschriftung links, Feld rechts. */
.dk-korrektur-optionen { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--linie); }
.dk-korrektur-zeile { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 12px; align-items: start; margin: 0 0 8px; }
.dk-korrektur-zeile > label, .dk-korrektur-beschriftung { padding-top: 5px; color: var(--tinte-3); }
.dk-korrektur-feld { min-width: 0; display: grid; gap: 2px; }
.dk-korrektur-aus { max-width: 340px; }
.dk-korrektur-aus.fehler { border-color: var(--warn); }
.dk-korrektur-haken { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }
.dk-korrektur-feld textarea { width: 100%; max-width: 560px; }

/* Akte: Angaben der gespeicherten Korrektur. */
.dk-korrektur-akte { padding: 8px 10px; border: 1px solid var(--linie); border-radius: 3px; }
.dk-korrektur-angaben { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 14px; margin: 0; }
.dk-korrektur-angaben dt { color: var(--tinte-5); }
.dk-korrektur-angaben dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dk-korrektur-begruendung { white-space: pre-line; }
.dk-korrektur-akte .dk-korrektur-festschreibung { max-width: 420px; }

@media (max-width: 760px) {
  /* Schmal: jede Zeile der Rechnung als Karte (Name über die ganze Breite, Menge und Preis darunter, das Feld 44 px hoch). */
  .dk-korrektur-kopf { display: none; }
  .dk-korrektur-pos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; padding: 8px 0; }
  .dk-korrektur-pos .pos { display: none; }
  .dk-korrektur-pos .name, .dk-korrektur-pos .eingabe { grid-column: 1 / -1; }
  .dk-korrektur-pos .menge { text-align: left; }
  .dk-korrektur-ein, .dk-korrektur-aus, .dk-korrektur-feld textarea { min-height: 44px; max-width: none; width: 100%; }
  .dk-korrektur-prozentzeile .dk-korrektur-ein { width: 120px; }
  .dk-korrektur-zeile { grid-template-columns: minmax(0, 1fr); }
  .dk-korrektur-zeile > label, .dk-korrektur-beschriftung { padding-top: 0; }
  .dk-korrektur-haken { min-height: 44px; }
  .dk-korrektur-ergebniszeile { flex-wrap: wrap; }
  .dk-korrektur-summen { width: 100%; }
  .dk-korrektur-angaben { grid-template-columns: minmax(0, 1fr); }
  .dk-korrektur-angaben dd { margin-bottom: 4px; }
}
