/* ── Dialog-Basis ────────────────────────────────────────────────────────────
   Geteilte Dialog-Hülle, gespiegelt aus dem Desktop: WPF DialogBase +
   die App*-Styles (AppSectionLabel, AppButtonSecondary/-Primary). EINE Quelle
   der Wahrheit für alle Dialoge — damit Fußzeile, Überschriften und Knöpfe
   überall identisch und 1:1 zum Desktop sind.

   Nur in Dialogen verwenden (Präfix .dlg-). Die generischen .modal-*/.btn-leise
   bleiben für Nicht-Dialog-Seiten (Daten, Konto, Projekte …) unangetastet. */

/* Karte ohne Innenabstand: jede Sektion bringt ihren eigenen Abstand mit,
   damit Titelzeile und Fußbalken bis an die Kanten reichen (wie ein WPF-Fenster). */
.dlg-karte { padding: 0; overflow: hidden;
  /* Nie höher als der Bildschirm: Karte begrenzen, Körper scrollt intern —
     sonst ragte ein großer Dialog (z. B. Kalkulation) oben aus dem Viewport und
     die Umschalter (Menge/Preise/Formel) waren nicht mehr erreichbar. */
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; }

/* Titelzeile — WPF Window.Title (+ optional Icon links), 13px/SemiBold. */
.dlg-titel { display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; font-size: 13px; font-weight: 600; }
.dlg-titel-icon { width: 16px; height: 16px; flex: none; opacity: .85; }

/* Trennlinie — BrBorderMid, Opacity .5. */
.dlg-trenner { height: 1px; background: var(--rand); opacity: .5; }

/* Körper mit Innenabstand + Scroll. */
.dlg-koerper { padding: 14px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }

/* Der Desktop hat ZWEI Überschriften-Stile — beide hier abgebildet:
   .dlg-heading = SecHeading (Primärtext, SemiBold, 13px) — z. B. Optionen/Excel-Export.
   .dlg-sektion = AppSectionLabel (Akzentfarbe, SemiBold, 11px) — z. B. Objekt/Filter/Katalog.
   Pro Dialog die Variante nehmen, die im zugehörigen XAML steht. */
.dlg-heading { font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.dlg-heading.folgt { margin-top: 14px; }
.dlg-sektion { color: var(--akzent); font-size: 11px; font-weight: 600; margin: 0 0 10px; }
.dlg-sektion.folgt { margin-top: 14px; }

/* Sekundäres Feld-Label — SekLbl: sekundärfarben, 11px. */
.dlg-seklbl { color: var(--text-2); font-size: 11px; margin: 0 0 4px; }

/* Fußbalken — WPF-Footer-Row: 52px hoch, eigener Hintergrund, Oberkante-Trennlinie.
   DockPanel-Logik: linke Sekundäraktion (optional) links, Abbrechen/Primär rechts. */
.dlg-fuss { display: flex; align-items: center; height: 52px; padding: 0 16px;
  background: var(--bg-tief); border-top: 1px solid var(--rand); }
.dlg-fuss-rechts { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Knöpfe — AppButtonSecondary (gefüllt, randlos) + AppButtonPrimary. */
.dlg-btn-sekundaer { background: var(--hover); color: var(--text); border: none;
  border-radius: 6px; height: 34px; padding: 0 18px; font-size: 13px; cursor: pointer; }
.dlg-btn-primaer { background: var(--text); color: var(--bg); border: none;
  border-radius: 6px; height: 34px; padding: 0 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
/* Akzent-Knopf = BigAccentBtn (z. B. GAEB „Importieren"): Akzentfüllung, weiß. */
.dlg-btn-akzent { background: var(--akzent); color: #fff; border: none;
  border-radius: 6px; height: 34px; padding: 0 24px; font-size: 13px; font-weight: 600; cursor: pointer; }
.dlg-btn-akzent:disabled { opacity: .5; cursor: default; }
.dlg-btn-sekundaer:hover, .dlg-btn-primaer:hover, .dlg-btn-akzent:hover { filter: brightness(1.12); }
.dlg-btn-gefahr { background: transparent; color: var(--gefahr); border: 1px solid var(--gefahr);
  border-radius: 6px; height: 34px; padding: 0 18px; font-size: 13px; cursor: pointer; }

/* Vorgangstext-Editor (Desktop VorgangTextDialog): Werkzeugzeile, Textfeld, Vorschau */
.vtext-dialog { width: 560px; max-width: 94vw; }
.vtext-werkzeuge { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.vtext-werkzeuge .feld { width: auto; min-width: 170px; }
.vtext-feld { width: 100%; height: 58px; resize: vertical;
  font-family: Consolas, "Cascadia Mono", monospace; }
.vtext-label { margin: 12px 0 4px; color: var(--text-2); font-size: 11.5px; }
.vtext-vorschau { min-height: 60px; padding: 10px; border-radius: 6px;
  background: var(--bg-tief, var(--bg-alt)); border: 1px solid var(--rand-fein); }

/* Vorgaenger-Auswahl (Desktop VorgaengerDialog): Haken | ID | Vorgang | Typ | Lag */
.vorg-dialog { width: 560px; max-width: 94vw; }
.vorg-tabelle { border: 1px solid var(--rand-fein); border-radius: 6px;
  max-height: 46vh; overflow: auto; }
.vorg-kopf, .vorg-zeile { display: grid; grid-template-columns: 34px 44px 1fr 74px 80px;
  align-items: center; gap: 6px; padding: 4px 8px; }
.vorg-kopf { position: sticky; top: 0; background: var(--bg); color: var(--text-2);
  font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--rand-fein); }
.vorg-zeile { border-bottom: 1px solid var(--rand-fein); font-size: 12.5px; }
.vorg-zeile:hover { background: var(--hover); }
.vorg-zeile .feld { width: 100%; padding: 2px 4px; font-size: 12px; }
.vorg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vorg-kopf .re, .vorg-zeile .re { text-align: right; }

/* Stationsabschnitte (Desktop StationsabschnittDialog) */
.stat-dialog { width: 600px; max-width: 94vw; }
.stat-raster { display: grid; grid-template-columns: auto 90px auto 90px auto 90px 1fr;
  align-items: center; gap: 6px; margin: 10px 0 12px; }
.stat-raster .feld { width: 100%; }
.stat-bauweise { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.stat-bauweise label { display: inline-flex; align-items: center; gap: 6px; }
.stat-label { color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.stat-tabelle { border: 1px solid var(--rand-fein); border-radius: 6px;
  max-height: 40vh; overflow: auto; }
.stat-kopf, .stat-zeile { display: grid; grid-template-columns: 34px 44px 1fr 120px;
  align-items: center; gap: 6px; padding: 4px 8px; }
.stat-kopf { position: sticky; top: 0; background: var(--bg); color: var(--text-2);
  font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--rand-fein); }
.stat-zeile { border-bottom: 1px solid var(--rand-fein); font-size: 12.5px; }
.stat-zeile:hover { background: var(--hover); }
.stat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-kopf .re, .stat-zeile .re { text-align: right; }

/* Stützpreise-anwenden: Vorschau-Zähler */
.sp-vorschau{margin:6px 0 4px;font-size:13px}
.sp-vorschau>div{display:flex;justify-content:space-between;padding:3px 0;color:var(--text-2)}
.sp-vorschau em{font-style:normal;font-variant-numeric:tabular-nums;color:var(--text)}
.sp-vorschau .sp-summe{border-top:1px solid var(--rand-fein);margin-top:4px;padding-top:6px;font-weight:600}
.sp-vorschau .sp-summe span,.sp-vorschau .sp-summe em{color:var(--text)}

/* GAEB-Export: Vorprüf-Liste */
.gaeb-probleme{margin:12px 0 4px;padding:10px 12px;border:1px solid var(--warnung,#C77700);
  border-radius:8px;background:color-mix(in srgb,var(--warnung,#C77700) 8%,transparent)}
.gaeb-probleme-titel{font-weight:600;font-size:13px;margin-bottom:4px}
.gaeb-probleme ul{margin:0;padding-left:18px;font-size:12.5px;color:var(--text-2)}
.gaeb-probleme li{margin:2px 0}

/* Neu-einfügen-Dialog (EinfuegenModal): OZ-Vorschau + Listen-Vorschau ±2 Zeilen */
.einf-typen { flex-wrap: wrap; }
.einf-oz-vorschau { font-size: 12px; color: var(--text-2); font-style: italic; margin: 8px 0 2px 2px; }
.einf-hinweis { margin: 4px 0 0; }
.einf-vorschau { border: 1px solid var(--rand); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.einf-zeile { display: flex; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--rand);
  font-size: 12px; color: var(--text-3); align-items: baseline; }
.einf-zeile:last-child { border-bottom: 0; }
.einf-zeile.kapitel { background: rgba(127,127,127,.07); font-weight: 600; }
.einf-zeile.neu { background: rgba(90,130,255,.16); color: var(--text-1); font-weight: 600; }
.einf-oz { flex: 0 0 auto; min-width: 56px; color: var(--text-2); }
.einf-zeile.neu .einf-oz { color: var(--text-1); }
.einf-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Stützpreis-Verwaltung + -Import (Desktop StuetzpreisVerwaltung/Import) ── */
.spv-flaeche { display: grid; grid-template-columns: 240px 1fr; gap: 8px; height: 380px; margin-top: 6px; }
.spv-liste { border: 1px solid var(--rand); border-radius: 6px; overflow-y: auto; background: var(--bg-tief); }
.spv-eintrag { padding: 8px 10px; border-bottom: 1px solid var(--rand); cursor: pointer; }
.spv-eintrag:hover { background: rgba(127,127,127,.08); }
.spv-eintrag.aktiv { background: rgba(90,130,255,.14); }
.spv-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spv-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.spv-detail { border: 1px solid var(--rand); border-radius: 6px; display: flex; flex-direction: column; overflow: hidden; }
.spv-detail-kopf { padding: 8px 12px; border-bottom: 1px solid var(--rand); font-size: 11px; font-style: italic;
  color: var(--text-2); background: rgba(127,127,127,.05); }
.spv-gitter { overflow-y: auto; flex: 1; }
.spv-gitter table { width: 100%; border-collapse: collapse; font-size: 12px; }
.spv-gitter th { position: sticky; top: 0; background: var(--bg-tief); text-align: left; padding: 5px 12px;
  border-bottom: 1px solid var(--rand); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.spv-gitter td { padding: 4px 12px; border-bottom: 1px solid var(--rand); color: var(--text-2); }
.spv-gitter .re, .spimp-vorschau .re { text-align: right; }
.spv-aktionen { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.spv-spacer { flex: 1; }
.spv-umb { max-width: 220px; }

.spimp-einstellungen { margin-top: 6px; }
.spimp-zeile3 { display: grid; grid-template-columns: 1fr 120px; gap: 12px; margin-top: 8px; }
.spimp-banner { margin: 10px 0; padding: 7px 10px; border-radius: 6px; font-size: 12px; }
.spimp-banner.ok { background: rgba(60,200,60,.15); color: var(--ok, #3caa5a); }
.spimp-banner.fehler { background: rgba(210,60,60,.15); color: #d24; }
.spimp-vorschau { max-height: 240px; overflow: auto; border: 1px solid var(--rand); border-radius: 6px; }
.spimp-vorschau table { border-collapse: collapse; font-size: 11.5px; width: max-content; min-width: 100%; }
.spimp-vorschau th, .spimp-vorschau td { padding: 3px 8px; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.spimp-vorschau th { position: sticky; top: 0; background: var(--bg-tief); color: var(--text-3); }
.spimp-nr { color: var(--text-3); text-align: right; }
.spimp-vorschau tr.gedimmt { opacity: .35; }
.spimp-kbk { background: rgba(60,200,60,.16); }
.spimp-preis { background: rgba(40,210,210,.16); }
.spimp-frage { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
