/* GlasERP – AVOR-Übersicht je Position und «Abschliessen & an AVOR» (8.11.2026, AVOR-Gesamtablauf, public/avor-ansicht.js).
   KURTH-Design: weiss, schwarze Schrift, eckig. Stand immer als Text, Farbe nur ergänzend. Desktop: Liste und Details nebeneinander;
   Tablet und Handy: Karten, die Details stehen beim Öffnen oben, «Zur Liste» führt zurück. Pflichtknöpfe mindestens 44 px auf Touch. */
.avor-seite { display: grid; gap: 12px; }
.avor-kopf h1 { margin: 0; }
.avor-kopf .sub { margin: 2px 0 0; }
.avor-schritte { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; }
.avor-schritte li { display: flex; align-items: center; gap: 8px; border: 1px solid #d6d6d6; padding: 6px 10px; font-size: 13px; color: #555; min-width: 0; }
.avor-schritte li span { display: inline-block; min-width: 22px; height: 22px; line-height: 22px; text-align: center; border: 1px solid #1a1a1a; font-size: 12px; }
.avor-schritte li.aktiv { border-color: #1a1a1a; color: #1a1a1a; font-weight: 600; }
.avor-schritte li.aktiv span { background: #1a1a1a; color: #fff; }
.avor-stufen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid #1a1a1a; }
.avor-stufe { border: 0; border-right: 1px solid #1a1a1a; background: #fff; color: #1a1a1a; padding: 10px 8px; font-size: 14px; border-radius: 0; min-height: 44px; cursor: pointer; }
.avor-stufe:last-child { border-right: 0; }
.avor-stufe b { margin-left: 6px; }
.avor-stufe.aktiv { background: #1a1a1a; color: #fff; }
.avor-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.avor-filter label { display: grid; gap: 2px; font-size: 12px; color: #555; margin: 0; }
.avor-filter .avor-suche { flex: 1 1 260px; }
.avor-filter input, .avor-filter select { min-height: 38px; }
.avor-sammel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: 1px solid #1a1a1a; padding: 8px 10px; background: #fafafa; }
.avor-sammel span { flex: 1 1 240px; }
.avor-haupt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.avor-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid #1a1a1a; }
.avor-zeile { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 6px; border-bottom: 1px solid #e3e3e3; padding: 4px 4px; }
.avor-zeile.offen { background: #f4f4f4; }
.avor-zeile.gewaehlt { box-shadow: inset 3px 0 0 #1a1a1a; }
.avor-wahl { display: flex; align-items: center; justify-content: center; margin: 0; min-height: 44px; }
.avor-wahl input { width: 18px; height: 18px; }
.avor-zeile-knopf { display: grid; grid-template-columns: 64px minmax(0, 1fr) 96px minmax(0, 220px); align-items: center; gap: 10px; text-align: left;
  background: transparent; border: 0; padding: 4px 0; color: inherit; font: inherit; cursor: pointer; border-radius: 0; min-height: 44px; }
.avor-mini { width: 64px; height: 44px; object-fit: contain; background: #fff; border: 1px solid #e3e3e3; }
.avor-kern, .avor-termin, .avor-stand { display: grid; gap: 1px; min-width: 0; }
.avor-kern small, .avor-termin small, .avor-stand small { color: #555; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avor-stand small { white-space: normal; }
.avor-eil { display: inline-block; border: 1px solid #b91c1c; color: #b91c1c; font-size: 11px; padding: 0 4px; }
.avor-aktion { justify-self: end; }
.avor-hinweis { color: #555; font-size: 12px; }
.avor-st { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 6px; border: 1px solid #1a1a1a; width: fit-content; }
.avor-st-neu { background: #fff; }
.avor-st-in_bearbeitung { background: #eef3fb; border-color: #2c5aa0; color: #1d3f75; }
.avor-st-wartet { background: #fdf3e6; border-color: #b45f06; color: #7a3f00; }
.avor-st-bereit { background: #eef7ee; border-color: #2e7d32; color: #1b5e20; }
.avor-leer { padding: 16px 4px; color: #555; }
.avor-seitenteil { display: none; }
.avor-seite.mit-detail .avor-seitenteil { display: block; order: -1; }
.avor-detail, .avor-detail-leer { border: 1px solid #1a1a1a; padding: 12px; background: #fff; }
.avor-detail-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avor-detail-kopf h2 { margin: 0; font-size: 18px; flex: 1 1 auto; }
.avor-skizze { margin: 10px 0; border: 1px solid #e3e3e3; background: #fff; }
.avor-skizze img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.avor-fakten { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 10px; margin: 0 0 10px; font-size: 13px; }
.avor-fakten dt { color: #555; }
.avor-fakten dd { margin: 0; }
.avor-detail h3 { font-size: 13px; margin: 12px 0 4px; }
.avor-gruende { border-left: 3px solid #b45f06; padding: 4px 10px; background: #fdf8f1; }
.avor-gruende ul { margin: 0; padding-left: 18px; }
.avor-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.avor-tab td { border-bottom: 1px solid #eee; padding: 4px 6px 4px 0; }
.avor-prog { font-weight: 600; }
.avor-prog-veraltet, .avor-prog-fehler, .avor-prog-gesperrt, .avor-prog-fehlt { color: #b45f06; }
.avor-prog-vorbereitet, .avor-prog-freigegeben, .avor-prog-heruntergeladen { color: #1b5e20; }
.avor-detail-aktion { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* «Abschliessen & an AVOR»: Fenster mit Druckknöpfen bzw. Gründen */
.abschluss-fenster h2 { margin-top: 0; }
.abschluss-gruende { margin: 0 0 10px; padding-left: 18px; }
.abschluss-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* Desktop: Liste links, Details rechts – das Seitenteil ist immer da (ohne Wahl ein Hinweis) */
@media (min-width: 1100px) {
  .avor-haupt { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .avor-seitenteil { display: block; position: sticky; top: 12px; }
  .avor-seite.mit-detail .avor-seitenteil { order: 0; }
  .avor-zu { display: none; }
}
/* Tablet hoch und Handy: Zeile als Karte, Aktion darunter */
@media (max-width: 820px) {
  .avor-zeile { grid-template-columns: 36px minmax(0, 1fr); }
  .avor-aktion { grid-column: 2; justify-self: start; padding-bottom: 6px; }
  .avor-zeile-knopf { grid-template-columns: 64px minmax(0, 1fr); }
  .avor-termin, .avor-stand { grid-column: 2; }
  .avor-schritte { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .avor-stufen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avor-stufe:nth-child(2) { border-right: 0; }
  .avor-stufe:nth-child(-n+2) { border-bottom: 1px solid #1a1a1a; }
}
@media (pointer: coarse) {
  .avor-naechste, .avor-sammel .btn-primary, .avor-sammel .btn-secondary, .avor-detail-aktion .btn, .avor-alle, .avor-zu { min-height: 44px; }
}
/* Zuschnittoptimierung: Rückweg zur AVOR, wenn die Auswahl von dort kam (public/programme-optimierer.js) */
.og-aus-avor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; font-size: 13px; color: #555; }
.avor-vorgelagert { border-left: 3px solid #2c5aa0; padding: 4px 10px; background: #f3f6fb; font-size: 13px; margin: 8px 0; }
.avor-offen { margin: 0; padding-left: 18px; font-size: 13px; }
