/**
 * TP Design System - Design Tokens
 * Colors extracted 1:1 from IssueHub (crates/issuehub-web/src/app.css).
 * Scale (spacing, typography, density) added by D-00T.
 */

/* ===========================
   Scale — theme independent
   (spacing, typography, density; see plan 0010 / D-00T)
   =========================== */
:root {
  /* Spacing — 4px grid; -0-5 / -1-5 are half steps (Tailwind reading) */
  --tp-space-0:    0;
  --tp-space-0-5:  2px;
  --tp-space-1:    4px;
  --tp-space-1-5:  6px;
  --tp-space-2:    8px;
  --tp-space-3:   12px;
  --tp-space-4:   16px;
  --tp-space-5:   20px;
  --tp-space-6:   24px;
  --tp-space-8:   32px;
  --tp-space-12:  48px;

  /* Font size — 5 steps. Named `font-size` because --tp-text* are colors. */
  --tp-font-size-1: 10px;  /* micro: uppercase label, table head, chip, icon */
  --tp-font-size-2: 12px;  /* secondary: table cell, meta, sub line, help text */
  --tp-font-size-3: 14px;  /* base: body copy, form, card/section title */
  --tp-font-size-4: 18px;  /* large title / metric */
  --tp-font-size-5: 28px;  /* display: the hero metric, and nothing else */

  /* Role alias: tune the KPI size here, not in the scale */
  --tp-font-size-metric:    var(--tp-font-size-4);
  --tp-font-size-metric-lg: var(--tp-font-size-5);

  --tp-line-none:  1;      /* icons, chips */
  --tp-line-tight: 1.2;    /* metrics, headings */
  --tp-line-snug:  1.4;    /* table cells, dense lists */
  --tp-line-base:  1.5;    /* body copy (= current base.css) */

  --tp-font-weight-normal:   400;
  --tp-font-weight-medium:   500;
  --tp-font-weight-semibold: 600;
  --tp-font-weight-bold:     700;

  --tp-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radius — one ramp. V2 carried 3/4/5/6/7/8/9/10/12px next to each other;
     D-00T §8 A5 parked this as its own candidate, D-003 is that candidate.
     Named by role, so a component picks a rung instead of a number. */
  --tp-radius-xs:    3px;  /* chip, code, trend pill, share track edge */
  --tp-radius-sm:    5px;  /* control: button, input, select, segment */
  --tp-radius-md:    8px;  /* surface: card, tile, banner, table frame */
  --tp-radius-lg:   12px;  /* overlay: drawer, picker panel */
  --tp-radius-pill: 999px;

  /* Density — padding, gaps and control heights only.
     Never font size, never line height (A3). Default = compact. */
  --tp-density-pad-y:     var(--tp-space-3);  /* 12px — card/tile/panel */
  --tp-density-pad-x:     var(--tp-space-3);  /* 12px */
  --tp-density-cell-y:    var(--tp-space-2);  /*  8px — table row */
  --tp-density-cell-x:    var(--tp-space-3);  /* 12px */
  --tp-density-gap:       var(--tp-space-3);  /* 12px — grid/stack */
  --tp-density-control-h: 28px;               /* button/input/select (7×4) */
  --tp-density-section-gap: var(--tp-space-5); /* 20px — between page sections */
}

/* Opt-in roomier density, e.g. <body data-density="comfortable"> on form
   and detail pages. Variants (-lg/-sm) use the scale directly, not this set. */
[data-density="comfortable"] {
  --tp-density-pad-y:     var(--tp-space-4);  /* 16px */
  --tp-density-pad-x:     var(--tp-space-4);
  --tp-density-cell-y:    var(--tp-space-3);  /* 12px */
  --tp-density-cell-x:    var(--tp-space-4);  /* 16px */
  --tp-density-gap:       var(--tp-space-4);
  --tp-density-control-h: 32px;               /* 8×4 */
  --tp-density-section-gap: var(--tp-space-8); /* 32px */
}

/* ===========================
   Light Theme (Default)
   =========================== */
:root,
[data-theme="light"] {
  /* Brand Colors.
     --tp-primary is the *fill* role: a surface that carries white glyphs
     (filled button, share bar, avatar). It must stay dark in both themes.
     --tp-accent is the *on-surface* role: text, icon, border, underline.
     Splitting them is the whole point — see the dark block. */
  --tp-primary: #1d4b8e;
  --tp-primary-hover: #174080;
  --tp-accent: #1d4b8e;        /* 8.6:1 on #fff — unchanged in light */
  --tp-accent-hover: #174080;
  --tp-secondary: #6d7175;
  --tp-dark: #1a1a1a;

  /* Layout Colors. The page/rail greys sit on one cool neutral ramp with
     --tp-table-border (#e5e7eb) and --tp-hover-bg (#f3f4f6); the old
     #efefef/#e8e8e8/#e1e1e1 were a second, warmer ramp, and secondary text
     on #efefef measured 4.28:1. */
  --tp-nav-bg: #1a1a1a;
  --tp-sidebar-bg: #eceef2;
  --tp-content-bg: #f4f5f7;
  --tp-surface: #ffffff;
  --tp-border: #e3e6ea;
  --tp-hover-bg: #f3f4f6;

  /* Text Colors */
  --tp-text: #202223;
  --tp-text-secondary: #61666b;
  --tp-highlight: #e3f2fd;

  /* Form Colors */
  --tp-input-bg: #ffffff;
  --tp-input-border: #d1d5db;
  --tp-focus-ring: rgba(29, 75, 142, 0.2);

  /* Status Colors */
  --tp-success: #18cf72;
  --tp-warning: #f59e0b;
  --tp-danger: #ef4444;
  --tp-info: #3b82f6;

  /* Badge Colors */
  --tp-badge-success-bg: #dcfce7;
  --tp-badge-success-text: #166534;
  --tp-badge-warning-bg: #fef3c7;
  --tp-badge-warning-text: #92400e;
  --tp-badge-danger-bg: #fee2e2;
  --tp-badge-danger-text: #991b1b;
  --tp-badge-info-bg: #dbeafe;
  --tp-badge-info-text: #1e40af;
  --tp-badge-gray-bg: #f3f4f6;
  --tp-badge-gray-text: #374151;
  /* Purple role (D-002c): `Closed`/`Merged` and the api-proxy detail pages
     referenced --tp-badge-purple-* long before it existed — those elements
     rendered transparent. Text measures 7.39:1 on its own tint. */
  --tp-badge-purple-bg: #f3e8ff;
  --tp-badge-purple-text: #6b21a8;

  /* Status Pill Fills (D-002c)
     Solid markers for primary entity state, louder than a table badge on
     purpose. Light mode: dark fill, --tp-status-fg glyph (4.59–6.16:1). */
  --tp-status-fg: #ffffff;
  --tp-status-open: #238636;
  --tp-status-closed: #8957e5;
  --tp-status-merged: #8957e5;
  --tp-status-draft: #6e7681;
  --tp-status-progress: #1f6feb;
  --tp-status-resolved: #9a4c07;

  /* Prose / Markdown Colors */
  --tp-prose-text: #1f2328;
  --tp-prose-heading: #1f2328;
  --tp-prose-link: #0969da;
  --tp-prose-code-bg: rgba(175, 184, 193, 0.2);
  --tp-prose-pre-bg: #f6f8fa;
  --tp-prose-border: #d1d9e0;
  --tp-prose-muted: #59636e;
  --tp-prose-table-bg: #ffffff;
  --tp-prose-table-alt-bg: #f6f8fa;
  --tp-prose-mention-bg: #ddf4ff;

  /* Table Colors. Zebra is its own tone: reusing --tp-table-header-bg made
     the head row indistinguishable from every second body row. */
  --tp-table-header-bg: #f6f8fa;
  --tp-table-row-alt: #fafbfc;
  --tp-table-row-hover: #f1f4f8;
  --tp-table-border: #e5e7eb;
  --tp-table-border-light: #f3f4f6;

  /* Card/Surface */
  --tp-card-shadow: rgba(0, 0, 0, 0.1);
  --tp-card-border: rgba(209, 213, 219, 0.3);

  /* Elevation — exactly two rungs (plan 0010 lever 5).
     -1 = resting surface (card, tile, sticky bar). -2 = overlay that floats
     above the page (drawer, picker panel, dialog). Nothing else casts a
     shadow. */
  --tp-elev-1: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --tp-elev-2: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);

  /* HTMX Loading */
  --tp-loading-overlay: rgba(255, 255, 255, 0.6);

  /* Numerics & Delta — aliases, no new colors.
     Named by judgement, not by sign: a falling return rate is `good`.
     Color carries the delta only; the value itself stays --tp-text. */
  --tp-numeric: tabular-nums;
  --tp-num-unit:         var(--tp-text-secondary);
  --tp-delta-good:       var(--tp-badge-success-text);
  --tp-delta-bad:        var(--tp-badge-danger-text);
  /* the neutral delta sits on --tp-delta-neutral-bg, so it takes the text of
     that same badge family — plain secondary text measured 4.50:1 on it */
  --tp-delta-neutral:    var(--tp-badge-gray-text);
  --tp-delta-good-bg:    var(--tp-badge-success-bg);
  --tp-delta-bad-bg:     var(--tp-badge-danger-bg);
  --tp-delta-neutral-bg: var(--tp-badge-gray-bg);
}

/* ===========================
   Dark Theme — CockpitHub-Grau (Tailwind gray-800/700, Plan 0116)
   =========================== */
[data-theme="dark"] {
  /* Brand Colors — the fill role keeps the TP blue (white glyphs on it read
     at 8.7:1). The on-surface role does not: #1d4b8e on #161b22 measures
     2.02:1, which is why links, active tabs, sort arrows and the spinner
     were barely visible in dark mode. --tp-accent is the same brand hue
     (212°) lifted to the value --tp-prose-link has used all along. */
  --tp-primary: #1d4b8e;
  --tp-primary-hover: #2563eb;
  --tp-accent: #60a5fa;        /* blue-400 wie CockpitHub-Links: 5.2:1 auf #273142, 5.8:1 auf #1f2937 */
  --tp-accent-hover: #93c5fd;
  --tp-secondary: #9ca3af;
  --tp-dark: #111827;

  /* Layout Colors — Seite gray-800, Karte eine Stufe heller */
  --tp-nav-bg: #111827;
  --tp-sidebar-bg: #1b2330;
  --tp-content-bg: #1f2937;
  --tp-surface: #273142;
  --tp-border: #374151;
  --tp-hover-bg: #323d4f;

  /* Text Colors */
  --tp-text: #f3f4f6;
  --tp-text-secondary: #a3acb9;
  --tp-highlight: #1e3a5f;

  /* Form Colors */
  --tp-input-bg: #1f2937;
  --tp-input-border: #4b5563;
  --tp-focus-ring: rgba(88, 166, 255, 0.4);

  /* Status Colors - keep our green */
  --tp-success: #18cf72;
  --tp-warning: #d29922;
  --tp-danger: #f85149;
  --tp-info: #58a6ff;

  /* Badge Colors */
  --tp-badge-success-bg: rgba(24, 207, 114, 0.15);
  --tp-badge-success-text: #3fb950;
  --tp-badge-warning-bg: rgba(210, 153, 34, 0.15);
  --tp-badge-warning-text: #d29922;
  --tp-badge-danger-bg: rgba(248, 81, 73, 0.15);
  --tp-badge-danger-text: #ff7b72;  /* #f85149 measured 4.35:1 on its own tint */
  --tp-badge-info-bg: rgba(88, 166, 255, 0.15);
  --tp-badge-info-text: #58a6ff;
  --tp-badge-gray-bg: rgba(139, 148, 158, 0.15);
  --tp-badge-gray-text: #b4bcc8;  /* auf der Tönung über #273142 ≥ 4.5:1 */
  --tp-badge-purple-bg: rgba(163, 113, 247, 0.15);
  --tp-badge-purple-text: #d2a8ff;  /* 7.26:1 on its own tint */

  /* Status Pill Fills — pair inverted for dark (D-002a banner medallion):
     the bright tone carries the fill, the page surface carries the glyph.
     The light-mode fills sat at 2.81–3.77:1 against #0d1117, so the pill
     stopped reading as a shape. Measured 5.29–7.03:1 (Glyph gray-900). */
  --tp-status-fg: #111827;
  --tp-status-open: #3fb950;
  --tp-status-closed: #a371f7;
  --tp-status-merged: #a371f7;
  --tp-status-draft: #8b949e;
  --tp-status-progress: #58a6ff;
  --tp-status-resolved: #d29922;

  /* Prose / Markdown Colors */
  --tp-prose-text: #f3f4f6;
  --tp-prose-heading: #f3f4f6;
  --tp-prose-link: #60a5fa;
  --tp-prose-code-bg: rgba(110, 118, 129, 0.4);
  --tp-prose-pre-bg: #273142;
  --tp-prose-border: #374151;
  --tp-prose-muted: #a3acb9;
  --tp-prose-table-bg: #1f2937;
  --tp-prose-table-alt-bg: #273142;
  --tp-prose-mention-bg: rgba(56, 139, 253, 0.15);

  /* Table Colors */
  --tp-table-header-bg: #2c3748;
  --tp-table-row-alt: #2a3445;
  --tp-table-row-hover: #323d4f;
  --tp-table-border: #374151;
  --tp-table-border-light: #2f3a4b;

  /* Card/Surface */
  --tp-card-shadow: rgba(0, 0, 0, 0.35);
  --tp-card-border: #374151;

  /* Elevation. On a dark page a drop shadow adds nothing — resting height is
     already carried by the surface being lighter than the page (#273142 on
     #1f2937). So rung 1 is honestly `none`; only the overlay lifts. */
  --tp-elev-1: none;
  --tp-elev-2: 0 12px 32px rgba(3, 7, 18, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);

  /* HTMX Loading */
  --tp-loading-overlay: rgba(17, 24, 39, 0.6);

  /* Numerics & Delta — re-aliased so dark mode does not freeze on the
     light values when [data-theme] sits below :root. */
  --tp-numeric: tabular-nums;
  --tp-num-unit:         var(--tp-text-secondary);
  --tp-delta-good:       var(--tp-badge-success-text);
  --tp-delta-bad:        var(--tp-badge-danger-text);
  /* the neutral delta sits on --tp-delta-neutral-bg, so it takes the text of
     that same badge family — plain secondary text measured 4.50:1 on it */
  --tp-delta-neutral:    var(--tp-badge-gray-text);
  --tp-delta-good-bg:    var(--tp-badge-success-bg);
  --tp-delta-bad-bg:     var(--tp-badge-danger-bg);
  --tp-delta-neutral-bg: var(--tp-badge-gray-bg);
}

/* ===========================================================================
   V2-Aliase (Plan 0065, Befund R-3)
   ===========================================================================
   Die V2-Bausteine schreiben `var(--tpv2-surface, #fff)`. Diese Namen gab es
   nie — jede dieser Stellen fiel auf ihren hellen Rückfallwert zurück, und
   zwar in JEDEM Thema. Sichtbar war es dort, wo der Rückfallwert eine Fläche
   ist: das Fenster einer Tat stand weiß auf der dunklen Seite.

   Sie stehen als Verweise und nicht als Farben, und in allen drei Selektoren:
   ein Verweis wird auf dem Element aufgelöst, das ihn deklariert — stünde er
   nur auf `:root`, fröre er auf den hellen Werten ein, sobald ein
   `[data-theme]` unterhalb der Wurzel sitzt. Aus demselben Grund stehen die
   Numerics weiter oben in beiden Themenblöcken. */
:root,
[data-theme='light'],
[data-theme='dark'] {
  --tpv2-surface: var(--tp-surface);
  --tpv2-surface-muted: var(--tp-hover-bg);
  --tpv2-border: var(--tp-border);
  --tpv2-text: var(--tp-text);
  --tpv2-text-muted: var(--tp-text-secondary);
  /* Derselbe Befund, anderer Name: sechs Stellen schreiben
     `--tp-text-primary`, definiert war es nirgends. Ohne Rückfallwert ist
     eine solche Farbe ungültig und der Text erbt — meistens richtig, und
     genau deshalb fiel es nie auf. */
  --tp-text-primary: var(--tp-text);
}
/**
 * TP Design System - Base Styles
 * Reset and typography
 */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tp-text);
  background-color: var(--tp-content-bg);
}

a {
  color: var(--tp-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Alpine.js cloak - hide elements until Alpine loads */
[x-cloak] { display: none !important; }

/* Utility classes */
.tp-text-success-v1 { color: var(--tp-success); }
.tp-text-warning-v1 { color: var(--tp-warning); }
.tp-text-danger-v1 { color: var(--tp-danger); }
.tp-text-secondary-v1 { color: var(--tp-text-secondary); }

.tp-mb-1-v1 { margin-bottom: var(--tp-space-1); }
.tp-mb-2-v1 { margin-bottom: var(--tp-space-2); }
.tp-mb-3-v1 { margin-bottom: var(--tp-space-3); }
.tp-mb-4-v1 { margin-bottom: var(--tp-space-4); }
.tp-mb-5-v1 { margin-bottom: var(--tp-space-5); }
.tp-mb-6-v1 { margin-bottom: var(--tp-space-6); }
/**
 * TP Design System - Admin Layout Components
 * DaisyUI-style semantic CSS classes for admin layouts
 *
 * Usage:
 *   <div class="tp-admin">
 *     <header class="tp-admin-header">...</header>
 *     <aside class="tp-admin-sidebar">...</aside>
 *     <main class="tp-admin-content">...</main>
 *   </div>
 */

/* ===========================
   Admin Container
   =========================== */
.tp-admin {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--tp-content-bg);
  position: relative;
}

/* ===========================
   Admin Header
   =========================== */
.tp-admin-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--tp-nav-bg);
  border-bottom: 1px solid var(--tp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
}

/* Header content sections */
.tp-admin-header-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tp-admin-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.tp-admin-header-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Header icon buttons */
.tp-admin-header-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: #b3b3b3;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tp-admin-header-icon:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Header brand/logo */
.tp-admin-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tp-admin-header-brand-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1d4b8e 0%, #0b549c 100%);
  box-shadow: 0 4px 8px rgba(29, 75, 142, 0.3);
  position: relative;
  overflow: hidden;
}

.tp-admin-header-brand-logo svg {
  fill: white;
  width: 1.25rem;
  height: 1.25rem;
}

.tp-admin-header-brand-title {
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
}

.tp-admin-header-brand-title:hover {
  opacity: 0.8;
}

/* Header Navigation Links */
.tp-admin-header-nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  padding: 0.25rem 0;
  transition: color 0.15s ease;
  position: relative;
}

.tp-admin-header-nav-link:hover {
  color: white;
}

.tp-admin-header-nav-link.active {
  color: white;
}

.tp-admin-header-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--tp-primary);
  border-radius: 1px;
}

/* Header Search */
.tp-admin-header-search {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  gap: 0.5rem;
  min-width: 200px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tp-admin-header-search:focus-within {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.tp-admin-header-search-icon {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

.tp-admin-header-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 0.875rem;
  width: 100%;
}

.tp-admin-header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.tp-admin-header-search-kbd {
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.625rem;
  font-family: inherit;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===========================
   Admin Sidebar
   =========================== */
.tp-admin-sidebar {
  position: fixed;
  left: 0;
  top: 56px;
  bottom: 0;
  width: 13rem; /* 208px */
  background-color: var(--tp-sidebar-bg);
  border-right: 1px solid var(--tp-border);
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.2s ease, width 0.2s ease;
}

/* Sidebar nav container */
.tp-admin-sidebar-nav {
  padding: 1rem 0;
}

/* Sidebar section heading */
.tp-admin-sidebar-heading {
  padding: 0 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sidebar link */
.tp-admin-sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin: 2px 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tp-admin-sidebar-link:hover {
  background-color: var(--tp-hover-bg);
}

.tp-admin-sidebar-link.active {
  background-color: var(--tp-primary);
  color: white;
}

.tp-admin-sidebar-link-icon {
  width: 1rem;
  margin-right: 0.75rem;
  text-align: center;
}

/* Sidebar divider */
.tp-admin-sidebar-divider {
  height: 1px;
  background-color: var(--tp-border);
  margin: 0.5rem 1rem;
}

/* Sidebar Variants */
.tp-admin-sidebar-collapsed {
  width: 4rem;
}

.tp-admin-sidebar-collapsed .tp-admin-sidebar-link span:not(.tp-admin-sidebar-link-icon) {
  display: none;
}

.tp-admin-sidebar-collapsed .tp-admin-sidebar-heading {
  display: none;
}

/* Mobile: Hidden by default, shown with overlay */
@media (max-width: 1023px) {
  .tp-admin-sidebar {
    transform: translateX(-100%);
  }

  .tp-admin-sidebar.open {
    transform: translateX(0);
  }
}


/* Desktop: Always visible */
@media (min-width: 1024px) {
  .tp-admin-sidebar {
    transform: translateX(0);
  }
}

/* ===========================
   Admin Content
   =========================== */
.tp-admin-content {
  flex: 1;
  min-width: 0;
  margin-top: 56px;
  margin-left: 0;
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  background-color: var(--tp-content-bg);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}

/* Desktop: Account for sidebar */
@media (min-width: 1024px) {
  .tp-admin-content {
    margin-left: 13rem; /* 208px - matches sidebar width */
  }

  .tp-admin-sidebar-collapsed + .tp-admin-content,
  .tp-admin.sidebar-collapsed .tp-admin-content {
    margin-left: 4rem;
  }
}

/* Content inner wrapper */
.tp-admin-content-inner {
  flex: 1;
  padding: 1.5rem;
}

/* Mobile + kleines Tablet: kein seitlicher Abstand.
   !important nötig da andere Dienste ggf. ältere tp-ui laden (z.B. ConsoleHub als Host). */
@media (max-width: 767px) {
  .tp-admin-content-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Narrow content (GitHub-style) */
.tp-admin-content-narrow {
  max-width: 64rem; /* 1024px */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Wide content (for pages with sidebar) */
.tp-admin-content-wide {
  max-width: 80rem; /* 1280px */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Extra narrow for focused content */
.tp-admin-content-xs {
  max-width: 48rem; /* 768px */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Full width content */
.tp-admin-content-full {
  max-width: none;
  width: 100%;
}

/* ===========================
   Data Table Card — Mobile
   =========================== */
/* On mobile: flat card (no border-radius/side-borders) + horizontal scroll.
   Negative margins are intentionally avoided — they cause table overflow.
   For full edge-to-edge (0 side gap) use tp-admin-content-data opt-in. */
@media (max-width: 767px) {
  .tp-data-table-card {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Table rows scroll horizontally, filter panel stays visible */
  .tp-data-table-card [data-density] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===========================
   Data View (opt-in)
   =========================== */
/* Opt-in class for data-display pages (tables, dashboards).
   Cards manage their own spacing via margin — no content-inner padding needed.
   On mobile: cards snap edge-to-edge for maximum usable space.
   Usage: {% block content_width %}tp-admin-content-full tp-admin-content-data{% endblock %} */
.tp-admin-content-inner.tp-admin-content-data {
  padding: 0;
}

@media (max-width: 767px) {
  .tp-admin-content-inner.tp-admin-content-data > * {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ===========================
   Admin Breadcrumb
   =========================== */
.tp-admin-breadcrumb {
  background-color: var(--tp-surface);
  border-bottom: 1px solid var(--tp-border);
  padding: 0.75rem 1rem;
}

.tp-admin-breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
}

.tp-admin-breadcrumb-link {
  color: var(--tp-text-secondary);
  transition: color 0.15s ease;
}

.tp-admin-breadcrumb-link:hover {
  color: var(--tp-text);
}

.tp-admin-breadcrumb-separator {
  color: var(--tp-text-secondary);
}

.tp-admin-breadcrumb-current {
  color: var(--tp-text);
  font-weight: 500;
}

/* ===========================
   Admin Page Header
   =========================== */
.tp-admin-page-header {
  margin-bottom: 1.5rem;
}

.tp-admin-page-header-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .tp-admin-page-header-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.tp-admin-page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--tp-text);
  line-height: 1.25;
}

.tp-admin-page-description {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
}

.tp-admin-page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ===========================
   Admin Card / Surface
   =========================== */
.tp-admin-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tp-admin-card-header {
  padding: 1rem;
  border-bottom: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
}

.tp-admin-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
}

.tp-admin-card-body {
  padding: 1rem;
}

.tp-admin-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Admin Mobile Overlay
   =========================== */
.tp-admin-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tp-admin-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .tp-admin-overlay {
    display: none;
  }
}

/* ===========================
   Admin User Menu
   =========================== */
.tp-admin-user-menu {
  position: relative;
}

.tp-admin-user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.tp-admin-user-menu-trigger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.tp-admin-user-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  width: 14rem;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 50;
}

.tp-admin-user-menu-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-admin-user-menu-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
}

.tp-admin-user-menu-email {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

.tp-admin-user-menu-items {
  padding: 0.25rem 0;
}

.tp-admin-user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  width: 100%;
  text-align: left;
  transition: background-color 0.15s ease;
}

.tp-admin-user-menu-item:hover {
  background-color: var(--tp-hover-bg);
}

.tp-admin-user-menu-item-icon {
  width: 1rem;
  color: var(--tp-text-secondary);
}

.tp-admin-user-menu-item-danger {
  color: var(--tp-danger);
}

.tp-admin-user-menu-divider {
  height: 1px;
  background-color: var(--tp-border);
  margin: 0.25rem 0;
}

/* ===========================
   Admin Card - Enhanced
   =========================== */

/* Card with subtle shadow and hover */
.tp-admin-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.tp-admin-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Card Header with Actions */
.tp-admin-card-header {
  padding: 1rem;
  border-bottom: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tp-admin-card-header-content {
  flex: 1;
  min-width: 0;
}

.tp-admin-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
  line-height: 1.4;
}

.tp-admin-card-subtitle {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  margin-top: 0.125rem;
}

.tp-admin-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tp-admin-card-body {
  padding: 1rem;
}

.tp-admin-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Stat Card - Dashboard Metrics
   =========================== */
.tp-stat-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tp-stat-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tp-stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tp-stat-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.tp-stat-card-icon-primary {
  background-color: rgba(29, 75, 142, 0.1);
  color: var(--tp-accent);
}

.tp-stat-card-icon-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.tp-stat-card-icon-warning {
  background-color: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

.tp-stat-card-icon-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.tp-stat-card-icon-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.tp-stat-card-menu {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  color: var(--tp-text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tp-stat-card-menu:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-stat-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.25rem;
}

.tp-stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--tp-text);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.tp-stat-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tp-border);
}

.tp-stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.tp-stat-card-trend-up {
  color: #22c55e;
}

.tp-stat-card-trend-down {
  color: #ef4444;
}

.tp-stat-card-trend-neutral {
  color: var(--tp-text-secondary);
}

.tp-stat-card-period {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

/* Compact Stat Card */
.tp-stat-card-compact {
  padding: 1rem;
}

.tp-stat-card-compact .tp-stat-card-icon {
  width: 2rem;
  height: 2rem;
  font-size: 0.875rem;
}

.tp-stat-card-compact .tp-stat-card-value {
  font-size: 1.25rem;
}

/* ===========================
   List Card - Activity/Items
   =========================== */
.tp-list-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tp-list-card-header {
  padding: 1rem;
  border-bottom: 1px solid var(--tp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tp-list-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
}

.tp-list-card-action {
  font-size: 0.75rem;
  color: var(--tp-accent);
  font-weight: 500;
  transition: color 0.15s ease;
}

.tp-list-card-action:hover {
  color: var(--tp-accent-hover);
}

.tp-list-card-items {
  padding: 0;
  margin: 0;
  list-style: none;
}

.tp-list-card-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--tp-border);
  transition: background-color 0.15s ease;
}

.tp-list-card-item:last-child {
  border-bottom: none;
}

.tp-list-card-item:hover {
  background-color: var(--tp-hover-bg);
}

.tp-list-card-item-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
}

.tp-list-card-item-icon-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.tp-list-card-item-icon-warning {
  background-color: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

.tp-list-card-item-icon-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.tp-list-card-item-icon-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.tp-list-card-item-content {
  flex: 1;
  min-width: 0;
}

.tp-list-card-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
  line-height: 1.4;
}

.tp-list-card-item-description {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  margin-top: 0.125rem;
}

.tp-list-card-item-meta {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  flex-shrink: 0;
}

.tp-list-card-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--tp-text-secondary);
  font-size: 0.875rem;
}

/* ===========================
   Progress Card
   =========================== */
.tp-progress-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.tp-progress-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tp-progress-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
}

.tp-progress-card-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
}

.tp-progress-bar {
  height: 0.5rem;
  background-color: var(--tp-hover-bg);
  border-radius: 9999px;
  overflow: hidden;
}

.tp-progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.tp-progress-bar-fill-primary {
  background-color: var(--tp-primary);
}

.tp-progress-bar-fill-success {
  background-color: #22c55e;
}

.tp-progress-bar-fill-warning {
  background-color: #eab308;
}

.tp-progress-bar-fill-danger {
  background-color: #ef4444;
}

.tp-progress-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

/* ===========================
   Action Card - Quick Actions
   =========================== */
.tp-action-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.tp-action-card:hover {
  border-color: var(--tp-accent);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tp-action-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background-color: var(--tp-hover-bg);
  color: var(--tp-accent);
}

.tp-action-card-content {
  flex: 1;
  min-width: 0;
}

.tp-action-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
}

.tp-action-card-description {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  margin-top: 0.125rem;
}

.tp-action-card-arrow {
  color: var(--tp-text-secondary);
  transition: color 0.15s ease, transform 0.15s ease;
}

.tp-action-card:hover .tp-action-card-arrow {
  color: var(--tp-accent);
  transform: translateX(2px);
}

/* ===========================
   Info Card - Alerts/Tips
   =========================== */
.tp-info-card {
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
}

.tp-info-card-default {
  background-color: var(--tp-hover-bg);
  border: 1px solid var(--tp-border);
}

.tp-info-card-info {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.tp-info-card-success {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.tp-info-card-warning {
  background-color: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.tp-info-card-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.tp-info-card-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.tp-info-card-default .tp-info-card-icon {
  color: var(--tp-text-secondary);
}

.tp-info-card-info .tp-info-card-icon {
  color: #3b82f6;
}

.tp-info-card-success .tp-info-card-icon {
  color: #22c55e;
}

.tp-info-card-warning .tp-info-card-icon {
  color: #eab308;
}

.tp-info-card-danger .tp-info-card-icon {
  color: #ef4444;
}

.tp-info-card-content {
  flex: 1;
  min-width: 0;
}

.tp-info-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
  margin-bottom: 0.25rem;
}

.tp-info-card-text {
  font-size: 0.8125rem;
  color: var(--tp-text-secondary);
  line-height: 1.5;
}

.tp-info-card-dismiss {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  color: var(--tp-text-secondary);
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tp-info-card-dismiss:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--tp-text);
}

/* ===========================
   Action Card - Fix Focus/Selected State
   =========================== */
.tp-action-card:focus {
  outline: none;
}

.tp-action-card:focus-visible {
  outline: 2px solid var(--tp-accent);
  outline-offset: 2px;
  border-color: transparent;
}

/* ===========================
   ConsoleHub Integration
   Wenn Admin-Layout unter ConsoleHub Topbar + Service Bar sitzt:
   Sidebar und Content starten bei 104px (56px + 48px)
   Nutzung: <div class="tp-admin tp-consolehub">
   =========================== */
.tp-admin.tp-consolehub .tp-admin-sidebar {
  top: 6.5rem; /* 56px topbar + 48px service-bar */
}

.tp-admin.tp-consolehub .tp-admin-content {
  margin-top: 6.5rem;
  min-height: calc(100vh - 6.5rem);
  min-height: calc(100dvh - 6.5rem);
}
/**
 * TP Design System - AI Summary Component
 * Collapsible AI-generated summary with loading animations
 *
 * Usage:
 *   <div class="tp-ai-summary" x-data="{ expanded: true }">
 *     <div class="tp-ai-summary-header">...</div>
 *     <div class="tp-ai-summary-content">...</div>
 *   </div>
 *
 * States:
 *   .tp-ai-summary-loading - Shows loading animation
 *   .tp-ai-summary-error - Shows error state
 *
 * Extracted from IssueHub with all animations preserved.
 */

/* ===========================
   AI Summary Container
   =========================== */
.tp-ai-summary {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--tp-border);
  background: linear-gradient(
    to bottom right,
    rgba(59, 130, 246, 0.05),
    rgba(99, 102, 241, 0.08),
    rgba(168, 85, 247, 0.05)
  );
}

/* Dark mode base */
[data-theme="dark"] .tp-ai-summary {
  background: linear-gradient(
    to bottom right,
    rgba(59, 130, 246, 0.1),
    rgba(99, 102, 241, 0.15),
    rgba(168, 85, 247, 0.1)
  );
}

/* ===========================
   AI Summary Header
   =========================== */
.tp-ai-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.tp-ai-summary-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.tp-ai-summary-toggle:hover {
  opacity: 0.8;
}

.tp-ai-summary-icon {
  color: #9ca3af;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

/* No rotation needed - using different icons (chevron-down/chevron-right) */
.tp-ai-summary-icon.expanded,
.tp-ai-summary-icon.collapsed {
  transform: rotate(0deg);
}

.tp-ai-summary-title {
  font-weight: 500;
  font-size: 0.875rem;
  color: #1f2937;
}

[data-theme="dark"] .tp-ai-summary-title {
  color: #e5e7eb;
}

/* Regenerate Button */
.tp-ai-summary-regenerate {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  background: none;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tp-ai-summary-regenerate:hover {
  background-color: rgba(255, 255, 255, 0.5);
  color: #374151;
}

[data-theme="dark"] .tp-ai-summary-regenerate {
  color: #9ca3af;
}

[data-theme="dark"] .tp-ai-summary-regenerate:hover {
  background-color: rgba(31, 41, 55, 0.5);
  color: #d1d5db;
}

/* ===========================
   AI Summary Content
   =========================== */
.tp-ai-summary-content {
  padding: 0 1rem 0.75rem 1.75rem;
}

.tp-ai-summary-content .prose {
  font-size: 0.875rem;
  line-height: 1.625;
  color: #374151;
}

[data-theme="dark"] .tp-ai-summary-content .prose {
  color: #d1d5db;
}

.tp-ai-summary-content .prose p {
  margin-bottom: 0.5rem;
}

.tp-ai-summary-content .prose ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.tp-ai-summary-content .prose li {
  margin-bottom: 0.25rem;
}

.tp-ai-summary-content .prose code {
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  background-color: rgba(99, 102, 241, 0.1);
  border-radius: 0.25rem;
  color: #6366f1;
}

[data-theme="dark"] .tp-ai-summary-content .prose code {
  background-color: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* ===========================
   Loading State
   =========================== */
.tp-ai-summary.tp-ai-summary-loading {
  min-height: 5rem;
  padding: 1.5rem;

  /* Animated gradient background */
  background: linear-gradient(
    125deg,
    rgba(99, 102, 241, 0.03) 0%,
    rgba(168, 85, 247, 0.08) 20%,
    rgba(236, 72, 153, 0.05) 40%,
    rgba(99, 102, 241, 0.08) 60%,
    rgba(59, 130, 246, 0.05) 80%,
    rgba(168, 85, 247, 0.03) 100%
  );
  background-size: 300% 300%;
  animation: tp-ai-gradient-flow 4s ease infinite;

  /* Glow border */
  box-shadow:
    inset 0 1px 0 0 rgba(168, 85, 247, 0.1),
    inset 0 -1px 0 0 rgba(99, 102, 241, 0.1);
}

/* Dark mode loading state */
[data-theme="dark"] .tp-ai-summary.tp-ai-summary-loading {
  background: linear-gradient(
    125deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(168, 85, 247, 0.15) 20%,
    rgba(236, 72, 153, 0.1) 40%,
    rgba(99, 102, 241, 0.15) 60%,
    rgba(59, 130, 246, 0.1) 80%,
    rgba(168, 85, 247, 0.08) 100%
  );
  background-size: 300% 300%;
  animation: tp-ai-gradient-flow 4s ease infinite;

  box-shadow:
    inset 0 1px 0 0 rgba(168, 85, 247, 0.2),
    inset 0 -1px 0 0 rgba(99, 102, 241, 0.2);
}

/* Hide content when loading */
.tp-ai-summary.tp-ai-summary-loading .tp-ai-summary-header,
.tp-ai-summary.tp-ai-summary-loading .tp-ai-summary-content {
  display: none !important;
}

/* Show loading content */
.tp-ai-summary.tp-ai-summary-loading .tp-ai-loading {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Sparkle effect overlay */
.tp-ai-summary.tp-ai-summary-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.4) 0%, transparent 8%),
    radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.5) 0%, transparent 6%),
    radial-gradient(circle at 40% 80%, rgba(236, 72, 153, 0.4) 0%, transparent 7%),
    radial-gradient(circle at 90% 70%, rgba(59, 130, 246, 0.5) 0%, transparent 5%),
    radial-gradient(circle at 10% 60%, rgba(168, 85, 247, 0.3) 0%, transparent 6%),
    radial-gradient(circle at 60% 10%, rgba(236, 72, 153, 0.4) 0%, transparent 4%);
  animation: tp-ai-sparkle 2s ease-in-out infinite;
  pointer-events: none;
}

/* Dark mode sparkle */
[data-theme="dark"] .tp-ai-summary.tp-ai-summary-loading::before {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.6) 0%, transparent 8%),
    radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.7) 0%, transparent 6%),
    radial-gradient(circle at 40% 80%, rgba(236, 72, 153, 0.6) 0%, transparent 7%),
    radial-gradient(circle at 90% 70%, rgba(59, 130, 246, 0.7) 0%, transparent 5%),
    radial-gradient(circle at 10% 60%, rgba(168, 85, 247, 0.5) 0%, transparent 6%),
    radial-gradient(circle at 60% 10%, rgba(236, 72, 153, 0.6) 0%, transparent 4%);
}

/* ===========================
   Loading Content
   =========================== */
.tp-ai-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.tp-ai-loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.tp-ai-loading-text-main {
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: tp-ai-text-shimmer 2s linear infinite;
}

[data-theme="dark"] .tp-ai-loading-text-main {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tp-ai-loading-text-sub {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  opacity: 0.8;
}

/* ===========================
   Loading Dots
   =========================== */
.tp-ai-loading-dots {
  display: inline-flex;
  gap: 4px;
}

.tp-ai-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  animation: tp-ai-dot-bounce 1.4s ease-in-out infinite;
}

.tp-ai-loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.tp-ai-loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.tp-ai-loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

[data-theme="dark"] .tp-ai-loading-dots span {
  background: linear-gradient(135deg, #818cf8, #c084fc);
}

/* ===========================
   Error State
   =========================== */
.tp-ai-summary.tp-ai-summary-error {
  background: linear-gradient(
    to bottom right,
    rgba(239, 68, 68, 0.05),
    rgba(239, 68, 68, 0.1)
  );
}

.tp-ai-summary-error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #dc2626;
}

.tp-ai-summary-error-message i {
  font-size: 1rem;
}

[data-theme="dark"] .tp-ai-summary.tp-ai-summary-error {
  background: linear-gradient(
    to bottom right,
    rgba(239, 68, 68, 0.1),
    rgba(239, 68, 68, 0.15)
  );
}

[data-theme="dark"] .tp-ai-summary-error-message {
  color: #f87171;
}

/* ===========================
   Keyframe Animations
   =========================== */

/* Gradient flow animation */
@keyframes tp-ai-gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Sparkle pulse animation */
@keyframes tp-ai-sparkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Text shimmer animation */
@keyframes tp-ai-text-shimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Dot bounce animation */
@keyframes tp-ai-dot-bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Icon pulse animation */
@keyframes tp-ai-icon-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Sparkle rotation for icons */
@keyframes tp-ai-sparkle-rotate {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: scale(1.15) rotate(10deg);
    opacity: 0.9;
  }
  50% {
    transform: scale(0.9) rotate(-10deg);
    opacity: 1;
  }
  75% {
    transform: scale(1.1) rotate(5deg);
    opacity: 0.95;
  }
}

/* ===========================
   Utility Classes
   =========================== */
.tp-ai-animate-sparkle {
  animation: tp-ai-sparkle-rotate 1.2s ease-in-out infinite;
}

.tp-ai-animate-pulse {
  animation: tp-ai-icon-pulse 2s ease-in-out infinite;
}

/* ===========================
   AI Summary Variants
   =========================== */

/* Compact variant */
.tp-ai-summary-compact .tp-ai-summary-header {
  padding: 0.375rem 0.75rem;
}

.tp-ai-summary-compact .tp-ai-summary-content {
  padding: 0 0.75rem 0.5rem 1.5rem;
}

.tp-ai-summary-compact .tp-ai-summary-title {
  font-size: 0.75rem;
}

/* Card variant (with border radius) */
.tp-ai-summary-card {
  border-radius: 0.5rem;
  border: 1px solid var(--tp-border);
  margin: 0.5rem;
}

/* Inline variant (no border-bottom) */
.tp-ai-summary-inline {
  border-bottom: none;
}
/**
 * TP Design System - Alert / Banner
 * Inline status strips (filter active, form errors, success toasts-adjacent)
 *
 * Usage:
 *   <div class="tp-alert tp-alert-info">…</div>
 */

.tp-alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.tp-alert-icon {
  flex-shrink: 0;
  font-size: 0.875rem;
}

.tp-alert-body {
  flex: 1;
  min-width: 0;
  color: var(--tp-text);
}

.tp-alert-actions {
  flex-shrink: 0;
  margin-left: auto;
}

.tp-alert-info {
  border-color: var(--tp-badge-info-bg);
  background-color: var(--tp-badge-info-bg);
  color: var(--tp-badge-info-text);
}

.tp-alert-info .tp-alert-body {
  color: var(--tp-badge-info-text);
}

.tp-alert-success {
  border-color: var(--tp-badge-success-bg);
  background-color: var(--tp-badge-success-bg);
  color: var(--tp-badge-success-text);
}

.tp-alert-success .tp-alert-body {
  color: var(--tp-badge-success-text);
}

.tp-alert-warning {
  border-color: var(--tp-badge-warning-bg);
  background-color: var(--tp-badge-warning-bg);
  color: var(--tp-badge-warning-text);
}

.tp-alert-warning .tp-alert-body {
  color: var(--tp-badge-warning-text);
}

.tp-alert-danger {
  border-color: var(--tp-badge-danger-bg);
  background-color: var(--tp-badge-danger-bg);
  color: var(--tp-badge-danger-text);
}

.tp-alert-danger .tp-alert-body {
  color: var(--tp-badge-danger-text);
}
/**
 * TP Design System - App Switcher Component
 * Google Cloud Console-style service navigation drawer
 *
 * Structure:
 *   <button class="tp-app-switcher-btn">☰</button>
 *
 *   <div class="tp-app-switcher-drawer" x-show="switcherOpen" x-cloak>
 *     <div class="tp-app-switcher-overlay" @click="switcherOpen = false"></div>
 *     <div class="tp-app-switcher-panel">
 *       <div class="tp-app-switcher-header">...</div>
 *       <div class="tp-app-switcher-search">...</div>
 *       <div class="tp-app-switcher-body">
 *         <div class="tp-app-switcher-section">
 *           <div class="tp-app-switcher-section-title">Favoriten</div>
 *           <a class="tp-app-switcher-item">
 *             <div class="tp-app-switcher-icon">...</div>
 *             <span class="tp-app-switcher-name">SupportHub</span>
 *             <button class="tp-app-switcher-star active">★</button>
 *             <button class="tp-app-switcher-arrow">›</button>
 *           </a>
 *         </div>
 *       </div>
 *       <div class="tp-app-switcher-footer">...</div>
 *     </div>
 *     <!-- Sub-menu panel -->
 *     <div class="tp-app-switcher-submenu" x-show="submenuOpen">...</div>
 *   </div>
 */

/* x-cloak: hide before Alpine initializes */
[x-cloak] { display: none !important; }

/* ===========================
   Burger Button
   =========================== */
.tp-app-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #b3b3b3;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 1rem;
  flex-shrink: 0;
}

.tp-app-switcher-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* ===========================
   Drawer Overlay
   =========================== */
.tp-app-switcher-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
}

.tp-app-switcher-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

/* ===========================
   Panel
   =========================== */
.tp-app-switcher-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 300px;
  height: 100%;
  background-color: var(--tp-surface);
  border-right: 1px solid var(--tp-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 1;
  overflow: hidden;
}

/* ===========================
   Header
   =========================== */
.tp-app-switcher-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background-color: var(--tp-nav-bg);
  flex-shrink: 0;
}

.tp-app-switcher-header-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
  flex-shrink: 0;
}

.tp-app-switcher-header-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.tp-app-switcher-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.tp-app-switcher-header-logo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  background: linear-gradient(135deg, #1d4b8e 0%, #0b549c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(29, 75, 142, 0.4);
}

.tp-app-switcher-header-logo svg {
  fill: white;
  width: 60%;
  height: 60%;
}

.tp-app-switcher-header-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   Search
   =========================== */
.tp-app-switcher-search {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--tp-border);
  flex-shrink: 0;
}

.tp-app-switcher-search-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--tp-hover-bg);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--tp-text-secondary);
  cursor: text;
  width: 100%;
}

.tp-app-switcher-search-input input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.8125rem;
  color: var(--tp-text);
  flex: 1;
  min-width: 0;
}

.tp-app-switcher-search-input input::placeholder {
  color: var(--tp-text-secondary);
}

/* ===========================
   Body (scrollable)
   =========================== */
.tp-app-switcher-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--tp-border) transparent;
}

.tp-app-switcher-body::-webkit-scrollbar {
  width: 4px;
}

.tp-app-switcher-body::-webkit-scrollbar-thumb {
  background-color: var(--tp-border);
  border-radius: 2px;
}

/* ===========================
   Sections
   =========================== */
.tp-app-switcher-section {
  padding: 0.5rem 0;
}

.tp-app-switcher-section + .tp-app-switcher-section {
  border-top: 1px solid var(--tp-border);
}

.tp-app-switcher-section-title {
  padding: 0.375rem 1rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--tp-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===========================
   Service Items
   =========================== */
.tp-app-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--tp-text);
  transition: background-color 0.1s;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.tp-app-switcher-item:hover {
  background-color: var(--tp-hover-bg);
}

.tp-app-switcher-item.active {
  background-color: rgba(29, 75, 142, 0.08);
}

.tp-app-switcher-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background-color: var(--tp-primary);
  color: white;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.tp-app-switcher-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Star / Favorite button */
.tp-app-switcher-star {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  border-radius: 0.25rem;
  transition: all 0.15s;
  flex-shrink: 0;
  opacity: 0;
  padding: 0;
}

.tp-app-switcher-item:hover .tp-app-switcher-star {
  opacity: 1;
}

.tp-app-switcher-star:hover {
  color: var(--tp-warning);
  background-color: rgba(245, 158, 11, 0.1);
}

.tp-app-switcher-star.active {
  color: var(--tp-warning);
  opacity: 1;
}

.tp-app-switcher-star.active:hover {
  color: var(--tp-text-secondary);
  background-color: var(--tp-hover-bg);
}

/* Sub-menu arrow */
.tp-app-switcher-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--tp-text-secondary);
  border-radius: 0.25rem;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.tp-app-switcher-arrow:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Sub-menu Panel (Google Cloud Console Style)
   Desktop: erscheint rechts neben dem Haupt-Panel
   Mobile:  deckt das Haupt-Panel ab (Overlay)
   =========================== */
.tp-app-switcher-submenu {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 300px;           /* direkt rechts vom 300px Haupt-Panel */
  width: 240px;
  background-color: var(--tp-surface);
  border-right: 1px solid var(--tp-border);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
  z-index: 201;          /* über dem Overlay */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Mobile: Sub-Menü deckt den Haupt-Panel ab */
@media (max-width: 640px) {
  .tp-app-switcher-submenu {
    left: 0;
    width: 100vw;
    max-width: 300px;
  }
}

.tp-app-switcher-submenu-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--tp-border);
  flex-shrink: 0;
}

.tp-app-switcher-submenu-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tp-text-secondary);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.tp-app-switcher-submenu-back:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

.tp-app-switcher-submenu-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tp-text);
}

.tp-app-switcher-submenu-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.tp-app-switcher-submenu-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  text-decoration: none;
  transition: background-color 0.1s;
  cursor: pointer;
}

.tp-app-switcher-submenu-item:hover {
  background-color: var(--tp-hover-bg);
}

.tp-app-switcher-submenu-item.active {
  color: var(--tp-accent);
  font-weight: 500;
}

/* ===========================
   Footer
   =========================== */
.tp-app-switcher-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--tp-border);
  flex-shrink: 0;
}

.tp-app-switcher-footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--tp-text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}

.tp-app-switcher-footer-link:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

/* ===========================
   ConsoleHub Shell Placeholder
   Verhindert FOUC (Flash of Unstyled Content) wenn Topbar via HTMX geladen wird.
   Nutzung in Services:
     <div id="consolehub-root"
          class="ch-topbar-placeholder"
          hx-get="/consolehub/ui/fragments/topbar"
          hx-trigger="load"
          hx-swap="innerHTML">
     </div>
   =========================== */
.ch-topbar-placeholder {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5rem;
  background: var(--tp-nav-bg, #1a1a1a);
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

.ch-topbar-placeholder::before {
  content: '';
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.ch-topbar-placeholder::after {
  content: '';
  width: 7rem;
  height: 0.875rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}
/**
 * TP Design System - Auth Card Component
 * Login/Register card with gradient background
 *
 * Usage:
 *   <div class="tp-auth-page">
 *     <div class="tp-auth-card">
 *       <div class="tp-auth-card-header">...</div>
 *       <div class="tp-auth-card-body">...</div>
 *       <div class="tp-auth-card-footer">...</div>
 *     </div>
 *   </div>
 */

/* ===========================
   Auth Page Background
   =========================== */
.tp-auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Animated gradient background */
.tp-auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.tp-auth-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(-45deg, #0080c8, #0b549c, #18cf72, #0080c8);
  background-size: 300% 300%;
  animation: tp-auth-gradient-shift 20s ease infinite;
}

.tp-auth-bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

@keyframes tp-auth-gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===========================
   Auth Card
   =========================== */
.tp-auth-card {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}


/* Header with logo and title */
.tp-auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tp-auth-card-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.tp-auth-card-subtitle {
  color: #6b7280;
  font-size: 1rem;
}

/* Body */
.tp-auth-card-body {
  margin-bottom: 1.5rem;
}

/* Footer with links */
.tp-auth-card-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.tp-auth-card-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.tp-auth-card-footer-link {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.tp-auth-card-footer-link:hover {
  color: #2563eb;
}

/* ===========================
   Logo Box
   =========================== */
.tp-auth-logo {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.tp-auth-logo-box {
  width: 80px;
  height: 80px;
  background-color: var(--tp-primary, #1d4b8e);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 32px rgba(29, 75, 142, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.tp-auth-logo-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: tp-auth-logo-shine 3s infinite;
}

@keyframes tp-auth-logo-shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.tp-auth-logo-box img,
.tp-auth-logo-box svg {
  width: 48px;
  height: 48px;
  position: relative;
  z-index: 1;
}

.tp-auth-logo-box svg {
  fill: white;
}

/* ===========================
   OAuth Button
   =========================== */
.tp-auth-oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(to right, #1d4b8e, #0b549c);
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px 0 rgba(29, 75, 142, 0.39);
  position: relative;
  overflow: hidden;
}

.tp-auth-oauth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(29, 75, 142, 0.3), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.tp-auth-oauth-btn:active {
  transform: translateY(0);
}

.tp-auth-oauth-btn svg,
.tp-auth-oauth-btn i {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.tp-auth-oauth-hint {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Loading state */
.tp-auth-oauth-btn.tp-auth-loading {
  pointer-events: none;
}

.tp-auth-oauth-btn .tp-auth-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: tp-auth-spin 1s ease-in-out infinite;
}

@keyframes tp-auth-spin {
  to { transform: rotate(360deg); }
}

/* ===========================
   Error Message
   =========================== */
.tp-auth-error {
  background-color: #fee2e2;
  border: 1px solid #f87171;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-auth-error i {
  flex-shrink: 0;
}

/* ===========================
   Form Variant (for email/password)
   =========================== */
.tp-auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: #9ca3af;
  font-size: 0.875rem;
}

.tp-auth-divider::before,
.tp-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: #e5e7eb;
}

/* ===========================
   Dark Mode
   =========================== */
[data-theme="dark"] .tp-auth-card {
  background: rgba(31, 41, 55, 0.95);
  border-color: rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] .tp-auth-card-title {
  color: #f9fafb;
}

[data-theme="dark"] .tp-auth-card-subtitle {
  color: #9ca3af;
}

[data-theme="dark"] .tp-auth-card-footer {
  border-top-color: #374151;
}

[data-theme="dark"] .tp-auth-card-footer-link {
  color: #9ca3af;
}

[data-theme="dark"] .tp-auth-card-footer-link:hover {
  color: #60a5fa;
}

[data-theme="dark"] .tp-auth-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #dc2626;
  color: #fca5a5;
}

[data-theme="dark"] .tp-auth-divider {
  color: #6b7280;
}

[data-theme="dark"] .tp-auth-divider::before,
[data-theme="dark"] .tp-auth-divider::after {
  background-color: #374151;
}
/**
 * TP Design System - Avatar Component
 * DaisyUI-inspired avatar with Tailwind width classes for sizing
 *
 * Usage:
 *   <!-- Avatar with initials -->
 *   <div class="tp-avatar w-10 rounded-full bg-blue-600">
 *     <span>KS</span>
 *   </div>
 *
 *   <!-- Avatar with image -->
 *   <div class="tp-avatar w-12 rounded-full">
 *     <img src="..." alt="Avatar">
 *   </div>
 *
 *   <!-- Placeholder avatar -->
 *   <div class="tp-avatar tp-avatar-placeholder w-10 rounded-full">
 *     <i class="fas fa-user"></i>
 *   </div>
 *
 * Sizes (use Tailwind width classes):
 *   w-6  (1.5rem / 24px) - extra small
 *   w-8  (2rem / 32px)   - small
 *   w-10 (2.5rem / 40px) - medium (default)
 *   w-12 (3rem / 48px)   - large
 *   w-16 (4rem / 64px)   - extra large
 *   w-20 (5rem / 80px)   - 2x large
 */

/* ===========================
   Base Avatar
   =========================== */
.tp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  background-color: var(--tp-primary);
  color: white;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  text-transform: uppercase;
  user-select: none;
  border-radius: 50%;
}

.tp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Auto-scale font size based on container */
.tp-avatar span,
.tp-avatar i {
  font-size: 0.4em;
  line-height: 1;
}

/* Specific font sizes for width classes */
.tp-avatar.w-6 span,
.tp-avatar.w-6 i { font-size: 0.625rem; }

.tp-avatar.w-8 span,
.tp-avatar.w-8 i { font-size: 0.75rem; }

.tp-avatar.w-10 span,
.tp-avatar.w-10 i { font-size: 0.875rem; }

.tp-avatar.w-12 span,
.tp-avatar.w-12 i { font-size: 1rem; }

.tp-avatar.w-16 span,
.tp-avatar.w-16 i { font-size: 1.25rem; }

.tp-avatar.w-20 span,
.tp-avatar.w-20 i { font-size: 1.5rem; }

/* ===========================
   Avatar Variants
   =========================== */

/* Placeholder (icon or empty) */
.tp-avatar-placeholder {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
}

/* Online/Offline indicators - need overflow visible to show indicator */
.tp-avatar-online,
.tp-avatar-offline,
.tp-avatar-busy,
.tp-avatar-away {
  overflow: visible;
}

.tp-avatar-online::after,
.tp-avatar-offline::after,
.tp-avatar-busy::after,
.tp-avatar-away::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 25%;
  height: 25%;
  min-width: 0.5rem;
  min-height: 0.5rem;
  border-radius: 50%;
  border: 2px solid var(--tp-surface);
  z-index: 1;
}

.tp-avatar-online::after {
  background-color: #22c55e;
}

.tp-avatar-offline::after {
  background-color: #6b7280;
}

.tp-avatar-busy::after {
  background-color: #ef4444;
}

.tp-avatar-away::after {
  background-color: #f59e0b;
}

/* Ring/border variant */
.tp-avatar-ring {
  box-shadow: 0 0 0 2px var(--tp-surface), 0 0 0 4px var(--tp-accent);
}

/* ===========================
   Avatar Group
   =========================== */
.tp-avatar-group {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.tp-avatar-group .tp-avatar {
  border: 2px solid var(--tp-surface);
  margin-left: -0.5rem;
}

.tp-avatar-group .tp-avatar:last-child {
  margin-left: 0;
}

/* Avatar group count (+N) */
.tp-avatar-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
  font-weight: 500;
}

/* ===========================
   Avatar Sizes (convenience classes)
   =========================== */
.tp-avatar-xs {
  width: 1.5rem;
  height: 1.5rem;
}
.tp-avatar-xs span,
.tp-avatar-xs i { font-size: 0.5rem; }

.tp-avatar-sm {
  width: 2rem;
  height: 2rem;
}
.tp-avatar-sm span,
.tp-avatar-sm i { font-size: 0.625rem; }

.tp-avatar-md {
  width: 2.5rem;
  height: 2.5rem;
}
.tp-avatar-md span,
.tp-avatar-md i { font-size: 0.75rem; }

.tp-avatar-lg {
  width: 3rem;
  height: 3rem;
}
.tp-avatar-lg span,
.tp-avatar-lg i { font-size: 0.875rem; }

.tp-avatar-xl {
  width: 4rem;
  height: 4rem;
}
.tp-avatar-xl span,
.tp-avatar-xl i { font-size: 1.125rem; }

/* ===========================
   Avatar Colors (presets)
   =========================== */
.tp-avatar-primary { background-color: var(--tp-primary); }
.tp-avatar-success { background-color: #16a34a; }
.tp-avatar-danger { background-color: #dc2626; }
.tp-avatar-warning { background-color: #ca8a04; }
.tp-avatar-info { background-color: #2563eb; }
.tp-avatar-blue { background-color: #2563eb; }
.tp-avatar-green { background-color: #16a34a; }
.tp-avatar-red { background-color: #dc2626; }
.tp-avatar-yellow { background-color: #ca8a04; }
.tp-avatar-purple { background-color: #9333ea; }
.tp-avatar-pink { background-color: #db2777; }
.tp-avatar-indigo { background-color: #4f46e5; }
.tp-avatar-gray { background-color: #6b7280; }

/* ===========================
   Hover Effect (optional)
   =========================== */
.tp-avatar-hover:hover {
  transform: scale(1.05);
  transition: transform 0.1s ease;
}
/**
 * TP Design System - Breadcrumb trail (form back path)
 * Note: existing breadcrumb.css covers admin header crumbs
 */

.tp-crumb-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
}

.tp-crumb-trail a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--tp-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.tp-crumb-trail a:hover {
  color: var(--tp-text);
}

.tp-crumb-trail-sep {
  font-size: 0.65rem;
  color: var(--tp-border);
}

.tp-crumb-trail-current {
  color: var(--tp-text-secondary);
}
/**
 * TP Design System - Breadcrumb Component
 * Navigation breadcrumb trail
 *
 * Usage (with items - chevron separator auto-generated):
 *   <nav class="tp-breadcrumb">
 *     <span class="tp-breadcrumb-item"><a href="/">Home</a></span>
 *     <span class="tp-breadcrumb-item"><a href="/projects">Projekte</a></span>
 *     <span class="tp-breadcrumb-item">Issue #123</span>
 *   </nav>
 *
 * Usage (manual separators):
 *   <nav class="tp-breadcrumb">
 *     <a href="/" class="tp-breadcrumb-link">Home</a>
 *     <span class="tp-breadcrumb-separator">/</span>
 *     <span class="tp-breadcrumb-current">Issue #123</span>
 *   </nav>
 *
 * Variants: tp-breadcrumb-sm, tp-breadcrumb-lg, tp-breadcrumb-slash
 * Default separator: chevron (>)
 */

/* ===========================
   Breadcrumb Container
   =========================== */
.tp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ===========================
   Breadcrumb Link
   =========================== */
.tp-breadcrumb-link {
  color: var(--tp-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.tp-breadcrumb-link:hover {
  color: var(--tp-text);
  text-decoration: underline;
}

.tp-breadcrumb-link:focus {
  outline: none;
}

.tp-breadcrumb-link:focus-visible {
  outline: 2px solid var(--tp-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Link with icon */
.tp-breadcrumb-link-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.tp-breadcrumb-link-icon i {
  font-size: 0.75em;
}

/* ===========================
   Breadcrumb Separator
   =========================== */
.tp-breadcrumb-separator {
  color: var(--tp-text-secondary);
  opacity: 0.5;
  user-select: none;
}

/* Chevron separator */
.tp-breadcrumb-separator-chevron::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.5;
}

/* Arrow separator */
.tp-breadcrumb-separator-arrow::before {
  content: '>';
}

/* ===========================
   Breadcrumb Current (Active)
   =========================== */
.tp-breadcrumb-current {
  color: var(--tp-text);
  font-weight: 500;
  white-space: nowrap;
}

/* Truncate long current page */
.tp-breadcrumb-current-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   Breadcrumb Sizes
   =========================== */
.tp-breadcrumb-sm {
  font-size: 0.75rem;
  gap: 0.375rem;
}

.tp-breadcrumb-lg {
  font-size: 1rem;
  gap: 0.625rem;
}

/* ===========================
   Breadcrumb in Container
   =========================== */
.tp-breadcrumb-bar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: var(--tp-surface);
  border-bottom: 1px solid var(--tp-border);
}

.tp-breadcrumb-bar .tp-breadcrumb {
  flex: 1;
  min-width: 0;
}

/* ===========================
   Breadcrumb with Actions
   =========================== */
.tp-breadcrumb-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tp-breadcrumb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ===========================
   Collapsed Breadcrumb (Mobile)
   =========================== */
.tp-breadcrumb-collapsed {
  position: relative;
}

.tp-breadcrumb-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--tp-text-secondary);
  background: none;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

.tp-breadcrumb-ellipsis:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-breadcrumb-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 10rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tp-breadcrumb-dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  text-decoration: none;
  transition: background-color 0.1s ease;
}

.tp-breadcrumb-dropdown-item:hover {
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
  .tp-breadcrumb-responsive .tp-breadcrumb-link:not(:first-child):not(:last-child) {
    display: none;
  }

  .tp-breadcrumb-responsive .tp-breadcrumb-separator:not(:first-of-type):not(:last-of-type) {
    display: none;
  }

  /* Show ellipsis instead */
  .tp-breadcrumb-responsive .tp-breadcrumb-mobile-ellipsis {
    display: inline;
  }
}

.tp-breadcrumb-mobile-ellipsis {
  display: none;
}

/* ===========================
   Breadcrumb Item (Alternative Structure)
   =========================== */
.tp-breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.tp-breadcrumb-item:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  margin: 0 0.5rem;
  border-right: 1.5px solid var(--tp-text-secondary);
  border-top: 1.5px solid var(--tp-text-secondary);
  transform: rotate(45deg);
  opacity: 0.6;
}

/* Slash separator variant */
.tp-breadcrumb-slash .tp-breadcrumb-item:not(:last-child)::after {
  content: '/';
  display: inline;
  width: auto;
  height: auto;
  border: none;
  transform: none;
  font-size: 1em;
  opacity: 0.5;
}

.tp-breadcrumb-item:last-child {
  color: var(--tp-text);
  font-weight: 500;
}

.tp-breadcrumb-item:last-child a {
  color: inherit;
  pointer-events: none;
}
/**
 * TP Design System - Button Components
 * DaisyUI-style button classes
 *
 * Usage:
 *   <button class="tp-btn tp-btn-primary">Primary</button>
 *   <button class="tp-btn tp-btn-secondary">Secondary</button>
 */

/* ===========================
   Base Button
   =========================== */
.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  min-height: 2.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.tp-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.3);
}

.tp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===========================
   Button Variants
   =========================== */

/* Primary - Main action button */
.tp-btn-primary {
  background-color: var(--tp-primary);
  border-color: var(--tp-primary);
  color: white;
}

.tp-btn-primary:hover:not(:disabled) {
  background-color: var(--tp-primary-hover);
  border-color: var(--tp-primary-hover);
}

.tp-btn-primary:active:not(:disabled) {
  background-color: #1e3a5f;
}

/* Secondary - Outline button */
.tp-btn-secondary {
  background-color: var(--tp-surface);
  border-color: var(--tp-border);
  color: var(--tp-text);
}

.tp-btn-secondary:hover:not(:disabled) {
  background-color: var(--tp-hover-bg);
  border-color: var(--tp-text-secondary);
}

.tp-btn-secondary:active:not(:disabled) {
  background-color: var(--tp-border);
}

/* Ghost - Text-only button */
.tp-btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--tp-text-secondary);
}

.tp-btn-ghost:hover:not(:disabled) {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-btn-ghost:active:not(:disabled) {
  background-color: var(--tp-border);
}

/* Danger - Destructive action */
.tp-btn-danger {
  background-color: #dc2626;
  border-color: #dc2626;
  color: white;
}

.tp-btn-danger:hover:not(:disabled) {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

.tp-btn-danger:active:not(:disabled) {
  background-color: #991b1b;
}

/* Danger Outline */
.tp-btn-danger-outline {
  background-color: transparent;
  border-color: #dc2626;
  color: #dc2626;
}

.tp-btn-danger-outline:hover:not(:disabled) {
  background-color: #dc2626;
  color: white;
}

/* Success - Positive action (create, confirm) */
.tp-btn-success {
  background-color: #16a34a;
  border-color: #16a34a;
  color: white;
}

.tp-btn-success:hover:not(:disabled) {
  background-color: #15803d;
  border-color: #15803d;
}

.tp-btn-success:active:not(:disabled) {
  background-color: #166534;
}

/* Icon-only button */
.tp-btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  background-color: transparent;
  border-color: transparent;
  color: var(--tp-text-secondary);
}

.tp-btn-icon:hover:not(:disabled) {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

/* ===========================
   Button Sizes
   =========================== */
.tp-btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.tp-btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
}

.tp-btn-icon.tp-btn-sm {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.25rem;
}

.tp-btn-icon.tp-btn-lg {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.75rem;
}

/* ===========================
   Button with Loading
   =========================== */
.tp-btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.tp-btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tp-btn-spin 0.6s linear infinite;
}

.tp-btn-primary.tp-btn-loading::after {
  border-color: white;
  border-right-color: transparent;
}

@keyframes tp-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===========================
   Button Group
   =========================== */
.tp-btn-group {
  display: inline-flex;
}

.tp-btn-group .tp-btn {
  border-radius: 0;
}

.tp-btn-group .tp-btn:first-child {
  border-radius: 0.375rem 0 0 0.375rem;
}

.tp-btn-group .tp-btn:last-child {
  border-radius: 0 0.375rem 0.375rem 0;
}

.tp-btn-group .tp-btn:not(:last-child) {
  border-right-width: 0;
}

.tp-btn-group .tp-btn:hover,
.tp-btn-group .tp-btn:focus {
  z-index: 1;
}
/**
 * TP Design System - Card Components
 * Reusable card system for comments, issues, and content blocks
 *
 * Components:
 *   - tp-icon-btn: Small icon-only button
 *   - tp-user-meta: Avatar + Name + Time
 *   - tp-card: Base card container
 *   - tp-card-header: Card header with user meta and actions
 *   - tp-comment-card: Specialized card for comments
 */

/* ===========================
   Icon Button
   =========================== */
.tp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  background-color: transparent;
  border: 1px solid var(--tp-border);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tp-icon-btn:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-icon-btn:active {
  background-color: var(--tp-border);
}

.tp-icon-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}

/* Icon button sizes */
.tp-icon-btn-sm {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.625rem;
}

.tp-icon-btn-lg {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

/* Icon button variants */
.tp-icon-btn-ghost {
  border-color: transparent;
}

.tp-icon-btn-ghost:hover {
  border-color: var(--tp-border);
}

/* ===========================
   User Meta (Avatar + Name + Time)
   =========================== */
.tp-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.tp-user-meta-avatar {
  flex-shrink: 0;
}

.tp-user-meta-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 0.875rem;
}

.tp-user-meta-name {
  font-weight: 600;
  color: var(--tp-text);
  white-space: nowrap;
}

.tp-user-meta-time {
  color: var(--tp-text-secondary);
  white-space: nowrap;
}

.tp-user-meta-badge {
  margin-left: 0.25rem;
}

/* Compact variant */
.tp-user-meta-compact .tp-user-meta-info {
  font-size: 0.75rem;
}

/* ===========================
   Card Base
   =========================== */
.tp-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Card Header */
.tp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--tp-hover-bg);
  border-bottom: 1px solid var(--tp-border);
}

.tp-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* Card Content */
.tp-card-content {
  padding: 0.75rem;
}

.tp-card-content-sm {
  padding: 0.5rem 0.75rem;
}

.tp-card-content-lg {
  padding: 1rem;
}

/* Card with prose content */
.tp-card-content .prose {
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--tp-text);
}

.tp-card-content .prose p {
  margin-bottom: 0.75rem;
}

.tp-card-content .prose p:last-child {
  margin-bottom: 0;
}

.tp-card-content .prose code {
  padding: 0.125rem 0.375rem;
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: var(--tp-hover-bg);
  border-radius: 0.25rem;
  color: var(--tp-text);
}

.tp-card-content .prose a {
  color: var(--tp-accent);
  text-decoration: none;
}

.tp-card-content .prose a:hover {
  text-decoration: underline;
}

.tp-card-content .prose strong {
  font-weight: 600;
  color: var(--tp-text);
}

.tp-card-content .prose ul,
.tp-card-content .prose ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.tp-card-content .prose li {
  margin-bottom: 0.25rem;
}

/* Card Footer */
.tp-card-footer {
  padding: 0.75rem;
  background-color: var(--tp-hover-bg);
  border-top: 1px solid var(--tp-border);
}

/* Card Sections (for multiple content blocks) */
.tp-card-section {
  border-bottom: 1px solid var(--tp-border);
}

.tp-card-section:last-child {
  border-bottom: none;
}

/* ===========================
   Card Variants
   =========================== */

/* Highlighted card (for author's own comments) */
.tp-card-highlighted {
  border-color: var(--tp-accent);
  border-width: 2px;
}

.tp-card-highlighted .tp-card-header {
  background-color: rgba(29, 78, 216, 0.05);
}

/* Muted card */
.tp-card-muted {
  opacity: 0.7;
}

/* Card without border */
.tp-card-borderless {
  border: none;
  border-radius: 0;
}

/* ===========================
   Comment Card
   =========================== */
.tp-comment-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tp-comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--tp-hover-bg);
  border-bottom: 1px solid var(--tp-border);
  border-radius: 0.5rem 0.5rem 0 0;
}

.tp-comment-card-content {
  padding: 0.625rem 0.75rem;
}

/* Comment card reactions (GitHub style) */
.tp-comment-card-reactions {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--tp-border);
}

.tp-reaction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  background-color: transparent;
  border: 1px solid var(--tp-border);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tp-reaction-btn:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
  border-color: var(--tp-text-secondary);
}

/* Comment card with AI Summary section */
.tp-comment-card .tp-ai-summary {
  margin: 0;
  border-radius: 0;
}

/* ===========================
   Issue Body Card
   =========================== */
.tp-issue-body {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tp-issue-body-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--tp-hover-bg);
  border-bottom: 1px solid var(--tp-border);
}

.tp-issue-body-content {
  padding: 1rem;
}

/* AI Summary inside Issue Body */
.tp-issue-body .tp-ai-summary {
  border-radius: 0;
}

/* ===========================
   Timeline
   =========================== */
.tp-timeline {
  position: relative;
  padding-left: 1.5rem;
}

/* Vertical timeline line */
.tp-timeline::before {
  content: '';
  position: absolute;
  left: 1.1875rem;
  top: 1.25rem;
  bottom: 0;
  width: 2px;
  background-color: var(--tp-border);
}

.tp-timeline-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ===========================
   Timeline Item
   =========================== */
.tp-timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.tp-timeline-item-avatar {
  position: absolute;
  left: -1.5rem;
  width: 2.5rem;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.tp-timeline-item-content {
  flex: 1;
  margin-left: 1.5rem;
}

/* Timeline Event (non-comment item) */
.tp-timeline-event {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
}

.tp-timeline-event-icon {
  position: absolute;
  left: -1.5rem;
  width: 2.5rem;
  display: flex;
  justify-content: center;
}

.tp-timeline-event-icon i {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--tp-surface);
  border: 2px solid var(--tp-border);
  border-radius: 50%;
  font-size: 0.625rem;
  color: var(--tp-text-secondary);
}

.tp-timeline-event-text {
  margin-left: 1.5rem;
}

.tp-timeline-event-text strong {
  font-weight: 500;
  color: var(--tp-text);
}

.tp-timeline-event-time {
  color: var(--tp-text-secondary);
  margin-left: 0.25rem;
}

/* ===========================
   Comment Form
   =========================== */
.tp-comment-form {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tp-comment-form-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--tp-hover-bg);
  border-bottom: 1px solid var(--tp-border);
}

.tp-comment-form-header-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
}

.tp-comment-form-body {
  padding: 1rem;
}

.tp-comment-form-textarea {
  width: 100%;
  min-height: 6rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--tp-text);
  background-color: var(--tp-input-bg);
  border: 1px solid var(--tp-input-border);
  border-radius: 0.375rem;
  resize: vertical;
}

.tp-comment-form-textarea:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}

.tp-comment-form-textarea::placeholder {
  color: var(--tp-text-secondary);
}

.tp-comment-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--tp-hover-bg);
  border-top: 1px solid var(--tp-border);
}

.tp-comment-form-hint {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

.tp-comment-form-hint kbd {
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.25rem;
  color: var(--tp-text-secondary);
}

.tp-comment-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Comment Form Tabs (GitHub style) */
.tp-comment-form-tabs {
  display: flex;
  gap: 0;
  margin-left: auto;
}

.tp-comment-form-tab {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tp-comment-form-tab:hover {
  color: var(--tp-text);
}

.tp-comment-form-tab.active {
  color: var(--tp-text);
  border-bottom-color: var(--tp-accent);
}

/* Comment Form Toolbar (GitHub style) */
.tp-comment-form-toolbar {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-comment-form-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  background-color: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tp-comment-form-toolbar-btn:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-comment-form-toolbar-divider {
  width: 1px;
  height: 1rem;
  margin: 0 0.25rem;
  background-color: var(--tp-border);
}

/* Comment Form File Hint (GitHub style) */
.tp-comment-form-file-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  border-top: 1px solid var(--tp-border);
  cursor: pointer;
}

.tp-comment-form-file-hint:hover {
  color: var(--tp-text);
}

.tp-comment-form-file-hint i {
  font-size: 0.875rem;
}

/**
 * TP Design System - Comment Form Component
 * GitHub-style markdown comment editor
 *
 * Usage:
 *   <div class="tp-comment-form">
 *     <div class="tp-comment-form-header">
 *       <div class="tp-comment-form-tabs">...</div>
 *       <div class="tp-comment-form-toolbar">...</div>
 *     </div>
 *     <div class="tp-comment-form-body">
 *       <textarea class="tp-comment-form-textarea">...</textarea>
 *     </div>
 *     <div class="tp-comment-form-footer">...</div>
 *   </div>
 */

/* ===========================
   Comment Form Container
   =========================== */
.tp-comment-form {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

/* ===========================
   Comment Form Header
   =========================== */
.tp-comment-form-header {
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: var(--tp-hover-bg);
}

.tp-comment-form-header-title {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text-secondary);
  border-bottom: 1px solid var(--tp-border);
}

/* Header row with tabs and optional actions */
.tp-comment-form-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tp-border);
}

/* ===========================
   Comment Form Tabs
   =========================== */
.tp-comment-form-tabs {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-comment-form-tab {
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.tp-comment-form-tab:hover {
  color: var(--tp-text);
}

.tp-comment-form-tab.active {
  color: var(--tp-text);
  border-bottom-color: var(--tp-accent);
}

/* ===========================
   Comment Form Toolbar
   =========================== */
.tp-comment-form-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.125rem;
  padding: 0.375rem 0.5rem;
  flex-wrap: wrap;
}

.tp-comment-form-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  background: none;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tp-comment-form-toolbar-btn:hover {
  color: var(--tp-text);
  background-color: var(--tp-surface);
}

.tp-comment-form-toolbar-btn:focus {
  outline: none;
}

.tp-comment-form-toolbar-btn:focus-visible {
  outline: 2px solid var(--tp-accent);
  outline-offset: -2px;
}

.tp-comment-form-toolbar-divider {
  width: 1px;
  height: 1rem;
  background-color: var(--tp-border);
  margin: 0 0.25rem;
}

/* ===========================
   Comment Form Body
   =========================== */
.tp-comment-form-body {
  padding: 0;
}

.tp-comment-form-textarea {
  width: 100%;
  min-height: 8rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--tp-text);
  background-color: var(--tp-input-bg);
  border: none;
  resize: vertical;
}

.tp-comment-form-textarea::placeholder {
  color: var(--tp-text-secondary);
}

.tp-comment-form-textarea:focus {
  outline: none;
}

/* ===========================
   Comment Form Preview
   =========================== */
.tp-comment-form-preview {
  min-height: 8rem;
  padding: 0.75rem;
  background-color: var(--tp-input-bg);
}

.tp-comment-form-preview-empty {
  color: var(--tp-text-secondary);
  font-style: italic;
}

/* ===========================
   Comment Form File Hint
   =========================== */
.tp-comment-form-file-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  background-color: var(--tp-hover-bg);
  border-top: 1px solid var(--tp-border);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tp-comment-form-file-hint:hover {
  background-color: var(--tp-border);
}

.tp-comment-form-file-hint i {
  font-size: 0.875rem;
}

/* ===========================
   Comment Form Footer
   =========================== */
.tp-comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--tp-hover-bg);
  border-top: 1px solid var(--tp-border);
}

.tp-comment-form-hint {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

.tp-comment-form-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-family: inherit;
  color: var(--tp-text-secondary);
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.25rem;
  box-shadow: 0 1px 0 var(--tp-border);
}

.tp-comment-form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===========================
   Comment Form Variants
   =========================== */

/* Compact form (less padding) */
.tp-comment-form-compact .tp-comment-form-textarea {
  min-height: 5rem;
  padding: 0.5rem;
}

.tp-comment-form-compact .tp-comment-form-footer {
  padding: 0.5rem;
}

/* Inline form (no border) */
.tp-comment-form-inline {
  border: none;
  border-radius: 0;
  background: transparent;
}

.tp-comment-form-inline .tp-comment-form-header,
.tp-comment-form-inline .tp-comment-form-footer {
  background: transparent;
}

/* Form with avatar */
.tp-comment-form-with-avatar {
  display: flex;
  gap: 0.75rem;
}

.tp-comment-form-avatar {
  flex-shrink: 0;
}

.tp-comment-form-with-avatar .tp-comment-form {
  flex: 1;
}

/* ===========================
   Comment Form States
   =========================== */

/* Disabled state */
.tp-comment-form-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Loading state */
.tp-comment-form-loading .tp-comment-form-textarea {
  opacity: 0.5;
}

.tp-comment-form-loading .tp-comment-form-actions button {
  pointer-events: none;
}

/* Error state */
.tp-comment-form-error {
  border-color: #ef4444;
}

.tp-comment-form-error-message {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
  border-top: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===========================
   Drag & Drop Zone
   =========================== */
.tp-comment-form-dropzone {
  border: 2px dashed var(--tp-border);
  border-radius: 0.375rem;
  transition: all 0.15s ease;
}

.tp-comment-form-dropzone.dragover {
  border-color: var(--tp-accent);
  background-color: rgba(29, 75, 142, 0.05);
}

/* ===========================
   Mention Autocomplete
   =========================== */
.tp-comment-form-mention-dropdown {
  position: absolute;
  z-index: 100;
  min-width: 12rem;
  max-height: 16rem;
  overflow-y: auto;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tp-comment-form-mention-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.tp-comment-form-mention-item:hover,
.tp-comment-form-mention-item.selected {
  background-color: var(--tp-hover-bg);
}

.tp-comment-form-mention-item-name {
  font-weight: 500;
}

.tp-comment-form-mention-item-username {
  color: var(--tp-text-secondary);
  font-size: 0.75rem;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
  .tp-comment-form-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .tp-comment-form-hint {
    display: none;
  }

  .tp-comment-form-actions {
    flex-direction: column;
  }

  .tp-comment-form-actions button {
    width: 100%;
    justify-content: center;
  }
}
/**
 * TP Design System - Components
 * Extracted 1:1 from IssueHub (crates/issuehub-web/src/app.css)
 */

/* ===========================
   Base Styles
   =========================== */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[x-cloak] {
  display: none !important;
}

/* ===========================
   Badge Component
   =========================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background-color: var(--tp-badge-success-bg); color: var(--tp-badge-success-text); }
.badge-warning { background-color: var(--tp-badge-warning-bg); color: var(--tp-badge-warning-text); }
.badge-danger { background-color: var(--tp-badge-danger-bg); color: var(--tp-badge-danger-text); }
.badge-info { background-color: var(--tp-badge-info-bg); color: var(--tp-badge-info-text); }
.badge-gray { background-color: var(--tp-badge-gray-bg); color: var(--tp-badge-gray-text); }

/* Status badges for issues */
.status-open { background-color: var(--tp-badge-success-bg); color: var(--tp-badge-success-text); }
.status-in_progress { background-color: var(--tp-badge-info-bg); color: var(--tp-badge-info-text); }
.status-resolved { background-color: var(--tp-badge-warning-bg); color: var(--tp-badge-warning-text); }
.status-closed { background-color: var(--tp-badge-gray-bg); color: var(--tp-badge-gray-text); }

/* Priority badges */
.priority-low { background-color: var(--tp-badge-gray-bg); color: var(--tp-badge-gray-text); }
.priority-medium { background-color: var(--tp-badge-info-bg); color: var(--tp-badge-info-text); }
.priority-high { background-color: var(--tp-badge-warning-bg); color: var(--tp-badge-warning-text); }
.priority-critical { background-color: var(--tp-badge-danger-bg); color: var(--tp-badge-danger-text); }

/* Issue Labels */
.issue-label {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  border-width: 1px;
  background-color: color-mix(in srgb, var(--label-color) 18%, transparent);
  color: color-mix(in srgb, var(--label-color) 55%, black);
  border-color: color-mix(in srgb, var(--label-color) 40%, transparent);
}

[data-theme="dark"] .issue-label {
  background-color: var(--label-color);
  color: var(--label-text-color, white);
  border-color: transparent;
}

/* ===========================
   Button Components
   =========================== */
.btn-primary {
  font-weight: 500;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  background-color: var(--tp-primary);
  color: white;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  display: inline-flex;
  align-items: center;
}

.btn-primary:hover {
  background-color: var(--tp-primary-hover);
}

.btn-secondary {
  font-weight: 500;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  background-color: var(--tp-secondary);
  color: white;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover {
  opacity: 0.9;
}

.btn-danger {
  font-weight: 500;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  background-color: var(--tp-danger);
  color: white;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  display: inline-flex;
  align-items: center;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-outline {
  font-weight: 500;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  background-color: transparent;
  border: 1px solid var(--tp-border);
  color: var(--tp-text);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  display: inline-flex;
  align-items: center;
}

.btn-outline:hover {
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Form Components
   =========================== */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--tp-input-border);
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-size: 0.875rem;
  background-color: var(--tp-input-bg);
  color: var(--tp-text);
}

.form-input:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 2px var(--tp-focus-ring);
}

.form-input::placeholder {
  color: var(--tp-text-secondary);
}

.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--tp-input-border);
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-size: 0.875rem;
  background-color: var(--tp-input-bg);
  color: var(--tp-text);
}

.form-select:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 2px var(--tp-focus-ring);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  margin-bottom: 0.25rem;
}

/* ===========================
   Surface / Card
   =========================== */
.tp-surface {
  background-color: var(--tp-surface);
  border-radius: 8px;
  box-shadow: 0 1px 3px var(--tp-card-shadow), 0 1px 2px var(--tp-card-shadow);
  border: 1px solid var(--tp-card-border);
}

/* ===========================
   Layout Components
   =========================== */
.tp-topbar {
  background-color: var(--tp-nav-bg);
  border-bottom: 1px solid var(--tp-border);
  height: 56px;
}

.tp-topbar-icon {
  color: #b3b3b3;
  transition: color 0.2s ease;
}

.tp-topbar-icon:hover {
  color: white;
}

.tp-sidebar {
  background-color: var(--tp-sidebar-bg);
  border-right: 1px solid var(--tp-border);
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  border-radius: 6px;
  margin: 2px 8px;
  color: var(--tp-text);
}

.sidebar-link:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.sidebar-link.active {
  background-color: var(--tp-primary);
  color: white;
  font-weight: 500;
}

/* Logo */
.tp-logo {
  background: linear-gradient(135deg, #1d4b8e 0%, #0b549c 100%);
  box-shadow: 0 8px 16px rgba(29, 75, 142, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.tp-logo svg {
  fill: white;
  position: relative;
  z-index: 10;
}

.tp-logo-shine {
  position: relative;
}

.tp-logo-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: rotate(45deg);
  animation: logoShine 4s infinite;
}

@keyframes logoShine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ===========================
   GitHub-style Markdown (Prose)
   =========================== */
.prose {
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  color: var(--tp-prose-text);
  overflow-wrap: break-word;
}

.prose > *:first-child {
  margin-top: 0 !important;
}

.prose > *:last-child {
  margin-bottom: 0 !important;
}

/* Headings */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--tp-prose-heading);
}

.prose h1 {
  font-size: 2em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--tp-prose-border);
}

.prose h2 {
  font-size: 1.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--tp-prose-border);
}

.prose h3 { font-size: 1.25em; }
.prose h4 { font-size: 1em; }
.prose h5 { font-size: 0.875em; }
.prose h6 { font-size: 0.85em; color: var(--tp-prose-muted); }

/* Paragraphs */
.prose p {
  margin-top: 0;
  margin-bottom: 16px;
}

/* Links */
.prose a {
  color: var(--tp-prose-link);
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

/* Bold & Italic */
.prose strong {
  font-weight: 600;
  color: var(--tp-prose-heading);
}

.prose em {
  font-style: italic;
}

/* Lists */
.prose ul, .prose ol {
  margin-top: 0;
  margin-bottom: 16px;
  padding-left: 2em;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-top: 4px;
}

.prose li + li {
  margin-top: 4px;
}

/* Code - Inline */
.prose code {
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  white-space: break-spaces;
  background-color: var(--tp-prose-code-bg);
  border-radius: 6px;
  color: var(--tp-prose-text);
}

/* Code - Block */
.prose pre {
  margin-top: 0;
  margin-bottom: 16px;
  padding: 16px;
  overflow-x: auto;
  font-size: 85%;
  line-height: 1.45;
  color: var(--tp-prose-text);
  background-color: var(--tp-prose-pre-bg);
  border-radius: 6px;
  border: 1px solid var(--tp-prose-border);
  max-width: 100%;
}

.prose pre code {
  padding: 0;
  margin: 0;
  font-size: 100%;
  word-break: normal;
  white-space: pre;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* Blockquotes */
.prose blockquote {
  margin: 0 0 16px 0;
  padding: 0 1em;
  color: var(--tp-prose-muted);
  border-left: 4px solid var(--tp-prose-border);
}

/* Tables */
.prose table {
  width: 100%;
  margin-top: 0;
  margin-bottom: 16px;
  border-spacing: 0;
  border-collapse: collapse;
  overflow: auto;
  display: block;
}

.prose table th {
  font-weight: 600;
  padding: 6px 13px;
  border: 1px solid var(--tp-prose-border);
  background-color: var(--tp-prose-table-alt-bg);
  color: var(--tp-prose-heading);
}

.prose table td {
  padding: 6px 13px;
  border: 1px solid var(--tp-prose-border);
  color: var(--tp-prose-text);
}

.prose table tr {
  background-color: var(--tp-prose-table-bg);
  border-top: 1px solid var(--tp-prose-border);
}

.prose table tr:nth-child(2n) {
  background-color: var(--tp-prose-table-alt-bg);
}

/* Images */
.prose img {
  max-width: 100%;
  box-sizing: content-box;
  border-radius: 6px;
}

/* Horizontal Rules */
.prose hr {
  height: 0.25em;
  padding: 0;
  margin: 24px 0;
  background-color: var(--tp-prose-border);
  border: 0;
}

/* Mentions */
.prose .mention {
  background-color: var(--tp-prose-mention-bg);
  color: var(--tp-prose-link);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 500;
}

/* ===========================
   Animations
   =========================== */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.3s ease-out; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Data Table
   =========================== */
.data-table {
  width: 100%;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--tp-text-secondary);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tp-table-border);
  background-color: var(--tp-table-header-bg);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tp-table-border-light);
  color: var(--tp-text);
}

.data-table tr:hover td {
  background-color: var(--tp-table-row-hover);
}

/* ===========================
   Notification
   =========================== */
.notification {
  background-color: var(--tp-surface);
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px var(--tp-card-shadow), 0 4px 6px -2px var(--tp-card-shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 4px solid;
  padding: 16px 20px;
  min-width: 300px;
  pointer-events: auto;
  animation: slideUp 0.3s ease-out;
  color: var(--tp-text);
}

.notification.success { border-left-color: var(--tp-success); }
.notification.error { border-left-color: var(--tp-danger); }
.notification.info { border-left-color: var(--tp-info); }
.notification.warning { border-left-color: var(--tp-warning); }

/* ===========================
   Empty State
   =========================== */
.empty-state {
  text-align: center;
  padding: 3rem 0;
  color: var(--tp-text-secondary);
}

.empty-state-icon {
  font-size: 2.25rem;
  color: var(--tp-border);
  margin-bottom: 1rem;
}
/**
 * DataTable Skeleton — Initial-Load-State für admin-table-Cells, die via
 * HTMX-Fragment nachgeladen werden.
 *
 * Ersetzt den heutigen `consolehub-layout::skeleton_card()` (zwei graue
 * Linien) durch eine Tabelle-shaped Vorschau mit Shimmer-Animation.
 *
 * Markup-Erwartung (vom consolehub-layout-Renderer ausgegeben — siehe
 * Storybook `V1/Components/DataTableSkeleton`):
 *
 *   <div class="tp-data-table-card tp-table-skeleton-card …">
 *     <table>
 *       <thead>…echte Header…</thead>
 *       <tbody>
 *         <tr><td><span class="tp-table-skeleton-bar"></span></td>…</tr>
 *         …
 *       </tbody>
 *     </table>
 *   </div>
 *
 * Die Header sind ECHT (nicht skeletoniert) — sie machen den Skeleton
 * informativer als "5 graue Streifen" und vermeiden Layout-Shift wenn die
 * echten Daten ankommen.
 */

.tp-table-skeleton-bar {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--tp-hover-bg, #f3f4f6) 0%,
    var(--tp-border, #e1e1e1) 50%,
    var(--tp-hover-bg, #f3f4f6) 100%
  );
  background-size: 200% 100%;
  border-radius: 0.25rem;
  animation: tp-table-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes tp-table-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Verlangsame Animation bei reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  .tp-table-skeleton-bar {
    animation-duration: 3s;
  }
}
/**
 * TP Design System - Data Table Components
 * Shopify-style data tables for admin interfaces
 *
 * Usage:
 *   <div class="tp-data-table">
 *     <div class="tp-data-table-toolbar">
 *       <div class="tp-data-table-tabs">...</div>
 *       <div class="tp-data-table-actions">...</div>
 *     </div>
 *     <table class="tp-data-table-content">...</table>
 *   </div>
 */

/* ===========================
   Data Table Container
   =========================== */
.tp-data-table {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

/* ===========================
   Toolbar (Tabs + Actions)
   =========================== */
.tp-data-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--tp-border);
  background-color: var(--tp-surface);
  min-height: 3rem;
  gap: 1rem;
}

/* ===========================
   Tabs Navigation
   =========================== */
.tp-data-table-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tp-data-table-tabs::-webkit-scrollbar {
  display: none;
}

.tp-data-table-tab {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tp-data-table-tab:hover {
  color: var(--tp-text);
}

.tp-data-table-tab.active {
  color: var(--tp-text);
  border-bottom-color: var(--tp-text);
}

.tp-data-table-tab-add {
  padding: 0.75rem 0.5rem;
  color: var(--tp-text-secondary);
  transition: color 0.15s ease;
}

.tp-data-table-tab-add:hover {
  color: var(--tp-text);
}

/* ===========================
   Actions (Search, Filter, etc.)
   =========================== */
.tp-data-table-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.tp-data-table-action {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  color: var(--tp-text-secondary);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.tp-data-table-action:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

.tp-data-table-action.active {
  color: var(--tp-accent);
  background-color: rgba(29, 78, 216, 0.1);
}

/* Action button group (grouped icons) */
.tp-data-table-action-group {
  display: flex;
  align-items: center;
  background-color: var(--tp-hover-bg);
  border-radius: 0.375rem;
  padding: 0.125rem;
}

.tp-data-table-action-group .tp-data-table-action {
  background-color: transparent;
}

.tp-data-table-action-group .tp-data-table-action:hover {
  background-color: var(--tp-surface);
}

/* ===========================
   Search Input (Expandable)
   =========================== */
.tp-data-table-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-data-table-search-input {
  width: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--tp-text);
  transition: width 0.2s ease, padding 0.2s ease;
}

.tp-data-table-search-input::placeholder {
  color: var(--tp-text-secondary);
}

.tp-data-table-search.expanded .tp-data-table-search-input {
  width: 12rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--tp-border);
  border-radius: 0.375rem;
  background-color: var(--tp-input-bg);
}

.tp-data-table-search.expanded .tp-data-table-search-input:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}

/* ===========================
   Table Content
   =========================== */
.tp-data-table-content {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

/* Table Header */
.tp-data-table-content thead {
  background-color: var(--tp-hover-bg);
  border-bottom: 1px solid var(--tp-border);
}

.tp-data-table-content th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 500;
  color: var(--tp-text-secondary);
  white-space: nowrap;
  border-bottom: 1px solid var(--tp-border);
}

.tp-data-table-content th.sortable {
  cursor: pointer;
  user-select: none;
}

.tp-data-table-content th.sortable:hover {
  color: var(--tp-text);
}

.tp-data-table-content th .sort-icon {
  margin-left: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tp-data-table-content th.sortable:hover .sort-icon,
.tp-data-table-content th.sorted .sort-icon {
  opacity: 1;
}

.tp-data-table-content th.sorted {
  color: var(--tp-text);
}

/* Table Body */
.tp-data-table-content tbody tr {
  border-bottom: 1px solid var(--tp-border);
  transition: background-color 0.1s ease;
}

.tp-data-table-content tbody tr:last-child {
  border-bottom: none;
}

.tp-data-table-content tbody tr:hover {
  background-color: var(--tp-hover-bg);
}

.tp-data-table-content tbody tr.selected {
  background-color: rgba(29, 78, 216, 0.05);
}

.tp-data-table-content td {
  padding: 0.625rem 0.75rem;
  color: var(--tp-text);
  vertical-align: middle;
}

/* Checkbox Column */
.tp-data-table-content .col-checkbox {
  width: 2.5rem;
  padding-left: 1rem;
  padding-right: 0.5rem;
}

.tp-data-table-checkbox {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--tp-border);
  border-radius: 0.25rem;
  background-color: var(--tp-surface);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tp-data-table-checkbox:hover {
  border-color: var(--tp-text-secondary);
}

.tp-data-table-checkbox:checked {
  background-color: var(--tp-primary);
  border-color: var(--tp-primary);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.tp-data-table-checkbox:indeterminate {
  background-color: var(--tp-primary);
  border-color: var(--tp-primary);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4 8a1 1 0 011-1h6a1 1 0 110 2H5a1 1 0 01-1-1z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

/* Primary Column (e.g., Order ID) */
.tp-data-table-content .col-primary {
  font-weight: 500;
  color: var(--tp-text);
}

.tp-data-table-content .col-primary a {
  color: var(--tp-text);
  transition: color 0.15s ease;
}

.tp-data-table-content .col-primary a:hover {
  color: var(--tp-accent);
}

/* Secondary/Muted Column */
.tp-data-table-content .col-secondary {
  color: var(--tp-text-secondary);
}

/* Numeric Column (right-aligned) */
.tp-data-table-content .col-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Badges are defined once, in v2/components/pill.css (`@tp/ui/badge`).
   This file used to redefine `.tp-badge` and its variants with hex literals;
   being alphabetically later it won over the tokenised definition, so
   .tp-badge-success rendered #16a34a on its own tint — 2.79:1 (D-003), and
   the badge was a 9999px pill in the two hubs that ship data-table.css and a
   4px rectangle in the other 18. Both halves are gone (D-002c). */

/* ===========================
   Empty State
   =========================== */
.tp-data-table-empty {
  padding: 3rem 1.5rem;
  text-align: center;
}

.tp-data-table-empty-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  color: var(--tp-text-secondary);
  opacity: 0.5;
}

.tp-data-table-empty-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--tp-text);
  margin-bottom: 0.25rem;
}

.tp-data-table-empty-description {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
}

/* ===========================
   Pagination
   =========================== */
.tp-data-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--tp-border);
  background-color: var(--tp-surface);
  font-size: 0.875rem;
}

.tp-data-table-pagination-info {
  color: var(--tp-text-secondary);
}

.tp-data-table-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-data-table-pagination-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--tp-border);
  border-radius: 0.375rem;
  background-color: var(--tp-surface);
  color: var(--tp-text);
  font-size: 0.875rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tp-data-table-pagination-btn:hover:not(:disabled) {
  background-color: var(--tp-hover-bg);
  border-color: var(--tp-text-secondary);
}

.tp-data-table-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tp-data-table-pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tp-data-table-pagination-page {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  transition: background-color 0.15s ease;
}

.tp-data-table-pagination-page:hover {
  background-color: var(--tp-hover-bg);
}

.tp-data-table-pagination-page.active {
  background-color: var(--tp-primary);
  color: white;
}

/* ===========================
   Bulk Actions Bar
   =========================== */
.tp-data-table-bulk {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--tp-primary);
  color: white;
}

.tp-data-table-bulk-count {
  font-size: 0.875rem;
  font-weight: 500;
}

.tp-data-table-bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-data-table-bulk-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  transition: background-color 0.15s ease;
}

.tp-data-table-bulk-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.tp-data-table-bulk-cancel {
  margin-left: auto;
  padding: 0.375rem;
  border-radius: 0.375rem;
  color: white;
  opacity: 0.8;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.tp-data-table-bulk-cancel:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.2);
}

/* ===========================
   Aggregate Row (Summary Footer)
   =========================== */

.tp-data-table-content tfoot tr,
.tp-data-table-content tbody tr.tp-agg-row {
  background-color: var(--tp-content-bg, #f3f4f6);
  border-top: 2px solid var(--tp-border, #e1e1e1);
}

.tp-data-table-content tfoot td,
.tp-data-table-content tbody tr.tp-agg-row td {
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tp-text, #202223);
  white-space: nowrap;
  border-bottom: none;
}

.tp-data-table-content tfoot td.agg-numeric,
.tp-data-table-content tbody tr.tp-agg-row td.agg-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tp-data-table-content tfoot td.agg-empty,
.tp-data-table-content tbody tr.tp-agg-row td.agg-empty {
  color: var(--tp-text-secondary, #6d7175);
  font-weight: 400;
}

.tp-data-table-content tfoot td.agg-label,
.tp-data-table-content tbody tr.tp-agg-row td.agg-label {
  color: var(--tp-text-secondary, #6d7175);
  font-weight: 500;
}

.tp-data-table-content tfoot tr:hover,
.tp-data-table-content tbody tr.tp-agg-row:hover {
  background-color: var(--tp-content-bg, #f3f4f6);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 767px) {
  .tp-data-table-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .tp-data-table-tabs {
    order: 2;
    padding-bottom: 0.5rem;
  }

  .tp-data-table-actions {
    order: 1;
    justify-content: flex-end;
  }

  .tp-data-table-content {
    display: block;
    overflow-x: auto;
  }

  .tp-data-table-pagination {
    flex-direction: column;
    gap: 0.75rem;
  }
}
.datahub-fragment {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.datahub-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
  font-size: 0.8125rem;
  color: var(--tp-text-secondary);
}

.tp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.tp-table-head {
  background-color: var(--tp-table-header-bg, #f6f8fa);
}

.tp-table-th {
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--tp-table-border, var(--tp-border));
  white-space: nowrap;
}

.tp-table-th a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
  transition: color 0.12s;
}

.tp-table-th a:hover {
  color: var(--tp-accent);
}

.tp-table-body {}

.tp-table-row {
  border-bottom: 1px solid var(--tp-table-border-light, var(--tp-border));
  transition: background-color 0.1s;
}

.tp-table-row:hover {
  background-color: var(--tp-table-row-hover, var(--tp-hover-bg));
}

.tp-table-row:last-child {
  border-bottom: none;
}

.tp-table-td {
  padding: 0.625rem 1rem;
  color: var(--tp-text);
  vertical-align: middle;
}

.tp-table-td a {
  color: var(--tp-accent);
  text-decoration: none;
  font-weight: 500;
}

.tp-table-td a:hover {
  text-decoration: underline;
}

.datahub-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--tp-border);
  font-size: 0.8125rem;
  color: var(--tp-text-secondary);
  background-color: var(--tp-surface);
}

.datahub-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Spec 179 Phase 1a — Footer-Schicht für aggregierte Tabellen.
   Marker-Klassen; die strukturelle Optik kommt aus den Tailwind-Utilities
   im Template (bg-tp-hover-bg, border-t-2). Hier nur Zahlen-Alignment und
   leichte Kontrast-Akzente. */
.tp-table-summary-row td {
  font-variant-numeric: tabular-nums;
}

.tp-table-meta-footer {
  font-variant-numeric: tabular-nums;
  background-color: var(--tp-surface);
}

/* ─── Loading-Overlay für HTMX-Requests (Spec 179 Phase G) ──────────────────
   Triggered via `hx-indicator="#<table-id>-container"` auf allen Filter/Sort/
   Pagination-Calls. Während der Request läuft, bekommt der Container die
   Class `htmx-request` (HTMX 2.x). Wir nutzen :has() um vom umschließenden
   `.tp-data-table-card` das Overlay sichtbar zu schalten.

   Verzögertes Erscheinen (200ms): bei schnellen Antworten gibt's keinen
   Flacker-Effekt. Verschwinden ohne Verzögerung. */
.tp-table-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--tp-loading-overlay, rgba(255, 255, 255, 0.6));
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-in 200ms;
  z-index: 10;
  backdrop-filter: blur(1px);
}

.tp-data-table-card:has(.htmx-request) .tp-table-loading-overlay {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0ms;
}

.tp-table-loading-spinner {
  font-size: 1.5rem;
  color: var(--tp-accent, #1d4b8e);
  animation: tp-table-spin 0.8s linear infinite;
}

@keyframes tp-table-spin {
  to { transform: rotate(360deg); }
}
/**
 * TP Design System — Date Range Picker
 * Used by shopcloud-ui DateRangeField and admin-table filters.
 */

.tp-date-range {
  position: relative;
  width: 100%;
  z-index: 1;
}

/* Raise above sibling filters / table rows when open */
.tp-date-range--open {
  z-index: 80;
}

.tp-date-range__panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 90;
  min-width: min(620px, calc(100vw - 2rem));
  max-width: calc(100vw - 1.5rem);
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.tp-date-range__panel-inner {
  display: flex;
  align-items: stretch;
  /* No hard max-height — let calendars + footer size naturally; presets scroll if needed */
  max-height: min(480px, 75vh);
}

/* ----- Presets column ----- */
.tp-date-range__presets {
  width: 168px;
  flex-shrink: 0;
  border-right: 1px solid var(--tp-border, #e1e1e1);
  padding: 6px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tp-date-range__preset {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 14px;
  font-size: 12.5px;
  line-height: 1.25;
  border: none;
  background: transparent;
  color: var(--tp-text, #202223);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.tp-date-range__preset:hover {
  background: var(--tp-hover-bg, rgba(0, 0, 0, 0.04));
}

.tp-date-range__preset.is-active {
  background: color-mix(in srgb, var(--tp-primary, #1d4b8e) 12%, transparent);
  color: var(--tp-accent, #1d4b8e);
  font-weight: 600;
}

.tp-date-range__divider {
  border-top: 1px solid var(--tp-border, #e1e1e1);
  margin: 6px 0;
}

.tp-date-range__last-n {
  padding: 0 12px 8px;
}

.tp-date-range__last-n-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--tp-text-secondary, #6d7175);
  margin: 0 0 6px;
}

.tp-date-range__last-n-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.tp-date-range__last-n-input {
  width: 52px;
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
  background: var(--tp-surface, #fff);
  color: var(--tp-text, #202223);
}

.tp-date-range__last-n-unit {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  background: var(--tp-surface, #fff);
  color: var(--tp-text, #202223);
}

.tp-date-range__include-today {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tp-text-secondary, #6d7175);
  cursor: pointer;
  user-select: none;
}

.tp-date-range__include-today input {
  width: 14px;
  height: 14px;
  margin: 0;
}

/* ----- Calendar column ----- */
.tp-date-range__cals {
  flex: 1;
  min-width: 0;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
}

.tp-date-range__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tp-date-range__nav-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--tp-text-secondary, #6d7175);
  font-size: 15px;
  line-height: 1;
}

.tp-date-range__nav-btn:hover {
  background: var(--tp-hover-bg, rgba(0, 0, 0, 0.04));
  color: var(--tp-text, #202223);
}

.tp-date-range__months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.tp-date-range__month-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--tp-text, #202223);
  margin-bottom: 6px;
  text-transform: capitalize;
}

.tp-date-range__wdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
}

.tp-date-range__wdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--tp-text-secondary, #6d7175);
  padding: 2px 0;
}

.tp-date-range__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.tp-date-range__cell {
  aspect-ratio: 1;
  min-width: 0;
}

.tp-date-range__day {
  width: 100%;
  height: 100%;
  min-height: 28px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--tp-text, #202223);
  font-weight: 400;
  padding: 0;
  line-height: 1;
}

.tp-date-range__day:hover {
  background: var(--tp-hover-bg, rgba(0, 0, 0, 0.06));
}

.tp-date-range__day.is-in-range {
  background: color-mix(in srgb, var(--tp-primary, #1d4b8e) 12%, transparent);
  border-radius: 0;
}

.tp-date-range__day.is-selected {
  background: var(--tp-primary, #1d4b8e);
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
}

.tp-date-range__day.is-today {
  border-color: var(--tp-accent, #1d4b8e);
  color: var(--tp-accent, #1d4b8e);
  font-weight: 600;
}

.tp-date-range__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--tp-border, #e1e1e1);
  flex-wrap: wrap;
}

.tp-date-range__summary {
  font-size: 12px;
  color: var(--tp-text-secondary, #6d7175);
  min-width: 0;
}

.tp-date-range__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.tp-date-range__btn-ghost {
  padding: 5px 10px;
  font-size: 12px;
  color: var(--tp-text-secondary, #6d7175);
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

.tp-date-range__btn-ghost:hover {
  color: var(--tp-text, #202223);
  background: var(--tp-hover-bg, rgba(0, 0, 0, 0.04));
}

.tp-date-range__btn-secondary {
  padding: 5px 12px;
  font-size: 12px;
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 7px;
  background: var(--tp-surface, #fff);
  color: var(--tp-text, #202223);
  cursor: pointer;
}

.tp-date-range__btn-secondary:hover {
  background: var(--tp-hover-bg, rgba(0, 0, 0, 0.04));
}

.tp-date-range__btn-primary {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 7px;
  background: var(--tp-primary, #1d4b8e);
  color: #fff;
  cursor: pointer;
}

.tp-date-range__btn-primary:disabled {
  background: var(--tp-border, #e1e1e1);
  color: var(--tp-text-secondary, #6d7175);
  cursor: not-allowed;
}

.tp-date-range__btn-primary:not(:disabled):hover {
  filter: brightness(1.05);
}

/* Narrow viewports: stack presets above calendars */
@media (max-width: 640px) {
  .tp-date-range__panel {
    min-width: min(100vw - 1.5rem, 360px);
    left: 50%;
    transform: translateX(-50%);
  }

  .tp-date-range__panel-inner {
    flex-direction: column;
    max-height: min(80vh, 560px);
  }

  .tp-date-range__presets {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--tp-border, #e1e1e1);
    max-height: 140px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px;
  }

  .tp-date-range__preset {
    width: auto;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
  }

  .tp-date-range__divider,
  .tp-date-range__last-n {
    width: 100%;
  }

  .tp-date-range__months {
    grid-template-columns: 1fr;
  }
}
/**
 * TP Design System - Drawer Component
 * Slide-in panel from any edge of the screen
 *
 * Usage:
 *   <div class="tp-drawer tp-drawer-right" x-show="open">
 *     <div class="tp-drawer-overlay" @click="open = false"></div>
 *     <div class="tp-drawer-panel">
 *       <div class="tp-drawer-header">...</div>
 *       <div class="tp-drawer-body">...</div>
 *       <div class="tp-drawer-footer">...</div>
 *     </div>
 *   </div>
 *
 * Positions: tp-drawer-right (default), tp-drawer-left, tp-drawer-top, tp-drawer-bottom
 * Sizes: tp-drawer-sm, tp-drawer-md (default), tp-drawer-lg, tp-drawer-xl, tp-drawer-full
 */

/* ===========================
   Drawer Container
   =========================== */
.tp-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
}

/* ===========================
   Drawer Overlay
   =========================== */
.tp-drawer-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

/* ===========================
   Drawer Panel
   =========================== */
.tp-drawer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--tp-surface);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
  overflow: hidden;
  z-index: 1;
}

/* ===========================
   Drawer Header
   =========================== */
.tp-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tp-border);
  flex-shrink: 0;
}

.tp-drawer-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--tp-text);
  margin: 0;
}

.tp-drawer-subtitle {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  margin-top: 0.25rem;
}

.tp-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--tp-text-secondary);
  background: none;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tp-drawer-close:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Drawer Body
   =========================== */
.tp-drawer-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
}

/* Body with no padding */
.tp-drawer-body-flush {
  padding: 0;
}

/* ===========================
   Drawer Footer
   =========================== */
.tp-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
  flex-shrink: 0;
}

.tp-drawer-footer-start {
  justify-content: flex-start;
}

.tp-drawer-footer-between {
  justify-content: space-between;
}

/* ===========================
   Drawer Positions
   =========================== */

/* Right (Default) */
.tp-drawer-right {
  justify-content: flex-end;
}

.tp-drawer-right .tp-drawer-panel {
  height: 100%;
  width: 24rem; /* Default md size */
  max-width: 100%;
}

/* Left */
.tp-drawer-left {
  justify-content: flex-start;
}

.tp-drawer-left .tp-drawer-panel {
  height: 100%;
  width: 24rem;
  max-width: 100%;
}

/* Top */
.tp-drawer-top {
  flex-direction: column;
  justify-content: flex-start;
}

.tp-drawer-top .tp-drawer-panel {
  width: 100%;
  height: auto;
  max-height: 80vh;
}

/* Bottom */
.tp-drawer-bottom {
  flex-direction: column;
  justify-content: flex-end;
}

.tp-drawer-bottom .tp-drawer-panel {
  width: 100%;
  height: auto;
  max-height: 80vh;
}

/* ===========================
   Drawer Sizes (Horizontal)
   =========================== */
.tp-drawer-xs .tp-drawer-panel {
  width: 16rem; /* 256px */
}

.tp-drawer-sm .tp-drawer-panel {
  width: 20rem; /* 320px */
}

.tp-drawer-md .tp-drawer-panel {
  width: 24rem; /* 384px */
}

.tp-drawer-lg .tp-drawer-panel {
  width: 32rem; /* 512px */
}

.tp-drawer-xl .tp-drawer-panel {
  width: 40rem; /* 640px */
}

.tp-drawer-2xl .tp-drawer-panel {
  width: 48rem; /* 768px */
}

.tp-drawer-full .tp-drawer-panel {
  width: 100%;
}

/* Half width */
.tp-drawer-half .tp-drawer-panel {
  width: 50%;
}

/* ===========================
   Drawer Sizes (Vertical - Top/Bottom)
   =========================== */
.tp-drawer-top.tp-drawer-sm .tp-drawer-panel,
.tp-drawer-bottom.tp-drawer-sm .tp-drawer-panel {
  max-height: 25vh;
}

.tp-drawer-top.tp-drawer-md .tp-drawer-panel,
.tp-drawer-bottom.tp-drawer-md .tp-drawer-panel {
  max-height: 40vh;
}

.tp-drawer-top.tp-drawer-lg .tp-drawer-panel,
.tp-drawer-bottom.tp-drawer-lg .tp-drawer-panel {
  max-height: 60vh;
}

.tp-drawer-top.tp-drawer-full .tp-drawer-panel,
.tp-drawer-bottom.tp-drawer-full .tp-drawer-panel {
  max-height: 100vh;
  height: 100vh;
}

/* ===========================
   Drawer Animations (Alpine.js)
   =========================== */

/* Overlay animations */
.tp-drawer-overlay[x-cloak] {
  display: none !important;
}

/* Right drawer slide */
.tp-drawer-right .tp-drawer-panel {
  transform: translateX(0);
}

.tp-drawer-right[x-show="false"] .tp-drawer-panel,
.tp-drawer-right.tp-drawer-closed .tp-drawer-panel {
  transform: translateX(100%);
}

/* Left drawer slide */
.tp-drawer-left .tp-drawer-panel {
  transform: translateX(0);
}

.tp-drawer-left[x-show="false"] .tp-drawer-panel,
.tp-drawer-left.tp-drawer-closed .tp-drawer-panel {
  transform: translateX(-100%);
}

/* Top drawer slide */
.tp-drawer-top .tp-drawer-panel {
  transform: translateY(0);
}

.tp-drawer-top[x-show="false"] .tp-drawer-panel,
.tp-drawer-top.tp-drawer-closed .tp-drawer-panel {
  transform: translateY(-100%);
}

/* Bottom drawer slide */
.tp-drawer-bottom .tp-drawer-panel {
  transform: translateY(0);
}

.tp-drawer-bottom[x-show="false"] .tp-drawer-panel,
.tp-drawer-bottom.tp-drawer-closed .tp-drawer-panel {
  transform: translateY(100%);
}

/* ===========================
   Drawer Variants
   =========================== */

/* Drawer without overlay */
.tp-drawer-no-overlay .tp-drawer-overlay {
  display: none;
}

/* Drawer with border instead of shadow */
.tp-drawer-bordered .tp-drawer-panel {
  box-shadow: none;
}

.tp-drawer-right.tp-drawer-bordered .tp-drawer-panel {
  border-left: 1px solid var(--tp-border);
}

.tp-drawer-left.tp-drawer-bordered .tp-drawer-panel {
  border-right: 1px solid var(--tp-border);
}

.tp-drawer-top.tp-drawer-bordered .tp-drawer-panel {
  border-bottom: 1px solid var(--tp-border);
}

.tp-drawer-bottom.tp-drawer-bordered .tp-drawer-panel {
  border-top: 1px solid var(--tp-border);
}

/* Drawer with rounded corners */
.tp-drawer-right.tp-drawer-rounded .tp-drawer-panel {
  border-top-left-radius: 0.75rem;
  border-bottom-left-radius: 0.75rem;
}

.tp-drawer-left.tp-drawer-rounded .tp-drawer-panel {
  border-top-right-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

.tp-drawer-top.tp-drawer-rounded .tp-drawer-panel {
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

.tp-drawer-bottom.tp-drawer-rounded .tp-drawer-panel {
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
}

/* ===========================
   Drawer Push Mode
   =========================== */
.tp-drawer-push {
  position: relative;
}

.tp-drawer-push .tp-drawer-overlay {
  display: none;
}

.tp-drawer-push .tp-drawer-panel {
  position: relative;
}

/* ===========================
   Drawer Tabs (for multi-section drawers)
   =========================== */
.tp-drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--tp-border);
}

.tp-drawer-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.tp-drawer-tab:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

.tp-drawer-tab.active {
  color: var(--tp-accent);
  border-bottom-color: var(--tp-accent);
}

/* ===========================
   Drawer Sections
   =========================== */
.tp-drawer-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--tp-border);
}

.tp-drawer-section:last-child {
  border-bottom: none;
}

.tp-drawer-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tp-text-secondary);
  margin-bottom: 0.75rem;
}

/* ===========================
   Drawer Loading State
   =========================== */
.tp-drawer-loading .tp-drawer-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-drawer-loading .tp-drawer-footer {
  opacity: 0.5;
  pointer-events: none;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
  /* Make horizontal drawers full width on mobile */
  .tp-drawer-right .tp-drawer-panel,
  .tp-drawer-left .tp-drawer-panel {
    width: 100%;
  }

  /* Reduce padding on mobile */
  .tp-drawer-header,
  .tp-drawer-body,
  .tp-drawer-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
/**
 * TP Design System - Dropdown Components
 * DaisyUI-style dropdown menu classes
 *
 * Usage:
 *   <div class="tp-dropdown" x-data="{ open: false }">
 *     <button @click="open = !open" class="tp-dropdown-trigger">Menu</button>
 *     <div x-show="open" class="tp-dropdown-menu">
 *       <a href="#" class="tp-dropdown-item">Item 1</a>
 *     </div>
 *   </div>
 */

/* ===========================
   Dropdown Container
   =========================== */
.tp-dropdown {
  position: relative;
  display: inline-block;
}

/* ===========================
   Dropdown Trigger
   =========================== */
.tp-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* ===========================
   Dropdown Menu
   =========================== */
.tp-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 10rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Positioning variants */
.tp-dropdown-menu-right {
  left: auto;
  right: 0;
}

.tp-dropdown-menu-top {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.tp-dropdown-menu-center {
  left: 50%;
  transform: translateX(-50%);
}

/* ===========================
   Dropdown Item
   =========================== */
.tp-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  text-align: left;
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tp-dropdown-item:hover {
  background-color: var(--tp-hover-bg);
}

.tp-dropdown-item:active {
  background-color: var(--tp-border);
}

.tp-dropdown-item:focus {
  outline: none;
  background-color: var(--tp-hover-bg);
}

/* Item icon */
.tp-dropdown-item-icon {
  width: 1rem;
  color: var(--tp-text-secondary);
  flex-shrink: 0;
}

/* Item description (secondary text) */
.tp-dropdown-item-description {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  margin-left: auto;
}

/* Danger item (destructive actions) */
.tp-dropdown-item-danger {
  color: #dc2626;
}

.tp-dropdown-item-danger:hover {
  background-color: rgba(220, 38, 38, 0.1);
}

.tp-dropdown-item-danger .tp-dropdown-item-icon {
  color: #dc2626;
}

/* Disabled item */
.tp-dropdown-item:disabled,
.tp-dropdown-item-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Active/selected item */
.tp-dropdown-item-active {
  background-color: var(--tp-hover-bg);
  font-weight: 500;
}

.tp-dropdown-item-active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: var(--tp-primary);
}

/* ===========================
   Dropdown Divider
   =========================== */
.tp-dropdown-divider {
  height: 1px;
  margin: 0.25rem 0;
  background-color: var(--tp-border);
}

/* ===========================
   Dropdown Header
   =========================== */
.tp-dropdown-header {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===========================
   Dropdown with Search
   =========================== */
.tp-dropdown-search {
  padding: 0.5rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-dropdown-search-input {
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--tp-border);
  border-radius: 0.375rem;
  background-color: var(--tp-input-bg);
  color: var(--tp-text);
}

.tp-dropdown-search-input:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}

.tp-dropdown-search-input::placeholder {
  color: var(--tp-text-secondary);
}

/* ===========================
   Dropdown with Checkbox
   =========================== */
.tp-dropdown-item-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tp-dropdown-item-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ===========================
   Dropdown Footer
   =========================== */
.tp-dropdown-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--tp-border);
}

/* ===========================
   Context Menu (Right-click)
   =========================== */
.tp-context-menu {
  position: fixed;
  z-index: 100;
  min-width: 12rem;
  padding: 0.25rem 0;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

/* ===========================
   Animations
   =========================== */
.tp-dropdown-menu[x-cloak] {
  display: none !important;
}

/* For Alpine.js transitions */
.tp-dropdown-enter {
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.tp-dropdown-enter-start {
  opacity: 0;
  transform: scale(0.95);
}

.tp-dropdown-enter-end {
  opacity: 1;
  transform: scale(1);
}

.tp-dropdown-leave {
  transition: opacity 0.075s ease-in, transform 0.075s ease-in;
}

.tp-dropdown-leave-start {
  opacity: 1;
  transform: scale(1);
}

.tp-dropdown-leave-end {
  opacity: 0;
  transform: scale(0.95);
}
/**
 * TP Design System - Empty State
 * ConsoleHub "Keine Einträge" placeholder
 */

.tp-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16rem;
  border: 1px solid var(--tp-border);
  border-radius: 0.75rem;
  background-color: var(--tp-surface);
  padding: 2rem 1.5rem;
}

.tp-empty-state-inner {
  text-align: center;
  max-width: 20rem;
}

.tp-empty-state-icon-wrap {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 9999px;
  background-color: var(--tp-hover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tp-text-secondary);
  font-size: 1.25rem;
}

.tp-empty-state-title {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
}

.tp-empty-state-desc {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--tp-text-secondary);
}

.tp-empty-state-action {
  display: inline-flex;
  justify-content: center;
}
/**
 * TP Design System - Filter bar & chips
 * ConsoleHub release-notes type filters
 */

.tp-filter-bar {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.tp-filter-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tp-filter-bar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

.tp-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tp-filter-chip:hover {
  border-color: var(--tp-text-secondary);
  color: var(--tp-text);
}

.tp-filter-chip-active {
  background-color: var(--tp-primary);
  border-color: var(--tp-primary);
  color: #fff;
}

.tp-filter-chip-active:hover {
  background-color: var(--tp-primary-hover);
  border-color: var(--tp-primary-hover);
  color: #fff;
}
/**
 * TP Design System - Form Components
 * Input, Select, Textarea, Checkbox, Radio, Label
 *
 * Usage:
 *   <label class="tp-form-label">Email</label>
 *   <input type="text" class="tp-form-input" placeholder="Enter email...">
 *
 *   <div class="tp-form-group">
 *     <label class="tp-form-label">Password</label>
 *     <input type="password" class="tp-form-input">
 *     <span class="tp-form-hint">Mindestens 8 Zeichen</span>
 *   </div>
 *
 * Sizes: tp-form-input-sm, tp-form-input-lg
 * States: :focus, :disabled, .tp-form-input-error
 */

/* ===========================
   Form Label
   =========================== */
.tp-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
  margin-bottom: 0.375rem;
}

.tp-form-label-required::after {
  content: ' *';
  color: #ef4444;
}

.tp-form-label-optional::after {
  content: ' (optional)';
  font-weight: 400;
  color: var(--tp-text-secondary);
  font-size: 0.75rem;
}

/* ===========================
   Form Input
   =========================== */
.tp-form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tp-text);
  background-color: var(--tp-input-bg);
  border: 1px solid var(--tp-input-border);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-form-input::placeholder {
  color: var(--tp-text-secondary);
}

.tp-form-input:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

.tp-form-input:disabled {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Input Sizes */
.tp-form-input-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
}

.tp-form-input-lg {
  padding: 0.625rem 1rem;
  font-size: 1rem;
}

/* Input States */
.tp-form-input-error {
  border-color: #ef4444;
}

.tp-form-input-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.tp-form-input-success {
  border-color: #22c55e;
}

.tp-form-input-success:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* ===========================
   Form Select
   =========================== */
.tp-form-select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tp-text);
  background-color: var(--tp-input-bg);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  border: 1px solid var(--tp-input-border);
  border-radius: 0.375rem;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-form-select:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

.tp-form-select:disabled {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Select Sizes */
.tp-form-select-sm {
  padding: 0.375rem 2rem 0.375rem 0.625rem;
  font-size: 0.75rem;
}

.tp-form-select-lg {
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  font-size: 1rem;
}

/* ===========================
   Form Textarea
   =========================== */
.tp-form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tp-text);
  background-color: var(--tp-input-bg);
  border: 1px solid var(--tp-input-border);
  border-radius: 0.375rem;
  resize: vertical;
  min-height: 5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-form-textarea::placeholder {
  color: var(--tp-text-secondary);
}

.tp-form-textarea:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

.tp-form-textarea:disabled {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

.tp-form-textarea-error {
  border-color: #ef4444;
}

/* ===========================
   Form Checkbox
   =========================== */
.tp-form-checkbox {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--tp-input-border);
  border-radius: 0.25rem;
  background-color: var(--tp-input-bg);
  cursor: pointer;
  appearance: none;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.tp-form-checkbox:checked {
  background-color: var(--tp-primary);
  border-color: var(--tp-primary);
}

.tp-form-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.25rem;
  height: 0.5rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.tp-form-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

.tp-form-checkbox:disabled {
  background-color: var(--tp-hover-bg);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Checkbox with Label */
.tp-form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  cursor: pointer;
}

.tp-form-checkbox-label:has(.tp-form-checkbox:disabled) {
  cursor: not-allowed;
  opacity: 0.7;
}

/* ===========================
   Form Radio
   =========================== */
.tp-form-radio {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--tp-input-border);
  border-radius: 50%;
  background-color: var(--tp-input-bg);
  cursor: pointer;
  appearance: none;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.tp-form-radio:checked {
  border-color: var(--tp-accent);
  border-width: 4px;
}

.tp-form-radio:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

.tp-form-radio:disabled {
  background-color: var(--tp-hover-bg);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Radio with Label */
.tp-form-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  cursor: pointer;
}

/* ===========================
   Form Group
   =========================== */
.tp-form-group {
  margin-bottom: 1rem;
}

.tp-form-group:last-child {
  margin-bottom: 0;
}

/* ===========================
   Form Hint / Error Message
   =========================== */
.tp-form-hint {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

.tp-form-error {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #ef4444;
}

.tp-form-success {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #22c55e;
}

/* ===========================
   Input with Icon
   =========================== */
.tp-form-input-wrapper {
  position: relative;
}

.tp-form-input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tp-text-secondary);
  pointer-events: none;
}

.tp-form-input-wrapper .tp-form-input {
  padding-left: 2.25rem;
}

.tp-form-input-icon-right {
  left: auto;
  right: 0.75rem;
}

.tp-form-input-wrapper:has(.tp-form-input-icon-right) .tp-form-input {
  padding-left: 0.75rem;
  padding-right: 2.25rem;
}

/* ===========================
   Input Group (Addon)
   =========================== */
.tp-form-input-group {
  display: flex;
}

.tp-form-input-group .tp-form-input {
  border-radius: 0;
}

.tp-form-input-group .tp-form-input:first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

.tp-form-input-group .tp-form-input:last-child {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

.tp-form-input-addon {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  background-color: var(--tp-hover-bg);
  border: 1px solid var(--tp-input-border);
  white-space: nowrap;
}

.tp-form-input-addon:first-child {
  border-right: none;
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

.tp-form-input-addon:last-child {
  border-left: none;
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

/* ===========================
   Search Input
   =========================== */
.tp-form-search {
  position: relative;
}

.tp-form-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tp-text-secondary);
  pointer-events: none;
  font-size: 0.875rem;
}

.tp-form-search .tp-form-input {
  padding-left: 2.25rem;
  padding-right: 2.25rem;
}

.tp-form-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tp-text-secondary);
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tp-form-search:hover .tp-form-search-clear,
.tp-form-search .tp-form-input:focus ~ .tp-form-search-clear {
  opacity: 1;
}

.tp-form-search-clear:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

/* ===========================
   Toggle Switch
   =========================== */
.tp-form-toggle {
  position: relative;
  width: 2.5rem;
  height: 1.5rem;
  background-color: var(--tp-hover-bg);
  border: 1px solid var(--tp-input-border);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  flex-shrink: 0;
}

.tp-form-toggle::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 1.125rem;
  height: 1.125rem;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.tp-form-toggle:checked {
  background-color: var(--tp-primary);
  border-color: var(--tp-primary);
}

.tp-form-toggle:checked::after {
  transform: translateY(-50%) translateX(1rem);
}

.tp-form-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

.tp-form-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toggle with Label */
.tp-form-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  cursor: pointer;
}

/* ===========================
   Form Row
   ===========================
 * The markup of `shopcloud_ui::FormRow` — one line of fields with the submit
 * button on the same baseline. It replaces the unused `.tp-form-inline`, which
 * described the same idea without saying how a cell is sized and was therefore
 * copied as an inline `style` four times over on the ShopcloudHub rights
 * surface (I-022c).
 *
 * Usage — the component writes this, nobody hand-rolls it:
 *   <div class="tp-form-row">
 *     <div class="tp-form-row-cell tp-form-row-cell-grow">…label + input…</div>
 *     <button class="tp-btn tp-btn-primary tp-btn-sm" type="submit">…</button>
 *   </div>
 */
.tp-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 0;
}

/* Room for what follows in the same form (a fieldset of checkboxes). */
.tp-form-row-space-below {
  margin-bottom: 0.85rem;
}

/* `min-width: 0` and not `auto`: a cell holding a `<select>` otherwise refuses
   to shrink below its longest option, and one long role name then pushes the
   submit button onto a line of its own. */
.tp-form-row-cell {
  flex: 0 0 auto;
  min-width: 0;
}

/* Takes what the row has left over. A name or a choice grows; a date and a
   short list of runtimes stay as wide as their control. */
.tp-form-row-cell-grow {
  flex: 1 1 16rem;
}
/**
 * FragmentSlot — empty, error, and loading states for HTMX-loaded content areas
 *
 * Usage (empty state):
 *   <div class="tp-fragment-slot tp-fragment-slot--empty">
 *     <div class="tp-fragment-slot-icon"><i class="fas fa-inbox"></i></div>
 *     <div class="tp-fragment-slot-title">Keine Einträge</div>
 *     <div class="tp-fragment-slot-description">Noch keine Daten vorhanden.</div>
 *     <button class="tp-fragment-slot-action">Eintrag erstellen</button>
 *   </div>
 *
 * Usage (error state):
 *   <div class="tp-fragment-slot tp-fragment-slot--error">
 *     <div class="tp-fragment-slot-icon"><i class="fas fa-triangle-exclamation"></i></div>
 *     <div class="tp-fragment-slot-title">Fehler beim Laden</div>
 *     <div class="tp-fragment-slot-description">Der Bereich konnte nicht geladen werden.</div>
 *     <button class="tp-fragment-slot-action" hx-get="..." hx-target="...">Erneut versuchen</button>
 *   </div>
 */

.tp-fragment-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  min-height: 10rem;
}

/* Icon container */
.tp-fragment-slot-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.tp-fragment-slot--empty .tp-fragment-slot-icon {
  background: var(--tp-hover-bg, #f3f4f6);
  color: var(--tp-text-secondary, #6d7175);
}

.tp-fragment-slot--error .tp-fragment-slot-icon {
  background: var(--tp-badge-danger-bg, #fee2e2);
  color: var(--tp-danger, #ef4444);
}

/* Text */
.tp-fragment-slot-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-text, #202223);
  margin-bottom: 5px;
}

.tp-fragment-slot-description {
  font-size: 13px;
  color: var(--tp-text-secondary, #6d7175);
  max-width: 24rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

/* Action button */
.tp-fragment-slot-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  border: 1px solid var(--tp-border, #e1e1e1);
  background: var(--tp-surface, #fff);
  color: var(--tp-text, #202223);
  text-decoration: none;
  font-family: inherit;
}

.tp-fragment-slot-action:hover {
  border-color: var(--tp-accent, #1d4b8e);
  color: var(--tp-accent, #1d4b8e);
}

.tp-fragment-slot-action--primary {
  background: var(--tp-primary, #1d4b8e);
  border-color: var(--tp-primary, #1d4b8e);
  color: #fff;
}

.tp-fragment-slot-action--primary:hover {
  background: var(--tp-primary-hover, #174080);
  border-color: var(--tp-primary-hover, #174080);
  color: #fff;
}

/* Compact variant — for tighter spaces */
.tp-fragment-slot--compact {
  padding: 1.5rem 1rem;
  min-height: 6rem;
}

.tp-fragment-slot--compact .tp-fragment-slot-icon {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.875rem;
  margin-bottom: 0.625rem;
}

.tp-fragment-slot--compact .tp-fragment-slot-title {
  font-size: 13px;
}

.tp-fragment-slot--compact .tp-fragment-slot-description {
  font-size: 12px;
  margin-bottom: 0.875rem;
}
/**
 * TP Design System - Icon Button Component
 * Buttons that contain only an icon
 *
 * Usage:
 *   <button class="tp-icon-btn">
 *     <i class="fas fa-edit"></i>
 *   </button>
 *
 *   <button class="tp-icon-btn tp-icon-btn-sm tp-icon-btn-ghost">
 *     <i class="fas fa-times"></i>
 *   </button>
 *
 * Sizes: tp-icon-btn-sm, tp-icon-btn-lg
 * Variants: default, ghost, primary, danger
 */

/* ===========================
   Base Icon Button
   =========================== */
.tp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  background-color: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
}

.tp-icon-btn:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

.tp-icon-btn:focus,
.tp-icon-btn:focus-within,
.tp-icon-btn:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  --tw-ring-shadow: none !important;
  --tw-ring-offset-shadow: none !important;
}

.tp-icon-btn:focus-visible {
  outline: 2px solid var(--tp-accent);
  outline-offset: 2px;
  box-shadow: none !important;
  border: none !important;
}

.tp-icon-btn:active {
  transform: scale(0.95);
}

.tp-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tp-icon-btn:disabled:hover {
  background-color: transparent;
  color: var(--tp-text-secondary);
}

/* ===========================
   Icon Button Sizes
   =========================== */
.tp-icon-btn-xs {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.625rem;
}

.tp-icon-btn-sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
}

.tp-icon-btn-lg {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

.tp-icon-btn-xl {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
}

/* ===========================
   Icon Button Variants
   =========================== */

/* Ghost - More subtle hover */
.tp-icon-btn-ghost {
  color: var(--tp-text-secondary);
}

.tp-icon-btn-ghost:hover {
  color: var(--tp-text);
  background-color: transparent;
}

/* Primary */
.tp-icon-btn-primary {
  color: var(--tp-accent);
}

.tp-icon-btn-primary:hover {
  color: white;
  background-color: var(--tp-primary);
}

/* Danger */
.tp-icon-btn-danger {
  color: var(--tp-text-secondary);
}

.tp-icon-btn-danger:hover {
  color: white;
  background-color: #ef4444;
}

/* Success */
.tp-icon-btn-success {
  color: var(--tp-text-secondary);
}

.tp-icon-btn-success:hover {
  color: white;
  background-color: #22c55e;
}

/* ===========================
   Filled Variants
   =========================== */
.tp-icon-btn-filled {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-icon-btn-filled:hover {
  background-color: var(--tp-border);
}

.tp-icon-btn-filled-primary {
  background-color: var(--tp-primary);
  color: white;
}

.tp-icon-btn-filled-primary:hover {
  background-color: var(--tp-primary-hover);
  color: white;
}

.tp-icon-btn-filled-danger {
  background-color: #ef4444;
  color: white;
}

.tp-icon-btn-filled-danger:hover {
  background-color: #dc2626;
  color: white;
}

/* ===========================
   Outlined Variants
   =========================== */
.tp-icon-btn-outlined {
  border: 1px solid var(--tp-border);
  color: var(--tp-text);
}

.tp-icon-btn-outlined:hover {
  background-color: var(--tp-hover-bg);
  border-color: var(--tp-text-secondary);
}

/* ===========================
   Icon Button with Badge
   =========================== */
.tp-icon-btn-badge {
  position: relative;
}

.tp-icon-btn-badge-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 0.5rem;
  height: 0.5rem;
  background-color: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--tp-surface);
}

.tp-icon-btn-badge-count {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1rem;
  text-align: center;
  color: white;
  background-color: #ef4444;
  border-radius: 9999px;
  border: 2px solid var(--tp-surface);
}

/* ===========================
   Icon Button Group
   =========================== */
.tp-icon-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tp-icon-btn-group-connected {
  gap: 0;
}

.tp-icon-btn-group-connected .tp-icon-btn {
  border-radius: 0;
}

.tp-icon-btn-group-connected .tp-icon-btn:first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

.tp-icon-btn-group-connected .tp-icon-btn:last-child {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

/* ===========================
   Circle Variant
   =========================== */
.tp-icon-btn-circle {
  border-radius: 50%;
}

/* ===========================
   Loading State
   =========================== */
.tp-icon-btn-loading {
  pointer-events: none;
}

.tp-icon-btn-loading i {
  animation: tp-icon-spin 1s linear infinite;
}

@keyframes tp-icon-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
/**
 * TP Design System - Inbox Item Component
 * Conversation list item for support/inbox UIs
 *
 * Usage:
 *   <div class="tp-inbox-item tp-inbox-item--selected">
 *     <div class="tp-inbox-item-avatar">...</div>
 *     <div class="tp-inbox-item-body">
 *       <div class="tp-inbox-item-header">
 *         <span class="tp-inbox-item-name">Anna Lehmann</span>
 *         <span class="tp-inbox-item-time">4 Min</span>
 *       </div>
 *       <p class="tp-inbox-item-preview">Nachrichtenvorschau…</p>
 *       <div class="tp-inbox-item-meta">...</div>
 *     </div>
 *   </div>
 */

.tp-inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--tp-border);
  border-left: 2px solid transparent;
  transition: background-color 0.1s ease;
  position: relative;
}

.tp-inbox-item:hover {
  background-color: var(--tp-hover-bg);
}

.tp-inbox-item--selected {
  background-color: #eff6ff;
  border-left-color: var(--tp-accent);
}

.dark .tp-inbox-item--selected,
[data-theme="dark"] .tp-inbox-item--selected {
  background-color: rgba(29, 75, 142, 0.12);
}

.tp-inbox-item--unread .tp-inbox-item-name {
  font-weight: 700;
}

/* ── Avatar slot ── */
.tp-inbox-item-avatar {
  flex-shrink: 0;
  padding-top: 1px;
}

/* ── Body ── */
.tp-inbox-item-body {
  flex: 1;
  min-width: 0;
}

/* ── Header row: name + time ── */
.tp-inbox-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.125rem;
}

.tp-inbox-item-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-inbox-item-time {
  font-size: 0.625rem;
  color: var(--tp-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Preview text ── */
.tp-inbox-item-preview {
  font-size: 0.6875rem;
  color: var(--tp-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin: 0;
}

/* ── Meta row (badges etc.) ── */
.tp-inbox-item-meta {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Unread dot ── */
.tp-inbox-item--unread::after {
  content: '';
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--tp-primary);
}
/**
 * KpiBar — horizontal metrics strip with trends and period selector
 *
 * Compact horizontal bar of business metrics, typically above a detail view
 * or at the top of a dashboard section. Different from StatCards (which are
 * individual cards in a grid layout).
 *
 * Usage:
 *   <div class="tp-kpi-bar">
 *     <div class="tp-kpi-bar-item">
 *       <div class="tp-kpi-bar-label">Preis</div>
 *       <div class="tp-kpi-bar-value">129,99 €</div>
 *       <div class="tp-kpi-bar-meta">
 *         <span class="tp-kpi-bar-trend tp-kpi-bar-trend--up">
 *           <i class="fas fa-arrow-up tp-kpi-bar-trend-icon"></i> +2,5%
 *         </span>
 *         <span class="tp-kpi-bar-period">vs. Vormonat</span>
 *       </div>
 *     </div>
 *     <div class="tp-kpi-bar-divider"></div>
 *     ...
 *   </div>
 */

.tp-kpi-bar {
  display: flex;
  align-items: stretch;
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 12px;
  overflow: hidden;
}

.tp-kpi-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 18px;
  min-width: 0;
}

.tp-kpi-bar-divider {
  width: 1px;
  background: var(--tp-border, #e1e1e1);
  flex-shrink: 0;
  margin: 10px 0;
}

.tp-kpi-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tp-text-secondary, #6d7175);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.tp-kpi-bar-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--tp-text, #202223);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-kpi-bar-value--lg { font-size: 24px; }
.tp-kpi-bar-value--sm { font-size: 16px; }

.tp-kpi-bar-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: nowrap;
}

.tp-kpi-bar-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tp-kpi-bar-trend--up   { color: var(--tp-success, #18cf72); }
.tp-kpi-bar-trend--down { color: var(--tp-danger, #ef4444); }
.tp-kpi-bar-trend--flat { color: var(--tp-text-secondary, #6d7175); }

.tp-kpi-bar-trend-icon { font-size: 9px; }

.tp-kpi-bar-period {
  font-size: 11px;
  color: var(--tp-text-secondary, #6d7175);
  white-space: nowrap;
}

/* Period selector dropdown */
.tp-kpi-bar-period-select {
  font-size: 11px;
  border: none;
  background: none;
  color: var(--tp-text-secondary, #6d7175);
  cursor: pointer;
  padding: 0;
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
}

.tp-kpi-bar-period-select:hover {
  color: var(--tp-accent, #1d4b8e);
}

/* Compact — no trends, tighter padding */
.tp-kpi-bar--compact .tp-kpi-bar-item {
  padding: 10px 14px;
}

.tp-kpi-bar--compact .tp-kpi-bar-value {
  font-size: 16px;
}

/* Linked item — clickable KPI that drills down */
.tp-kpi-bar-item--link {
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
}

.tp-kpi-bar-item--link:hover {
  background: var(--tp-hover-bg, #f3f4f6);
}

.tp-kpi-bar-item--link:hover .tp-kpi-bar-value {
  color: var(--tp-accent, #1d4b8e);
}
/**
 * TP Design System - Label (V1)
 *
 * Was `badge.css`. Badge and status badge moved to `v2/components/pill.css`
 * in D-002c — one definition for both vocabularies; `@tp/ui/badge` resolves
 * there. What is left here has nothing to do with that migration:
 *
 *   - tp-label: user-defined label with configurable colors
 *   - tp-priority-badge: priority levels with their own palette
 *
 * Import as `@tp/ui/label`.
 */

/* ===========================
   Label (User-defined colors)
   For issue labels with user-configurable colors

   Usage:
   <span class="tp-label" style="--label-color: #e74c3c;">bug</span>

   Or with explicit text color:
   <span class="tp-label" style="--label-color: #1d4b8e; --label-text: #ffffff;">feature</span>
   =========================== */
.tp-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 9999px;
  white-space: nowrap;
  border: 1px solid transparent;

  /* Default: light mode uses semi-transparent background */
  background-color: color-mix(in srgb, var(--label-color, #6e7681) 15%, transparent);
  color: color-mix(in srgb, var(--label-color, #6e7681) 80%, black);
  border-color: color-mix(in srgb, var(--label-color, #6e7681) 30%, transparent);
}

/* Label hover state */
.tp-label:hover {
  background-color: color-mix(in srgb, var(--label-color, #6e7681) 25%, transparent);
}

/* Dark mode: toned-down background with light text */
[data-theme="dark"] .tp-label,
.dark .tp-label {
  background-color: color-mix(in srgb, var(--label-color, #6e7681) 60%, #1f2937);
  color: var(--label-text, #ffffff);
  border-color: color-mix(in srgb, var(--label-color, #6e7681) 40%, transparent);
}

[data-theme="dark"] .tp-label:hover,
.dark .tp-label:hover {
  background-color: color-mix(in srgb, var(--label-color, #6e7681) 70%, #1f2937);
}

/* Label with close button */
.tp-label-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.125rem;
  margin-right: -0.25rem;
  font-size: 0.625rem;
  color: currentColor;
  opacity: 0.7;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.tp-label-close:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tp-label-close:hover,
.dark .tp-label-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ===========================
   Label Sizes
   =========================== */
.tp-label-sm {
  padding: 0 0.375rem;
  font-size: 0.625rem;
}

.tp-label-lg {
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
}

/* ===========================
   Priority Badge
   Semantic colors for priority levels
   =========================== */
.tp-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 9999px;
  white-space: nowrap;
}

.tp-priority-low {
  background-color: #ddf4ff;
  color: #0969da;
}

.tp-priority-medium {
  background-color: #fff8c5;
  color: #9a6700;
}

.tp-priority-high {
  background-color: #ffebe9;
  color: #cf222e;
}

.tp-priority-critical {
  background-color: #cf222e;
  color: #ffffff;
}

/* Dark mode priority badges */
[data-theme="dark"] .tp-priority-low,
.dark .tp-priority-low {
  background-color: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
}

[data-theme="dark"] .tp-priority-medium,
.dark .tp-priority-medium {
  background-color: rgba(187, 128, 9, 0.15);
  color: #d29922;
}

[data-theme="dark"] .tp-priority-high,
.dark .tp-priority-high {
  background-color: rgba(248, 81, 73, 0.15);
  color: #f85149;
}

[data-theme="dark"] .tp-priority-critical,
.dark .tp-priority-critical {
  background-color: #b62324;
  color: #ffffff;
}
.dh-page-header {
  background: var(--tp-surface, #fff);
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
  padding: 10px 16px 12px;
}

.dh-page-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--tp-text-secondary, #6d7175);
}

.dh-page-header-breadcrumb a {
  color: var(--tp-text-secondary, #6d7175);
  text-decoration: none;
}

.dh-page-header-breadcrumb a:hover {
  color: var(--tp-text, #202223);
}

.dh-page-header-breadcrumb-sep {
  font-size: 8px;
  color: var(--tp-text-secondary, #6d7175);
}

.dh-page-header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dh-page-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tp-text, #202223);
  margin: 0;
  line-height: 1.3;
}

.dh-page-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dh-layout {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--tp-content-bg, #efefef);
  min-height: 0;
}

.dh-layout--stack {
  flex-direction: column;
}

.dh-layout--columns-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dh-layout--columns-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dh-layout--grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .dh-layout--columns-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .dh-layout--columns-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dh-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-column: span 12;
}

.dh-zone--span-3  { grid-column: span 12; }
.dh-zone--span-4  { grid-column: span 12; }
.dh-zone--span-6  { grid-column: span 12; }
.dh-zone--span-8  { grid-column: span 12; }
.dh-zone--span-9  { grid-column: span 12; }
.dh-zone--span-12 { grid-column: span 12; }

@media (min-width: 1024px) {
  .dh-zone--span-3  { grid-column: span 3; }
  .dh-zone--span-4  { grid-column: span 4; }
  .dh-zone--span-6  { grid-column: span 6; }
  .dh-zone--span-8  { grid-column: span 8; }
  .dh-zone--span-9  { grid-column: span 9; }
  .dh-zone--span-12 { grid-column: span 12; }
}

.dh-widget {
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 8px;
  overflow: hidden;
}

.dh-widget--kpi {
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 8px;
  overflow: hidden;
}

.dh-widget--table {
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.dh-widget--chart {
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 8px;
  overflow: hidden;
  min-height: 220px;
}

.dh-widget-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dh-widget-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tp-text, #202223);
  margin: 0;
}

.dh-kpi-card {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 8px;
  overflow: hidden;
}

.dh-kpi-item {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  border-right: 1px solid var(--tp-border, #e1e1e1);
}

.dh-kpi-item:last-child {
  border-right: none;
}

.dh-kpi-item__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tp-text-secondary, #6d7175);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  margin-bottom: 3px;
}

.dh-kpi-item__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--tp-text, #202223);
  line-height: 1.2;
  white-space: nowrap;
}

.dh-kpi-item__trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}

.dh-kpi-item__trend--up     { color: var(--tp-success, #18cf72); }
.dh-kpi-item__trend--down   { color: var(--tp-danger, #ef4444); }
.dh-kpi-item__trend--neutral { color: var(--tp-text-secondary, #6d7175); }

.dh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dh-table thead tr {
  background: var(--tp-hover-bg, #f3f4f6);
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
}

.dh-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--tp-text-secondary, #6d7175);
  white-space: nowrap;
}

.dh-table td {
  padding: 8px 12px;
  color: var(--tp-text, #202223);
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
  vertical-align: middle;
}

.dh-table tbody tr:last-child td {
  border-bottom: none;
}

.dh-table tbody tr:hover td {
  background: var(--tp-hover-bg, #f3f4f6);
}

.dh-page-tabs {
  display: flex;
  align-items: center;
  background: var(--tp-surface, #fff);
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.dh-page-tabs::-webkit-scrollbar {
  display: none;
}

.dh-page-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tp-text-secondary, #6d7175);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.dh-page-tab:hover {
  color: var(--tp-text, #202223);
}

.dh-page-tab--active {
  color: var(--tp-accent, #1d4b8e);
  border-bottom-color: var(--tp-accent, #1d4b8e);
  font-weight: 600;
}

.dh-filter-panel {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dh-filter-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tp-text-secondary, #6d7175);
  margin-bottom: 5px;
}

.dh-filter-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 6px;
  font-size: 12px;
  color: var(--tp-text, #202223);
  background: var(--tp-surface, #fff);
  outline: none;
  cursor: pointer;
}

.dh-filter-select:focus {
  border-color: var(--tp-accent, #1d4b8e);
}

.dh-timeline-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
}

.dh-timeline-item:last-child {
  border-bottom: none;
}

.dh-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tp-primary, #1d4b8e);
  flex-shrink: 0;
  margin-top: 4px;
}

.dh-timeline-content {
  flex: 1;
  min-width: 0;
}

.dh-timeline-text {
  font-size: 12px;
  color: var(--tp-text, #202223);
}

.dh-timeline-meta {
  font-size: 11px;
  color: var(--tp-text-secondary, #6d7175);
  margin-top: 2px;
}

.dh-placeholder {
  padding: 48px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--tp-text-secondary, #6d7175);
}

.dh-placeholder code {
  font-size: 11px;
  background: var(--tp-hover-bg, #f3f4f6);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
/**
 * TP Design System - Logo Component
 * Talk-Point Logo with gradient and shine animation
 *
 * Usage:
 *   <a href="#" class="tp-logo tp-logo-shine">
 *     <svg>...</svg>
 *   </a>
 *
 *   <div class="tp-logo tp-logo-lg">
 *     <svg>...</svg>
 *   </div>
 *
 * Sizes: tp-logo-sm, tp-logo-md (default), tp-logo-lg, tp-logo-xl
 * Variants: tp-logo-shine (animated), tp-logo-flat (no gradient)
 */

/* ===========================
   Base Logo
   =========================== */
.tp-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0.375rem;
  background: linear-gradient(135deg, #1d4b8e 0%, #0b549c 100%);
  border-radius: 0.5rem;
  box-shadow:
    0 4px 6px -1px rgba(29, 75, 142, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tp-logo:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 8px -1px rgba(29, 75, 142, 0.35),
    0 3px 6px -1px rgba(0, 0, 0, 0.15);
}

.tp-logo svg {
  width: 100%;
  height: 100%;
  fill: white;
  position: relative;
  z-index: 1;
}

/* ===========================
   Logo Sizes
   =========================== */
.tp-logo-xs {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
}

.tp-logo-sm {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.3rem;
  border-radius: 0.375rem;
}

.tp-logo-md {
  width: 2rem;
  height: 2rem;
  padding: 0.375rem;
}

.tp-logo-lg {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border-radius: 0.625rem;
}

.tp-logo-xl {
  width: 3rem;
  height: 3rem;
  padding: 0.625rem;
  border-radius: 0.75rem;
}

.tp-logo-2xl {
  width: 4rem;
  height: 4rem;
  padding: 0.75rem;
  border-radius: 1rem;
}

/* ===========================
   Shine Animation
   =========================== */
.tp-logo-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 70%
  );
  transform: rotate(45deg) translateX(-100%);
  animation: tp-logo-shine 4s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes tp-logo-shine {
  0% {
    transform: rotate(45deg) translateX(-100%);
  }
  50%, 100% {
    transform: rotate(45deg) translateX(100%);
  }
}

/* Disable animation on reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tp-logo-shine::before {
    animation: none;
  }
}

/* ===========================
   Flat Variant (no gradient)
   =========================== */
.tp-logo-flat {
  background: #1d4b8e;
  box-shadow: none;
}

.tp-logo-flat:hover {
  transform: none;
  box-shadow: none;
}

/* ===========================
   Color Variants
   =========================== */
.tp-logo-dark {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.tp-logo-light {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

.tp-logo-light svg {
  fill: #1d4b8e;
}

/* ===========================
   Logo with Text
   =========================== */
.tp-logo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.tp-logo-brand-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--tp-text);
  white-space: nowrap;
}

/* In topbar context - white text */
.tp-topbar .tp-logo-brand-text {
  color: white;
}

/* ===========================
   Logo Pulse (for loading)
   =========================== */
.tp-logo-pulse {
  animation: tp-logo-pulse 2s ease-in-out infinite;
}

@keyframes tp-logo-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

/* ===========================
   Logo Square (no border-radius)
   =========================== */
.tp-logo-square {
  border-radius: 0;
}

/* ===========================
   Logo Circle
   =========================== */
.tp-logo-circle {
  border-radius: 50%;
}
/**
 * TP Design System - Message Bubble Component
 * Support chat messages: inbound (customer), outbound (agent), note, ai-draft
 *
 * Usage:
 *   <div class="tp-msg">
 *     <div class="tp-msg-avatar">...</div>
 *     <div class="tp-msg-content">
 *       <div class="tp-msg-header">
 *         <span class="tp-msg-author">Julia Hartmann</span>
 *         <span class="tp-msg-meta">julia@example.de</span>
 *         <span class="tp-msg-time">09:12</span>
 *       </div>
 *       <div class="tp-msg-bubble">…text…</div>
 *       <div class="tp-msg-footer">Kanal: E-Mail · 2 Anlagen</div>
 *     </div>
 *   </div>
 *
 * Variants:
 *   tp-msg--inbound   (customer, default)
 *   tp-msg--note      (internal note, yellow)
 *   tp-msg--ai        (AI draft, blue accent border)
 *   tp-msg--indent    (indented, e.g. note inside thread)
 */

/* ── Base ── */
.tp-msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.tp-msg-avatar {
  flex-shrink: 0;
  padding-top: 1px;
}

.tp-msg-content {
  flex: 1;
  min-width: 0;
}

/* ── Header ── */
.tp-msg-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.tp-msg-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text);
}

.tp-msg-meta {
  font-size: 0.6875rem;
  color: var(--tp-text-secondary);
}

.tp-msg-time {
  font-size: 0.6875rem;
  color: var(--tp-text-secondary);
  margin-left: auto;
}

/* ── Bubble ── */
.tp-msg-bubble {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--tp-text);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border-top-left-radius: 0.25rem;
  border: 1px solid var(--tp-border);
  background-color: var(--tp-surface);
  max-width: 42rem;
}

.tp-msg-bubble p + p {
  margin-top: 0.5rem;
}

/* ── Footer ── */
.tp-msg-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: var(--tp-text-secondary);
}

/* ── Variant: Internal Note ── */
.tp-msg--note {
  padding-left: 2rem;
}

.tp-msg--note .tp-msg-avatar {
  display: none;
}

.tp-msg--note::before {
  content: '';
  width: 2px;
  background-color: #fbbf24; /* yellow-400 */
  border-radius: 9999px;
  align-self: stretch;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

.tp-msg--note .tp-msg-bubble {
  background-color: #fefce8;
  border-color: #fde68a;
  border-radius: 0.75rem;
  border-top-left-radius: 0.25rem;
}

.dark .tp-msg--note .tp-msg-bubble,
[data-theme="dark"] .tp-msg--note .tp-msg-bubble {
  background-color: rgba(120, 83, 0, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
}

/* ── Variant: AI Draft ── */
.tp-msg--ai .tp-msg-bubble {
  background-color: rgba(29, 75, 142, 0.04);
  border-color: rgba(29, 75, 142, 0.25);
  border-width: 2px;
  border-top-left-radius: 0.75rem;
}

/* ── Variant: Indented ── */
.tp-msg--indent {
  padding-left: 2rem;
}

/* ── AI Actions row (below AI bubble) ── */
.tp-msg-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
/**
 * TP Design System - Modal Dialog Components
 * Dialog windows for focused user interactions
 *
 * Usage (with Alpine.js):
 *   <div x-data="{ open: false }" @keydown.escape.window="open = false">
 *     <button @click="open = true">Open Modal</button>
 *     <div class="tp-modal-overlay" :class="open && 'open'" @click.self="open = false">
 *       <div class="tp-modal">
 *         <div class="tp-modal-header">
 *           <h3 class="tp-modal-title">Title</h3>
 *           <button @click="open = false" class="tp-modal-close">
 *             <i class="fas fa-times"></i>
 *           </button>
 *         </div>
 *         <div class="tp-modal-body">Content...</div>
 *         <div class="tp-modal-footer">
 *           <button @click="open = false">Close</button>
 *         </div>
 *       </div>
 *     </div>
 *   </div>
 *
 * Features:
 *   - ESC key closes modal (@keydown.escape.window)
 *   - Click outside closes modal (@click.self on overlay)
 *   - Close button in header
 */

/* ===========================
   Modal Overlay
   =========================== */
.tp-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tp-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ===========================
   Modal Container
   =========================== */
.tp-modal {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
}

.tp-modal-overlay.open .tp-modal {
  transform: scale(1) translateY(0);
}

/* ===========================
   Modal Sizes
   =========================== */
.tp-modal-sm {
  max-width: 24rem;
}

.tp-modal-lg {
  max-width: 48rem;
}

.tp-modal-xl {
  max-width: 64rem;
}

.tp-modal-full {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
}

/* ===========================
   Modal Header
   =========================== */
.tp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tp-border);
  flex-shrink: 0;
}

.tp-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--tp-text);
  line-height: 1.4;
}

.tp-modal-subtitle {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  margin-top: 0.125rem;
}

.tp-modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  color: var(--tp-text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tp-modal-close:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

/* ===========================
   Modal Body
   =========================== */
.tp-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.tp-modal-body-padded {
  padding: 1.5rem;
}

.tp-modal-body-compact {
  padding: 1rem;
}

/* ===========================
   Modal Footer
   =========================== */
.tp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
  flex-shrink: 0;
}

.tp-modal-footer-left {
  justify-content: flex-start;
}

.tp-modal-footer-between {
  justify-content: space-between;
}

.tp-modal-footer-center {
  justify-content: center;
}

.tp-modal-footer-stack {
  flex-direction: column;
  gap: 0.75rem;
}

.tp-modal-footer-stack > * {
  width: 100%;
}

/* ===========================
   Modal Variants
   =========================== */
.tp-modal-danger .tp-modal-header {
  background-color: rgba(239, 68, 68, 0.1);
  border-bottom-color: rgba(239, 68, 68, 0.2);
}

.tp-modal-danger .tp-modal-title {
  color: #ef4444;
}

.tp-modal-warning .tp-modal-header {
  background-color: rgba(234, 179, 8, 0.1);
  border-bottom-color: rgba(234, 179, 8, 0.2);
}

.tp-modal-warning .tp-modal-title {
  color: #ca8a04;
}

.tp-modal-success .tp-modal-header {
  background-color: rgba(34, 197, 94, 0.1);
  border-bottom-color: rgba(34, 197, 94, 0.2);
}

.tp-modal-success .tp-modal-title {
  color: #22c55e;
}

/* ===========================
   Confirm Dialog
   =========================== */
.tp-modal-confirm {
  max-width: 28rem;
  text-align: center;
}

.tp-modal-confirm .tp-modal-body {
  padding: 2rem 1.5rem;
}

.tp-modal-confirm-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.tp-modal-confirm-icon-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.tp-modal-confirm-icon-warning {
  background-color: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

.tp-modal-confirm-icon-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.tp-modal-confirm-icon-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.tp-modal-confirm-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--tp-text);
  margin-bottom: 0.5rem;
}

.tp-modal-confirm-text {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  line-height: 1.5;
}

.tp-modal-confirm .tp-modal-footer {
  justify-content: center;
  background-color: transparent;
  border-top: none;
  padding-top: 0;
}

/* ===========================
   Alert/Notification Modal
   =========================== */
.tp-modal-alert {
  max-width: 24rem;
}

.tp-modal-alert .tp-modal-body {
  text-align: center;
  padding: 1.5rem;
}

.tp-modal-alert .tp-modal-footer {
  justify-content: center;
  background-color: transparent;
  border-top: none;
}

/* ===========================
   Drawer Modal (Slide-in)
   =========================== */
.tp-modal-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  max-width: 28rem;
  max-height: 100vh;
  border-radius: 0;
  border-left: 1px solid var(--tp-border);
  transform: translateX(100%);
}

.tp-modal-overlay.open .tp-modal-drawer {
  transform: translateX(0);
}

.tp-modal-drawer-left {
  left: 0;
  right: auto;
  border-left: none;
  border-right: 1px solid var(--tp-border);
  transform: translateX(-100%);
}

.tp-modal-overlay.open .tp-modal-drawer-left {
  transform: translateX(0);
}
/**
 * TP Design System - Page Header
 * ConsoleHub list/detail title row
 */

.tp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tp-page-header-text {
  min-width: 0;
}

.tp-page-header-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tp-text);
  line-height: 1.3;
}

.tp-page-header-desc {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  line-height: 1.4;
}

.tp-page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
/**
 * TP Design System - Property Inspector Component
 * Flat key-value panel (Linear/Figma style), no cards/boxes.
 * Used in: Support ticket context, issue details, item metadata.
 *
 * Usage:
 *   <div class="tp-prop-panel">
 *     <div class="tp-prop-header">
 *       <span>BETRIFFT</span>
 *       <a href="#">Link</a>
 *     </div>
 *     <div class="tp-prop-row">
 *       <span class="tp-prop-label">Rechnung</span>
 *       <span class="tp-prop-value">Rg. Nr. 4408</span>
 *     </div>
 *     <div class="tp-prop-divider"></div>
 *     <div class="tp-prop-row tp-prop-row--link">
 *       <i class="..."></i>
 *       <div class="tp-prop-row-body">
 *         <span class="tp-prop-label">Status-Seite</span>
 *         <span class="tp-prop-sublabel">Kundenansicht</span>
 *       </div>
 *     </div>
 *   </div>
 */

/* ── Panel wrapper ── */
.tp-prop-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ── Section header ── */
.tp-prop-section {
  padding: 0.875rem 1rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tp-prop-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--tp-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tp-prop-section-action {
  font-size: 0.625rem;
  color: var(--tp-accent);
  text-decoration: none;
}

.tp-prop-section-action:hover {
  text-decoration: underline;
}

/* ── Row ── */
.tp-prop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--tp-border) 50%, transparent);
  gap: 0.5rem;
  transition: background-color 0.1s ease;
  min-height: 2rem;
}

.tp-prop-row:hover {
  background-color: color-mix(in srgb, var(--tp-hover-bg) 40%, transparent);
}

.tp-prop-row--section-end {
  border-bottom-color: var(--tp-border);
  margin-bottom: 0;
}

/* ── Row: profile (avatar + details) ── */
.tp-prop-row--profile {
  align-items: flex-start;
  gap: 0.625rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

/* ── Row: link (icon + body + external icon) ── */
.tp-prop-row--link {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.tp-prop-row--link:hover .tp-prop-label {
  color: var(--tp-accent);
}

.tp-prop-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

/* ── Label / Value ── */
.tp-prop-label {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  flex-shrink: 0;
}

.tp-prop-value {
  font-size: 0.75rem;
  color: var(--tp-text);
  font-weight: 500;
  text-align: right;
}

.tp-prop-value--mono {
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  color: var(--tp-text-secondary);
}

.tp-prop-value--danger {
  color: #dc2626;
  font-weight: 600;
}

.tp-prop-value--warning {
  color: #d97706;
  font-weight: 600;
}

.tp-prop-sublabel {
  font-size: 0.625rem;
  color: var(--tp-text-secondary);
}

/* ── Divider between sections ── */
.tp-prop-divider {
  height: 1px;
  background-color: var(--tp-border);
  margin: 0;
}

/* ── Stats grid (2-column) ── */
.tp-prop-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-prop-stat {
  background-color: var(--tp-hover-bg);
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
}

.tp-prop-stat-label {
  font-size: 0.6875rem;
  color: var(--tp-text-secondary);
  display: block;
}

.tp-prop-stat-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--tp-text);
  display: block;
}

.tp-prop-stat-value--warning {
  color: #d97706;
}
/**
 * TP Design System - Prose (Markdown) Component
 * GitHub-style markdown rendering
 *
 * Usage:
 *   <div class="tp-prose">
 *     <h1>Title</h1>
 *     <p>Paragraph with <strong>bold</strong> and <em>italic</em>.</p>
 *     <pre><code>code block</code></pre>
 *   </div>
 *
 * Variants: tp-prose-sm, tp-prose-lg
 */

/* ===========================
   Prose Container
   =========================== */
.tp-prose {
  font-size: 0.875rem;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: var(--tp-prose-text, var(--tp-text));
}

.tp-prose > *:first-child {
  margin-top: 0 !important;
}

.tp-prose > *:last-child {
  margin-bottom: 0 !important;
}

/* ===========================
   Headings
   =========================== */
.tp-prose h1,
.tp-prose h2,
.tp-prose h3,
.tp-prose h4,
.tp-prose h5,
.tp-prose h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--tp-prose-heading, var(--tp-text));
}

.tp-prose h1 {
  font-size: 2em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--tp-prose-border, var(--tp-border));
}

.tp-prose h2 {
  font-size: 1.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--tp-prose-border, var(--tp-border));
}

.tp-prose h3 {
  font-size: 1.25em;
}

.tp-prose h4 {
  font-size: 1em;
}

.tp-prose h5 {
  font-size: 0.875em;
}

.tp-prose h6 {
  font-size: 0.85em;
  color: var(--tp-prose-muted, var(--tp-text-secondary));
}

/* ===========================
   Paragraphs
   =========================== */
.tp-prose p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* ===========================
   Links
   =========================== */
.tp-prose a {
  color: var(--tp-prose-link, var(--tp-accent));
  text-decoration: none;
}

.tp-prose a:hover {
  text-decoration: underline;
}

/* ===========================
   Bold & Italic
   =========================== */
.tp-prose strong {
  font-weight: 600;
  color: var(--tp-prose-heading, var(--tp-text));
}

.tp-prose em {
  font-style: italic;
}

/* ===========================
   Lists
   =========================== */
.tp-prose ul,
.tp-prose ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2em;
}

.tp-prose ul {
  list-style-type: disc;
}

.tp-prose ol {
  list-style-type: decimal;
}

.tp-prose li {
  margin-top: 0.25rem;
}

.tp-prose li + li {
  margin-top: 0.25rem;
}

/* Nested lists */
.tp-prose ul ul,
.tp-prose ol ol,
.tp-prose ul ol,
.tp-prose ol ul {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Task lists */
.tp-prose ul.task-list {
  list-style-type: none;
  padding-left: 0;
}

.tp-prose .task-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.tp-prose .task-list-item input[type="checkbox"] {
  margin-top: 0.25rem;
}

/* ===========================
   Code - Inline
   =========================== */
.tp-prose code {
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  white-space: break-spaces;
  background-color: var(--tp-prose-code-bg, rgba(110, 118, 129, 0.15));
  border-radius: 6px;
  color: var(--tp-prose-text, var(--tp-text));
}

/* ===========================
   Code - Block
   =========================== */
.tp-prose pre {
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 1rem;
  overflow-x: auto;
  font-size: 85%;
  line-height: 1.45;
  color: var(--tp-prose-text, var(--tp-text));
  background-color: var(--tp-prose-pre-bg, var(--tp-hover-bg));
  border-radius: 6px;
  border: 1px solid var(--tp-prose-border, var(--tp-border));
  max-width: 100%;
}

.tp-prose pre code {
  padding: 0;
  margin: 0;
  font-size: 100%;
  word-break: normal;
  white-space: pre;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* ===========================
   Blockquotes
   =========================== */
.tp-prose blockquote {
  margin: 0 0 1rem 0;
  padding: 0 1em;
  color: var(--tp-prose-muted, var(--tp-text-secondary));
  border-left: 4px solid var(--tp-prose-border, var(--tp-border));
}

.tp-prose blockquote > *:last-child {
  margin-bottom: 0;
}

/* ===========================
   Tables
   =========================== */
.tp-prose table {
  width: 100%;
  margin-top: 0;
  margin-bottom: 1rem;
  border-spacing: 0;
  border-collapse: collapse;
  overflow: auto;
  display: block;
}

.tp-prose table th {
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--tp-prose-border, var(--tp-border));
  background-color: var(--tp-prose-table-alt-bg, var(--tp-hover-bg));
  color: var(--tp-prose-heading, var(--tp-text));
  text-align: left;
}

.tp-prose table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--tp-prose-border, var(--tp-border));
  color: var(--tp-prose-text, var(--tp-text));
}

.tp-prose table tr {
  background-color: var(--tp-prose-table-bg, var(--tp-surface));
  border-top: 1px solid var(--tp-prose-border, var(--tp-border));
}

.tp-prose table tr:nth-child(2n) {
  background-color: var(--tp-prose-table-alt-bg, var(--tp-hover-bg));
}

/* ===========================
   Images
   =========================== */
.tp-prose img {
  max-width: 100%;
  box-sizing: content-box;
  border-radius: 6px;
}

/* ===========================
   Horizontal Rules
   =========================== */
.tp-prose hr {
  height: 0.25em;
  padding: 0;
  margin: 1.5rem 0;
  background-color: var(--tp-prose-border, var(--tp-border));
  border: 0;
}

/* ===========================
   Mentions & Tags
   =========================== */
.tp-prose .mention {
  background-color: var(--tp-prose-mention-bg, rgba(29, 75, 142, 0.1));
  color: var(--tp-prose-link, var(--tp-accent));
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 500;
}

.tp-prose .hashtag {
  color: var(--tp-prose-link, var(--tp-accent));
}

/* ===========================
   Prose Sizes
   =========================== */
.tp-prose-sm {
  font-size: 0.75rem;
}

.tp-prose-sm h1 { font-size: 1.75em; }
.tp-prose-sm h2 { font-size: 1.375em; }
.tp-prose-sm h3 { font-size: 1.125em; }

.tp-prose-lg {
  font-size: 1rem;
}

.tp-prose-lg h1 { font-size: 2.25em; }
.tp-prose-lg h2 { font-size: 1.75em; }
.tp-prose-lg h3 { font-size: 1.375em; }

/* ===========================
   Prose Compact (less spacing)
   =========================== */
.tp-prose-compact p {
  margin-bottom: 0.5rem;
}

.tp-prose-compact ul,
.tp-prose-compact ol {
  margin-bottom: 0.5rem;
}

.tp-prose-compact h1,
.tp-prose-compact h2,
.tp-prose-compact h3,
.tp-prose-compact h4,
.tp-prose-compact h5,
.tp-prose-compact h6 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* ===========================
   Dark Mode Adjustments
   =========================== */
[data-theme="dark"] .tp-prose code {
  background-color: rgba(110, 118, 129, 0.25);
}

[data-theme="dark"] .tp-prose pre {
  background-color: rgba(22, 27, 34, 0.5);
}
/**
 * TP Design System - Resizable Panel Layout
 * 3-column layout with drag handles + collapsible bottom strip.
 * Also includes tp-split-view: 2-panel master-detail with optional search header.
 * Uses Alpine.js for state; CSS provides the structural skeleton.
 *
 * Usage (3-panel with Alpine.js):
 *   <div class="tp-panel-layout" x-data="{ leftW: 264, rightW: 272, ... }">
 *     <div class="tp-panel-left" :style="`width: ${leftW}px`">...</div>
 *     <div class="tp-panel-handle tp-panel-handle--v" @mousedown="startDrag('left', $event)">
 *       <div class="tp-panel-handle-line"></div>
 *     </div>
 *     <div class="tp-panel-main">...</div>
 *     <div class="tp-panel-handle tp-panel-handle--v" @mousedown="startDrag('right', $event)">
 *       <div class="tp-panel-handle-line"></div>
 *     </div>
 *     <div class="tp-panel-right" :style="`width: ${rightW}px`">...</div>
 *   </div>
 *
 * Bottom strip usage:
 *   <div class="tp-panel-strip">
 *     <div class="tp-panel-handle tp-panel-handle--h" x-show="open" @mousedown="startDrag('bottom', $event)">
 *       <div class="tp-panel-handle-line"></div>
 *     </div>
 *     <div class="tp-panel-strip-header">...</div>
 *     <div class="tp-panel-strip-body" x-show="open" :style="`height: ${h}px`">...</div>
 *   </div>
 */

/* ── Main layout container ── */
.tp-panel-layout {
  display: flex;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* ── Fixed-width side panels ── */
.tp-panel-left,
.tp-panel-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--tp-surface);
}

.tp-panel-left {
  border-right: 1px solid var(--tp-border);
}

.tp-panel-right {
  border-left: 1px solid var(--tp-border);
}

/* ── Main content panel ── */
.tp-panel-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Drag handles ── */
.tp-panel-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
  position: relative;
}

/* Vertical handle (between columns) — the handle IS the 1px line */
.tp-panel-handle--v {
  width: 1px;
  cursor: col-resize;
  align-self: stretch;
  flex-shrink: 0;
  background-color: var(--tp-border);
  position: relative;
  transition: background-color 0.15s ease;
}

/* Expand clickable area without affecting visual width */
.tp-panel-handle--v::before {
  content: '';
  position: absolute;
  inset-y: 0;
  left: -4px;
  right: -4px;
  cursor: col-resize;
  z-index: 1;
}

.tp-panel-handle--v:hover,
.tp-panel-handle--v:active {
  background-color: color-mix(in srgb, var(--tp-primary) 50%, transparent);
}

/* Horizontal handle (between rows) — the handle IS the 1px line */
.tp-panel-handle--h {
  height: 1px;
  cursor: row-resize;
  width: 100%;
  flex-shrink: 0;
  background-color: var(--tp-border);
  position: relative;
  transition: background-color 0.15s ease;
}

.tp-panel-handle--h::before {
  content: '';
  position: absolute;
  inset-x: 0;
  top: -4px;
  bottom: -4px;
  cursor: row-resize;
  z-index: 1;
}

.tp-panel-handle--h:hover,
.tp-panel-handle--h:active {
  background-color: color-mix(in srgb, var(--tp-primary) 50%, transparent);
}

/* Legacy inner line element — no longer needed, kept for compat */
.tp-panel-handle-line { display: none; }

/* ── Bottom strip (collapsible panel) ── */
.tp-panel-strip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--tp-surface);
}

.tp-panel-strip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-top: 1px solid var(--tp-border);
  min-height: 2.25rem;
  flex-shrink: 0;
  background-color: var(--tp-surface);
}

.tp-panel-strip-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-panel-strip-count {
  font-size: 0.625rem;
  color: var(--tp-text-secondary);
  font-weight: 400;
}

.tp-panel-strip-toggle {
  margin-left: auto;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  color: var(--tp-text-secondary);
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
  border: none;
  background: none;
}

.tp-panel-strip-toggle:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-panel-strip-body {
  overflow-y: auto;
  border-top: 1px solid color-mix(in srgb, var(--tp-border) 30%, transparent);
  min-height: 0;
}

/* ── Full-page wrapper when using ConsoleHub frame ── */
.tp-panel-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =============================================================================
   tp-split-view — 2-panel master/detail with optional search header
   Uses: tp-panel-layout, tp-panel-left, tp-panel-main, tp-panel-handle--v
   ============================================================================= */

/**
 * Outer card wrapper — single border, rounded, flex column.
 *
 * Usage:
 *   <div class="tp-split-view" x-data="{ panelWidth: 280, ... }">
 *     <div class="tp-split-view-search">
 *       <input class="tp-split-view-search-input" placeholder="Suchen…">
 *     </div>
 *     <div class="tp-split-view-body tp-panel-layout">
 *       <div class="tp-panel-left" :style="`width: ${panelWidth}px`">…</div>
 *       <div class="tp-panel-handle tp-panel-handle--v" @mousedown.prevent="startDrag($event)">…</div>
 *       <div class="tp-panel-main">…</div>
 *     </div>
 *   </div>
 *
 * Responsive: on small screens tp-split-view-body stacks vertically.
 * Use tp-split-view--mobile-list / tp-split-view--mobile-detail to toggle.
 */
.tp-split-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tp-border);
  border-radius: 0.75rem;
  background-color: var(--tp-surface);
  /* Default: stretch to fill parent height */
  flex: 1;
  min-height: 0;
}

/* Modifier: fix to full viewport (minus top chrome) */
.tp-split-view--fullpage {
  height: calc(100dvh - var(--tp-split-view-offset, 9rem));
  flex: none;
}

/* Modifier: grow with content, never smaller than 360px */
.tp-split-view--content {
  flex: none;
  height: auto;
  min-height: 360px;
}

/* Search bar spanning full width above both panels */
.tp-split-view-search {
  flex-shrink: 0;
  border-bottom: 1px solid var(--tp-border);
  padding: 0.625rem 1rem;
}

.tp-split-view-search-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem 0.375rem 2.25rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  outline: none;
  transition: border-color 0.15s;
}
.tp-split-view-search-input::placeholder { color: var(--tp-text-secondary); }
.tp-split-view-search-input:focus { border-color: var(--tp-accent); }

.tp-split-view-search-wrapper {
  position: relative;
}
.tp-split-view-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tp-text-secondary);
  font-size: 0.75rem;
  pointer-events: none;
}

/* Body = tp-panel-layout inside the card */
.tp-split-view-body {
  flex: 1;
  min-height: 0;
}

/* List panel item — highlighted active state */
.tp-split-view-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.1s, border-color 0.1s;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
}
.tp-split-view-item:hover {
  background-color: var(--tp-hover-bg, rgba(0,0,0,0.04));
}
.tp-split-view-item.active,
.tp-split-view-item[aria-selected="true"] {
  background-color: color-mix(in srgb, var(--tp-primary) 8%, transparent);
  border-left-color: var(--tp-accent);
}

/* ── Responsive: Mobile stacked ── */
@media (max-width: 767px) {
  /* In mobile mode, left and right stack instead of side-by-side */
  .tp-split-view-body.tp-panel-layout {
    flex-direction: column;
  }
  /* tp-panel-left becomes full-width on mobile */
  .tp-split-view-body .tp-panel-left {
    width: 100% !important;
    border-right: none;
    border-bottom: 1px solid var(--tp-border);
  }
  /* Handle hidden on mobile */
  .tp-split-view-body .tp-panel-handle--v {
    display: none;
  }
  /* Detail panel full-width */
  .tp-split-view-body .tp-panel-main {
    width: 100% !important;
  }
  /* Helper classes: toggle which panel is visible on mobile */
  .tp-split-view--mobile-detail .tp-panel-left { display: none; }
  .tp-split-view--mobile-list   .tp-panel-main { display: none; }
}
/**
 * TP Design System - Service Bar Component
 * Second navigation bar below the main topbar (Google Cloud Console pattern)
 *
 * Usage:
 *   <div class="tp-service-bar">
 *     <div class="tp-service-bar-identity">
 *       <i class="fas fa-headset tp-service-bar-icon"></i>
 *       <span class="tp-service-bar-name">SupportHub</span>
 *     </div>
 *     <nav class="tp-service-bar-nav">
 *       <a href="..." class="tp-service-bar-tab active">Dashboard</a>
 *       <a href="..." class="tp-service-bar-tab">Anfragen</a>
 *       <a href="..." class="tp-service-bar-tab">Einstellungen</a>
 *     </nav>
 *     <div class="tp-service-bar-actions">
 *       <!-- Optional right-side actions -->
 *     </div>
 *   </div>
 *
 * Sits at top: 56px (below tp-topbar at 56px)
 * Content gets margin-top: 104px (56 + 48)
 */

/* ===========================
   Service Bar Container
   =========================== */
.tp-service-bar {
  position: fixed;
  top: 3.5rem; /* 56px — directly below tp-topbar */
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  height: 3rem; /* 48px */
  padding: 0 1rem;
  background-color: var(--tp-surface);
  border-bottom: 1px solid var(--tp-border);
  gap: 1rem;
}

/* ===========================
   Service Identity (left side)
   =========================== */
.tp-service-bar-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-right: 1rem;
  border-right: 1px solid var(--tp-border);
}

/* Steht die Identität allein in der Bar (keine Nav, kein Breadcrumb — so die
   Apps-Shell seit Plan 0085), trennt der Strich nichts mehr ab. */
.tp-service-bar-identity:last-child {
  border-right: 0;
}

.tp-service-bar-icon {
  font-size: 0.875rem;
  color: var(--tp-accent);
}

.tp-service-bar-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tp-text);
  white-space: nowrap;
}

/* Identity as link — wrap icon + name in <a> for clickable home navigation */
.tp-service-bar-identity a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  border-radius: 0.25rem;
  transition: opacity 0.15s;
}

.tp-service-bar-identity a:hover {
  opacity: 0.7;
}

/* ===========================
   Breadcrumb (wenn Sidebar vorhanden — ersetzt Nav-Tabs)
   =========================== */
.tp-service-bar-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--tp-text-secondary);
  min-width: 0;
  overflow: hidden;
}

.tp-service-bar-breadcrumb a,
.tp-service-bar-breadcrumb .tp-admin-breadcrumb-link {
  color: var(--tp-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.1s;
  font-size: 0.8125rem;
}

.tp-service-bar-breadcrumb a:hover,
.tp-service-bar-breadcrumb .tp-admin-breadcrumb-link:hover {
  color: var(--tp-accent);
}

.tp-service-bar-breadcrumb-sep {
  margin: 0 0.375rem;
  color: var(--tp-border);
  flex-shrink: 0;
}

.tp-service-bar-breadcrumb span {
  color: var(--tp-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   Navigation Tabs (center, wenn keine Sidebar)
   =========================== */
.tp-service-bar-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.tp-service-bar-nav::-webkit-scrollbar {
  display: none;
}

.tp-service-bar-tab {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  position: relative;
}

.tp-service-bar-tab:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

.tp-service-bar-tab.active {
  color: var(--tp-accent);
  border-bottom-color: var(--tp-accent);
  font-weight: 600;
}

/* ===========================
   Right Actions (optional)
   =========================== */
.tp-service-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* ===========================
   Page content offset
   (use when both topbar + service-bar are fixed)
   =========================== */
.tp-with-service-bar {
  padding-top: 6.5rem; /* 56px topbar + 48px service-bar + 8px gap */
}
/**
 * TP-UI Sidebar Section Component
 *
 * A reusable sidebar section with optional gear menu dropdown.
 * Uses Alpine.js for interactivity.
 *
 * Usage:
 *   <div class="tp-sidebar-section" x-data="{ menuOpen: false }">
 *     <div class="tp-sidebar-section-header">
 *       <span class="tp-sidebar-section-title">Zugewiesen</span>
 *       <button @click="menuOpen = !menuOpen" class="tp-sidebar-section-gear">
 *         <i class="fas fa-cog"></i>
 *       </button>
 *     </div>
 *     <div x-show="menuOpen" class="tp-sidebar-section-dropdown">
 *       <!-- dropdown content -->
 *     </div>
 *     <div class="tp-sidebar-section-content">
 *       <!-- section content -->
 *     </div>
 *   </div>
 */

/* ===========================
   Sidebar Section Container
   =========================== */
.tp-sidebar-section {
  position: relative;
  border-bottom: 1px solid var(--tp-border);
  padding-bottom: 1rem;
  /* Allow dropdowns to overflow and appear above other sections */
  overflow: visible;
}

/* When dropdown is open, section needs higher z-index */
/* Only use class-based approach - :has() with x-cloak doesn't work reliably with Alpine's x-show */
.tp-sidebar-section-dropdown-open {
  z-index: 100;
}

.tp-sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ===========================
   Section Header
   =========================== */
.tp-sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.tp-sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--tp-text-secondary);
}

/* ===========================
   Gear Button
   =========================== */
.tp-sidebar-section-gear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  color: var(--tp-text-secondary);
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all 0.15s ease;
}

.tp-sidebar-section-gear:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

.tp-sidebar-section-gear:focus {
  outline: none;
}

.tp-sidebar-section-gear:focus-visible {
  outline: 2px solid var(--tp-accent);
  outline-offset: 2px;
}

.tp-sidebar-section-gear i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.tp-sidebar-section-gear:hover i {
  transform: rotate(45deg);
}

/* ===========================
   Section Dropdown Menu
   =========================== */
.tp-sidebar-section-dropdown {
  position: absolute;
  top: 1.75rem;
  left: 0;
  right: 0;
  z-index: 110;
  min-width: 100%;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  isolation: isolate;
}

.tp-sidebar-section-dropdown[x-cloak] {
  display: none !important;
}

/* Dropdown Header */
.tp-sidebar-section-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tp-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tp-text);
  background-color: var(--tp-surface);
}

/* Dropdown Search */
.tp-sidebar-section-dropdown-search {
  padding: 0.5rem;
  border-bottom: 1px solid var(--tp-border);
  background-color: var(--tp-surface);
}

.tp-sidebar-section-dropdown-search input {
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  background-color: var(--tp-input-bg);
  border: 1px solid var(--tp-input-border);
  border-radius: 0.375rem;
  color: var(--tp-text);
}

.tp-sidebar-section-dropdown-search input:focus {
  outline: none;
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 2px rgba(29, 75, 142, 0.2);
}

.tp-sidebar-section-dropdown-search input::placeholder {
  color: var(--tp-text-secondary);
}

/* Dropdown List Container */
.tp-sidebar-section-dropdown-list {
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.25rem 0;
  background-color: var(--tp-surface);
  display: flex;
  flex-direction: column;
}

/* Dropdown Item */
.tp-sidebar-section-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  cursor: pointer;
  transition: background-color 0.1s ease;
  background-color: var(--tp-surface);
  position: relative;
  width: 100%;
  text-align: left;
  border: none;
  box-sizing: border-box;
  flex-shrink: 0;
}

.tp-sidebar-section-dropdown-item:hover {
  background-color: var(--tp-hover-bg);
}

/* Item with checkbox */
.tp-sidebar-section-dropdown-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--tp-border);
  cursor: pointer;
}

/* Item avatar/icon */
.tp-sidebar-section-dropdown-item-avatar {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background-color: var(--tp-hover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
}

/* Item text */
.tp-sidebar-section-dropdown-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Item description */
.tp-sidebar-section-dropdown-item-desc {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

/* Item check mark (for selected items) */
.tp-sidebar-section-dropdown-item-check {
  width: 1rem;
  color: var(--tp-accent);
  opacity: 0;
}

.tp-sidebar-section-dropdown-item.selected .tp-sidebar-section-dropdown-item-check {
  opacity: 1;
}

/* Dropdown Footer */
.tp-sidebar-section-dropdown-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--tp-border);
}

.tp-sidebar-section-dropdown-footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  border-radius: 0.25rem;
  transition: all 0.1s ease;
}

.tp-sidebar-section-dropdown-footer-link:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Section Content
   =========================== */
.tp-sidebar-section-content {
  position: relative;
  z-index: 1;
}

/* Empty state */
.tp-sidebar-section-empty {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  font-style: italic;
}

/* ===========================
   Content Variants
   =========================== */

/* User/Assignee display - uses tp-avatar component for the avatar */
.tp-sidebar-section-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-sidebar-section-user-name {
  font-size: 0.875rem;
  color: var(--tp-text);
}

/* Labels display */
.tp-sidebar-section-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* Resource/Link display */
.tp-sidebar-section-resource {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.tp-sidebar-section-resource-icon {
  font-size: 1rem;
}

.tp-sidebar-section-resource-content {
  flex: 1;
  min-width: 0;
}

.tp-sidebar-section-resource-title {
  font-size: 0.875rem;
  color: var(--tp-accent);
}

.tp-sidebar-section-resource-title:hover {
  text-decoration: underline;
}

.tp-sidebar-section-resource-desc {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
}

/* Dark mode: make resource description more readable */
[data-theme="dark"] .tp-sidebar-section-resource-desc,
.dark .tp-sidebar-section-resource-desc {
  color: var(--tp-text-muted, #9ca3af);
}

/* Actions list */
.tp-sidebar-section-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tp-sidebar-section-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  transition: color 0.1s ease;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.tp-sidebar-section-action:hover {
  color: var(--tp-text);
}

.tp-sidebar-section-action i {
  width: 1rem;
}

.tp-sidebar-section-action-danger {
  color: #dc2626;
}

.tp-sidebar-section-action-danger:hover {
  color: #b91c1c;
}

/* ===========================
   Animations
   =========================== */
.tp-sidebar-section-dropdown {
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

/* Hide with x-cloak and animate entry */
.tp-sidebar-section-dropdown:not([x-cloak]) {
  animation: sidebar-dropdown-enter 0.1s ease-out;
}

@keyframes sidebar-dropdown-enter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/**
 * TP Design System - Sidebar Component
 * Application sidebar navigation
 *
 * Usage:
 *   <aside class="tp-sidebar">
 *     <nav class="tp-sidebar-nav">
 *       <div class="tp-sidebar-section">
 *         <p class="tp-sidebar-heading">Navigation</p>
 *         <a href="#" class="tp-sidebar-link active">
 *           <i class="fas fa-home tp-sidebar-link-icon"></i>
 *           <span>Dashboard</span>
 *         </a>
 *       </div>
 *     </nav>
 *   </aside>
 *
 * Mobile: Uses Alpine.js for slide-in animation
 */

/* ===========================
   Sidebar Container
   =========================== */
.tp-sidebar {
  position: fixed;
  left: 0;
  top: 3.5rem; /* Below topbar */
  bottom: 0;
  width: 13rem; /* 208px */
  background-color: var(--tp-sidebar-bg, var(--tp-surface));
  border-right: 1px solid var(--tp-border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  transform: translateX(0);
  transition: transform 0.2s ease, width 0.2s ease;
}

/* Die Grenze zwischen Schubfach und fester Leiste liegt bei 1024 px, und
   zwar auf DERSELBEN Seite wie überall sonst.

   Hier stand `max-width: 1024px`, während `admin-layout.css` den Inhalt
   ab `min-width: 1024px` um 13rem einrückt. Bei genau 1024 px griffen
   beide: die Leiste war weggeschoben und der Inhalt trotzdem eingerückt —
   eine 208 px breite leere Rinne, und die Navigation dahinter nur über
   den Griff erreichbar. `1023.98px` ist die übliche Schreibweise dafür,
   dass 1024 zum Desktop gehört; ein ganzzahliges `1023px` würde auf
   Bildschirmen mit gebrochener Gerätebreite eine Lücke lassen. */
/* Mobile: Hidden by default */
@media (max-width: 1023.98px) {
  .tp-sidebar {
    transform: translateX(-100%);
  }

  .tp-sidebar.open {
    transform: translateX(0);
  }
}

/* ===========================
   Sidebar Navigation
   =========================== */
.tp-sidebar-nav {
  padding: 1rem 0;
}

/* ===========================
   Sidebar Section
   =========================== */
.tp-sidebar-section {
  margin-bottom: 0.5rem;
}

/* ===========================
   Sidebar Heading
   =========================== */
.tp-sidebar-heading {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tp-text-secondary);
}

/* ===========================
   Sidebar Link
   =========================== */
.tp-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin: 0.125rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
}

.tp-sidebar-link:hover {
  background-color: var(--tp-hover-bg);
  color: var(--tp-text);
}

.tp-sidebar-link:focus {
  outline: none;
}

.tp-sidebar-link:focus-visible {
  outline: 2px solid var(--tp-accent);
  outline-offset: -2px;
}

/* Active state */
.tp-sidebar-link.active {
  background-color: var(--tp-border);
  color: var(--tp-text);
  font-weight: var(--tp-font-weight-semibold);
}

.tp-sidebar-link.active .tp-sidebar-link-icon {
  color: var(--tp-text);
}

/* Planned state: the entry is announced, the page does not exist yet.
   Rendered on a <span> rather than an <a> (there is nothing to link to),
   so this only has to take the colour back and switch the hover off. */
.tp-sidebar-link-planned,
.tp-sidebar-link-planned:hover {
  color: var(--tp-text-secondary);
  background-color: transparent;
  cursor: default;
}

.tp-sidebar-link-planned .tp-sidebar-link-icon,
.tp-sidebar-link-planned:hover .tp-sidebar-link-icon {
  color: var(--tp-text-secondary);
  opacity: 0.6;
}

/* ===========================
   Sidebar Link Icon
   =========================== */
.tp-sidebar-link-icon {
  width: 1rem;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  flex-shrink: 0;
  text-align: center;
}

.tp-sidebar-link:hover .tp-sidebar-link-icon {
  color: var(--tp-text);
}

/* ===========================
   Sidebar Divider
   =========================== */
.tp-sidebar-divider {
  height: 1px;
  margin: 0.5rem 1rem;
  background-color: var(--tp-border);
}

/* ===========================
   Sidebar Badge
   =========================== */
.tp-sidebar-badge {
  margin-left: auto;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: white;
  background-color: var(--tp-primary);
  border-radius: 9999px;
}

.tp-sidebar-badge-danger {
  background-color: #ef4444;
}

.tp-sidebar-badge-warning {
  background-color: #f59e0b;
}

/* ===========================
   Sidebar Collapsible
   =========================== */
.tp-sidebar-collapsible {
  /* Container for collapsible section */
}

.tp-sidebar-collapsible-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin: 0.125rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
  background: none;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-align: left;
}

.tp-sidebar-collapsible-trigger:hover {
  background-color: var(--tp-hover-bg);
}

.tp-sidebar-collapsible-trigger-icon {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  transition: transform 0.2s ease;
}

.tp-sidebar-collapsible-trigger[aria-expanded="true"] .tp-sidebar-collapsible-trigger-icon {
  transform: rotate(180deg);
}

.tp-sidebar-collapsible-content {
  padding-left: 1rem;
}

/* ===========================
   Sidebar Footer
   =========================== */
.tp-sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  border-top: 1px solid var(--tp-border);
  background-color: var(--tp-sidebar-bg, var(--tp-surface));
}

/* ===========================
   Sidebar Overlay (Mobile)
   =========================== */
.tp-sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 35;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tp-sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1024px) {
  .tp-sidebar-overlay {
    display: none;
  }
}

/* ===========================
   Sidebar Variants
   =========================== */

/* Compact sidebar */
.tp-sidebar-compact {
  width: 4rem;
}

.tp-sidebar-compact .tp-sidebar-link {
  justify-content: center;
  padding: 0.75rem;
}

.tp-sidebar-compact .tp-sidebar-link span {
  display: none;
}

.tp-sidebar-compact .tp-sidebar-link-icon {
  width: auto;
  font-size: 1.125rem;
}

.tp-sidebar-compact .tp-sidebar-heading {
  display: none;
}

.tp-sidebar-compact .tp-sidebar-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  margin-left: 0;
}

.tp-sidebar-compact .tp-sidebar-link {
  position: relative;
}

/* Dark sidebar */
.tp-sidebar-dark {
  background-color: #1f2937;
  border-right-color: #374151;
}

.tp-sidebar-dark .tp-sidebar-heading {
  color: #9ca3af;
}

.tp-sidebar-dark .tp-sidebar-link {
  color: #e5e7eb;
}

.tp-sidebar-dark .tp-sidebar-link:hover {
  background-color: #374151;
}

.tp-sidebar-dark .tp-sidebar-link-icon {
  color: #9ca3af;
}

.tp-sidebar-dark .tp-sidebar-divider {
  background-color: #374151;
}

/* ===========================
   Sidebar with Top Padding
   =========================== */
.tp-sidebar-with-topbar {
  top: 3.5rem;
}

.tp-sidebar-no-topbar {
  top: 0;
}

/* ConsoleHub integration: Sidebar startet unter Topbar (56px) + Service Bar (48px) = 104px */
.tp-sidebar-with-consolehub {
  top: 6.5rem;
}

/* Native disclosure keeps secondary navigation keyboard-accessible. */
.tp-sidebar-disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.tp-sidebar-disclosure > summary::-webkit-details-marker { display: none; }
.tp-sidebar-disclosure > summary::after { content: "›"; font-size: 1rem; transition: transform .15s ease; }
.tp-sidebar-disclosure[open] > summary::after { transform: rotate(90deg); }
.tp-sidebar-disclosure > summary:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: -2px; }
/**
 * TP Design System - Skeleton Loading Components
 * Scaffold/placeholder elements for loading states
 *
 * Usage:
 *   <div class="tp-skeleton tp-skeleton-text"></div>
 *   <div class="tp-skeleton tp-skeleton-avatar"></div>
 */

/* ===========================
   Base Skeleton
   =========================== */
.tp-skeleton {
  background: linear-gradient(
    90deg,
    var(--tp-hover-bg) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--tp-hover-bg) 75%
  );
  background-size: 200% 100%;
  animation: tp-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.25rem;
}

@keyframes tp-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===========================
   Skeleton Text
   =========================== */
.tp-skeleton-text {
  height: 0.875rem;
  margin-bottom: 0.5rem;
}

.tp-skeleton-text:last-child {
  margin-bottom: 0;
}

.tp-skeleton-text-sm {
  height: 0.75rem;
}

.tp-skeleton-text-lg {
  height: 1.25rem;
}

.tp-skeleton-text-xl {
  height: 1.5rem;
}

/* Skeleton Title */
.tp-skeleton-title {
  height: 1.5rem;
  width: 40%;
  margin-bottom: 1rem;
}

/* ===========================
   Skeleton Avatar
   =========================== */
.tp-skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.tp-skeleton-avatar-sm {
  width: 2rem;
  height: 2rem;
}

.tp-skeleton-avatar-lg {
  width: 3rem;
  height: 3rem;
}

.tp-skeleton-avatar-xl {
  width: 4rem;
  height: 4rem;
}

/* ===========================
   Skeleton Button
   =========================== */
.tp-skeleton-button {
  height: 2.25rem;
  width: 6rem;
  border-radius: 0.375rem;
}

.tp-skeleton-button-sm {
  height: 1.75rem;
  width: 4rem;
}

.tp-skeleton-button-lg {
  height: 2.75rem;
  width: 8rem;
}

/* ===========================
   Skeleton Icon
   =========================== */
.tp-skeleton-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
}

.tp-skeleton-icon-sm {
  width: 2rem;
  height: 2rem;
}

.tp-skeleton-icon-lg {
  width: 3rem;
  height: 3rem;
}

/* ===========================
   Skeleton Card
   =========================== */
.tp-skeleton-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  padding: 1rem;
}

.tp-skeleton-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-skeleton-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===========================
   Skeleton Stat Card
   =========================== */
.tp-skeleton-stat-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.tp-skeleton-stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tp-skeleton-stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
}

.tp-skeleton-stat-value {
  height: 2rem;
  width: 60%;
  margin-top: 0.5rem;
}

.tp-skeleton-stat-label {
  height: 0.75rem;
  width: 40%;
}

/* ===========================
   Skeleton Table
   =========================== */
.tp-skeleton-table {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tp-skeleton-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background-color: var(--tp-hover-bg);
  border-bottom: 1px solid var(--tp-border);
}

.tp-skeleton-table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-skeleton-table-row:last-child {
  border-bottom: none;
}

.tp-skeleton-table-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ===========================
   Skeleton List
   =========================== */
.tp-skeleton-list {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tp-skeleton-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-skeleton-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-skeleton-list-item:last-child {
  border-bottom: none;
}

.tp-skeleton-list-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* ===========================
   Skeleton Image / Media
   =========================== */
.tp-skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
}

.tp-skeleton-image-square {
  aspect-ratio: 1 / 1;
}

.tp-skeleton-image-portrait {
  aspect-ratio: 3 / 4;
}

/* ===========================
   Skeleton Form
   =========================== */
.tp-skeleton-input {
  height: 2.5rem;
  border-radius: 0.5rem;
}

.tp-skeleton-label {
  height: 0.875rem;
  width: 30%;
  margin-bottom: 0.5rem;
}

.tp-skeleton-textarea {
  height: 6rem;
  border-radius: 0.5rem;
}
/**
 * TP Design System - Surface card (admin content blocks)
 * Complements tp-card; matches ConsoleHub rounded-xl surface panels
 */

.tp-surface-card {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.75rem;
  overflow: hidden;
}

.tp-surface-card-dashed {
  border-style: dashed;
  opacity: 0.9;
}

.tp-surface-card-header {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
}

.tp-surface-card-header-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tp-text-secondary);
}

.tp-surface-card-body {
  padding: 1rem 1.25rem;
  color: var(--tp-text);
  font-size: 0.875rem;
}

.tp-surface-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--tp-border);
  background-color: var(--tp-hover-bg);
}
/**
 * TabInline — content-switching tabs within a detail/single-record view
 *
 * Different from tp-data-table-tabs (filter tabs on list views).
 * These navigate between content sections in a detail page, e.g.:
 * "Kerndaten | Bestellungen (12) | Lagerstand | Idealo"
 *
 * Usage (with Alpine.js):
 *   <div x-data="{ tab: 'kerndaten' }">
 *     <div class="tp-tab-inline-bar">
 *       <button class="tp-tab-inline-tab" :class="tab==='kerndaten'?'active':''" @click="tab='kerndaten'">
 *         Kerndaten
 *       </button>
 *     </div>
 *     <div class="tp-tab-inline-content">
 *       <div x-show="tab==='kerndaten'">...</div>
 *     </div>
 *   </div>
 *
 * Usage (with HTMX):
 *   <button class="tp-tab-inline-tab active"
 *     hx-get="/fragments/article-orders?id=123"
 *     hx-target="#tab-content"
 *     hx-swap="innerHTML">
 *     Bestellungen
 *   </button>
 */

.tp-tab-inline-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  flex-shrink: 0;
}

.tp-tab-inline-bar::-webkit-scrollbar { display: none; }

.tp-tab-inline-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tp-text-secondary, #6d7175);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s;
}

.tp-tab-inline-tab:hover {
  color: var(--tp-text, #202223);
}

.tp-tab-inline-tab.active {
  color: var(--tp-accent, #1d4b8e);
  border-bottom-color: var(--tp-accent, #1d4b8e);
  font-weight: 600;
}

/* Count badge on a tab */
.tp-tab-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  background: var(--tp-hover-bg, #f3f4f6);
  color: var(--tp-text-secondary, #6d7175);
  transition: background 0.12s, color 0.12s;
}

.tp-tab-inline-tab.active .tp-tab-inline-badge {
  background: var(--tp-primary, #1d4b8e);
  color: #fff;
}

/* Small variant — for denser layouts */
.tp-tab-inline-bar--sm .tp-tab-inline-tab {
  padding: 7px 11px;
  font-size: 12px;
}

/* Optional subtitle below tab label (like CockpitHub's TabsInlineSmall) */
.tp-tab-inline-label-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.tp-tab-inline-subtitle {
  font-size: 10px;
  font-weight: 400;
  color: var(--tp-text-secondary, #6d7175);
  line-height: 1.2;
}

.tp-tab-inline-tab.active .tp-tab-inline-subtitle {
  color: var(--tp-accent, #1d4b8e);
  opacity: 0.75;
}

/* Content area below the tab bar */
.tp-tab-inline-content {
  padding: 16px 0 0;
}
/**
 * TP Design System - Timeline Component
 * GitHub-style comment timeline with avatars and events
 */

/* ===========================
   Timeline Container
   =========================== */
.tp-timeline {
  position: relative;
  /* Line runs along the left side, through avatar centers */
  --timeline-line-left: 1.25rem; /* Center of 2.5rem avatar */
}

/* Vertical line - continuous from top to bottom */
.tp-timeline::before {
  content: '';
  position: absolute;
  left: var(--timeline-line-left);
  top: 1.25rem; /* Start at first avatar center */
  bottom: 1.25rem; /* End at last avatar center */
  width: 2px;
  background-color: var(--tp-border);
  z-index: 0;
}

/* ===========================
   Timeline Item (Comment)
   =========================== */
.tp-timeline-item {
  position: relative;
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
}

.tp-timeline-item:last-child {
  padding-bottom: 0;
}

/* Avatar */
.tp-timeline-item-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  z-index: 1;
}

.tp-timeline-item-avatar .tp-avatar {
  width: 2.5rem;
  height: 2.5rem;
  box-shadow: 0 0 0 4px var(--tp-content-bg, #f5f5f5);
}

/* Content */
.tp-timeline-item-content {
  flex: 1;
  min-width: 0;
  position: relative;
}

/* ===========================
   Timeline Event (Label, Assignment, etc.)
   =========================== */
.tp-timeline-event {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  line-height: 1.5;
}

/* More space between last event and following comment */
.tp-timeline-event + .tp-timeline-item {
  margin-top: 0.75rem;
}

/* Event icon container */
.tp-timeline-event-icon {
  flex-shrink: 0;
  width: 2.5rem;
  display: flex;
  justify-content: center;
  z-index: 1;
}

/* Event icon - covers the line */
.tp-timeline-event-icon i,
.tp-timeline-event-icon svg {
  font-size: 1rem;
  color: var(--tp-text-secondary);
  background-color: var(--tp-content-bg, #f5f5f5);
  padding: 0.25rem;
  /* Ensure icon covers the timeline line */
  position: relative;
  z-index: 1;
}

/* Icon color variants */
.tp-timeline-event-icon-success i,
.tp-timeline-event-icon-success svg {
  color: #22c55e;
}

.tp-timeline-event-icon-danger i,
.tp-timeline-event-icon-danger svg {
  color: #ef4444;
}

.tp-timeline-event-icon-warning i,
.tp-timeline-event-icon-warning svg {
  color: #f59e0b;
}

.tp-timeline-event-icon-info i,
.tp-timeline-event-icon-info svg {
  color: #3b82f6;
}

.tp-timeline-event-icon-purple i,
.tp-timeline-event-icon-purple svg {
  color: #8b5cf6;
}

/* Event text */
.tp-timeline-event-text {
  flex: 1;
  padding-top: 0.125rem;
}

.tp-timeline-event-text strong {
  color: var(--tp-text);
  font-weight: 600;
}

.tp-timeline-event-text a {
  color: var(--tp-accent);
  text-decoration: none;
}

.tp-timeline-event-text a:hover {
  text-decoration: underline;
}

.tp-timeline-event-time {
  margin-left: 0.5rem;
  color: var(--tp-text-secondary);
}

/* ===========================
   Comment Card
   =========================== */
.tp-comment-card {
  position: relative;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  /* Note: overflow: hidden removed to allow arrow pseudo-elements to show */
}

/* Arrow pointing to avatar */
.tp-comment-card::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 14px;
  border: 8px solid transparent;
  border-right-color: var(--tp-border);
  border-left: 0;
}

.tp-comment-card::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 15px;
  border: 7px solid transparent;
  border-right-color: var(--tp-hover-bg);
  border-left: 0;
}

/* Highlighted comment */
.tp-comment-card-highlighted {
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 3px var(--tp-focus-ring);
}

/* Comment header */
.tp-comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--tp-hover-bg);
  border-bottom: 1px solid var(--tp-border);
}

.tp-comment-card-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.875rem;
}

.tp-comment-card-header-author {
  font-weight: 600;
  color: var(--tp-text);
}

.tp-comment-card-header-time {
  color: var(--tp-text-secondary);
}

.tp-comment-card-header-badge {
  margin-left: 0.125rem;
}

.tp-comment-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Comment body */
.tp-comment-card-body {
  padding: 0.75rem;
}

/* ===========================
   Reactions
   =========================== */
.tp-comment-card-reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.tp-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tp-reaction-btn:hover {
  background-color: var(--tp-hover-bg);
}

.tp-reaction-emoji {
  font-size: 1rem;
  line-height: 1;
}

.tp-reaction-count {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Add reaction button (smiley) - always first/left */
.tp-reaction-add {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  color: var(--tp-text-secondary);
  background: transparent;
  border: 1px solid var(--tp-border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  order: -1; /* Always first */
}

.tp-reaction-add:hover {
  color: var(--tp-text);
  border-color: var(--tp-text-secondary);
}

.tp-reaction-add > i {
  font-size: 0.75rem;
}

/* Reaction picker popup - hidden by default, shown via JS/Alpine */
.tp-reaction-picker {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem;
  background-color: #1f2937;
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

/* Show picker when parent has .open class (for JS/Alpine toggle) */
.tp-reaction-add.open .tp-reaction-picker,
.tp-reaction-picker.show {
  display: flex;
}

.tp-reaction-picker::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background-color: #1f2937;
}

.tp-reaction-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 1rem;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.1s ease;
  padding: 0;
}

.tp-reaction-picker-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.15);
}

.tp-reaction-picker-btn.active {
  background-color: rgba(59, 130, 246, 0.3);
}

/* Demo: show picker inline for documentation */
.tp-reaction-picker-demo {
  display: flex;
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
}

.tp-reaction-picker-demo::after {
  display: none;
}

/* ===========================
   Timeline Variants
   =========================== */

/* Without line */
.tp-timeline-no-line::before {
  display: none;
}

/* Compact */
.tp-timeline-compact .tp-timeline-event {
  padding: 0.375rem 0;
}

.tp-timeline-compact .tp-timeline-item {
  padding-bottom: 1rem;
}

/* ===========================
   Loading State
   =========================== */
.tp-timeline-loading-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
}

.tp-timeline-loading-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--tp-border);
  border-radius: 50%;
  animation: tp-skeleton-pulse 1.5s ease-in-out infinite;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--tp-content-bg, #f5f5f5);
}

.tp-timeline-loading-content {
  flex: 1;
  height: 6rem;
  background-color: var(--tp-border);
  border-radius: 0.5rem;
  animation: tp-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes tp-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
  .tp-timeline-item-avatar {
    width: 2rem;
  }

  .tp-timeline::before {
    left: 1rem;
  }

  .tp-timeline-event-icon {
    width: 2rem;
  }

  .tp-comment-card-body {
    padding: 0.5rem;
  }
}

/* ===========================
   Dark Mode
   =========================== */
[data-theme="dark"] .tp-timeline-item-avatar .tp-avatar {
  box-shadow: 0 0 0 4px var(--tp-content-bg, #1a1a1a);
}

[data-theme="dark"] .tp-timeline-event-icon i,
[data-theme="dark"] .tp-timeline-event-icon svg {
  background-color: var(--tp-content-bg, #1a1a1a);
}
/**
 * TP Design System - Toast Notifications
 *
 * Usage (Alpine.js + HTMX):
 *   Server sends HX-Trigger: {"show-toast": {"message": "...", "type": "success"}}
 *   Alpine component in notifications.html listens for the window event and renders toasts.
 */

.tp-toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 24rem;
}

.tp-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-left-width: 3px;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--tp-text);
  pointer-events: auto;
  animation: tp-toast-in 0.2s ease-out;
}

.tp-toast-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.tp-toast-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tp-info);
  text-decoration: none;
  white-space: nowrap;
}

.tp-toast-link:hover {
  text-decoration: underline;
}

.tp-toast-success { border-left-color: var(--tp-success); }
.tp-toast-error   { border-left-color: var(--tp-danger); }
.tp-toast-warning { border-left-color: var(--tp-warning); }
.tp-toast-info    { border-left-color: var(--tp-info); }

.tp-toast-icon {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}

.tp-toast-success .tp-toast-icon { color: var(--tp-success); }
.tp-toast-error   .tp-toast-icon { color: var(--tp-danger); }
.tp-toast-warning .tp-toast-icon { color: var(--tp-warning); }
.tp-toast-info    .tp-toast-icon { color: var(--tp-info); }

@keyframes tp-toast-in {
  from { opacity: 0; transform: translateX(0.75rem); }
  to   { opacity: 1; transform: translateX(0); }
}
/**
 * TP Design System - Topbar Component
 * Application header with navigation, branding, and user menu
 *
 * Usage:
 *   <header class="tp-topbar">
 *     <div class="tp-topbar-start">
 *       <a href="#" class="tp-topbar-brand">
 *         <div class="tp-logo tp-logo-shine">...</div>
 *         <span class="tp-topbar-brand-text">AppName</span>
 *       </a>
 *     </div>
 *     <div class="tp-topbar-end">
 *       <button class="tp-topbar-icon-btn">...</button>
 *       <div class="tp-topbar-user">...</div>
 *     </div>
 *   </header>
 *
 * Uses Alpine.js for mobile menu and user dropdown
 */

/* ===========================
   Topbar Container
   =========================== */
.tp-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem; /* 56px */
  padding: 0 1rem;
  background-color: var(--tp-nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===========================
   Topbar Sections
   =========================== */
.tp-topbar-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tp-topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.tp-topbar-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===========================
   Topbar Brand
   =========================== */
.tp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.tp-topbar-brand:hover {
  opacity: 0.9;
}

.tp-topbar-brand-text {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Hide brand text on small screens */
@media (max-width: 640px) {
  .tp-topbar-brand-text {
    display: none;
  }
}

/* ===========================
   Topbar Icon Button
   =========================== */
.tp-topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #b3b3b3;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.tp-topbar-icon-btn:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.tp-topbar-icon-btn:focus {
  outline: none;
}

.tp-topbar-icon-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Icon button with notification badge */
.tp-topbar-icon-btn-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1rem;
  text-align: center;
  color: white;
  background-color: #ef4444;
  border-radius: 9999px;
}

/* ===========================
   Topbar User Menu
   =========================== */
.tp-topbar-user {
  position: relative;
}

.tp-topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  color: white;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tp-topbar-user-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.tp-topbar-user-btn:focus {
  outline: none;
}

.tp-topbar-user-chevron {
  color: #9ca3af;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.tp-topbar-user-btn[aria-expanded="true"] .tp-topbar-user-chevron {
  transform: rotate(180deg);
}

/* User Dropdown */
.tp-topbar-user-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  min-width: 14rem;
  margin-top: 0.5rem;
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.tp-topbar-user-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tp-border);
}

.tp-topbar-user-dropdown-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tp-text);
}

.tp-topbar-user-dropdown-email {
  font-size: 0.75rem;
  color: var(--tp-text-secondary);
  margin-top: 0.125rem;
}

.tp-topbar-user-dropdown-menu {
  padding: 0.25rem 0;
}

.tp-topbar-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--tp-text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.1s ease;
  text-decoration: none;
}

.tp-topbar-user-dropdown-item:hover {
  background-color: var(--tp-hover-bg);
}

.tp-topbar-user-dropdown-item i {
  width: 1rem;
  color: var(--tp-text-secondary);
}

.tp-topbar-user-dropdown-item-danger {
  color: #ef4444;
}

.tp-topbar-user-dropdown-item-danger i {
  color: #ef4444;
}

.tp-topbar-user-dropdown-divider {
  height: 1px;
  margin: 0.25rem 0;
  background-color: var(--tp-border);
}

/* ===========================
   Mobile Menu Button
   =========================== */
.tp-topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #b3b3b3;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tp-topbar-menu-btn:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 1023.98px) {
  .tp-topbar-menu-btn {
    display: flex;
  }
}

/* ===========================
   Topbar Search (Optional)
   =========================== */
.tp-topbar-search {
  position: relative;
  max-width: 24rem;
  width: 100%;
}

.tp-topbar-search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.875rem;
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.tp-topbar-search-input::placeholder {
  color: #9ca3af;
}

.tp-topbar-search-input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.tp-topbar-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

/* ===========================
   Topbar Variants
   =========================== */

/* Transparent variant */
.tp-topbar-transparent {
  background-color: transparent;
  border-bottom: none;
}

/* Light variant */
.tp-topbar-light {
  background-color: var(--tp-surface);
  border-bottom: 1px solid var(--tp-border);
}

.tp-topbar-light .tp-topbar-brand-text {
  color: var(--tp-text);
}

.tp-topbar-light .tp-topbar-icon-btn {
  color: var(--tp-text-secondary);
}

.tp-topbar-light .tp-topbar-icon-btn:hover {
  color: var(--tp-text);
  background-color: var(--tp-hover-bg);
}

.tp-topbar-light .tp-topbar-user-btn {
  color: var(--tp-text);
}

.tp-topbar-light .tp-topbar-user-btn:hover {
  background-color: var(--tp-hover-bg);
}

/* ===========================
   Animation for dropdown
   =========================== */
.tp-topbar-user-dropdown[x-cloak] {
  display: none !important;
}

.tp-topbar-user-dropdown {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ===========================
   Global Command Palette
   =========================== */
.tp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tp-command-trigger {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: min(32rem, 100%);
  height: 2.25rem;
  padding: 0 0.5rem 0 0.75rem;
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-command-trigger:hover {
  color: white;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.tp-command-trigger:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.tp-command-trigger > i {
  font-size: 0.75rem;
}

.tp-command-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-command-trigger-shortcut,
.tp-command-palette kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.3rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 0.6875rem;
  line-height: 1;
  white-space: nowrap;
}

.tp-command-palette {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(14vh, 8rem) 1rem 1rem;
  background: rgba(3, 7, 18, 0.62);
  backdrop-filter: blur(4px);
}

.tp-command-palette-dialog {
  width: min(56rem, 100%);
  color: var(--tp-text, #202223);
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #dfe3e8);
  border-radius: 0.875rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.tp-command-palette-enter,
.tp-command-palette-leave {
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.tp-command-palette-enter-start,
.tp-command-palette-leave-end {
  opacity: 0;
  transform: translateY(-0.5rem) scale(0.985);
}

.tp-command-palette-enter-end,
.tp-command-palette-leave-start {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tp-command-palette-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--tp-border, #dfe3e8);
}

.tp-command-palette-input-row > i {
  color: var(--tp-text-secondary, #6d7175);
  font-size: 1rem;
}

.tp-command-palette-input-row input {
  flex: 1;
  min-width: 0;
  height: 3.875rem;
  padding: 0;
  color: var(--tp-text, #202223);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 1.125rem;
}

.tp-command-palette-input-row input::placeholder {
  color: var(--tp-text-secondary, #6d7175);
}

.tp-command-palette-spinner {
  color: var(--tp-text-secondary, #6d7175);
  font-size: 0.8125rem;
}

.tp-command-palette-close {
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tp-command-palette-close kbd,
.tp-command-palette-footer kbd {
  color: var(--tp-text-secondary, #6d7175);
  background: var(--tp-hover-bg, #f3f4f6);
  border-color: var(--tp-border, #dfe3e8);
  box-shadow: none;
}

.tp-command-palette-results {
  max-height: min(40rem, 70vh);
  padding: 0.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tp-command-results-group + .tp-command-results-group {
  margin-top: 0.375rem;
  padding-top: 0.375rem;
  border-top: 1px solid var(--tp-border, #dfe3e8);
}

.tp-command-palette-section-label {
  padding: 0.375rem 0.625rem 0.5rem;
  color: var(--tp-text-secondary, #6d7175);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tp-command-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.5rem 0.625rem;
  color: var(--tp-text, #202223);
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: left;
}

.tp-command-result.is-rich {
  min-height: 5rem;
  align-items: flex-start;
  padding-block: 0.625rem;
}

.tp-command-result.is-selected {
  background: var(--tp-hover-bg, #f3f4f6);
}

.tp-command-result:focus-visible {
  outline: 2px solid var(--tp-primary, #1d4b8e);
  outline-offset: -2px;
}

.tp-command-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  color: var(--tp-primary, #1d4b8e);
  background: color-mix(in srgb, var(--tp-primary, #1d4b8e) 10%, transparent);
  border-radius: 0.5rem;
}

.tp-command-result.is-rich .tp-command-result-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.125rem;
}

.tp-command-result-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 0.125rem;
}

.tp-command-result-title,
.tp-command-result-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-command-result-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.tp-command-result-subtitle {
  color: var(--tp-text-secondary, #6d7175);
  font-size: 0.75rem;
}

.tp-command-result.is-rich .tp-command-result-subtitle {
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tp-command-result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.1875rem;
}

.tp-command-result-badge,
.tp-command-result-source {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0.125rem 0.375rem;
  color: var(--tp-text-secondary, #6d7175);
  background: var(--tp-hover-bg, #f3f4f6);
  border: 1px solid var(--tp-border, #dfe3e8);
  border-radius: 999px;
  font-size: 0.6875rem;
  line-height: 1.1;
}

.tp-command-result-source {
  color: var(--tp-primary, #1d4b8e);
  background: color-mix(in srgb, var(--tp-primary, #1d4b8e) 8%, transparent);
  border-color: color-mix(in srgb, var(--tp-primary, #1d4b8e) 20%, var(--tp-border, #dfe3e8));
}

.tp-command-result-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  color: var(--tp-text-secondary, #6d7175);
  font-size: 0.6875rem;
}

.tp-command-result.is-rich .tp-command-result-meta {
  align-items: flex-end;
  flex-direction: column;
  padding-top: 0.125rem;
}

.tp-command-result-type {
  padding: 0.2rem 0.375rem;
  background: var(--tp-hover-bg, #f3f4f6);
  border-radius: 0.3rem;
}

.tp-command-palette-empty,
.tp-command-palette-error {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.625rem;
  min-height: 10rem;
  padding: 1.5rem;
  color: var(--tp-text-secondary, #6d7175);
  font-size: 0.8125rem;
  text-align: center;
}

.tp-command-palette-empty > i {
  font-size: 1.25rem;
  opacity: 0.7;
}

.tp-command-palette-error {
  color: var(--tp-critical-text, #b42318);
}

.tp-command-palette-partial {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  color: var(--tp-text-secondary, #6d7175);
  border-top: 1px solid var(--tp-border, #dfe3e8);
  font-size: 0.75rem;
  text-align: center;
}

.tp-command-palette-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  color: var(--tp-text-secondary, #6d7175);
  background: var(--tp-hover-bg, #f3f4f6);
  border-top: 1px solid var(--tp-border, #dfe3e8);
  font-size: 0.6875rem;
}

.tp-command-palette-footer > span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tp-command-palette-scope-note {
  margin-left: auto;
}

@media (max-width: 720px) {
  .tp-topbar {
    gap: 0.5rem;
  }

  .tp-topbar-center {
    justify-content: flex-end;
    padding: 0;
  }

  .tp-command-trigger {
    justify-content: center;
    width: 2.25rem;
    padding: 0;
  }

  .tp-command-trigger-label,
  .tp-command-trigger-shortcut {
    display: none;
  }

  .tp-command-palette {
    padding: 0;
  }

  .tp-command-palette-dialog {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .tp-command-palette-results {
    max-height: calc(100vh - 6.5rem);
  }

  .tp-command-palette-footer {
    display: none;
  }

  .tp-command-result-type {
    display: none;
  }

  .tp-command-result-source {
    display: none;
  }

  .tp-command-result.is-rich {
    min-height: 4.75rem;
  }
}
/* ViewTabs — gespeicherte Filter-Ansichten (Shopify-style) */

.vt-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--tp-border, #e1e1e1);
  background: var(--tp-content-bg, #efefef);
  padding: 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}

.vt-bar::-webkit-scrollbar { display: none; }

.vt-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tp-text-secondary, #6d7175);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.vt-tab:hover { color: var(--tp-text, #202223); }

.vt-tab.active {
  color: var(--tp-accent, #1d4b8e);
  border-bottom-color: var(--tp-accent, #1d4b8e);
}

.vt-tab-group {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.vt-tab-group:hover .vt-actions { opacity: 1; }

.vt-actions {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity .15s;
  padding-right: 2px;
}

.vt-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--tp-text-secondary, #6d7175);
  border-radius: 4px;
  font-size: 11px;
  transition: color .1s, background .1s;
}

.vt-action-btn:hover { background: var(--tp-hover-bg, #f3f4f6); }
.vt-action-btn.del:hover { color: #ef4444; }

.vt-new-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--tp-text-secondary, #6d7175);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}

.vt-new-btn:hover {
  color: var(--tp-accent, #1d4b8e);
  background: var(--tp-hover-bg, #f3f4f6);
}

.vt-tab-input {
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tp-text, #202223);
  background: var(--tp-surface, #fff);
  border: 1.5px solid var(--tp-accent, #1d4b8e);
  border-radius: 4px;
  outline: none;
  min-width: 72px;
  max-width: 160px;
  margin: 4px 2px 4px 8px;
  box-shadow: 0 0 0 3px rgba(29, 75, 142, 0.15);
}

.vt-action-btn.rename:hover { color: var(--tp-accent, #1d4b8e); }

/* Dirty-Indikator — View hat ungespeicherte Filteränderungen */
.vt-dirty-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background: var(--tp-warning, #f59e0b);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 4px;
  flex-shrink: 0;
  transition: background .15s;
}

.vt-dirty-indicator:hover {
  background: #d97706;
}

.vt-dirty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

/* Save-panel — schwebt über dem Tab-Bar */
.vt-save-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--tp-surface, #fff);
  border: 1px solid var(--tp-border, #e1e1e1);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  padding: 16px;
  z-index: 30;
  width: 260px;
}
