/* Belegerkennung und PDF-Import der Buchhaltung (Bauplan 2026-11-14-web-app-belegerkennung): Ablagefläche, Band mit den Hinweisen der
   Prüfung, unsichere Felder, die Liste des Imports. Haarlinien, Ecken 3 px, Farbe trägt die Bedeutung, Blau nur am Hauptknopf. */

/* ── Ablagefläche: das Dateifeld liegt unsichtbar über der ganzen Fläche (Ziehen und Ablegen ohne Skript). ── */
.bh-ek { margin: 4px 0 10px; }
.bh-ek-flaeche { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 52px;
    border: 1px dashed var(--linie-stark); border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-3); cursor: pointer; }
.bh-ek-flaeche.offen { min-height: 120px; padding: 18px 20px; }
.bh-ek-flaeche:hover, .bh-ek-flaeche:focus-within { border-color: var(--akzent); color: var(--tinte-2); }
.bh-ek-flaeche input[type=file], .bh-ek-andere input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.bh-ek-flaeche input[type=file]:disabled { cursor: progress; }
.bh-ek-flaeche[aria-busy=true] { cursor: progress; border-style: solid; }
.bh-ek-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; font-size: 12.5px; }
.bh-ek-text strong { font-size: 13px; font-weight: 600; color: var(--tinte-2); }
.bh-ek-waehlen { flex: none; pointer-events: none; }
.bh-ek-laeuft { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--tinte-2); }
.bh-ek-kreis { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--linie-stark); border-top-color: var(--akzent); animation: bh-ek-drehen .8s linear infinite; }
@keyframes bh-ek-drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bh-ek-kreis { animation: none; } }
.bh-ek-fehler { margin-top: 6px; border: 1px solid var(--alarm); border-radius: 3px; }

/* ── Band nach der Erkennung ── */
.bh-ek-band { display: block; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-2); font-size: 12.5px; }
.bh-ek-band.warn { background: var(--warn-grund); border-color: var(--warn); }
.bh-ek-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bh-ek-kopf strong { font-size: 13px; font-weight: 600; }
.bh-ek-datei { color: var(--tinte-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.bh-ek-kopf .kn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.bh-ek-kopf .kn + .kn { margin-left: 0; }
.bh-ek-andere { position: relative; overflow: hidden; }
.bh-ek-satz { margin: 6px 0 0; }
.bh-ek-dublette { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--alarm); font-weight: 500; }
.bh-ek-hinweise { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.bh-ek-hinweise li { padding-left: 10px; border-left: 2px solid var(--warn); }
.bh-ek-hinweise li.sperre { border-left-color: var(--alarm); }
.bh-ek-feld { font-weight: 600; margin-right: 4px; }
.bh-ek-info { margin: 6px 0 0; color: var(--tinte-4); }
.bh-ek-infos { margin-top: 6px; color: var(--tinte-4); }
.bh-ek-infos summary { cursor: pointer; }
.bh-ek-infos ul { margin: 4px 0 0; padding-left: 16px; }
.bh-ek-bezahlt { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 500; }

/* Unsicher erkannte Felder des Editors: gelber Rand, bis zum ersten Speichern. */
.be-feld.be-unsicher .ein, .be-feld.be-unsicher select { border-color: var(--ampel-gelb); background: var(--warn-grund); }
.be-feld.be-unsicher .be-titel::after { content: " ?"; color: var(--warn); font-weight: 600; }
.be-nachschritt { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; border: 1px solid var(--warn); border-radius: 3px; background: var(--warn-grund); color: var(--warn); }

/* ── Seite PDF-Import ── */
.bh-im { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 24px; max-width: 1280px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.bh-im-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; }
.bh-im-zurueck { display: inline-flex; align-items: center; gap: 4px; }
.bh-im-titel { flex: 1 1 360px; min-width: 0; }
.bh-im-titel h1 { margin: 0; font-size: 18px; font-weight: 600; }
.bh-im-titel p { margin: 4px 0 0; font-size: 12.5px; color: var(--tinte-4); max-width: 80ch; }
.bh-im-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.bh-im-flaeche { min-height: 64px; }
.bh-im-abgelehnt { display: flex; align-items: flex-start; justify-content: space-between; border: 1px solid var(--warn); border-radius: 3px; background: var(--warn-grund); color: var(--warn); font-size: 12.5px; }
.bh-im-abgelehnt ul { margin: 0; padding-left: 16px; }
.bh-im-liste { display: flex; flex-direction: column; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); container-type: inline-size; }
.bh-im-zeile { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(170px, 1.4fr) minmax(180px, 2fr) 100px 110px 220px;
    gap: 10px; align-items: center; padding: 6px 10px; border-top: 1px solid var(--linie-fein); font-size: 12.5px; min-height: 40px; }
.bh-im-zeile:first-child { border-top: none; }
.bh-im-kopfzeile { min-height: 28px; color: var(--tinte-4); font-weight: 500; background: var(--flaeche-2); }
.bh-im-zeile > span { min-width: 0; }
.bh-im-zeile .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bh-im-datei { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinte-3); }
.bh-im-stand { display: flex; flex-direction: column; gap: 2px; }
.bh-im-hinweis { color: var(--tinte-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-im-marke { align-self: flex-start; padding: 1px 6px; border-radius: 3px; font-size: 11.5px; font-weight: 600; background: var(--flaeche-2); color: var(--tinte-3); }
.bh-im-marke.gut { background: var(--ok-grund); color: var(--ok); }
.bh-im-marke.warn { background: var(--warn-grund); color: var(--warn); }
.bh-im-marke.alarm { background: var(--alarm-grund); color: var(--alarm); }
.bh-im-lieferant { display: flex; flex-direction: column; gap: 1px; }
.bh-im-lieferant strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-im-lieferant span { color: var(--tinte-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-im-offen label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bh-im-knoepfe { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.bh-im-zeile[data-stand=Gespeichert] { color: var(--tinte-4); }
.bh-im-fuss { margin: 0; font-size: 12px; color: var(--tinte-4); }

/* Schmal (Handy): je Datei eine Karte. Gemessen wird die Liste, nicht das Fenster. */
@container (max-width: 760px) {
    .bh-im-kopfzeile { display: none; }
    .bh-im-zeile { grid-template-columns: 1fr auto; grid-template-areas: "datei zahl" "stand stand" "lieferant lieferant" "offen knoepfe"; gap: 4px 10px; padding: 10px; }
    .bh-im-datei { grid-area: datei; }
    .bh-im-zeile > .zahl { grid-area: zahl; }
    .bh-im-stand { grid-area: stand; }
    .bh-im-lieferant { grid-area: lieferant; }
    .bh-im-offen { grid-area: offen; }
    .bh-im-knoepfe { grid-area: knoepfe; }
    .bh-im-hinweis { white-space: normal; }
}
@media (max-width: 600px) {
    .bh-im { padding: 12px 12px 20px; }
    .bh-ek-flaeche.offen { min-height: 96px; }
    .bh-ek-kopf .kn { margin-left: 0; }
}

/* Trenner im Menü „Neuer Beleg“. */
.bh-neu-trenner { height: 1px; margin: 4px 0; background: var(--linie-fein); }
