/* RUESS Hub 3.7.24 - TIKOS Listen › Preisliste (Kunde) (public/tikos-preisliste.js). Bausteine wie Trägerliste (box ap-box, ap-toolbar, ap-table);
   hier nur Felder, Abteilungs-Chips, Blockköpfe und Hinweise. Nur Tokens aus ruess-design-system.css.
   3.7.28 (Marvin 03.12.): Kopf neu (Modus-Reiter, Auswahl, zuklappbare Abteilungen/Kunden, Ergebnis-Kopf mit Zahlen-Chips + Export rechts,
   Spalten als Aufklapp-Menü mit Vorlagen), Spaltenfilter + Sortieren im Tabellenkopf, Rahmenvertrag (Kundenliste, Abweichungen markiert). */
.tp-liste .tp-modus { margin: 0 0 var(--ds-space-3); }
.tp-liste .tp-suche { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ds-space-2) var(--ds-space-4); min-width: 0; }
html[data-seiten="2026"] #appBox #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld, #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld { display: flex; flex-direction: column; gap: var(--ds-space-1); flex: 0 1 260px !important; width: 260px; max-width: 100%; min-width: 0; font-size: var(--ds-font-xs); color: var(--ds-muted); position: relative; }
html[data-seiten="2026"] #appBox #tikosPreiseView .ap-toolbar .ap-filter label.tp-vertrag, #tikosPreiseView .ap-toolbar .ap-filter label.tp-vertrag { flex: 0 1 420px !important; width: 420px; }
html[data-seiten="2026"] #appBox #tikosPreiseView .ap-toolbar .ap-filter label.tp-tag, #tikosPreiseView .ap-toolbar .ap-filter label.tp-tag { flex: 0 1 170px !important; width: 170px; }
html[data-seiten="2026"] #appBox #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld input, #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld input,
html[data-seiten="2026"] #appBox #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld select, #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld select { width: 100% !important; min-width: 0 !important; flex: 0 0 auto !important; }
#tikosPreiseView .tp-feld .ruess-lookup-hint { position: absolute; top: 100%; left: 0; right: 0; margin-top: 2px; color: var(--ds-text); font-size: var(--ds-font-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-liste .tp-haken { display: inline-flex; align-items: center; gap: var(--ds-space-2); flex-direction: row !important; font-size: var(--ds-font-sm); color: var(--ds-text); min-height: var(--ds-h-bar); }
.tp-liste .tp-haken input { width: auto; height: auto; flex: 0 0 auto; }
.tp-liste .tp-feld-klein { display: inline-flex; align-items: center; gap: var(--ds-space-2); font-size: var(--ds-font-xs); color: var(--ds-muted); }
html[data-seiten] #appBox #tikosPreiseView .tp-liste .tp-feld-klein input, html[data-seiten] #appBox #tikosPreiseView .tp-liste .tp-feld-klein select { width: 220px; max-width: 100%; height: 36px !important; min-height: 36px !important; }

/* Zuklappbare Bereiche: Abteilungen, Kunden des Rahmenvertrags, Preisgruppen */
.tp-liste .tp-klapp { margin: var(--ds-space-3) 0 0; border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); background: var(--ds-surface); }
.tp-liste .tp-klapp > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); cursor: pointer; padding: var(--ds-space-2) var(--ds-space-4); font-size: var(--ds-font-sm); color: var(--ds-ink); font-weight: 600; min-height: var(--ds-h-bar); }
.tp-liste .tp-klapp > summary .ap-hint { margin: 0; font-weight: 400; }
.tp-liste .tp-klapp > summary:focus-visible, .tp-liste .tp-spalten > summary:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 1px; border-radius: var(--ds-radius-md); }
.tp-liste .tp-abteilungen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); padding: 0 var(--ds-space-4) var(--ds-space-3); }
.tp-liste .tp-chip { display: inline-flex; align-items: center; gap: var(--ds-space-1); padding: 4px var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-pill); background: var(--ds-surface); font-size: var(--ds-font-sm); color: var(--ds-ink); cursor: pointer; }
.tp-liste .tp-chip.klein { padding: 2px var(--ds-space-2); font-size: var(--ds-font-xs); }
.tp-liste .tp-chip input { width: auto; height: auto; margin: 0; }
html #appBox #tikosPreiseView .tp-liste .tp-chip .ap-hint, .tp-liste .tp-chip .ap-hint { display: inline; margin: 0; padding: 0; line-height: inherit; font-size: var(--ds-font-xs); }
.tp-liste .tp-chip:has(input:checked) { border-color: var(--ds-brand); background: var(--ds-brand-soft); }
.tp-liste .tp-chip:focus-within { outline: 2px solid var(--ds-focus); outline-offset: 1px; }
.tp-liste .tp-kunden-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-2); padding: 0 var(--ds-space-4) var(--ds-space-2); }
.tp-liste .tp-kunden { list-style: none; margin: 0; padding: 0 var(--ds-space-4) var(--ds-space-3); max-height: 340px; overflow: auto; }
.tp-liste .tp-kunde-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-1) var(--ds-space-3); padding: var(--ds-space-1) 0; border-bottom: 1px solid var(--ds-line); font-size: var(--ds-font-sm); color: var(--ds-ink); }
.tp-liste .tp-kunde-zeile:last-child { border-bottom: 0; }
.tp-liste .tp-kunde-zeile .ap-hint { margin: 0; }
.tp-liste .tp-kunde-zeile.tp-gesperrt .tp-kunde-name { color: var(--ds-muted); }
.tp-liste .tp-kunde-name { display: inline-flex; align-items: center; gap: var(--ds-space-2); min-width: 0; cursor: pointer; }
.tp-liste .tp-kunde-name input { width: auto; height: auto; margin: 0; flex: 0 0 auto; }
.tp-liste .tp-kunde-abt { display: inline-flex; flex-wrap: wrap; gap: var(--ds-space-1); }
.tp-liste .tp-gruppen { list-style: none; margin: 0; padding: 0 var(--ds-space-4) var(--ds-space-3); display: flex; flex-direction: column; gap: var(--ds-space-2); font-size: var(--ds-font-sm); color: var(--ds-ink); }
.tp-liste .tp-gruppen .ap-hint { margin: 0; display: inline; }
.tp-liste .tp-gruppe-kunden { display: flex; flex-wrap: wrap; gap: 2px var(--ds-space-3); margin-top: 2px; font-size: var(--ds-font-xs); color: var(--ds-text); }

.tp-liste .tp-demo { padding: var(--ds-space-2) var(--ds-space-3); border: 1px dashed var(--ds-line-strong); border-radius: var(--ds-radius-md); background: var(--ds-warning-soft); color: var(--ds-ink); }
.tp-liste .tp-fehler { color: var(--ds-danger); }
.tp-liste .tp-recht { display: flex; flex-direction: column; gap: 2px; margin: var(--ds-space-3) 0; padding: var(--ds-space-3) var(--ds-space-4); border: 1px solid var(--ds-line); border-left: 4px solid var(--ds-warning); border-radius: var(--ds-radius-lg); background: var(--ds-warning-soft); color: var(--ds-ink); font-size: var(--ds-font-sm); }

/* Ergebnis-Kopf: Titel + Zahlen-Chips links, Export rechts (statt grosser Kacheln) */
.tp-liste .tp-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--ds-space-2) var(--ds-space-4); margin-top: var(--ds-space-4); padding-top: var(--ds-space-3); border-top: 1px solid var(--ds-line); }
.tp-liste .tp-kopf-titel { display: flex; flex-direction: column; gap: var(--ds-space-2); min-width: 0; flex: 1 1 320px; }
.tp-liste .tp-kopf h3 { margin: 0; font-size: var(--ds-font-xl); color: var(--ds-ink); overflow-wrap: anywhere; }
.tp-liste .tp-zahlen { display: flex; flex-wrap: wrap; gap: var(--ds-space-1) var(--ds-space-2); }
.tp-liste .tp-zahlen b { font-variant-numeric: tabular-nums; }
html #appBox #tikosPreiseView .tp-liste .ap-chip.tp-chip-warn, .tp-liste .ap-chip.tp-chip-warn { background: var(--ds-warning-soft); color: var(--ds-ink); }
.tp-liste .tp-export { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-space-2); }
.tp-liste .tp-unterleiste { margin-top: var(--ds-space-3); }
.tp-liste .tp-unterleiste .ap-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--ds-space-2); }
.tp-liste .tp-ansicht { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-2); margin-top: var(--ds-space-3); }

/* Spalten: Aufklapp-Menue rechts in der Filterleiste */
.tp-liste .tp-spalten { position: relative; }
.tp-liste .tp-spalten > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--ds-space-1); }
.tp-liste .tp-spalten > summary::-webkit-details-marker { display: none; }
.tp-liste .tp-spalten > summary .ap-hint { margin: 0; }
.tp-liste .tp-spalten-pop { position: absolute; right: 0; top: calc(100% + var(--ds-space-1)); z-index: 2; /* knapp ueber dem klebenden Tabellenkopf (z-index 1), kein Dialog */ width: min(560px, calc(100vw - 2 * var(--ds-space-4))); padding: var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); background: var(--ds-surface); }
.tp-liste .tp-vorlagen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); padding-bottom: var(--ds-space-2); margin-bottom: var(--ds-space-2); border-bottom: 1px solid var(--ds-line); }
.tp-liste .tp-vorlagen .ap-hint { margin: 0; }
.tp-liste .tp-spalten-liste { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); }

/* Bloecke + Tabelle */
.tp-liste .tp-block { margin-top: var(--ds-space-5); }
.tp-liste .tp-block-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); margin: 0 0 var(--ds-space-2); font-size: var(--ds-font-md); color: var(--ds-ink); }
.tp-liste .tp-block-kopf .tp-anzahl { margin: 0; }
.tp-liste #tpBloecke > .ap-table-wrap { margin-top: var(--ds-space-3); }
html #appBox #tikosPreiseView .tp-tabelle thead tr:first-child th { height: 36px; }
html #appBox #tikosPreiseView .tp-tabelle thead tr.tp-filterzeile th { top: 36px; padding: 0 4px 6px; height: 34px; }
html #appBox #tikosPreiseView .tp-tabelle th > button.tp-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; border-radius: var(--ds-radius-sm); }
html #appBox #tikosPreiseView .tp-tabelle th > button.tp-sort:hover, html #appBox #tikosPreiseView .tp-tabelle th > button.tp-sort.aktiv { color: var(--ds-ink); }
html #appBox #tikosPreiseView .tp-tabelle th > button.tp-sort:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
html[data-seiten] #appBox #tikosPreiseView .tp-tabelle th.tp-sf input { width: 100%; min-width: 56px; height: 28px !important; min-height: 28px !important; padding: 0 6px; font-size: var(--ds-font-xs); text-transform: none; letter-spacing: 0; font-weight: 400; border-radius: var(--ds-radius-sm); }
.tp-liste tr.tp-ohne td { background: color-mix(in srgb, var(--ds-warning-soft) 55%, transparent); }
.tp-liste td.tp-abw { background: var(--ds-warning-soft); }
.tp-liste td.tp-fehlt { color: var(--ds-muted); }
.tp-liste .tp-abw-mark { display: inline-block; margin-left: 2px; color: var(--ds-ink); font-weight: 700; cursor: help; }
.tp-liste .tp-alle { color: var(--ds-muted); }
html #appBox #tikosPreiseView .tp-liste .ap-badge.tp-eigen, .tp-liste .ap-badge.tp-eigen { background: var(--ds-success-soft); color: var(--ds-ink); }
html #appBox #tikosPreiseView .tp-liste .ap-badge.tp-fremd, .tp-liste .ap-badge.tp-fremd { background: var(--ds-surface-2); color: var(--ds-ink); }
html #appBox #tikosPreiseView .tp-liste .ap-badge.tp-warn, .tp-liste .ap-badge.tp-warn { background: var(--ds-warning-soft); color: var(--ds-ink); }
@media (max-width: 640px) {
  html[data-seiten="2026"] #appBox #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld, #tikosPreiseView .ap-toolbar .ap-filter label.tp-feld { flex: 1 1 100% !important; width: 100%; grid-column: 1 / -1; }
  .tp-liste .tp-export, .tp-liste .tp-unterleiste .ap-tools { justify-content: flex-end; width: 100%; }
  .tp-liste .tp-spalten-pop { right: auto; left: 0; }
  .tp-liste .tp-kunden { max-height: 50vh; }
  .tp-liste .tp-feld-klein { flex: 1 1 100%; flex-wrap: wrap; min-width: 0; }
  html[data-seiten] #appBox #tikosPreiseView .tp-liste .tp-feld-klein :is(input, select) { width: 100%; flex: 1 1 auto; min-width: 0; }
  html[data-seiten] #appBox #tikosPreiseView .tp-unterleiste .ap-filter label { min-width: 0; }
  html[data-seiten="2026"] #appBox #tikosPreiseView .tp-liste .ap-toolbar.tp-unterleiste form.ap-filter label :is(input, select) { min-width: 0 !important; max-width: 100%; }
}
/* 3.7.28: Hinweistexte in Zeilen/Köpfen ohne den Block-Abstand von .ap-hint */
html #appBox #tikosPreiseView .tp-liste :is(.tp-kunde-zeile, .tp-gruppen, .tp-klapp > summary, .tp-vorlagen, .tp-block-kopf, .tp-spalten > summary, .tp-kunden-kopf) .ap-hint { display: inline; margin: 0; line-height: inherit; }
.tp-liste .tp-nv { color: var(--ds-muted); font-size: var(--ds-font-xs); }
