/**
 * AHG CRM – Stylesheet
 * Design System: "The Tactile Community"
 */

/* ── Fonts ──
   P4, Runde A (23.09.2026): NUR noch Material Symbols (Icons) hier — die
   Text-Schriften (Plus Jakarta Sans/Be Vietnam Pro bzw. IBM Plex) kommen jetzt
   aus dem Theme (/theme/tokens.css, siehe unten), weil sie je Installation
   unterschiedlich sind (Google-Import fuer "ahg", selbst gehostet fuer
   "der-nachweis"). Icons sind KEIN Theme-Bestandteil und bleiben hier fix.
   v1.8.0 (29.09.2026, DSGVO): Die Icon-Schrift wird SELBST GEHOSTET
   (public/fonts/material-symbols-outlined.woff2) — vorher lud ein @import bei
   jedem Seitenaufruf, auch auf der Login-Seite, von Googles Schrift-Server (IP-
   Adresse an Google, ohne Einwilligung). @font-face + Klassenregel sind die
   unveraenderten Werte aus Googles CSS2-Antwort (Chrome-User-Agent, Stand
   29.09.2026, Datei v374); Wächter: scripts/pruefe-keine-fremdschrift.js. */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url('../fonts/material-symbols-outlined.woff2') format('woff2');
}
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ── Design Tokens ──
   P4, Runde A (23.09.2026): Farb-/Radius-/Schatten-/Schrift-Rollen (--primary,
   --ok, --accent, --warn, --danger, --info, ihre -soft/-strong/-muted-Varianten,
   --surface*, --text*, --outline, --radius-*, --shadow-*, --font-*) kommen NICHT
   mehr von hier, sondern aus /theme/tokens.css — erzeugt von config/theme.js aus
   themes/<id>/theme.json der Instanz (config/instanz.js: instanz.theme). Die
   Reihenfolge der <link>-Tags in index.html (tokens.css VOR crm.css) sorgt
   dafuer, dass diese Rollen bereits gesetzt sind, wenn crm.css sie liest.
   Siehe themes/AGENTS.md. Hier bleiben NUR die zwei Layout-Masse, die keine
   Theme-Identitaet sind (Sidebar-Breite, Kopfzeilen-Hoehe). */
:root {
    --sidebar-width: 260px; --header-height: 64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font-body); color: var(--text); background: var(--surface); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; vertical-align: middle; line-height: 1; }

/* ═══════ LOGIN ═══════ */
#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--flaeche-login); padding: 20px; }
.login-card { background: var(--surface-card); border-radius: var(--radius-xl); padding: 48px 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; color: var(--primary); margin-top: 12px; }
.login-logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.login-logo .logo-emoji { font-size: 3rem; display: block; }
/* Theme-Bildmarke statt Emoji (P4, Runde A): .logo-emoji-svg ersetzt den
   Emoji-Block 1:1 in Groesse/Position, .logo-inline sitzt in der Sidebar-Kopfzeile
   neben dem Text (dort ersetzt sie nur das Zeichen "🏠", nicht den ganzen Block). */
.logo-emoji-svg { width: 3rem; height: 3rem; margin: 0 auto; }
.logo-inline { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 16px; border: 2px solid transparent; border-radius: var(--radius-md); background: var(--surface-low); color: var(--text); font-size: 1rem; transition: all 0.2s ease; outline: none; }
.form-input:focus { border-color: var(--primary); background: var(--surface-card); box-shadow: 0 0 0 4px var(--primary-a10); }
.login-error { color: var(--danger); font-size: 0.85rem; font-weight: 600; min-height: 20px; margin-bottom: 8px; }
.login-hinweis { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.4; margin-bottom: 8px; }
.login-hinweis:empty { display: none; }
.login-vergessen { text-align: center; margin-top: 12px; }

/* ═══════ ZWEI-FAKTOR-ANMELDUNG (v1.37.0) — große Felder, ruhige Farben, Warnung deutlich rot ═══════ */
.zf-titel { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.zf-titel .material-symbols-outlined { color: var(--primary); }
.zf-hinweis { font-size: 0.95rem; }
.form-input.zf-code-feld { font-size: 1.6rem; letter-spacing: 0.25em; text-align: center; padding: 14px 16px; font-variant-numeric: tabular-nums; }
.zf-haken { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; font-weight: 500; cursor: pointer; }
.zf-haken input { width: 20px; height: 20px; }
.zf-status { font-size: 0.95rem; line-height: 1.5; margin: 0 0 14px; }
.zf-schritte { padding-left: 20px; margin: 0 0 16px; font-size: 0.95rem; line-height: 1.5; }
.zf-schritte li { margin-bottom: 12px; }
.zf-qr { text-align: center; margin: 10px 0; }
.zf-qr img { width: 220px; height: 220px; background: #fff; border: 1px solid var(--surface-low); border-radius: var(--radius-md); image-rendering: pixelated; }
.zf-handy { text-align: center; margin: 12px 0 4px; }
.zf-handy-knopf { width: 100%; max-width: 420px; padding: 16px 20px; font-size: 1.05rem; text-decoration: none; text-align: center; }
.zf-handy-hinweis { font-size: 0.9rem; color: var(--text-secondary); margin: 0 0 12px; text-align: center; }
.zf-geheimnis { display: block; margin-top: 6px; padding: 10px 12px; background: var(--surface-low); border-radius: var(--radius-sm); font-size: 1.05rem; letter-spacing: 0.08em; word-break: break-all; user-select: all; }
.zf-codes { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; counter-reset: zfc; }
.zf-codes li { counter-increment: zfc; font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.08em; padding: 8px 10px; background: var(--surface-low); border-radius: var(--radius-sm); }
.zf-codes li::before { content: counter(zfc) ". "; color: var(--text-muted); font-weight: 500; }
.zf-aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.zf-unterueberschrift { font-size: 1rem; font-weight: 700; margin: 18px 0 8px; }
.zf-geraete { list-style: none; padding: 0; margin: 0 0 12px; font-size: 0.9rem; }
.zf-geraete li { padding: 6px 0; border-bottom: 1px solid var(--surface-low); }
.zf-warnkarte { border: 4px solid #b3261e; }
.zf-warntitel { color: #b3261e; font-weight: 800; }
.zf-warntext { font-size: 0.95rem; line-height: 1.5; }
.zf-warntext p { margin: 0 0 12px; }
.zf-warntext ul { margin: 0 0 12px; padding-left: 22px; }
.btn-danger-solid { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: none; border-radius: var(--radius-md); background: #b3261e; color: #fff; font-weight: 700; cursor: pointer; text-align: center; }
.btn-danger-solid:hover { background: #8c1d18; }
@media print {
    body.zf-druck > *:not(#modal-zweifaktor) { display: none !important; }
    body.zf-druck #modal-zweifaktor { position: static; background: #fff; backdrop-filter: none; padding: 0; display: block; }
    body.zf-druck #modal-zweifaktor .modal-card { box-shadow: none; max-width: none; max-height: none; }
    body.zf-druck #modal-zweifaktor .modal-actions, body.zf-druck #modal-zweifaktor h2 .material-symbols-outlined { display: none !important; }
}

/* ═══════ BUTTONS ═══════ */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border: none; border-radius: var(--radius-md); background: var(--accent); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; width: 100%; }
.btn-primary:hover { background: var(--primary); box-shadow: var(--shadow-glow-primary); transform: translateY(-1px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border: none; border-radius: var(--radius-md); background: var(--primary-muted); color: var(--primary); font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease; }
.btn-secondary:hover { background: var(--primary); color: #fff; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; }
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-md); font-weight: 700; cursor: pointer; transition: all 0.2s ease; }
.btn-danger:hover { opacity: 0.9; }

/* ═══════ APP LAYOUT ═══════ */
#app-screen { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--surface-card); box-shadow: var(--shadow-md); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-header { flex-shrink: 0; padding: 24px 20px; background: var(--flaeche-kopf); color: #fff; }
.sidebar-header h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; }
.sidebar-header p { font-size: 0.8rem; opacity: 0.7; margin-top: 2px; }
/* Menue scrollt, Kopf und Fuss (Passwort aendern, Abmelden) bleiben immer sichtbar. */
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); color: var(--text-secondary); font-weight: 500; cursor: pointer; transition: all 0.2s ease; margin-bottom: 4px; border: none; background: none; width: 100%; text-align: left; font-size: 0.95rem; }
.nav-item:hover { background: var(--surface-low); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item .material-symbols-outlined { font-size: 22px; }
.sidebar-footer { flex-shrink: 0; padding: 16px 12px; background: var(--surface-low); }
.sidebar-footer .btn-ghost { width: 100%; }
.user-info { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 8px; }
.user-info .user-name { font-weight: 600; font-size: 0.9rem; }
.role-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.5px; }
.role-superadmin { background: var(--accent-soft); color: var(--accent); }
.role-verwaltung { background: var(--primary-soft); color: var(--primary); }
.role-mitarbeiter { background: var(--primary-soft); color: var(--primary); }
.role-werkstattleitung { background: var(--primary-soft); color: var(--primary); }
.main-content { flex: 1; min-width: 0; margin-left: var(--sidebar-width); padding: 32px; min-height: 100vh; } /* min-width: 0 — sonst wird der Bereich so breit wie die breiteste Tabelle und die Seite laeuft rechts aus */

/* ═══════ CONTACTS VIEW ═══════ */
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.view-header > div { flex-wrap: wrap; min-width: 0; } /* Knopfgruppe rechts bricht um statt rechts auszulaufen */
.view-header h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--text); }
.contacts-count { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* Search Bar */
.search-bar { position: relative; max-width: 400px; width: 100%; }
.search-bar .material-symbols-outlined { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 20px; }
.search-bar input { width: 100%; padding: 12px 16px 12px 44px; border: 2px solid transparent; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-sm); font-size: 0.95rem; transition: all 0.2s ease; outline: none; }
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-a08); }

/* Label Filter */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
.label-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-pill); border: none; background: var(--surface-card); box-shadow: var(--shadow-sm); font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.2s ease; }
.label-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.label-chip.active { color: #fff; background: var(--label-color, var(--primary)); box-shadow: 0 4px 12px color-mix(in srgb, var(--label-color, var(--primary)) 30%, transparent); }
.label-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.label-chip.active .label-dot { background: rgba(255,255,255,0.6) !important; }
.label-toggle { font-size: 0.75rem; opacity: 0.6; margin-left: 2px; }
.filter-mode-btn { padding: 5px 12px; border-radius: var(--radius-pill); border: 2px solid var(--outline); background: transparent; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-mode-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Data Table */
.data-table-wrapper { background: var(--surface-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); overflow-x: auto; } /* breite Tabelle scrollt in ihrer Karte, nicht die Seite */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { padding: 14px 18px; text-align: left; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--surface-low); }
.data-table tbody tr { transition: background 0.15s ease; cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody td { padding: 14px 18px; font-size: 0.92rem; color: var(--text-secondary); vertical-align: middle; }
.data-table .cell-name strong { color: var(--text); font-weight: 600; }
.data-table .cell-email { color: var(--text-muted); font-size: 0.88rem; }
.data-table .cell-company { color: var(--text-muted); font-size: 0.88rem; }

/* Checkbox Column */
.cell-checkbox { width: 44px; text-align: center; padding: 10px 8px !important; }
.cell-checkbox input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); border-radius: 4px; }

/* Label Tags & Source Badges */
.label-tag { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; margin: 1px 3px; white-space: nowrap; }
.source-badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 0.72rem; font-weight: 600; }
.source-manual { background: var(--surface-low); color: var(--text-muted); }
.source-webhook_um { background: var(--info-soft); color: var(--info); }
.source-webhook_cf7 { background: var(--accent-soft); color: var(--accent); }
.source-wordpress { background: var(--info-soft); color: var(--info); }
.source-crm { background: var(--primary-soft); color: var(--primary); }
.empty-state { text-align: center; padding: 60px 20px !important; color: var(--text-muted); }
.empty-state .material-symbols-outlined { font-size: 48px; opacity: 0.3; display: block; margin-bottom: 12px; }
.empty-hint { color: var(--text-faint); font-style: italic; font-size: 0.9rem; padding: 12px 0; }

/* Status Badges */
.status-badge { display: inline-block; padding: 3px 12px; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
/* ⚠️ Unsicher/bewusste Abweichung (P4, Runde A): "grün-hell" ist sonst IMMER
   --primary-soft (siehe themes/AGENTS.md) — hier ausnahmsweise --ok-soft, weil
   diese eine Zeile Hintergrund+Text FUER EIN Status-Semantik paart (aktiv=gut,
   vgl. .status-gesperrt=danger, .status-interessent=warn zwei Zeilen weiter).
   Waere die Karte in Primary-Soft geblieben, haette "aktiv" im Nachweis-Theme
   (primary=Zinnaberrot) wie ein Fehler-Badge ausgesehen. */
.status-aktiv { background: var(--ok-soft); color: var(--ok); }
.status-passiv { background: var(--surface-low); color: var(--text-muted); }
.status-gesperrt { background: var(--danger-soft); color: var(--danger); }
.status-interessent { background: var(--warn-soft); color: var(--warn); }

/* ═══════ DETAIL VIEW ═══════ */
.detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.detail-header h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; }
.detail-meta { display: flex; gap: 12px; align-items: center; }
.detail-meta span { font-size: 0.85rem; color: var(--text-muted); }
.btn-detail-action { margin-left: 8px; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-card { background: var(--surface-card); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow-sm); }
.detail-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.detail-card h3 .material-symbols-outlined { font-size: 20px; color: var(--primary); }
.detail-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-form-grid .form-group { margin-bottom: 0; }
.detail-form-grid .full-width { grid-column: 1 / -1; }

/* Form Section Titles */
.form-section-title { font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.8px; margin: 20px 0 10px 0; padding-bottom: 6px; background: linear-gradient(to right, var(--primary-soft), transparent); padding: 6px 10px; border-radius: var(--radius-sm); }
.form-section-title:first-of-type { margin-top: 0; }

.form-input-sm { width: 100%; padding: 10px 14px; border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--surface-low); font-size: 0.9rem; transition: all 0.2s ease; outline: none; }
.form-input-sm:focus { border-color: var(--primary); background: #fff; }
select.form-input-sm { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-input-sm { min-height: 120px; resize: vertical; line-height: 1.6; }

/* DSGVO Checkbox */
.form-checkbox-group { display: flex; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); user-select: none; padding: 10px 0; }
.checkbox-label input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.checkbox-custom { display: none; }
.checkbox-label:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.checkbox-label input[type="checkbox"]:disabled { cursor: not-allowed; }

/* ═══════ TIMELINE ═══════ */
.timeline-container { max-height: 400px; overflow-y: auto; padding-right: 8px; }
.timeline-container::-webkit-scrollbar { width: 4px; }
.timeline-container::-webkit-scrollbar-track { background: transparent; }
.timeline-container::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 4px; }
.timeline-item { display: flex; gap: 12px; padding: 12px 0; transition: background 0.15s ease; }
.timeline-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-text { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4; }
.timeline-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 0.78rem; color: var(--text-faint); }
.timeline-add { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; }
.timeline-add input { flex: 1; padding: 10px 14px; border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--surface-low); font-size: 0.9rem; outline: none; transition: all 0.2s ease; }
.timeline-add input:focus { border-color: var(--primary); background: #fff; }

/* Snapshot Toggle Button */
.btn-snapshot-toggle { display: inline-block; margin-top: 6px; padding: 4px 12px; border: 1px solid var(--outline); border-radius: var(--radius-pill); background: var(--surface-low); color: var(--text-muted); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn-snapshot-toggle:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* Snapshot Content */
.timeline-snapshot { margin-top: 8px; padding: 12px; background: var(--surface-low); border-radius: var(--radius-sm); }
.snapshot-row { display: flex; gap: 8px; padding: 3px 0; font-size: 0.82rem; }
.snapshot-label { font-weight: 600; color: var(--text-muted); min-width: 120px; flex-shrink: 0; }
.snapshot-value { color: var(--text); }

/* Delta Entries */
.timeline-delta .timeline-text { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delta-field { font-weight: 700; color: var(--text); font-size: 0.85rem; }
.delta-old { color: var(--danger); text-decoration: line-through; font-size: 0.85rem; opacity: 0.8; }
.delta-arrow { color: var(--text-muted); font-weight: 700; font-size: 0.9rem; }
.delta-new { color: var(--ok); font-weight: 600; font-size: 0.85rem; }

/* ═══════ RELATIONS ═══════ */
.relation-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s ease; }
.relation-item:hover { background: var(--surface-low); }
.relation-item .material-symbols-outlined { color: var(--info); font-size: 20px; }
.relation-type { font-size: 0.78rem; color: var(--text-muted); display: block; }

/* ═══════ LABEL MANAGER ═══════ */
.label-manager-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); transition: background 0.15s ease; }
.label-manager-item:hover { background: var(--surface-low); }
.label-dot-lg { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.label-manager-name { font-weight: 600; flex: 1; }
.label-manager-count { font-size: 0.82rem; color: var(--text-muted); margin-right: 8px; }
.label-manager-kind { margin-left: 28px; }
.label-eltern-select { padding: 6px 10px; border: 1px solid var(--outline); border-radius: var(--radius-sm); background: var(--surface-card); font-size: 0.85rem; max-width: 190px; }
.color-picker { width: 32px; height: 32px; border: none; border-radius: var(--radius-sm); cursor: pointer; background: none; padding: 0; }
.new-label-form { display: flex; gap: 10px; align-items: center; padding: 16px; background: var(--surface-low); border-radius: var(--radius-md); margin-top: 16px; }
.new-label-form input[type="text"] { flex: 1; padding: 10px 14px; border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--surface-card); outline: none; font-size: 0.9rem; transition: border 0.2s ease; }
.new-label-form input[type="text"]:focus { border-color: var(--primary); }

/* ═══════ MODALS ═══════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(23, 29, 22, 0.4); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
/* 🔀 v1.12.4: Hinweis „Anmeldung in einem anderen Tab gewechselt“ — über allem anderen, Knopf mind. 44 px */
.wechsel-overlay { z-index: 1200; }
.wechsel-knopf { width: auto; min-height: 44px; }
.modal-card { background: var(--surface-card); border-radius: var(--radius-xl); padding: 32px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-card-lg { max-width: 680px; }
.modal-card h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.modal-card h2 .material-symbols-outlined { color: var(--primary); }
/* 1.41.0: Die Dialoge der E-Mail- und Briefvorlagen tragen die Klasse .modal-dialog, für die es keine Regel gab: sie hatten keinen Karten-Hintergrund und wurden so breit wie ihr Inhalt (auf dem Handy 811 px, Querscrollen). Jetzt wie .modal-card. */
.modal-dialog { background: var(--surface-card); border-radius: var(--radius-xl); padding: 32px; width: 100%; box-sizing: border-box; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-dialog h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.modal-dialog h2 .material-symbols-outlined { color: var(--primary); }
@media (max-width: 600px) { .modal-dialog { padding: 18px 14px; } }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ═══════ TOAST ═══════ */
#toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--primary-strong); color: #fff; padding: 12px 28px; border-radius: var(--radius-pill); font-weight: 600; font-size: 0.9rem; box-shadow: var(--shadow-glow-primary); opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1000; pointer-events: none; }
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
/* Absage/Fehler: rot statt gruen. Sonst sieht ein abgewiesener Vorgang aus wie ein
   gelungener (gefunden 08.09.2026 an der Sphaeren-Absage der Werkstatt-Abrechnung). */
#toast.toast-error { background: var(--danger, #b3261e); box-shadow: 0 4px 20px rgba(179, 38, 30, 0.45); text-align: left; max-width: 640px; }

/* ═══════ ESCALATION / ALARM BOX ═══════ */
.escalation-box { background: var(--danger-soft); border-left: 4px solid var(--danger); border-radius: var(--radius-xl); padding: 20px 24px; margin-bottom: 24px; animation: escalation-pulse 0.6s ease-out; }
@keyframes escalation-pulse { 0% { opacity: 0; transform: translateY(-8px); } 100% { opacity: 1; transform: translateY(0); } }
.escalation-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.escalation-icon { font-size: 1.5rem; }
.escalation-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--danger); letter-spacing: 0.5px; margin: 0; }
.escalation-details { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.escalation-row { display: flex; gap: 12px; font-size: 0.9rem; }
.escalation-label { font-weight: 700; color: var(--danger); min-width: 70px; flex-shrink: 0; }
.escalation-value { color: var(--text); }
.escalation-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════ 🕯️ TODESFALL ═══════ */
/* Bewusst ruhig und dunkelgrau statt Alarm-Rot: Das ist kein Fehler und kein Notfall,
   sondern eine Tatsache, die Respekt verlangt. Die Sperre wirkt trotzdem hart. */
.deceased-box { background: #eceff1; border-left: 4px solid #546e7a; border-radius: var(--radius-xl); padding: 20px 24px; margin-bottom: 24px; }
.deceased-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.deceased-icon { font-size: 1.5rem; }
.deceased-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: #37474f; letter-spacing: 0.5px; margin: 0; }
.deceased-details { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.deceased-row { display: flex; gap: 12px; font-size: 0.9rem; }
.deceased-label { font-weight: 700; color: #546e7a; min-width: 110px; flex-shrink: 0; }
.deceased-value { color: var(--text); }
.deceased-hint { font-size: 0.85rem; color: #546e7a; margin: 0 0 14px; line-height: 1.5; }
.deceased-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-verstorben { background: #cfd8dc; color: #37474f; }
.row-verstorben { background: rgba(84, 110, 122, 0.06) !important; }
.row-verstorben:hover { background: rgba(84, 110, 122, 0.12) !important; }
.row-verstorben .contact-name-cell { color: var(--text-muted); }

/* ═══════ GESPERRT ROW HIGHLIGHT ═══════ */
.row-gesperrt { background: var(--danger-a04) !important; }
.row-gesperrt:hover { background: var(--danger-a08) !important; }
.gesperrt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 8px; vertical-align: middle; animation: dot-pulse 2s ease-in-out infinite; }
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ═══════ PROFI-INFOKARTE ═══════ */
.profi-card { background: linear-gradient(135deg, #e8eaf6, #e3f2fd); border-left: 4px solid #227bc3; border-radius: var(--radius-xl); padding: 20px 24px; margin-bottom: 24px; animation: profi-slide 0.5s ease-out; }
@keyframes profi-slide { 0% { opacity: 0; transform: translateY(-6px); } 100% { opacity: 1; transform: translateY(0); } }
.profi-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.profi-card-icon { font-size: 1.4rem; }
.profi-card-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: #227bc3; letter-spacing: 0.5px; margin: 0; flex: 1; }
.profi-model-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); color: #fff; font-size: 0.7rem; font-weight: 800; letter-spacing: 1px; }
.profi-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profi-stat { background: rgba(255,255,255,0.7); border-radius: var(--radius-md); padding: 10px 14px; }
.profi-stat-label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.profi-stat-value { font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* ═══════ BILLING MODULE ═══════ */
.billing-tabs { display: flex; gap: 0; margin-bottom: 20px; }
.billing-tab { display: flex; align-items: center; gap: 6px; padding: 12px 20px; background: none; border: none; border-bottom: 3px solid transparent; font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.billing-tab:hover { color: var(--text); background: rgba(0,0,0,0.02); }
.billing-tab.active { color: var(--primary-strong); border-bottom-color: var(--primary-strong); }
.billing-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--surface-light); font-size: 0.72rem; font-weight: 800; padding: 0 6px; }
.billing-tab.active .billing-tab-count { background: var(--primary-strong); color: #fff; }

.billing-status-chips { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.status-chip { padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.status-chip:hover { background: var(--surface-light); }
.status-chip.active { background: var(--primary-strong); color: #fff; border-color: var(--primary-strong); }

.assignment-badge, .invoice-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3px; }
.assignment-offen { background: #fff3e0; color: #e65100; }
.assignment-in_bearbeitung { background: #e3f2fd; color: #1565c0; }
.assignment-abgeschlossen { background: #e8f5e9; color: #2e7d32; }
.assignment-storniert { background: #fce4ec; color: #c62828; }
.invoice-entwurf { background: #f5f5f5; color: #616161; }
/* „Erstellt" = PDF da, nichts hinausgegangen (11.09.2026). Bernstein, nicht blau:
   Es ist ein Zwischenstand, der noch etwas von jemandem will — nicht der Abschluss. */
.invoice-erstellt { background: #fff3e0; color: #e65100; }
.invoice-gesendet { background: #e3f2fd; color: #1565c0; }
.invoice-bezahlt { background: #e8f5e9; color: #2e7d32; }
.invoice-mahnung { background: #fce4ec; color: #c62828; }
.invoice-storniert { background: #f5f5f5; color: #9e9e9e; text-decoration: line-through; }

.billing-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.billing-empty p { margin-top: 8px; font-size: 0.9rem; }

.billing-tab-content { animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Typeahead */
.typeahead-wrap { position: relative; }
.typeahead-results { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 100; max-height: 200px; overflow-y: auto; }
.typeahead-item { padding: 10px 14px; cursor: pointer; font-size: 0.85rem; transition: background 0.15s; }
.typeahead-item:hover { background: var(--surface-light); }
.typeahead-item small { display: block; color: var(--text-muted); font-size: 0.75rem; }

/* Invoice Modal */
.modal-card-xl { max-width: 780px; }
.invoice-number-badge { margin-left: auto; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--primary-strong); color: #fff; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.5px; }
.invoice-items-section { margin: 16px 0; }
.invoice-items-section h3 { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px; }
.line-items-table { width: 100%; border-collapse: collapse; }
.line-items-table th { font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 6px 8px; font-weight: 700; }
.line-items-table td { padding: 4px 8px; }
.line-items-table .form-input-sm { width: 100%; padding: 7px 10px; font-size: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.line-items-table .form-input-sm:focus { border-color: var(--primary-strong); outline: none; }

.invoice-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 16px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.invoice-total-row { display: flex; gap: 24px; font-size: 0.9rem; }
.invoice-total-row span:first-child { color: var(--text-muted); min-width: 80px; text-align: right; }
.invoice-total-gross { font-weight: 800; font-size: 1.1rem; color: var(--primary-strong); padding-top: 4px; border-top: 2px solid var(--primary-strong); margin-top: 4px; }

/* Unit Combobox */
.unit-combo { position: relative; display: flex; align-items: stretch; }
.unit-combo input { width: 100%; padding-right: 28px; }
.unit-combo-chevron { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); font-size: 18px; border-radius: var(--radius-sm); transition: color 0.15s, background 0.15s; user-select: none; }
.unit-combo-chevron:hover { color: var(--primary-strong); background: rgba(0,0,0,0.04); }
.unit-combo-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 200; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden; margin-top: 2px; }
.unit-combo-dropdown.open { display: block; animation: fade-in 0.15s ease; }
.unit-combo-option { padding: 7px 10px; font-size: 0.83rem; cursor: pointer; transition: background 0.12s; }
.unit-combo-option:hover { background: var(--surface-light); color: var(--primary-strong); font-weight: 600; }

/* AHG Discount Toggle */
.ahg-discount-toggle { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-top: 12px; background: var(--flaeche-rabatt); border-radius: var(--radius-md); border: 1px solid var(--primary-a15); }
.ahg-discount-label { font-weight: 700; font-size: 0.88rem; color: var(--primary-strong); }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: background 0.25s; }
.toggle-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--primary-strong); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.ahg-discount-row { font-weight: 700; }
.ahg-discount-row span:last-child { color: #c0392b !important; }

/* Detail Billing */
.detail-billing-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.04); gap: 8px; flex-wrap: wrap; }
.detail-billing-row:last-child { border-bottom: none; }
.detail-billing-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 0.85rem; }
.detail-billing-actions { display: flex; gap: 6px; align-items: center; }
.btn-xs { padding: 3px 10px; font-size: 0.75rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ═══════ GROUP ACTION MODAL ═══════ */
.group-action-badge { margin-left: auto; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--accent); color: #fff; font-size: 0.78rem; font-weight: 800; }
.group-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.group-action-card { background: var(--surface-low); border-radius: var(--radius-lg); padding: 0; overflow: hidden; border: 1px solid rgba(0,0,0,0.04); transition: box-shadow 0.2s ease; }
.group-action-card:hover { box-shadow: var(--shadow-sm); }
.group-action-card-header { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: var(--flaeche-gruppenaktion); border-bottom: 1px solid rgba(0,0,0,0.04); }
.group-action-card-header .material-symbols-outlined { color: var(--primary); font-size: 22px; }
.group-action-card-header h3 { font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; color: var(--text); margin: 0; flex: 1; }
.group-action-card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.group-action-email-card { grid-column: 1 / -1; }

/* Batch Radio Buttons */
.batch-radio-group { display: flex; gap: 16px; }
.batch-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); }
.batch-radio input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Email Warning */
.batch-email-warning { padding: 10px 14px; background: var(--warn-soft); border-radius: var(--radius-sm); font-size: 0.82rem; color: var(--warn); font-weight: 600; border-left: 3px solid var(--warn); }
.group-email-hint { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-left: auto; }

/* ═══════ DOKUMENTENVERWALTUNG ═══════ */
.doc-upload-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; padding: 12px; background: var(--surface-hover); border-radius: var(--radius-md); }
.doc-upload-bar select { flex: 1; }
.doc-category { margin-bottom: 12px; border-radius: var(--radius-md); overflow: hidden; }
.doc-category-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-hover); cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--text); transition: background 0.15s; user-select: none; }
.doc-category-header:hover { background: var(--surface-card); }
.doc-category-header .doc-cat-icon { font-size: 16px; }
.doc-category-header .doc-cat-count { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.doc-category-body { padding: 0 12px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--surface-hover); font-size: 0.82rem; }
.doc-row:last-child { border-bottom: none; }
.doc-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.doc-row-size { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }
.doc-row-date { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }
.doc-row-actions { display: flex; gap: 4px; }
.doc-row-actions button { padding: 4px; border: none; background: none; cursor: pointer; border-radius: var(--radius-sm); color: var(--text-muted); transition: all 0.15s; }
.doc-row-actions button:hover { background: var(--surface-hover); color: var(--primary); }
.doc-row-actions button.doc-delete:hover { color: var(--status-gesperrt); }
.doc-id-badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-md); font-size: 0.82rem; font-weight: 600; }
.doc-id-badge.verified { background: var(--ok-soft); color: var(--ok); }
/* .unverified: Bernstein-Ton passt zu keiner Theme-Rolle exakt (weder --warn/-soft
   noch sonst etwas Definiertes) — bewusst als Literal belassen, siehe Bericht. */
.doc-id-badge.unverified { background: #fff7e6; color: #b27300; }
.doc-id-verify-btn { margin-top: 8px; }
.doc-empty { color: var(--text-muted); font-size: 0.8rem; font-style: italic; padding: 6px 0; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 1024px) { .detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; flex-direction: row; overflow-x: auto; }
    .sidebar-header { padding: 12px 16px; }
    .sidebar-nav { display: flex; flex-direction: row; flex: none; overflow: visible; padding: 8px; gap: 4px; }
    .nav-item { white-space: nowrap; padding: 8px 14px; margin-bottom: 0; }
    .sidebar-footer { display: flex; align-items: center; gap: 4px; padding: 8px; }
    .sidebar-footer .user-info { display: none; }
    .sidebar-footer .btn-ghost { width: auto; white-space: nowrap; }
    .main-content { margin-left: 0; padding: 16px; }
    #app-screen { flex-direction: column; }
    .detail-form-grid { grid-template-columns: 1fr; }
    .view-header { flex-direction: column; align-items: flex-start; }
    .modal-card-lg { max-width: 100%; }
    /* Editor der E-Mail-Vorlagen: Platzhalter-Liste unter den Text statt daneben (1.41.0, sonst Querscrollen auf dem Handy) */
    .tpl-spalten { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ═══════ DIRTY-INDICATOR (Ungespeichert-Badge) ═══════ */
.dirty-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--warn-a12);
    border: 1.5px solid var(--warn-a35);
    color: var(--warn);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    animation: dirty-pulse 2.5s ease-in-out infinite;
    white-space: nowrap;
    flex-shrink: 0;
}
.dirty-indicator .material-symbols-outlined { font-size: 15px; }
@keyframes dirty-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ═══════ DIRTY-DIALOG OVERLAY ═══════ */
.dirty-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 29, 22, 0.55);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 20px;
    animation: dirty-overlay-in 0.2s ease;
}
@keyframes dirty-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.dirty-dialog-card {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    padding: 40px 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(23, 29, 22, 0.2);
    text-align: center;
    animation: dirty-card-in 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 4px solid var(--warn);
}
@keyframes dirty-card-in {
    from { opacity: 0; transform: scale(0.93) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.dirty-dialog-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--flaeche-warnung);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px var(--warn-a20);
}
.dirty-dialog-icon .material-symbols-outlined {
    font-size: 32px;
    color: var(--warn);
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 32;
}
.dirty-dialog-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
}
.dirty-dialog-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 28px;
}
.dirty-dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dirty-dialog-actions .btn-primary {
    background: var(--primary);
    box-shadow: var(--shadow-glow-primary);
}
.dirty-dialog-actions .btn-primary:hover {
    background: var(--primary-strong);
}
.dirty-btn-discard {
    color: var(--danger) !important;
    border: 1.5px solid var(--danger-a25);
}
.dirty-btn-discard:hover {
    background: var(--danger-soft) !important;
}

/* ═══════ CONFIRM-DIALOG Variante ═══════ */
.confirm-dialog-icon {
    background: linear-gradient(135deg, #e3f2fd, #e8eaf6) !important;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.15) !important;
}
.confirm-dialog-icon .material-symbols-outlined {
    color: #1565c0 !important;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 32;
}

/* ═══════ Hinweise in Formularen (24.08.2026) ═══════ */
/* form-hint = erklaerender Kleintext unter einem Eingabefeld.
   form-static-hint = Anzeige eines Wertes, den der Server setzt und den der
   Benutzer bewusst NICHT bearbeiten darf (z. B. der Pruefvermerk des
   Personenkreises). Optisch wie ein Feld, aber ohne Rahmen und ohne Cursor. */
.form-hint { display: block; margin-top: 4px; font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.form-static-hint { padding: 8px 0; font-size: 0.82rem; color: var(--text-muted); font-style: italic; }

/* ═══════ Zeiterfassung Scheibe 2 (26.09.2026): Kennzahlen + "vergessener Timer" ═══════ */
/* Farbe steht NIE allein (gelb/rot tragen zusaetzlich Symbol + Text) — Zielgruppe
   schliesst aeltere Nutzer ein: grosse, klar lesbare Schrift, hoher Kontrast. */
.ze-kennzahl-karte {
    flex: 1 1 240px;
    min-width: 220px;
    background: var(--surface-low);
    border: 2px solid transparent;
    border-radius: var(--radius-md, 10px);
    padding: 14px 18px;
}
.ze-kennzahl-titel { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.ze-kennzahl-wert { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ze-kennzahl-kontakt { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.ze-kennzahl-gelb { background: var(--warn-soft); border-color: var(--warn); }
.ze-kennzahl-gelb .ze-kennzahl-wert { color: var(--warn); }
.ze-kennzahl-rot { background: var(--danger-soft); border-color: var(--danger); }
.ze-kennzahl-rot .ze-kennzahl-wert { color: var(--danger); }

/* Pause-Kachel (v1.6.0, 28.09.2026): neutral/grau statt der bunten Zweck-Farbe —
   zaehlt nicht als Arbeit, soll sich optisch klar von den echten Zwecken abheben. */
.ze-kachel-neutral { background: var(--surface-low); color: var(--text-muted); border: 2px solid var(--border); }
.ze-kachel-neutral:hover { background: var(--outline); color: var(--text); }

.ze-vergessen-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--warn-soft);
    border: 2px solid var(--warn);
    color: var(--warn);
    border-radius: var(--radius-md, 10px);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 60;
}
.ze-vergessen-banner .material-symbols-outlined { font-size: 22px; }

/* 🤝 Empfehlungen / Tippgeber-Programm (v1.20.0) */
.emp-hinweis { display: flex; align-items: flex-start; gap: 10px; background: var(--warn-soft); border: 2px solid var(--warn); color: var(--text); border-radius: var(--radius-md, 10px); padding: 12px 14px; margin: 10px 0; font-size: 0.95rem; line-height: 1.4; }
.emp-hinweis .material-symbols-outlined { color: var(--warn); font-size: 24px; flex-shrink: 0; }
.emp-gewaehlt { display: flex; align-items: center; gap: 8px; background: var(--surface-low); border-radius: 8px; padding: 8px 12px; }
.emp-regeln { white-space: pre-wrap; word-break: break-word; background: var(--surface-2, #f6f7f9); border: 1px solid var(--border, #d0d5dd); border-radius: var(--radius-md, 10px); padding: 12px 14px; margin: 0 0 8px; font-family: inherit; font-size: 0.9rem; line-height: 1.45; }
.emp-badge { display: inline-block; white-space: nowrap; min-width: 22px; text-align: center; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); border: 1px solid var(--warn); font-size: 0.8rem; font-weight: 700; }
.emp-reihe { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; }
.emp-label { min-width: 150px; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.emp-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.emp-kachel { background: var(--surface-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.emp-zahl { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.emp-erkl { font-size: 0.82rem; color: var(--text-muted); line-height: 1.35; }
.emp-zeile { cursor: default; }
.emp-zeile-aus { opacity: 0.75; }
.emp-betrag { font-weight: 700; }
.emp-negativ { color: #b42318; }

/* ═══════ AUFTRAGS-LAUFBAND (v1.29.0 L1, Schliff v1.30.0 L2) — nur Theme-Rollen, keine festen Farben ═══════ */
.lb-view { min-width: 0; max-width: 100%; }
/* v1.39.1: Suchfeld über dem Brett und „Rechnung an“ im Auftragskopf — mindestens 44 px hoch, 16 px Schrift (kein Zoomen am iPhone), auf 390 px ohne waagerechtes Scrollen */
.lb-suche-zeile { flex-wrap: nowrap; }
.lb-suche-zeile .lb-suche { flex: 1 1 0; min-width: 0; width: auto; min-height: 44px; font-size: 16px; }
.lb-suche-zeile #lb-suche-leeren, #lb-suche-leeren-2 { min-height: 44px; white-space: nowrap; }
.lb-rechnung-wahl { width: auto; max-width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
@media (max-width: 520px) { .lb-suche-zeile { flex-wrap: wrap; } .lb-suche-zeile .lb-suche { flex-basis: 100%; } .lb-rechnung-wahl { width: 100%; } }
/* v1.39.2 (M-143): das Suchfeld ist als Eingabefeld erkennbar — echter Rahmen (Kontrast >= 3:1, WCAG 1.4.11), Lupe, dunklerer Platzhalter (>= 4,5:1), deutlicher Fokus-Ring.
   Alle Farben sind Mischungen aus Theme-Rollen (--text, --surface-card, --primary): sie folgen jedem Theme, auch einem dunklen. Gemessen wird im Klicktest (scripts/klicktest-laufband-1392.js). */
:root {
    --lb-feld-rahmen: color-mix(in srgb, var(--text) 66%, var(--surface-card));
    --lb-feld-platzhalter: color-mix(in srgb, var(--text) 78%, var(--surface-card));
    --lb-feld-lupe: var(--text-secondary);
}
.lb-suche-feld { position: relative; flex: 1 1 0; min-width: 0; }
.lb-suche-lupe { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--lb-feld-lupe); pointer-events: none; }
.lb-suche-zeile .lb-suche-feld .lb-suche { width: 100%; padding-left: 44px; border: 2px solid var(--lb-feld-rahmen); background: var(--surface-card); color: var(--text); }
.lb-suche-zeile .lb-suche-feld .lb-suche::placeholder { color: var(--lb-feld-platzhalter); opacity: 1; }
.lb-suche-zeile .lb-suche-feld .lb-suche:focus { border-color: var(--primary); outline: 3px solid var(--primary); outline-offset: 2px; box-shadow: none; }
.lb-suche-zeile .emp-label { color: var(--text-secondary); }
@media (max-width: 520px) { .lb-suche-zeile .lb-suche-feld { flex-basis: 100%; } }
/* v1.39.2: „Rechnung an“ als Zeile im Kasten „Beteiligte“; Schalter „Im Laufband auswählbar“ am Kontakt */
.lb-rechnung-zeile { border-top: 1px solid var(--outline); margin-top: 10px; padding-top: 10px; }
.lb-freigabe-label { min-height: 44px; }
.lb-freigabe-text { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; }
/* Feste Spaltenbreite wie im Prototyp; das Brett schiebt sich waagerecht, die Seite selbst nicht. */
.lb-spalten { display: flex; gap: 10px; overflow-x: auto; max-width: 100%; padding-bottom: 16px; align-items: flex-start; }
.lb-spalte { flex: 0 0 244px; width: 244px; background: var(--surface-low); border: 1px solid var(--outline); border-radius: var(--radius-md); min-height: 160px; }
.lb-spalte-kopf { padding: 10px 10px 8px; border-bottom: 2px solid var(--primary); }
.lb-spalte-titel { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 0.92rem; line-height: 1.25; }
.lb-spalte-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lb-nr { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 0.78rem; font-weight: 800; }
.lb-spalte-zahl { flex: 0 0 auto; color: var(--text-muted); font-weight: 600; }
.lb-spalte-rolle { margin-top: 2px; padding-left: 28px; font-size: 0.75rem; color: var(--text-muted); }
.lb-spalte-koerper { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.lb-karte { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface-card); border: 1px solid var(--outline); border-left: 5px solid var(--ok); border-radius: var(--radius-md); padding: 9px 10px 9px 11px; cursor: pointer; box-shadow: var(--shadow-sm); }
.lb-karte:hover, .lb-karte:focus-visible { border-color: var(--primary); border-left-color: inherit; box-shadow: var(--shadow-md, var(--shadow-sm)); }
.lb-karte.lb-gruen { border-left-color: var(--ok); }
.lb-karte.lb-gelb { border-left-color: var(--warn); }
.lb-karte.lb-rot { border-left-color: var(--danger); }
.lb-karte.lb-grau { border-left-color: var(--outline); opacity: 0.8; }
/* L3: offene Schadenserweiterung = gelb markiert (--warn / --warn-soft des Themes); Rot (Blockade) behaelt in der Randfarbe den Vorrang */
.lb-karte.lb-erw { background: var(--warn-soft); border-color: var(--warn); }
.lb-karte.lb-erw.lb-rot { border-color: var(--danger); }
.lb-erw-zeile { margin-top: 6px; font-size: 0.76rem; font-weight: 700; color: var(--warn-strong, var(--text)); }
/* Kennzeichen als Schild-Rahmen */
.lb-kennzeichen { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.5px; overflow-wrap: anywhere; }
.lb-schild { display: inline-block; font-size: 0.9rem; border: 2px solid var(--text); border-radius: 4px; padding: 0 7px; background: var(--surface-card); letter-spacing: 0.04em; }
.lb-karte-fahrzeug { margin-top: 6px; font-weight: 600; font-size: 0.88rem; overflow-wrap: break-word; }
.lb-karte-halter { font-size: 0.8rem; color: var(--text-muted); overflow-wrap: break-word; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.lb-tag { font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; background: var(--primary-soft); color: var(--primary); }
.lb-balken { height: 5px; background: var(--surface-low); border: 1px solid var(--outline); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.lb-balken i { display: block; height: 100%; background: var(--primary); }
.lb-karte.lb-gelb .lb-balken i { background: var(--warn); }
.lb-karte.lb-rot .lb-balken i { background: var(--danger); }
.lb-fuss { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.74rem; color: var(--text-muted); }
.lb-status { margin-top: 6px; font-size: 0.76rem; font-weight: 700; }
.lb-status.lb-gelb { color: var(--warn-strong, var(--text)); }
.lb-status.lb-rot { color: var(--danger); }
.lb-tage { white-space: nowrap; }
/* Eingang des Weichenstellers */
.lb-freigaben { margin: 0 0 14px; padding: 12px; border: 1px solid var(--outline); border-left: 5px solid var(--warn); border-radius: var(--radius-md); background: var(--surface-card); }
.lb-freigaben h3 { margin: 0 0 8px; font-size: 0.95rem; }
.lb-freigaben-reihe { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 5px 0; border-top: 1px solid var(--outline); }
.lb-freigaben-reihe:first-of-type { border-top: 0; }
/* Detail */
.lb-stationsleiste { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.lb-stn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--outline); background: var(--surface-low); font-size: 0.78rem; font-weight: 600; }
.lb-stn.lb-gruen { border-color: var(--ok); }
.lb-stn.lb-hier { background: var(--primary); color: #fff; border-color: var(--primary); }
.lb-hinweisbox { padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-low); border: 1px solid var(--outline); margin: 8px 0; font-size: 0.88rem; }
.lb-hinweisbox.lb-rot { border-color: var(--danger); background: var(--danger-soft); }
.lb-hinweisbox.lb-gelb { border-color: var(--warn); }
.lb-hinweisbox.lb-gruen { border-color: var(--ok); }
.lb-hinweisbox.lb-erw { border-color: var(--warn); background: var(--warn-soft); }
.lb-liste-titel { margin: 14px 0 6px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.lb-punkt { display: grid; grid-template-columns: 26px 1fr; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--outline); }
.lb-punkt-haken { font-size: 20px; color: var(--text-muted); }
.lb-punkt.lb-ok .lb-punkt-haken { color: var(--ok); }
.lb-punkt-text { font-weight: 600; overflow-wrap: anywhere; }
.lb-punkt-warum { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.lb-punkt-bedienung { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lb-punkt-bedienung .form-input { width: auto; flex: 1 1 160px; min-width: 120px; padding: 6px 10px; font-size: 0.9rem; }
.lb-pflicht-aus { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.lb-knopf { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border: 1px solid var(--outline); border-radius: var(--radius-sm); background: var(--surface-card); color: var(--text); font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.lb-knopf:hover { border-color: var(--primary); }
.lb-knopf.lb-an { background: var(--primary); border-color: var(--primary); color: #fff; }
.lb-knopf:disabled { opacity: 0.5; cursor: default; }
.lb-tabelle { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lb-tabelle th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); padding: 6px 8px; border-bottom: 2px solid var(--outline); }
.lb-tabelle td { padding: 7px 8px; border-bottom: 1px solid var(--outline); vertical-align: middle; overflow-wrap: anywhere; }
.lb-tabelle input.form-input, .lb-tabelle select.form-input { padding: 5px 8px; font-size: 0.88rem; }
.lb-tabellen-huelle { overflow-x: auto; max-width: 100%; }
.lb-verlauf { list-style: none; margin: 12px 0 0; padding: 0; }
.lb-verlauf li { border-left: 3px solid var(--primary); padding: 6px 0 6px 12px; margin-bottom: 6px; overflow-wrap: anywhere; }
.lb-verlauf-kopf { font-size: 0.8rem; color: var(--text-muted); }
.lb-verlauf-text { white-space: pre-wrap; }
/* v1.32.0 (L4): Erinnerungen (Glocke), Fertigtermin, Filter, Teile */
.lb-glocke { display: inline-flex; align-items: center; gap: 2px; font-size: 0.74rem; font-weight: 800; padding: 0 5px; border-radius: 3px; background: var(--warn-soft); color: var(--warn-strong, var(--text)); border: 1px solid var(--warn); }
.lb-glocke .material-symbols-outlined { font-size: 14px; }
.lb-glocke.lb-s2 { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.lb-erinnerung { display: flex; align-items: center; gap: 4px; margin-top: 4px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; background: var(--warn-soft); color: var(--warn-strong, var(--text)); border: 1px solid var(--warn); overflow-wrap: anywhere; }
.lb-erinnerung .material-symbols-outlined { font-size: 16px; flex: 0 0 auto; }
.lb-erinnerung.lb-s2 { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.lb-karte-termin { margin-top: 4px; font-size: 0.74rem; color: var(--text-muted); font-weight: 600; }
.lb-tag.lb-rot { background: var(--danger-soft); color: var(--danger); }
.lb-frist { display: inline-block; width: auto; padding: 3px 8px; font-size: 0.85rem; }
.lb-filter { align-items: center; margin-top: 10px; }
.lb-erinn-gruppe { margin-bottom: 14px; }

/* 📱 v1.33.0 (L5): Fotos am Auftrag, Arbeitszeit, Stationsverwaltung */
.lb-fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-foto { display: block; width: 96px; height: 96px; border: 1px solid var(--outline); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-low); position: relative; }
.lb-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-foto-unter { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 0.65rem; padding: 2px 4px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-foto-box { position: relative; width: 96px; height: 96px; }
.lb-foto-box .lb-foto { width: 100%; height: 100%; }
.lb-foto-weg { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; }
.lb-foto-weg .material-symbols-outlined { font-size: 18px; }
.lb-foto-weg:hover, .lb-foto-weg:focus-visible { background: #b3261e; }
.lb-foto-zahl { color: var(--text-muted); font-size: 0.8rem; }
.lb-stationen-liste label { display: flex; align-items: center; gap: 8px; padding: 6px 0; min-height: 36px; }
.lb-neu-feld { border: 1px dashed var(--outline); border-radius: var(--radius-md); padding: 10px; }

/* 🛠️ v1.35.0 (Bedienrunde, 07.11.2026): Tor-Zeile mit Ampelfarbe, Freigeben/Blockieren, Kennzahlen-Leiste, Kontaktdaten, Label-Aufklappen.
   Alle Farben kommen aus den Theme-Rollen (--ok, --danger, --warn, --text …); die Tor-Töne sind helle Mischungen davon (Text bleibt --text, Kontrast weit über 4,5:1).
   Es gibt kein dunkles Theme in diesem Produkt — kommt eins, gehören diese Token in dessen Block. */
:root {
    --lb-tor-rot-bg: color-mix(in srgb, var(--danger) 14%, #fff);
    --lb-tor-gruen-bg: color-mix(in srgb, var(--ok) 16%, #fff);
    --lb-freigeben-bg: color-mix(in srgb, var(--ok) 86%, #000);
    --lb-freigeben-bg-hover: color-mix(in srgb, var(--ok) 72%, #000);
    --lb-blockieren-bg: var(--danger);
    --lb-blockieren-bg-hover: color-mix(in srgb, var(--danger) 80%, #000);
}
.lb-hinweisbox.lb-tor { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--text); font-weight: 600; }
.lb-hinweisbox.lb-tor.lb-tor-rot { background: var(--lb-tor-rot-bg); border-color: var(--danger); }
.lb-hinweisbox.lb-tor.lb-tor-gruen { background: var(--lb-tor-gruen-bg); border-color: var(--ok); }
.lb-tor-icon { flex: 0 0 auto; font-size: 24px; }
.lb-tor-rot .lb-tor-icon { color: var(--danger); }
.lb-tor-gruen .lb-tor-icon { color: var(--ok); }
.lb-tor-text { flex: 0 1 auto; overflow-wrap: anywhere; }
.btn-primary.lb-freigeben-an { background: var(--lb-freigeben-bg); color: #fff; }
.btn-primary.lb-freigeben-an:hover { background: var(--lb-freigeben-bg-hover); }
.btn-primary.lb-freigeben-aus, .btn-primary.lb-freigeben-aus:hover { background: var(--surface-hover); color: var(--text-muted); border: 1px solid var(--outline); box-shadow: none; transform: none; cursor: not-allowed; }
.btn-secondary.lb-blockieren { background: var(--lb-blockieren-bg); color: #fff; border: 2px solid var(--lb-blockieren-bg); }
.btn-secondary.lb-blockieren:hover { background: var(--lb-blockieren-bg-hover); border-color: var(--lb-blockieren-bg-hover); color: #fff; }
.lb-knopf.lb-rot-knopf { background: var(--lb-blockieren-bg); border-color: var(--lb-blockieren-bg); color: #fff; }
.lb-hinweisbox .lb-knopf.lb-aufheben { background: var(--lb-freigeben-bg); border-color: var(--lb-freigeben-bg); color: #fff; }
.lb-text-knopf { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; padding: 4px 2px; }
.lb-text-knopf:hover, .lb-text-knopf:focus-visible { color: var(--danger); }
.lb-stn.lb-skip { border-style: dashed; }
.lb-stn .material-symbols-outlined, .lb-tag .material-symbols-outlined { font-size: 14px; vertical-align: -3px; }
.lb-tag.lb-uebersprungen { background: var(--surface-low); color: var(--text-secondary); border: 1px dashed var(--outline); }

/* Kennzahlen-Leiste über dem Brett */
.lb-kennzahlen { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.lb-kz { background: var(--surface-card); border: 1px solid var(--outline); border-top: 4px solid var(--text); border-radius: var(--radius-md); padding: 10px 12px; min-width: 0; }
.lb-kz-rot { border-top-color: var(--danger); }
.lb-kz-gelb { border-top-color: var(--warn); }
.lb-kz-zahl { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.lb-kz-text { margin-top: 2px; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); overflow-wrap: anywhere; }
@media (max-width: 900px) { .lb-kennzahlen { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lb-kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lb-kz-zahl { font-size: 1.4rem; } }

/* v1.40.0 (L11): Handy — das Suchfeld steht ÜBER den Kennzahlen (am Rechner bleibt die Reihenfolge). Nur die Reihenfolge ändert sich (Flex mit `order`), nichts wird versteckt. */
@media (max-width: 600px) {
    #lb-brett { display: flex; flex-direction: column; }
    #lb-brett > * { min-width: 0; }
    #lb-brett > #lb-suche-zeile { margin-bottom: 12px; }
    #lb-brett > .lb-kennzahlen, #lb-brett > #lb-freigaben { order: 1; }
    #lb-brett > #lb-leer, #lb-brett > #lb-spalten, #lb-brett > #lb-abg { order: 2; }
}
/* v1.40.0 (L11): Unterlagen aus E-Mails in der Akte */
.lb-unterlagen-mail { border-top: 1px solid var(--outline); padding: 10px 0; min-width: 0; }
.lb-unterlagen-mail:first-child { border-top: 0; padding-top: 0; }
.lb-unterlagen-kopf { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; overflow-wrap: anywhere; }
.lb-unterlagen-liste { margin: 6px 0 0 0; padding-left: 0; list-style: none; overflow-wrap: anywhere; }
.lb-unterlagen-liste li { padding: 3px 0; min-height: 28px; }
.lb-unterlagen-nicht { color: var(--text-secondary); font-size: 0.85rem; }
.lb-unterlagen-frage { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 0.9rem; }

/* Beteiligte: anklickbare Zeilen mit Telefon und E-Mail */
.lb-b-zeile { cursor: pointer; }
.lb-b-zeile:hover, .lb-b-zeile:focus-visible { background: var(--surface-hover); outline: none; }
.lb-b-zeile[aria-expanded="true"] { background: var(--surface-hover); }
.lb-b-kontakt td { background: var(--surface-low); }
.lb-b-kontakt.hidden { display: none; }
.lb-b-kontakt-teil { display: inline-flex; align-items: center; gap: 4px; margin-right: 24px; }
.lb-b-kontakt-teil .material-symbols-outlined { font-size: 18px; color: var(--text-muted); }
.lb-keine-angabe { color: var(--text-muted); font-style: italic; }

/* Label-Filter und Label-Auswahl: Unterlabels aufklappbar */
.label-gruppe { display: inline-flex; align-items: stretch; gap: 2px; }
.label-gruppe .label-chip.hat-kinder { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.label-aufklapp { display: inline-flex; align-items: center; justify-content: center; width: 28px; padding: 0; border: none; border-radius: 4px var(--radius-pill) var(--radius-pill) 4px; background: var(--surface-card); box-shadow: var(--shadow-sm); color: var(--text-secondary); cursor: pointer; }
.label-aufklapp:hover, .label-aufklapp:focus-visible { background: var(--surface-hover); }
.label-aufklapp .material-symbols-outlined { font-size: 18px; transition: transform 0.15s ease; }
.label-aufklapp[aria-expanded="true"] .material-symbols-outlined { transform: rotate(180deg); }
.label-chip.teil-aktiv { box-shadow: inset 0 0 0 2px var(--label-color, var(--primary)); color: var(--text); font-weight: 700; }
.label-chip.label-kind { font-size: 0.78rem; padding: 5px 12px; }

/* 🗂️ v1.36.0: Bereich „Abgeschlossene Aufträge“ unter dem Brett (Tabelle, 50 je Seite; auf schmalen Bildschirmen gestapelte Zeilen, keine waagerechte Seitenverschiebung) */
.lb-abg { margin-top: 24px; max-width: 100%; min-width: 0; }
.lb-abg-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lb-abg-kopf h2 { margin: 0; font-size: 1.15rem; }
.lb-abg-reiter { display: flex; gap: 6px; }
.lb-abg-reiter button { border: 1px solid var(--border); background: var(--bg-card, #fff); color: var(--text); border-radius: var(--radius-md); padding: 6px 14px; font: inherit; font-size: 0.9rem; cursor: pointer; }
.lb-abg-reiter button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.lb-abg-suche { margin-bottom: 10px; }
.lb-abg-suche input { width: 100%; max-width: 520px; }
.lb-abg-tabelle { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.lb-abg-tabelle th { text-align: left; font-weight: 700; color: var(--text-muted); padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.lb-abg-tabelle td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.lb-abg-tabelle tr.lb-abg-zeile { cursor: pointer; }
.lb-abg-tabelle tr.lb-abg-zeile:hover td, .lb-abg-tabelle tr.lb-abg-zeile:focus-visible td { background: var(--hover-bg, rgba(0, 0, 0, 0.04)); }
.lb-abg-tabelle tr.lb-abg-zeile:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.lb-abg-blaettern { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.lb-abg-blaettern .lb-abg-seite { color: var(--text-muted); font-size: 0.9rem; }
@media (max-width: 700px) {
    .lb-abg-tabelle thead { position: absolute; left: -9999px; }
    .lb-abg-tabelle, .lb-abg-tabelle tbody, .lb-abg-tabelle tr, .lb-abg-tabelle td { display: block; width: 100%; box-sizing: border-box; }
    .lb-abg-tabelle tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
    .lb-abg-tabelle td { border-bottom: 0; padding: 2px 4px; }
    .lb-abg-tabelle td[data-label]::before { content: attr(data-label) ": "; color: var(--text-muted); font-size: 0.8rem; }
}

/* ── 📞 Anrufliste & Verzeichnis-Post (v1.41.0) — nur Theme-Rollen, keine Farb-Literale; Handy zuerst (Messung: scripts/klicktest-anrufliste.js) ── */
.search-bar .search-clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: var(--radius-lg); background: transparent; color: var(--text-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.search-bar .search-clear.hidden { display: none; }
.search-bar .search-clear:hover { background: var(--surface-hover); color: var(--text); }
.search-bar .search-clear:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.search-bar input { padding-right: 46px; }
.ar-view { max-width: 980px; }
.ar-knopf { min-height: 44px; }
.ar-kopf-knoepfe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ar-kampagne-wahl { width: auto; max-width: 100%; min-height: 44px; }
.ar-leitfaden { background: var(--surface-card); border: 2px solid var(--outline); border-radius: var(--radius-md); padding: 10px 14px; margin: 18px 0 0; }
@media (min-width: 901px) {
    .ar-inhalt { display: flex; flex-direction: column; }
    .ar-inhalt > .ar-leitfaden { order: -2; margin: 0 0 14px; }
    .ar-inhalt > .ar-stat-box { order: -1; }
}
.ar-leitfaden summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.ar-leitfaden-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; padding: 4px 0 8px; }
.ar-statistik { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.ar-kachel { background: var(--surface-card); border: 2px solid var(--outline); border-radius: var(--radius-md); padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.ar-kachel-zahl { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--text); }
.ar-kachel-text { font-size: 0.75rem; color: var(--text-secondary); overflow-wrap: anywhere; }
@media (max-width: 900px) { .ar-statistik { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ar-statistik { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ar-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ar-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--outline); border-radius: var(--radius-pill); background: var(--surface-card); color: var(--text); font-weight: 700; cursor: pointer; }
.ar-chip.aktiv { border-color: var(--primary); background: var(--primary-muted); color: var(--primary); }
.ar-chip-zahl { font-weight: 800; }
.ar-liste { display: flex; flex-direction: column; gap: 12px; }
.ar-karte { background: var(--surface-card); border: 2px solid var(--outline); border-left-width: 8px; border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ar-s-offen { border-left-color: var(--primary); }
.ar-s-rueckruf { border-left-color: var(--warn); }
.ar-s-nicht_erreicht { border-left-color: var(--warn); }
.ar-s-erledigt { border-left-color: var(--ok); }
.ar-s-widerspruch { border-left-color: var(--danger); }
.ar-karte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.ar-name { font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; min-width: 0; flex: 1 1 180px; }
.ar-status { font-size: 0.8rem; font-weight: 800; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-low); color: var(--text); white-space: normal; }
.ar-status-erledigt { background: var(--ok-soft); color: var(--text); }
.ar-status-rueckruf, .ar-status-nicht_erreicht { background: var(--warn-soft); color: var(--text); }
.ar-status-widerspruch { background: var(--danger-soft); color: var(--text); }
.ar-sub { font-size: 0.9rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.ar-brief-faellig { color: var(--text); font-weight: 700; }
.ar-tel { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border-radius: var(--radius-md); background: var(--primary-muted); color: var(--primary); font-weight: 800; font-size: 1.1rem; text-decoration: none; align-self: flex-start; max-width: 100%; overflow-wrap: anywhere; }
.ar-tel:not([href]) { background: var(--surface-low); color: var(--text-muted); }
.ar-hinweis { background: var(--warn-soft); border: 2px solid var(--warn); border-radius: var(--radius-md); padding: 8px 12px; font-size: 0.9rem; color: var(--text); overflow-wrap: anywhere; }
.ar-eintraege { margin: 0; padding-left: 20px; font-size: 0.9rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.ar-ampel { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; border: 2px solid var(--outline); }
.ar-ampel-gruen { background: var(--ok); }
.ar-ampel-gelb { background: var(--warn); }
.ar-ampel-rot { background: var(--danger); }
.ar-karte-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ar-karte-knoepfe .btn-primary, .ar-karte-knoepfe .btn-secondary, .ar-karte-knoepfe .btn-ghost { min-height: 44px; }
.ar-briefe, .ar-widerspruch { background: var(--surface-card); border: 2px solid var(--outline); border-radius: var(--radius-md); padding: 12px 14px; margin: 18px 0 0; }
.ar-briefe:empty, .ar-widerspruch:empty { display: none; }
.ar-h2 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.ar-versendet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.ar-versendet .form-input { width: auto; min-height: 44px; }
.ar-w-liste { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.ar-w-zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.ar-modal { max-width: 640px; }
.ar-zeile2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.ar-zeile3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.ar-modal .form-input { min-height: 44px; }
.ar-modal textarea.form-input { min-height: 88px; }
.ar-modal .checkbox-label { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.ar-modal .checkbox-label input[type="checkbox"] { width: 24px; height: 24px; flex-shrink: 0; }
.ar-gross { font-weight: 800; font-size: 1.05rem; }
.ar-block-nummer { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ar-mail-kopf { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; overflow-wrap: anywhere; font-size: 0.92rem; }
.ar-mail-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-low); border-radius: var(--radius-md); padding: 12px; max-height: 40vh; overflow-y: auto; font-family: var(--font-body); font-size: 0.9rem; line-height: 1.45; }
@media (max-width: 560px) {
    .ar-zeile2, .ar-zeile3 { grid-template-columns: minmax(0, 1fr); }
    .ar-modal.modal-card { padding: 18px 14px; }
    .ar-kampagne-wahl { width: 100%; }
    .ar-karte-knoepfe .btn-primary, .ar-karte-knoepfe .btn-secondary, .ar-karte-knoepfe .btn-ghost { flex: 1 1 100%; justify-content: center; }
}

/* ── v1.42.0: Abschnitt „Anbieterverzeichnis“ im Kontakt ── */
#detail-verzeichnis .dv-belege { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 6px; }
#detail-verzeichnis .dv-zeile { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--outline-variant, var(--border)); overflow-wrap: anywhere; }
#detail-verzeichnis .dv-label { font-weight: 700; min-width: 11em; }
#detail-verzeichnis .dv-wert { flex: 1 1 14em; min-width: 0; }
#detail-verzeichnis .dv-leer { color: var(--text-muted); }
#detail-verzeichnis .dv-warn .dv-wert { color: var(--danger); }
#detail-verzeichnis .dv-hinweis { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
#detail-verzeichnis .dv-link { color: var(--text-muted); }
#detail-verzeichnis .dv-aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 6px; }
#detail-verzeichnis .dv-ja-form { margin-top: 10px; padding: 10px; border: 2px solid var(--outline, var(--border)); border-radius: var(--radius-md, 8px); }
#detail-verzeichnis .form-input-sm, #detail-verzeichnis select.form-input-sm { min-height: 44px; }
#detail-verzeichnis .dv-anrufe { margin: 8px 0; }
#detail-verzeichnis .dv-anrufe summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
#detail-verzeichnis .dv-anruf-liste { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
