/* ============================================
   LEVELUPHOST ADMIN - Filament v5 Dark Theme
   Minimale Overrides (v5 hat eigenes Dark Mode)
   ============================================ */

/* Globale Farbvariablen überschreiben - dunkles Grau statt reines Schwarz
   --gray-950: Body-Background
   --gray-900: Sections, Tabellen, Karten (heller als Body)
   --gray-800: Inputs, Hover-States
   --gray-700: Borders */
html.fi,
html.fi.dark,
:root {
    --gray-950: #1A1C23;
    --gray-900: #252a35;
    --gray-800: #2d3340;
    --gray-700: #3d4451;
    --color-gray-950: #1A1C23;
    --color-gray-900: #252a35;
    --color-gray-800: #2d3340;
    --color-gray-700: #3d4451;
}

/* Body-Hintergrund */
.fi-body:where(.dark, .dark *) {
    background-color: #1A1C23 !important;
}

/* Sidebar & Topbar bleiben dunkel */
.fi-sidebar:where(.dark, .dark *),
.fi-sidebar-header:where(.dark, .dark *),
.fi-sidebar-nav:where(.dark, .dark *) {
    background-color: #111827 !important;
}

.fi-topbar:where(.dark, .dark *) {
    background-color: #111827 !important;
}

/* Tabellen im Dark Mode - kein Weiß */
.dark table {
    background-color: transparent !important;
}

.dark table thead tr,
.dark table thead th {
    background-color: #1e2433 !important;
    color: #94a3b8 !important;
}

.dark table tbody tr {
    background-color: #252a35 !important;
}

.dark table tbody tr:hover {
    background-color: #2d3340 !important;
}

.dark table td {
    color: #e2e8f0;
}

/* Filament Tabellen (fi-ta = table) */
.fi-ta-row:where(.dark, .dark *) {
    background-color: #252a35 !important;
}

.fi-ta-row:where(.dark, .dark *):hover {
    background-color: #2d3340 !important;
}

.fi-ta-header-cell:where(.dark, .dark *) {
    background-color: #1e2433 !important;
}

/* Formular-Inputs im Dark Mode */
.fi-input-wrp:where(.dark, .dark *) {
    background-color: #2d3340 !important;
    border-color: #3d4451 !important;
}

.fi-input-wrp:where(.dark, .dark *) input,
.fi-input-wrp:where(.dark, .dark *) select,
.fi-input-wrp:where(.dark, .dark *) textarea {
    color: #e2e8f0 !important;
}

/* Select Dropdowns */
.fi-select-option:where(.dark, .dark *) {
    color: #e2e8f0 !important;
}

/* Formular-Labels */
.fi-fo-field-wrp-label:where(.dark, .dark *) label {
    color: #d1d5db !important;
}

/* Helper Text */
.fi-fo-field-wrp-hint:where(.dark, .dark *),
.fi-fo-field-wrp-helper-text:where(.dark, .dark *) {
    color: #9ca3af !important;
}

/* Filament Page Header */
.fi-page-header:where(.dark, .dark *) {
    color: #f1f5f9 !important;
}

/* Formulare: Top-Level Schema auf 1 Spalte = volle Breite für Sections.
   Filament setzt columns(2) auf EditRecord/CreateRecord Formulare.
   Nur das ERSTE Grid-Level wird auf 1 Spalte gezwungen.
   minmax(0, 1fr) statt 1fr: Track darf unter seine max-content-Breite schrumpfen,
   sonst dehnen breite Inhalte das Grid ueber den Viewport hinaus. */
.fi-sc-form .fi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
}

/* Kein horizontales Seiten-Scrollen: breite Inhalte (Tab-Leiste etc.) werden geklippt
   bzw. scrollen in ihrem eigenen Container (overflow-x:auto). */
.fi-main {
    overflow-x: clip;
}

/* === Content-Breiten-Fix ===
   Filaments gelayerte Regel `:is(.fi-main,.fi-simple-main).fi-width-7xl { max-width:
   var(--container-7xl) }` liegt in @layer components und wird hier offenbar durch etwas
   ausgehebelt, sodass der Content auf jeder Seite voll-breit ist. Wir erzwingen die
   Content-Breite (88rem, leicht über 7xl, zentriert) unlayered + !important zurück.
   Betrifft NUR fi-width-7xl-Seiten — bewusst vollbreite Seiten (fi-width-full, z. B.
   Produkte/Hosts) bleiben unberührt. */
:is(.fi-main, .fi-simple-main).fi-width-7xl {
    max-width: 88rem !important;
    margin-inline: auto !important;
}

/* Sicherheit gegen echten Overflow: der Content-Container darf im Flex neben dem
   20rem-Sidebar auf den Restplatz schrumpfen (kein Überstand über den Viewport). */
@media (min-width: 1024px) {
    .fi-main-ctn {
        min-width: 0;
    }
}

/* bg-white Elemente im Dark Mode überschreiben */
.dark .bg-white,
.fi-body .bg-white {
    background-color: #252a35 !important;
}

/* Icon-Groessen (Filament v5 size utilities) */
svg.fi-icon,
.fi-icon {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0 !important;
}

svg.fi-icon.fi-size-xs,
.fi-icon.fi-size-xs {
    width: 0.75rem !important;
    height: 0.75rem !important;
}

svg.fi-icon.fi-size-sm,
.fi-icon.fi-size-sm {
    width: 1rem !important;
    height: 1rem !important;
}

svg.fi-icon.fi-size-md,
.fi-icon.fi-size-md {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

svg.fi-icon.fi-size-lg,
.fi-icon.fi-size-lg {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

svg.fi-icon.fi-size-xl,
.fi-icon.fi-size-xl {
    width: 1.75rem !important;
    height: 1.75rem !important;
}

/* Alle SVGs innerhalb von Filament begrenzen */
[class^="fi-"] > svg:not(.fi-icon),
[class*=" fi-"] > svg:not(.fi-icon) {
    max-width: 1.5rem !important;
    max-height: 1.5rem !important;
}

/* Widget-spezifische SVGs */
.fi-wi-stats-overview-stat svg,
.fi-wi svg:not(.fi-icon) {
    max-width: 1.5rem !important;
    max-height: 1.5rem !important;
}

/* Filament Info Widget komplett verstecken */
.fi-filament-info-widget,
.fi-filament-info-widget-main,
.fi-filament-info-widget-logo {
    display: none !important;
}

/* Logo in Sidebar begrenzen */
.fi-logo svg,
.fi-sidebar-header svg {
    max-height: 2rem !important;
    width: auto !important;
}

/* Theme Switcher verstecken (Dark Mode ist erzwungen) */
.fi-theme-switcher,
[class*="theme-switcher"],
[class*="ThemeSwitcher"] {
    display: none !important;
}

/* Sidebar-Header (Logo) - gleiche Hoehe wie Topbar */
.fi-sidebar-header {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* Avatar - weissen Ring entfernen */
.fi-avatar {
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-offset-shadow: 0 0 #0000 !important;
    outline: none !important;
}

/* Mailbox Button Styles */
.mailbox-btn.mailbox-read {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
}

.mailbox-btn.mailbox-unread {
    background-color: rgba(14, 165, 233, 0.2) !important;
    border: 1px solid rgba(14, 165, 233, 0.3) !important;
}

.mailbox-btn:hover {
    background-color: #374151 !important;
}

/* User Menu Button */
.user-menu-btn {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
}

.user-menu-btn:hover {
    background-color: #374151 !important;
}

/* Sektionen & Tabs overflow visible (fuer Dropdowns) */
.fi-section,
.fi-ta-ctn {
    overflow: visible !important;
}

/* Input Wrapper overflow visible (fuer Select-Dropdowns) */
.fi-input-wrp {
    overflow: visible !important;
}

/* Formular-Tabs horizontal scrollbar halten (z. B. Produkt anlegen/bearbeiten):
   Filament-Schema-Items haben default min-width:auto und wachsen dadurch auf die volle
   nowrap-Breite der Tab-Leiste -> der Container wird breiter als der Viewport und die
   ganze Seite scrollt statt der Tab-Leiste. min-width:0 erlaubt das Schrumpfen, sodass
   die Tab-Nav selbst horizontal scrollt (wie bei den Allgemeinen Einstellungen). */
.fi-form,
.fi-fo-component-ctn,
.fi-sc-form,
.fi-sc-component,
.fi-sc,
.fi-sc-tabs,
.fi-sc-tabs-tab,
.fi-grid,
.fi-grid > * {
    min-width: 0;
}

/* License Navigation Disabled */
.navigation-item-disabled {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    filter: grayscale(100%) !important;
}

.navigation-group-disabled {
    opacity: 0.3 !important;
    pointer-events: none !important;
}

.license-warning {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-left: 4px solid #fca5a5;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
}

/* FilamentInfoWidget verstecken */
.fi-filament-info-widget {
    display: none !important;
}

/* Mobile */
@media (max-width: 768px) {
    .fi-breadcrumbs {
        display: none !important;
    }
}

/* iOS Safari Viewport Fix - 100vh inkludiert dort die Adressleisten-Fläche,
   wodurch Layouts unten überhaengen. 100dvh = dynamic viewport height. */
html,
body,
.fi-layout,
.fi-body,
.fi-main,
.fi-main-ctn {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
}

.min-h-screen {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
}

.h-screen {
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
}

/* Sidebar-Scrollbar visuell ausblenden (Mausrad-Scroll bleibt erhalten). Verhindert,
   dass die Scrollleiste Platz wegnimmt und die Inhalte rechts verschiebt. */
.fi-sidebar,
.fi-main-sidebar,
.fi-sidebar-nav,
.fi-sidebar-nav-groups {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.fi-sidebar::-webkit-scrollbar,
.fi-main-sidebar::-webkit-scrollbar,
.fi-sidebar-nav::-webkit-scrollbar,
.fi-sidebar-nav-groups::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ============================================================================
   ADMIN-UI-KIT (.sx-*)
   ----------------------------------------------------------------------------
   Filament v5 liefert nur seine eigenen `fi-*`-Klassen, und das Vite-Bundle
   (resources/css/app.css) wird im Admin NICHT geladen. Tailwind-Utilities in
   `resources/views/filament/**` sind deshalb wirkungslos. Die eigenen Admin-
   Seiten bauen ihr Layout ueber dieses Kit auf: eine Flaeche, eine Akzentfarbe
   (Sky = Panel-Primary), Hierarchie ueber Typografie und Haarlinien statt ueber
   Farbverlaeufe, Icon-Kacheln und Schatten.

   Reihenfolge beachten: bei Tabellen faerbt weiter oben `.dark table thead th`
   per !important. Deshalb sind die Tabellenregeln hier doppelt geklassert
   (`.sx-table.sx-table`) — zwei Klassen schlagen `.dark` + Elementselektoren.
   ============================================================================ */

:root {
    --sx-surface: #252a35;
    --sx-surface-2: #2d3340;
    --sx-line: #333a48;
    --sx-line-soft: rgba(255, 255, 255, 0.05);
    --sx-text: #e7eaf0;
    --sx-muted: #9aa3b2;
    --sx-dim: #6b7484;
    --sx-accent: #38bdf8;
    --sx-ok: #34d399;
    --sx-warn: #fbbf24;
    --sx-err: #f87171;
}

/* --- Layout ------------------------------------------------------------- */

.sx-stack > * + * { margin-top: 1.25rem; }
.sx-stack-sm > * + * { margin-top: 0.6rem; }
.sx-stack-md > * + * { margin-top: 1rem; }

.sx-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }

@media (min-width: 768px) {
    .sx-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .sx-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .sx-cols-xl-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sx-cols-xl-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sx-span-2 { grid-column: span 2 / span 2; }
}

.sx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sx-inline { display: flex; align-items: center; gap: 0.5rem; }
.sx-inline-wrap { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sx-spacer { flex: 1 1 auto; }
.sx-mt { margin-top: 0.5rem; }
.sx-mt-xs { margin-top: 0.35rem; }
.sx-mb { margin-bottom: 0.5rem; }
.sx-nowrap { white-space: nowrap; }
.sx-right { text-align: right; }
.sx-center { text-align: center; }

/* --- Flaechen ------------------------------------------------------------ */

.sx-card {
    background: var(--sx-surface);
    border: 1px solid var(--sx-line);
    border-radius: 0.75rem;
}

.sx-card-head {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--sx-line);
}

/* Kopf mit Aktion rechts */
.sx-card-head.sx-between,
.sx-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sx-card-title { font-size: 0.875rem; font-weight: 600; color: var(--sx-text); }
.sx-card-meta { margin-top: 0.15rem; font-size: 0.75rem; color: var(--sx-dim); }
.sx-card-body { padding: 1.25rem; }
.sx-card-foot { padding: 0.9rem 1.25rem; border-top: 1px solid var(--sx-line); }

.sx-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--sx-line);
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
}

.sx-divider { height: 1px; background: var(--sx-line); }

/* --- Typografie ---------------------------------------------------------- */

.sx-label { font-size: 0.75rem; color: var(--sx-muted); }
.sx-note { font-size: 0.75rem; color: var(--sx-dim); }
.sx-text { font-size: 0.8125rem; color: var(--sx-muted); }
.sx-strong { color: var(--sx-text); font-weight: 600; }
.sx-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; }
.sx-break { overflow-wrap: anywhere; }

.sx-row-label { font-size: 0.8125rem; color: var(--sx-muted); }
.sx-row-label .sx-note { margin-left: 0.35rem; }

.sx-row-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sx-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sx-row-value .sx-note { font-weight: 400; margin-left: 0.25rem; }

/* --- Kennzahlen ---------------------------------------------------------- */

/* Haarlinien-Raster: die Trennlinien zeichnen die Zellen selbst (box-shadow oben/links,
   in der 1px-Luecke). Der Container traegt die FLAECHENfarbe — sonst wuerde eine
   unvollstaendige letzte Reihe (ungerade Anzahl) als dunkler Block durchscheinen.
   Die Schatten der ersten Reihe/Spalte liegen unter dem Rahmen und werden weggeschnitten. */
.sx-kpis {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    background: var(--sx-surface);
    border: 1px solid var(--sx-line);
    border-radius: 0.75rem;
    overflow: hidden;
}

@media (min-width: 640px) {
    .sx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Zweispaltiger Bereich: eine allein stehende letzte Kachel nimmt die ganze Reihe
   ein, damit daneben keine leere Haelfte bleibt. Oberhalb greifen wieder 3 bzw. 4
   Spalten, dort waere die Regel falsch — deshalb die Obergrenze. */
@media (min-width: 640px) and (max-width: 1279px) {
    .sx-kpis > .sx-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (min-width: 1280px) {
    .sx-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sx-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.sx-kpi {
    background: var(--sx-surface);
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: -1px 0 0 var(--sx-line), 0 -1px 0 var(--sx-line);
}
.sx-kpi-label { font-size: 0.75rem; color: var(--sx-muted); }

.sx-kpi-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sx-text);
    font-variant-numeric: tabular-nums;
}

.sx-kpi-meta { margin-top: 0.55rem; font-size: 0.75rem; line-height: 1.5; color: var(--sx-dim); }

.sx-delta { font-size: 0.75rem; font-weight: 500; }
.sx-up { color: var(--sx-ok); }
.sx-down { color: var(--sx-err); }
.sx-flat { color: var(--sx-dim); }

.sx-dot {
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: var(--dot, var(--sx-dim));
    margin-right: 0.35rem;
    vertical-align: middle;
}

.sx-kpi-meta .sx-dot:not(:first-child) { margin-left: 0.6rem; }

/* --- Verweiskachel (Ticket: Kunde, verknuepftes Produkt) ----------------- */

.sx-link-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--sx-surface);
    border: 1px solid var(--sx-line);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.sx-link-card:hover {
    background: var(--sx-surface-2);
    border-color: var(--sx-accent);
}

.sx-link-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: var(--sx-surface-2);
    color: var(--sx-muted);
}

.sx-link-card-icon svg { width: 1.25rem; height: 1.25rem; }

.sx-link-card-body { flex: 1; min-width: 0; }

.sx-link-card-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sx-text);
}

.sx-link-card-chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--sx-dim);
}

/* --- Balken -------------------------------------------------------------- */

.sx-bar {
    display: flex;
    height: 4px;
    margin-top: 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.sx-bar > span { display: block; height: 100%; border-radius: 9999px; background: var(--sx-accent); }
.sx-bar-split > span:first-child { border-radius: 9999px 0 0 9999px; }
.sx-bar-split > span:last-child { border-radius: 0 9999px 9999px 0; }
.sx-bar-thin { height: 2px; margin-top: 0.4rem; }
.sx-bar + .sx-note { display: block; margin-top: 0.4rem; }

/* --- Badges (schlicht: getoenter Text, feiner Rahmen) --------------------- */

.sx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--sx-muted);
    border: 1px solid var(--sx-line);
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

.sx-badge-ok { color: var(--sx-ok); border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.sx-badge-info { color: var(--sx-accent); border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.08); }
.sx-badge-warn { color: var(--sx-warn); border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); }
.sx-badge-err { color: var(--sx-err); border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); }

/* --- Hinweise ------------------------------------------------------------ */

.sx-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 0.6rem;
    border: 1px solid var(--sx-line);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.8125rem;
    color: var(--sx-muted);
}

.sx-notice-title { font-weight: 600; color: var(--sx-text); }
.sx-notice-info { border-color: rgba(56, 189, 248, 0.28); background: rgba(56, 189, 248, 0.07); }
.sx-notice-warn { border-color: rgba(251, 191, 36, 0.28); background: rgba(251, 191, 36, 0.07); }
.sx-notice-err { border-color: rgba(248, 113, 113, 0.28); background: rgba(248, 113, 113, 0.07); }
.sx-notice-ok { border-color: rgba(52, 211, 153, 0.28); background: rgba(52, 211, 153, 0.07); }

/* --- Buttons ------------------------------------------------------------- */

.sx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid var(--sx-line);
    background: var(--sx-surface-2);
    color: var(--sx-text);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sx-btn:hover { background: #353c4b; }
.sx-btn:disabled, .sx-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.sx-btn:disabled:hover, .sx-btn[disabled]:hover { background: var(--sx-surface-2); }
.sx-btn-sm { padding: 0.25rem 0.55rem; font-size: 0.75rem; }
.sx-btn-block { width: 100%; }

.sx-btn-primary { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.35); color: var(--sx-accent); }
.sx-btn-primary:hover { background: rgba(56, 189, 248, 0.22); }
.sx-btn-danger { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.32); color: var(--sx-err); }
.sx-btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.sx-btn-warn { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.32); color: var(--sx-warn); }
.sx-btn-warn:hover { background: rgba(251, 191, 36, 0.2); }
.sx-btn-ghost { background: transparent; }
.sx-btn-ghost:hover { background: rgba(255, 255, 255, 0.04); }

/* --- Tabellen (doppelt geklassert, siehe Kopfkommentar) ------------------- */

.sx-table { width: 100%; border-collapse: collapse; }

.sx-table.sx-table thead tr { background: transparent !important; }

.sx-table.sx-table thead th {
    padding: 0.55rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sx-dim) !important;
    text-align: left;
    background: transparent !important;
    border-bottom: 1px solid var(--sx-line);
}

.sx-table.sx-table tbody tr { background: transparent !important; }
.sx-table.sx-table tbody tr:hover { background: rgba(255, 255, 255, 0.02) !important; }
.sx-table.sx-table tbody tr + tr td { border-top: 1px solid var(--sx-line-soft); }

.sx-table.sx-table td {
    padding: 0.7rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--sx-muted);
    vertical-align: middle;
}

.sx-table .sx-num-col { text-align: right; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sx-table .sx-rank-col { width: 1%; }
.sx-table .sx-act-col { text-align: right; width: 1%; white-space: nowrap; }
.sx-table .sx-rank { color: var(--sx-dim); font-variant-numeric: tabular-nums; }
.sx-table .sx-strong { color: var(--sx-text); font-weight: 600; }
.sx-table .sx-empty-cell { padding: 2.25rem 1.25rem; text-align: center; color: var(--sx-dim); }

.sx-cell-title { font-size: 0.8125rem; font-weight: 500; color: var(--sx-text); }
.sx-cell-sub { font-size: 0.75rem; color: var(--sx-dim); margin-top: 0.1rem; }
.sx-scroll-x { overflow-x: auto; }

/* --- Leerzustand --------------------------------------------------------- */

.sx-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    border: 1px dashed var(--sx-line);
    border-radius: 0.75rem;
    color: var(--sx-dim);
}

.sx-empty-title { font-size: 0.875rem; font-weight: 500; color: var(--sx-text); }
.sx-empty .sx-note { margin-top: 0.35rem; }

/* --- Medien -------------------------------------------------------------- */

.sx-media {
    aspect-ratio: 16 / 9;
    background: var(--sx-surface-2);
    border-bottom: 1px solid var(--sx-line);
    overflow: hidden;
    position: relative;
}

.sx-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- Code / Konsole ------------------------------------------------------ */

.sx-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--sx-muted);
    background: #1a1c23;
    border: 1px solid var(--sx-line);
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* --- Animation (Filament liefert die Keyframes, aber keine Utility-Klasse) -- */

.animate-spin { animation: sx-spin 1s linear infinite; }
@keyframes sx-spin { to { transform: rotate(360deg); } }

/* --- Textlink im Fliesstext ---------------------------------------------- */

.sx-link { color: var(--sx-accent); text-decoration: none; font-weight: 500; }
.sx-link:hover { text-decoration: underline; }

/* --- Overlays ------------------------------------------------------------ */

.sx-hidden { display: none; }

.sx-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(10, 12, 16, 0.7);
}

.sx-modal-box {
    width: 100%;
    max-width: 56rem;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--sx-surface);
    border: 1px solid var(--sx-line);
    border-radius: 0.75rem;
    overflow: hidden;
}

.sx-modal-body { padding: 1.25rem; overflow-y: auto; }

.sx-loading {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 16, 0.5);
}

.sx-loading-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.15rem;
    border-radius: 0.6rem;
    background: var(--sx-surface);
    border: 1px solid var(--sx-line);
    color: var(--sx-muted);
    font-size: 0.8125rem;
}

/* --- Eingaben ausserhalb von Filament-Formularen -------------------------- */

.sx-input {
    padding: 0.45rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid var(--sx-line);
    background: #1a1c23;
    color: var(--sx-text);
    font-size: 0.8125rem;
}

.sx-input::placeholder { color: var(--sx-dim); }
.sx-input:focus { outline: none; border-color: rgba(56, 189, 248, 0.5); }
.sx-input-grow { flex: 1 1 15rem; }

/* --- Filter-Chips -------------------------------------------------------- */

.sx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid var(--sx-line);
    background: transparent;
    color: var(--sx-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sx-chip:hover { background: rgba(255, 255, 255, 0.03); color: var(--sx-text); }

.sx-chip-on {
    color: var(--sx-accent);
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.1);
}

.sx-chip-count { color: var(--sx-dim); font-variant-numeric: tabular-nums; }
.sx-chip-on .sx-chip-count { color: inherit; opacity: 0.75; }

.sx-actions-end { display: flex; justify-content: flex-end; margin-bottom: 1.5rem; }
