        /* --- PDF EINSTELLUNGEN POP-OUT ANIMATION --- */
        @keyframes popOutLeftUp {
            0% {
                opacity: 0;
                transform: scale(0.8) translate(20px, 20px);
            }

            100% {
                opacity: 1;
                transform: scale(1) translate(0, 0);
            }
        }

        /* NEU: Rückwärts-Animation für weiches Schließen */
        @keyframes popInRightDown {
            0% {
                opacity: 1;
                transform: scale(1) translate(0, 0);
            }

            100% {
                opacity: 0;
                transform: scale(0.8) translate(20px, 20px);
            }
        }

        /* Wenn das Fenster schließt, diese Animation anwenden */
        .pdf-settings-popout.closing {
            animation: popInRightDown 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
            pointer-events: none !important;
            /* Verhindert Klicks während der Animation */
        }

        .pdf-settings-popout {
            display: none;
            position: absolute;
            bottom: 50px;
            right: 0;
            width: 380px;
            max-height: 65vh;
            overflow-y: auto;
            background: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            box-shadow: -5px 15px 40px rgba(0, 0, 0, 0.25);
            z-index: 150;
            transform-origin: bottom right;
            animation: popOutLeftUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        /* Entfernt die alten Zahlen aus den roten Punkten */
        .part-marker::after {
            content: none !important;
        }

        :root {
            --hormann-blue: #005596;
            --hormann-hover: #003d6e;
            --alert-orange: #e67e22;
            --friendly-green: #27ae60;
            --friendly-green-hover: #219150;
            --text-dark: #333;
            --bg-light: #f4f6f9;
            --border-color: #ddd;
            --disabled-gray: #bdc3c7;
            --error-red: #e74c3c;
            --color-br40: #005596;
            /* Hörmann Blau */
            --color-br30: #e67e22;
            /* Orange */
            --color-br20: #27ae60;
            /* Grün oder Grau */
            --color-tools: #8e44ad;
            /* Lila für Interne Tools */
        }

        /* --- WICHTIGER LAYOUT FIX: GLOBAL BOX-SIZING --- */
        /* Zwingt alle Boxen dazu, Padding nach innen zu rechnen. Verhindert das Kollidieren von Grid-Spalten! */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
        }

        html {
            overflow-y: scroll;
            /* Vertikaler Balken immer da (gegen Springen) */
            overflow-x: hidden;
            /* Kein horizontaler Balken auf der Hauptseite */
            font-size: 14px;
            height: 100%;
        }

        body,
        button,
        input,
        select,
        textarea,
        .modal-content,
        h1,
        h2,
        h3 {
            font-family: 'Segoe UI', Arial, sans-serif !important;
        }

        body {
            margin: 0;
            padding: 20px;
            color: var(--text-dark);
            background: #f0f2f5;
            min-height: 100%;
            max-width: 100vw;
        }

        /* --- SCROLLBALKEN --- */
        * {
            scrollbar-width: thin;
            scrollbar-color: #ccc transparent;
        }

        ::-webkit-scrollbar {
            height: 8px;
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background-color: #ccc;
            border-radius: 4px;
            border: 2px solid transparent;
            background-clip: content-box;
        }

        ::-webkit-scrollbar-thumb:hover {
            background-color: var(--hormann-blue);
        }

        /* HEADER */
        .main-header {
            text-align: center;
            margin-bottom: 25px;
        }

        .main-header h1 {
            color: var(--hormann-blue);
            font-size: 1.6rem;
            font-weight: 700;
            margin: 0 0 5px 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .main-header p.subline {
            color: #666;
            font-size: 0.9rem;
            margin: 0;
        }

        /* TABS */
        .series-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0 auto;
    border-bottom: none;
}

        .tab-btn {
            background: transparent;
            border: none;
            border-bottom: 4px solid transparent;
            padding: 10px 20px;
            font-size: 1rem;
            font-weight: bold;
            color: #777;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: -2px;
        }

        .tab-btn.disabled {
            color: #ccc;
            cursor: not-allowed;
            pointer-events: none;
        }

        /* BR40 (Blau) */
        #tabBR40:hover {
            color: var(--color-br40);
            background: rgba(0, 85, 150, 0.05);
        }

        #tabBR40.active {
            color: var(--color-br40);
            border-bottom-color: var(--color-br40);
        }

        /* BR30 (Orange) */
        #tabBR30:hover {
            color: var(--color-br30);
            background: rgba(230, 126, 34, 0.05);
        }

        #tabBR30.active {
            color: var(--color-br30);
            border-bottom-color: var(--color-br30);
        }

        /* BR20 (Grün) */
        #tabBR20:hover {
            color: var(--color-br20);
            background: rgba(39, 174, 96, 0.05);
        }

        #tabBR20.active {
            color: var(--color-br20);
            border-bottom-color: var(--color-br20);
        }

        /* Tools (Lila) */
        #tabTOOLS:hover {
            color: var(--color-tools);
            background: rgba(142, 68, 173, 0.05);
        }

        #tabTOOLS.active {
            color: var(--color-tools);
            border-bottom-color: var(--color-tools);
        }

        /* BADGES FÜR DIE SUCHE */
        .badge-br40 {
            background: #eaf4fb;
            color: var(--color-br40);
        }

        .badge-br30 {
            background: #fdf2e9;
            color: var(--color-br30);
        }

        .badge-br20 {
            background: #eafaf1;
            color: var(--color-br20);
        }

        /* --- GRID LAYOUT (Optimiert) --- */
        .app-container {
            display: grid;
            /* Spalte 1: 320px fest. Spalte 2: Rest, aber darf schrumpfen (minmax 0) */
            grid-template-columns: 320px minmax(0, 1fr);
            gap: 25px;
            align-items: start;
            max-width: 1400px;
            margin: 0 auto;
        }

        /* --- BR30 MODUS: Option A verstecken, Option B zentrieren --- */
        .app-container.br30-mode {
            grid-template-columns: 1fr !important;
            /* Erzwingt eine einzige, breite Spalte */
            max-width: 1000px;
            /* Macht den Container etwas kompakter, damit es perfekt mittig wirkt */
        }

        /* RESPONSIVE: Früherer Umbruch für Laptops (ab 1150px statt 1000px) */
        @media (max-width: 1150px) {
            .app-container {
                grid-template-columns: 1fr;
                /* Alles untereinander */
            }

            .card-box {
                max-width: 100%;
            }
        }

        .card-box {
            background: #fff;
            border-radius: 6px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
            padding: 20px;
            border-top: 4px solid var(--hormann-blue);
            position: relative;
            width: 100%;
            /* WICHTIG: Verhindert, dass Grid-Items breiter werden als erlaubt */
            min-width: 0;
        }

        .card-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-dark);
            margin-top: 0;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: nowrap;
        }

        .card-badge {
            background: #eee;
            color: #555;
            font-size: 0.7rem;
            padding: 3px 6px;
            border-radius: 4px;
            text-transform: uppercase;
            font-weight: bold;
            white-space: nowrap;
            flex-shrink: 0;
        }

        /* LINKS: FORMULARE */
        .controls {
            background: transparent;
            padding: 0;
            border: none;
            font-size: 0.85rem;
        }

        .controls h3 {
            margin-top: 15px;
            margin-bottom: 8px;
            font-size: 0.9rem;
            color: var(--hormann-blue);
            letter-spacing: 0.5px;
            font-weight: 700;
        }

        .controls h3:first-of-type {
            margin-top: 0;
        }

        .form-group {
            margin-bottom: 12px;
            position: relative;
        }

        label {
            display: block;
            margin-bottom: 4px;
            font-weight: 600;
            font-size: 0.8rem;
        }

        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .validation-icon {
            margin-left: 8px;
            font-weight: bold;
            font-size: 1.1rem;
        }

        .val-error {
            color: var(--error-red);
        }

        .val-ok {
            color: var(--friendly-green);
        }

        .number-control {
            display: flex;
            align-items: center;
            width: 100%;
            max-width: 140px;
            border: 1px solid #ccc;
            border-radius: 4px;
            background: white;
            overflow: hidden;
            height: 32px;
        }

        .number-control button {
            width: 35px;
            height: 100%;
            background: #f9f9f9;
            border: none;
            border-right: 1px solid #ddd;
            font-weight: bold;
            font-size: 1rem;
            cursor: pointer;
            color: #333;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .number-control button:hover {
            background: #eee;
        }

        .number-control input {
            flex: 1;
            text-align: center;
            border: none;
            font-size: 0.9rem;
            padding: 0;
            outline: none;
            background: white;
            color: #333;
            height: 100%;
        }

        .hint-text {
            font-size: 0.7rem;
            color: #888;
            margin-top: 3px;
            display: block;
        }

        .checkbox-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            background: #f9f9f9;
            padding: 10px;
            border-radius: 4px;
            margin-bottom: 12px;
            border: 1px solid #eee;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .checkbox-item label {
            margin: 0;
            font-size: 0.85rem;
            font-weight: normal;
            cursor: pointer;
        }

        .fitting-options {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }

        .fitting-btn {
            flex: 1;
            border: 2px solid #ddd;
            border-radius: 4px;
            padding: 6px;
            cursor: pointer;
            background: white;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            opacity: 0.7;
        }

        .fitting-btn img {
            width: 100%;
            height: auto;
            max-height: 40px;
            object-fit: contain;
            margin-bottom: 4px;
        }

        .fitting-btn span {
            font-weight: bold;
            font-size: 0.8rem;
        }

        .fitting-btn:hover {
            border-color: #aaa;
            opacity: 1;
        }

        .fitting-btn.active {
            border-color: var(--hormann-blue);
            background-color: #eaf4fb;
            opacity: 1;
            box-shadow: 0 0 0 2px rgba(0, 85, 150, 0.1);
        }

        .fitting-btn.disabled {
            opacity: 0.2;
            pointer-events: none;
            cursor: not-allowed;
            filter: grayscale(100%);
            background-color: #f5f5f5;
            border-color: #ddd;
        }

        .discount-row {
            display: flex;
            gap: 10px;
            align-items: center;
            margin-bottom: 8px;
            font-size: 0.85rem;
        }

        .discount-label {
            width: 80px;
            font-weight: 600;
        }

        .discount-input {
            width: 50px;
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
            text-align: right;
        }

        .btn-calc {
            background: var(--hormann-blue);
            color: white;
            border: none;
            padding: 12px;
            width: 100%;
            cursor: pointer;
            border-radius: 4px;
            font-size: 0.95rem;
            margin-top: 15px;
            font-weight: bold;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .btn-calc:hover {
            background: var(--hormann-hover);
            transform: translateY(-1px);
        }

        .btn-calc.dirty {
            background-color: var(--alert-orange);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.4);
            }

            70% {
                box-shadow: 0 0 0 10px rgba(230, 126, 34, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(230, 126, 34, 0);
            }
        }

        .btn-pdf {
            background: var(--friendly-green);
            color: white;
            border: none;
            padding: 12px;
            width: 100%;
            cursor: pointer;
            border-radius: 4px;
            font-size: 0.95rem;
            margin-top: 10px;
            font-weight: bold;
            transition: background 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* --- MODERNE EXPORT BUTTONS --- */
        .export-btn-sec {
            background: #fdfdfd;
            border: 1px solid #dcdfe3;
            color: #555;
            padding: 0;
            height: 34px;
            border-radius: 4px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin: 0;
        }

        .export-btn-sec:hover {
            background: #eaf4fb;
            border-color: var(--hormann-blue);
            color: var(--hormann-blue);
        }

        .export-btn-main {
            background: var(--hormann-blue);
            color: white;
            border: none;
            padding: 0 10px;
            height: 38px;
            border-radius: 4px;
            font-size: 0.9rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s;
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin: 0;
            box-shadow: 0 2px 4px rgba(0, 85, 150, 0.2);
        }

        .export-btn-main:hover {
            background: var(--hormann-hover);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0, 85, 150, 0.3);
        }

        .export-icon-btn {
            background: white;
            border: 1px solid #dcdfe3;
            color: #555;
            width: 38px;
            height: 38px;
            border-radius: 4px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin: 0;
            padding: 0;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
        }

        .export-icon-btn:hover {
            background: #eaf4fb;
            border-color: var(--hormann-blue);
            color: var(--hormann-blue);
            transform: translateY(-1px);
            box-shadow: 0 3px 6px rgba(0, 85, 150, 0.15);
        }

        .btn-pdf:hover {
            background: var(--friendly-green-hover);
            transform: translateY(-1px);
        }

        button:disabled {
            background-color: var(--disabled-gray) !important;
            cursor: not-allowed !important;
            animation: none !important;
            box-shadow: none !important;
            transform: none !important;
            opacity: 0.7;
        }

        button.reset-filter {
            background: #5e6d7a;
            margin-top: 0;
            margin-bottom: 20px;
            font-size: 0.9rem;
            padding: 10px;
            border: none;
            color: white;
            border-radius: 4px;
            cursor: pointer;
            width: 100%;
            font-weight: bold;
            display: block;
            text-align: center;
        }

        button.reset-filter:hover {
            background: #4b5863;
        }

        /* --- RECHTS: VISUALISIERUNG --- */
        .output-area {
            width: 100%;
            overflow-x: auto;
            padding-bottom: 5px;
        }

        /* --- OPTION B: HAUPT-LAYOUT --- */
        .visual-container-flex {
            display: flex;
            border: 1px solid #ddd;
            border-radius: 6px;
            background: #ffffff !important;
            margin-bottom: 15px;

            /* NEU: Zwingt die seitlichen Menüs, sich an die Höhe der Skizze anzupassen */
            align-items: stretch;

            width: 90%;

            /* NEU: Macht die Skizze und die Box kompakter (850px statt 1050px) */
            max-width: 850px;

            margin-left: auto;
            margin-right: auto;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
        }

        /* Auf kleinen Bildschirmen automatisch wieder 100% Breite */
        @media (max-width: 800px) {
            .visual-container-flex {
                width: 100%;
                min-width: auto;
            }
        }

        /* --- MITTE: GRAFIK & FILTER --- */
        .visual-wrapper {
            position: relative;
            flex: 1;
            background: #ffffff !important;
            line-height: 0;
            font-size: 0;
            /* FIX: Hier darf kein display: flex stehen, da es die relative Positionierung stört */
            display: block;
        }

        .visual-img-bg {
            width: 100%;
            height: auto;
            display: block;
            /* DAS IST DER MAGISCHE FILTER: Er "bleicht" graue Hintergründe im Bild auf Reinweiß aus, behält aber die dunklen Linien! */
            filter: grayscale(100%) brightness(1.06) contrast(1.1);
        }

        /* --- NEU: LINKE SIDEBAR (Für Schalter) --- */
        .visual-sidebar-left {
            width: 110px;
            background: #ffffff !important;
            border-right: 1px solid #ddd;
            padding: 15px 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            /* <-- HIER EINFÜGEN */
            gap: 15px;
            flex-shrink: 0;
        }

        .visual-sidebar-left h4 {
            margin: 0;
            font-size: 0.85rem;
            text-align: center;
            color: #555;
            width: 100%;
            border-bottom: 1px solid #eee;
            padding-bottom: 8px;
        }

        .visual-sidebar-left .checkbox-item {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .visual-sidebar-left label.opt-label {
            font-size: 0.85rem !important;
            font-weight: bold;
            margin: 0;
            color: #333;
            text-align: center;
        }

        /* --- RECHTE SIDEBAR (Export/Beschlag) --- */
        .visual-sidebar {
            width: 130px;
            background: #ffffff !important;
            border-left: 1px solid #ddd;
            padding: 15px 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            /* <-- HIER EINFÜGEN */
            gap: 8px;
            flex-shrink: 0;
        }

        .visual-sidebar h4 {
            margin: 0 0 8px 0;
            font-size: 0.85rem;
            text-align: center;
            color: #555;
        }

        .visual-sidebar .fitting-btn {
            width: 100%;
            padding: 4px;
            flex: none;
            height: auto;
        }

        .visual-sidebar .fitting-btn img {
            max-height: 35px;
        }

        /* MARKER - PROZENTUAL POSITIONIERT */
        .part-marker {
            position: absolute;
            width: 28px;
            height: 28px;
            background: rgba(231, 76, 60, 0.95);
            border: 2px solid white;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            z-index: 10;
            transition: transform 0.2s, background 0.2s;
            transform: translate(-50%, -50%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            font-weight: bold;
            font-family: Arial, sans-serif;
        }

        .part-marker::after {
            content: attr(data-pos);
        }

        .part-marker:hover {
            transform: translate(-50%, -50%) scale(1.3);
            z-index: 12;
        }

        .part-marker.active {
            background: #27ae60;
            border-color: #fff;
            opacity: 1 !important;
            z-index: 11;
            box-shadow: 0 0 10px rgba(39, 174, 96, 0.6);
        }

        /* POSITIONS */
        .pos-bl {
            top: 97%;
            left: 3%;
        }

        .pos-br {
            top: 97%;
            left: 97%;
        }

        .pos-tl {
            top: 4%;
            left: 3%;
        }

        .pos-tr {
            top: 4%;
            left: 97%;
        }

        .pos-ml {
            top: 50%;
            left: 3%;
        }

        .pos-ml-1 {
            top: 26%;
            left: 3%;
        }

        .pos-ml-2 {
            top: 75%;
            left: 3%;
        }

        .pos-mr {
            top: 50%;
            left: 97%;
        }

        .pos-mr-1 {
            top: 26%;
            left: 97%;
        }

        .pos-mr-2 {
            top: 75%;
            left: 97%;
        }

        .pos-center-1 {
            top: 75%;
            left: 50%;
        }

        .pos-center-2 {
            top: 50%;
            left: 50%;
        }

        .pos-center-3 {
            top: 27%;
            left: 50%;
        }

        .pos-bottom-seal {
            top: 98.5%;
            left: 50%;
            width: 73%;
            height: 18px;
            border-radius: 15px;
            transform: translate(-50%, -50%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
        }

        .pos-bottom-seal::after {
            content: attr(data-pos);
            position: static;
            transform: none;
        }

        .pos-bottom-seal:hover {
            transform: translate(-50%, -50%) scale(1.02);
            z-index: 20;
        }

        /* --- RESPONSIVE TABELLE (Zurück zum Standard) --- */
        .table-scroll-container {
            width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            /* Verhindert vertikales Zucken */
            margin-bottom: 20px;
            border: 1px solid #ddd;
            background: #fff;
            padding: 2px;
            /* Platz für Schatten */
        }

        .catalog-table {
            min-width: 950px;
            /* Etwas breiter als 800px, damit die Boxen passen */
            width: 100%;
            table-layout: fixed;
            border-collapse: collapse;
        }

        /* Wir zwingen nur die Mengen-Spalte etwas breiter, da wir den Kasten vergrößert haben. 
           Der Rest (Art-Nr etc.) nimmt sich den Platz, der im HTML definiert ist. */
        .catalog-table th:nth-child(6) {
            width: 140px !important;
            /* Überschreibt die 100px aus dem HTML */
        }

        .catalog-table th {
            background: #f9f9f9;
            padding: 8px;
            border-bottom: 2px solid #ddd;
            color: #555;
            font-size: 0.8rem;
            font-weight: 700;
        }

        .catalog-table th.text-right {
            text-align: right;
        }

        .catalog-table th.text-center {
            text-align: center;
        }

        .catalog-table td {
            padding: 6px 12px;
            /* Etwas mehr Luft seitlich */
            border-bottom: 1px solid #eee;
            vertical-align: middle;
            height: 55px;
        }

        /* --- TABELLEN SPALTEN OPTIMIERUNG FÜR BADGES --- */
        .catalog-table th:nth-child(1),
        .catalog-table td:nth-child(1) {
            padding-left: 6px !important;
            padding-right: 0 !important;
        }

        .catalog-table th:nth-child(2),
        .catalog-table td:nth-child(2) {
            padding-left: 4px !important;
            padding-right: 4px !important;
        }

        .catalog-table th:nth-child(3),
        .catalog-table td:nth-child(3) {
            padding-left: 2px !important;
            padding-right: 8px !important;
        }

        /* --- ANIMATIONEN & ZEILEN-EFFEKTE --- */

        /* 1. Basis-Zustand (Normal) */
        .catalog-table tr {
            transition: background-color 0.3s ease;
        }

        .catalog-table td {
            /* Wir animieren Padding und Opacity für den "Schrumpf"-Effekt */
            transition: padding 0.3s ease, opacity 0.3s ease, color 0.3s ease;
        }

        .part-img {
            width: 50px;
            height: 35px;
            object-fit: contain;
            border: 1px solid #eee;
            background: white;
            cursor: pointer;
            border-radius: 3px;
            /* Animation für das Bild */
            transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.2s;
        }

        /* 2. Deaktivierter Zustand (Abgewählt) */
        .row-disabled {
            background-color: #fcfcfc !important;
            /* Ganz helles Grau */
            color: #aaa;
            /* Text heller */
        }

        .row-disabled td {
            /* DER SCHRUMPF-EFFEKT: */
            padding-top: 2px !important;
            padding-bottom: 2px !important;
            height: 40px;
            /* Erzwingt, dass die Zeile niedriger wird */
            opacity: 0.5;
            /* Halb durchsichtig */
            pointer-events: none;
            /* Verhindert Klicks auf Buttons/Inputs */
        }

        /* Bild im abgewählten Zustand: Kleiner und Grau */
        .row-disabled .part-img {
            transform: scale(0.7);
            filter: grayscale(100%);
            opacity: 0.7;
        }

        /* WICHTIG: Die Checkbox muss klickbar bleiben und ihre Größe behalten */
        .row-disabled input[type="checkbox"] {
            pointer-events: auto;
            cursor: pointer;
            opacity: 1;
            /* Checkbox bleibt voll sichtbar */
        }

        .part-img {
            width: 50px;
            height: 35px;
            object-fit: contain;
            border: 1px solid #eee;
            background: white;
            cursor: pointer;
            border-radius: 3px;
        }

        .part-img:hover {
            transform: scale(2.0);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
            border-color: var(--hormann-blue);
            position: relative;
            z-index: 100;
            background: #fff;
            transition: transform 0.1s ease-out;
        }

        #tableBody tr:last-child .part-img:hover {
            transform-origin: center bottom;
        }

        /* Mengen-Eingabe (Breite Box beibehalten) */
        .qty-wrapper {
            display: flex;
            align-items: center;
            border: 1px solid #ddd;
            border-radius: 3px;
            overflow: hidden;
            width: 110px;
            /* Die Breite, die dir gefallen hat */
            margin: 0 auto;
            background: #fff;
        }

        .qty-wrapper button {
            width: 30px;
            height: 28px;
            background: #f5f5f5;
            border: none;
            cursor: pointer;
            font-weight: bold;
            font-size: 1rem;
        }

        .qty-wrapper button:hover {
            background: #e0e0e0;
        }

        .qty-wrapper input {
            flex: 1;
            text-align: center;
            border: none;
            font-size: 0.9rem;
            font-weight: bold;
            width: 50px;
            height: 28px;
        }

        .copy-btn {
            background: none;
            border: none;
            cursor: pointer;
            color: #aaa;
            font-size: 1.0rem;
            transition: color 0.2s;
            margin-left: 0;
            /* Wir steuern den Abstand jetzt direkt im HTML-Gap */
        }

        .copy-btn:hover {
            color: var(--hormann-blue);
        }

        .copy-btn.success {
            color: var(--friendly-green);
        }

        .sum-block {
            margin-top: 15px;
            border-top: 2px solid #eee;
            padding-top: 10px;
            width: 100%;
            max-width: 350px;
            margin-left: auto;
        }

        .sum-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
            font-size: 0.85rem;
        }

        .sum-total {
            font-weight: bold;
            color: var(--hormann-blue);
            font-size: 1rem;
            margin-top: 8px;
            border-top: 1px solid #ddd;
            padding-top: 8px;
        }

        /* MODALS, LOGIN, PROFILE, FOOTER (Unverändert gut) */

        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 2000;
            backdrop-filter: blur(2px);
            overflow-y: auto;
            padding: 20px 0;
        }

        .modal-content {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            position: relative;
            max-width: 480px;
            width: 90%;
            animation: fadeIn 0.3s;
            margin: auto;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .close-btn {
            position: absolute;
            top: -12px;
            right: -12px;
            background: white;
            color: #333;
            border: 2px solid #ddd;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            cursor: pointer;
            font-weight: bold;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }

        .close-btn:hover {
            background: #eee;
        }

        .text-center {
            text-align: center;
        }

        .text-right {
            text-align: right;
        }

        .hidden-text {
            color: transparent;
            user-select: none;
        }

        #userProfile {
            position: absolute;
            top: 20px;
            right: 30px;
        }

        .notification-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--error-red);
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            font-size: 11px;
            display: none;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            border: 2px solid white;
            z-index: 1001;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        #profileRole {
            font-size: 0.75rem;
            color: white;
            background-color: var(--hormann-blue);
            padding: 2px 6px;
            border-radius: 4px;
            display: inline-block;
            margin-bottom: 10px;
            font-weight: bold;
            text-transform: uppercase;
        }

        #menuAdminArea {
            border-bottom: 1px solid #eee;
            margin-bottom: 10px;
            padding-bottom: 10px;
            display: none;
        }

        .menu-request-item {
            font-size: 0.8rem;
            background: #fff3cd;
            padding: 8px;
            border-radius: 4px;
            margin-bottom: 5px;
            display: flex;
            flex-direction: column;
            gap: 5px;
            border: 1px solid #ffeeba;
        }

        .menu-request-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .role-select {
            padding: 3px;
            border: 1px solid #ccc;
            border-radius: 3px;
            font-size: 0.75rem;
            margin-right: 5px;
            cursor: pointer;
        }

        .btn-approve-small {
            background: var(--friendly-green);
            color: white;
            border: none;
            padding: 4px 8px;
            border-radius: 3px;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: bold;
        }

        .btn-reject-small {
            background: var(--error-red);
            color: white;
            border: none;
            padding: 4px 8px;
            border-radius: 3px;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: bold;
            margin-right: 5px;
        }

        .btn-reject-small:hover {
            background: #c0392b;
        }

        .login-intro {
            font-size: 0.95rem;
            color: #555;
            margin-bottom: 20px;
            line-height: 1.5;
        }

        .login-info-box {
            background-color: #fff3cd;
            border-left: 4px solid #e67e22;
            padding: 12px;
            font-size: 0.8rem;
            color: #444;
            text-align: left;
            margin-bottom: 15px;
            border-radius: 4px;
            line-height: 1.4;
        }

        .info-box-soft {
            background-color: #f9f9f9;
            border-left: 4px solid #7f8c8d;
            padding: 12px;
            font-size: 0.8rem;
            color: #444;
            text-align: left;
            margin-bottom: 20px;
            border-radius: 4px;
            line-height: 1.4;
        }

        .login-info-box strong,
        .info-box-soft strong {
            color: #333;
        }

        .app-footer {
            margin-top: 50px;
            padding: 20px 0;
            border-top: 1px solid #ddd;
            text-align: center;
            display: block;
            width: 100%;
            font-size: 0.85rem;
            color: #666;
        }

        .footer-link {
            color: var(--hormann-blue);
            text-decoration: underline;
            margin: 0 8px;
            cursor: pointer;
            font-weight: 600;
            transition: color 0.2s;
        }

        .footer-link:hover {
            color: var(--hormann-hover);
            text-decoration: none;
        }

        .legal-text {
            text-align: left;
            font-size: 0.9rem;
            line-height: 1.6;
            color: #333;
        }

        .legal-text h3 {
            border-bottom: 1px solid #eee;
            padding-bottom: 5px;
            margin-top: 20px;
        }

        .legal-text p {
            margin-bottom: 10px;
        }

        .input-required {
            border: 2px solid var(--error-red) !important;
            background-color: #fff0f0 !important;
            outline: none;
        }

        @keyframes shake {

            0%,
            100% {
                transform: translateX(0);
            }

            25% {
                transform: translateX(-5px);
            }

            75% {
                transform: translateX(5px);
            }
        }

        .shake-element {
            animation: shake 0.2s ease-in-out 0s 2;
        }

        /* --- VISUAL TOOLS STYLING --- */
        .tool-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 5px;
            width: 100%;
            margin-bottom: 5px;
        }

        .tool-btn {
            background: white;
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 6px 2px;
            cursor: pointer;
            font-size: 1.2rem;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #444;
        }

        .tool-label {
            font-size: 0.6rem;
            font-weight: bold;
            margin-top: 2px;
            text-transform: uppercase;
        }

        .tool-btn:hover {
            background: #f0f2f5;
            border-color: var(--hormann-blue);
            color: var(--hormann-blue);
            transform: translateY(-1px);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .tool-btn:active {
            transform: translateY(0);
        }

        .pdf-tool {
            grid-column: span 2;
            background-color: #f9f9f9;
            border-color: var(--hormann-blue);
            color: var(--hormann-blue);
        }

        .pdf-tool:hover {
            background-color: var(--hormann-blue);
            color: white;
        }

        /* --- SIDEBAR TOGGLE (Einklappen von Option A) --- */

        /* Der Toggle-Button selbst */
        .toggle-sidebar-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: transparent;
            border: 1px solid #ddd;
            color: #666;
            width: 30px;
            height: 30px;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            z-index: 10;
        }

        .toggle-sidebar-btn:hover {
            background-color: #eee;
            color: var(--hormann-blue);
            border-color: var(--hormann-blue);
        }

        /* ZUSTAND: EINGEKLAPPT (Desktop) */
        .app-container.sidebar-collapsed {
            /* Spalte 1 wird winzig (50px), Spalte 2 nimmt den ganzen Platz */
            grid-template-columns: 50px 1fr;
        }

        /* Was passiert mit der Karte, wenn eingeklappt? */
        .app-container.sidebar-collapsed #optionACard {
            padding: 20px 5px;
            /* Weniger Padding */
            background-color: #f8f9fa;
            /* Leicht grauer Hintergrund */
            overflow: hidden;
            /* Versteckt alles was übersteht */
        }

        /* Verstecke den Inhalt von Option A wenn eingeklappt */
        .app-container.sidebar-collapsed #optionACard .controls,
        .app-container.sidebar-collapsed #optionACard .card-title span,
        .app-container.sidebar-collapsed #optionACard .card-badge {
            display: none !important;
            opacity: 0;
        }

        /* Zentriere den Button wenn eingeklappt */
        .app-container.sidebar-collapsed #optionACard .card-title {
            border-bottom: none;
            justify-content: center;
            padding: 0;
            margin: 0;
            height: 100%;
        }

        .app-container.sidebar-collapsed .toggle-sidebar-btn {
            position: static;
            /* Button nicht mehr absolut, sondern mittig */
            width: 100%;
            height: 100%;
            border: none;
            background: transparent;
            font-size: 1.5rem;
        }

        /* Mobile Ansicht (unter 1150px): Hier klappen wir es einfach vertikal zu */
        @media (max-width: 1150px) {
            .app-container.sidebar-collapsed {
                grid-template-columns: 1fr;
                /* Bleibt 1 Spalte */
            }

            /* Nur der Inhalt verschwindet, Header bleibt als schmale Leiste */
            .app-container.sidebar-collapsed #optionACard .controls {
                display: none;
            }

            .app-container.sidebar-collapsed #optionACard {
                padding-bottom: 10px;
                /* Kompakt */
            }

            /* Titel bleibt auf Handy sichtbar, damit man weiß was es ist */
            .app-container.sidebar-collapsed #optionACard .card-title span,
            .app-container.sidebar-collapsed #optionACard .card-badge {
                display: inline-block !important;
                opacity: 1 !important;
            }
        }

        /* --- ADMIN DASHBOARD --- */
        .admin-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }

        .admin-table th {
            background: #eee;
            padding: 10px;
            text-align: left;
            border-bottom: 2px solid #ccc;
            position: sticky;
            top: 0;
        }

        .admin-table td {
            padding: 8px;
            border-bottom: 1px solid #eee;
            vertical-align: top;
        }

        .admin-table tr:hover {
            background: #f9f9f9;
        }

        .admin-actions {
            display: flex;
            gap: 5px;
        }

        .btn-edit {
            background: var(--hormann-blue);
            color: white;
            border: none;
            padding: 4px 8px;
            border-radius: 3px;
            cursor: pointer;
        }

        .btn-delete {
            background: var(--error-red);
            color: white;
            border: none;
            padding: 4px 8px;
            border-radius: 3px;
            cursor: pointer;
        }

        .admin-form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .full-width {
            grid-column: span 2;
        }

        .admin-input-label {
            font-size: 0.8rem;
            font-weight: bold;
            display: block;
            margin-bottom: 3px;
            color: #555;
        }

        .admin-input {
            width: 100%;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-family: inherit;
        }

        .admin-input:focus {
            border-color: var(--hormann-blue);
            outline: none;
        }

        .btn-add-new {
            background: var(--friendly-green);
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 4px;
            font-weight: bold;
            cursor: pointer;
            margin-bottom: 15px;
        }

        .btn-add-new:hover {
            background: var(--friendly-green-hover);
        }

        /* ONBOARDING STYLES (Ergänzt) */
        /* ONBOARDING STYLES (Optimiert) */
        .tour-highlight {
            position: relative !important;
            z-index: 9998 !important;
            background-color: white !important;
            box-shadow: 0 0 0 5px var(--hormann-blue), 0 0 100vh rgba(0, 0, 0, 0.6) !important;
            /* 100vh dunkelt alles ab */
            border-radius: 4px;
            pointer-events: none;
            transition: box-shadow 0.3s ease;
        }

        .tour-arrow {
            position: absolute;
            width: 0;
            height: 0;
            border-style: solid;
        }

        /* Pfeil sitzt OBEN auf der Box und zeigt nach OBEN */
        .arrow-top {
            top: -8px;
            border-width: 0 8px 8px 8px;
            border-color: transparent transparent white transparent;
        }

        /* Pfeil sitzt UNTEN auf der Box und zeigt nach UNTEN */
        .arrow-bottom {
            bottom: -8px;
            border-width: 8px 8px 0 8px;
            border-color: white transparent transparent transparent;
        }

        /* Pfeil sitzt LINKS an der Box und zeigt nach LINKS */
        .arrow-left {
            left: -8px;
            top: 20px;
            /* Höhe des Pfeils an der Box */
            border-width: 8px 8px 8px 0;
            /* Dreieck nach links */
            border-color: transparent white transparent transparent;
        }

        /* Pfeil sitzt RECHTS an der Box und zeigt nach RECHTS */
        .arrow-right {
            right: -8px;
            top: 20px;
            border-width: 8px 0 8px 8px;
            /* Dreieck nach rechts */
            border-color: transparent transparent transparent white;
        }

        /* FIX für die Suchleiste beim Highlight (verhindert das Verschieben) */
        #tourSearchBox.tour-highlight {
            position: absolute !important;
        }

        /* FIX für das User-Profil beim Highlight */
        #userProfile.tour-highlight {
            position: absolute !important;
            /* Zwingt es, oben rechts zu bleiben */
            top: 20px;
            right: 30px;
            background: transparent !important;
            /* Kein weißer Kasten um die Icons */
            box-shadow: none !important;
            /* Kein eckiger Schatten um die ganze Gruppe */
        }

        /* Wir highlighten stattdessen die runden Buttons direkt, falls nötig, 
           oder wir lassen den Schatten weg und nutzen nur den Dunkel-Effekt.
           
           BESSER: Damit der "Spotlight"-Effekt schön ist, geben wir dem Container
           einen runden Schatten, statt dem eckigen Standard.
        */
        #userProfile.tour-highlight {
            position: absolute !important;
            z-index: 9998 !important;
            background-color: rgba(255, 255, 255, 0.8) !important;
            /* Leicht transparent weiß */
            border-radius: 50px !important;
            /* Runde Form für die Icons */
            padding: 5px 15px !important;
            /* Etwas Luft */
            right: 15px !important;
            /* Kleine Korrektur damit es nicht am Rand klebt */
            box-shadow: 0 0 0 5px var(--hormann-blue), 0 0 100vh rgba(0, 0, 0, 0.6) !important;
        }

        /* CHANGELOG STYLES */

        /* Der Wackel-Effekt für den Badge */
        @keyframes wobble-attention {
            0% {
                transform: rotate(0deg) scale(1);
            }

            15% {
                transform: rotate(-5deg) scale(1.1);
            }

            30% {
                transform: rotate(3deg) scale(1.1);
            }

            45% {
                transform: rotate(-3deg) scale(1.1);
            }

            60% {
                transform: rotate(2deg) scale(1.1);
            }

            75% {
                transform: rotate(-1deg) scale(1.1);
            }

            100% {
                transform: rotate(0deg) scale(1);
            }
        }

        .badge-pulse {
            animation: wobble-attention 1s ease-in-out infinite;
            border: 2px solid var(--hormann-blue);
            /* Hervorhebung */
        }

        /* Tags im Modal */
        .cl-tag {
            font-size: 0.7rem;
            font-weight: bold;
            text-transform: uppercase;
            padding: 2px 6px;
            border-radius: 4px;
            display: inline-block;
            width: 85px;
            text-align: center;
            margin-right: 10px;
            flex-shrink: 0;
        }

        .cl-new {
            background-color: #e8f5e9;
            color: #2ecc71;
            border: 1px solid #2ecc71;
        }

        /* Grün */
        .cl-imp {
            background-color: #eaf2f8;
            color: #3498db;
            border: 1px solid #3498db;
        }

        /* Blau */
        .cl-fix {
            background-color: #fff5e6;
            color: #e67e22;
            border: 1px solid #e67e22;
        }

        /* Orange */

        /* Version Block im Modal */
        .cl-version-block {
            margin-bottom: 25px;
        }

        .cl-header {
            background: #f9f9f9;
            padding: 8px 12px;
            border-radius: 4px;
            font-weight: bold;
            color: #333;
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
        }

        .cl-date {
            font-weight: normal;
            color: #888;
            font-size: 0.85rem;
        }

        .cl-item {
            display: flex;
            align-items: flex-start;
            margin-bottom: 6px;
            font-size: 0.9rem;
            line-height: 1.5;
        }

        /* Admin Line im Editor */
        .cl-edit-row {
            display: flex;
            gap: 5px;
            margin-bottom: 5px;
            align-items: center;
        }

        /* --- OPTION B: EINKLAPP-ANIMATION --- */
        #visualCollapsible {
            max-height: 2000px;
            opacity: 1;
            transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease-in-out;
            overflow: visible;
            /* Erlaubt das Überlappen des PDF-Menüs! */
        }

        #visualCollapsible.visual-collapsed {
            max-height: 0;
            opacity: 0;
            pointer-events: none;
            overflow: hidden;
            /* Versteckt Inhalte nur noch beim sauberen Einklappen */
        }

        .visual-inner-wrap {
            padding-bottom: 10px;
        }

        /* Hover-Effekt für den Header, wenn er klickbar wird */
        #optionBHeader.clickable-header:hover {
            background-color: #f9f9f9;
        }

        /* --- OPTION B: HEADER HIGHLIGHT WENN EINGEKLAPPT --- */

        /* Die Animation lenkt das Auge kurz auf den Balken */
        /* --- OPTION B: HEADER HIGHLIGHT WENN EINGEKLAPPT --- */
        @keyframes header-pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(0, 85, 150, 0.3);
            }

            70% {
                box-shadow: 0 0 0 8px rgba(0, 85, 150, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(0, 85, 150, 0);
            }
        }

        .header-collapsed-mode {
            background-color: #eaf4fb !important;
            border: 1px dashed var(--hormann-blue) !important;
            animation: header-pulse 2s 2;
        }

        .visual-hint-text {
            font-size: 0.85rem;
            font-weight: bold;
            white-space: nowrap;
            /* Übergang für weichen Textwechsel */
            transition: color 0.3s ease;
        }

        /* Text einblenden, wenn eingeklappt */
        .header-collapsed-mode .visual-hint-text {
            opacity: 1;
            transform: translateX(0);
            display: inline-block;
        }

        /* --- TOGGLE SCHALTER (Für "Zusätzliche Eigenschaften") --- */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 42px;
            height: 22px;
            flex-shrink: 0;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .3s;
            border-radius: 22px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .3s;
            border-radius: 50%;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        .toggle-switch input:checked+.toggle-slider {
            background-color: var(--friendly-green);
        }

        .toggle-switch input:checked+.toggle-slider:before {
            transform: translateX(20px);
        }

        /* --- FIX: Option B komplett auf Reinweiß zwingen --- */
        .visual-container-flex,
        .visual-sidebar-left,
        .visual-wrapper,
        .visual-sidebar {
            background-color: #ffffff !important;
        }

        /* Entfernt die graue Kasten-Optik von den Schaltern in Option B */
        .visual-sidebar-left .checkbox-group,
        .visual-sidebar-left .checkbox-item {
            background-color: transparent !important;
            border: none !important;
            box-shadow: none !important;
        }

        .instant-hide {
            visibility: hidden !important;
            opacity: 0 !important;
            transition: none !important;
            pointer-events: none !important;
        }

        .instant-hide * {
            transition: none !important;
        }

/* Neuer, stabiler Header-Aufbau */
.header-layout {
    display: flex;
    justify-content: center; /* Zentriert die Baureihen-Tabs */
    align-items: center;
    position: relative;
    padding: 10px 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 25px;
    min-height: 60px;
}

/* Die Suche wird hier nicht mehr "absolut" irgendwohin geschoben */
.search-container {
    position: absolute;
    right: 0;
    width: 300px;
}

        .search-input-group {
            display: flex;
            align-items: center;
            border: 1px solid #ccc;
            border-radius: 4px;
            background: #fff;
            overflow: hidden;
            height: 34px;
        }

        .search-input-group:focus-within {
            border-color: var(--hormann-blue);
            box-shadow: 0 0 0 2px rgba(0, 85, 150, 0.1);
        }

        .search-input-group select {
            border: none;
            background: #f5f5f5;
            padding: 0 8px;
            height: 100%;
            font-size: 0.85rem;
            color: #444;
            border-right: 1px solid #ccc;
            outline: none;
            cursor: pointer;
            font-weight: bold;
        }

        .search-input-group select:hover {
            background: #ebebeb;
        }

        .search-input-group input {
            flex: 1;
            border: none;
            padding: 0 10px;
            font-size: 0.9rem;
            height: 100%;
            outline: none;
            background: transparent;
            min-width: 0;
            /* Verhindert, dass das Input-Feld den Container sprengt */
        }

        .search-dropdown {
            display: none;
            position: absolute;
            top: 100%;
            right: 0;
            background: #fff;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            width: 100%;
            /* Passt sich exakt der Breite des Suchfeldes an */
            max-height: 300px;
            overflow-y: auto;
            z-index: 1000;
            margin-top: 4px;
        }

        .search-result-item {
            padding: 10px;
            border-bottom: 1px solid #eee;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.85rem;
        }

        .search-result-item:hover {
            background: #f5f5f5;
        }

        .search-result-item:last-child {
            border-bottom: none;
        }

        .search-result-name {
            font-weight: bold;
            color: #333;
        }

        .search-result-nr {
            color: #888;
        }

        /* --- SUCHFELD CLEAR BUTTON (X) --- */
        .search-clear-btn {
            cursor: pointer;
            color: #aaa;
            font-size: 1.2rem;
            font-weight: bold;
            padding: 0 8px;
            display: none;
            user-select: none;
            transition: color 0.2s;
        }

        .search-clear-btn:hover {
            color: var(--error-red);
        }

        /* --- Popup (Modal) Artikelsuche (BREIT & HORIZONTAL) --- */
        .search-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            padding: 20px;
            box-sizing: border-box;
            backdrop-filter: blur(3px);
        }

        .search-modal-content {
            background: #fff;
            padding: 25px;
            border-radius: 10px;
            max-width: 850px;
            width: 100%;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            position: relative;
        }

        .search-modal-close {
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
            color: #666;
            background: #f0f0f0;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .search-modal-close:hover {
            background: #e0e0e0;
            color: #333;
        }

        .search-modal-back {
            background: #eaf4fb;
            color: var(--hormann-blue);
            border: none;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: bold;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            transition: all 0.2s;
        }

        .search-modal-back:hover {
            background: var(--hormann-blue);
            color: white;
            transform: translateX(-2px);
        }

        /* Das 2-Spalten-Layout */
        .search-modal-body-grid {
            display: grid;
            grid-template-columns: 300px minmax(0, 1fr);
            gap: 30px;
            align-items: start;
            overflow-y: auto;
            padding: 5px 10px 5px 5px;
            /* FIX: Padding gibt den Box-Shadows und dem Hover-Effekt ringsherum Luft! */
            flex: 1;
        }

        /* Falls der Bildschirm sehr schmal wird, Suche unter die Tabs schieben */
@media (max-width: 900px) {
    .header-layout { flex-direction: column; }
    .search-container { position: static; margin-top: 10px; width: 100%; max-width: 400px; }
}

        /* WICHTIG: Die Begrenzung für das Bild */
        .search-modal-img-container {
            background: #fff;
            border: 2px solid #eee;
            border-radius: 8px;
            padding: 10px;
            height: 220px;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            box-sizing: border-box;
        }

        .search-modal-thumbnail {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 4px;
            position: static;
        }

        .search-modal-compat-box {
            background: #f9f9f9;
            padding: 12px;
            border-radius: 6px;
            margin-top: 15px;
            font-size: 0.9rem;
            color: #444;
            border-left: 4px solid var(--hormann-blue);
        }

        /* --- STYLE FÜR ZUGEHÖRIGE BAUTEILE (MODAL) --- */
        .related-part-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 10px;
            background: #f9f9f9;
            border: 1px solid #e0e0e0;
            border-radius: 4px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .related-part-item:hover {
            background: #eaf4fb;
            border-color: var(--hormann-blue);
            transform: translateX(2px);
        }

        .related-part-name {
            font-weight: bold;
            color: var(--hormann-blue);
        }

        .related-part-badge {
            font-size: 0.65rem;
            padding: 2px 5px;
            border-radius: 3px;
            font-weight: bold;
        }

        /* --- INLINE EDITIERUNG ADMIN --- */
        .inline-input {
            width: 100%;
            padding: 4px 6px;
            border: 1px solid #ccc;
            border-radius: 3px;
            font-size: 0.8rem;
            font-family: monospace;
            box-sizing: border-box;
            background: #fff;
        }

        .inline-input:focus {
            border-color: var(--hormann-blue);
            box-shadow: 0 0 0 2px rgba(0, 85, 150, 0.1);
            outline: none;
        }

        .inline-edit-row {
            background-color: #eaf4fb !important;
        }

        .inline-edit-row td {
            padding: 4px !important;
        }

        /* --- ADMIN TABELLE BILD HOVER --- */
        .admin-thumbnail {
            /* Grundzustand: Klein in der Tabelle */
            width: 25px;
            height: 25px;
            object-fit: contain;
            background: #fff;
            /* Heller Hintergrund für transparente PNGs */
            border: 1px solid #eee;
            border-radius: 3px;

            /* Wichtig für den Effekt */
            position: relative;
            z-index: 1;
            transition: all 0.2s ease-in-out;
            /* Weicher Übergang */
            cursor: zoom-in;
            /* Zeigt Lupe an */
            /* Startpunkt der Vergrößerung oben links, damit die Maus nicht verdeckt wird */
            transform-origin: top left;
        }

        .admin-thumbnail-wrapper {
            display: inline-block;
            width: 25px;
            height: 25px;
            position: relative;
        }

        .admin-thumbnail {
            width: 25px;
            height: 25px;
            object-fit: contain;
            background: #fff;
            border: 1px solid #eee;
            border-radius: 3px;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 1;
            transition: all 0.2s ease-in-out;
            cursor: zoom-in;
            /* FIX 1: Bild skaliert jetzt vom linken Rand aus nach rechts, 
               damit es nicht mehr links abgeschnitten wird! */
            transform-origin: left center;
        }

        .admin-thumbnail-wrapper:hover .admin-thumbnail {
            /* Leicht nach rechts verschoben, damit es nicht am Bildschirmrand klebt */
            transform: scale(7) translateX(2px);
            z-index: 9999;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            border-color: var(--hormann-blue);
        }

        /* --- ADMIN TAGS (NEU) --- */
        .admin-tags-container {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            font-size: 0.75rem;
            background: #fff;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            margin-top: 5px;
        }

        .admin-tag-group {
            display: flex;
            flex-direction: column;
            gap: 4px;
            border-right: 1px solid #eee;
            padding-right: 10px;
        }

        .admin-tag-group:last-child {
            border-right: none;
        }

        .admin-tag-label {
            font-weight: bold;
            color: var(--hormann-blue);
            margin-bottom: 2px;
            text-transform: uppercase;
            font-size: 0.7rem;
        }

        .admin-tag-cb {
            display: flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            color: #444;
            margin: 0;
        }

        .admin-tag-cb input {
            margin: 0;
            cursor: pointer;
        }

        /* --- SORTIER-ICONS & TABELLENKOPF --- */
        /* FIX 2: Verhindert, dass der Pfeil beim Preis in die nächste Zeile rutscht */
        .admin-table th {
            white-space: nowrap;
        }

        .sort-icon {
            /* FIX 3: Größer und dunkler, damit man die inaktiven Pfeile besser sieht */
            font-size: 0.85rem;
            margin-left: 5px;
            color: #888;
            font-weight: bold;
        }

        .sort-active {
            color: var(--hormann-blue);
            font-weight: bold;
        }

        /* --- UNTERMENÜ (SUB-NAV FÜR BAUREIHEN) --- */
        .sub-nav-container {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: -10px;
            /* Zieht das Menü näher an den Haupt-Strich */
            margin-bottom: 25px;
            flex-wrap: wrap;
        }

        .sub-nav-btn {
            background: #f0f2f5;
            border: 1px solid transparent;
            padding: 6px 16px;
            font-size: 0.85rem;
            color: #555;
            cursor: pointer;
            border-radius: 20px;
            /* Schicke Pillen-Form */
            transition: all 0.2s ease;
            font-weight: 600;
        }

        .sub-nav-btn:hover:not(.disabled-nav) {
            background: #eaf4fb;
            color: var(--hormann-blue);
            border-color: var(--hormann-blue);
        }

        .sub-nav-btn.active {
            background: var(--hormann-blue);
            color: white;
            box-shadow: 0 2px 5px rgba(0, 85, 150, 0.3);
        }

        .sub-nav-btn.disabled-nav {
            opacity: 0.5;
            cursor: not-allowed;
            background: transparent;
            border: 1px dashed #ccc;
            color: #888;
        }

        /* --- ERSATZLAMELLEN GRAFIK-BOXEN --- */
        .lamella-box {
            position: absolute;
            left: 12%;
            /* Passt auf die Zeichnung */
            width: 76%;
            height: 18%;
            /* Höhe einer Sektion */
            background: rgba(0, 85, 150, 0.05);
            border: 2px dashed rgba(0, 85, 150, 0.4);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            font-weight: bold;
            color: var(--hormann-blue);
            cursor: pointer;
            transition: all 0.2s ease;
            z-index: 10;
        }

        .lamella-box:hover {
            background: rgba(0, 85, 150, 0.15);
            border-style: solid;
            transform: scale(1.02);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            z-index: 11;
        }

        .lamella-box.active {
            background: rgba(39, 174, 96, 0.2) !important;
            border: 2px solid var(--friendly-green) !important;
            color: var(--friendly-green-hover) !important;
            transform: scale(1.02);
            box-shadow: 0 4px 10px rgba(39, 174, 96, 0.2);
            z-index: 12;
        }

        /* Weißer Kasten um den Text der Lamellen-Auswahl */
        .lamella-box span {
            background-color: rgba(255, 255, 255, 0.9);
            /* 90% Weiß, lässt minimal was durchschimmern */
            padding: 4px 12px;
            border-radius: 4px;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
            /* Leichter Schatten hebt es von der Zeichnung ab */
            transition: all 0.2s ease;
        }

        /* Beim Hovern machen wir den Kasten reinweiß */
        .lamella-box:hover span,
        .lamella-box.active span {
            background-color: #ffffff;
        }

        /* --- ADMIN TABS --- */
        .admin-tab-btn {
            background: #f0f2f5;
            border: 1px solid #ddd;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            color: #555;
            transition: all 0.2s;
            font-size: 0.9rem;
        }

        .admin-tab-btn.active {
            background: var(--hormann-blue);
            color: #fff;
            border-color: var(--hormann-blue);
        }

        .admin-tab-btn:hover:not(.active) {
            background: #eaf4fb;
            color: var(--hormann-blue);
            border-color: #c2e0f4;
        }

        .btn-locate {
            background: white;
            border-radius: 6px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 15px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .btn-locate:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        }

        /* --- Klickbare Bauteil-Namen in der Tabelle --- */
        .clickable-part-name {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            transition: color 0.2s ease;
        }

        .clickable-part-name strong {
            transition: color 0.2s ease;
        }

        .clickable-part-name .info-icon {
            background: #f0f2f5;
            color: var(--hormann-blue);
            border-radius: 50%;
            width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: bold;
            transition: all 0.2s ease;
        }

        .clickable-part-name:hover strong {
            color: var(--hormann-blue);
        }

        .clickable-part-name:hover .info-icon {
            background: var(--hormann-blue);
            color: white;
            box-shadow: 0 2px 5px rgba(0, 85, 150, 0.3);
        }

        /* Erlaubt den Klick auch, wenn die Zeile abgewählt (ausgegraut) ist */
        .row-disabled .clickable-part-name {
            pointer-events: auto;
        }

        /* Versteckt die Standard-Pfeile des Browsers in Zahlen-Eingabefeldern */
        input[type="number"]::-webkit-outer-spin-button,
        input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type="number"] {
            -moz-appearance: textfield;
        }

        /* Fix für unsichtbare Schrift im Tour-Modus */
        #btnSubAufmass.active {
            background-color: #0284c7 !important;
            /* Erzwingt den blauen Hintergrund (Passe den HEX-Code ggfs. an dein Blau an) */
            color: #ffffff !important;
            /* Erzwingt die weiße Schrift */
        }

        /* Fix für Tour-Highlight Layoutverschiebungen und Farben */
        #sceneProposalMenu.tour-highlight {
            position: absolute !important;
            right: 20px !important;
            left: auto !important;
            bottom: 20px !important;
            top: auto !important;
            margin: 0 !important;
        }

        /* 1. Das Menü selbst anpassen und zum Leuchten bringen */
        #settingsOptions.tour-highlight {
            background-color: #ffffff !important;
            z-index: 99999 !important;
            border-radius: 4px;
            box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 20px rgba(56, 189, 248, 0.8) !important;
            /* Erzeugt das Leuchten/Glow */
        }

        #settingsOptions.tour-highlight,
        #settingsOptions.tour-highlight label,
        #settingsOptions.tour-highlight span {
            color: #0f172a !important;
        }

        /* 2. DEN ELTERN-CONTAINER ANHEBEN (Das ist der Schlüssel gegen die Abdunkelung!) */
        div:has(> #settingsOptions.tour-highlight),
        .view-controls:has(#settingsOptions.tour-highlight) {
            z-index: 99999 !important;
        }

        #settingsOptions.tour-highlight,
        #settingsOptions.tour-highlight label,
        #settingsOptions.tour-highlight span {
            color: #0f172a !important;
        }

        #settingsOptions.tour-highlight {
            background-color: #ffffff !important;
        }

        #settingsOptions.tour-highlight {
            background-color: #ffffff !important;
            z-index: 10000 !important;
            position: relative !important;
            border-radius: 4px;
        }

        /* Dezenter Puls-Effekt für den Aufmaß-Pilot Button */
        .pulse-highlight {
            animation: gentle-pulse 2s infinite;
            box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
            border-radius: 4px;
        }

        @keyframes gentle-pulse {
            0% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
            }

            70% {
                transform: scale(1.03);
                box-shadow: 0 0 0 10px rgba(2, 132, 199, 0);
            }

            100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(2, 132, 199, 0);
            }
        }

        /* Stellt sicher, dass der Tool-Tab nicht zu groß wird */
.tool-tab-special {
    flex-shrink: 0;
}

/* Optional: Damit er sich beim Hovern noch besser absetzt */
.tool-tab-special:hover {
    background: rgba(142, 68, 173, 0.05);
    border-bottom-color: #8e44ad !important;
}

.tool-tab-special.active {
    color: #8e44ad !important;
    border-bottom-color: #8e44ad !important;
}

/* Erstelle diese Klasse für den Tool-Container, damit er das gleiche Layout wie die Tore hat */
#toolsAppContainer {
    display: none; /* Standardmäßig aus */
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================
   NEU: WIDGET- & AVATAR-STYLES FÜR CARL
   ========================================== */

#carlWidgetContainer {
    position: absolute;
    top: 15px;
    left: 30px;
    z-index: 1000;
}

#carlAvatar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: white;
    padding: 6px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

#carlAvatar:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: #cbd5e1;
}

#carlAvatar:active {
    transform: translateY(1px) scale(0.98);
}

/* Der kleine Roboter-Kopf */
.carl-robot {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    animation: carlFloat 3.5s ease-in-out infinite;
}

/* Wenn Carl aktiv antwortet, dreht er sich */
.carl-robot.carl-active {
    animation: carlSpin 0.8s ease-in-out;
}

.carl-antenna {
    position: absolute;
    top: 0px;
    width: 2px;
    height: 6px;
    background: #475569;
}

.carl-antenna-ball {
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: #a855f7;
    border-radius: 50%;
    box-shadow: 0 0 8px #c084fc;
    animation: carlEyePulse 2s infinite alternate;
}

.carl-head {
    width: 32px;
    height: 28px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #475569;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.carl-ears {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    top: 8px;
    box-sizing: border-box;
    padding: 0 1px;
}

.carl-ear {
    width: 4px;
    height: 8px;
    background: #64748b;
    border: 1px solid #475569;
}

.carl-ear.left {
    border-radius: 2px 0 0 2px;
    margin-left: -4px;
}

.carl-ear.right {
    border-radius: 0 2px 2px 0;
    margin-right: -4px;
}

.carl-eyes {
    display: flex;
    gap: 5px;
    margin-bottom: 2px;
}

.carl-eye {
    width: 7px;
    height: 7px;
    background: #0ea5e9;
    border-radius: 50%;
    box-shadow: 0 0 6px #38bdf8;
    animation: carlEyePulse 1.5s infinite alternate;
}

.carl-mouth {
    width: 14px;
    height: 3px;
    background: #475569;
    border-radius: 1px;
    margin-top: 2px;
    transition: all 0.2s;
}

.carl-badge {
    display: flex;
    flex-direction: column;
}

.carl-badge-title {
    font-weight: 700;
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.1;
}

.carl-badge-sub {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ==========================================
   CARL CHAT-PANEL STYLES (GLASSMORPHISM)
   ========================================== */

.carl-chat-panel {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 380px;
    height: 520px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
    z-index: 10010;
    animation: carlFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.carl-chat-header {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.carl-mini-avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carl-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #34d399;
}

.carl-header-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}

.carl-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.carl-header-btn:active {
    transform: translateY(0) scale(0.95);
}

.carl-header-btn svg {
    transition: transform 0.2s ease;
}

.carl-header-btn:hover svg {
    transform: scale(1.1);
}

.carl-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #faf5ff;
}

.carl-chat-welcome {
    padding: 12px 18px;
    background: #f3e8ff;
    border-bottom: 1px solid #e9d5ff;
    font-size: 0.85rem;
    color: #5b21b6;
    line-height: 1.4;
}

.carl-chat-history {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Blasen-Styling */
.carl-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.carl-msg.carl {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.carl-msg.kunde {
    background: #2563eb;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.carl-msg.sascha {
    background: #1e293b;
    color: white;
    align-self: flex-start;
    border: 2px solid #fbbf24;
    border-bottom-left-radius: 2px;
    box-shadow: 0 4px 10px rgba(251, 191, 36, 0.25);
}

.carl-msg.system {
    background: #e2e8f0;
    color: #475569;
    align-self: center;
    max-width: 90%;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border-radius: 20px;
    padding: 4px 12px;
    box-shadow: none;
}

.carl-msg-author {
    font-weight: bold;
    display: block;
    font-size: 0.75rem;
    margin-bottom: 3px;
    opacity: 0.9;
}

.carl-msg.sascha .carl-msg-author {
    color: #fbbf24;
}

/* Quick Options */
.carl-quick-options {
    padding: 8px 15px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid #f3e8ff;
    background: #fff;
}

.carl-quick-btn {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    color: #6d28d9;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.carl-quick-btn:hover {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

/* Chat Footer & Eingabe */
.carl-chat-footer {
    padding: 10px 15px;
    background: white;
    border-top: 1px solid #f3e8ff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#carlChatInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

#carlChatInput:focus {
    border-color: #7c3aed;
}

#btnSendCarlMessage {
    background: #7c3aed;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#btnSendCarlMessage:hover {
    background: #6d28d9;
    transform: scale(1.05);
}

/* Eskalationsbereich */
.carl-escalate-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
    padding-top: 5px;
    border-top: 1px dashed #f1f5f9;
}

.carl-escalate-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-weight: 700;
    text-decoration: underline;
    font-size: 0.75rem;
    padding: 0;
}

.carl-escalate-btn:hover {
    color: #1d4ed8;
}

/* ==========================================
   CARL ANIMATIONEN & KEYFRAMES
   ========================================== */

@keyframes carlFloat {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0px); }
}

@keyframes carlSpin {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

@keyframes carlEyePulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.1); filter: brightness(1.2) drop-shadow(0 0 3px rgba(56, 189, 248, 0.8)); }
}

@keyframes carlFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   ADMIN LIVE-CHATS INTERFACE STYLES
   ========================================== */

.admin-chat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.admin-chat-card:hover {
    border-color: var(--hormann-blue);
    background: #f8fafc;
    transform: translateY(-1px);
}

.admin-chat-card.active {
    border-color: var(--hormann-blue);
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.admin-chat-status {
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    width: max-content;
}

.admin-chat-status.waiting {
    background: #fef3c7;
    color: #d97706;
}

.admin-chat-status.active {
    background: #dcfce7;
    color: #15803d;
}

/* ==========================================
   RESPONSIVE DESIGN FÜR CARL
   ========================================== */

@media (max-width: 900px) {
    #carlWidgetContainer {
        position: relative;
        top: 0;
        left: 0;
        margin: 10px auto;
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    #carlAvatar {
        width: max-content;
    }
    
    .carl-chat-panel {
        position: fixed;
        top: 80px;
        left: 5%;
        width: 90%;
        height: 70vh;
        max-height: 520px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    }
}

/* --- ADMIN ACTIVITY BADGES & CLIENT UNREAD ASSISTANT BADGES --- */
.admin-badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ef4444; /* bright red */
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: adminPulse 1.5s infinite;
}

@keyframes adminPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.carl-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid white;
    z-index: 10;
}

/* --- TEXT-KONVERTER SPLIT-LAYOUT --- */
.tool-split-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 25px;
    align-items: stretch;
    margin-top: 15px;
}

@media (max-width: 900px) {
    .tool-split-grid {
        grid-template-columns: 1fr;
    }
}

.tool-column-left, .tool-column-right {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-column-right .checklist-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
    transition: all 0.3s ease;
}

.tool-column-right .checklist-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
}

.tool-checklist-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-checklist-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #334155;
    overflow-y: auto;
    max-height: 480px;
    flex-grow: 1;
    padding-right: 8px;
}

/* Custom scrollbar for checklist */
.tool-checklist-content::-webkit-scrollbar {
    width: 6px;
}
.tool-checklist-content::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 3px;
}
.tool-checklist-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.tool-checklist-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Checkbox and item styling */
.checklist-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
}
.checklist-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.checklist-checkbox {
    margin-top: 4px;
    margin-right: 12px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--hormann-blue);
    flex-shrink: 0;
}
.checklist-text {
    flex-grow: 1;
    color: #334155;
    font-weight: 500;
    transition: all 0.2s ease;
}
.checklist-checkbox:checked + .checklist-text {
    text-decoration: line-through;
    color: #94a3b8;
}

.checklist-header-line {
    margin: 18px 0 10px 0;
    font-weight: 700;
    color: var(--hormann-blue);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.checklist-header-line:first-child {
    margin-top: 0;
}

/* ==========================================
   PREMIUM NEWSLETTER & MARKETING HUB STYLES
   ========================================== */

/* Tabs Navigation */
.nl-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    padding-bottom: 2px;
}

.nl-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: #64748b;
    transition: all 0.2s ease;
    border-radius: 6px 6px 0 0;
}

.nl-tab-btn:hover {
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: adminPulse 1.5s infinite;
}

@keyframes adminPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.carl-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid white;
    z-index: 10;
}

/* --- TEXT-KONVERTER SPLIT-LAYOUT --- */
.tool-split-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 25px;
    align-items: stretch;
    margin-top: 15px;
}

@media (max-width: 900px) {
    .tool-split-grid {
        grid-template-columns: 1fr;
    }
}

.tool-column-left, .tool-column-right {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-column-right .checklist-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
    transition: all 0.3s ease;
}

.tool-column-right .checklist-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
}

.tool-checklist-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-checklist-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #334155;
    overflow-y: auto;
    max-height: 480px;
    flex-grow: 1;
    padding-right: 8px;
}

/* Custom scrollbar for checklist */
.tool-checklist-content::-webkit-scrollbar {
    width: 6px;
}
.tool-checklist-content::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 3px;
}
.tool-checklist-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.tool-checklist-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Checkbox and item styling */
.checklist-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
}
.checklist-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.checklist-checkbox {
    margin-top: 4px;
    margin-right: 12px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--hormann-blue);
    flex-shrink: 0;
}
.checklist-text {
    flex-grow: 1;
    color: #334155;
    font-weight: 500;
    transition: all 0.2s ease;
}
.checklist-checkbox:checked + .checklist-text {
    text-decoration: line-through;
    color: #94a3b8;
}

.checklist-header-line {
    margin: 18px 0 10px 0;
    font-weight: 700;
    color: var(--hormann-blue);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.checklist-header-line:first-child {
    margin-top: 0;
}

/* ==========================================
   PREMIUM NEWSLETTER & MARKETING HUB STYLES
   ========================================== */

/* Tabs Navigation */
.nl-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    padding-bottom: 2px;
}

.nl-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: #64748b;
    transition: all 0.2s ease;
    border-radius: 6px 6px 0 0;
}

.nl-tab-btn:hover {
    color: var(--hormann-blue);
    background: #f1f5f9;
}

.nl-tab-btn.active {
    color: var(--hormann-blue);
    border-bottom-color: var(--hormann-blue);
    background: #eff6ff;
}

/* 2-Spalten Layout */
.nl-split-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    min-height: 500px;
}

@media (max-width: 992px) {
    .nl-split-grid {
        grid-template-columns: 1fr;
    }
}

.nl-editor-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.nl-preview-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Editor Toolbar */
.nl-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px 6px 0 0;
    margin-bottom: -13px;
    z-index: 5;
}

.nl-tool-btn {
    padding: 6px 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.nl-tool-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Live Mail Preview Pane */
.nl-preview-container {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nl-preview-header {
    background: #f1f5f9;
    padding: 10px 14px;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nl-preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.nl-preview-dot.red { background: #ef4444; }
.nl-preview-dot.yellow { background: #f59e0b; }
.nl-preview-dot.green { background: #10b981; }

.nl-preview-addressbar {
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: #64748b;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nl-preview-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
    background: #f1f5f9;
    min-height: 250px;
    max-height: 480px;
}

/* Tabellen Layout für Archiv & Entwürfe */
.nl-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.nl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.nl-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
}

.nl-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.nl-table tr:hover {
    background: #f8fafc;
}

/* Badges & Buttons */
.nl-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nl-badge.draft {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.nl-badge.sent {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Uploader Spinner */
.nl-upload-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: nlSpin 0.8s ease-in-out infinite;
}

@keyframes nlSpin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   BILDER-MEDIATHEK GALERIE STYLES
   ========================================== */
.nl-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 2px;
}

.nl-gallery-card {
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 90px;
}

.nl-gallery-card:hover {
    border-color: var(--hormann-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 53, 150, 0.08);
}

.nl-gallery-img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    background: #ffffff;
    transition: opacity 0.15s;
}

.nl-gallery-img:hover {
    opacity: 0.85;
}

.nl-gallery-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 5px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    font-size: 0.7rem;
    color: #64748b;
    height: 30px;
}

.nl-gallery-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    margin-right: 4px;
}

.nl-gallery-delete-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.75rem;
    transition: background 0.15s, color 0.15s;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nl-gallery-delete-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* ==========================================
   SLEEK PROFESSIONAL NEWSLETTER BUTTONS
   ========================================== */
.nl-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 550;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-transform: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nl-btn-secondary {
    background: #64748b;
}
.nl-btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.nl-btn-dark {
    background: #475569;
}
.nl-btn-dark:hover {
    background: #334155;
    transform: translateY(-1px);
}

.nl-btn-accent {
    background: #d97706;
}
.nl-btn-accent:hover {
    background: #b45309;
    transform: translateY(-1px);
}

.nl-btn-primary {
    background: var(--friendly-green);
}
.nl-btn-primary:hover {
    background: #16a34a; /* emerald-600 */
    transform: translateY(-1px);
}

/* Modal Viewport Centering clipping fix */
#adminNewsletterModal {
    align-items: flex-start !important;
    justify-content: center !important;
}

#adminNewsletterModal .modal-content {
    margin: 20px auto !important;
}
