/* ---------------------------------------------------------------------------
   Vectral 2.0 — Import-Wizard (Schritt 1a, 2, Prüfung, Fehlerseite, Vorlagen)
   T18 n: aus app.css herausgelöst. Dropzone, Erkennung, Mapping, Befunde,
   Korrektur-Regeln, Diff-Karte, Datumsformat, Zeitraum, H01, Abgleich.
--------------------------------------------------------------------------- */

/* === Upload-Baustein (H7) =============================================== */

.upload { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: center; }
.upload .leerzustand.is-compact { padding: 18px 20px; }
@media (max-width: 900px) { .upload { grid-template-columns: 1fr; } }

.dropzone {
  border: 2px dashed var(--navy-line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--navy-soft), var(--surface) 70%);
  padding: 38px 24px; text-align: center;
}
.dropzone .dz-icon {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--navy); border: 1px solid var(--navy-line);
  box-shadow: var(--shadow-xs);
}
.dropzone .dz-title { font-size: 16px; font-weight: 700; }
.dropzone .dz-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.dropzone .btn { margin-top: 18px; }

/* Import-Historie: engere Polster, Zahlen/Datum ohne Umbruch, Knöpfe in einer Zeile */
.table-std.is-historie th, .table-std.is-historie td { padding: 12px 10px; }
.table-std.is-historie th:first-child, .table-std.is-historie td:first-child { padding-left: 16px; }
.table-std.is-historie th:last-child, .table-std.is-historie td:last-child { padding-right: 16px; }
.table-std.is-historie td.num, .table-std.is-historie td .tiny.num { white-space: nowrap; }
.table-std.is-historie .badge { white-space: nowrap; }
.table-std.is-historie .btn-row.is-tight { flex-wrap: nowrap; }
.korr-zelle { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.korr-zelle > div { min-width: 0; max-width: 200px; white-space: normal; }
.table-std.is-historie td:nth-child(2) { white-space: nowrap; }

.maplist h4 { margin-bottom: 6px; font-size: 14px; }
.maprow {
  display: grid; grid-template-columns: 122px 20px 1fr;
  align-items: center; gap: 8px; padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.maprow:last-of-type { border-bottom: 0; }
.maprow .mf { font-weight: 700; font-size: 13px; }
.maprow .ar { color: var(--muted-2); text-align: center; }
.maprow .ms { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* === B2-Ergänzungen === */
/* Import-Wizard (Dropzone-Zustände, Erkennung, Mapping-Zeilen, Befunde,
   Diff-Karte, Job-Fortschritt), Grundriss-Editor 1b, Zonen-Editor 1c,
   Vorlagen-Dialog. Nur vorhandene Tokens; Zonenfarben kommen als `farbe`
   aus der API, Fallback ist die Rampe.                                    */

/* --- Wizard-Stufen ----------------------------------------------------- */
/* Abstand nach oben gehört zur Leiste selbst: `margin: 0` hatte die Utility `.mt-16` im HTML
   überschrieben (gleiche Spezifität, später geladen), sodass die Stufen an der Zweck-Karte klebten
   (Auftraggeber 15.09.2026, Handy-Screenshot Screen 2). */
.wz-steps { display: flex; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; flex-wrap: wrap; }
.wz-steps li { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wz-steps li a { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.wz-steps .wz-no { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted-2); border: 1px solid var(--border); }
.wz-steps .is-active { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); }
.wz-steps .is-active .wz-no { background: var(--navy-fill); color: #fff; border-color: var(--navy-fill); }
.wz-steps .is-done { color: var(--ink); }
.wz-steps .is-done .wz-no { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }

/* --- Dropzone-Zustände --------------------------------------------------- */
.dropzone.is-drag { border-color: var(--link); background: var(--primary-soft); }
.dropzone.is-busy { opacity: .85; }
.dropzone .dz-progress { margin-top: 16px; text-align: left; }
.dropzone .btn:disabled { opacity: .6; }

/* --- Erkennungskarte und Rohvorschau ---------------------------------- */
.erk-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.formgrid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .formgrid.is-4 { grid-template-columns: 1fr; } }
.input.is-static { display: flex; align-items: center; background: var(--surface-2); box-shadow: none; }
.rohvorschau { max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rohvorschau .table-std { font-size: 12px; font-family: var(--mono); }
.rohvorschau .table-std th { position: sticky; top: 0; z-index: 1; font-family: var(--font); }
.rohvorschau .table-std td { padding: 6px 10px; white-space: nowrap; }

/* --- Mapping-Zeilen ----------------------------------------------------- */
.maprow.is-b2 { grid-template-columns: 122px 20px minmax(0, 1fr) auto; align-items: start; }
.maprow.is-b2 .mf { padding-top: 10px; }
.maprow.is-b2 .ar { padding-top: 10px; }
.maprow.is-b2 .ms-wrap { display: grid; gap: 4px; min-width: 0; }
.maprow.is-b2 .mp-bsp { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maprow.is-b2 .mk { padding-top: 10px; min-width: 0; }
.maprow .pflicht { color: var(--danger); }
/* Platzhalter-Chips der zusammengesetzten Vorlage (B17 §2.1) */
.maprow.is-b2 .mp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.maprow.is-b2 .mp-chips-label { margin-right: 2px; }
.mp-chip { padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: pointer; }
.mp-chip:hover { border-color: var(--navy-line); background: var(--navy-soft); color: var(--navy); }
.maprow.is-b2 .mp-bsp.is-fehler { color: var(--danger); font-family: inherit; white-space: normal; }
/* Hinweis zur letzten Aktion unter der Zeile, z. B. „Zuordnung von ‚Gang‘ aufgehoben“ */
.maprow.is-b2 .mp-hinweis { color: var(--warn); font-weight: 600; white-space: normal; line-height: 1.5; }

/* Quellspalten: je Spalte die Verwendung — Zusatzspalte (Vorgabe) oder verwerfen (B17 §2.2) */
.quellen { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.quelle { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 12.5px; }
.quelle .q-name { font-weight: 700; font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quelle .q-wahl { max-width: 100%; font-size: 11.5px; padding: 3px 6px; }
.quelle .q-bsp { grid-column: 1 / -1; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quelle.is-belegt { border-color: var(--navy-line); background: var(--navy-soft); }
.quelle.is-zusatz { border-style: dashed; }
.quelle.is-verworfen { opacity: .6; }
.quelle.is-verworfen .q-name { text-decoration: line-through; }
/* Prüfmodus 1b: Zusatzspalten aus der Kundendatei (B17 §2.2) */
.filterbar .check { margin-top: 0; white-space: nowrap; }
.table-std th.is-zusatz, .table-std td.is-zusatz { background: var(--surface-2); }
.table-std th.is-zusatz { font-style: italic; }

/* Auswege am Befund (B18): Knopfreihe unter den Handlungsoptionen */
.table-std tr.is-gruppenstart td { border-top: 2px solid var(--border-strong); }

/* Karte „Spalten zusammenführen" (K03, B17) — Aufbau wie die Bereich-Split-Karte */
.zf-karte { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); }
.zf-karte.is-aktiv { border-style: solid; border-color: var(--vorschlag-line); background: var(--vorschlag-soft); }
.zf-liste { display: grid; gap: 10px; }
.zf-regel { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.zf-regel .field { min-width: 0; }
.zf-regel .mp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.zf-regel .mp-bsp { display: block; margin-top: 4px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; }
.zf-regel .mp-bsp.is-fehler { color: var(--danger); font-family: inherit; white-space: normal; }
.zf-regel > button { align-self: end; }
@media (max-width: 900px) { .zf-regel { grid-template-columns: 1fr; } .zf-regel > button { justify-self: start; } }

/* Zusammenführung und Bereich-Split auf demselben Feld: sichtbarer Konflikt, kein stiller Ersatz
   (E7, Audit 11.09.2026). Gilt in der Karte, in der Regelzeile und in der Zuordnungszeile. */
.zf-regel.is-konflikt { border-color: var(--danger-line); background: var(--danger-soft); }
.zf-konflikt { display: block; margin-top: 4px; color: var(--danger); font-weight: 600; line-height: 1.5; white-space: normal; }

.split-karte { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); }
.split-karte.is-aktiv { border-style: solid; border-color: var(--vorschlag-line); background: var(--vorschlag-soft); }

.table-std tr.is-geaendert td { background: var(--warn-soft); }


/* Der Baustein „Befund“ steht seit B25 in bausteine.css — er wird auch außerhalb des
   Wizards gebraucht (Screen 1c, Prüfung je Zone). */

/* --- Korrektur-Regeln und Diff-Karte ------------------------------------ */
.regeln { display: grid; gap: 8px; }
.regel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.regel .rg-id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.regel .rg-param { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.regel.is-vorschlag { border-color: var(--vorschlag-line); background: var(--vorschlag-soft); }
.diffkarte { border: 1px solid var(--navy-line); border-radius: var(--radius); background: var(--surface); }
.diffkarte .dk-head { padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--navy-soft); border-radius: var(--radius) var(--radius) 0 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.diffkarte .dk-body { padding: 16px 18px; display: grid; gap: 18px; }
.delta { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.delta .dl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.delta .table-std { font-size: 12.5px; margin-top: 8px; }
.delta .table-std td { padding: 6px 10px; font-family: var(--mono); }
.delta .d-alt { color: var(--muted); text-decoration: line-through; }
.delta .d-neu { font-weight: 700; color: var(--navy); }

.vorlage-mapping { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
@media (max-width: 720px) { .vorlage-mapping { grid-template-columns: 1fr; } }

/* === B3-Ergänzungen === */
/* Pickdaten-Wizard (Datumsformat-Wahl, Zeitraum-Karte, H01-Optionen,
   Artikel-Abgleich, Faktenbasis-Karte). Nur vorhandene Tokens.           */

/* --- Datumsformat-Wahl ---------------------------------------------------- */
.datumsformat { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.datumsformat.is-pflicht { border-style: solid; border-color: var(--warn-line); background: var(--warn-soft); }
.datumsformat select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.datumsformat .hint.is-fehler { color: var(--danger); font-weight: 600; }

/* --- Erkannter Zeitraum --------------------------------------------------- */
.zeitraum-karte .zr-gross { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.zeitraum-karte.is-leer .zr-gross { font-size: 18px; font-weight: 600; }
.zeitraum-karte .zr-hinweis { color: var(--navy); }

/* --- H01: Drei-Optionen-Entscheidung -------------------------------------- */
.h01-optionen { display: grid; gap: 10px; }
.h01-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
@media (max-width: 720px) { .h01-option { grid-template-columns: 1fr; } }
.entscheidung { padding: 10px 12px; border: 1px solid var(--navy-line); border-radius: var(--radius-sm); background: var(--navy-soft); font-size: 13px; }

/* --- K01: Artikel-Abgleich ------------------------------------------------ */
.abgleich-tabelle { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.abgleich-tabelle .table-std th { position: sticky; top: 0; z-index: 1; }
.abgleich-tabelle .table-std td { padding: 6px 10px; }
.abgleich-tabelle input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--link); }
.abgleich-tabelle tr.is-uebernommen td { background: var(--vorschlag-soft); color: var(--muted); }
