/* wartung – Stile der App „Wartung“ und der Bausteine in /assets/anlagen.js (Karte „Anlagen“ in CRM und Baustelle,
   Dialog „Anlage anlegen“). Nur Variablen aus app.css, Präfix .wt-. Dunkelmodus über die Variablen. */

/* ---------- Karte „Anlagen“ (auch in anderen Apps) ---------- */
.wt-karte-box { display: block; }
.wt-karte { margin-bottom: 18px; }
.wt-karte-titel { display: inline-flex; align-items: center; gap: 8px; }
.wt-karte-titel .ico { color: var(--copper); }
.wt-karte-wartung { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--copper-tint); flex-wrap: wrap; }
.wt-karte-wartung .grow { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.wt-karte-wartung small { color: var(--ink-2); font-size: 13px; }
.wt-karte .list .m .ico, .wt-karte-wartung .ico { width: 14px; height: 14px; }

/* ---------- Kunde wählen, Objektadresse, art-eigene Felder ---------- */
.wt-kunde-suche { display: grid; gap: 8px; }
.wt-kunde-suche .search { max-width: none; }
.wt-treffer { max-height: 236px; overflow-y: auto; }
.wt-treffer li { padding: 10px 14px; min-height: 44px; }
.wt-treffer li.muted { cursor: default; }
.wt-kunde-gewaehlt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); }
.wt-kunde-gewaehlt .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.wt-kunde-gewaehlt small { font-size: 12.5px; }
.wt-kunde-neu, .wt-adresse-neu { display: grid; gap: 12px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 8px; }
.wt-kunde-neu .two, .wt-adresse-neu .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wt-daten-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 14px; padding: 12px; border-radius: 8px; background: var(--surface-2); }
.wt-daten-felder:empty { display: none; }

/* ---------- Seiten ---------- */
.wt-reiter { margin-bottom: 16px; }
.wt-spalten { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.wt-spalte { min-width: 0; }
.wt-kopf .grow { flex: 1; min-width: 0; }
.wt-kopf h2 { overflow-wrap: anywhere; }
.wt-block { display: block; margin-top: 2px; font-weight: 400; }
.wt-filter { margin-bottom: 14px; }
.wt-filter .grow { flex: 1; }
.wt-artwahl select { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); appearance: auto; }
.wt-galerie { margin-bottom: 12px; }
.wt-dateien-weg { margin-top: 12px; }
.wt-dateien-weg summary { cursor: pointer; padding: 6px 0; }
.wt-verlauf li { align-items: flex-start; }
.wt-v-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--copper); }
.wt-punkte { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.wt-nfc-warte { margin: 6px auto; }

/* ---------- Wartungsprotokoll (Handy zuerst: große Felder, Ja/Nein-Tasten) ---------- */
.wt-wartung .chip-hinweis { margin: 0 0 14px; }
.wt-anlage-pr .card-head { align-items: flex-start; }
.wt-anlage-pr .card-head .grow { flex: 1; min-width: 0; }
.wt-punkt { align-items: flex-start; min-height: 56px; }
.wt-punkt > .grow { flex: 1; min-width: 0; display: grid; gap: 8px; padding-top: 10px; line-height: 1.35; }
.wt-bemerkung { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--bad); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 15px; }
.wt-punkt .jn { width: 52px; height: 52px; }
.wt-punkt .jn[disabled] { cursor: default; opacity: .75; }
.wt-messwerte { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; padding: 12px; border-radius: 8px; background: var(--surface-2); }
.wt-messwerte input { font-family: var(--mono); font-size: 16px; }
.wt-speichern { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.wt-speichern [data-wt-stand] { flex: 1; min-width: 140px; }
.wt-unterschrift .form { gap: 12px; }
.wt-sig { max-width: 320px; width: 100%; height: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ---------- Vertrag anlegen/ändern ---------- */
.wt-formular > .form { gap: 18px; }
.wt-formular .card-body.form { gap: 14px; }
.wt-formular .two, .wt-anlage-form .two { align-items: start; }
.wt-wahl { margin: 0; flex-wrap: wrap; }
.wt-wahl label { position: relative; display: inline-flex; }
.wt-wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wt-wahl span { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.wt-wahl input:checked + span { background: var(--nav); border-color: var(--nav); color: var(--nav-ink); }
.wt-wahl input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }
.wt-pos-liste { display: grid; gap: 10px; margin-bottom: 10px; }
.wt-pos { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.wt-pos-weg { margin-bottom: 1px; color: var(--bad); }

/* Einstellungen: abgeschaltete Partner-App */
.af-schalter.wt-aus { opacity: .8; }
.af-schalter em { font-style: normal; color: var(--warn); }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 900px) {
  .wt-spalten { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 640px) {
  .wt-kopf { flex-direction: column; align-items: flex-start; gap: 10px; }
  .wt-kunde-neu .two, .wt-adresse-neu .two { grid-template-columns: minmax(0, 1fr); }
  .wt-pos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wt-pos-text { grid-column: 1 / -1; }
  .wt-pos-weg { justify-self: end; }
  .wt-karte-wartung .btn { width: 100%; }
  .wt-speichern .btn { flex: 1; }
  .wt-messwerte { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wt-artwahl, .wt-artwahl select { width: 100%; }
}
