/* KM Angebot — CI: Navy/Grün-Töne des Farbklimas, Calibri-nah */
:root {
  --gruen: #3F7560;      /* KM-Dunkelgrün */
  --mint:  #74A98C;      /* KM-Grün hell */
  --navy:  #22333F;
  --korall:#E95E55;
  --bg:    #F4F7F5;
  --card:  #FFFFFF;
  --text:  #1E2A26;
  --muted: #6B7B74;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Calibri, "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 17px;
  overscroll-behavior: none;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.warn { color: var(--korall); font-weight: 600; }
.grow { flex: 1; }
.preis { font-variant-numeric: tabular-nums; }

.view { position: fixed; inset: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff;
  padding: max(env(safe-area-inset-top), 8px) 12px 8px 12px;
}
.topbar h1 { font-size: 1.15em; margin: 0; letter-spacing: .5px; }
.topbar h1 span, .login-box h1 span { color: var(--mint); font-weight: 400; }
.pill { background: rgba(255,255,255,.15); border-radius: 999px; padding: 3px 12px; font-size: .8em; }
.content { flex: 1; overflow-y: auto; padding: 14px; padding-bottom: 24px; }

/* Buttons */
button {
  font: inherit; border: none; border-radius: var(--radius);
  padding: 10px 16px; cursor: pointer; background: #E3ECE7; color: var(--text);
}
button.primary { background: var(--gruen); color: #fff; font-weight: 600; }
button.primary:active { background: var(--mint); }
button.ghost { background: transparent; color: inherit; }
.topbar button.ghost { color: #fff; }
button.big { width: 100%; padding: 15px; font-size: 1.05em; margin: 6px 0; }
button.small { padding: 6px 10px; font-size: .85em; }
.row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.aktionen { margin-top: 14px; }
.aktionen button { flex: 1; }

/* Login */
#view-login { align-items: center; justify-content: center; background: var(--navy); }
.login-box { background: var(--card); border-radius: var(--radius); padding: 28px; width: min(90vw, 380px); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.login-box h1 { margin: 0; color: var(--navy); }
input, select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid #C9D6CF; border-radius: 10px;
  background: #fff; width: 100%;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: .9em; color: var(--muted); }
label input, label select { color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.grid2 .span2 { grid-column: span 2; }

/* Liste */
.angebot-card {
  background: var(--card); border-radius: var(--radius); padding: 14px; margin: 10px 0;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.angebot-card .status { font-size: .78em; padding: 3px 10px; border-radius: 999px; background: #E3ECE7; white-space: nowrap; }
.angebot-card .status.auftrag { background: var(--mint); color: #fff; }
.angebot-card .status.abgelehnt { background: #F4D5D2; }
.banner { background: #FFF2CC; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-size: .9em; }
.banner.green { background: var(--mint); color: #fff; }

/* Editor Split (hochkant: oben Angebot, unten Block) */
#editor-split { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#quote-pane { flex: 1; min-height: 0; }
#pad-pane {
  height: 46vh; min-height: 0; display: flex; flex-direction: column;
  border-top: 3px solid var(--gruen); background: #fff;
}
#pad-pane.collapsed { height: 0; border-top: none; overflow: hidden; }
/* F66: „minimiert" — Pad-Editor zu, nur die schmale Toolbar-Leiste (mit dem Pfeil) bleibt;
   collapsed (= komplett weg) bleibt dem Präsentationsmodus vorbehalten */
#pad-pane.minimiert { height: auto; }
/* Präsentationsmodus schlägt minimiert: beide Klassen gleichzeitig → Pad KOMPLETT weg */
#pad-pane.collapsed.minimiert { height: 0; }
#pad-pane.minimiert #pad-editor { flex: none; height: 0; min-height: 0; overflow: hidden; }
#pad-pane.minimiert #btn-pad-save, #pad-pane.minimiert #btn-pad-clear { display: none; }
#pad-toolbar { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: #Eef4F0; }
#btn-pad-minimieren { font-size: 1.1em; line-height: 1; padding: 6px 14px; }
#pad-editor { flex: 1; min-height: 0; }
#pad-editor .imageEditorContainer { width: 100%; height: 100%; }

details { background: var(--card); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
summary { font-weight: 700; color: var(--gruen); cursor: pointer; padding: 4px 0; }
.card { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; box-shadow: 0 1px 3px rgba(0,0,0,.07); }

/* Anlagen & Positionen */
.anlage { border: 1px solid #DCE7E1; border-radius: 10px; padding: 10px; margin: 10px 0; }
.anlage input.anlage-name { font-weight: 700; border: none; background: transparent; padding: 4px 0; }
.anlage input.variante-input { width: 118px; font-size: .82em; padding: 6px 8px; }
/* F27: zusätzliche 32px-Spalte für den ✏-Stift neben dem ⓘ */
.pos-row { display: grid; grid-template-columns: 126px 1fr 32px 32px 30px; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px dashed #E2EAE5; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button { width: 36px; height: 40px; padding: 0; font-size: 1.15em; border-radius: 8px; background: #E3ECE7; flex: none; }
.stepper input.menge { width: 48px; text-align: center; padding: 8px 2px; }
.pos-row .bez { line-height: 1.25; }
.pos-row .bez .details { font-size: .78em; color: var(--muted); }
.pos-row .ep { text-align: right; font-size: .9em; }
.pos-row .ep .offen { color: var(--korall); font-weight: 700; }
.pos-row button.del { background: transparent; color: var(--korall); font-size: 1.1em; padding: 2px; }
.pos-row button.info-btn, .kat-item button.info-btn { background: transparent; color: var(--gruen); font-size: 1.05em; padding: 2px; }
.pos-row button.edit-btn { background: transparent; color: var(--muted); font-size: .95em; padding: 2px; }
/* F16: im Präsentationsmodus bleibt ⓘ sichtbar (Gerätedaten fürs Kundengespräch) —
   ✏-Stift, Aufmaß-🎤, ✨ Ausformulieren (beide .aufmass-btn) und alles Interne verschwinden */
.praesentation .pos-row { grid-template-columns: 126px 1fr 32px; }
.praesentation .ep, .praesentation #summen, .praesentation #nachlass-editor, .praesentation .aktionen,
.praesentation #sec-abschluss, .praesentation #sec-staende, .praesentation #q-status, .praesentation .del, .praesentation #skizzen-galerie,
.praesentation .edit-btn, .praesentation .aufmass-btn, .praesentation #btn-foto,
.praesentation #q-von,
.praesentation .check-chips { display: none !important; }   /* F70: Ersteller intern; F3/F76-Zweifel-Hinweise nie vorm Kunden */

/* F10: Schreibschutz nach Auftrag — nur PDF, Stände und Status bleiben bedienbar.
   Neue Buttons (✏-Stift, Aufmaß-🎤, 🔍 auswerten) sperrt die Pauschalregel automatisch mit;
   Mailversand bleibt möglich (läuft über das „PDF fertig"-Modal AUSSERHALB von #quote-pane). */
#quote-pane.gesperrt :is(input, select, textarea, button) { pointer-events: none; opacity: .65; }
#quote-pane.gesperrt :is(#btn-pdf, #q-status, .stand-btn, .info-btn) { pointer-events: auto; opacity: 1; }
#quote-pane.gesperrt #btn-unterschrift { display: none; }

/* Summen */
.summen { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; user-select: none; }
.sumrow { display: flex; justify-content: space-between; padding: 3px 0; }
.sumrow.total { border-top: 1px solid rgba(255,255,255,.3); margin-top: 6px; padding-top: 8px; font-size: 1.15em; }
.sumrow.variante-kopf { color: var(--mint); font-weight: 700; margin-top: 8px; }
.summen .warn { color: #FFD9A0; font-size: .82em; margin-top: 6px; }
/* F13: unscheinbarer Öffner für den Projektnachlass */
.summen .nachlass-trigger { display: block; margin-left: auto; background: transparent; color: rgba(255,255,255,.35); padding: 0 6px; font-size: 1em; line-height: 1; }
/* F10: PDF-Stände */
#staende-liste .stand-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed #E2EAE5; }
#staende-liste .stand-row:first-child { border-top: none; }

/* F64: ⚙-Funktionsmenü */
#modal-funktionen .modal-box { max-width: 480px; }
#btn-func-reset { color: var(--korall); }

/* Katalog-Modal */
.modal { position: fixed; inset: 0; background: rgba(20,30,26,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-box {
  background: var(--bg); border-radius: 18px 18px 0 0; width: 100%; max-width: 720px;
  max-height: 88vh; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.modal-box header { display: flex; justify-content: space-between; align-items: center; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.chips button { white-space: nowrap; border-radius: 999px; padding: 6px 14px; font-size: .85em; }
.chips button.aktiv { background: var(--gruen); color: #fff; }
.kat-liste { min-height: 120px; }
/* F20: Picker — feste Höhe, Kopf/Suche/Chips oben fix, NUR die Artikelliste scrollt,
   Neutralartikel-Zeile + Übernehmen fest am unteren Rand */
#modal-katalog .modal-box { height: 92vh; max-height: 92vh; overflow: hidden; }
#modal-katalog .kat-liste { flex: 1; min-height: 0; overflow-y: auto; }
.kat-item { background: var(--card); border-radius: 10px; padding: 10px 12px; margin: 6px 0; display: flex; gap: 10px; align-items: center; border: 2px solid transparent; }
.kat-item.gewaehlt { border-color: var(--gruen); background: #EAF3EE; }
.kat-item .info { flex: 1; }
.kat-item .info .details { font-size: .78em; color: var(--muted); }
.kat-item .stepper input.menge { width: 44px; }
.kat-item .preis-tag { font-size: .85em; white-space: nowrap; }
.kat-item .preis-tag.offen { color: var(--korall); }
/* F15/F20: Sammelkorb-Footer — jetzt festes Flex-Kind unter der scrollenden Liste */
.kat-footer { background: var(--bg); padding: 6px 0 2px; margin-top: 2px; display: flex; flex-direction: column; gap: 6px; }
.kat-footer > button { width: 100%; }
.kat-footer button:disabled { opacity: .45; }
#neutral-auswahl span { background: #EAF3EE; color: var(--gruen); border-radius: 999px; padding: 3px 10px; font-size: .78em; }
#neutral-auswahl:empty { display: none; }
/* F20: kompakte Neutralartikel-Zeile (eine Zeile; Menge/Einheit hinter dem ⚙) */
.neutral-zeile { display: flex; gap: 6px; align-items: center; }
.neutral-zeile #neutral-bez { flex: 1; min-width: 0; }
.neutral-zeile #neutral-preis { width: 104px; flex: none; }
.neutral-zeile button { flex: none; padding: 9px 13px; }
.neutral-detail { display: flex; gap: 10px; }
.neutral-detail label { flex: 1; }

/* Unterschrift */
#sign-canvas { width: 100%; height: 220px; background: #fff; border: 2px dashed var(--mint); border-radius: 10px; touch-action: none; }
/* F11: AGB-Bestätigung */
.agb-row { flex-direction: row !important; align-items: flex-start; gap: 10px; font-size: .88em; }
.agb-row input { width: auto; margin-top: 3px; }
.agb-row a { color: var(--gruen); }

/* F81: Widerrufsbelehrung im Sign-Modal (nur Privat) */
#widerruf-block { display: flex; flex-direction: column; gap: 8px; }
#widerruf-block > p { margin: 0; }
#widerruf-text { max-height: 180px; overflow-y: auto; background: #fff; border: 1px solid #DCE7E1; border-radius: 10px; padding: 8px 12px; font-size: .85em; }
#widerruf-text p { margin: 6px 0; }
#widerruf-vorzeitig { margin: 0; padding: 8px 12px; }
#widerruf-vorzeitig summary { font-size: .92em; }
#widerruf-canvas { width: 100%; height: 110px; background: #fff; border: 2px dashed var(--mint); border-radius: 10px; touch-action: none; }

/* F9: Info-Overlay */
#modal-info .modal-box { max-width: 560px; }
#info-bilder img { display: block; width: 100%; max-width: 400px; margin: 8px auto; background: #fff; border-radius: 10px; border: 1px solid #DCE7E1; }
#info-details { white-space: pre-line; font-size: .92em; }

/* F38: Farbvarianten im Info-Overlay — gestapelt, direkt vergleichbar */
#info-farbvarianten:not(:empty) { margin: 14px 0 10px; }
.farbvarianten-titel { display: block; margin-bottom: 6px; color: var(--gruen); }
.farbvariante { margin: 0 0 16px; text-align: center; }
.farbvariante img { display: block; width: 100%; max-width: 400px; margin: 0 auto; background: #fff; border-radius: 10px; border: 1px solid #DCE7E1; }
.farbvariante figcaption { font-size: .88em; color: var(--muted); margin-top: 5px; }

/* F59: Neue-Anlage-Modal — Quell-Buttons („Artikel übernehmen aus: …") als Karten-Liste */
#anlage-neu-quellen { display: flex; flex-direction: column; gap: 8px; }
#anlage-neu-quellen button { width: 100%; padding: 12px 14px; text-align: left; background: var(--card); }

/* F14: schwebender Diktat-Knopf — erscheint, sobald ein Textfeld den Fokus hat
   (schwebt auch über den Modals, z. B. für die Neutralartikel-Bezeichnung) */
#diktat-btn {
  position: fixed; right: 10px; top: 42%; z-index: 200;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gruen); color: #fff; font-size: 1.35em;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
#diktat-btn.rec { background: var(--korall); animation: diktat-puls 1.2s infinite; }
@keyframes diktat-puls { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* Anlagenkonzept + Prüf-Hinweise (F2/F3) */
.konzept-wrap textarea { margin-top: 4px; font-size: .92em; }
button.rec { background: var(--korall); color: #fff; }
.check-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.check-chips span { background: #FDECEA; color: #B3423A; border-radius: 999px; padding: 3px 10px; font-size: .78em; }
.check-chips span.soft { background: #FFF2CC; color: #7A5D00; }
/* F46: klickbare Chips springen in den Katalog-Picker (Position/Kategorie ergänzen) */
.check-chips span.klickbar { cursor: pointer; text-decoration: underline dotted; }
.check-chips span.klickbar:active { filter: brightness(.94); }
/* F76: Mengen-Plausibilität — eigener gelblicher Chip-Stil (weich, blockiert nichts) */
.check-chips span.menge { background: #FFF8DE; color: #8A6A00; border: 1px dashed #D9BB55; }
/* F76: Zielposition nach Chip-Klick kurz aufblinken lassen */
.pos-row.blink { animation: posBlink 1.6s ease-out; }
@keyframes posBlink { 0%, 55% { background: #FFF2CC; } 100% { background: transparent; } }

/* Skizzen */
#skizzen-galerie { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
#skizzen-galerie .skizze { position: relative; margin-bottom: 14px; }
#skizzen-galerie img { width: 130px; border-radius: 8px; border: 1px solid #DCE7E1; background: #fff; }
#skizzen-galerie button { position: absolute; top: -6px; right: -6px; background: var(--korall); color: #fff; border-radius: 50%; width: 26px; height: 26px; padding: 0; }

/* F17: Archiv-Bereich in der Übersicht */
#archiv-bereich summary { color: var(--muted); }
.angebot-card.archiviert { opacity: .65; }

/* F56: Reiter „Angebote | Anfragen" in der Übersicht */
.segmente { display: flex; background: #E3ECE7; border-radius: 999px; padding: 4px; margin: 2px 0 10px; }
.segmente button { flex: 1; border-radius: 999px; padding: 9px 12px; background: transparent; font-weight: 600; color: var(--muted); }
.segmente button.aktiv { background: var(--gruen); color: #fff; }

/* F56: Anfragen-Reiter — Suchzeile, Karten, Status-Badges */
.anfrage-filterzeile #anfrage-suche { flex: 1; min-width: 0; }
.anfrage-filterzeile #anfrage-sort { width: auto; flex: none; max-width: 48%; }
#anfragen-stand { margin: 4px 0 2px; }
.anfrage-card {
  background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.anfrage-card .kopf { display: flex; align-items: center; gap: 8px; }
.anfrage-card .meta { color: var(--muted); font-size: .85em; margin-top: 3px; }
.anfrage-card .schritt { font-size: .88em; margin-top: 6px; }
.anfrage-card .notizen {
  color: var(--muted); font-size: .85em; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.anfrage-card .fuss { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.anfrage-badge { font-size: .78em; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.anfrage-badge.status-offen { background: #FFE0B8; color: #8A5200; }        /* Offen = orange */
.anfrage-badge.status-erstellt { background: #D6E6F5; color: #1F4E79; }     /* erstellt = blau */
.anfrage-badge.status-versandt { background: var(--mint); color: #fff; }    /* versandt = grün */
.anfrage-badge.status-beauftragt { background: var(--gruen); color: #fff; } /* BEAUFTRAGT = dunkelgrün */
.anfrage-badge.nummer { background: #E3ECE7; color: var(--text); }

/* F62: Anfrage-Karte ist antippbar (Detail-Modal); Felder-Liste im Modal */
.anfrage-card { cursor: pointer; }
#modal-anfrage .modal-box { max-width: 560px; }
.anfrage-detail { display: flex; flex-direction: column; }
.anfrage-detail .feld { display: grid; grid-template-columns: 118px 1fr; gap: 8px; padding: 6px 0; border-top: 1px dashed #E2EAE5; font-size: .92em; }
.anfrage-detail .feld:first-child { border-top: none; }
.anfrage-detail .feld .label { color: var(--muted); }
.anfrage-detail .feld .wert { white-space: pre-wrap; word-break: break-word; color: var(--text); }
.anfrage-detail .feld a.wert { color: var(--gruen); font-weight: 600; text-decoration: none; }

/* F78: Bearbeiten-Modus im Detail-Modal — Eingabefelder in der Felder-Liste + Kopfzeile mit Stift */
#modal-anfrage .modal-box header { gap: 8px; }
#modal-anfrage .modal-box header .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anfrage-detail .feld input { padding: 7px 10px; min-width: 0; }
.anfrage-detail .feld:has(input) { align-items: center; }

/* F65: Nutzer-Filter über der Angebotsliste */
.angebote-filterzeile { margin: 0 0 4px; }
.angebote-filterzeile select { width: auto; flex: 1; max-width: 240px; }

/* F69: Status „zur Kontrolle" (Badge) + Chip „Zur Kontrolle (N)" über der Liste */
.angebot-card .status.kontrolle { background: #D6E6F5; color: #1F4E79; }
.kontrolle-zeile { margin: 6px 0 2px; }
.kontrolle-zeile .kontrolle-chip { background: #D6E6F5; color: #1F4E79; font-weight: 600; }
.kontrolle-zeile .kontrolle-chip.aktiv { background: #1F4E79; color: #fff; }

/* F28: „Alternativ"-Häkchen im Anlagen-Kopf */
.anlage .alt-check { flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; }

/* F22a: Toast-Hinweis unten mittig */
#app-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: .9em; max-width: 92vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 300;
}
#app-toast.sichtbar { opacity: 1; transform: translateX(-50%) translateY(0); }

/* F24.4: Ankreuzliste im Unterschrift-Modal */
.beauftragt-liste { margin: 4px 0 8px; }
.beauftragt-row { flex-direction: row !important; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px dashed #E2EAE5; font-size: .92em; color: var(--text); }
.beauftragt-row:first-child { border-top: none; }
.beauftragt-row input { width: auto; }
.beauftragt-row .preis { white-space: nowrap; }
.beauftragt-row.info { padding-left: 26px; color: var(--muted); }
.beauftragt-row.info:last-child { font-weight: 600; color: var(--text); }

/* F21/F22: Aufmaß-Vorschlags-Modal */
#aufmass-positionen { max-height: 38vh; overflow-y: auto; }
.aufmass-row { flex-direction: row !important; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px dashed #E2EAE5; font-size: .92em; color: var(--text); }
.aufmass-row:first-child { border-top: none; }
.aufmass-row input[type="checkbox"] { width: auto; }
.aufmass-row input.menge { width: 68px; text-align: center; flex: none; }

/* F18: Mail-Modal — Zusammenfassung der Doppel-Bestätigung */
#mail-confirm-info { white-space: pre-line; }
#mail-confirm { border: 2px solid var(--korall); }

/* F50: PDF-Vorschau-Overlay (Fallback, wenn window.open blockiert ist) */
.pdf-viewer-overlay { position: fixed; inset: 0; z-index: 400; background: var(--navy); display: flex; flex-direction: column; }
.pdf-viewer-bar { display: flex; align-items: center; gap: 8px; color: #fff; padding: max(env(safe-area-inset-top), 8px) 12px 8px 12px; }
.pdf-viewer-bar button.ghost { color: #fff; }
#pdf-viewer-frame { flex: 1; width: 100%; border: none; background: #fff; }
.pdf-viewer-bar .muted { color: #cbd5e1; }
/* F53: interne technische Datenblätter — scrollbare Bildliste */
#technik-bilder { flex: 1; overflow-y: auto; background: #fff; padding: 8px; }
#technik-bilder img { display: block; max-width: 100%; margin: 0 auto 12px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* F77: Anfragen-Reiter — Ansicht „Meine | Alle", Warnblock, kompakte Karten, Timeline */
.anfrage-ansicht-zeile { margin: 0 0 2px; }
.segmente.mini { margin: 0; padding: 3px; display: inline-flex; flex: none; }
.segmente.mini button { flex: none; padding: 7px 18px; font-size: .88em; }
/* Zähler-Badge am Reiter-Tab (meine überfälligen + heutigen Schritte) */
.tab-badge { display: inline-block; margin-left: 7px; min-width: 1.5em; background: var(--korall); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .75em; font-weight: 700; line-height: 1.4; }
/* Warnblock „ohne nächsten Schritt" — Antippen filtert (Toggle) */
#anfrage-warnblock { display: block; width: 100%; text-align: left; background: #FFF2CC; color: #7A5D00; border-radius: 10px; padding: 10px 14px; margin: 6px 0; font-size: .9em; font-weight: 600; }
#anfrage-warnblock.aktiv { background: #FFE9A8; outline: 2px solid #D9BB55; }
/* kompakte Zeile (eingeklappt) + aufgeklappte Karte */
.anfrage-card.kompakt { padding: 10px 14px; }
.anfrage-card .kopf { flex-wrap: wrap; row-gap: 4px; }
.anfrage-card .kopf .titel { min-width: 0; }
.anfrage-card .badges { display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.anfrage-card.gestorben { opacity: .6; background: #EFF1F0; }
.anfrage-card.offen { border: 1px solid #C9D6CF; }
/* Lead-Status-Badges (Alltagssprache; Grüntöne bleiben dem Funnel vorbehalten) */
.anfrage-badge.lead-offen { background: #E3ECE7; color: #4A5A53; }
.anfrage-badge.lead-termin { background: #D6E6F5; color: #1F4E79; }
.anfrage-badge.lead-besichtigt { background: #E6DEF2; color: #5B3E8E; }
.anfrage-badge.lead-wartet { background: #DCE4EA; color: #46606F; }
.anfrage-badge.lead-meldet { background: #EADFD3; color: #7A5230; }
.anfrage-badge.lead-gestorben { background: #E4E6E5; color: #6B7B74; }
/* Wiedervorlage-Badges + Besitzer-Kürzel (R1) */
.anfrage-badge.wv-ueberfaellig { background: var(--korall); color: #fff; font-weight: 700; }
.anfrage-badge.wv-heute { background: #FFE9A8; color: #7A5D00; font-weight: 700; }
.anfrage-badge.wv-normal { background: #ECEFED; color: var(--muted); }
.schritt-von { font-size: .7em; border: 1px solid #C9D6CF; border-radius: 6px; padding: 1px 5px; color: var(--muted); background: #fff; }
/* aufgeklappter Detailbereich */
.anfrage-inline { border-top: 1px dashed #E2EAE5; margin-top: 8px; padding-top: 6px; }
.anfrage-inline .feld { display: grid; grid-template-columns: 118px 1fr; gap: 8px; padding: 3px 0; font-size: .9em; }
.anfrage-inline .feld .label { color: var(--muted); }
.anfrage-inline .feld span:not(.label) { white-space: pre-wrap; word-break: break-word; }
.anfrage-inline a { color: var(--gruen); font-weight: 600; text-decoration: none; }
.anfrage-inline .knopfzeile { display: flex; gap: 8px; margin: 10px 0 4px; }
.anfrage-inline .knopfzeile button { flex: 1; }
.anfrage-aktionen:empty { display: none; }   /* Ansatzpunkt für die Interaktions-Schicht */
/* F77: Interaktions-Schicht — Aktivitäts-Chips + Status-Knöpfe im aufgeklappten Lead */
.anfrage-aktionen { border-top: 1px dashed #E2EAE5; margin-top: 8px; padding-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.anfrage-aktionen .chips { flex-wrap: wrap; overflow-x: visible; }
.anfrage-aktionen .akt-status button { background: #EEF2F0; border: 1px solid #DCE7E1; }
.anfrage-notiz-inline { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.anfrage-notiz-inline .row { margin: 0; }
/* F77: Schritt-Dialog (R2) — Datums-Chips mit Zieldatum + Besitzer-Toggle */
#modal-schritt .modal-box { max-width: 500px; }
#schritt-chips { flex-wrap: wrap; overflow-x: visible; }
.schritt-von-zeile { display: flex; align-items: center; gap: 12px; margin: 2px 0 4px; }
/* F77: „Gestorben" — Pflicht-Grund als Karten-Liste */
#modal-grund .modal-box { max-width: 480px; }
#grund-liste { display: flex; flex-direction: column; gap: 8px; }
#grund-liste button { width: 100%; text-align: left; background: var(--card); padding: 12px 14px; }
#grund-sonstiges input { flex: 1; min-width: 0; }
/* Verlaufs-Timeline (neueste oben) */
.anfrage-timeline { border-top: 1px dashed #E2EAE5; margin-top: 8px; padding-top: 6px; display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow-y: auto; }
.akt-zeile { display: flex; gap: 6px; align-items: flex-start; font-size: .85em; }
.akt-zeile .akt-icon { flex: none; width: 32px; text-align: center; }
.akt-zeile.system { color: var(--muted); }
.akt-zeile .akt-text { white-space: pre-wrap; word-break: break-word; min-width: 0; }
.akt-stempel { color: var(--muted); font-variant-numeric: tabular-nums; }
.akt-fallback { color: var(--muted); font-size: .85em; white-space: pre-wrap; word-break: break-word; }
