/* css/styles.css */ 

/* ========================================
   LANDING PAGE STYLES
   ======================================== */

/* Landing Page Container */
.landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Loading Animation */
.loading-container {
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.dashboard-icon-animated {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.icon-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    animation: barPulse 1.5s ease-in-out infinite;
}

.icon-bar.bar-1 { animation-delay: 0s; height: 100%; }
.icon-bar.bar-2 { animation-delay: 0.2s; height: 100%; }
.icon-bar.bar-3 { animation-delay: 0.4s; height: 100%; }
.icon-bar.bar-4 { animation-delay: 0.6s; height: 100%; }

.loading-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-top: 8px;
}

@keyframes barPulse {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Welcome Chat */
.welcome-chat {
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
}

.welcome-chat-body {
    padding: 36px 28px;
    max-height: 70vh;
    overflow-y: auto;
}

.welcome-message {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 40px;
}

.welcome-message .chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.welcome-message .chat-bubble {
    background: #f1f5f9;
    padding: 18px 22px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    flex: 1;
}

.welcome-message .chat-bubble p {
    margin: 0 0 14px 0;
    line-height: 1.65;
    color: #1e293b;
    font-size: 15px;
}

.welcome-message .chat-bubble p:last-child {
    margin-bottom: 0;
}

/* ========================================
   MODERN LAYOUT - Main Content + Sidebar
   ======================================== */

.landing-main-content {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

/* Action Buttons - Now taking more space */
.welcome-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Sidebar Actions - Small boxes on the right */
.sidebar-actions {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.action-button:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.action-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.action-button.primary:hover {
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* Modern SVG Icons for Action Buttons */
.action-icon-svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: inherit;
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: inherit;
}

.action-button.primary .action-title {
    color: white;
}

.action-description {
    font-size: 13px;
    color: #64748b;
}

.action-button.primary .action-description {
    color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   SIDEBAR BOXES - Small Modern Cards
   ======================================== */

.sidebar-box {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sidebar-box:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.sidebar-icon {
    width: 32px;
    height: 32px;
    color: #667eea;
    margin-bottom: 4px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.sidebar-description {
    font-size: 11px;
    color: #64748b;
}

/* API Token Section */
.api-token-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    margin-top: 8px;
    margin-bottom: 24px;
}

.api-token-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.api-icon {
    font-size: 20px;
}

.api-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.api-token-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.api-token-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s;
}

.api-token-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.api-token-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.api-token-toggle:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.api-token-save {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.api-token-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.api-token-save:active {
    transform: translateY(0);
}

.api-token-status {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
}

.api-token-status.success {
    color: #10b981;
}

.api-token-status.error {
    color: #ef4444;
}

.api-token-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.api-token-hint a {
    color: #667eea;
    text-decoration: none;
}

.api-token-hint a:hover {
    text-decoration: underline;
}

/* Quick Upload */
.quick-upload {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    margin-top: 8px;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.upload-box:hover {
    border-color: #667eea;
    background: #f1f5f9;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.upload-text {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.upload-status {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.upload-status.success { color: #10b981; }
.upload-status.error { color: #ef4444; }

/* Back Button - neu positioniert */
.back-button {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #1e40af;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: fit-content; /* Sorgt für vertikale Zentrierung */
}

.back-button:hover {
    background: white;
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Landing Page Chat Section */
.landing-chat-section {
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
    padding-top: 32px;
}

.chat-divider {
    text-align: center;
    margin-bottom: 16px;
    position: relative; /* Fix für weißen Strich */
}

.chat-divider span {
    background: white;
    padding: 0 12px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.chat-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e2e8f0;
    z-index: -1;
}

.landing-chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.landing-chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.landing-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.landing-chat-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.landing-chat-message.user {
    flex-direction: row-reverse;
}

.landing-chat-message .chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.landing-chat-message.assistant .chat-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.landing-chat-message.user .chat-avatar {
    background: #e2e8f0;
}

.landing-chat-message .chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.landing-chat-message.assistant .chat-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.landing-chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.landing-chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.landing-chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typing 1.4s infinite;
}

.landing-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.landing-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

.landing-chat-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.landing-chat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.landing-chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.landing-chat-input::-webkit-scrollbar {
    width: 4px;
}

.landing-chat-input::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.landing-chat-send {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.landing-chat-send:hover {
    transform: scale(1.05);
}

.landing-chat-send:active {
    transform: scale(0.95);
}

.landing-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-chat {
        width: 95%;
        max-width: none;
    }

    .welcome-chat-body {
        padding: 24px 16px;
    }

    .action-button {
        padding: 14px 16px;
    }

    .action-icon {
        font-size: 28px;
    }

    .action-title {
        font-size: 15px;
    }

    .action-description {
        font-size: 12px;
    }
    
    .landing-chat-messages {
        max-height: 200px;
    }
}

/* ========================================
   END LANDING PAGE STYLES
   ======================================== */

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
} 

body {
    font-family: 'Aptos', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif; 
    background: #f1f5f9; 
    color: #1e293b; 
    min-height: 100vh; 
} 

/* Header Styles */ 
.header { 
    background: linear-gradient(to right, #2563eb, #1d4ed8); 
    position: sticky; 
    top: 0; 
    z-index: 50; 
    padding: 1.25rem; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    border-bottom: 1px solid rgba(30, 58, 138, 0.2); 
} 

.header-content { 
    max-width: 1920px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 1rem; 
} 

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
} 

.header h1 { 
    font-size: 1.875rem; 
    font-weight: bold; 
    color: white; 
}

.view-mode-toggle { 
    display: flex; 
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(4px); 
    padding: 0.25rem; 
    border-radius: 0.5rem; 
    gap: 0.25rem; 
} 

.view-mode-toggle button { 
    padding: 0.5rem 1rem; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    border-radius: 0.375rem; 
    transition: all 0.2s; 
    color: rgba(255, 255, 255, 0.8); 
    font-size: 0.875rem; 
    font-weight: 500; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
} 

.view-mode-toggle button:hover { 
    background: rgba(255, 255, 255, 0.1); 
    color: white; 
} 

.view-mode-toggle button.active { 
    background: white; 
    color: #2563eb; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
} 

.filters { 
    display: flex; 
    gap: 1.5rem; 
    align-items: center; 
    flex-wrap: wrap; 
} 

.filter-group { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(4px); 
    border-radius: 0.5rem; 
    padding: 0.5rem 0.75rem; 
} 

.filter-label { 
    font-size: 0.875rem; 
    font-weight: 600; 
    color: #475569; 
} 

select, .dropdown-button { 
    background: white; 
    border: 1px solid #e2e8f0; 
    border-radius: 0.375rem; 
    padding: 0.375rem 0.75rem; 
    font-size: 0.875rem; 
    cursor: pointer; 
    min-width: 120px; 
    transition: all 0.2s; 
} 

select:hover, .dropdown-button:hover { 
    border-color: #cbd5e1; 
} 

select:focus, .dropdown-button:focus { 
    outline: none; 
    border-color: #2563eb; 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); 
} 

.dropdown { 
    position: relative; 
} 

.dropdown-button { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    min-width: 200px; 
} 

.dropdown-menu { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background: white; 
    border: 1px solid #e2e8f0; 
    border-radius: 0.5rem; 
    margin-top: 0.25rem; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    z-index: 1000; 
    min-width: 14rem; 
    max-height: 300px; 
    overflow-y: auto; 
    display: none; 
} 

.dropdown-menu.show { 
    display: block; 
} 

.dropdown-item { 
    padding: 0.5rem 1rem; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    cursor: pointer; 
    transition: background 0.2s; 
} 

.dropdown-item:hover { 
    background: #f8fafc; 
} 

.dropdown-separator { 
    height: 1px; 
    background: #e2e8f0; 
    margin: 0.25rem 0; 
} 

.checkbox { 
    width: 1rem; 
    height: 1rem; 
    border: 2px solid #cbd5e1; 
    border-radius: 0.25rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s; 
} 

.checkbox.checked { 
    background: #2563eb; 
    border-color: #2563eb; 
} 

.checkbox.checked::after { 
    content: '✓'; 
    color: white; 
    font-size: 0.75rem; 
} 

/* ✨ v18: Main Layout mit align-items: stretch für gleiche Höhen */
.main {
    max-width: 1920px;
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: stretch; /* KPI-Grid und Map-Sidebar gleich hoch */
} 

.main.table-view { 
    padding: 1.25rem; 
} 

/* ✨ v18: KPI Grid mit gleichen Box-Größen */
.kpi-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    grid-auto-rows: 320px; /* Alle Zeilen gleich hoch */
    gap: 1.25rem;
    align-content: start; /* Grid startet oben */
}

/* ✨ v18: KPI Card mit fester Höhe - alle gleich groß */
.kpi-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    animation: fadeIn 0.3s ease-out;
    height: 100%; /* Nutzt volle Grid-Cell Höhe */
} 

@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    } 
    to { 
        opacity: 1; 
        transform: scale(1); 
    } 
} 

.kpi-card:hover { 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    transform: translateY(-2px); 
} 

.kpi-card::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    height: 0.25rem; 
    background: linear-gradient(to right, #3b82f6, #a855f7, #ec4899); 
    opacity: 0; 
    transition: opacity 0.3s; 
} 

.kpi-card:hover::before { 
    opacity: 1; 
} 

.kpi-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 0.5rem; 
} 

.kpi-title { 
    font-size: 1.125rem; 
    font-weight: bold; 
    color: #1e293b; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    flex: 1; 
} 

.zoom-button { 
    padding: 0.25rem 0.5rem; 
    background: #f1f5f9; 
    border: 1px solid #e2e8f0; 
    border-radius: 0.375rem; 
    cursor: pointer; 
    transition: all 0.2s; 
    font-size: 1rem; 
} 

.zoom-button:hover { 
    background: #e2e8f0; 
    transform: scale(1.1); 
} 

.fullscreen-modal { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(0, 0, 0, 0.8); 
    display: none; 
    align-items: center; 
    justify-content: center; 
    z-index: 2000; 
    animation: fadeIn 0.3s ease-out; 
} 

.fullscreen-modal.show { 
    display: flex; 
} 

.fullscreen-kpi { 
    background: white; 
    border-radius: 1rem; 
    padding: 2rem; 
    width: 95%; 
    height: 90%; 
    max-width: 1400px; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    animation: slideUp 0.3s ease-out; 
} 

@keyframes slideUp { 
    from { 
        transform: translateY(20px); 
        opacity: 0; 
    } 
    to { 
        transform: translateY(0); 
        opacity: 1; 
    } 
} 

.fullscreen-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1.5rem; 
} 

.fullscreen-title { 
    font-size: 2rem; 
    font-weight: bold; 
    color: #1e293b; 
} 

.fullscreen-close { 
    background: #ef4444; 
    color: white; 
    border: none; 
    border-radius: 0.5rem; 
    padding: 0.5rem 1rem; 
    font-size: 1rem; 
    cursor: pointer; 
    transition: background 0.2s; 
} 

.fullscreen-close:hover { 
    background: #dc2626; 
} 

.fullscreen-chart { 
    flex: 1; 
    position: relative; 
} 

.kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: #86BC25; /* Deloitte Grün */
}

.kpi-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
} 

.kpi-description { 
    font-size: 0.75rem; 
    color: #64748b; 
    margin-top: 0.125rem; 
} 

.kpi-badge { 
    background: #dcfce7; 
    color: #166534; 
    border: 1px solid #bbf7d0; 
    padding: 0.25rem 0.5rem; 
    border-radius: 0.375rem; 
    font-size: 0.75rem; 
    font-weight: 500; 
} 

.kpi-metrics { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 0.75rem; 
} 

.kpi-value { 
    font-size: 2.25rem; 
    font-weight: 800; 
    color: #2563eb; 
} 

.kpi-trend { 
    display: flex; 
    align-items: center; 
    gap: 0.25rem; 
    font-size: 0.875rem; 
    font-weight: 600; 
} 

.kpi-trend.positive { 
    color: #16a34a; 
} 

.kpi-trend.negative { 
    color: #dc2626; 
} 

.view-toggle { 
    display: flex; 
    background: #f3f4f6; 
    padding: 0.125rem; 
    border-radius: 0.375rem; 
} 

.view-toggle button { 
    padding: 0.25rem 0.5rem; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 0.25rem; 
    transition: all 0.2s; 
    color: #6b7280; 
    font-size: 1rem; 
} 

.view-toggle button.active { 
    background: white; 
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); 
    color: #2563eb; 
} 

/* ✨ v18: Chart Container mit max-height für gleiche Box-Größen */
.chart-container {
    flex-grow: 1;
    min-height: 150px;
    max-height: 200px; /* Verhindert zu große Charts */
    position: relative;
} 

.chart-container.clickable { 
    cursor: pointer; 
    position: relative; 
} 

.chart-container.clickable::after { 
    content: '🔍 Klick für Tagesansicht'; 
    position: absolute; 
    bottom: 10px; 
    right: 10px; 
    background: rgba(37, 99, 235, 0.9); 
    color: white; 
    padding: 0.25rem 0.5rem; 
    border-radius: 0.375rem; 
    font-size: 0.75rem; 
    font-weight: 500; 
    opacity: 0; 
    transition: opacity 0.3s; 
    pointer-events: none; 
    animation: pulse 2s infinite; 
} 

.chart-container.clickable:hover::after { 
    opacity: 1; 
} 

@keyframes pulse { 
    0% { 
        transform: scale(1); 
    } 
    50% { 
        transform: scale(1.05); 
    } 
    100% { 
        transform: scale(1); 
    } 
} 

.time-range-selector { 
    display: flex; 
    gap: 0.5rem; 
    margin-bottom: 0.75rem; 
    justify-content: center; 
    align-items: center; 
} 

.time-range-selector button { 
    padding: 0.25rem 0.75rem; 
    background: #f3f4f6; 
    border: 1px solid #e2e8f0; 
    border-radius: 0.375rem; 
    cursor: pointer; 
    font-size: 0.875rem; 
    transition: all 0.2s; 
} 

.time-range-selector button:hover { 
    background: #e2e8f0; 
} 

.time-range-selector button.active { 
    background: #2563eb; 
    color: white; 
    border-color: #2563eb; 
} 

.time-navigation { 
    display: flex; 
    gap: 0.5rem; 
    align-items: center; 
    margin: 0 0.5rem; 
} 

.time-navigation button { 
    padding: 0.25rem 0.5rem; 
    background: white; 
    border: 1px solid #e2e8f0; 
    border-radius: 0.375rem; 
    cursor: pointer; 
    font-size: 1rem; 
    transition: all 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
} 

.time-navigation button:hover { 
    background: #f1f5f9; 
    transform: scale(1.1); 
} 

.time-navigation button:disabled { 
    opacity: 0.3; 
    cursor: not-allowed; 
} 

.time-navigation button:disabled:hover { 
    transform: scale(1); 
    background: white; 
} 

.time-navigation .current-period { 
    font-weight: 600; 
    color: #1e293b; 
    min-width: 120px; 
    text-align: center; 
    font-size: 0.875rem; 
} 

/* ✨ v18: Map Sidebar - Höhe passt sich an KPI-Grid an */
.map-sidebar {
    width: 380px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    position: relative;
    z-index: 10;
    align-self: stretch; /* Nutzt volle verfügbare Höhe */
} 

@keyframes slideIn { 
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    } 
    to { 
        transform: translateX(0); 
        opacity: 1; 
    } 
} 

.map-container {
    flex: 1 1 auto;
    min-height: 400px;
    background: white;
    position: relative;
    transition: flex 0.3s ease;
} 

.map-info { 
    padding: 1rem; 
    border-top: 1px solid #e2e8f0; 
} 

.map-info h3 { 
    font-size: 0.875rem; 
    font-weight: 600; 
    color: #475569; 
    margin-bottom: 0.5rem; 
} 

.selected-states { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
    min-height: 1.5rem; 
} 

.state-tag { 
    padding: 0.25rem 0.5rem; 
    border-radius: 9999px; 
    background: #dcfce7; 
    border: 1px solid #86efac; 
    font-size: 0.75rem; 
    color: #166534; 
    cursor: pointer; 
    transition: all 0.2s; 
} 

.state-tag:hover { 
    background: #bbf7d0; 
} 

.state-tag.more {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
    cursor: default;
}

.state-tag.more:hover {
    background: #fef3c7;
}

.clear-button { 
    width: 100%; 
    margin-top: 0.75rem; 
    padding: 0.5rem 1rem; 
    background: #046A38; 
    color: white; 
    border: none; 
    border-radius: 0.375rem; 
    cursor: pointer; 
    font-weight: 500; 
    transition: background 0.2s; 
} 

.clear-button:hover { 
    background: #03522c; 
} 

.clear-button:disabled { 
    background: #d1d5db; 
    cursor: not-allowed; 
} 

/* Upload Section */ 
.upload-section { 
    background: #f0f9ff; 
    border-bottom: 2px solid #0ea5e9; 
    padding: 1rem; 
    text-align: center; 
} 

.upload-label { 
    cursor: pointer; 
    background: #0ea5e9; 
    color: white; 
    padding: 0.5rem 1.5rem; 
    border-radius: 0.375rem; 
    display: inline-block; 
    font-weight: 500; 
    transition: background 0.2s; 
} 

.upload-label:hover { 
    background: #0284c7; 
} 

#csvUpload { 
    display: none; 
} 

/* TABLE VIEW STYLES */ 
.table-view-container { 
    display: none; 
    width: 100%; 
    animation: fadeIn 0.3s ease-out; 
} 

.table-view-container.active { 
    display: block; 
} 

.table-controls { 
    background: white; 
    border-radius: 1rem; 
    padding: 1.25rem; 
    margin-bottom: 1.25rem; 
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); 
    border: 1px solid #e2e8f0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 1rem; 
} 

.table-view-toggle { 
    display: flex; 
    background: #f3f4f6; 
    padding: 0.25rem; 
    border-radius: 0.5rem; 
    gap: 0.25rem; 
} 

.table-view-toggle button { 
    padding: 0.5rem 1.25rem; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    border-radius: 0.375rem; 
    transition: all 0.2s; 
    color: #64748b; 
    font-size: 0.875rem; 
    font-weight: 500; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
} 

.table-view-toggle button:hover { 
    background: #e2e8f0; 
    color: #1e293b; 
} 

.table-view-toggle button.active { 
    background: white; 
    color: #2563eb; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
} 

.table-wrapper { 
    background: white; 
    border-radius: 1rem; 
    overflow: hidden; 
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); 
    border: 1px solid #e2e8f0; 
} 

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.875rem; 
} 

.data-table thead { 
    background: linear-gradient(to right, #2563eb, #1d4ed8); 
    position: sticky; 
    top: 0; 
    z-index: 10; 
} 

.data-table th { 
    padding: 1rem; 
    text-align: left; 
    font-weight: 600; 
    color: white; 
    border-bottom: 2px solid #1e40af; 
    white-space: nowrap; 
    cursor: pointer; 
    user-select: none; 
    transition: background 0.2s; 
} 

.data-table th:hover { 
    background: rgba(255, 255, 255, 0.1); 
} 

.data-table th.sortable::after { 
    content: ' ⇅'; 
    opacity: 0.5; 
    font-size: 0.75rem; 
} 

.data-table th.sorted-asc::after { 
    content: ' ▲'; 
    opacity: 1; 
} 

.data-table th.sorted-desc::after { 
    content: ' ▼'; 
    opacity: 1; 
} 

.data-table tbody tr { 
    border-bottom: 1px solid #e2e8f0; 
    transition: background 0.2s; 
} 

.data-table tbody tr:hover { 
    background: #f8fafc; 
} 

.data-table tbody tr:last-child { 
    border-bottom: none; 
} 

.data-table td { 
    padding: 1rem; 
    color: #1e293b; 
} 

.data-table td.number { 
    text-align: right; 
    font-variant-numeric: tabular-nums; 
} 

.data-table td.positive { 
    color: #16a34a; 
    font-weight: 600; 
} 

.data-table td.negative { 
    color: #dc2626; 
    font-weight: 600; 
} 

.row-header { 
    font-weight: 600; 
    color: #1e293b; 
    position: sticky; 
    left: 0; 
    background: white; 
    z-index: 5; 
} 

.data-table tbody tr:hover .row-header { 
    background: #f8fafc; 
} 

.table-empty { 
    padding: 3rem; 
    text-align: center; 
    color: #64748b; 
    font-style: italic; 
} 

/* County Map Styles */
.county-path {
    transition: all 0.2s ease;
}

.county-path:hover {
    filter: brightness(0.95);
}

.zoom-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zoom-controls button {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.zoom-controls button:hover {
    background: #f1f5f9;
    transform: scale(1.05);
}

#info-tooltip {
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ✨ v18: Responsive mit festen Grid-Row Heights */
@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        grid-auto-rows: 320px; /* Konsistente Höhe auch bei kleineren Screens */
    }
} 

@media (max-width: 768px) { 
    .main { 
        flex-direction: column; 
    } 
    .map-sidebar { 
        width: 100%; 
    } 
    .header-content { 
        flex-direction: column; 
        align-items: stretch; 
    } 
    .filters { 
        flex-direction: column; 
        gap: 0.75rem; 
    } 
    .filter-group { 
        width: 100%; 
    } 
    select, .dropdown-button { 
        width: 100%; 
    } 
    .table-wrapper { 
        overflow-x: auto; 
    } 
    .data-table { 
        min-width: 1200px; 
    } 
} 

.empty-state { 
    color: #64748b; 
    font-style: italic; 
    font-size: 0.875rem; 
} 

.loading { 
    display: inline-block; 
    width: 20px; 
    height: 20px; 
    border: 3px solid rgba(0,0,0,.1); 
    border-radius: 50%; 
    border-top-color: #2563eb; 
    animation: spin 1s ease-in-out infinite; 
} 

@keyframes spin { 
    to { 
        transform: rotate(360deg); 
    } 
} 

.highlight-row { 
    background: #fef3c7 !important; 
    animation: highlightFade 2s ease-out; 
} 

@keyframes highlightFade { 
    from { 
        background: #fde047; 
    } 
    to { 
        background: #fef3c7; 
    } 
}

/* ========================================
   CHAT WIDGET STYLES
   ======================================== */

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.chat-widget.minimized {
    height: 60px;
}

.chat-widget.minimized .chat-body,
.chat-widget.minimized .chat-input-container {
    display: none;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-icon {
    font-size: 24px;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-minimize,
.chat-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-minimize:hover,
.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.chat-welcome {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.chat-welcome h3 {
    color: #1e293b;
    margin-bottom: 8px;
}

.chat-welcome p {
    margin-bottom: 16px;
    font-size: 14px;
}

.chat-welcome ul {
    text-align: left;
    font-size: 13px;
    line-height: 1.8;
    color: #475569;
}

.chat-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.chat-avatar svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.chat-message.assistant .chat-avatar {
    background: white;
    border: 2px solid #86BC25;
    color: #86BC25;
}

.chat-message.user .chat-avatar {
    background: #e2e8f0;
    color: #475569;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.assistant .chat-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.chat-bubble strong {
    font-weight: 600;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typing 1.4s infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    background: white;
    border-radius: 0 0 16px 16px;
}

.chat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.chat-send {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: scale(1.05);
}

.chat-send:active {
    transform: scale(0.95);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 999;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle:active {
    transform: scale(0.95);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.filter-action {
    display: inline-block;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 4px 8px;
    margin: 4px 0;
    font-size: 12px;
    color: #1e40af;
    font-weight: 500;
}

@media (max-width: 768px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .chat-input-container {
        border-radius: 0;
    }
    
    .chat-toggle {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .chat-widget {
        width: 100vw;
        height: 100vh;
    }
}

/* County Map Styles */
.county-path {
    transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
    transform-origin: center;
    transform-box: fill-box;
}

.county-path:hover {
    cursor: pointer;
}

/* ========================================
   ✨ v14: Sample Question Buttons
   ======================================== */

.sample-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.landing-sample-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 16px;
}

.sample-question-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: currentColor;
}

.sample-question-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.sample-question-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   ✨ v14: AI Response Panel unter Karte
   ======================================== */

.ai-response-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 16px;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    max-height: 50vh;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-response-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ai-response-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ai-response-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-response-content {
    padding: 20px;
    overflow-y: auto;
    line-height: 1.6;
    color: #333;
    flex: 1 1 auto;
}

/* Formatierung für KI-Antworten */
.ai-response-content h1,
.ai-response-content h2,
.ai-response-content h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.ai-response-content h1 {
    font-size: 24px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.ai-response-content h2 {
    font-size: 20px;
}

.ai-response-content h3 {
    font-size: 18px;
}

.ai-response-content p {
    margin: 12px 0;
    font-size: 15px;
}

.ai-response-content ul,
.ai-response-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.ai-response-content li {
    margin: 8px 0;
    font-size: 15px;
}

.ai-response-content strong {
    color: #764ba2;
    font-weight: 600;
}

.ai-response-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.ai-response-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 16px 0;
    color: #666;
    font-style: italic;
}

.ai-response-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.ai-response-content th,
.ai-response-content td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.ai-response-content th {
    background: #f5f5f5;
    font-weight: 600;
    color: #667eea;
}

/* Scrollbar Styling */
.ai-response-content::-webkit-scrollbar {
    width: 8px;
}

.ai-response-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ai-response-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.ai-response-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
/* ========================================
   Version Display
   ======================================== */

.version-display {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Aptos', 'Segoe UI', system-ui, -apple-system, sans-serif;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.version-display:hover {
    background: rgba(37, 99, 235, 1);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* ========================================
   v18.3: Landing Page Verbesserungen
   ======================================== */

/* Größere Schrift für Willkommensnachricht */
.welcome-message .chat-bubble p {
    font-size: 17px; /* Größer: war implizit ~14-15px */
    font-weight: 400;
    line-height: 1.7;
}

.welcome-message .chat-bubble p strong {
    font-size: 20px; /* "Hallo!" größer */
}

/* Typewriter-Effekt */
.typewriter-text,
.typewriter-text-2 {
    opacity: 0;
    overflow: hidden;
    border-right: 2px solid transparent;
    white-space: nowrap;
    animation: fadeIn 0.3s ease forwards;
}

.typewriter-text {
    animation-delay: 0.3s;
}

.typewriter-text-2 {
    animation-delay: 0.6s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Typewriter Cursor Blink */
@keyframes blink {
    50% {
        border-color: #667eea;
    }
}

.typewriter-text.typing {
    animation: typewriter 2s steps(60) 0.3s, blink 0.7s step-end infinite;
    border-right-color: #667eea;
}

.typewriter-text-2.typing {
    animation: typewriter 1.5s steps(60) 2.5s, blink 0.7s step-end infinite 2.5s;
    border-right-color: #667eea;
}

/* Probefragen: grau mit lila Hover */
.landing-sample-questions .sample-question-btn {
    background: #f1f5f9; /* Grau */
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.landing-sample-questions .sample-question-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Lila */
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.landing-sample-questions .sample-question-btn:active {
    transform: translateY(0);
}

/* Landing Chat Section spacing anpassen */
.landing-chat-section {
    margin-top: 20px;
}

.landing-sample-questions {
    margin-top: 16px; /* Nach Input */
}

/* ========================================
   AGENTUR OVERVIEW PAGE STYLES
   ======================================== */

.agentur-page {
    min-height: 100vh;
    background: #f1f5f9;
    padding: 24px;
}

.agentur-header {
    max-width: 1400px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.agentur-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.agentur-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
}

/* Stammdaten Card */
.agentur-stammdaten {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agentur-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.agentur-photo svg {
    width: 80px;
    height: 80px;
    color: white;
}

.stammdaten-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stammdaten-item {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.stammdaten-item:last-child {
    border-bottom: none;
}

.stammdaten-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stammdaten-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* Details Column */
.agentur-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agentur-kpis,
.agentur-contracts {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.agentur-kpis h2,
.agentur-contracts h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
}

/* KPI Bars */
.kpi-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kpi-bar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.kpi-bar-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.kpi-bar-track {
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.kpi-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: width 1s ease;
}

.kpi-bar-fill.positive {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.kpi-bar-fill.negative {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Contracts Table */
.contracts-table-wrapper {
    overflow-x: auto;
}

.contracts-table {
    width: 100%;
    border-collapse: collapse;
}

.contracts-table thead {
    background: #f8fafc;
}

.contracts-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contracts-table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #1e293b;
}

.contracts-table tbody tr:hover {
    background: #f8fafc;
}

.contract-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.contract-status.aktiv {
    background: #dcfce7;
    color: #166534;
}

.contract-status.storniert {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive */
@media (max-width: 1024px) {
    .agentur-container {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   BILLING CHECK PAGE STYLES
   ======================================== */

.billing-page {
    min-height: 100vh;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
}

.billing-header {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.billing-page-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.billing-iframe {
    flex: 1;
    border: none;
    width: 100%;
    height: calc(100vh - 80px);
}

/* ========================================
   DELOITTE BRANDING STYLES
   ======================================== */

/* Deloitte Logo Container */
.deloitte-logo-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10001;
}

.deloitte-logo {
    height: 40px;
    width: auto;
}

/* Deloitte D Icon für Chat */
.chat-icon-deloitte,
.chat-avatar-deloitte {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #86BC25;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar-deloitte {
    width: 44px;
    height: 44px;
}

.deloitte-d {
    font-size: 22px;
    font-weight: 700;
    color: #000000;
    font-family: 'Arial', sans-serif;
}

/* ========================================
   LANDING PAGE - WEISSER HINTERGRUND
   ======================================== */

.landing-page {
    background: white !important;
}

/* Welcome Chat - Breiter */
.welcome-chat {
    width: 90%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
}

/* Header mit Deloitte-Grün */
.welcome-chat-header {
    background: white;
    color: #000000;
    padding: 20px 24px;
    border-bottom: 3px solid #86BC25;
}

/* ========================================
   NAVIGATION BOXEN
   ======================================== */

.navigation-boxes {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.nav-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-box:hover {
    border-color: #86BC25;
    background: #f8fdf5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(134, 188, 37, 0.2);
}

.nav-box-icon {
    width: 32px;
    height: 32px;
    color: #86BC25;
}

.nav-box span {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* ========================================
   SETTINGS COLLAPSIBLE BOX
   ======================================== */

.settings-collapsible {
    margin-top: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.settings-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
}

.settings-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.settings-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: #64748b;
    transition: transform 0.3s ease;
}

.settings-collapsible.open .chevron-icon {
    transform: rotate(180deg);
}

.settings-content {
    display: none;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.settings-collapsible.open .settings-content {
    display: block;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-item:hover {
    background: #f1f5f9;
    border-color: #86BC25;
}

.settings-item-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
}

.settings-item span {
    font-size: 14px;
    color: #1e293b;
}

.settings-upload-label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    cursor: pointer;
}

.settings-api-section {
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
}

.settings-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.settings-item-header span {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* Mock Toggle */
.mock-toggle {
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background-color: #86BC25;
}

.toggle-switch input:checked + label:before {
    transform: translateX(24px);
}

/* API Token Styles angepasst */
.api-token-save {
    padding: 10px 20px;
    background: #86BC25;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.api-token-save:hover {
    background: #6fa31e;
    transform: translateY(-1px);
}

.api-token-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.api-token-toggle:hover {
    background: #f8fafc;
    border-color: #86BC25;
}

/* Chat Widget - Breiter */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 500px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* Chat Header mit Deloitte-Grün */
.chat-header {
    background: white;
    color: #000000;
    padding: 16px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #86BC25;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
    color: #000000;
}

.chat-subtitle {
    font-size: 12px;
    color: #64748b;
}

.chat-minimize,
.chat-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-minimize:hover,
.chat-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Chat Toggle Button mit Deloitte-Grün */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border: 3px solid #86BC25;
    background: white;
    color: #000000;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(134, 188, 37, 0.3);
    z-index: 999;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(134, 188, 37, 0.4);
}

/* Sample Questions mit Deloitte-Grün */
.sample-question-btn {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sample-question-btn:hover {
    border-color: #86BC25;
    background: #f8fdf5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(134, 188, 37, 0.15);
}

.sample-question-btn svg {
    flex-shrink: 0;
    color: #86BC25;
}

.sample-question-btn:hover svg {
    color: currentColor;
}

/* Button SVG Icons allgemein */
button svg,
.back-button svg,
.view-mode-toggle button svg {
    flex-shrink: 0;
    vertical-align: middle;
}

.upload-label svg {
    vertical-align: middle;
    margin-right: 6px;
    color: #86BC25;
}

/* Landing Chat Input - Deloitte Focus */
.landing-chat-input:focus {
    outline: none;
    border-color: #86BC25;
    box-shadow: 0 0 0 3px rgba(134, 188, 37, 0.1);
}

/* Landing Chat Send Button */
.landing-chat-send {
    background: #86BC25;
}

.landing-chat-send:hover {
    background: #6fa31e;
}

/* Chat Input Focus */
.chat-input:focus {
    outline: none;
    border-color: #86BC25;
    box-shadow: 0 0 0 3px rgba(134, 188, 37, 0.1);
}

/* Chat Send Button */
.chat-send {
    background: #86BC25;
}

.chat-send:hover {
    background: #6fa31e;
}

/* Landing Chat Message Assistant Avatar */
.landing-chat-message.assistant .chat-avatar {
    background: white;
    border: 2px solid #86BC25;
    color: #000000;
}

/* User Message - Deloitte Grün */
.landing-chat-message.user .chat-bubble {
    background: #86BC25;
    color: white;
}

.chat-message.user .chat-bubble {
    background: #86BC25;
    color: white;
}

/* Responsive für breiteres Chat Widget */
@media (max-width: 768px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .welcome-chat {
        width: 95%;
        max-width: none;
    }

    .navigation-boxes {
        flex-direction: column;
    }
}

/* ========================================
   LOGO PLATZHALTER
   ======================================== */

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.logo-placeholder:hover {
    border-color: #86BC25;
    background: #f8fdf5;
    color: #86BC25;
}

.logo-placeholder svg {
    color: inherit;
}

.upload-mode-active .logo-placeholder {
    border-color: #86BC25;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: #86BC25; }
    50% { border-color: #cbd5e1; }
}

.upload-mode-hint {
    font-size: 12px;
    color: #86BC25;
    padding: 8px 16px;
    background: #f8fdf5;
    border-radius: 6px;
    margin-top: 8px;
}

/* ========================================
   CHATBOT GRÖSSERE SCHRIFT
   ======================================== */

.landing-chat-input {
    font-size: 16px !important;
}

.chat-input {
    font-size: 16px !important;
}

.chat-bubble {
    font-size: 16px !important;
}

.chat-bubble p {
    font-size: 16px !important;
    line-height: 1.6 !important;
}

.welcome-message .chat-bubble p {
    font-size: 18px !important;
}

.landing-chat-message .chat-bubble {
    font-size: 16px !important;
}

.chat-message .chat-bubble {
    font-size: 16px !important;
}

/* ========================================
   AUTOCOMPLETE SUGGESTIONS
   ======================================== */

/* Wrapper für Input + Suggestions */
.landing-chat-input-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    font-size: 14px;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f8fdf5;
}

.autocomplete-item svg {
    width: 20px;
    height: 20px;
    color: #86BC25;
    flex-shrink: 0;
}

.autocomplete-item .agent-name {
    font-weight: 600;
    color: #1e293b;
}

.autocomplete-item .agent-id {
    color: #64748b;
    font-size: 12px;
    margin-left: auto;
}

/* ========================================
   POTENTIALANALYSE PAGE
   ======================================== */

.potential-page {
    min-height: 100vh;
    background: white;
    padding: 24px;
}

.potential-header {
    max-width: 1400px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.potential-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
}

.potential-toggle-container {
    display: flex;
    gap: 8px;
}

.potential-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
}

.potential-toggle-btn:hover {
    border-color: #86BC25;
    color: #86BC25;
}

.potential-toggle-btn.active {
    border-color: #86BC25;
    background: #86BC25;
    color: white;
}

.potential-toggle-btn.fida-btn.active {
    background: #2563eb;
    border-color: #2563eb;
}

.potential-content {
    max-width: 1400px;
    margin: 0 auto;
}

.potential-table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.potential-info-box {
    padding: 20px 24px;
    background: #f8fdf5;
    border-bottom: 1px solid #e2e8f0;
}

.potential-info-box.fida {
    background: #eff6ff;
}

.potential-info-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.potential-info-box p {
    font-size: 14px;
    color: #64748b;
}

.potential-table {
    width: 100%;
    border-collapse: collapse;
}

.potential-table thead {
    background: #f8fafc;
}

.potential-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.potential-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #1e293b;
}

.potential-table tbody tr:hover {
    background: #f8fafc;
}

.potential-table tbody tr:last-child td {
    border-bottom: none;
}

/* Potential Badges */
.potential-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.potential-badge.hausrat {
    background: #dcfce7;
    color: #166534;
}

.potential-badge.kfz {
    background: #fef3c7;
    color: #92400e;
}

.potential-badge.leben {
    background: #dbeafe;
    color: #1e40af;
}

.potential-badge.unfall {
    background: #fce7f3;
    color: #9d174d;
}

.potential-badge.rechtsschutz {
    background: #e0e7ff;
    color: #3730a3;
}

.potential-badge.pflege {
    background: #f3e8ff;
    color: #6b21a8;
}

.potential-badge.bu {
    background: #fee2e2;
    color: #991b1b;
}

.potential-badge.sach {
    background: #ffedd5;
    color: #9a3412;
}

.potential-badge.altersvorsorge {
    background: #cffafe;
    color: #0e7490;
}

.potential-badge.kranken {
    background: #fdf2f8;
    color: #be185d;
}

.potential-badge.haftpflicht {
    background: #f0fdf4;
    color: #15803d;
}

.potential-badge.wohngebaeude {
    background: #fef9c3;
    color: #a16207;
}

/* Potential Group Rows (collapsible) */
.potential-group-row {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.potential-group-row:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.potential-group-row td {
    padding: 14px 16px !important;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.potential-group-row .group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.potential-group-row .group-toggle svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: #64748b;
}

.potential-group-row.expanded .group-toggle svg {
    transform: rotate(90deg);
}

/* Segment Badges - 4 Hauptfarben */
.segment-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.segment-badge.segment-leben {
    background: #dbeafe;
    color: #1e40af;
}

.segment-badge.segment-kranken {
    background: #fce7f3;
    color: #9d174d;
}

.segment-badge.segment-shu {
    background: #d1fae5;
    color: #065f46;
}

.segment-badge.segment-kfz {
    background: #fef3c7;
    color: #92400e;
}

.potential-group-row .group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #475569;
    color: white;
    font-size: 13px;
    font-weight: 700;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    margin-left: 16px;
}

.potential-group-row .group-priorities {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
}

.potential-group-row .priority-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 70px;
    justify-content: center;
}

.potential-group-row .priority-count.high {
    background: #fee2e2;
    color: #991b1b;
}

.potential-group-row .priority-count.medium {
    background: #fef3c7;
    color: #92400e;
}

.potential-group-row .priority-count.low {
    background: #dcfce7;
    color: #166534;
}

.potential-detail-row {
    display: none;
}

.potential-detail-row.visible {
    display: table-row;
}

.potential-detail-row td:first-child {
    padding-left: 40px !important;
}

/* Priority Tags */
.priority {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority.high {
    background: #fee2e2;
    color: #991b1b;
}

.priority.medium {
    background: #fef3c7;
    color: #92400e;
}

.priority.low {
    background: #dcfce7;
    color: #166534;
}

/* Consent Tags */
.consent {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.consent.yes {
    background: #dcfce7;
    color: #166534;
}

/* DORA Table Styling */
.fida-table thead {
    background: #eff6ff;
}

/* ========================================
   KUNDEN TAB NAVIGATION
   ======================================== */

.kunden-tabs {
    max-width: 1200px;
    margin: 0 auto 24px;
    display: flex;
    gap: 8px;
    padding: 0 24px;
}

.kunden-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    border-bottom: 2px solid #e2e8f0;
}

.kunden-tab:hover {
    border-color: #86BC25;
    color: #86BC25;
    border-bottom-color: #86BC25;
}

.kunden-tab.active {
    border-color: #86BC25;
    border-bottom-color: white;
    background: white;
    color: #86BC25;
    position: relative;
    z-index: 1;
    margin-bottom: -2px;
}

.kunden-tab.fida-tab:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.kunden-tab.fida-tab.active {
    border-color: #2563eb;
    border-bottom-color: white;
    color: #2563eb;
}

.kunden-tab-content {
    display: none;
}

.kunden-tab-content.active {
    display: block;
}

/* ========================================
   FIDA STATUS CARD
   ======================================== */

.fida-status-card {
    border: 2px solid #2563eb;
}

.fida-status-content {
    padding: 24px;
}

.fida-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.fida-status-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fida-status-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fida-status-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.fida-status-value.consent-active {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #16a34a;
}

.fida-status-value.consent-expiring {
    color: #f59e0b;
}

.fida-status-value.consent-expired {
    color: #dc2626;
}

.fida-datasources {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.fida-datasource-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #eff6ff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
}

/* ========================================
   FIDA SOURCE BADGES
   ======================================== */

.fida-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

/* ========================================
   POTENTIAL STATUS BADGES
   ======================================== */

.potential-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.potential-status.offen {
    background: #f1f5f9;
    color: #64748b;
}

.potential-status.angeschrieben {
    background: #dbeafe;
    color: #1e40af;
}

.potential-status.termin {
    background: #dcfce7;
    color: #166534;
}

.potential-status.abgeschlossen {
    background: #86BC25;
    color: white;
}

/* ========================================
   KOMMUNIKATIONSHISTORIE
   ======================================== */

.kommunikation-timeline {
    padding: 16px;
}

.komm-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.komm-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.komm-item:last-child {
    margin-bottom: 0;
}

.komm-item.auto {
    border-left: 3px solid #2563eb;
}

.komm-item.manuell {
    border-left: 3px solid #86BC25;
}

.komm-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.komm-item.auto .komm-icon {
    color: #2563eb;
}

.komm-item.manuell .komm-icon {
    color: #86BC25;
}

.komm-content {
    flex: 1;
    min-width: 0;
}

.komm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.komm-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.komm-item.auto .komm-type {
    color: #2563eb;
}

.komm-item.manuell .komm-type {
    color: #86BC25;
}

.komm-date {
    font-size: 12px;
    color: #94a3b8;
}

.komm-subject {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.komm-preview {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.komm-status {
    display: flex;
    gap: 8px;
}

.komm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.komm-status-badge.versendet {
    background: #f1f5f9;
    color: #64748b;
}

.komm-status-badge.geoeffnet {
    background: #dcfce7;
    color: #166534;
}

.komm-status-badge.termin {
    background: #dbeafe;
    color: #1e40af;
}

.komm-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: center;
}

.komm-action:hover {
    border-color: #86BC25;
    color: #86BC25;
}

/* ========================================
   FIDA DETAILLIERTE DATEN
   ======================================== */

.fida-source-tag {
    background: #eff6ff;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* PSD2 Styling (bereits verfügbar seit 2018) */
.psd2-card {
    border: 2px solid #94a3b8;
}

.kunden-card-header.psd2 {
    background: #f1f5f9;
}

.kunden-card-header.psd2 h2 {
    color: #475569;
}

.psd2-source-tag {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
}

.data-source-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 12px;
    border-top: 1px solid #e2e8f0;
}

.data-source-info.psd2 {
    background: #f8fafc;
    color: #64748b;
}

.data-source-info svg {
    flex-shrink: 0;
}

/* FIDA NEU Styling (ab 2027) */
.fida-new-card {
    border: 2px solid #16a34a;
}

.kunden-card-header.fida-new {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.kunden-card-header.fida-new h2 {
    color: #166534;
}

.fida-new-tag {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

/* Extended Open Finance Table Styling */
.fida-extended-table {
    font-size: 13px;
}

.fida-extended-table th {
    white-space: nowrap;
    padding: 10px 8px;
}

.fida-extended-table td {
    padding: 12px 8px;
    vertical-align: top;
}

/* Tarif Badges */
.tarif-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tarif-badge.premium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.tarif-badge.standard {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.tarif-badge.basis {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* Leistung Tags */
.leistung-tag {
    display: inline-block;
    background: #ecfdf5;
    color: #059669;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin: 2px 2px 2px 0;
    border: 1px solid #a7f3d0;
}

/* Ausschluss Tags */
.ausschluss-tag {
    display: inline-block;
    background: #fef2f2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin: 2px 2px 2px 0;
    border: 1px solid #fecaca;
}

/* Vermittler Toggle (Makler/AO) */
.vermittler-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.toggle-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.vermittler-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
}

.toggle-option:hover {
    color: #1e40af;
}

.toggle-option.active {
    background: white;
    color: #1e40af;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-option[data-mode="ao"].active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

/* Produktvorschläge Section */
.produktvorschlaege-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px dashed #e2e8f0;
}

.produktvorschlaege-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    color: #1e40af;
    font-size: 15px;
}

.produktvorschlaege-title svg {
    color: #f59e0b;
}

/* Produkt Ranking */
.produkt-ranking {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.produkt-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.produkt-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.produkt-card.rank-1 {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.produkt-card.rank-2 {
    border: 1px solid #9ca3af;
}

.produkt-card.rank-3 {
    border: 1px solid #d97706;
}

.produkt-card.ao-single {
    border: 2px solid #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.produkt-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: white;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.rank-badge.ergo {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    width: 40px;
    height: 40px;
}

.rank-label {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.produkt-rank.ao .rank-label {
    color: #dc2626;
    font-weight: 600;
}

.produkt-info {
    flex: 1;
}

.produkt-anbieter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.produkt-anbieter img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.produkt-anbieter strong {
    font-size: 15px;
    color: #1e293b;
}

.produkt-details {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.produkt-deckung {
    font-size: 14px;
    font-weight: 600;
    color: #059669;
}

.produkt-praemie {
    font-size: 14px;
    color: #64748b;
}

.produkt-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.highlight-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.highlight-tag.good {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.highlight-tag.neutral {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.produkt-score {
    text-align: center;
    min-width: 60px;
}

.score-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e40af;
    line-height: 1;
}

.score-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.ao-vorteile {
    margin-top: 12px;
    padding: 10px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: #b91c1c;
}

.ao-vorteile strong {
    display: block;
    margin-bottom: 4px;
}

.angebot-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.angebot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.fida-finance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px;
}

.fida-finance-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fida-finance-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fida-finance-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.fida-finance-detail {
    font-size: 12px;
    color: #94a3b8;
}

.fida-product-type {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.fida-insight-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #eff6ff;
    border-top: 1px solid #e2e8f0;
    color: #1e40af;
    font-size: 13px;
}

.fida-insight-box.warning {
    background: #fef3c7;
    color: #92400e;
}

.fida-insight-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Deckungslücken-Analyse */
.deckungsluecke-card {
    border: 2px solid #f59e0b;
}

.kunden-card-header.warning {
    background: #fef3c7;
    color: #92400e;
}

.kunden-card-header.warning h2 {
    color: #92400e;
}

.deckungsluecke-content {
    padding: 24px;
}

.deckungsluecke-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.deckungsluecke-item {
    text-align: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.deckungsluecke-item.highlight-danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.deckungsluecke-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.deckungsluecke-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.deckungsluecke-item.highlight-danger .deckungsluecke-value {
    color: #dc2626;
}

.deckungsluecke-divider {
    font-size: 32px;
    font-weight: 300;
    color: #94a3b8;
}

.deckungsluecke-bar {
    height: 32px;
    background: #fee2e2;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.deckungsluecke-bar-filled {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #86BC25);
    border-radius: 16px;
    transition: width 0.5s ease;
}

.deckungsluecke-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.deckungsluecke-recommendation {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1200px) {
    .fida-finance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .fida-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fida-finance-grid {
        grid-template-columns: 1fr;
    }

    .kunden-tabs {
        flex-wrap: wrap;
    }

    .komm-item {
        flex-direction: column;
    }

    .komm-action {
        align-self: flex-start;
    }

    .deckungsluecke-row {
        flex-direction: column;
        gap: 12px;
    }

    .deckungsluecke-divider {
        transform: rotate(90deg);
    }
}

/* ========================================
   AGENTUR PHOTO UPLOAD
   ======================================== */

.agentur-photo {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-mode-active .agentur-photo {
    border: 3px dashed #86BC25;
}

.agentur-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.agentur-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}

.upload-mode-active .agentur-photo:hover .agentur-photo-overlay {
    opacity: 1;
}

.agentur-photo-overlay svg {
    width: 40px;
    height: 40px;
    color: white;
}

/* Upload Overlay im Agentur Photo */
.agentur-photo .upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}

.upload-mode-active .agentur-photo:hover .upload-overlay {
    opacity: 1;
}

.agentur-photo .upload-overlay svg {
    width: 40px;
    height: 40px;
    color: white;
}

.agentur-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.agentur-photo-placeholder {
    width: 80px;
    height: 80px;
    color: white;
}

/* ========================================
   POTENTIAL FILTER
   ======================================== */

.potential-filters {
    max-width: 1400px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.potential-filters .filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-right: 8px;
}

.potential-filter-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.potential-filter-btn:hover {
    border-color: #86BC25;
    color: #86BC25;
}

.potential-filter-btn.active {
    background: #86BC25;
    border-color: #86BC25;
    color: white;
}

/* Klickbare Zeilen */
.clickable-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.clickable-row:hover {
    background: #f8fdf5 !important;
}

/* ========================================
   KUNDENDETAIL PAGE
   ======================================== */

.kunden-page {
    min-height: 100vh;
    background: #f8fafc;
    padding: 24px;
}

.kunden-header {
    max-width: 1200px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.kunden-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
}

.kunden-content {
    max-width: 1200px;
    margin: 0 auto;
}

.kunden-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    overflow: hidden;
}

.kunden-card-header {
    padding: 20px 24px;
    background: #f8fdf5;
    border-bottom: 1px solid #e2e8f0;
}

.kunden-card-header.fida {
    background: #eff6ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kunden-card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.consent-info {
    font-size: 12px;
    font-weight: 600;
    color: #166534;
    background: #dcfce7;
    padding: 4px 12px;
    border-radius: 12px;
}

.kunden-stammdaten {
    display: flex;
    gap: 40px;
    padding: 24px;
}

.kunden-foto-container {
    text-align: center;
    flex-shrink: 0;
}

.kunden-foto {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 3px solid #86BC25;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.kunden-foto:hover {
    background: #f8fdf5;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(134, 188, 37, 0.3);
}

.kunden-foto::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(134, 188, 37, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.kunden-foto:hover::after {
    opacity: 1;
}

.kunden-foto svg {
    width: 48px;
    height: 48px;
    color: #64748b;
}

.kunden-foto-container h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.kunden-id {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.kunden-info-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.kunden-info-grid .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kunden-info-grid .info-item.full-width {
    grid-column: span 2;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 15px;
    color: #1e293b;
}

.kinder-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 4px;
}

.no-children {
    color: #94a3b8;
    font-style: italic;
}

.kunden-table {
    width: 100%;
    border-collapse: collapse;
}

.kunden-table thead {
    background: #f8fafc;
}

.kunden-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.kunden-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #1e293b;
}

.kunden-table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.aktiv {
    background: #dcfce7;
    color: #166534;
}

.fida-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #fef3c7;
    border-bottom: 1px solid #e2e8f0;
}

.fida-notice svg {
    flex-shrink: 0;
    color: #92400e;
}

.fida-notice p {
    font-size: 13px;
    color: #92400e;
    margin: 0;
}

.fida-card .kunden-table thead {
    background: #eff6ff;
}

/* ========================================
   VERTRIEBSIMPULS BOX
   ======================================== */

.vertriebsimpuls-card {
    border: 2px solid #86BC25;
    background: linear-gradient(135deg, rgba(134, 188, 37, 0.05) 0%, rgba(134, 188, 37, 0.02) 100%);
}

.kunden-card-header.vertriebsimpuls {
    background: linear-gradient(135deg, #86BC25 0%, #6fa31e 100%);
    color: white;
}

.kunden-card-header.vertriebsimpuls h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.kunden-card-header.vertriebsimpuls svg {
    width: 20px;
    height: 20px;
}

.vertriebsimpuls-content {
    padding: 20px;
}

.impuls-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.impuls-item.highlight {
    border-left: 4px solid #86BC25;
    box-shadow: 0 2px 8px rgba(134, 188, 37, 0.15);
}

.impuls-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(134, 188, 37, 0.15) 0%, rgba(134, 188, 37, 0.05) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86BC25;
}

.impuls-icon svg {
    width: 24px;
    height: 24px;
}

.impuls-text {
    flex: 1;
}

.impuls-text strong {
    display: block;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 6px;
}

.impuls-text p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.impuls-priority {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.impuls-priority.high {
    background: linear-gradient(135deg, #86BC25 0%, #6fa31e 100%);
    color: white;
}

.impuls-priority.medium {
    background: #fef3c7;
    color: #92400e;
}

.impuls-priority.low {
    background: #f1f5f9;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .kunden-stammdaten {
        flex-direction: column;
        gap: 24px;
    }

    .kunden-info-grid {
        grid-template-columns: 1fr;
    }

    .kunden-info-grid .info-item.full-width {
        grid-column: span 1;
    }

    .potential-filters {
        justify-content: flex-start;
    }
}

/* ========================================
   AGENTUR OVERVIEW - FACHKONZEPT DESIGN
   ======================================== */

.agentur-page-new {
    min-height: 100vh;
    background: #f8fafc;
    padding-bottom: 40px;
}

/* Header mit Agentur-Info */
.agentur-header-new {
    background: white;
    padding: 16px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.agentur-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.agentur-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agentur-photo-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #86BC25 0%, #6fa31e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.agentur-photo-small:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(134, 188, 37, 0.3);
}

.agentur-photo-small:hover::after {
    content: '📷';
    position: absolute;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.agentur-photo-placeholder-small {
    width: 24px;
    height: 24px;
    color: white;
}

.agentur-photo-img-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agentur-header-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.agentur-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* Cockpit KPIs (Big Numbers) */
.cockpit-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 32px;
}

.cockpit-kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.cockpit-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cockpit-kpi-icon svg {
    width: 24px;
    height: 24px;
}

.cockpit-kpi-icon.bestand {
    background: #dbeafe;
    color: #2563eb;
}

.cockpit-kpi-icon.neugeschaeft {
    background: #dcfce7;
    color: #16a34a;
}

.cockpit-kpi-icon.storno {
    background: #fee2e2;
    color: #dc2626;
}

.cockpit-kpi-icon.ziel {
    background: #f3e8ff;
    color: #9333ea;
}

.cockpit-kpi-content {
    flex: 1;
}

.cockpit-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.cockpit-kpi-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.cockpit-kpi-trend {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
}

.cockpit-kpi-trend.positive {
    background: #dcfce7;
    color: #16a34a;
}

.cockpit-kpi-trend.negative {
    background: #fee2e2;
    color: #dc2626;
}

.cockpit-kpi-gauge {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.cockpit-kpi-gauge .gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #86BC25 0%, #6ba31c 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Tab Navigation */
.agentur-main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

.agentur-tabs {
    display: flex;
    gap: 8px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.agentur-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
    white-space: nowrap;
}

.agentur-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.agentur-tab.active {
    background: #86BC25;
    color: white;
}

.agentur-tab svg {
    flex-shrink: 0;
}

/* Tab Content */
.agentur-tab-content {
    display: none;
}

.agentur-tab-content.active {
    display: block;
}

/* Stammdaten Sections */
.stammdaten-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.stammdaten-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.stammdaten-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #86BC25;
}

.stammdaten-grid-new {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stammdaten-item-new {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stammdaten-item-new .stammdaten-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stammdaten-item-new .stammdaten-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #dc2626;
}

/* KPI Detail Cards */
.kpi-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-detail-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.kpi-detail-card.highlight {
    border-color: #86BC25;
    background: linear-gradient(180deg, #f8fdf5 0%, white 100%);
}

.kpi-detail-card.warning {
    border-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, white 100%);
}

.kpi-detail-header {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.kpi-detail-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.kpi-detail-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Sparten Chart */
.sparten-chart {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.sparten-chart h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
}

.sparten-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sparten-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sparten-bar-label {
    width: 100px;
    font-size: 13px;
    color: #64748b;
    flex-shrink: 0;
}

.sparten-bar-track {
    flex: 1;
    height: 24px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.sparten-bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    transition: width 0.5s ease;
}

.sparten-bar-fill.leben { background: #2563eb; }
.sparten-bar-fill.kranken { background: #16a34a; }
.sparten-bar-fill.schaden { background: #9333ea; }
.sparten-bar-fill.kfz { background: #f59e0b; }

/* Storno Reasons */
.storno-reasons {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.storno-reasons h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.storno-reason-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storno-reason-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.storno-reason-name {
    font-size: 14px;
    color: #1e293b;
}

.storno-reason-count {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
}

/* Responsive für neue Agentur-Seite */
@media (max-width: 1200px) {
    .cockpit-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .stammdaten-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .cockpit-kpis {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .agentur-header-new {
        padding: 12px 16px;
    }

    .agentur-main-content {
        padding: 0 16px;
    }

    .agentur-tabs {
        padding: 4px;
    }

    .agentur-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .agentur-tab span {
        display: none;
    }

    .kpi-detail-grid {
        grid-template-columns: 1fr;
    }

    .stammdaten-grid-new {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   USER PROFILE SWITCHER
   ======================================== */

.user-profile-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10001;
}

.profile-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 14px 8px 8px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.profile-display:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.profile-role {
    font-size: 11px;
    color: #64748b;
}

.profile-dropdown-arrow {
    color: #64748b;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.profile-dropdown-arrow.open {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.profile-option:hover {
    background: #f1f5f9;
}

.profile-option.active {
    background: rgba(134, 188, 37, 0.1);
}

.option-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.option-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.option-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    line-height: 1.3;
}

.option-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.option-role {
    font-size: 12px;
    color: #64748b;
}

.option-check {
    color: #86BC25;
    flex-shrink: 0;
}

/* Separator between options */
.profile-option + .profile-option {
    border-top: 1px solid #e2e8f0;
}

/* Profile Avatar Upload Overlay */
.profile-avatar {
    position: relative;
    cursor: pointer;
}

.avatar-upload-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #86BC25;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border: 2px solid white;
}

.avatar-upload-overlay svg {
    stroke: white;
}

.profile-avatar:hover .avatar-upload-overlay {
    opacity: 1;
}

/* Clickable option avatar in dropdown */
.option-avatar.clickable {
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease;
}

.option-avatar.clickable:hover {
    transform: scale(1.1);
}

.option-avatar.clickable::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.15s ease;
}

.option-avatar.clickable:hover::after {
    border-color: #86BC25;
}

/* Profile info clickable area */
.profile-info-clickable {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

/* ========================================
   IFRAME FULLSCREEN CONTAINER (Abrechnungsprüfung)
   ======================================== */

.iframe-fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 20000;
    display: none;
    flex-direction: column;
}

.iframe-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.iframe-close-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.iframe-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.iframe-close-btn svg {
    stroke: white;
}

.iframe-title {
    font-size: 18px;
    font-weight: 600;
}

.iframe-content {
    flex: 1;
    width: 100%;
    border: none;
}

/* ========================================
   FIDA POTENTIALE TAB (Agentursicht)
   ======================================== */

/* FIDA Tab Button Highlight */
.agentur-tab.fida-tab {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-color: #059669;
}

.agentur-tab.fida-tab:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

/* FIDA Highlight Cards */
.kpi-detail-card.fida-highlight {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.kpi-detail-card.fida-highlight .kpi-detail-header {
    color: #059669;
}

.kpi-detail-card.fida-highlight .kpi-detail-value {
    color: #047857;
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.section-title svg {
    color: #64748b;
}

/* FIDA Pipeline */
.fida-pipeline-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fida-pipeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 20px 0;
}

.pipeline-stage {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pipeline-stage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pipeline-stage.success {
    background: #ecfdf5;
}

.pipeline-count {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.pipeline-stage.success .pipeline-count {
    color: #059669;
}

.pipeline-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.pipeline-bar {
    height: 6px;
    border-radius: 3px;
    margin-top: 8px;
}

.pipeline-arrow {
    color: #cbd5e1;
    flex-shrink: 0;
}

/* FIDA Cases Table Section */
.fida-cases-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fida-filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.fida-filter-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.fida-filter-btn:hover {
    border-color: #10b981;
    color: #10b981;
}

.fida-filter-btn.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.fida-cases-table {
    width: 100%;
    border-collapse: collapse;
}

.fida-cases-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.fida-cases-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}

.fida-cases-table tr:hover {
    background: #f8fafc;
}

/* Kunde Cell */
.kunde-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kunde-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.kunde-info {
    display: flex;
    flex-direction: column;
}

.kunde-info strong {
    color: #1e293b;
}

.kunde-info span {
    font-size: 12px;
    color: #94a3b8;
}

/* Potential Type Badges */
.potential-type {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.potential-type.bu {
    background: #fef3c7;
    color: #92400e;
}

.potential-type.kfz {
    background: #dbeafe;
    color: #1e40af;
}

.potential-type.risiko {
    background: #fee2e2;
    color: #991b1b;
}

.potential-type.invest {
    background: #d1fae5;
    color: #065f46;
}

.potential-type.hausrat {
    background: #e0e7ff;
    color: #3730a3;
}

.potential-type.alters {
    background: #fce7f3;
    color: #9d174d;
}

/* FIDA Source Badge Small */
.fida-source-badge.small {
    font-size: 11px;
    padding: 3px 8px;
}

/* Status Badges for FIDA */
.status-badge.neu {
    background: #f1f5f9;
    color: #475569;
}

.status-badge.angeschrieben {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.termin {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.abgeschlossen {
    background: #d1fae5;
    color: #065f46;
}

/* Action Button */
.action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #10b981;
    color: #10b981;
}

.action-btn svg {
    color: #64748b;
}

.action-btn:hover svg {
    color: #10b981;
}

/* Automatische Kommunikation Section */
.auto-komm-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auto-komm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.komm-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
}

.komm-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.komm-stat-icon.email {
    background: #dbeafe;
    color: #2563eb;
}

.komm-stat-icon.brief {
    background: #fef3c7;
    color: #d97706;
}

.komm-stat-icon.response {
    background: #d1fae5;
    color: #059669;
}

.komm-stat-icon.termin {
    background: #e0e7ff;
    color: #4f46e5;
}

.komm-stat-content {
    display: flex;
    flex-direction: column;
}

.komm-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.komm-stat-label {
    font-size: 13px;
    color: #64748b;
}

/* Responsive für FIDA Potentiale */
@media (max-width: 1200px) {
    .fida-pipeline {
        flex-wrap: wrap;
    }

    .pipeline-stage {
        min-width: calc(50% - 20px);
    }

    .pipeline-arrow {
        display: none;
    }

    .auto-komm-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pipeline-stage {
        min-width: 100%;
    }

    .auto-komm-stats {
        grid-template-columns: 1fr;
    }

    .fida-cases-table {
        display: block;
        overflow-x: auto;
    }
}

/* ========================================
   PSD2/FIDA SOURCE TAGS IN DECKUNGSLÜCKE
   ======================================== */

/* Combined Source Tag */
.combined-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(90deg, #64748b 0%, #64748b 45%, #10b981 55%, #10b981 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    margin-left: auto;
}

/* Individual Source Tags */
.source-tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}

.source-tag.psd2 {
    background: #64748b;
    color: white;
}

.source-tag.fida {
    background: #10b981;
    color: white;
}

/* Deckungslücke Item with Source */
.deckungsluecke-item.psd2-item {
    border-left: 3px solid #64748b;
    padding-left: 12px;
}

.deckungsluecke-item.fida-item {
    border-left: 3px solid #10b981;
    padding-left: 12px;
}

.deckungsluecke-source {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.deckungsluecke-item.highlight-danger .deckungsluecke-source {
    color: #dc2626;
    font-weight: 600;
}

/* Deckungslücke Insight Section */
.deckungsluecke-insight {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.insight-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #334155;
}

.insight-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.insight-icon.psd2 {
    background: #e2e8f0;
    color: #475569;
}

.insight-icon.fida {
    background: #d1fae5;
    color: #059669;
}

.insight-row strong {
    font-weight: 600;
}

/* Make recommendation more prominent */
.deckungsluecke-recommendation {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.6;
}

.deckungsluecke-recommendation strong {
    color: #92400e;
}

/* Klickbare Tabellenzeilen */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.clickable-row:hover {
    background-color: #e0f2fe !important;
    transform: scale(1.002);
}

.clickable-row:active {
    background-color: #bae6fd !important;
}
