/* Dokumente › Mahnwesen › Mahnlauf (Bauplan 2026-11-24-web-app-mahnlauf-design.md). Vorsatz „ml-“. Wie die übrigen Seiten: eckig (3 px),
   Haarlinien, dichte Zeilen, Farbe nur, wo sie etwas sagt (rot überfällig, Frist abgelaufen, Mahnung 2/3; violett Mahnstopp; Bernstein
   Hinweise); Blau nur am Hauptknopf und Fokus. Alle Schwellen messen die SEITE (Containerabfragen auf .ml-innen), nicht das Fenster. */

.ml-seite { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--grund); }
.ml-innen { max-width: 1440px; margin: 0 auto; padding: 18px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  container: ml / inline-size; }

/* ── Kopf ──────────────────────────────────────────────────────────────────── */
.ml-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ml-titel h1 { font-size: 20px; font-weight: 600; }
.ml-stand { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; color: var(--tinte-5); font-size: 12px; }
.ml-stand span + span::before { content: "·"; margin-right: 6px; }
.ml-kopf-knoepfe { display: flex; gap: 6px; }

.ml-band { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche);
  color: var(--tinte-3); font-size: 12.5px; }
.ml-band.warn { background: var(--warn-grund); border-color: transparent; color: var(--warn); }
.ml-band .sym { flex: 0 0 auto; }

/* ── Sichten ───────────────────────────────────────────────────────────────── */
.ml-sichten { display: flex; flex-wrap: wrap; gap: 6px; }
.ml-sicht { display: grid; grid-template-columns: auto auto; align-content: start; column-gap: 8px; row-gap: 1px; min-width: 118px; padding: 7px 10px;
  border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); color: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.ml-sicht:hover { background: var(--flaeche-2); }
.ml-sicht.gewaehlt { border-color: var(--tinte-5); box-shadow: inset 0 0 0 1px var(--tinte-5); }
.ml-sicht-titel { color: var(--tinte-4); font-size: 12px; }
.ml-sicht-zahl { grid-row: 1; grid-column: 2; justify-self: end; color: var(--tinte-3); font-size: 12px; font-weight: 600; }
.ml-sicht-summe { grid-column: 1 / -1; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ml-sicht.arbeit .ml-sicht-titel, .ml-sicht.arbeit .ml-sicht-zahl { color: var(--tinte-1); font-weight: 600; }
#ml-sicht-stop .ml-sicht-summe { color: var(--violett); }

/* ── Leiste: Mahnstand und Suche ───────────────────────────────────────────── */
.ml-leiste { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ml-stufen { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.ml-stufen-titel { margin-right: 6px; color: var(--tinte-5); font-size: 12px; }
.ml-stufe { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 1px solid transparent; border-radius: 3px;
  background: transparent; color: var(--tinte-3); font-size: 12.5px; cursor: pointer; }
.ml-stufe:hover { background: var(--flaeche-2); }
.ml-stufe.gewaehlt { border-color: var(--linie-stark); background: var(--flaeche); color: var(--tinte-1); font-weight: 600; }
.ml-stufe-zahl { color: var(--tinte-5); font-weight: 400; font-size: 11.5px; }
.ml-suche { display: inline-flex; align-items: center; gap: 6px; min-width: 220px; height: 28px; padding: 0 8px; border: 1px solid var(--linie-stark);
  border-radius: 3px; background: var(--flaeche); color: var(--tinte-5); }
.ml-suche input { flex: 1 1 auto; min-width: 0; height: 26px; border: 0; padding: 0; background: transparent; color: var(--tinte-1); outline: none; }
.ml-suche:focus-within { border-color: var(--akzent); }

/* ── Arbeitsfläche: Liste und Akte ─────────────────────────────────────────── */
.ml-arbeit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }

.ml-liste { --ml-spalten: minmax(170px, 1.6fr) 104px minmax(110px, .9fr) minmax(104px, .8fr) minmax(110px, .9fr) minmax(104px, .8fr) minmax(150px, 1.2fr);
  border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); min-width: 0; }
.ml-spaltenkopf, .ml-zeile { display: grid; grid-template-columns: var(--ml-spalten); column-gap: 12px; align-items: center; }
.ml-spaltenkopf { position: sticky; top: 0; z-index: 1; min-height: 32px; padding: 0 12px; border-bottom: 1px solid var(--linie); background: var(--flaeche-2);
  border-radius: 3px 3px 0 0; }
.ml-spaltenkopf .r { justify-self: end; }
.ml-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--tinte-4); font-size: 12px;
  font-weight: 600; cursor: pointer; white-space: nowrap; }
.ml-sort:hover, .ml-sort.aktiv { color: var(--tinte-1); }

.ml-zeile { width: 100%; min-height: 44px; padding: 5px 12px; border: 0; border-top: 1px solid var(--linie-fein); background: transparent; color: inherit;
  text-align: left; cursor: pointer; font: inherit; }
.ml-spaltenkopf + .ml-zeile, .ml-leer + .ml-zeile { border-top: 0; }
.ml-zeile:hover { background: var(--flaeche-2); }
.ml-zeile.gewaehlt { background: var(--auswahl); box-shadow: inset 3px 0 0 var(--tinte-1); }
.ml-zeile.ruht { color: var(--tinte-5); }
.ml-zelle { display: grid; gap: 1px; min-width: 0; }
.ml-zelle.r { justify-items: end; text-align: right; }
.ml-leit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-kunde .ml-leit { font-weight: 600; }
.ml-leit.zahl { font-variant-numeric: tabular-nums; font-weight: 600; }
.ml-leit.leise, .ml-neben.leise { color: var(--tinte-6); }
.ml-leit.teil { color: var(--warn); }
.ml-leit.handlung { font-weight: 600; color: var(--tinte-1); }
.ml-leit.alarm { font-weight: 600; color: var(--alarm); }
.ml-neben { min-height: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-5); font-size: 12px; }
.ml-neben.alarm { color: var(--alarm); }
.ml-neben.violett { color: var(--violett); }
.ml-marke { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 11px; line-height: 16px; }
.ml-marke.warn { background: var(--warn-grund); color: var(--warn); }
.ml-stufenmarke { display: inline-block; padding: 0 6px; border: 1px solid var(--linie-stark); border-radius: 3px; font-size: 12px; line-height: 18px; }
.ml-stufenmarke.stufe-2, .ml-stufenmarke.stufe-3 { border-color: transparent; background: var(--alarm-grund); color: var(--alarm); }
.ml-zeile.stopp .ml-stufenmarke { border-color: transparent; background: var(--violett-grund); color: var(--violett); }

.ml-leer { padding: 22px 14px; color: var(--tinte-4); text-align: center; }
.ml-fuss { padding: 8px 12px; border-top: 1px solid var(--linie); color: var(--tinte-4); font-size: 12px; }

.ml-laedt { display: grid; gap: 10px; color: var(--tinte-4); }
.ml-gerippe { display: grid; gap: 6px; }
.ml-gerippe span { height: 38px; border-radius: 3px; background: var(--flaeche-2); }
.ml-leerzustand { display: grid; gap: 6px; justify-items: start; padding: 18px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.ml-leer-titel { font-weight: 600; }

/* ── Akte ──────────────────────────────────────────────────────────────────── */
.ml-akte { position: sticky; top: 0; display: grid; gap: 12px; align-content: start; max-height: calc(100vh - 80px); overflow: auto; padding: 12px 14px;
  border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.ml-akte-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ml-akte-titel { display: grid; gap: 2px; min-width: 0; }
.ml-akte-kunde { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ml-akte-beleg { color: var(--tinte-3); font-size: 12.5px; }
.ml-akte-ueber { color: var(--tinte-5); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ml-akte-teil { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--linie-fein); }

.ml-schritt { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche-2); }
.ml-schritt.dringend { border-color: var(--alarm); box-shadow: inset 3px 0 0 var(--alarm); }
.ml-schritt.handlung { box-shadow: inset 3px 0 0 var(--tinte-1); }
.ml-schritt-titel { font-weight: 600; }
.ml-schritt-satz { color: var(--tinte-3); font-size: 12.5px; white-space: pre-line; }
.ml-schritt-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ml-schritt-knoepfe a.kn { text-decoration: none; }
.ml-schritt-hinweis { display: flex; gap: 6px; align-items: flex-start; color: var(--tinte-4); font-size: 12px; }
.ml-schritt-hinweis .sym { margin-top: 2px; flex: 0 0 auto; }

.ml-stopp { color: var(--violett); }
.ml-stopp .ml-akte-ueber { color: var(--violett); }
.ml-stopp-titel { font-weight: 600; }
.ml-stopp-satz { font-size: 12.5px; color: var(--tinte-3); white-space: pre-line; overflow-wrap: anywhere; }
.ml-stopp .ml-stopp-satz { color: var(--tinte-2); }
.ml-stopp-satz.leise { color: var(--tinte-5); }

.ml-saldo { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 0; font-size: 12.5px; }
.ml-saldo dt { color: var(--tinte-4); }
.ml-saldo dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ml-saldo .summe { padding-top: 3px; border-top: 1px solid var(--linie); font-weight: 600; color: var(--tinte-1); }

.ml-schreiben { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ml-schreiben th { padding: 3px 4px; color: var(--tinte-5); font-weight: 600; font-size: 11.5px; text-align: left; border-bottom: 1px solid var(--linie); }
.ml-schreiben td { padding: 4px; border-bottom: 1px solid var(--linie-fein); }
.ml-schreiben .r { text-align: right; }
.ml-akte-pc { color: var(--tinte-5); font-size: 11.5px; }

/* ── Breit genug: die Akte steht rechts neben der Liste, die Liste zeigt dann die fünf wichtigsten Spalten ─────────────────── */
@container ml (min-width: 1100px) {
  .mit-akte .ml-arbeit { grid-template-columns: minmax(0, 1fr) 380px; }
  .mit-akte .ml-liste { --ml-spalten: minmax(150px, 1.5fr) 100px minmax(96px, .8fr) minmax(100px, .9fr) minmax(140px, 1.2fr); }
  .mit-akte .ml-spaltenkopf > :nth-child(3), .mit-akte .ml-spaltenkopf > :nth-child(6),
  .mit-akte .ml-zeile > .ml-zahlung, .mit-akte .ml-zeile > .ml-frist { display: none; }
}
/* ── Schmaler: die Akte als Blatt darüber, ab 980 px weniger Spalten ─────── */
@container ml (max-width: 1099.98px) {
  .ml-akte { position: fixed; top: 40px; right: 0; bottom: 0; z-index: 25; width: min(420px, 100vw); max-height: none; border-radius: 0;
    border-width: 0 0 0 1px; box-shadow: var(--schatten); }
}
@container ml (max-width: 979.98px) {
  .ml-liste { --ml-spalten: minmax(150px, 1.5fr) 100px minmax(96px, .8fr) minmax(100px, .9fr) minmax(140px, 1.2fr); }
  .ml-spaltenkopf > :nth-child(3), .ml-spaltenkopf > :nth-child(6), .ml-zeile > .ml-zahlung, .ml-zeile > .ml-frist { display: none; }
}
/* Handy: jede Forderung als Karte (Kunde und Betrag oben, Mahnstand und nächster Schritt darunter). */
@container ml (max-width: 640px) {
  .ml-innen { padding: 12px 12px 28px; }
  .ml-sichten { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
  .ml-sicht { min-width: 108px; }
  .ml-spaltenkopf { display: none; }
  .ml-zeile { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kunde offen" "stand aktion"; row-gap: 4px; padding: 8px 12px; }
  .ml-zeile > .ml-kunde { grid-area: kunde; }
  .ml-zeile > .ml-zelle.r { grid-area: offen; }
  .ml-zeile > .ml-mahnstand { grid-area: stand; }
  .ml-zeile > .ml-aktion { grid-area: aktion; justify-items: end; text-align: right; }
  .ml-zeile > .ml-faellig, .ml-zeile > .ml-zahlung, .ml-zeile > .ml-frist { display: none; }
  .ml-suche { min-width: 0; flex: 1 1 100%; }
  .ml-akte { width: 100vw; border-left: 0; }
  .ml-kn-text { display: none; }
}
