/* components.css - UI-Komponenten für ShopAnalytics */

/* ============================================================================
   NAV TABS – VS-Primary Farben statt Bootstrap-Blau
   ============================================================================ */

.nav-tabs .nav-link {
    color: var(--vs-primary, #1a4e3a);
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
    color: var(--vs-primary, #1a4e3a);
    border-color: #dee2e6 #dee2e6 transparent;
}

.nav-tabs .nav-link.active {
    color: var(--vs-primary, #1a4e3a);
    font-weight: 600;
}

/* ============================================================================
   PLATFORM TOGGLE – Schieberegler im Header
   ============================================================================ */

.platform-slider {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    visibility: hidden;
}

.platform-slider.ready {
    visibility: visible;
}

.platform-slider-track {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    padding: 3px;
    cursor: pointer;
}

.platform-slider-label {
    position: relative;
    z-index: 2;
    padding: 5px 16px;
    font-size: 0.74rem;
    line-height: 1;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-slider-label[data-platform="shopify"] {
    min-width: 72px;
}

.platform-slider-label[data-platform="shopware"] {
    min-width: 84px;
}

.platform-slider-label.active {
    color: var(--vs-primary);
    font-weight: 600;
}

.platform-slider-thumb {
    position: absolute;
    top: 2px;
    left: 0;
    height: calc(100% - 4px);
    background: #fff;
    border-radius: 18px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Schachbrettmuster für transparente Bilder (Logo/Banner) */
.checkerboard-bg {
    background-image:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #f0f0f0;
}

/* ============================================================================
   CSS VARIABLEN (globale Design-Token)
   ============================================================================ */

:root {
    --vs-primary:  #1a4e3a;
    --vs-success:  #00ba39;
    --vs-gold:     #c8a96e;
    --vs-warning:  #ffc107;
    --vs-border:   #dee2e6;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Hover-Effekt für Karten */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    border-color: var(--vs-primary) !important;
    box-shadow: 0 0 0 1px var(--vs-primary) !important;
}

.transition-all {
    transition: all 0.3s ease;
}


/* ============================================================================
   DASHBOARD – Modul-Kacheln
   ============================================================================ */

/* Zwei-Spalten-Layout: links Module (max 3 pro Zeile), rechts freier Bereich */
.dash-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.dash-main {
    flex: 0 0 auto;
    max-width: 774px; /* 3 * 250px + 2 * 12px gap */
    width: 100%;
}

@media (max-width: 992px) {
    .dash-layout { flex-direction: column; }
    .dash-main { max-width: 100%; }
}

/* Rechte Seitenspalte: Info & Aufgaben */
.dash-side {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tabbed-Card-Look (analog zu .dq-tabbed-card aus data_quality_product_detail) */
.dash-side-tabbed {
    display: block;
}

.dash-side-tab {
    display: inline-block;
    background: #f3fff1;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #000;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
}

.dash-side-block {
    background: #f3fff1;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top-left-radius: 0;
    border-top-right-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    padding: 14px 16px;
}

.dash-side-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-side-list[data-collapsed="true"] .dash-side-card-extra {
    display: none;
}

.dash-side-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: #f3fff1;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, opacity 0.4s ease, transform 0.4s ease,
        max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
    overflow: hidden;
    max-height: 80px;
}

/* Sanftes Ausfaden + Zusammenziehen beim Archivieren — gibt dem User
   ~450ms visuellen Hinweis, statt das Item abrupt zu entfernen. */
.dash-side-card-dismissing {
    pointer-events: none;
    opacity: 0;
    transform: translateX(8px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.dash-side-card-link:hover {
    background: #e6f7e2;
}

.dash-side-card-urgent {
    /* Akzent entfernt — Cards bleiben einheitlich */
}

/* Globale Info-Cards (kein Link, kein Hover) */
.dash-side-card-static {
    cursor: default;
}
.dash-side-card-static:hover {
    background: #f3fff1;
}

.dash-side-card .dash-side-card-icon,
.dash-side-card .dash-side-card-icon.text-gold,
.dash-side-card .dash-side-card-icon.text-success,
.dash-side-card .dash-side-card-icon.text-warning,
.dash-side-card .dash-side-card-icon.text-danger,
.dash-side-card .dash-side-card-icon.text-primary,
.dash-side-card .dash-side-card-icon.text-muted {
    color: #000 !important;
    background: transparent !important;
    transition: color 0.15s ease;
}

.dash-side-card:hover .dash-side-card-icon,
.dash-side-card:hover .dash-side-card-icon.text-gold,
.dash-side-card:hover .dash-side-card-icon.text-success,
.dash-side-card:hover .dash-side-card-icon.text-warning,
.dash-side-card:hover .dash-side-card-icon.text-danger,
.dash-side-card:hover .dash-side-card-icon.text-primary,
.dash-side-card:hover .dash-side-card-icon.text-muted {
    color: #000 !important;
}

.dash-side-card-icon {
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.dash-side-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.dash-side-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-side-card-meta {
    font-size: 0.72rem;
    color: #888;
    margin-top: 2px;
}

.dash-side-card-arrow {
    color: #bbb;
    font-size: 0.85rem;
}

.dash-side-card-link:hover .dash-side-card-arrow {
    color: var(--vs-primary);
}

.dash-side-toggle {
    margin-top: 10px;
    width: 100%;
    background: none;
    border: 1px dashed var(--vs-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--vs-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dash-side-toggle i {
    color: #fff;
}

.dash-side-toggle:hover {
    background: #e6f7e2;
    border-color: var(--vs-primary);
}

.dash-main-footer {
    margin-top: 32px;
    display: flex;
    justify-content: flex-start;
}

.dash-side-mark-read {
    background: none;
    border: none;
    color: var(--vs-primary);
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.dash-side-mark-read:hover {
    opacity: 1;
    text-decoration: underline;
}


.text-gold { color: var(--vs-gold) !important; }

/* Flex-Row für Kacheln (feste Größe, Umbruch) */
.dash-tile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    overflow: visible;
}

.dash-tile-wrap {
    flex: 0 0 250px;
    overflow: visible;
}

.dash-card {
    background: #fff;
    border-color: var(--vs-border) !important;
    box-shadow: none;
    width: 100%;
    height: 70px;
    overflow: visible;
}

/* Mobile: Kacheln über volle Breite */
@media (max-width: 576px) {
    .dash-tile-wrap {
        flex: 0 0 100%;
    }
}

/* Tablet: zwei Kacheln pro Zeile */
@media (min-width: 577px) and (max-width: 768px) {
    .dash-tile-wrap {
        flex: 0 0 calc(50% - 6px);
    }
}

.dash-card:hover {
    border-color: var(--vs-primary) !important;
}

.dash-icon-wrap {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--vs-success);
    font-size: 1.7rem;
    line-height: 1;
}

/* Titel-Spacing */
.dash-card-title {
    padding-left: 2.5rem;
    padding-right: 0.5rem;
}

/* What's New Badge */
.whats-new-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--vs-gold, #c8a96e);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
    cursor: pointer;
    line-height: 1.5;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.whats-new-dot:hover {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(200, 169, 110, 0.45);
}

/* What's New Popover */
.wn-popover { max-width: 340px; z-index: 1060; overflow: visible !important; }
.wn-popover .popover-body { padding: 16px 18px 14px; overflow: visible !important; }
.wn-popover .popover-inner { overflow: visible !important; }
.wn-popover-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; color: #212529; }
.wn-popover-counter { font-size: 0.7rem; color: #999; font-weight: 400; margin-left: 6px; }
.wn-popover-text { font-size: 0.82rem; color: #444; line-height: 1.55; flex: 1; }
.wn-popover-text p { margin: 0 0 8px 0; }
.wn-popover-text p:last-child { margin-bottom: 0; }
.wn-popover-footer { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e9ecef; text-align: right; flex-shrink: 0; }

/* Dashboard Tooltips – dunkles Grau statt schwarz, voll deckend */
.tooltip {
    --bs-tooltip-opacity: 1;
}
.tooltip.show {
    opacity: 1;
}
.tooltip .tooltip-inner {
    background-color: #495057;
    font-size: 0.78rem;
}
.tooltip .tooltip-arrow::before {
    border-bottom-color: #495057;
}
.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #495057;
}
.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: #495057;
}
.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: #495057;
}

/* Gruppen-Überschriften */
.dash-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    margin-bottom: 0.5rem;
    padding-left: 2px;
}

/* Dashboard – Gruppen-Container (gleichmäßiger Abstand per gap) */
#dashboard-groups { display: flex; flex-direction: column; gap: 2.5rem; }

/* Drag & Drop Handle */
.dash-group-label { cursor: grab; }
.dash-drag-handle { color: #adb5bd; margin-right: 6px; font-size: 1.1rem; vertical-align: -1px; }
.dash-group-label:hover .dash-drag-handle { color: var(--vs-primary); }
.dash-group.sortable-ghost { opacity: 0.3; }
.dash-group.sortable-chosen .dash-group-label { cursor: grabbing; }

/* Tile Drag Handle */
.dash-tile-handle {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: transparent;
    font-size: 0.85rem;
    cursor: grab;
    z-index: 2;
    transition: color 0.15s;
}
.dash-card:hover .dash-tile-handle { color: #ccc; }
.dash-tile-handle:hover { color: var(--vs-primary) !important; }
.dash-tile-wrap.sortable-ghost { opacity: 0.3; }
.dash-tile-wrap.sortable-chosen .dash-tile-handle { cursor: grabbing; color: var(--vs-primary); }


/* ============================================================================
   TABELLEN
   ============================================================================ */

/* Tabellen Header */
.table thead th {
    background-color: #f8f9fa;
    color: var(--vs-primary);
    border-bottom: 2px solid var(--vs-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 12px 15px;
    white-space: nowrap; /* Header soll nicht umbrechen */
}

.table tbody td,
.table tfoot td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Text-Kürzung (Truncation) für lange Texte */
.cell-truncate {
    max-width: 220px;       /* Maximale Breite */
    white-space: nowrap;    /* Kein Zeilenumbruch */
    overflow: hidden;       /* Überstehendes verstecken */
    text-overflow: ellipsis;/* Pünktchen (...) anzeigen */
    display: block;         /* Wichtig für truncate in Tabellen */
}

/* Währungs-Spalten (Breiter & kein Umbruch) */
.cell-currency {
    white-space: nowrap;
    min-width: 100px; /* Genug Platz für "1.234,56 €" */
    font-feature-settings: "tnum"; /* Tabellenziffern für bessere Lesbarkeit */
}


/* ============================================================================
   LINKS
   ============================================================================ */

/* Standard-Link in Tabellen */
.table-link {
    color: var(--vs-primary);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: all 0.2s ease;
}

.table-link:hover {
    color: var(--vs-success);
    border-bottom: 1px dashed var(--vs-success);
}


/* ============================================================================
   SPINNER & LOADER
   ============================================================================ */

/* Legacy (wird noch von kleinen Inline-Spinnern genutzt) */
.vs-spinner-large {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(26, 78, 58, 0.1);
    border-top-color: var(--vs-primary);
    border-radius: 50%;
    animation: vs-spin 1s linear infinite;
}

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

/* ── Fullscreen Signet-Loader ────────────────────────────────── */

#global-loader {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.vs-loader-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-loader-icon {
    width: 48px;
    height: auto;
    opacity: 0.85;
    animation: vs-pulse 2s ease-in-out infinite;
}

@keyframes vs-pulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.05); }
}

.vs-loader-ring {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    animation: vs-ring-rotate 1.4s linear infinite;
}

.vs-loader-ring circle {
    fill: none;
    stroke: var(--vs-primary, #1A4E3A);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 200;
    stroke-dashoffset: 60;
}

@keyframes vs-ring-rotate {
    to { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 20px;
    color: var(--vs-primary, #1A4E3A);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    min-height: 1.4em;
}

.loader-sub {
    color: #5C5F62;
    font-weight: 400;
    font-size: 0.8rem;
    margin-top: 4px;
    min-height: 1.2em;
    text-align: center;
}


/* ============================================================================
   SYSTEM-ELEMENTE
   ============================================================================ */

.updates-box-compact {
    font-size: 0.8rem;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--vs-border);
}

.debug-box {
    background-color: var(--vs-warning);
    opacity: 0.7;
}

.debug-box:hover {
    opacity: 1;
}

.copy-success-flash {
    animation: flash-green 0.8s ease-out;
}

@keyframes flash-green {
    0% { background-color: rgba(0, 186, 57, 0.2); }
    100% { background-color: transparent; }
}


/* ============================================================================
   UPDATE-TIMELINE (Dashboard)
   ============================================================================ */

.update-timeline {
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

/* Scrollbar Styling */
.update-timeline::-webkit-scrollbar {
    width: 5px;
}

.update-timeline::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.update-timeline::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.update-timeline::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.update-entry {
    position: relative;
}

.change-item {
    line-height: 1.5;
    display: flex;
    align-items: center;
}

.changes-list {
    border-left: 2px solid #e9ecef;
    padding-left: 0.75rem !important;
}

.page-header .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
}

.page-header .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-1px);
}

.page-header .btn-outline-light:active {
    transform: translateY(0);
}

/* Auf kleinen Bildschirmen: Nur Icon anzeigen */
@media (max-width: 576px) {
    .page-header .btn-outline-light span {
        display: none;
    }

    .page-header .btn-outline-light {
        padding: 0.375rem 0.5rem;
    }
}


/* ============================================================================
   DASHBOARD – UPDATE-HISTORY (Footer)
   ============================================================================ */

.update-history-summary {
    max-height: 100px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Hauptüberschriften ausblenden */
.update-history-summary h1,
.update-history-summary h2 {
    display: none;
}

/* Datumsüberschriften dezent stylen */
.update-history-summary h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vs-primary);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    padding-bottom: 0.125rem;
    border-bottom: 1px solid var(--vs-border);
}

.update-history-summary h3:first-child {
    margin-top: 0;
}

.update-history-summary ul {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}

.update-history-summary li {
    margin-bottom: 0.125rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.update-history-summary strong {
    color: var(--vs-success);
    font-weight: 600;
}


/* ============================================================================
   UPDATE-HISTORY – Vollständige Changelog-Seite
   ============================================================================ */

.update-history-full h1,
.update-history-full h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vs-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--vs-border);
}

.update-history-full h1:first-child,
.update-history-full h2:first-child {
    margin-top: 0;
}

.update-history-full h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vs-primary);
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    padding-bottom: 0.125rem;
    border-bottom: 1px solid var(--vs-border);
}

.update-history-full ul {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.update-history-full li {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.update-history-full strong {
    color: var(--vs-success);
    font-weight: 600;
}


/* ============================================================================
   DATA QUALITY – BETA-KACHEL
   ============================================================================ */

/* Gestrichelter Rahmen signalisiert Beta-Status */
.dq-beta-card {
    border: 1px dashed #e76f51 !important;
}

.dq-beta-card:hover {
    border-color: #e76f51 !important;
}

/* Hinweis-Streifen am Kartenende */
.dq-beta-footer {
    background: #fff8f5;
    color: #e76f51;
    font-size: 0.7rem;
}

/* Icon-Hintergrund (Dunkelgrün, passend zu vs-primary) */
.dq-icon-bg {
    background-color: rgba(45, 106, 79, 0.1);
}

.dq-icon-color {
    color: #2d6a4f;
}

/* BETA-Badge (Dashboard-Kachel) — siehe auch .dq-beta-badge weiter unten */

/* Scope-Badges (welche Datentypen unterstützt werden) */
.dq-scope-active {
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
    font-size: 0.65rem;
}

.dq-scope-soon {
    background: #f8f9fa;
    color: #adb5bd;
    border: 1px solid #dee2e6;
    font-size: 0.65rem;
    opacity: 0.6;
}

/* Data Quality – Name als Link in der Übersichtstabelle */
.dq-name-link:hover {
    color: var(--vs-primary) !important;
    text-decoration: underline !important;
}

/* ============================================================================
   TOOLTIPS – Zentrale Styles (genutzt in Data Quality, Periodenvergleich etc.)
   ============================================================================ */

/* Info-Icon mit Tooltip */
.vs-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    font-size: 0.65rem;
    cursor: help;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.vs-info-icon:hover {
    background: #1a4e3a;
    color: #fff;
}

/* FAIL-Badge für Data Quality */
.dq-fail-badge {
    background: #212529;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

/* Klickbare Tabellenzeilen (Data Quality) */
#dq-table tbody tr:hover {
    background-color: rgba(26, 78, 58, 0.05);
}
#dq-table tbody tr:hover td:first-child span {
    color: #1a4e3a;
}

/* Score-Verteilung Kacheln (Data Quality) */
.dq-dist-tile {
    flex: 1;
    min-width: 0;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px 6px 7px;
    text-align: center;
}

.dq-dist-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.dq-dist-label {
    font-size: 0.65rem;
    color: #888;
    line-height: 1.3;
    margin-top: 3px;
}

.dq-dist-label span {
    font-size: 0.6rem;
    color: #aaa;
}

/* FAIL-Filter-Button aktiver Zustand */
.dq-filter-btn[data-filter="fail"].active {
    background: #212529 !important;
    color: #fff !important;
    border-color: #212529 !important;
}


/* ============================================================================
   LOGIN-SEITE (Passwordless Auth)
   ============================================================================ */

.login-page-body {
    background: #0e1f18;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Georgia', serif;
}

.login-page-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0,186,57,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(200,169,110,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(12px);
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-wrap img {
    height: 36px;
    opacity: 0.9;
}

.login-subtitle {
    color: rgba(255,255,255,0.35);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.login-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 0.4rem;
}

.login-lead {
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
    margin-bottom: 1.8rem;
    font-family: system-ui, sans-serif;
}

.login-label {
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    font-family: system-ui, sans-serif;
    margin-bottom: 0.4rem;
    display: block;
}

.login-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.2s;
    outline: none;
}

.login-input:focus {
    background: rgba(255,255,255,0.09);
    border-color: var(--vs-success);
    box-shadow: 0 0 0 3px rgba(0,186,57,0.12);
    color: #fff;
}

.login-input::placeholder { color: rgba(255,255,255,0.25); }

.login-input.code-input {
    font-size: 1.6rem;
    letter-spacing: 0.3em;
    text-align: center;
    font-family: 'Courier New', monospace;
    padding: 0.8rem 1rem;
}

.login-btn {
    background: var(--vs-success);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem;
    width: 100%;
    font-size: 0.95rem;
    font-family: system-ui, sans-serif;
    letter-spacing: 0.02em;
    transition: all 0.2s;
    cursor: pointer;
}

.login-btn:hover   { background: #00a832; transform: translateY(-1px); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.login-btn-link {
    background: none;
    border: none;
    color: var(--vs-gold, #c8a96e);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0;
    font-family: system-ui, sans-serif;
    text-decoration: underline;
    opacity: 0.8;
}

.login-btn-link:hover { opacity: 1; }

.login-alert {
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: system-ui, sans-serif;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.login-alert-error {
    background: rgba(220,53,69,0.15);
    border: 1px solid rgba(220,53,69,0.3);
    color: #f8a0a8;
}

.login-alert-success {
    background: rgba(0,186,57,0.12);
    border: 1px solid rgba(0,186,57,0.25);
    color: #7de89d;
}

.login-step { display: none; }
.login-step.active { display: block; }

.login-divider {
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 1.5rem 0;
}

.login-hint {
    color: rgba(255,255,255,0.3);
    font-size: 0.75rem;
    text-align: center;
    font-family: system-ui, sans-serif;
    margin-top: 1rem;
}

.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vs-spin 0.6s linear infinite;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}


/* ============================================================================
   HEADER – USER-INFO & LOGOUT
   ============================================================================ */

.user-info-pill {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 4px 12px 4px 10px;
    color: #fff;
    font-size: 0.82rem;
}

.user-info-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 0 0 0 8px;
    border-left: 1px solid rgba(255,255,255,0.2);
    margin-left: 4px;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
}

.btn-logout:hover {
    color: #fff;
}

/* BETA-Badge für Data Quality */
.dq-beta-badge {
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    padding: 3px 7px;
}


/* ============================================================================
   PORTFOLIO – Entity Combobox
   ============================================================================ */

.entity-combobox {
    position: relative;
}

.entity-combobox .entity-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--vs-border);
    border-top: none;
    border-radius: 0 0 .375rem .375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    display: none;
}

.entity-combobox .entity-list.show {
    display: block;
}

.entity-combobox .entity-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .875rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.entity-combobox .entity-item .entity-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.entity-combobox .entity-item .entity-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .7rem;
    color: #6c757d;
}

.entity-combobox .entity-item:hover,
.entity-combobox .entity-item.active {
    background: #f0f4ff;
}

.entity-combobox .entity-item .badge {
    font-size: .7rem;
    font-weight: 500;
}


/* ============================================================================
   PORTFOLIO – Entity Header
   ============================================================================ */

#entity-header {
    display: none;
}

#entity-header .nav-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ============================================================================
   PORTFOLIO – Stats (klappbar)
   ============================================================================ */

#stats-container .stats-content {
    transition: max-height .4s ease, opacity .2s ease;
    max-height: 600px;
    opacity: 1;
    overflow: hidden;
}

#stats-container.collapsed .stats-content {
    max-height: 0;
    opacity: 0;
}

#stats-container .stats-toggle {
    cursor: pointer;
    user-select: none;
}

#stats-container .stats-toggle i {
    transition: transform .2s ease;
}

#stats-container.collapsed .stats-toggle i {
    transform: rotate(-90deg);
}


/* ============================================================================
   PORTFOLIO – Produkttyp-Select
   ============================================================================ */

.pf-product-type-select {
    width: auto;
}


/* ============================================================================
   PORTFOLIO – Entity-Badges (Combobox + Header)
   ============================================================================ */

.pf-badge-entity {
    font-size: .65rem;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
    letter-spacing: .02em;
}

.pf-badge-dist {
    background: var(--vs-gold);
    color: #fff;
}

.pf-badge-both {
    background: var(--vs-warning);
    color: #212529;
}

.pf-badge-sup {
    background: #6c757d;
    color: #fff;
}

.pf-badge-man {
    background: #f8f9fa;
    color: var(--vs-primary);
    border: 1px solid var(--vs-border);
}


/* ============================================================================
   PORTFOLIO – Dropship-Badge (Tabelle)
   ============================================================================ */

.pf-badge-dropship {
    font-size: .6rem;
    font-weight: 500;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid var(--vs-border);
    vertical-align: middle;
    margin-left: 4px;
}


/* ============================================================================
   PORTFOLIO – Stats Cards
   ============================================================================ */

#stats-container.collapsed {
    margin-bottom: .5rem !important;
}

#stats-container.collapsed .stats-toggle {
    margin-bottom: 0 !important;
}


/* ============================================================================
   PORTFOLIO – Sortierbare Spaltenheader
   ============================================================================ */

.sortable-th {
    cursor: pointer;
}


/* ============================================================================
   UTILITY CLASSES – Inline-Style Extraktion
   ============================================================================ */

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Spaltenbreiten (Tabellen) */
.w-col-32  { width: 32px; }
.w-col-50  { width: 50px; }
.w-col-60  { width: 60px; }
.w-col-80  { width: 80px; }
.w-col-100 { width: 100px; }
.w-col-120 { width: 120px; }
.w-col-140 { width: 140px; }
.w-col-150 { width: 150px; }
.w-col-200 { width: 200px; }

/* Prozentuale Spaltenbreiten */
.w-pct-6  { width: 6%; }
.w-pct-7  { width: 7%; }
.w-pct-9  { width: 9%; }
.w-pct-26 { width: 26%; }
.w-pct-40 { width: 40%; }

/* Schriftgrößen */
.fs-60 { font-size: 0.60rem; }
.fs-62 { font-size: 0.62rem; }
.fs-65 { font-size: 0.65rem; }
.fs-68 { font-size: 0.68rem; }
.fs-70 { font-size: 0.70rem; }
.fs-72 { font-size: 0.72rem; }
.fs-85 { font-size: 0.85rem; }
.fs-90 { font-size: 0.90rem; }
.fs-95 { font-size: 0.95rem; }

/* Letter Spacing */
.ls-sm { letter-spacing: 0.06em; }

/* Composite: Feld-Label (Data Quality Detail etc.) */
.field-label-xs {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
}

/* Composite: Badge klein & leicht */
.badge-xs-light {
    font-size: 0.62rem;
    font-weight: 400;
}

/* Buttons – kompakt (Filter etc.) */
.btn-xs-compact {
    font-size: 0.72rem;
    padding: 2px 8px;
}

/* Höhen – Viewport-Calc */
.h-viewport-160 { height: calc(100vh - 160px); }
.h-viewport-220 { height: calc(100vh - 220px); }

/* Mindesthöhen */
.min-h-60  { min-height: 60px; }
.min-h-500 { min-height: 500px; }

/* Max-Höhe + Scroll */
.max-h-200-scroll {
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

.max-h-250-scroll {
    max-height: 250px;
    overflow-y: auto;
}

/* Modal-Höhe */
.modal-vh-85 { max-height: 85vh; }

/* Icon – groß & gedimmt */
.icon-xl-muted {
    font-size: 3rem;
    opacity: 0.3;
}

.icon-xl-primary {
    font-size: 3rem;
    opacity: 0.4;
    color: var(--vs-primary);
}

/* DQ – Score-Tile Rahmen-Farben */
.dq-border-success { border-top: 3px solid #1a9952; }
.dq-border-info    { border-top: 3px solid #0dcaf0; }
.dq-border-warning { border-top: 3px solid #ffc107; }
.dq-border-danger  { border-top: 3px solid #dc3545; }
.dq-border-dark    { border-top: 3px solid #212529; }

/* DQ – Filter-Buttons Inline-Overrides */
.dq-filter-btn-fail {
    border-color: #212529;
    color: #212529;
}

/* Text-Utilities */
.text-vs-primary { color: var(--vs-primary); }
.text-mono-xs {
    font-size: 0.65rem;
    word-break: break-all;
    color: #999;
}

/* Iframe ohne Rahmen */
.iframe-borderless {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.375rem;
}

/* Logo-Höhe */
.logo-h-35 { height: 35px; }

/* Select mit min-width */
.select-w-200 { min-width: 200px; }


/* ============================================================================
   PERSONA AI CHAT
   ============================================================================ */

.persona-ai-msg {
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.45;
}

.persona-ai-msg.user {
    background: var(--vs-primary, #1a3a5c);
    color: white;
    margin-left: 20%;
    text-align: right;
}

.persona-ai-msg.assistant {
    background: white;
    border: 1px solid #dee2e6;
    margin-right: 20%;
}

.persona-ai-msg .ai-action-btn {
    margin-top: 6px;
}

/* ============================================================================
   PRICE ADJUSTMENT (Portfolio → Preisanpassung)
   Zahlen-Zellen und Inputs 1px kleiner als Basis-Body (Bootstrap .small = 0.875rem).
   ============================================================================ */
.pa-num,
.pa-num input.form-control {
    font-size: 0.8125rem; /* = 13px bei 16px Root */
    line-height: 1.35;
}
.pa-num input.form-control {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}
/* ============================================================================
   GRAPE RATING — 1..5 Trauben (Data Quality / Produkte, Hersteller, Lieferanten)
   Verwendet signet.png als CSS-Maske, eingefärbt via background-color.
   ============================================================================ */
.grape-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background-color 0.12s ease;
}
.grape-badge:hover {
    background-color: rgba(212, 175, 55, 0.08);
}
.grape-badge:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}
.grape-badge-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-left: 6px;
    font-weight: 500;
}
.grape-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    -webkit-mask: url('/static/images/signet.png') no-repeat center / contain;
            mask: url('/static/images/signet.png') no-repeat center / contain;
    transition: background-color 0.15s ease;
}
.grape-icon-active   { background-color: #D4AF37; } /* Gold */
.grape-icon-inactive { background-color: #d8d8d8; } /* Hellgrau */
.grape-badge:hover .grape-icon-inactive { background-color: #c0c0c0; }

/* Picker-Modal: einzelne Stufen-Reihen */
.grape-stage-row {
    background-color: #fff;
    border-color: #e9ecef !important;
    transition: border-color 0.12s, background-color 0.12s;
}
.grape-stage-row:hover {
    background-color: #fafafa;
    border-color: #d4af37 !important;
}
.grape-stage-row-selected {
    background-color: rgba(212, 175, 55, 0.08) !important;
    border-color: #D4AF37 !important;
}

/* ============================================================================
   GAMIFICATION – USER-SCORE & WARNINGS
   ============================================================================ */

/* Score-Pill im Header — Stern + Zahl direkt neben dem Usernamen. */
.user-score {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 215, 0, 0.18);
    color: #ffd966;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    transform-origin: center;
    transition: transform 0.2s ease;
}
.user-score i {
    font-size: 0.8rem;
    color: #ffd83a;
}
.user-score.score-bump {
    animation: score-bump 0.7s cubic-bezier(.34,1.56,.64,1);
}
@keyframes score-bump {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.35); }
    55%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Warnings-Tab — bewusst rot, weil „Achtung — etwas ist falsch". */
.dash-side-tab-warning {
    background: #fff1f0;
    color: #a8001a;
    border-color: rgba(168, 0, 26, 0.18);
}
.dash-warnings-section .dash-side-block {
    background: #fff1f0;
    border-color: rgba(168, 0, 26, 0.18);
}
.dash-warnings-section .dash-side-card {
    background: #ffe6e3;
}
.dash-warnings-section .dash-side-card .dash-side-card-icon {
    color: #c00 !important;
}

/* Warning-Card-Layout: Body links, Detail-Link + Resolve-Button rechts. */
.dash-warning-card {
    position: relative;
    padding-right: 14px;
}
.dash-warning-detail {
    color: #a8001a;
    margin-right: 6px;
    font-size: 0.9rem;
    opacity: 0.7;
    text-decoration: none;
}
.dash-warning-detail:hover { opacity: 1; }

.dash-warning-resolve {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #198754;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.dash-warning-resolve:hover { background: #157347; }
.dash-warning-resolve:active { transform: scale(0.96); }
.dash-warning-resolve[disabled] { opacity: 0.5; cursor: wait; }
.dash-warning-resolve-pts {
    font-size: 0.7rem;
    opacity: 0.85;
    padding-left: 2px;
}
