/* =============================================================================
   WP1 – Leads, Smart Views, Suche (SPEC_UI_CLOSE_1ZU1 C-03, C-04, C-12; ABGLEICH LS-01 … LS-40, SUCHE-01 … 07, VIEWS-01 … 04)
   Bausteine (Knöpfe, Menüs, .data-table, Chips …) kommen aus app.css; hier stehen nur die Regeln dieser Bildschirme.
   Maße an close\M02, M03, 03, 04c und E124 nachgemessen (Kommentare an den Regeln).
   1 Seitenkopf + Filterleiste · 2 Tabelle · 3 Filterpanel · 4 Filter-Schublade · 5 Menüs/Popover · 6 Dialoge ·
   7 Smart-View-Verwaltung + Formularseite · 8 Suchfenster + Befehlspalette · 9 Arbeitsliste (Übergang bis WP2)
   ============================================================================= */

/* ---------- 1 Seitenkopf + Filterleiste ---------- */
/* Kopf 68 px + Linie schon ab 1440 px [M M02: y 49–116, Linie 117; E124; B 03: 210–276]; Filterleiste 48 px + Linie [M M02: 118–165, 166] */
.leads-page > .page-head { min-height: 69px; gap: 12px; }
.leads-page > .filter-bar { height: 49px; }
.leads-page .page-head__title { gap: 6px; }
/* Titel-Caret wie Close: kleines gefülltes Dreieck statt Chevron [M M02] */
.leads-page .page-head__caret { width: 20px; height: 24px; }
.leads-page .page-head__caret .icon { display: none; }
.leads-page .page-head__caret::before { content: ""; border: 4px solid transparent; border-top: 5px solid var(--text-default); border-bottom: 0; }
.btn .caret { color: var(--icon-default); }
.btn-primary .caret { color: #fff; }
.btn-wrap, .inline-form { display: inline-flex; }
.btn-danger-text, .btn-danger-text .icon { color: var(--text-danger); }
.btn-danger-text:hover { color: var(--text-danger); background: var(--red-5); }
.leads-page .btn-menu { min-width: 54px; }                       /* [phone ▾] [zap ▾] 54 × 32 [M M02: x 1619–1672] */
.leads-page .bulk-button { padding: 0 10px 0 12px; }
/* Filterleiste: 24 px Rand, 16 px zwischen Knopf und Trefferzahl, rechts 4 px zwischen Sortierung und Spalten [B 03, M M02] */
.leads-page > .filter-bar, .views-page > .filter-bar { gap: 16px; }
.leads-page .filter-bar__right, .views-page .filter-bar__right { gap: 4px; }
.filter-toggle__chev { transition: transform var(--dur-quick) var(--ease); }
.filter-toggle[aria-expanded="true"] .filter-toggle__chev { transform: rotate(90deg); }
.filter-toggle .filter-toggle__chev { width: 14px; height: 14px; }
.filter-bar .blue-badge { justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 5px; line-height: 16px; }   /* „2“ 16 × 16 [M M02] */
.filter-bar__link { font-size: 13px; line-height: 18px; white-space: nowrap; }
.filter-bar .token-chip { flex: none; max-width: 40%; }
.list-error--warn { background: var(--gold-5); color: var(--gold-70); }
.list-error--warn .icon { color: var(--gold-50); }
.list-error + .list-error { border-top: 1px solid rgba(0, 0, 0, .05); }
.list-page > .list-error--warn { flex: none; }

/* ---------- 2 Tabelle ---------- */
/* Spaltenbreiten je + 1 px Linie: Checkbox 48 + Name 247 = 295 · Icon 45 · übrige 257 [B 03: Linien x 546/591/636/893; M M02] */
.lead-table col.col-check { width: 48px; }
.lead-table col.col-name { width: 247px; }
.lead-table col.col-icon { width: 45px; }
.lead-table col.col-std { width: 257px; }
.lead-table { width: 0; }                                         /* feste Spaltenbreiten aus <colgroup>; die Tabelle ist so breit wie ihre Spalten */
.lead-table .col-name { left: 48px; width: auto; padding: 0 12px 0 2px; }
.lead-table .col-icon { width: auto; }
.lead-table .col-std { width: auto; }
/* Zeilen 40 px + 1 px Linie = 41 px; Fuß 38 + 1 [M M02: Linien y 345/386/425] */
.lead-table thead th { height: 41px; }
.lead-table td, .lead-table tbody th { height: 41px; }
.lead-table tfoot td { height: 39px; padding: 0; }
.lead-table thead .col-check, .lead-table tbody .col-check { padding-left: 24px; }
.lead-table tbody tr { cursor: pointer; }
.lead-table tbody tr.is-cursor > *, .views-table tbody tr.is-cursor > * { background: var(--table-row-cursor); }
.lead-table tbody tr.is-selected > * { background: var(--table-cell-highlight); }
.lead-table tbody tr.is-selected.is-cursor > * { background: var(--table-row-cursor); }
.lead-table .row-cursor-marker { top: 50%; margin-top: -7px; }
/* .lead-name heißt auch die Überschrift der Lead-Seite (wp_detail.css) – beide Regeln stehen deshalb unter ihrem Bauteil */
.lead-table .lead-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lead-table .lead-name .entity { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-table .lead-name .avatar { width: 24px; height: 24px; font-size: 10px; font-weight: 600; }      /* Kreis 24 px bei x = 50 [B 03: 302–325] */
/* Icons der Icon-Spalten: 12 px mit Linie 2 – Tinte 12 × 12 (Hörer) bzw. 12 × 10 (Brief) wie Close [M M02: x 630–641, y 361–372] */
.lead-table .cell-icon .icon, .lead-table thead .col-icon .icon { width: 12px; height: 12px; stroke-width: 2; }
/* Icon-Spalten: Icon mittig, in Zeilen #474747, im Kopf #2e2e2e [M M02]; ohne Nummer/Adresse #c6c6c6 und ohne Funktion [B 03] */
.cell-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--icon-default); vertical-align: middle; }
a.cell-icon:hover { background: var(--bg-hover); text-decoration: none; }
.cell-icon.is-off { color: var(--gray-20); }
:root[data-theme="dark"] .cell-icon.is-off { color: var(--gray-30); }   /* „keine E-Mail/Nummer“ bleibt leise, aber ≥ 3 : 1 */
.lead-table thead .col-icon .icon { display: block; margin: 0 auto; color: var(--text-default); }
.lead-table .cell-icon .icon { position: relative; top: 1px; }
.lead-table td.col-icon, .lead-table th.col-icon { padding: 0; text-align: center; }
/* Checkboxen der Tabelle stehen auf der Zeilenmitte [M M02: Kästchen y 359–372 in der Zeile 346–385] – ohne das hängen sie an der Grundlinie */
.lead-table .col-check input[type="checkbox"]:not([role="switch"]) { display: grid; margin: 0; }   /* Block statt inline-grid (app.css): die Zelle setzt es mittig */
/* Status: Punkt 10 px ab 15 px, Text ab 37 px; beim Überfahren Caret – Klick öffnet das Status-Menü [M M02: Punkt x 976–985, y 361–370] */
.lead-table td.col-status { padding: 0 8px 0 4px; }
.status-cell {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 32px; padding: 0 8px 0 11px; border: 0; border-radius: 6px; background: none;
  font: 400 14px/20px var(--font-sans); color: var(--text-default); text-align: left; cursor: pointer; min-width: 0;
}
.status-cell__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Punkt 8 px in der Statusfarbe (grau = #e2e2e2) – wp_detail.css trägt noch eine ältere .status-dot-Regel (9 px, #9ca3af) */
.lead-table .status-dot, .menu .status-dot, .drawer-option .status-dot { width: 8px; height: 8px; background: var(--gray-10); }
.lead-table .status-cell .status-dot { width: 10px; height: 10px; }                 /* in der Tabelle 10 px [M M02] */
.lead-table .status-dot[data-color=blue], .menu .status-dot[data-color=blue] { background: #d4e3ff; }
.lead-table .status-dot[data-color=green], .menu .status-dot[data-color=green] { background: #c9f4c5; }
.lead-table .status-dot[data-color=yellow], .menu .status-dot[data-color=yellow] { background: #f9e9a1; }
.lead-table .status-dot[data-color=orange], .menu .status-dot[data-color=orange] { background: #ffdbc1; }
.lead-table .status-dot[data-color=purple], .menu .status-dot[data-color=purple] { background: #e4ddff; }
.lead-table .status-dot[data-color=magenta], .menu .status-dot[data-color=magenta] { background: #ffd6e1; }
.lead-table .status-dot[data-color=teal], .menu .status-dot[data-color=teal] { background: #b3f4f1; }
.status-cell__caret { margin-left: auto; color: var(--icon-default); visibility: hidden; }
.status-cell:hover, .status-cell[aria-expanded="true"] { background: var(--bg-hover); }
.status-cell:hover .status-cell__caret, .status-cell[aria-expanded="true"] .status-cell__caret, .status-cell:focus-visible .status-cell__caret { visibility: visible; }
.status-cell.is-saving { opacity: .6; pointer-events: none; }
.lead-table td a:not(.cell-icon) { color: var(--text-default); }
.lead-table td a:not(.cell-icon):hover { color: var(--link); }
/* Spaltenkopf: Klick auf das Wort sortiert; beim Überfahren ⋯ (Nach diesem Feld filtern · Spalte ausblenden) [E111, E112] */
.th-inner { display: flex; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.th-label { color: var(--text-default); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
a.th-label:hover { text-decoration: none; color: var(--text-default); }
/* Sortierpfeil im Kopf: schmal, hoch, schwarz und kräftig wie Close [M M02: 8 × 13 px, Schaft 2 px, x 1330–1337] */
.th-arrow { color: var(--text-default); flex: none; stroke-width: 3; }
/* Knöpfe „Sortierung“ und „Spalten“ der Filterleiste [M M02, Knopf 24 px hoch]: Icons in Textfarbe; Pfeil-Mitte 17,5 px und Text ab
   30 px vom linken Rand; Spalten-Icon 14 × 12 px ab 11 px, Text ab 29 px, rechts 13 px frei */
.leads-page .filter-bar__right .btn .icon { color: var(--text-default); }
.leads-page .filter-bar__right .btn-sm { gap: 4px; padding: 0 9px 0 10px; }
.leads-page .filter-bar__right .btn-sm .icon-columns-2 { margin-right: -3px; }
.leads-page .filter-bar__right .btn-sm:has(.icon-columns-2) { padding: 0 13px 0 9px; }
.th-more {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: auto; padding: 0; border: 0; border-radius: 4px;
  background: none; color: var(--gray-40); cursor: pointer; opacity: 0; flex: none;
}
.th-more:hover { background: var(--bg-hover); color: var(--icon-default); }
th:hover > .th-inner .th-more, .th-more:focus-visible, .th-more[aria-expanded="true"] { opacity: 1; }
.lead-table thead th.num .th-inner { justify-content: flex-end; }
.lead-table thead th.num .th-more { margin-left: 0; order: -1; margin-right: auto; }
/* Auswahl ersetzt den Tabellenkopf: „[–] 1 Lead ausgewählt“ [E116, B 04e] */
/* 41 px wie die Kopfzeile (40 + Linie): beim Auswählen springt die Tabelle nicht um 1 px */
.data-table .selection-row > th { height: 41px; font-weight: 600; border-right: 0; border-bottom: 1px solid var(--border-default); }
.lead-table .selection-row > th:last-child { padding-left: 2px; }
.selection-row__inner { display: flex; align-items: center; gap: 8px; }
.selection-row__sep { width: 1px; height: 20px; margin: 0 4px; background: var(--border-default); }
/* Fuß „+ Berechnung“: 13 px #767676, unter Name und Zahlen-/Datumsspalten immer, sonst beim Überfahren [M M02, E109] */
.calc-btn {
  display: flex; align-items: center; gap: 5px; width: 100%; height: 38px; padding: 4px 12px 0 13px; border: 0; background: none; cursor: pointer;
  font: 400 13px/18px var(--font-sans); color: var(--text-light); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calc-btn .icon { color: var(--text-light); flex: none; }
/* unter Checkbox + Name eine Zelle: „+“ bei x = 26 [M M02] – bleibt beim waagerechten Scrollen links stehen */
.lead-table tfoot td.calc-cell--name { position: sticky; left: 0; z-index: calc(var(--z-sticky) + 1); }
.calc-cell--name .calc-btn { padding-left: 25px; }
.calc-btn:not(.is-visible):not(.has-value) > * { visibility: hidden; }
.calc-cell:hover .calc-btn > *, .calc-btn:focus-visible > *, .calc-btn[aria-expanded="true"] > * { visibility: visible; }
.calc-btn:hover, .calc-btn[aria-expanded="true"] { background: var(--gray-2); }
.calc-btn.has-value { font-weight: 600; color: var(--text-default); }
.calc-cell.num .calc-btn { justify-content: flex-end; }
.lead-table tr.sentinel > td { height: 40px; text-align: center; border-right: 0; border-bottom: 0; background: transparent; font-size: 13px; }
.lead-table tr.sentinel.is-loading a { visibility: hidden; }
.lead-table tr.sentinel.is-loading > td { background: linear-gradient(90deg, transparent 0, transparent calc(50% - 60px), var(--bg-skeleton) calc(50% - 60px), var(--bg-skeleton) calc(50% + 60px), transparent calc(50% + 60px)) center / 100% 12px no-repeat; }
.data-table tr.empty-row > td { height: auto; border-right: 0; border-bottom: 0; background: transparent; white-space: normal; }
.data-table tr.empty-row:hover > td { background: transparent; }
.leads-page.is-busy .table-scroll { opacity: .6; transition: opacity var(--dur-base) var(--ease) .15s; }

/* ---------- 3 Filterpanel [M M02: Band y 167–210 + Linie #f1f1f1; Chips 24 px; Zeilenabstand 14 px] ---------- */
.filter-panel { flex: none; max-height: max(40%, 232px); overflow: auto; background: var(--surface); border-bottom: 1px solid var(--border-default); font-size: 13px; line-height: 18px; }
/* Passt das Panel nicht ganz (viele Bedingungen, niedriges Fenster, Erinnerungsleiste), scrollt es in sich. Die unterste Kante blendet
   16 px weich nach Weiß aus: eine angeschnittene Zeile sieht nach „geht weiter“ aus, nicht nach einem halbierten Chip. Am Ende des
   Panels liegt der Verlauf über dem unteren Innenabstand (18 px) und ist nicht zu sehen. */
.filter-panel::after { content: ""; position: sticky; bottom: 0; display: block; height: 16px; margin-top: -16px; background: linear-gradient(rgba(255, 255, 255, 0), var(--surface)); pointer-events: none; }
.filter-panel--static { max-height: none; border: 1px solid var(--border-default); border-radius: 8px; overflow: hidden; }
.filter-panel--static::after { content: none; }
.filter-panel__band {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px; padding: 0 16px; background: var(--surface-medium);
  border-bottom: 1px solid var(--border-light); color: var(--text-default);
}
.filter-panel__band b, .filter-line__object { font-weight: 600; }
.filter-panel__body { padding: 12px 24px 18px; }
.filter-line { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 24px; }
/* Raster wie Close: Bedingungszeilen 36 px (24 + 12), die Schlusszeile mit den Knöpfen 38 px [04c, M02, E209] */
.filter-line + .filter-line, .filter-line + .filter-nest, .filter-nest + .filter-line { margin-top: 12px; }
.filter-line + .filter-line--add, .filter-nest + .filter-line--add { margin-top: 14px; }
/* Die Schlusszeile („Filter hinzufügen“ / „Gruppe hinzufügen“) bleibt unten im Panel stehen, wenn es in sich scrollt (LS-V1: viele
   Bedingungen bei niedrigem Fenster) – nur die Bedingungen laufen darunter durch, der weiche Übergang sitzt über ihr. Am Ende des
   Panels steht sie genau wie bisher: 6 px Innenabstand oben ersetzen 6 px Abstand, die 18 px unten liegen im Innenabstand des Panels. */
.filter-panel__body > .filter-line--add { position: sticky; bottom: 0; z-index: 2; margin: 0 -24px -18px; padding: 0 24px 18px; background: var(--surface); }
.filter-panel__body > * + .filter-line--add { margin-top: 8px; padding-top: 6px; }
.filter-panel__body > .filter-line--add::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; background: linear-gradient(rgba(255, 255, 255, 0), var(--surface)); pointer-events: none;
}
.filter-line__head { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; flex: none; max-width: 100%; flex-wrap: wrap; }
.filter-line__lead { font-weight: 600; min-width: 46px; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; max-width: 100%; }
/* „mindestens eine“: vor jedem Chip steht „oder“ (auch vor dem ersten) und bleibt beim Umbrechen bei seinem Chip [E207] */
.filter-or { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.filter-panel .select-inline { font-size: 13px; line-height: 18px; gap: 8px; padding: 2px 6px 3px; white-space: nowrap; }
.filter-panel .select-inline:hover { background: var(--bg-hover); border-radius: 4px 4px 0 0; }
.select-inline.is-static { cursor: default; }
.select-inline .caret { color: var(--text-default); }
.filter-panel .mini-badge { height: 18px; padding: 0 6px; border-radius: 4px; font-size: 12px; line-height: 18px; color: var(--text-default); }
.token-chip { white-space: nowrap; gap: 4px; }
.token-chip .icon-x { stroke-width: 2.25; }
.token-chip__label { overflow: hidden; text-overflow: ellipsis; }
.token-chip b { overflow: hidden; text-overflow: ellipsis; }
.token-chip .mini-badge { height: 16px; padding: 0 4px; border-radius: 3px; font-size: 11px; line-height: 16px; }
.token-chip.is-editable { cursor: pointer; }
.token-chip__x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; flex: none; }
.token-chip__x:hover { background: rgba(0, 0, 0, .1); }
.filter-line__tools { display: inline-flex; gap: 2px; margin-left: 2px; opacity: 0; }
.filter-line:hover .filter-line__tools, .filter-line:focus-within .filter-line__tools { opacity: 1; }
.filter-tool { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--gray-40); cursor: pointer; }
.filter-tool:hover { background: var(--bg-hover); color: var(--icon-default); }
/* verschachtelte Gruppe: 38 px eingerückt, senkrechte Führungslinie mit waagerechtem Ansatz je Zeile [E091] */
.filter-nest { position: relative; margin: 12px 0 0 11px; padding-left: 27px; border-left: 1px solid var(--border-default); }
.filter-nest > .filter-line::before { content: ""; position: absolute; left: -27px; top: 12px; width: 19px; height: 1px; background: var(--border-default); }
.filter-nest > .filter-line:last-child::after { content: ""; position: absolute; left: -28px; top: 13px; bottom: -1px; width: 1px; background: var(--surface); }

/* ---------- 4 Filter-Schublade [M M03: 500 px ab y 56; Kopf 56; Suche 32; Zeilen 43; Fuß 64] ---------- */
.filter-drawer {
  position: fixed; top: 55px; right: 0; bottom: 0; width: 500px; max-width: 100vw; z-index: var(--z-dropdown); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border-default); box-shadow: var(--shadow-4); animation: drawer-in .25s var(--ease-out);
}
.filter-drawer[hidden] { display: none; }
/* Während eines Anrufs ist die Kopfleiste um die Gesprächsleiste höher (63 px, wp_telephony.css: .topbar.has-call-bar bzw.
   ohne Optik-Skript über :has()). Die Schublade beginnt wie in Close an deren Unterkante [E179], nicht darunter verdeckt. */
body:has(.topbar.has-call-bar) .filter-drawer,
body:has(.topbar .softphone-bar [data-sp="hangup"]:not([hidden])) .filter-drawer { top: 118px; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Meldungen („Spalten gespeichert.“) stehen über dem Fuß der offenen Schublade (64 px + 8 px), nicht auf „Abbrechen / Fertig“ */
body:has(.filter-drawer:not([hidden])) { --toast-bottom: 72px; }
.filter-drawer__head { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 12px 0 16px; flex: none; }
.filter-drawer__back { margin-left: -8px; }
.filter-drawer__title { flex: 1; min-width: 0; margin: 0; font: 600 16px/24px var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-drawer__title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.filter-drawer__title.is-category { display: flex; align-items: center; justify-content: center; gap: 8px; padding-left: 4px; font-size: 15px; }   /* 4 px: gleicht den Versatz des Zurück-Knopfs aus – Mitte der Schublade */
.filter-drawer__title.is-category > .icon { color: var(--icon-default); flex: none; }
.filter-drawer__search { position: relative; margin: 0 12px 16px 16px; flex: none; }
.filter-drawer__search-icon, .popover__search-icon, .views-search__icon { position: absolute; left: 12px; top: 8px; display: inline-flex; color: var(--icon-default); pointer-events: none; }
.filter-drawer__body { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--border-default); outline: 0; }
.filter-drawer__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; height: 64px; padding: 0 16px; border-top: 1px solid var(--border-default); flex: none; }
.drawer-cat {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 48px); height: 43px; margin: 0 24px; padding: 0; border: 0; border-bottom: 1px solid var(--border-default);
  background: none; font: 500 14px/20px var(--font-sans); color: var(--text-default); text-align: left; cursor: pointer;
}
.drawer-cat > .icon { color: var(--gray-40); flex: none; }
/* Pfeil wie in M03: langer Schaft, flacher Kopf (Tinte 14 × 9 px statt 11 × 11) – waagerecht gestreckt, rechte Kante bleibt (LS-V3) */
.drawer-cat > .icon:last-child { margin-left: auto; transform: scaleX(1.3); transform-origin: 100% 50%; }
.drawer-cat:hover, .drawer-cat:focus-visible { background: var(--gray-2); box-shadow: -24px 0 0 var(--gray-2), 24px 0 0 var(--gray-2); outline: 0; }
.drawer-section { padding: 16px 24px 4px; }
.drawer-section__title { margin: 0 0 8px; font: 600 14px/20px var(--font-sans); color: var(--text-default); }
.drawer-section__title--caps { font: 600 12px/16px var(--font-sans); text-transform: uppercase; color: var(--text-light); }
.drawer-field { display: flex; align-items: center; gap: 8px; min-height: 28px; font: 600 13px/18px var(--font-sans); color: var(--text-default); cursor: pointer; }
.drawer-field > .icon { width: 12px; height: 12px; color: var(--gray-40); flex: none; }   /* Typ-Icon 12 px [E097] */
.drawer-field__name { min-width: 0; overflow-wrap: anywhere; }
.drawer-field--single { cursor: default; }
.drawer-editor { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px 22px; }
.drawer-editor .select, .drawer-editor .input { height: 32px; }
.drawer-editor__row { display: flex; align-items: center; gap: 8px; }
.drawer-editor__row > .input { flex: 1; min-width: 0; }
.drawer-editor__unit { color: var(--text-light); font-size: 13px; white-space: nowrap; }
.drawer-radio { display: flex; gap: 20px; font-weight: 400; }
.drawer-radio label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.drawer-multi { border: 1px solid var(--form-border); border-radius: 8px; overflow: hidden; }
.drawer-multi__search { position: relative; border-bottom: 1px solid var(--border-default); }
.drawer-multi__search .input { border: 0; border-radius: 0; padding-right: 36px; }
.drawer-multi__search .icon { position: absolute; right: 12px; top: 8px; color: var(--icon-default); pointer-events: none; }
.drawer-multi__list { max-height: 264px; overflow: auto; padding: 4px; }
.drawer-option { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 8px; border-radius: 6px; font: 400 14px/20px var(--font-sans); color: var(--text-default); cursor: pointer; }
.drawer-option:hover { background: var(--menu-item-hover); }
.drawer-option small { margin-left: 4px; color: var(--text-light); font-size: 12px; }
.drawer-option--head { font-weight: 600; margin-top: 4px; border-top: 1px solid var(--border-default); border-radius: 0; padding-top: 4px; }
.drawer-multi__foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-default); font-size: 13px; color: var(--text-default); }
.drawer-multi__foot .icon { color: var(--icon-default); }
.drawer-summary { font: 400 12px/16px var(--font-sans); color: var(--text-light); }
/* Datumsfeld ohne Wert: „Option wählen“ grau wie ein Platzhalter [E119] */
.drawer-editor .select.is-placeholder { color: var(--text-light); }
.drawer-editor .select.is-placeholder option { color: var(--text-default); }
/* Einzel-Bearbeitung: „Filter in eigene Gruppe herausziehen“ – grauer unterstrichener Textlink unter dem Editor [E113] */
.drawer-link { display: inline-block; margin: 6px 0 0 22px; padding: 0; border: 0; background: none; font: 400 13px/18px var(--font-sans); color: var(--text-light); text-decoration: underline; cursor: pointer; }
.drawer-link:hover { color: var(--text-default); }
.drawer-empty { margin: 0; padding: 24px; color: var(--text-medium); text-align: center; }
/* Suchtreffer: je Kategorie eine Überschrift, darunter deren Abschnitte; Linie zwischen den Kategorien [E199] */
.drawer-hits + .drawer-hits { border-top: 1px solid var(--border-default); }
.drawer-hits__title { margin: 0; padding: 16px 24px 0; font: 700 18px/24px var(--font-sans); color: var(--text-default); }
.drawer-hits > .drawer-section { padding-top: 10px; }
.drawer-hint { margin: 0; padding: 8px 24px 0; font-size: 13px; line-height: 18px; color: var(--text-light); }

/* ---------- 5 Menüs und Popover ---------- */
.menu-item__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .check { visibility: hidden; }
.menu-item.is-selected .check, .menu-item[aria-checked="true"] .check { visibility: visible; }
/* gewählte Zeile: hellblau aus app.css (--menu-item-selected) wie in Close [E032, E171] – hier nicht grau überschreiben */
/* zweizeilige Einträge: Icon · Titel fett · Beschreibung grau [E077, E080] */
.menu--two { width: 280px; padding: 8px; }
.menu-item--two { align-items: flex-start; padding: 6px 8px; white-space: normal; }
.menu-item--two > .icon { margin-top: 3px; }
.menu-item--two .menu-item__label { padding: 0; }
.menu-item--two strong { font-weight: 600; }
.menu-item--two .menu-item__hint { display: block; }
.menu-item__formula { display: block; font: 600 12px/16px var(--font-sans); color: var(--text-default); letter-spacing: .02em; margin-top: 2px; }
.mode-menu { width: 260px; padding: 8px; }
.mode-menu .menu-item--two > .check { margin-top: 2px; }
.exists-menu { min-width: 120px; }
.more-menu { min-width: 232px; }
.calc-menu .menu-item[hidden] { display: none; }
/* Smart-View-Umschalter am Titel: 340 px, Suche oben, Liste scrollt [E070] */
.view-switcher { width: 340px; max-width: 340px; max-height: min(620px, 70vh); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.view-switcher[hidden] { display: none; }
.view-switcher__list { flex: 1; min-height: 0; overflow: auto; padding: 4px 8px 8px; }
.popover__search { position: relative; padding: 8px; flex: none; }
.popover__search .popover__search-icon { left: 20px; top: 16px; }
.popover { display: flex; flex-direction: column; overflow: hidden; }
.popover[hidden] { display: none; }
.popover form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
/* .popover__body / .popover__foot benutzt auch das Zeitraum-Popover der Lead-Seite (wp_detail.css) – hier nur die zwei Menüs der Liste */
.sort-menu .popover__body, .columns-menu .popover__body { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 8px; }
.sort-menu .popover__foot, .columns-menu .popover__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-default); background: var(--surface); flex: none; }
.popover__hint { margin: 0; padding: 6px 16px; font-size: 12px; line-height: 16px; color: var(--text-light); border-top: 1px solid var(--border-default); flex: none; }
.sort-menu { width: 320px; max-width: 320px; }
.columns-menu { width: 275px; max-width: 275px; }
.seg { display: flex; gap: 2px; padding: 2px; margin: 4px 0 8px; border-radius: 6px; background: var(--gray-5); }
.seg__btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 24px; border: 0; border-radius: 4px; background: none; font: 400 13px/18px var(--font-sans); color: var(--text-medium); cursor: pointer; }
.seg__btn.is-on { background: var(--surface); color: var(--text-default); box-shadow: var(--shadow-1); }
.menu-group[hidden] { display: none; }
/* zwischen zwei Gruppen: 8 px · Linie · 10 px – von der letzten Zeile bis zur nächsten Überschrift 52 px wie Close [E248, E104] */
.menu-group + .menu-group { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border-default); }
.menu-group__head { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 32px; padding: 0 8px; border: 0; background: none; font: 600 14px/20px var(--font-sans); color: var(--text-default); cursor: pointer; }
.menu-group__head .icon { color: var(--icon-default); transition: transform var(--dur-quick) var(--ease); }
.menu-group.is-collapsed .menu-group__head .icon { transform: rotate(180deg); }
.menu-group.is-collapsed .menu-group__items { display: none; }
/* Zeilen der Listen „Sortierung“ und „Spalten“: 34 px wie Close (E104/E106 bei 1920 px: 373 → 401 → 428 im 0,817-Bild = 33,9 px;
   30_leads_smartviews N4 „Zeile 33 px“) */
.menu-group__items .menu-item { min-height: 34px; }
.menu-check { cursor: pointer; }
.menu-check.is-checked { background: var(--blue-5); }
.menu-check.is-fixed { opacity: .55; cursor: default; }
.menu-check.is-disabled { opacity: .5; }

/* ---------- 6 Dialoge (im Modal) ---------- */
/* „Neuer Lead“: Trenner „ODER“ (Linie · Wort · Linie) und umrandeter Knopf über die ganze Breite wie Close [E090] */
.new-lead-or { display: flex; align-items: center; gap: 12px; margin: 0; font: 400 12px/16px var(--font-sans); color: var(--text-light); }
.lead-form--new .privacy-duplicate-check:empty { display: none; }      /* ohne Hinweis kein leerer Abstand vor „ODER“ */
.new-lead-or::before, .new-lead-or::after { content: ""; flex: 1; height: 1px; background: var(--border-default); }
.new-lead-alt { display: flex; width: 100%; justify-content: center; }
.modal-band { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--cyan-5); color: var(--cyan-70); }
.modal-band strong { display: block; font: 600 14px/20px var(--font-sans); color: var(--text-default); }
.modal-band span { font-size: 13px; line-height: 18px; }
.modal-band__icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--cyan-70); flex: none; }
.modal-band--warn { background: var(--gold-5); color: var(--gold-70); }
.modal-band--warn .modal-band__icon { color: var(--gold-60); }
.modal-content.form { gap: 12px; }
.field-optional { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px; background: var(--gray-5); font: 400 11px/16px var(--font-sans); color: var(--text-medium); }
.textarea-count { position: relative; display: block; }
.textarea-count textarea.input { min-height: 95px; padding-bottom: 22px; resize: vertical; }
.textarea-count__n { position: absolute; right: 12px; bottom: 6px; font-size: 12px; line-height: 16px; color: var(--text-light); pointer-events: none; }
.share-targets { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--gray-1); }
.share-targets[hidden] { display: none; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; max-height: 220px; overflow: auto; }
.check-grid--one { grid-template-columns: 1fr; }
.check-grid > div { display: contents; }
.check-grid label { display: flex; align-items: center; gap: 8px; font-weight: 400; min-width: 0; cursor: pointer; }
.check-grid label.is-off { color: var(--text-light); cursor: default; }
.view-meta__more { align-self: flex-start; font-size: 13px; }
.radio-group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.radio-group legend { padding: 0 0 8px; }
.radio-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.radio-row input { margin-top: 3px; }
.radio-row strong { display: block; font-weight: 400; }
.radio-row small { display: block; font-size: 13px; line-height: 18px; color: var(--text-light); }
.bulk-confirm__sub { margin: 4px 0 0; font: 600 12px/16px var(--font-sans); text-transform: uppercase; color: var(--text-light); }
.bulk-confirm__list { margin: 0; padding: 0; list-style: none; max-height: 200px; overflow: auto; border: 1px solid var(--border-default); border-radius: 8px; }
.bulk-confirm__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; padding: 0 12px; border-bottom: 1px solid var(--border-light); }
.bulk-confirm__list li:last-child { border-bottom: 0; }
.bulk-confirm--page { max-width: 640px; margin: 0 auto; overflow: hidden; }
.bulk-confirm--page .modal-footer { border-radius: 0; }
.bulk-confirm .field-custom .label { font: 600 13px/18px var(--font-sans); }

/* ---------- 7 Smart-View-Verwaltung [E024–E028] und Formularseite ---------- */
.page-head--tall { min-height: 80px; }
.filter-bar--tools { height: 56px; }
.views-search { position: relative; width: 400px; max-width: 40vw; margin-left: 8px; }
.data-table--plain { width: 100%; }
.data-table--plain thead th, .data-table--plain td, .data-table--plain tbody th { border-right: 0; }
.views-table col.col-check { width: 48px; }
.views-table col.col-share, .views-table col.col-owner { width: 184px; }
.views-table col.col-date { width: 150px; }
.views-table col.col-more { width: 56px; }
.views-table .col-check { padding: 0 0 0 24px; width: auto; }
.views-table thead th { height: 41px; }
.views-table td, .views-table tbody th { height: 41px; }
.views-table thead th.num { text-align: right; }
.views-table thead th .th-label { display: inline; }
.views-table thead th .th-arrow { vertical-align: -2px; margin: 0 4px; }
.views-table__name { padding-left: 2px; }
.views-table__name .entity { font-weight: 600; margin-right: 8px; }
.views-table__name .entity-off { color: var(--text-medium); margin-right: 8px; }
.views-table__name .status-pill { margin-right: 6px; }
.views-table__share { display: inline-flex; align-items: center; gap: 8px; }
.views-table__share .icon { color: var(--icon-default); }
.views-table__date { color: var(--text-medium); }
.views-table .col-more { padding: 0 16px 0 0; text-align: right; }
.row-more { opacity: 0; }
tr:hover .row-more, .row-more:focus-visible, .row-more[aria-expanded="true"] { opacity: 1; }
#view-row-menu .when-pinned, #view-row-menu.is-pinned .when-unpinned { display: none; }
#view-row-menu.is-pinned .when-pinned { display: inline-block; }
.views-table tr.is-broken .entity { color: var(--text-danger); }
.btn-sm.is-on { background: var(--gray-5); }
.view-form { max-width: 720px; padding: 24px 24px 40px; display: flex; flex-direction: column; gap: 24px; }
.view-form__section { display: flex; flex-direction: column; gap: 12px; }
.view-form__section > h2 { font: 600 16px/24px var(--font-sans); padding-bottom: 8px; border-bottom: 1px solid var(--border-default); }
.view-form__details > summary { cursor: pointer; font-size: 14px; color: var(--link); margin-bottom: 8px; }
.view-form__sort { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.view-form__actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border-default); }
.view-form .list-error { border-radius: 6px; }
.view-form .check-grid { max-height: 300px; }
.filter-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.filter-rows[hidden] { display: none; }
.filter-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) auto; gap: 8px; align-items: center; }
.filter-row select, .filter-row input {
  width: 100%; height: 32px; padding: 0 12px; border: 1px solid var(--form-border); border-radius: 8px; background: var(--surface); color: var(--text-default); font: inherit;
}
@media (max-width: 900px) { .filter-row { grid-template-columns: 1fr 1fr; } }

/* ---------- 8 Suchfenster der Kopfleiste [E011, E012] und Befehlspalette [E022] ---------- */
/* Feld und Fenster bilden eine Fläche: so breit wie das Feld, ohne Abstand, Linie dazwischen (SUCHE-02) */
.topbar-search .search-panel.omnibox-suggestions {
  top: 100%; left: 0; width: 100%; max-width: none; padding: 0 0 6px; border: 0; border-top: 1px solid var(--border-default);   /* Höhe: .search-panel in app.css (92vh, in niedrigen Fenstern 80vh) – keine Abzugsrechnung (B.1) */
  border-radius: 0 0 8px 8px; box-shadow: 0 18px 25px 0 rgba(0, 0, 0, .15);
}
.topbar-search:has(.omnibox-suggestions:not([style*="display: none"]) .suggest) { z-index: var(--z-dropdown); }
.topbar-search:has(.omnibox-suggestions:not([style*="display: none"]) .suggest) .topbar-search__input {
  background: var(--surface); border-color: transparent; border-radius: 8px 8px 0 0; box-shadow: 0 0 25px 0 rgba(0, 0, 0, .15);
}
.topbar-search__clear {
  position: absolute; right: 10px; top: 11px; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--text-light); cursor: pointer;
}
.topbar-search__clear:hover { color: var(--text-default); }
.topbar-search__clear[hidden] { display: none; }
.suggest__section { padding: 12px 12px 4px; font: 400 12px/16px var(--font-sans); text-transform: uppercase; color: var(--text-light); }
.suggest__section--line, .suggest__line { margin-top: 8px; border-top: 1px solid var(--border-default); }
.suggest__line { height: 0; margin-bottom: 8px; }
.suggest__row {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; color: var(--text-medium); font: 400 14px/20px var(--font-sans); text-decoration: none; cursor: pointer;
}
.suggest__row:hover { text-decoration: none; color: var(--text-medium); }
.suggest__row > .icon { color: var(--gray-40); flex: none; }
.suggest__row.is-active { background: var(--gray-5); }
.suggest__main { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.suggest__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.suggest__name b, .suggest__sub b { font-weight: 600; color: var(--text-default); }
.suggest__sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-light); flex: 1 10 0; }
.suggest__lead { display: inline-flex; align-items: center; gap: 6px; max-width: 50%; min-width: 0; font-size: 13px; color: var(--text-medium); }
.suggest__lead span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest__lead .icon { color: var(--gray-40); flex: none; }
.suggest__hint { display: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-light); }
.suggest__row.is-active .suggest__hint { display: block; }
.suggest__enter { display: none; color: var(--text-light); flex: none; }
.suggest__row.is-active .suggest__enter { display: inline-flex; }
.suggest .status-pill { flex: none; max-width: 150px; }
/* Befehlspalette: Modal 672 px, Oberkante 180 px, ohne Kopfzeile */
.modal:has(.palette) { padding-top: min(180px, 20vh); }
.modal:has(.palette) .modal-dialog { max-width: 672px; overflow: hidden; }
.modal:has(.palette) .modal-close { display: none; }
.palette__field { position: relative; padding: 12px 12px 8px; }
.palette__field .input { height: 36px; padding-right: 130px; }
.palette__hint { position: absolute; right: 24px; top: 21px; font-size: 13px; line-height: 18px; color: var(--text-light); pointer-events: none; }
.palette__list { max-height: min(380px, 50vh); overflow: auto; padding: 0 8px 8px; }
.palette__list[hidden] { display: none; }
.palette__list .suggest__row { border-radius: 6px; }
.palette__list .suggest__row[hidden] { display: none; }
.palette__keys { display: inline-flex; gap: 4px; }
.palette__none { margin: 0; padding: 12px; color: var(--text-light); }
.palette__foot { padding: 10px 16px; border-top: 1px solid var(--border-default); background: var(--surface-medium); font-size: 13px; line-height: 18px; color: var(--text-medium); }

/* ---------- 9 Arbeitsliste auf der Lead-Seite (Übergang: das Template gehört WP2, das die schwebende Leiste baut) ---------- */
.worklist-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 8px 12px; margin: 0 0 12px; background: var(--gray-2); border: 1px solid var(--border-default); border-radius: 8px; }
.worklist-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.worklist-view { font-weight: 600; color: var(--text-default); }
.worklist-progress { width: 120px; height: 6px; }
.worklist-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.worklist-actions kbd { font-size: 11px; padding: 0 4px; }
@media (max-width: 640px) { .worklist-progress { display: none; } .worklist-bar { position: sticky; top: 0; z-index: 20; } }

/* ---------- Altbestand – übernommen aus completion.css (WP0, einmalig verschoben): Filterformulare „card filter-panel“ der
   Datenschutz- und Berichtsseiten, bis WP6/WP7 sie umbauen; sie bekommen die Regeln des neuen Filterpanels (3) nicht ---------- */
.card.filter-panel { padding: 16px; margin-bottom: 14px; max-height: none; overflow: visible; font-size: 14px; line-height: 20px; }
.card.filter-panel label:where(:not(.checkbox):not(.radio):not(.switch)) { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }

/* ---------- schmale Fenster ---------- */
@media (max-width: 1100px) {
  .views-table col.col-owner, .views-table .views-table__owner { width: 140px; }
  .filter-drawer { width: min(500px, 100vw); }
}
@media (max-width: 760px) {
  .leads-page > .page-head { padding: 0 12px; }
  .leads-page > .filter-bar, .views-page > .filter-bar { padding: 0 12px; overflow-x: auto; }
  .views-search { width: 220px; }
  .check-grid { grid-template-columns: 1fr; }
}
@media print { .filter-drawer, .filter-panel { display: none !important; } }
