/* ═══════════════════════════════════════════════════════════════
   lieferanten.css · Rechnungseingang BA 4, WP4.F2
   Reiter der Seite „Lieferanten“, Seitenleiste „Lieferant“, Dialoge, Ansicht „Rollen“.
   ALMAS-Webdesign v2: hell/premium, Rot #FF2325 (Flächen) / #D81020 (Text, Knöpfe),
   weiche mehrschichtige Schatten, gerundet. Nutzt die Tokens aus almas-design.css +
   rechnungstool-theme.css; alle Klassen mit Präfix lf-.
   ═══════════════════════════════════════════════════════════════ */

#lieferantenReiter { min-width: 0; }
.lf-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.lf-icon { width: 16px; height: 16px; flex: none; }

/* ─── Reiterleiste (Segment-Umschalter) ─── */
.lf-reiterleiste {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 18px;
  width: max-content; max-width: 100%;
  flex-wrap: wrap; /* R3: statt in sich zu scrollen (ohne sichtbare Leiste) umbrechen – jeder Reiter bleibt sichtbar */
  background: #EEEEF2; border: 1px solid var(--border-secondary); border-radius: 14px;
}
.lf-reiter {
  appearance: none; border: 0; background: transparent; font: inherit;
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  flex: 1 1 auto; /* umgebrochene Zeilen füllen sich gleichmäßig */
  padding: 9px 16px; min-height: 40px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.lf-reiter:hover { color: var(--text-primary); background: rgba(255, 255, 255, .6); }
.lf-reiter.is-aktiv {
  background: #FFFFFF; color: #D81020;
  box-shadow: 0 1px 2px rgba(16, 17, 22, .06), 0 4px 12px rgba(16, 17, 22, .08);
}
.lf-reiter:focus-visible { outline: 2px solid var(--almas-red); outline-offset: 2px; }

#lieferantenReiter .netz-bar { margin-bottom: 14px; }

.lf-panel { container: lfpanel / inline-size; min-width: 0; animation: lf-ein .24s ease; }
.lf-panel:focus { outline: none; }
@keyframes lf-ein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ─── Werkzeugleiste ─── */
.lf-werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 10px; min-width: 0; }
.lf-werkzeug-rest { flex: 1 1 0; }
.lf-suche { position: relative; flex: 1 1 280px; min-width: 0; max-width: 460px; }
.lf-suche .almas-input { padding-left: 38px; }
.lf-suche-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-tertiary); pointer-events: none;
}
.lf-auswahl { display: flex; align-items: center; gap: 8px; }
.lf-auswahl label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.lf-auswahl .almas-select { width: auto; min-width: 110px; }
.lf-status { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; min-height: 18px; }
/* Nach Ladefehler: Suchfeld ≠ angezeigte Daten – die Statuszeile sagt es deutlich (#8A5A00 auf Grau: 5,5:1). */
.lf-status.is-abweichend { color: #8A5A00; font-weight: 600; }
.lf-einleitung { margin: -2px 0 10px; }

/* ─── Schalter ─── */
.lf-schalter {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 36px; cursor: pointer; user-select: none; font-size: 14px; color: var(--text-primary);
}
.lf-schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.lf-schalter-bahn {
  position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px;
  background: #D9DAE0; box-shadow: inset 0 1px 2px rgba(16, 17, 22, .12); transition: background .2s ease;
}
.lf-schalter-bahn::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(16, 17, 22, .25), 0 2px 6px rgba(16, 17, 22, .10);
  transition: transform .2s ease;
}
.lf-schalter input:checked + .lf-schalter-bahn { background: #D81020; }
.lf-schalter input:checked + .lf-schalter-bahn::after { transform: translateX(16px); }
.lf-schalter input:focus-visible + .lf-schalter-bahn { outline: 2px solid var(--almas-red); outline-offset: 2px; }
.lf-schalter.is-gesperrt { cursor: not-allowed; opacity: .62; }
.lf-schalterreihe { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 2px 0 4px; }
.lf-kuerzel {
  display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; background: rgba(0, 122, 255, .08); color: #0057B8;
}

/* ─── Tabellen ─── */
.lf-tabelle-box { overflow-x: auto; }
.lf-tabelle td { vertical-align: top; }
.lf-tabelle th { white-space: normal; color: var(--text-secondary); } /* AA: .almas-table th nimmt --text-tertiary (#8A8D94 auf Weiß 3,3:1) */
.lf-th-zusatz { text-transform: none; letter-spacing: 0; font-weight: 500; }
.lf-tabelle tbody tr.is-inaktiv td { color: #6B6E75; } /* 5,1:1 auf Weiß (text-tertiary hätte nur 3,3:1) */
.lf-tabelle-flach { border-top: 1px solid var(--border-secondary); }
.lf-tabelle-klein th, .lf-tabelle-klein td { padding: 7px 10px; font-size: 13px; }
.lf-tabelle-bank td:first-child { min-width: 200px; }
.lf-link {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit;
  color: var(--text-primary); font-weight: 600; text-align: left; cursor: pointer; border-radius: 4px;
}
.lf-link:hover { color: #D81020; text-decoration: underline; text-underline-offset: 3px; }
.lf-link:focus-visible { outline: 2px solid var(--almas-red); outline-offset: 2px; }
.lf-unterzeile { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-secondary); }
button.lf-unterzeile { font-weight: 500; color: #D81020; }
/* Platzhalter „—“ etwas zurückgenommen, aber lesbar: #6B6E75 = 5,1:1 auf Weiß, 4,7:1 auf #F5F5F7 (WCAG AA).
   Ganze Hinweissätze („Noch keine Kennungen …“) in der normalen Zweitfarbe (6,4:1). */
.lf-leer { color: #6B6E75; }
p.lf-leer { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.lf-mono { font-family: var(--font-mono); font-size: 13px; }
.lf-iban { font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.lf-iban-gross { font-size: 16px; font-weight: 600; }
.lf-person { font-weight: 500; overflow-wrap: anywhere; }
.lf-vertretung { display: block; margin-top: 2px; font-size: 12px; color: var(--text-secondary); }
.lf-ges {
  display: inline-block; min-width: 40px; margin-right: 6px; padding: 2px 6px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; text-align: center;
  color: var(--text-secondary); background: var(--bg-tertiary);
}
.lf-regel { display: block; }
.lf-regel + .lf-regel { margin-top: 5px; }
.lf-aktionen { text-align: right; }
.lf-aktionen .almas-btn { margin: 2px 0 2px 6px; }
.lf-belege { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; }
.lf-beleg { font-size: 12px; font-weight: 500; color: #D81020; }
.lf-notiz { font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.lf-umbruch { overflow-wrap: anywhere; }
.lf-btn-gefahr { color: #C20F1C; }
.lf-seiten { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--text-secondary); }

/* Schmal (Container): Zeilen als Karten, Beschriftung aus data-label */
@container lfpanel (max-width: 700px) {
  .lf-panel .lf-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lf-panel .lf-tabelle, .lf-panel .lf-tabelle tbody, .lf-panel .lf-tabelle tr, .lf-panel .lf-tabelle td { display: block; width: 100%; }
  .lf-panel .lf-tabelle tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--border-secondary); }
  .lf-panel .lf-tabelle tbody tr:last-child { border-bottom: 0; }
  .lf-panel .lf-tabelle td, .lf-panel .lf-tabelle-klein td {
    position: relative; border: 0; padding: 4px 0 4px 36%; min-height: 26px; text-align: left; overflow-wrap: anywhere;
  }
  .lf-panel .lf-tabelle td::before {
    content: attr(data-label); position: absolute; left: 0; top: 6px; width: 33%;
    font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6B6E75;
  }
  .lf-panel .lf-aktionen .almas-btn { margin: 4px 6px 0 0; }
  .lf-panel .lf-iban { white-space: normal; }
  /* R3: gelöschte Regeln haben keine Aktionen – keine leere Zeile „AKTIONEN“ in der Karte */
  .lf-panel .lf-tabelle td.lf-aktionen:empty { display: none; }
}
@container lfrollen (max-width: 540px) {
  .lf-rollen-liste .lf-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lf-rollen-liste .lf-tabelle, .lf-rollen-liste .lf-tabelle tbody, .lf-rollen-liste .lf-tabelle tr, .lf-rollen-liste .lf-tabelle td { display: block; width: 100%; }
  .lf-rollen-liste .lf-tabelle tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--border-secondary); }
  .lf-rollen-liste .lf-tabelle tbody tr:last-child { border-bottom: 0; }
  .lf-rollen-liste .lf-tabelle td, .lf-rollen-liste .lf-tabelle-klein td {
    position: relative; border: 0; padding: 4px 0 4px 36%; min-height: 26px; text-align: left; overflow-wrap: anywhere;
  }
  .lf-rollen-liste .lf-tabelle td::before {
    content: attr(data-label); position: absolute; left: 0; top: 6px; width: 33%;
    font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6B6E75;
  }
  .lf-rollen-liste .lf-aktionen .almas-btn { margin: 4px 6px 0 0; }
  .lf-rollen-liste .lf-iban { white-space: normal; }
}

/* ─── Zustände ─── */
.lf-zustand {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 40px 20px; text-align: center; color: var(--text-secondary);
  background: var(--bg-secondary); border: 1px solid var(--border-secondary); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.lf-zustand[role=status] { flex-direction: row; gap: 10px; font-size: 14px; }
.lf-zustand-icon { width: 34px; height: 34px; margin-bottom: 4px; color: var(--text-tertiary); }
.lf-zustand-titel { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.lf-zustand-text { margin: 0 auto; max-width: 480px; font-size: 14px; line-height: 1.5; }
.lf-zustand .almas-btn { margin-top: 10px; }
.lf-zustand-recht .lf-zustand-icon { color: #D81020; }
.lf-spinner { width: 18px; height: 18px; border-width: 2px; }
.lf-spinner-knopf {
  display: inline-block; width: 14px; height: 14px; border-width: 2px;
  border-color: currentColor; border-top-color: transparent; opacity: .85;
}

/* Nachladen mit vorhandenen Daten (aria-busy aus lieferanten.js): alte Daten gedimmt + Laufbalken.
   Erst nach kurzer Verzögerung, damit schnelle Antworten nicht flackern. */
.lf-ergebnis { position: relative; min-width: 0; }
.lf-ergebnis > * { transition: opacity .15s ease; }
.lf-ergebnis[aria-busy="true"] > :not(.lf-zustand[role="status"]) { opacity: .55; transition: opacity .2s ease .18s; }
.lf-ergebnis[aria-busy="true"]:not(:has(> .lf-zustand[role="status"]))::before {
  content: ""; position: absolute; z-index: 2; top: -7px; left: 0; right: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 35, 37, 0), #FF2325 50%, rgba(255, 35, 37, 0)) no-repeat;
  background-size: 36% 100%; opacity: 0;
  animation: lf-lauf 1.15s ease-in-out .18s infinite;
}
#lfRollenTabelle.lf-ergebnis[aria-busy="true"]::before { top: 0; }
@keyframes lf-lauf { from { background-position: -45% 0; opacity: 1; } to { background-position: 145% 0; opacity: 1; } }

/* ─── Meldungen ─── */
.lf-meldung {
  display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; padding: 12px 14px;
  border-radius: 12px; font-size: 14px; line-height: 1.45;
}
.lf-meldung > .lf-icon { width: 18px; height: 18px; margin-top: 1px; }
.lf-meldung p { margin: 0; }
.lf-meldung p + p { margin-top: 4px; }
.lf-meldung-fehler { background: rgba(255, 35, 37, .07); border: 1px solid rgba(255, 35, 37, .22); color: #9E0B16; }
.lf-meldung-warnung { background: rgba(255, 149, 0, .09); border: 1px solid rgba(255, 149, 0, .28); color: #6E4600; }
.lf-meldung-info { background: rgba(0, 122, 255, .06); border: 1px solid rgba(0, 122, 255, .18); color: #0B4A94; }
.lf-meldung-hinweis { background: #FFF6F6; border: 1px solid rgba(255, 35, 37, .22); color: var(--text-primary); }
.lf-meldung-hinweis > .lf-icon { color: #D81020; }
.lf-rueckruf-hinweis { margin: 0 0 14px; }
.lf-form-meldung:empty, .lf-kandidaten:empty { display: none; }

/* ─── Filter-Chips ─── */
.lf-filter { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.lf-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer;
  background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 999px;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.lf-chip:hover { border-color: #C9CAD1; color: var(--text-primary); }
/* Aktiver Chip: deckender Rotton statt Transparenz – #D81020 auf #FFF3F3 = 4,8:1 auf jedem Untergrund
   (vorher rgba(…, .08) über dem grauen Seitengrund: 4,31:1, unter AA für 13 px/600). */
.lf-chip.is-aktiv {
  background: #FFF3F3; border-color: rgba(216, 16, 32, .42); color: #D81020;
  box-shadow: 0 1px 2px rgba(216, 16, 32, .06), 0 2px 8px rgba(216, 16, 32, .06);
}
.lf-chip:focus-visible { outline: 2px solid var(--almas-red); outline-offset: 2px; }
.lf-chip-zeile { margin: 0 0 10px; }
.lf-chip-weg {
  appearance: none; display: inline-flex; padding: 2px; margin: 0 -4px 0 2px; border: 0; border-radius: 50%;
  background: none; color: inherit; cursor: pointer;
}
.lf-chip-weg:hover { background: rgba(255, 35, 37, .12); }
.lf-chip-weg:focus-visible { outline: 2px solid var(--almas-red); outline-offset: 1px; }
.lf-zaehler {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--text-secondary); background: var(--bg-tertiary);
}

/* ─── Dialoge ─── */
html.lf-gesperrt { overflow: hidden; }
/* R3: Toasts lagen nach jedem Speichern gut 3,5 s auf dem X der Seitenleiste. Solange sie offen ist: links
   neben der Leiste, wenn Platz ist (700 px Leiste + 400 px Toast), sonst unten. */
html.lf-schublade-offen .almas-toast-container { top: auto; bottom: var(--space-lg); }
@media (min-width: 1148px) {
  html.lf-schublade-offen .almas-toast-container { top: var(--space-lg); bottom: auto; right: calc(700px + var(--space-lg)); }
}
.lf-overlay { z-index: 1100; }
.lf-dialog { max-width: 520px; padding: 22px 24px; }
.lf-dialog-breit { max-width: 680px; }
.lf-dialog:focus, .lf-schublade:focus { outline: none; }
.lf-dialog-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lf-dialog-titel, .almas-modal h2.lf-dialog-titel { margin: 4px 0 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.lf-zu {
  appearance: none; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--bg-tertiary); color: var(--text-secondary); transition: background var(--transition-fast);
}
.lf-zu:hover { background: #E6E7EC; color: var(--text-primary); }
.lf-zu:focus-visible { outline: 2px solid var(--almas-red); outline-offset: 2px; }
.lf-zu .lf-icon { width: 18px; height: 18px; }
.lf-rueckfrage { font-size: 14px; line-height: 1.5; color: var(--text-primary); }
.lf-rueckfrage p { margin: 0 0 8px; }
.lf-konto-kopf { margin: 0 0 10px; }
.lf-konto-kopf .lf-unterzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }

/* Seitenleiste (Lieferant bearbeiten) */
.lf-schublade-overlay {
  position: fixed; inset: 0; z-index: 1050; display: flex; justify-content: flex-end;
  background: rgba(16, 17, 22, .32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: almas-fade-in .2s ease;
}
.lf-schublade {
  display: flex; flex-direction: column; width: min(700px, 100%); height: 100%; min-width: 0;
  background: var(--bg-primary);
  box-shadow: -18px 0 50px rgba(16, 17, 22, .16), -2px 0 8px rgba(16, 17, 22, .06);
  animation: lf-schublade-ein .28s cubic-bezier(.2, .8, .2, 1);
}
.lf-schublade .lf-dialog-kopf {
  margin: 0; padding: 16px 22px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-secondary);
}
.lf-schublade .lf-dialog-inhalt { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 48px; }
.lf-schublade .lf-zustand { box-shadow: none; }
@keyframes lf-schublade-ein { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }

.lf-detail-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 14px; }
.lf-detail-kopf .lf-unterzeile, .lf-detail-kopf .lf-hilfe { flex-basis: 100%; margin: 2px 0 0; }
.lf-abschnitt {
  margin: 0 0 14px; padding: 16px 18px; background: var(--bg-secondary);
  border: 1px solid var(--border-secondary); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.lf-abschnitt > h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.lf-abschnitt > .lf-hilfe:first-of-type { margin: -4px 0 12px; }
.lf-zust-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px 24px; }
.lf-zust-karte { min-width: 0; }
.lf-zust-karte h4 {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 10px; padding-bottom: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .3px; color: var(--text-primary); border-bottom: 1px solid var(--border-secondary);
}
.lf-zust-karte h4 .lf-unterzeile { margin: 0; letter-spacing: 0; }

/* ─── Formulare ─── */
.lf-form .almas-form-group { margin-bottom: 12px; }
.lf-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.lf-feld { min-width: 0; }
.lf-hilfe { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); }
.lf-pflicht { color: #D81020; }
.lf-form-knoepfe { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.lf-form-knoepfe.lf-links { justify-content: flex-start; }
.lf-kennung-form {
  display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) auto; gap: 0 10px;
  align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-secondary);
}
.lf-kennung-form > button { margin-bottom: 12px; }
.lf-feld-ganz { grid-column: 1 / -1; margin-top: -4px; }
.lf-dl { display: grid; grid-template-columns: minmax(120px, 36%) minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.lf-dl dt { color: var(--text-secondary); }
.lf-dl dd { margin: 0; overflow-wrap: anywhere; }
.lf-kandidaten-liste { display: grid; gap: 6px; margin: 8px 0 10px; padding: 0; list-style: none; }
.lf-kandidaten-liste li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 6px 10px;
  background: rgba(255, 255, 255, .75); border-radius: 8px;
}
.lf-kandidat-name { font-weight: 600; }
.lf-kandidaten-liste .lf-unterzeile { display: inline; flex: 1 1 auto; margin: 0; }
/* Während das Formular sendet, sind „Trotzdem …“ und „Öffnen“ gesperrt (Codex-Gate WP4.F2 Befund 4). */
.lf-kandidaten [aria-disabled="true"]:not([aria-busy="true"]) { opacity: .55; cursor: not-allowed; }
/* Bank-Dialog nach gespeicherter Entscheidung: Datum/Notiz stehen fest, nur „Weiter neu bewerten“ (Befund 5). */
.lf-form .almas-input[readonly], .lf-form .almas-textarea[readonly] { opacity: .75; cursor: default; }

/* Listen in der Seitenleiste */
.lf-liste { margin: 0; padding: 0; list-style: none; }
.lf-liste-zeile {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border-secondary);
}
.lf-liste-zeile:last-child { border-bottom: 0; }
.lf-liste-zeile.is-inaktiv, .lf-liste-zeile.is-inaktiv .lf-unterzeile { color: #6B6E75; }
.lf-liste-wert { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.lf-liste-zeile .lf-unterzeile { flex-basis: 100%; margin: 0; }
.lf-liste-zeile > .almas-btn { margin-left: auto; }

/* Aufklappbereiche + Protokoll */
.lf-aufklapp > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 700; border-radius: 6px;
}
.lf-aufklapp > summary::-webkit-details-marker { display: none; }
.lf-aufklapp > summary::before {
  content: ""; width: 7px; height: 7px; margin: 0 4px 0 2px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s ease;
}
.lf-aufklapp[open] > summary::before { transform: rotate(45deg); }
.lf-aufklapp > summary:focus-visible { outline: 2px solid var(--almas-red); outline-offset: 3px; }
.lf-aufklapp[open] > summary { margin-bottom: 10px; }
.lf-karte-flach {
  margin-top: 16px; padding: 14px 18px; background: var(--bg-secondary);
  border: 1px solid var(--border-secondary); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.lf-protokoll { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.lf-protokoll li {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 2px 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border-secondary);
}
.lf-protokoll li:last-child { border-bottom: 0; }
.lf-protokoll-zeit { grid-row: span 3; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.lf-protokoll-werte { color: var(--text-secondary); overflow-wrap: anywhere; }
.lf-protokoll .lf-unterzeile { margin: 0; }

/* ─── Import ─── */
.lf-import { display: grid; gap: 16px; min-width: 0; }
.lf-import > .almas-card { margin: 0; }
.lf-karte { min-width: 0; padding: 20px 22px; }
.lf-karte > h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.lf-schritte { display: grid; gap: 16px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: lf-schritt; }
.lf-schritte > li { position: relative; min-width: 0; padding-left: 38px; counter-increment: lf-schritt; }
.lf-schritte > li::before {
  content: counter(lf-schritt); position: absolute; left: 0; top: 0;
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; font-weight: 700; color: #D81020; background: rgba(255, 35, 37, .10);
}
.lf-import-text { min-height: 130px; font-family: var(--font-mono); font-size: 13px; }
/* Spalten zuordnen (Vorschau des Absender-Imports) – flach, keine Karte in der Karte */
.lf-zuordnung {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px;
  min-width: 0; margin: 2px 0 12px; padding: 0; border: 0;
}
.lf-zuordnung > legend { padding: 0; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.lf-zuordnung-feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lf-zuordnung-feld > label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.lf-zuordnung .almas-select { width: 100%; min-width: 0; }
.lf-unterzeile.lf-inline { display: inline; margin: 0 0 0 6px; font-weight: 500; }
.lf-bericht { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-secondary); min-width: 0; }
.lf-bericht-titel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.lf-bericht-titel .lf-unterzeile { display: inline; margin: 0; }
.lf-bericht .lf-filter { margin: 8px 0 10px; }
.lf-bericht .lf-aufklapp { padding: 10px 0; border-top: 1px solid var(--border-secondary); }
.lf-bericht .lf-aufklapp > summary { font-size: 14px; }
.lf-kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
@container lfpanel (max-width: 620px) { .lf-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lf-kachel { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg-tertiary); }
.lf-kachel-wert { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.lf-kachel-label { font-size: 12px; color: var(--text-secondary); }
.lf-kachel-info .lf-kachel-wert { color: #0057B8; }
.lf-kachel-warnung { background: rgba(255, 149, 0, .10); }
.lf-kachel-warnung .lf-kachel-wert { color: #8A5A00; }
.lf-scroll { max-height: 440px; overflow: auto; min-width: 0; }

/* ─── Rollen ─── */
.lf-rollen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.lf-rollen-liste { container: lfrollen / inline-size; min-width: 0; }
.lf-rollen-liste .almas-table-header { gap: 12px; flex-wrap: wrap; }
.lf-rollen-liste .lf-status { margin: 0; }
.lf-rollen-liste > div > .lf-zustand { border: 0; box-shadow: none; border-radius: 0; }
.lf-rollen-form { align-self: start; }
.lf-erklaerung {
  margin: 8px 0 0; padding: 9px 11px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  color: var(--text-secondary); background: var(--bg-tertiary);
}
.lf-hinweise {
  display: grid; gap: 8px; margin: 16px 0 0; padding: 14px 0 0; list-style: none;
  font-size: 13px; line-height: 1.45; color: var(--text-secondary); border-top: 1px solid var(--border-secondary);
}
.lf-hinweise li { display: flex; align-items: flex-start; gap: 8px; }
.lf-hinweise .lf-icon { margin-top: 1px; color: var(--text-tertiary); }
#rollenInhalt:focus { outline: none; }
@media (min-width: 1240px) {
  .lf-rollen { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); align-items: start; }
}

/* ─── Schmal ─── */
@media (max-width: 600px) {
  .lf-reiterleiste { width: 100%; }
  .lf-suche { flex-basis: 100%; max-width: none; }
  .lf-kennung-form { grid-template-columns: minmax(0, 1fr); }
  .lf-kennung-form > button { justify-self: start; }
  .lf-schublade .lf-dialog-kopf, .lf-schublade .lf-dialog-inhalt { padding-left: 16px; padding-right: 16px; }
  .lf-protokoll li { grid-template-columns: minmax(0, 1fr); }
  .lf-protokoll-zeit { grid-row: auto; }
  .lf-karte { padding: 16px; }
  .lf-schritte > li { padding-left: 0; padding-top: 34px; }
}

/* ─── Bewegung reduzieren ─── */
@media (prefers-reduced-motion: reduce) {
  .lf-panel, .lf-schublade, .lf-schublade-overlay, .lf-overlay, .lf-dialog,
  .lf-reiter, .lf-chip, .lf-zu, .lf-schalter-bahn, .lf-schalter-bahn::after, .lf-aufklapp > summary::before {
    animation: none !important; transition: none !important;
  }
  .lf-spinner, .lf-spinner-knopf { animation-duration: 2.4s; }
  .lf-ergebnis > *, .lf-ergebnis[aria-busy="true"] > :not(.lf-zustand[role="status"]) { transition: none !important; }
  .lf-ergebnis[aria-busy="true"]:not(:has(> .lf-zustand[role="status"]))::before { animation: none !important; opacity: 1; background-position: 50% 0; background-size: 100% 100%; background-image: none; background-color: rgba(255, 35, 37, .45); }
}

/* Lade-Zustand der Knöpfe (aria-busy statt disabled, damit der Fokus bleibt) */
.almas-btn[aria-busy="true"] { cursor: progress; opacity: .78; transform: none; }
.lf-zust-karte .lf-form-knoepfe { justify-content: flex-start; }
.lf-liste-zeile > .almas-btn { order: 2; }
.lf-liste-zeile > .lf-unterzeile { order: 3; }
.lf-tabelle .almas-badge { white-space: nowrap; }
.almas-badge.lf-badge-text { text-transform: none; letter-spacing: 0; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }

/* Feste Spaltenbreiten: die Tabellen passen ab ca. 700 px Inhaltsbreite ohne waagerechtes Scrollen */
.lf-tabelle-stamm, .lf-tabelle-regeln, .lf-tabelle-bank, .lf-tabelle-import { table-layout: fixed; }
.lf-tabelle-stamm th, .lf-tabelle-stamm td, .lf-tabelle-regeln th, .lf-tabelle-regeln td,
.lf-tabelle-bank th, .lf-tabelle-bank td, .lf-tabelle-import th, .lf-tabelle-import td { padding-left: 10px; padding-right: 10px; overflow-wrap: anywhere; }
.lf-tabelle-stamm th:nth-child(1) { width: 22%; } .lf-tabelle-stamm th:nth-child(2) { width: 13%; }
.lf-tabelle-stamm th:nth-child(3), .lf-tabelle-stamm th:nth-child(4) { width: 15%; }
.lf-tabelle-stamm th:nth-child(5) { width: 13%; } .lf-tabelle-stamm th:nth-child(6), .lf-tabelle-stamm th:nth-child(7) { width: 11%; }
.lf-tabelle-regeln th:nth-child(1) { width: 21%; } .lf-tabelle-regeln th:nth-child(2) { width: 11%; }
.lf-tabelle-regeln th:nth-child(3) { width: 22%; } .lf-tabelle-regeln th:nth-child(4) { width: 20%; }
.lf-tabelle-regeln th:nth-child(5) { width: 14%; } .lf-tabelle-regeln th:nth-child(6) { width: 12%; }
.lf-tabelle-bank th:nth-child(1) { width: 22%; } .lf-tabelle-bank th:nth-child(2) { width: 17%; }
.lf-tabelle-bank th:nth-child(3) { width: 13%; } .lf-tabelle-bank th:nth-child(4) { width: 15%; }
.lf-tabelle-bank th:nth-child(5) { width: 10%; } .lf-tabelle-bank th:nth-child(6) { width: 23%; }
/* Datum nicht mitten in der Zahl umbrechen („17.10.202|6“ bei 1024 px) */
.lf-tabelle-bank td[data-label="Erstmals gesehen"] { overflow-wrap: normal; }
.lf-tabelle-import th:nth-child(1) { width: 7%; } .lf-tabelle-import th:nth-child(2) { width: 19%; }
.lf-tabelle-import th:nth-child(3) { width: 20%; } .lf-tabelle-import th:nth-child(4) { width: 13%; }
.lf-tabelle-import th:nth-child(5) { width: 20%; } .lf-tabelle-import th:nth-child(6) { width: 21%; }
.lf-tabelle-bank td:first-child { min-width: 0; }
.lf-tabelle-bank .lf-iban { white-space: normal; }
.lf-tabelle .almas-badge { white-space: normal; text-align: left; }
.lf-aktionen .almas-btn { white-space: normal; text-align: center; line-height: 1.3; }
.lf-aktionen-zeile { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; text-align: left; }
.lf-aktionen-zeile .almas-btn { margin: 0; }
.lf-tabelle-regeln .lf-aktionen .almas-btn { margin: 0 0 6px 6px; }
/* R4: kein display:flex auf der Zelle selbst – eine Flex-Zelle ist keine Tabellenzelle mehr (Trennlinien versetzt,
   leere Zellen gelöschter Regeln ohne Rahmen). Die Knöpfe stehen als Inline-Blöcke rechtsbündig. */
@container lfpanel (max-width: 700px) {
  .lf-tabelle-stamm, .lf-tabelle-regeln, .lf-tabelle-bank, .lf-tabelle-import { table-layout: auto; }
  .lf-panel .lf-tabelle-regeln .lf-aktionen .almas-btn { margin: 4px 6px 0 0; }
}
.lf-tabelle th { overflow-wrap: normal; word-break: normal; -webkit-hyphens: auto; hyphens: auto; }
.lf-aktionen .almas-btn { overflow-wrap: normal; word-break: keep-all; }

/* Karten: Beschriftung als Float in der Einrückung, damit zweizeilige Beschriftungen die Zeile mitwachsen lassen */
@container lfpanel (max-width: 700px) {
  .lf-panel .lf-tabelle td, .lf-panel .lf-tabelle-klein td { display: flow-root; box-sizing: border-box; padding: 4px 0 4px 136px; min-height: 0; }
  .lf-panel .lf-tabelle, .lf-panel .lf-tabelle tr { box-sizing: border-box; min-width: 0; }
  .lf-panel .lf-tabelle td::before { position: static; float: left; width: 124px; margin-left: -136px; padding-top: 2px; }
}
@container lfrollen (max-width: 540px) {
  .lf-rollen-liste .lf-tabelle td { display: flow-root; box-sizing: border-box; padding: 4px 0 4px 136px; min-height: 0; }
  .lf-rollen-liste .lf-tabelle, .lf-rollen-liste .lf-tabelle tr { box-sizing: border-box; min-width: 0; }
  .lf-rollen-liste .lf-tabelle td::before { position: static; float: left; width: 124px; margin-left: -136px; padding-top: 2px; }
}

/* ─── Dubletten prüfen / Lieferanten zusammenführen (L-0046 WP6) ─── */
.lf-zus, .lf-zus * { min-width: 0; }
.lf-zus-liste, .lf-zus-zeilen, .lf-zus-punkte { list-style: none; margin: 0; padding: 0; }
.lf-zus-gruppe {
  display: grid; gap: 8px; padding: 14px 16px; margin: 0 0 10px; border: 1px solid var(--border-color, #E6E7EC);
  border-radius: 14px; background: var(--bg-primary);
}
.lf-zus-gruppe > .almas-btn { justify-self: start; }
.lf-zus-gruppe-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.lf-zus-name, .lf-zus-text { overflow-wrap: anywhere; }
.lf-zus-zeilen > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 3px 0; font-size: 14px; }
.lf-zus-stamm { color: var(--text-secondary); font-size: 13px; }
.lf-zus-kopf { margin-bottom: 14px; }
.lf-detail-aktion { display: flex; justify-content: flex-end; margin: -4px 0 12px; }
.lf-zus-satz { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--border-color, #E6E7EC); border-radius: 12px; }
.lf-zus-satz > legend { padding: 0 6px; font-size: 13px; font-weight: 700; }
.lf-zus-wahl { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 14px; line-height: 1.4; cursor: pointer; }
.lf-zus-wahl > input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #D81020; }
.lf-zus-wahl > input:focus-visible { outline: 2px solid var(--almas-red); outline-offset: 2px; }
.lf-zus-wahl > span { overflow-wrap: anywhere; }
.lf-zus-neu { margin: 6px 0 0 28px; }
.lf-zus-neu[hidden], .lf-zus-bestaetigung[hidden], .lf-zus-wahl[hidden] { display: none; }
.lf-zus .almas-btn { min-height: 44px; }
.lf-zus .lf-schalterreihe { margin-top: 4px; }
.lf-zus-aktion { margin: 0 0 12px; }
.lf-zus-vorschau { display: grid; gap: 10px; margin: 0 0 12px; }
.lf-zus-vorschau:empty { display: none; }
.lf-zus-punkte > li { padding: 4px 0 4px 14px; position: relative; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.lf-zus-punkte > li::before { content: ''; position: absolute; left: 2px; top: .85em; width: 5px; height: 5px; border-radius: 50%; background: #D81020; }
.lf-zus-ergebnis { padding: 8px 12px; border: 1px solid var(--border-color, #E6E7EC); border-radius: 12px; background: var(--bg-secondary, #FAFAFB); }
.lf-zus-geprueft { padding: 10px 12px; border: 1px solid var(--border-color, #E6E7EC); border-radius: 12px; font-weight: 600; }
.lf-zus-rechnungen .lf-zus-zeilen { max-height: 240px; overflow-y: auto; }
@media (max-width: 600px) {
  .lf-zus-neu { margin-left: 0; }
  .lf-zus-gruppe { padding: 12px; }
  .lf-zus-satz { padding: 10px; }
  .lf-zus .almas-modal-actions { flex-wrap: wrap; }
  .lf-zus .almas-modal-actions > .almas-btn { flex: 1 1 100%; }
}
