/* Pepsi-Filter (tabs/pepsi-suche.js): flache Zeile über dem Kartenraster wie bei Leads/Pipeline, Handy zweispaltig. */
.pepsi-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 16px; }
.pepsi-filter input[type="search"] { flex: 1 1 220px; min-width: 0; max-width: 320px; min-height: 40px; }
.pepsi-filter select { flex: 0 0 auto; width: auto; min-width: 0; max-width: 230px; min-height: 40px; }
.pepsi-filter .pepsi-pve { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: 0; padding-left: 2.6em; white-space: nowrap; }
.pepsi-filter .pepsi-pve .form-check-input { margin-top: 0; cursor: pointer; }
.pepsi-filter .pepsi-pve .form-check-label { cursor: pointer; font-size: 14px; }
.pepsi-filter .pepsi-zaehler { font-size: 13px; color: var(--bs-secondary-color, #6b7280); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pepsi-filter .pepsi-reset { min-height: 40px; }
/* Aktive Auswahl sichtbar machen (wie ein gesetzter Filter). */
.pepsi-filter select:not([data-pf="min"]):has(option:checked:not([value=""])), .pepsi-filter select[data-pf="min"]:has(option:checked:not([value="0"])) { border-color: var(--crm-accent, #175676); box-shadow: inset 0 0 0 1px var(--crm-accent, #175676); }
.pepsi-leer { margin: 8px 0 24px; color: var(--bs-secondary-color, #6b7280); }
/* F5-14: Felder gleich hoch (twenty-ui setzt .form-select sonst auf 38 px, am Handy 44 px). */
html.twenty-ui .pepsi-filter input[type="search"].form-control, html.twenty-ui .pepsi-filter select.form-select { height: 40px; min-height: 40px; }
@media (max-width: 767.98px) {
  .pepsi-filter input[type="search"] { flex: 1 1 100%; max-width: none; }
  .pepsi-filter select { flex: 1 1 calc(50% - 5px); max-width: none; }
  .pepsi-filter select[data-pf="land"], .pepsi-filter select[data-pf="fach"] { flex-basis: 100%; }
  /* Reihenfolge am Handy: volle Breite zuerst, dann Paare (Stand + Gefunden, Eignung + PVE) */
  .pepsi-filter .pepsi-ansicht { order: 0; } .pepsi-filter input[type="search"] { order: 1; }
  .pepsi-filter select[data-pf="land"] { order: 2; } .pepsi-filter select[data-pf="fach"] { order: 3; }
  .pepsi-filter select[data-pf="stand"] { order: 4; } .pepsi-filter select[data-pf="zeit"] { order: 5; }
  .pepsi-filter select[data-pf="min"] { order: 6; } .pepsi-filter .pepsi-pve { order: 7; }
  .pepsi-filter .pepsi-zaehler { order: 8; } .pepsi-filter .pepsi-reset { order: 9; }
  .pepsi-filter .pepsi-pve { flex: 1 1 auto; }
  html.twenty-ui .pepsi-filter input[type="search"].form-control, html.twenty-ui .pepsi-filter select.form-select { height: 44px; min-height: 44px; font-size: 16px; }
}

/* Ansicht „Karten | Liste“ (wie „Board | Liste“ in der Pipeline) */
.pepsi-ansicht { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--crm-line, #e5e7eb); border-radius: 10px; flex: none; }
.pepsi-ansicht button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pepsi-ansicht button[aria-pressed="true"] { background: var(--crm-accent, #175676); color: #fff; }
.pepsi-ansicht button:focus-visible { outline: 2px solid var(--crm-accent, #175676); outline-offset: 1px; }
[data-bs-theme="dark"] .pepsi-ansicht button[aria-pressed="true"] { background: #2a7aa3; }

/* Liste: flache Tabelle, ganze Zeile öffnet die Akte */
.pepsi-liste { margin: 0 0 24px; border: 1px solid var(--crm-line, #e5e7eb); border-radius: var(--crm-radius, 10px); overflow-x: auto; background: var(--crm-surface, var(--bs-body-bg, #fff)); }
.pepsi-tabelle { width: 100%; margin: 0; border-collapse: collapse; font-size: 13.5px; }
.pepsi-tabelle th { position: sticky; top: 0; z-index: 1; padding: 0; background: var(--crm-surface, var(--bs-body-bg, #fff)); border-bottom: 1px solid var(--crm-line, #e5e7eb); text-align: left; white-space: nowrap; }
.pepsi-tabelle th button { width: 100%; min-height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--crm-quiet, #6b7280); font-size: 12px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; text-align: left; cursor: pointer; }
.pepsi-tabelle th[aria-sort="ascending"] button, .pepsi-tabelle th[aria-sort="descending"] button { color: var(--crm-accent, #175676); }
.pepsi-tabelle th button:focus-visible { outline: 2px solid var(--crm-accent, #175676); outline-offset: -2px; }
.pepsi-liste .pepsi-tabelle td { padding: 10px 12px; border-bottom: 1px solid var(--crm-line, #e5e7eb); vertical-align: middle; }
.pepsi-tabelle tbody tr { cursor: pointer; transition: background-color .12s ease; }
.pepsi-tabelle tbody tr:last-child td { border-bottom: 0; }
.pepsi-tabelle tbody tr:hover, .pepsi-tabelle tbody tr:focus-visible { background: color-mix(in srgb, var(--crm-accent, #175676) 6%, transparent); outline: none; }
.pepsi-tabelle tbody tr:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--crm-accent, #175676); }
.pepsi-tabelle .pl-name { font-weight: 600; min-width: 220px; }
.pepsi-tabelle .pl-name-text { overflow-wrap: anywhere; }
.pepsi-tabelle .pl-fachText { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--crm-quiet, #6b7280); }
.pepsi-tabelle .pl-ort, .pepsi-tabelle .pl-land { white-space: nowrap; }
.pepsi-tabelle .pl-tag, .pepsi-tabelle .pl-eignung { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pepsi-tabelle .pl-punkte { color: var(--crm-accent, #175676); letter-spacing: 1px; font-size: 11px; }
[data-bs-theme="dark"] .pepsi-tabelle .pl-punkte, [data-bs-theme="dark"] .pepsi-tabelle th[aria-sort="ascending"] button, [data-bs-theme="dark"] .pepsi-tabelle th[aria-sort="descending"] button { color: #8fc6e3; }
.pepsi-tabelle .pl-pve { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px; background: color-mix(in srgb, var(--crm-accent, #175676) 12%, transparent); color: var(--crm-accent, #175676); font-size: 11px; font-weight: 700; vertical-align: 1px; }
[data-bs-theme="dark"] .pepsi-tabelle .pl-pve { color: #8fc6e3; background: rgba(143,198,227,.12); }
.pepsi-tabelle .pl-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border: 1px solid var(--crm-line, #e5e7eb); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.pepsi-tabelle .pl-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6b7280; }
.pepsi-tabelle .pl-chip[data-art="pruefen"]::before { background: #d4a72c; }
.pepsi-tabelle .pl-chip[data-art="gut"]::before { background: #2da44e; }
.pepsi-tabelle .pl-chip[data-art="nein"]::before { background: #cf222e; }
.pepsi-tabelle .pl-chip[data-art="uebernommen"]::before { background: var(--crm-accent, #175676); }
.pepsi-tabelle .pl-akte { width: 1%; text-align: right; }
.pepsi-tabelle .pl-link { color: var(--crm-accent, #175676); font-weight: 600; white-space: nowrap; }
[data-bs-theme="dark"] .pepsi-tabelle .pl-link { color: #8fc6e3; }
/* Mittlere Breite: Bundesland und Fachrichtung zuerst weglassen (stehen in der Akte) */
@media (max-width: 1199.98px) { .pepsi-tabelle .pl-fachText { display: none; } }
/* Handy: Zeilen als kompakte Einträge (Name, darunter Ort · Bundesland, rechts Eignung) */
@media (max-width: 767.98px) {
  .pepsi-ansicht { flex: 1 1 100%; }
  .pepsi-ansicht button { flex: 1 1 0; min-height: 38px; }
  .pepsi-liste { overflow: visible; }
  .pepsi-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pepsi-tabelle, .pepsi-tabelle tbody { display: block; }
  .pepsi-tabelle tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--crm-line, #e5e7eb); align-items: baseline; }
  .pepsi-tabelle tbody tr:last-child { border-bottom: 0; }
  .pepsi-liste .pepsi-tabelle td { display: block; padding: 0; border: 0; }
  .pepsi-tabelle .pl-name { grid-column: 1; min-width: 0; font-size: 15px; }
  .pepsi-tabelle .pl-eignung { grid-column: 2; grid-row: 1; text-align: right; font-size: 12.5px; }
  .pepsi-tabelle .pl-ort { grid-column: 1; color: var(--crm-quiet, #6b7280); white-space: normal; }
  .pepsi-tabelle .pl-land { grid-column: 1; color: var(--crm-quiet, #6b7280); font-size: 12.5px; }
  .pepsi-tabelle .pl-stand { grid-column: 2; grid-row: 2; text-align: right; }
  .pepsi-tabelle .pl-tag { grid-column: 2; grid-row: 3; text-align: right; color: var(--crm-quiet, #6b7280); font-size: 12px; }
  .pepsi-liste .pepsi-tabelle td.pl-akte { display: none; }
  .pepsi-liste .pepsi-tabelle td.pl-fachText { grid-column: 1; max-width: none; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { .pepsi-tabelle tbody tr { transition: none; } }
