/* Sendungsmaske /versand/{id}/bearbeiten wie ShipmentDetailView des PC-Programms (Bauplan Web-App Versand, Aufgabe 10): Kopf mit
   Nummer, Status, „Speichern“ und „Label erstellen“, nach dem Label das grüne Band mit einer Karte je Paket, darunter die Schritte –
   zu mit Kurzfassung, offen mit ihren Feldern. Nur Klassen mit der Vorsilbe vm- (Wächter VersandMaskeStileTests: eine Regel auf
   geteilte Klassen wie .ein oder .fm-z änderte jede Maske der Web-App). Marken aus oo.css, Ecken 3 px, Haarlinien, Blau nur für die
   Hauptaktion; Farbe trägt Bedeutung (grün erledigt, bernstein Hinweis, rot fehlt). Eingebunden in Dokument.razor nach oo.versand.css. */

/* ── Wurzel ────────────────────────────────────────────────────────────────────────────────────────────────────
   ☠️ .oo-inhalt ist overflow: hidden: die Maske rollt selbst und darf im Flex-Rahmen schrumpfen (sonst lägen die unteren Schritte
   unerreichbar unter dem Fensterrand, Falle der Import-Seite vom 16.11.2026). position: relative schließt unsichtbare Hilfstexte ein. */
.vm { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; background: var(--grund);
  container-type: inline-size; padding-bottom: 32px; }

/* ── Kopf: klebt oben im Rollbereich ──────────────────────────────────────────────────────────────────────────── */
.vm-kopf { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 52px;
  padding: 8px 20px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.vm-zurueck { flex: 0 0 auto; }
.vm-titel { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.vm-titel h1 { margin: 0; font-size: 17px; font-weight: 600; color: var(--tinte-1); white-space: nowrap; }
.vm-titel-an { min-width: 0; color: var(--tinte-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-kopf-rechts { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.vm-stand { color: var(--tinte-4); font-size: 12px; white-space: nowrap; }
.vm-stand.vm-ungespeichert { color: var(--warn); font-weight: 600; }
.vm-label { height: auto; min-height: 36px; padding: 3px 14px; display: inline-flex; align-items: center; gap: 6px; }
.vm-label .kreisel { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
.vm-label-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: left; }
.vm-label-unter { font-size: 11.5px; font-weight: 400; opacity: .85; }

/* ── Breite der Inhalte unter dem Kopf ────────────────────────────────────────────────────────────────────────── */
.vm-nurlesen, .vm-band, .vm-unterwegs, .vm-schritte { box-sizing: border-box; max-width: 1120px; margin: 12px 20px 0; }
.vm-leer { margin-top: 12vh; }
.vm-laedt { display: flex; justify-content: center; padding: 48px 0; }
/* ☠️ Die Wurzel ist eine rollende Flex-Spalte: ihre Kinder schrumpfen nie. Der Kopf trägt min-height: 52px (ersetzt die Untergrenze
   aus dem Inhalt) und wurde am Handy, auf zwei Zeilen umgebrochen, auf 52 px gedrückt: „Speichern“ lag über dem Band (20.11.2026). */
.vm-kopf, .vm-nurlesen, .vm-band, .vm-unterwegs, .vm-schritte, .vm-leer, .vm-laedt { flex-shrink: 0; }

.vm-nurlesen { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--flaeche-2); border: 1px solid var(--linie);
  border-radius: 3px; color: var(--tinte-3); }

/* ── Grünes Band nach dem Label ───────────────────────────────────────────────────────────────────────────────── */
.vm-band { display: grid; gap: 8px; padding: 10px 12px; background: var(--ok-grund); border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--linie));
  border-radius: 3px; }
.vm-band-kopf { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.vm-band-text { color: var(--tinte-1); font-weight: 600; }
.vm-band-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
.vm-paketkarten { display: flex; flex-wrap: wrap; gap: 6px; }
.vm-paketkarte { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 8px; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 3px; font-size: 12.5px; }
.vm-paketkarte-nr { font-weight: 600; color: var(--tinte-1); }
.vm-band-hinweis { margin: 0; color: var(--tinte-4); font-size: 12px; }

/* ── Unterwegs (versendet, zugestellt …) ──────────────────────────────────────────────────────────────────────── */
.vm-unterwegs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 3px;
  background: color-mix(in srgb, var(--akzent) 6%, var(--flaeche)); }
.vm-unterwegs-text { flex: 1 1 260px; color: var(--tinte-2); }

/* ── Schritte ─────────────────────────────────────────────────────────────────────────────────────────────────── */
.vm-schritte { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 3px; }
.vm-schritt { border-top: 1px solid var(--linie); }
.vm-schritt:first-child { border-top: 0; }
.vm-schritt-kopf { display: grid; grid-template-columns: 18px minmax(150px, 210px) minmax(0, 1fr) auto; grid-template-areas: "z t k b";
  align-items: center; gap: 4px 10px; min-height: 40px; padding: 4px 12px; }
.vm-schritt.offen .vm-schritt-kopf { grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-areas: "z t b"; }
.vm-schritt-zeichen { grid-area: z; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--tinte-5); }
.vm-schritt.ok .vm-schritt-zeichen { color: var(--ok); }
.vm-schritt.hinweis .vm-schritt-zeichen { color: var(--warn); }
.vm-schritt.fehlt .vm-schritt-zeichen { color: var(--alarm); }
.vm-schritt-titel { grid-area: t; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--tinte-1); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.vm-schritt-kurz { grid-area: k; display: flex; gap: 12px; min-width: 0; }
.vm-kurz-links { flex: 1 1 auto; min-width: 0; color: var(--tinte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-kurz-rechts { flex: 0 1 auto; min-width: 0; color: var(--tinte-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-bearbeiten { grid-area: b; }
.vm-schritt.offen .vm-bearbeiten { visibility: hidden; }

/* Befunde des Prüfers unter dem Kopf: je Zeile ein Sprung zum Feld; rot fehlt, bernstein Hinweis. */
.vm-befunde { list-style: none; margin: 0; padding: 0 16px 8px 40px; display: grid; gap: 1px; }
.vm-befunde li.fehlt { color: var(--alarm); }
.vm-befunde li.hinweis { color: var(--warn); }
.vm-befund { appearance: none; border: 0; background: none; padding: 1px 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.vm-befund:hover { text-decoration: underline; }
.vm-befund:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 3px; }

.vm-schritt-inhalt { padding: 4px 16px 14px 40px; }
/* Beschriftungen der Felder (Baustein Feld): die Texte des PC-Programms sind lang („Straße und Hausnummer *“, „Transportversicherung
   (Betrag)“) – mehr Platz als die 136 px der übrigen Masken, und umbrechen statt abschneiden. */
.vm-schritt-inhalt .fm-z { grid-template-columns: 190px minmax(0, 1fr); }
.vm-schritt-inhalt .fm-z > label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
.vm-schritt-fuss { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linie-fein); }

/* ── Teile eines Schritts ─────────────────────────────────────────────────────────────────────────────────────── */
.vm-teil + .vm-teil { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linie-fein); }
.vm-von, .vm-an, .vm-bezahlung, .vm-produkt, .vm-etikett { max-width: 680px; }
.vm-teil-titel { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; font-size: 12.5px; font-weight: 600;
  color: var(--tinte-2); }
.vm-teil-unter, .vm-pflicht-hinweis { font-size: 12px; font-weight: 400; color: var(--tinte-4); }
.vm-unterteil { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linie-fein); }
.vm-unter-titel { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 6px; font-size: 12px; font-weight: 600;
  color: var(--tinte-3); }
.vm-raster2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); column-gap: 28px; }
.vm-raster3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: 24px; }
.vm-zeile { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); column-gap: 16px; }
.vm-zusaetze { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.vm-zeile-eng { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vm-land { max-width: 64px; }

.vm-leise { color: var(--tinte-4); }
.vm-warn { color: var(--warn); }
.vm-gut { color: var(--ok); }
.vm-wert { display: inline-flex; align-items: center; min-height: 28px; color: var(--tinte-1); }
.vm-hinweis-klein { margin: 4px 0 0; font-size: 12px; }
.vm-grenzen { margin: -2px 0 6px 146px; font-size: 12px; }
.vm-von-text { margin: 0; padding: 6px 8px; background: var(--flaeche-2); border-radius: 3px; color: var(--tinte-2); white-space: pre-line; }
.vm-von-text.vm-warn { background: var(--warn-grund); color: var(--warn); }
.vm-hinweis-band { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; padding: 6px 10px; background: var(--flaeche-2);
  border: 1px solid var(--linie); border-radius: 3px; color: var(--tinte-2); font-size: 12.5px; }
.vm-knopfzeile { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Haken (Express, Blindversand, Zusatzleistungen) */
.vm-haken-zeile { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 2px 0 6px 146px; }
.vm-haken-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); column-gap: 20px; }
.vm-haken { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; color: var(--tinte-1); cursor: pointer; }
.vm-haken input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; accent-color: var(--akzent); }
.vm-haken input:disabled + span { color: var(--tinte-4); }

/* ── Tabellen (Positionen, Paketinhalt) ───────────────────────────────────────────────────────────────────────── */
.vm-tabelle-huelle { overflow-x: auto; border: 1px solid var(--linie); border-radius: 3px; }
.vm-tabelle { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.vm-tabelle th { height: 28px; padding: 0 8px; text-align: left; font-weight: 600; color: var(--tinte-4); background: var(--flaeche-2);
  border-bottom: 1px solid var(--linie); white-space: nowrap; }
.vm-tabelle td { height: 28px; padding: 0 8px; border-bottom: 1px solid var(--linie-fein); color: var(--tinte-1); }
.vm-tabelle tbody tr:last-child td { border-bottom: 0; }
.vm-tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-tabelle tr.vm-offen td:last-child { color: var(--warn); font-weight: 600; }
.vm-tabelle .vm-inhalt-menge { width: 64px; text-align: right; }
/* Haken „Versand“ je Position (wie die erste Spalte am PC); eine nicht versendete Position steht grau da. */
.vm-tabelle .vm-spalte-haken { width: 1%; text-align: center; white-space: nowrap; }
.vm-tabelle .vm-versand-haken { width: 14px; height: 14px; margin: 0; vertical-align: middle; accent-color: var(--akzent); cursor: pointer; }
.vm-tabelle .vm-versand-haken:disabled { cursor: default; }
.vm-tabelle tr.vm-nicht-versand td:not(.vm-spalte-haken) { color: var(--tinte-4); }
.vm-summe { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; color: var(--tinte-3); font-variant-numeric: tabular-nums; }
.vm-inhalt-zeile { margin: 6px 0 0; font-size: 12.5px; }

/* ── Verpackung ───────────────────────────────────────────────────────────────────────────────────────────────── */
.vm-paketliste { display: grid; border: 1px solid var(--linie); border-radius: 3px; }
.vm-paket { display: grid; grid-template-columns: 76px repeat(4, minmax(80px, 112px)) minmax(0, 1fr); align-items: end; gap: 10px; padding: 8px 10px;
  border-top: 1px solid var(--linie-fein); }
.vm-paket:first-child { border-top: 0; }
.vm-paket.vm-mit-label { background: color-mix(in srgb, var(--ok-grund) 55%, var(--flaeche)); }
.vm-paket .fm-z { grid-template-columns: minmax(0, 1fr); gap: 2px; min-height: 0; margin: 0; }
.vm-paket .fm-z > label { font-size: 11.5px; }
.vm-paket-nr { align-self: center; font-weight: 600; color: var(--tinte-1); }
.vm-paket-rechts { align-self: center; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; min-width: 0; }
.vm-paket-inhalt { max-width: 100%; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-pakete-fuss { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vm-leer-pakete { display: grid; gap: 6px; justify-items: start; padding: 12px; border: 1px dashed var(--linie-stark); border-radius: 3px; }
.vm-vorschlag-eins, .vm-vorschlag-stueck { height: auto; min-height: 40px; padding: 4px 12px; display: inline-flex; flex-direction: column;
  align-items: flex-start; gap: 0; line-height: 1.3; text-align: left; }

/* ── Etikett ──────────────────────────────────────────────────────────────────────────────────────────────────── */
.vm-wahlkachel { display: flex; align-items: flex-start; gap: 10px; max-width: 520px; margin-bottom: 8px; padding: 10px 12px;
  border: 1px solid var(--linie); border-radius: 3px; }
.vm-wahlkachel.gewaehlt { border-color: var(--linie-stark); background: var(--flaeche-2); }
.vm-wahlkachel > span { display: grid; gap: 2px; }

/* ── Übersicht ────────────────────────────────────────────────────────────────────────────────────────────────── */
.vm-bereit { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--ok); font-weight: 600; }
.vm-fehlt-liste { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--linie); border-radius: 3px; }
.vm-fehlt-liste li { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 32px;
  padding: 2px 8px; border-top: 1px solid var(--linie-fein); }
.vm-fehlt-liste li:first-child { border-top: 0; }
.vm-fehlt-schritt { font-weight: 600; color: var(--tinte-2); }
.vm-fehlt-text { color: var(--alarm); }
.vm-hinweis-liste { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 1px; }
.vm-hinweis-liste li { color: var(--warn); }
.vm-verlauf { list-style: none; margin: 0; padding: 0; display: grid; }
.vm-verlauf li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 26px;
  border-top: 1px solid var(--linie-fein); font-size: 12.5px; }
.vm-verlauf li:first-child { border-top: 0; }

/* ── Schmal (Tablet hochkant, Handy): Breite der Maske, nicht des Fensters ──────────────────────────────────────── */
@container (width < 760px) {
  .vm-kopf { padding: 8px 12px; }
  .vm-kopf-rechts { width: 100%; justify-content: stretch; }
  .vm-label { flex: 1 1 auto; justify-content: center; }
  .vm-nurlesen, .vm-band, .vm-unterwegs, .vm-schritte { margin: 10px 12px 0; }
  .vm-schritt-kopf { grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-areas: "z t b" ". k k"; }
  .vm-schritt-kurz { flex-direction: column; gap: 0; }
  .vm-befunde { padding-left: 40px; padding-right: 12px; }
  .vm-schritt-inhalt { padding: 4px 12px 12px; }
  .vm-schritt-inhalt .fm-z { grid-template-columns: 136px minmax(0, 1fr); }
  .vm-zeile { grid-template-columns: minmax(0, 1fr); }
  .vm-grenzen, .vm-haken-zeile { margin-left: 0; }
  .vm-paket { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vm-paket-nr, .vm-paket-rechts { grid-column: 1 / -1; }
  .vm-paket-rechts { justify-content: flex-start; }
  .vm-fehlt-liste li { grid-template-columns: minmax(0, 1fr) auto; }
  .vm-fehlt-schritt { grid-column: 1 / -1; }
  .vm-verlauf li { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 0; }
}
