/* ============================================================================
   components.css – Telepski Design-System Standard-Klassen (DOC-160 v3.1)
   ============================================================================
   Verbindlicher Cross-Cut-Standard (DEC-133). Baut auf design-tokens.css auf.
   Master-Pfad:   systeme/design-system/komponenten/components.css
   Deploy-Mirror: systeme/telepski-tools/public/_shared/components/components.css

   Verwendung:
     <link rel="stylesheet" href="/_shared/components/design-tokens.css">
     <link rel="stylesheet" href="/_shared/components/components.css">

   Stil-Referenz Sidebar/Listen: AkquiseOS (Henrik-Direktive 18.07.2026).
   Dark-Mode via body.dark-mode (Token-Konvention).
   ============================================================================ */

/* ------------------------------------------------------------------ Base -- */
.tp-app * { box-sizing: border-box; }
.tp-app {
  font-family: var(--tp-font-sans);
  background: var(--tp-bg-app);
  color: var(--tp-text-primary);
  font-size: 14px;
  line-height: var(--tp-leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------- App-Shell-Layout -- */
/* Linke, fixierte Sidebar (angeklebt, volle Hoehe) + Content rechts.
   GLOBAL HART feedback_tool_app_shell_standard (17.07.2026). */
.tp-shell { display: flex; }
/* --tp-shell-offset = Hoehe fixer Kopfzeilen ueber der App (z.B. Guard-Portal-Bar
   44px via body.telepski-headed). Wird von app-shell.js dynamisch gemessen –
   Sidebar fuellt exakt den Rest-Viewport, Footer nie abgeschnitten, kein
   Seiten-Scrollbalken (Fix 18.07.). */
.tp-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--tp-bg-surface);
  border-right: 1px solid var(--tp-border-default);
  padding: 18px 12px 12px;
  position: sticky; top: var(--tp-shell-offset, 0px);
  height: calc(100vh - var(--tp-shell-offset, 0px));
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.tp-shell { min-height: calc(100vh - var(--tp-shell-offset, 0px)); }
.tp-main {
  flex: 1;
  padding: 28px 36px 60px;
  max-width: calc(100vw - 260px);
  overflow-x: hidden;
}
@media (max-width: 767px) {
  .tp-shell { flex-direction: column; }
  .tp-sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform var(--tp-duration-slow) var(--tp-ease-out); box-shadow: var(--tp-shadow-lg); }
  .tp-sidebar.open { transform: translateX(0); }
  .tp-main { max-width: 100vw; padding: 20px 16px 48px; }
}

/* Brand-Block oben: Logo/Mark + Tool-Name + Sub-Zeile */
.tp-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; border-bottom: 1px solid var(--tp-border-default); margin-bottom: 12px; }
.tp-brand-mark { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--tp-accent), var(--tp-accent-hover)); color: var(--tp-text-on-accent); font-weight: var(--tp-weight-bold); font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tp-brand-mark img, .tp-brand-mark svg { width: 20px; height: 20px; }
.tp-brand-text h1 { font-size: 14px; font-weight: var(--tp-weight-semibold); line-height: 1.1; margin: 0; }
.tp-brand-text .tp-brand-sub { font-size: 11px; color: var(--tp-text-tertiary); margin-top: 2px; }
.tp-brand-actions { margin-left: auto; display: flex; gap: 2px; }

/* Nav-Gruppen mit Labels (INBOX / AKTUELL / ADMIN / STAMMDATEN / GEPLANT) */
.tp-nav-group { padding: 8px 0; }
.tp-nav-label { font-size: 10px; font-weight: var(--tp-weight-semibold); text-transform: uppercase; letter-spacing: 0.08em; color: var(--tp-text-tertiary); padding: 6px 12px 4px; }
.tp-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--tp-radius-sm);
  color: var(--tp-text-secondary);
  font-size: 13.5px;
  cursor: pointer; user-select: none;
  transition: all var(--tp-duration-normal) var(--tp-ease-out);
  text-decoration: none;
  background: transparent; border: none; width: 100%;
  font-family: inherit; text-align: left;
}
.tp-nav-item svg, .tp-nav-item > i { width: 16px; height: 16px; flex-shrink: 0; }
/* Bold-Breiten-Reserve (Fix 18.07.): unsichtbare Fett-Kopie des Labels reserviert
   die Breite des Aktiv-Zustands – Item-Höhe kann beim Aktivieren nie springen. */
.tp-nav-text { display: inline-flex; flex-direction: column; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-nav-text::after { content: attr(data-label); font-weight: var(--tp-weight-semibold); height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.tp-nav-item:hover { background: var(--tp-bg-hover); color: var(--tp-text-primary); }
.tp-nav-item.active { background: var(--tp-bg-selected); color: var(--tp-accent); font-weight: var(--tp-weight-semibold); }
.tp-nav-item.disabled { opacity: 0.45; cursor: not-allowed; }
.tp-nav-item.disabled:hover { background: transparent; color: var(--tp-text-secondary); }
/* Zaehler-/Status-Bubble rechts (Referenz AkquiseOS «Leads 3891») */
.tp-nav-badge { margin-left: auto; font-size: 10px; padding: 2px 6px; background: var(--tp-bg-hover); border-radius: var(--tp-radius-pill); color: var(--tp-text-tertiary); font-weight: var(--tp-weight-semibold); font-variant-numeric: tabular-nums; }
.tp-nav-item.active .tp-nav-badge { background: var(--tp-accent); color: var(--tp-text-on-accent); }

/* Reorder-Modus (Menue-Reihenfolge global anpassen, Teil-4-Standard 18.07.) */
.tp-nav-item .tp-nav-grip { display: none; margin-left: auto; color: var(--tp-text-tertiary); cursor: grab; }
.tp-sidebar.reordering .tp-nav-item { border: 1px dashed var(--tp-border-strong); margin-bottom: 2px; }
.tp-sidebar.reordering .tp-nav-item .tp-nav-badge { display: none; }
.tp-sidebar.reordering .tp-nav-item .tp-nav-grip { display: inline-flex; }
.tp-sidebar.reordering .tp-nav-item.drag-over { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.tp-reorder-bar { display: none; padding: 8px 12px; margin: 0 0 8px; border: 1px solid var(--tp-accent); background: var(--tp-accent-soft); border-radius: var(--tp-radius-sm); font-size: 11px; color: var(--tp-accent); align-items: center; gap: 8px; }
.tp-sidebar.reordering .tp-reorder-bar { display: flex; }

/* Footer: User + Theme-Toggle + Abmelden */
.tp-sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--tp-border-default); display: flex; align-items: center; justify-content: space-between; padding-left: 8px; padding-right: 4px; gap: 6px; }
.tp-user { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tp-text-secondary); min-width: 0; }
.tp-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-user-avatar { width: 26px; height: 26px; border-radius: var(--tp-radius-full); background: var(--tp-accent-soft); color: var(--tp-accent); display: flex; align-items: center; justify-content: center; font-weight: var(--tp-weight-bold); font-size: 11px; flex-shrink: 0; }
.tp-icon-btn { width: 30px; height: 30px; border-radius: var(--tp-radius-sm); background: transparent; border: none; color: var(--tp-text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all var(--tp-duration-normal) var(--tp-ease-out); flex-shrink: 0; }
.tp-icon-btn:hover { background: var(--tp-bg-hover); color: var(--tp-accent); }
.tp-icon-btn svg { width: 15px; height: 15px; }
.tp-icon-btn.active { background: var(--tp-accent-soft); color: var(--tp-accent); }

/* ------------------------------------------------ Tabs (Sub-Interfaces) --- */
/* DOC-160 §17.4 (Henrik 19.07., MarketingOS-SOT): mehrere Record-Sammlungen
   derselben Domäne = EIN Menüpunkt + Tabs in der View statt Sidebar-Flut. */
.tp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--tp-border-default); margin-bottom: 20px; overflow-x: auto; }
.tp-tab { padding: 9px 14px; font-size: 13.5px; color: var(--tp-text-secondary); background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: inherit; white-space: nowrap; transition: all var(--tp-duration-normal) var(--tp-ease-out); }
.tp-tab:hover { color: var(--tp-text-primary); background: var(--tp-bg-hover); border-radius: var(--tp-radius-sm) var(--tp-radius-sm) 0 0; }
.tp-tab.active { color: var(--tp-accent); font-weight: var(--tp-weight-semibold); border-bottom-color: var(--tp-accent); }
.tp-tab-text { display: inline-flex; flex-direction: column; }
.tp-tab-text::after { content: attr(data-label); font-weight: var(--tp-weight-semibold); height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.tp-tab-badge { font-size: 10px; padding: 1px 6px; background: var(--tp-bg-hover); border-radius: var(--tp-radius-pill); color: var(--tp-text-tertiary); font-weight: var(--tp-weight-semibold); font-variant-numeric: tabular-nums; }
.tp-tab.active .tp-tab-badge { background: var(--tp-accent); color: var(--tp-text-on-accent); }

/* Tasten-Darstellung fuer Bedienungs-Anleitungen */
.tp-kbd { display: inline-block; padding: 1px 7px; font-family: var(--tp-font-mono, monospace); font-size: 11.5px; background: var(--tp-bg-hover); border: 1px solid var(--tp-border-default); border-bottom-width: 2px; border-radius: 5px; color: var(--tp-text-primary); white-space: nowrap; }

/* --------------------------------------------------------------- Topbar --- */
.tp-topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 20px; flex-wrap: wrap; }
.tp-topbar h2 { font-size: 22px; font-weight: var(--tp-weight-bold); letter-spacing: var(--tp-tracking-tight); margin: 0; }
.tp-topbar .tp-subtitle { font-size: 13px; color: var(--tp-text-secondary); margin-top: 4px; }
.tp-topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* --------------------------------------------------------------- Buttons -- */
.tp-btn { padding: 8px 14px; border-radius: var(--tp-radius-sm); border: 1px solid var(--tp-border-default); background: var(--tp-bg-surface); color: var(--tp-text-primary); cursor: pointer; font-size: 13px; font-weight: var(--tp-weight-medium); display: inline-flex; align-items: center; gap: 6px; transition: all var(--tp-duration-normal) var(--tp-ease-out); text-decoration: none; font-family: inherit; }
.tp-btn:hover { border-color: var(--tp-accent); color: var(--tp-accent); }
.tp-btn.primary { background: var(--tp-accent); border-color: var(--tp-accent); color: var(--tp-text-on-accent); }
.tp-btn.primary:hover { background: var(--tp-accent-hover); border-color: var(--tp-accent-hover); color: var(--tp-text-on-accent); }
.tp-btn.ghost { background: transparent; border-color: transparent; color: var(--tp-text-secondary); }
.tp-btn.danger:hover { border-color: var(--tp-error); color: var(--tp-error); }
.tp-btn.sm { padding: 5px 10px; font-size: 12px; }
.tp-btn svg { width: 14px; height: 14px; }
.tp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----------------------------------------------------------------- Cards -- */
.tp-card { background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); padding: 20px; box-shadow: var(--tp-shadow-xs); margin-bottom: 16px; }
/* Padding-Konsistenz (Fix 18.07.): letztes Kind ohne Aussen-Margin – sonst
   addiert sich dessen margin-bottom zum Card-Padding (z.B. 20+16px unten). */
.tp-card > :last-child { margin-bottom: 0; }
.tp-card-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.tp-card-title { font-size: 15px; font-weight: var(--tp-weight-semibold); }
.tp-card-subtitle { font-size: 12px; color: var(--tp-text-secondary); margin-top: 3px; }

/* Stat-Kacheln (Referenz EM Benutzerverwaltung / Login-Aktivitaet) */
.tp-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tp-stat-tile { background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); padding: 14px 16px; box-shadow: var(--tp-shadow-xs); position: relative; overflow: hidden; }
.tp-stat-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tile-color, var(--tp-accent)); }
.tp-stat-tile.ok { --tile-color: var(--tp-success); }
.tp-stat-tile.warn { --tile-color: var(--tp-warning); }
.tp-stat-tile.err { --tile-color: var(--tp-error); }
.tp-stat-label { font-size: 11px; color: var(--tp-text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--tp-weight-semibold); margin-bottom: 6px; }
.tp-stat-value { font-size: 24px; font-weight: var(--tp-weight-bold); letter-spacing: var(--tp-tracking-tight); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tp-stat-meta { margin-top: 4px; font-size: 12px; color: var(--tp-text-secondary); }

/* ----------------------------------------------------------- Formulare ---- */
.tp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tp-form-group { display: flex; flex-direction: column; gap: 5px; }
.tp-form-label { font-size: 11px; color: var(--tp-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: var(--tp-weight-semibold); }
.tp-form-hint { font-size: 11px; color: var(--tp-text-tertiary); }
.tp-input, .tp-select, .tp-textarea {
  padding: 9px 12px; border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-sm);
  background: var(--tp-bg-surface); color: var(--tp-text-primary);
  font-size: 14px; font-family: inherit; width: 100%;
  transition: border-color var(--tp-duration-normal) var(--tp-ease-out);
}
.tp-input:focus, .tp-select:focus, .tp-textarea:focus { outline: none; border-color: var(--tp-accent); box-shadow: 0 0 0 2px var(--tp-accent-soft); }
.tp-select { font-weight: var(--tp-weight-medium); cursor: pointer; }
/* Auto-Resize-Textareas (§F.3): Hoehe folgt Inhalt, nie internes Scrollen */
.tp-textarea { resize: none; overflow: hidden; min-height: 38px; line-height: 1.5; }

/* -------------------------------------------------------- Suchfeld (§F.6) - */
.tp-search { position: relative; display: flex; align-items: center; min-width: 220px; }
.tp-search svg.tp-search-icon { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--tp-text-tertiary); pointer-events: none; }
.tp-search input { padding: 8px 30px 8px 32px; border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-sm); background: var(--tp-bg-surface); color: var(--tp-text-primary); font-size: 13px; font-family: inherit; width: 100%; transition: border-color var(--tp-duration-normal) var(--tp-ease-out); }
.tp-search input:focus { outline: none; border-color: var(--tp-accent); box-shadow: 0 0 0 2px var(--tp-accent-soft); }
.tp-search .tp-search-clear { position: absolute; right: 6px; width: 20px; height: 20px; border: none; background: transparent; color: var(--tp-text-tertiary); cursor: pointer; display: none; align-items: center; justify-content: center; border-radius: var(--tp-radius-full); }
.tp-search .tp-search-clear:hover { background: var(--tp-bg-hover); color: var(--tp-text-primary); }
.tp-search.has-value .tp-search-clear { display: inline-flex; }

/* ----------------------------------------------- Filter-Pills mit Zaehler - */
.tp-pill-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 10px; }
.tp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-pill); font-size: 12px; cursor: pointer; transition: all var(--tp-duration-normal) var(--tp-ease-out); user-select: none; font-family: inherit; }
.tp-pill:hover { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.tp-pill.active { background: var(--tp-accent-soft); border-color: var(--tp-accent); box-shadow: inset 0 0 0 1px var(--tp-accent); }
.tp-pill .tp-pill-label { color: var(--tp-text-secondary); font-weight: var(--tp-weight-semibold); }
.tp-pill.active .tp-pill-label, .tp-pill.active .tp-pill-count { color: var(--tp-accent); }
.tp-pill .tp-pill-count { color: var(--tp-text-primary); font-weight: var(--tp-weight-bold); font-variant-numeric: tabular-nums; }
.tp-pill.zero { opacity: 0.45; }
.tp-pill-reset { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: transparent; border: 1px dashed var(--tp-border-strong); color: var(--tp-text-secondary); border-radius: var(--tp-radius-pill); font-size: 12px; cursor: pointer; transition: all var(--tp-duration-normal) var(--tp-ease-out); font-family: inherit; }
.tp-pill-reset:hover { border-color: var(--tp-error); color: var(--tp-error); border-style: solid; }

/* -------------------------------------------- Select-Badges (§B.3 / §F.4) - */
/* Single-Select: einzelnes farbcodiertes Badge. Multi-Select: Badge-Gruppe
   mit aktiv/inaktiv-Zustaenden (Referenz MarketingOS «Angles»). */
.tp-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--tp-radius-sm); font-size: 10.5px; font-weight: var(--tp-weight-bold); text-transform: uppercase; letter-spacing: 0.04em; background: var(--badge-bg, var(--tp-accent-soft)); color: var(--badge-fg, var(--tp-accent)); white-space: nowrap; }
.tp-badge.gray   { --badge-bg: var(--tp-bg-hover);      --badge-fg: var(--tp-text-secondary); }
.tp-badge.gold   { --badge-bg: var(--tp-accent-soft);   --badge-fg: var(--tp-accent); }
.tp-badge.green  { --badge-bg: var(--tp-success-soft);  --badge-fg: var(--tp-success); }
.tp-badge.red    { --badge-bg: var(--tp-error-soft);    --badge-fg: var(--tp-error); }
.tp-badge.blue   { --badge-bg: var(--tp-info-soft);     --badge-fg: var(--tp-info); }
.tp-badge-group { display: inline-flex; gap: 3px; white-space: nowrap; }
.tp-badge-group .tp-badge.off { opacity: 0.35; filter: grayscale(0.6); }

/* ------------------------------------------------------------- Tabellen --- */
.tp-table-wrap { overflow-x: auto; border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); background: var(--tp-bg-surface); }
.tp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tp-table th { text-align: left; padding: 11px 12px; font-weight: var(--tp-weight-semibold); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--tp-text-tertiary); border-bottom: 1px solid var(--tp-border-default); background: var(--tp-bg-surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tp-table th.num, .tp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tp-table td { padding: 10px 12px; border-bottom: 1px solid var(--tp-border-default); vertical-align: middle; }
.tp-table tbody tr:last-child td { border-bottom: none; }
/* Hover + Row-Click (§F.2): ganze Zeile klickbar, Hover als Signal */
.tp-table tbody tr.clickable { cursor: pointer; transition: background var(--tp-duration-fast) var(--tp-ease-out); }
.tp-table tbody tr.clickable:hover { background: var(--tp-bg-hover); }
.tp-table tbody tr.selected { background: var(--tp-bg-selected); }
/* Aktions-Spalte: Edit-Stift + roter Trash immer rechts (§B.1/§B.2) */
.tp-row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.tp-row-actions .tp-icon-btn.edit:hover { color: var(--tp-accent); }
.tp-row-actions .tp-icon-btn.delete { color: var(--tp-error); }
.tp-row-actions .tp-icon-btn.delete:hover { background: var(--tp-error-soft); color: var(--tp-error); }
/* Inline-Edit-Dropdown direkt in der Zeile (§B.5) */
.tp-table .tp-select.inline { padding: 4px 8px; font-size: 12px; width: auto; min-width: 120px; }

/* ------------------------------------------------------ Bulk-Actions-Bar -- */
/* Erscheint bei Checkbox-Auswahl (§B.6). Backend: Soft-Delete Pflicht,
   >50 Docs nur mit bulk_approval_token (feedback_data_safety, DEC-117). */
.tp-bulk-bar { position: sticky; top: 0; z-index: 5; background: var(--tp-accent-soft); border: 1px solid var(--tp-accent); border-radius: var(--tp-radius-lg); padding: 10px 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--tp-shadow-xs); flex-wrap: wrap; }
.tp-bulk-bar.hidden { display: none; }
.tp-bulk-count { font-size: 13px; font-weight: var(--tp-weight-semibold); color: var(--tp-accent); margin-right: auto; }
.tp-bulk-action { display: flex; align-items: center; gap: 6px; }
.tp-bulk-action label { font-size: 11px; color: var(--tp-text-secondary); font-weight: var(--tp-weight-semibold); text-transform: uppercase; letter-spacing: 0.04em; }

/* ------------------------------------------------- Date-Range-Picker (§A.6) */
.tp-drp { position: relative; display: inline-block; }
/* Panel default linksbündig; JS klemmt es in den Viewport (Flip auf rechtsbündig bei Überlauf, Fix 18.07.2026) */
.tp-drp-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); box-shadow: var(--tp-shadow-lg); padding: 14px; display: none; gap: 16px; min-width: 420px; }
.tp-drp.open .tp-drp-panel { display: flex; }
.tp-drp-presets { display: flex; flex-direction: column; gap: 2px; min-width: 150px; border-right: 1px solid var(--tp-border-default); padding-right: 14px; }
.tp-drp-preset { text-align: left; padding: 6px 10px; border: none; background: transparent; border-radius: var(--tp-radius-sm); font-size: 12.5px; color: var(--tp-text-secondary); cursor: pointer; font-family: inherit; transition: all var(--tp-duration-fast) var(--tp-ease-out); }
.tp-drp-preset:hover { background: var(--tp-bg-hover); color: var(--tp-text-primary); }
.tp-drp-preset.active { background: var(--tp-accent-soft); color: var(--tp-accent); font-weight: var(--tp-weight-semibold); }
.tp-drp-custom { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tp-drp-custom-label { font-size: 10px; font-weight: var(--tp-weight-bold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--tp-text-tertiary); }
.tp-drp-hint { font-size: 11px; color: var(--tp-text-tertiary); background: var(--tp-bg-surface-2); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-sm); padding: 8px 10px; line-height: 1.45; }
@media (max-width: 560px) { .tp-drp-panel { min-width: 90vw; flex-direction: column; } .tp-drp-presets { border-right: none; border-bottom: 1px solid var(--tp-border-default); padding-right: 0; padding-bottom: 10px; } }

/* -------------------------------------------------- Upload-Dropzone (§A.1) */
.tp-dropzone { border: 2px dashed var(--tp-border-strong); border-radius: var(--tp-radius-lg); padding: 28px 20px; text-align: center; color: var(--tp-text-secondary); cursor: pointer; transition: all var(--tp-duration-normal) var(--tp-ease-out); background: var(--tp-bg-surface); }
.tp-dropzone:hover, .tp-dropzone.dragover { border-color: var(--tp-accent); background: var(--tp-accent-soft); color: var(--tp-accent); }
.tp-dropzone .tp-dropzone-plus { width: 40px; height: 40px; border-radius: var(--tp-radius-full); background: var(--tp-accent-soft); color: var(--tp-accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; font-size: 22px; font-weight: 300; }
.tp-dropzone .tp-dropzone-hint { font-size: 12px; color: var(--tp-text-tertiary); margin-top: 4px; }

/* ------------------------------------------------ Master-Detail (View B) -- */
.tp-md { display: flex; gap: 0; border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); overflow: hidden; min-height: 480px; height: calc(100vh - 200px); background: var(--tp-bg-surface); }
.tp-md-list { width: 320px; flex-shrink: 0; border-right: 1px solid var(--tp-border-default); overflow-y: auto; display: flex; flex-direction: column; }
.tp-md-list-header { padding: 10px 12px; border-bottom: 1px solid var(--tp-border-default); background: var(--tp-bg-surface-2); position: sticky; top: 0; z-index: 2; }
.tp-md-item { padding: 12px 14px; border-bottom: 1px solid var(--tp-border-default); cursor: pointer; transition: background var(--tp-duration-fast) var(--tp-ease-out); }
.tp-md-item:hover { background: var(--tp-bg-hover); }
.tp-md-item.active { background: var(--tp-bg-selected); border-left: 3px solid var(--tp-accent); padding-left: 11px; }
.tp-md-item .tp-md-item-title { font-size: 13px; font-weight: var(--tp-weight-semibold); margin-bottom: 3px; }
.tp-md-item .tp-md-item-sub { font-size: 11.5px; color: var(--tp-text-tertiary); }
.tp-md-detail { flex: 1; overflow-y: auto; padding: 22px 26px; }
/* Pipeline-Status pro Listen-Item (18.07., MarketingOS-Referenz): schmaler
   Fortschrittsbalken unter dem Item. Generischer .tp-progress wiederverwendbar. */
.tp-md-item-status { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tp-md-item-status-label { font-size: 10.5px; color: var(--tp-text-tertiary); white-space: nowrap; }
.tp-md-item-status.error .tp-md-item-status-label { color: var(--tp-error); }
.tp-progress { flex: 1; display: block; height: 3px; border-radius: var(--tp-radius-pill); background: var(--tp-bg-hover); overflow: hidden; min-width: 40px; }
.tp-progress i { display: block; height: 100%; background: var(--tp-accent); border-radius: var(--tp-radius-pill); transition: width var(--tp-duration-slow) var(--tp-ease-out); }
.tp-md-item-status.error .tp-progress i { background: var(--tp-error); }
.tp-md-item-status.ok .tp-progress i { background: var(--tp-success); }
@media (max-width: 900px) { .tp-md { flex-direction: column; height: auto; } .tp-md-list { width: 100%; max-height: 320px; border-right: none; border-bottom: 1px solid var(--tp-border-default); } }

/* -------------------------------------------- Inline-Create-Row (§G.1) ---- */
.tp-table tr.tp-create-row td { background: var(--tp-bg-surface-2); border-top: 2px solid var(--tp-accent-soft); padding: 6px 8px; }
.tp-create-row .tp-input, .tp-create-row .tp-select { padding: 6px 8px; font-size: 13px; }
.tp-cbx { position: relative; }
/* Chevron rechts: signalisiert Dropdown (Combobox-Standard 18.07.) */
.tp-cbx .tp-cbx-chevron { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--tp-text-tertiary); pointer-events: none; }
.tp-cbx .tp-input { padding-right: 46px; }
.tp-cbx .tp-cbx-x { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border: none; background: transparent; color: var(--tp-text-tertiary); cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 14px; border-radius: var(--tp-radius-full); }
.tp-cbx .tp-cbx-x:hover { background: var(--tp-bg-hover); color: var(--tp-text-primary); }
.tp-cbx-list { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 20; background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-sm); box-shadow: var(--tp-shadow-md); max-height: 220px; overflow-y: auto; display: none; }
.tp-cbx.open .tp-cbx-list { display: block; }
.tp-cbx-option { padding: 7px 10px; font-size: 13px; cursor: pointer; }
.tp-cbx-option:hover { background: var(--tp-bg-hover); }
.tp-cbx-option.highlighted { background: var(--tp-bg-selected); color: var(--tp-text-primary); box-shadow: inset 2px 0 0 var(--tp-accent); font-weight: var(--tp-weight-medium); }
.tp-cbx-option .tp-cbx-check { float: right; color: var(--tp-accent); }
.tp-cbx-empty { padding: 8px 10px; font-size: 12px; color: var(--tp-text-tertiary); }

/* ------------------------------------------------------ Quiz-Flow (§G.2) -- */
.tp-quiz { max-width: 640px; margin: 0 auto; }
.tp-quiz-card { background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-xl); box-shadow: var(--tp-shadow-md); overflow: hidden; }
.tp-quiz-progress { height: 4px; background: var(--tp-bg-hover); }
.tp-quiz-progress i { display: block; height: 100%; background: var(--tp-accent); transition: width var(--tp-duration-slow) var(--tp-ease-out); }
.tp-quiz-inner { padding: 28px 30px 26px; }
.tp-quiz-count { font-size: 11px; font-weight: var(--tp-weight-bold); text-transform: uppercase; letter-spacing: 0.08em; color: var(--tp-accent); margin-bottom: 10px; }
.tp-quiz-question { font-size: 19px; font-weight: var(--tp-weight-bold); letter-spacing: var(--tp-tracking-tight); margin-bottom: 18px; line-height: 1.35; }
.tp-quiz-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 16px; margin-bottom: 8px; border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); background: var(--tp-bg-surface); color: var(--tp-text-primary); font-size: 14px; font-family: inherit; cursor: pointer; transition: all var(--tp-duration-normal) var(--tp-ease-out); }
.tp-quiz-opt:hover { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.tp-quiz-opt .tp-quiz-mark { width: 18px; height: 18px; border: 2px solid var(--tp-border-strong); border-radius: var(--tp-radius-full); flex-shrink: 0; transition: all var(--tp-duration-normal) var(--tp-ease-out); }
.tp-quiz-opt:hover .tp-quiz-mark, .tp-quiz-opt.chosen .tp-quiz-mark { border-color: var(--tp-accent); background: var(--tp-accent); box-shadow: inset 0 0 0 3px var(--tp-bg-surface); }
.tp-quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.tp-quiz-back { border: none; background: transparent; color: var(--tp-text-tertiary); font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 4px 6px; }
.tp-quiz-back:hover { color: var(--tp-accent); }

/* ------------------------------------------- KI-Agent-Chat (Kap. 27, §H.2) */
/* Best-of-both: Nicole/BAS (Verlauf, Chips, Quellen, Konfidenz, Eskalation)
   + AbschlussOS (Avatar-Bubbles, Anhang-Pills, Thinking-Dots). */
.tp-chat { display: flex; flex-direction: column; border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); background: var(--tp-bg-surface); height: calc(100vh - 200px); min-height: 480px; overflow: hidden; }
.tp-chat.dragover { outline: 2px dashed var(--tp-accent); outline-offset: -4px; }
.tp-chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--tp-border-default); background: var(--tp-bg-surface-2); }
.tp-chat-avatar { width: 36px; height: 36px; border-radius: var(--tp-radius-md); background: var(--tp-accent-soft); color: var(--tp-accent); font-weight: var(--tp-weight-bold); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.tp-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tp-chat-ident { flex: 1; min-width: 0; }
.tp-chat-name { font-size: 15px; font-weight: var(--tp-weight-bold); }
.tp-chat-name .tp-chat-dot { color: var(--tp-accent); }
.tp-chat-sub { font-size: 11.5px; color: var(--tp-text-tertiary); }
.tp-chat-body { flex: 1; display: flex; min-height: 0; }
.tp-chat-hist { width: 230px; flex-shrink: 0; border-right: 1px solid var(--tp-border-default); overflow-y: auto; padding: 10px; background: var(--tp-bg-surface-2); }
.tp-chat-hist-head { font-size: 10px; font-weight: var(--tp-weight-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--tp-text-tertiary); padding: 4px 6px 8px; }
.tp-chat-hist-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: none; background: transparent; border-radius: var(--tp-radius-sm); font-size: 12.5px; font-family: inherit; color: var(--tp-text-primary); cursor: pointer; }
.tp-chat-hist-item:hover { background: var(--tp-bg-hover); }
.tp-chat-hist-leer { font-size: 12px; color: var(--tp-text-tertiary); padding: 6px; }
.tp-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tp-chat-scroll { flex: 1; overflow-y: auto; padding: 20px 18px 8px; }
.tp-chat-msgs { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.tp-chat-msg { display: flex; gap: 10px; max-width: 88%; }
.tp-chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.tp-chat-msg-avatar { width: 30px; height: 30px; border-radius: var(--tp-radius-md); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: var(--tp-weight-bold); background: var(--tp-accent-soft); color: var(--tp-accent); overflow: hidden; }
.tp-chat-msg.user .tp-chat-msg-avatar { background: var(--tp-bg-hover); color: var(--tp-text-secondary); }
.tp-chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tp-chat-bubble { background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); padding: 11px 14px; font-size: 14px; line-height: 1.55; word-break: break-word; }
.tp-chat-msg.user .tp-chat-bubble { background: var(--tp-accent-soft); border-color: var(--tp-accent-stronger, var(--tp-accent-soft)); }
.tp-chat-bubble.abstain { border-color: var(--tp-warning); background: var(--tp-warning-soft); }
.tp-chat-text { white-space: pre-wrap; }
.tp-chat-meta { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tp-chat-actions { margin-top: 8px; }
.tp-chat-att-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tp-chat-att-pill { font-size: 11px; background: var(--tp-bg-surface-2); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-sm); padding: 3px 8px; }
.tp-chat-think { display: inline-flex; gap: 4px; padding: 4px 0; }
.tp-chat-think span { width: 6px; height: 6px; border-radius: var(--tp-radius-full); background: var(--tp-accent); opacity: 0.4; animation: tpChatBlink 1.2s infinite; }
.tp-chat-think span:nth-child(2) { animation-delay: 0.2s; }
.tp-chat-think span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tpChatBlink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
/* Quellen-Block (Referenz Nicole: Typ-Badge + Verifiziert-Badge) */
.tp-chat-quellen { margin-top: 10px; border-top: 1px dashed var(--tp-border-default); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.tp-chat-quellen-titel { font-size: 10.5px; font-weight: var(--tp-weight-bold); color: var(--tp-text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.tp-chat-quelle { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--tp-text-primary); text-decoration: none; }
a.tp-chat-quelle:hover .qt { text-decoration: underline; }
.tp-chat-quelle-typ { flex: none; border: 1px solid var(--tp-accent); color: var(--tp-accent); border-radius: var(--tp-radius-sm); padding: 0 6px; font-size: 10px; font-weight: var(--tp-weight-bold); text-transform: uppercase; }
/* Eingabe-Zeile: Plus + Auto-Textarea + Gold-Senden */
.tp-chat-input-wrap { border-top: 1px solid var(--tp-border-default); padding: 10px 16px 12px; background: var(--tp-bg-surface); }
.tp-chat-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 780px; margin: 0 auto 8px; }
.tp-chat-chips:empty { display: none; }
.tp-chat-attach-pills { display: flex; flex-wrap: wrap; gap: 6px; max-width: 780px; margin: 0 auto 6px; }
.tp-chat-attach-pills:empty { display: none; }
.tp-chat-att { font-size: 11px; background: var(--tp-accent-soft); color: var(--tp-accent); border-radius: var(--tp-radius-sm); padding: 3px 6px 3px 8px; display: inline-flex; align-items: center; gap: 4px; }
.tp-chat-att button { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 13px; padding: 0 2px; }
.tp-chat-input { display: flex; align-items: flex-end; gap: 8px; max-width: 780px; margin: 0 auto; border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); padding: 6px 8px; background: var(--tp-bg-surface); }
.tp-chat-input:focus-within { border-color: var(--tp-accent); box-shadow: 0 0 0 2px var(--tp-accent-soft); }
.tp-chat-input .tp-textarea { border: none; box-shadow: none; padding: 8px 4px; background: transparent; }
.tp-chat-input .tp-textarea:focus { border: none; box-shadow: none; }
.tp-chat-send { width: 34px; height: 34px; border-radius: var(--tp-radius-md); border: none; background: var(--tp-accent); color: var(--tp-text-on-accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--tp-duration-normal) var(--tp-ease-out); }
.tp-chat-send:hover { background: var(--tp-accent-hover); }
.tp-chat-foot { max-width: 780px; margin: 8px auto 0; font-size: 10.5px; color: var(--tp-text-tertiary); text-align: center; }
/* Eskalations-Modal (2 Schritte) */
.tp-chat-modal-bg { position: fixed; inset: 0; background: var(--tp-bg-overlay); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tp-chat-modal { background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-xl); box-shadow: var(--tp-shadow-xl); padding: 20px 22px; width: 100%; max-width: 460px; }
.tp-chat-modal h3 { margin: 0 0 8px; font-size: 16px; }
.tp-chat-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tp-chat-copybox { margin-top: 10px; background: var(--tp-bg-surface-2); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-sm); padding: 10px; font-size: 12px; font-family: var(--tp-font-mono); white-space: pre-wrap; }
@media (max-width: 767px) { .tp-chat-hist { position: absolute; z-index: 10; height: 100%; box-shadow: var(--tp-shadow-lg); } .tp-chat { height: calc(100vh - 140px); } }

/* ---------------------------------------- Auswahl-Kacheln (Kap. 21.6) ----- */
/* Referenz: Content-Generator «Content-Baukasten» – grafische Auswahl-
   Interfaces (Content-Typ-Wahl, Generierungs-Einstiege, Modul-Auswahl). */
.tp-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tp-choice-card { display: flex; flex-direction: column; gap: 10px; text-align: left; background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-lg); padding: 18px; font-family: inherit; color: var(--tp-text-primary); cursor: pointer; transition: all var(--tp-duration-normal) var(--tp-ease-out); box-shadow: var(--tp-shadow-xs); }
.tp-choice-card:hover:not(.disabled) { border-color: var(--tp-accent); box-shadow: var(--tp-shadow-md); transform: translateY(-2px); }
.tp-choice-card:focus-visible { outline: none; border-color: var(--tp-accent); box-shadow: var(--tp-shadow-focus); }
.tp-choice-card.disabled { cursor: default; border-style: dashed; background: transparent; opacity: 0.65; }
.tp-choice-card.disabled .tp-choice-title, .tp-choice-card.disabled .tp-choice-desc { color: var(--tp-text-tertiary); }
.tp-choice-head { display: flex; align-items: center; gap: 12px; }
.tp-choice-icon { width: 40px; height: 40px; border-radius: var(--tp-radius-md); background: var(--tp-accent-soft); color: var(--tp-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.tp-choice-icon svg { width: 20px; height: 20px; }
.tp-choice-icon img { width: 100%; height: 100%; object-fit: cover; }
.tp-choice-card.disabled .tp-choice-icon { background: var(--tp-bg-hover); color: var(--tp-text-tertiary); }
.tp-choice-title { font-size: 15px; font-weight: var(--tp-weight-semibold); }
.tp-choice-desc { font-size: 13px; color: var(--tp-text-secondary); line-height: 1.5; flex: 1; }
.tp-choice-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tp-choice-meta { font-size: 11px; background: var(--tp-bg-surface-2); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-sm); padding: 3px 8px; color: var(--tp-text-secondary); font-weight: var(--tp-weight-medium); }
/* Selektierbar: Gold-Rahmen + Haekchen oben rechts (Referenz Content-Generator) */
.tp-choice-card { position: relative; }
.tp-choice-card.selected { border-color: var(--tp-accent); box-shadow: inset 0 0 0 1px var(--tp-accent); }
.tp-choice-card.selected::after { content: '✓'; position: absolute; top: 6px; right: 9px; color: var(--tp-accent); font-weight: var(--tp-weight-bold); font-size: 13px; }
/* Kompakt-Variante: kleine Kachel (Icon + Label), weisser Hintergrund */
.tp-choice-grid.kompakt { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.tp-choice-card.kompakt { align-items: center; text-align: center; gap: 8px; padding: 14px 10px 12px; }
.tp-choice-card.kompakt .tp-choice-icon { width: 34px; height: 34px; }
.tp-choice-card.kompakt .tp-choice-icon svg { width: 17px; height: 17px; }
.tp-choice-card.kompakt .tp-choice-title { font-size: 12.5px; line-height: 1.25; }
/* Options-Buttons: exklusive Wert-Auswahl (z.B. Anzahl) – IMMER Surface-Weiss.
   Alle Buttons EXAKT gleich hoch (Fix 18.07.); Sub-Label («Standard») steht als
   Mini-Caption UNTER dem Button und greift nicht in die Button-Geometrie ein. */
.tp-option-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-option-row.has-subs { padding-bottom: 16px; }
.tp-option-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 42px; padding: 0 14px; background: var(--tp-bg-surface); border: 1px solid var(--tp-border-default); border-radius: var(--tp-radius-md); cursor: pointer; font-family: inherit; color: var(--tp-text-primary); box-shadow: var(--tp-shadow-xs); transition: all var(--tp-duration-normal) var(--tp-ease-out); }
.tp-option-btn:hover:not(.disabled) { border-color: var(--tp-accent); }
.tp-option-btn.selected { border-color: var(--tp-accent); box-shadow: inset 0 0 0 1px var(--tp-accent); }
.tp-option-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.tp-option-label { font-size: 14px; font-weight: var(--tp-weight-semibold); }
.tp-option-sub { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font-size: 9.5px; color: var(--tp-text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; pointer-events: none; }
.tp-option-btn.selected .tp-option-sub { color: var(--tp-accent); }

/* -------------------------------------------------------- Empty-States ---- */
.tp-empty { padding: 40px 20px; text-align: center; }
.tp-empty .tp-empty-title { font-size: 14px; font-weight: var(--tp-weight-semibold); margin-bottom: 4px; }
.tp-empty .tp-empty-sub { font-size: 12.5px; color: var(--tp-text-tertiary); }

/* ------------------------------------------------------- Utility ---------- */
.tp-muted { color: var(--tp-text-tertiary); }
.tp-mono { font-family: var(--tp-font-mono); font-variant-numeric: tabular-nums; }
.tp-flex { display: flex; align-items: center; gap: 8px; }
.tp-right { margin-left: auto; }
.tp-mb-2 { margin-bottom: var(--tp-space-2); } .tp-mb-4 { margin-bottom: var(--tp-space-4); }
