:root {
    --sidebar-color: #2e64a0;
    --sidebar-transparent: rgba(46, 100, 160, 0.7);
    --sidebar-hover: rgba(46, 100, 160, 0.9);
    /* Modern B2B Design Tokens */
    --sidebar-bg: #ffffff;
    --sidebar-text: #374151;
    --sidebar-text-muted: #9ca3af;
    --sidebar-border: #e5e7eb;
    --sidebar-active-bg: rgba(46, 100, 160, 0.08);
    --sidebar-active-text: var(--sidebar-color);
    --sidebar-hover-bg: #f9fafb;
    --card-border: #e5e7eb;
    --card-radius: 8px;
    --dialog-radius: 8px;
    --btn-radius: 6px;
}

.text-kim-blue {
    color: var(--sidebar-color) !important;
}

/* Wizard-Hinweismeldungen (Pflichtfeld-Hinweise) */
.wizard-hint {
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    overscroll-behavior-y: contain;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: var(--sidebar-color, #1b6ec2);
    border-color: var(--sidebar-color, #1861ac);
    font-weight: 500;
    border-radius: var(--btn-radius);
    transition: all 0.15s ease;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* Dialog-Öffner-Buttons besser erkennbar machen */
.btn-outline-secondary {
    transition: all 0.15s ease;
}

.btn-outline-secondary:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
    padding-bottom: 2rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    transition: all 0.3s ease;
    color: var(--sidebar-text);
    position: fixed;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 48px; /* Reduziert von 60px auf 48px */
}

/* Text in collapsed mode ausblenden */
.sidebar.collapsed .nav-text {
    display: none;
}

/* Sidebar Toggle Button - integriert im Brand-Bereich */
.sidebar-toggle-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--btn-radius, 6px);
    background: transparent;
    border: none;
    color: var(--sidebar-muted, #9ca3af);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar-toggle-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    top: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--sidebar-hover-bg, #f3f4f6);
    color: var(--sidebar-text, #374151);
}

.sidebar.collapsed .sidebar-toggle-btn {
    margin-left: auto;
    margin-right: auto;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 1rem 0.25rem 0.5rem;
}

/* Sidebar Brand / Logo */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 0.75rem 0.5rem;
    border-bottom: none;
    gap: 0.25rem;
}

.sidebar-brand-logo {
    max-width: 100%;
    height: 40px;
    object-fit: contain;
}

.sidebar-brand-logo-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Optional: Anpassung des oberen Abstands der Navigationspunkte */
.sidebar-content {
    padding: 0.75rem 0;  /* Etwas mehr Platz oben ohne Header */
    flex-grow: 1; /* Nimmt den verfügbaren Platz ein */
    overflow-y: auto; /* Fügt Scrollleiste hinzu, wenn nötig */
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
    font-size: 0.9rem; /* Einheitliche Schriftgröße für alle Sidebar-Elemente */
}

/* Scrollbar Styling für moderne Browser */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Scrollbar für Firefox */
.sidebar-content {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

/* Anpassung der nav-item Styles */
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    margin: 1px 0.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.15s ease;
    gap: 0.5rem;
    border-radius: var(--btn-radius);
}

.nav-item:hover {
    color: var(--sidebar-text) !important;
    background: var(--sidebar-hover-bg);
}

.nav-item i {
    font-size: 1.1rem; /* Angepasste Icongröße */
    display: flex; /* Flexbox für bessere Zentrierung */
    align-items: center;
    justify-content: center;
    width: 1.5rem; /* Feste Breite für Icons */
}

.nav-text {
    line-height: 1.1rem; /* Anpassung an Iconhöhe */
    display: flex;
    align-items: center;
}

/* Anpassung der Section Header */
.nav-section-header {
    padding: 0.5rem 0.75rem;
    color: var(--sidebar-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
}

.sidebar.collapsed .nav-section-header {
    padding: 0.25rem 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.sidebar.collapsed .nav-section-header > .nav-text {
    display: none;
}

/* Grundlegende Layout-Styles */
.page {
    position: relative;
    display: flex;
    flex-direction: row;
    height: 100vh;    /* Volle Viewport-Höhe */
    overflow: hidden; /* Verhindert Scrollbalken */
}

main {
    flex: 1;
    padding-left: 250px; /* Entspricht der Sidebar-Breite */
    transition: padding-left 0.3s ease;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto; /* Scrollbalken wenn Inhalt überläuft */
    height: 100vh;
    box-sizing: border-box;
}

/* Sidebar Footer - Verkehrswert-Anzeige */
.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--sidebar-border);
    padding: 0.75rem 1rem;
    background: var(--sidebar-hover-bg);
}

.verkehrswert-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.verkehrswert-label {
    color: var(--sidebar-text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.verkehrswert-value {
    color: var(--sidebar-color);
    font-size: 1.1rem;
    font-weight: 700;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--card-radius, 8px);
    color: var(--sidebar-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    justify-content: center;
}

.logout-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-color);
    border-color: var(--sidebar-color);
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar.collapsed ~ main {
    padding-left: 48px; /* Angepasst an neue collapsed Breite */
}

/* Hintergrundbild für die Home-Seite */
.home-page {
    position: absolute;
    top: 0;
    left: 250px;  /* Entspricht der Sidebar-Breite */
    right: 0;
    bottom: 0;
    background-image: url('/images/architecture_1836070_1920x1080.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0;        /* Entfernt alle Margins */
    padding: 0;             /* Zurücksetzen des generellen Paddings */
    padding-left: 3rem;     /* Linker Abstand */
    padding-top: 3rem;      /* Oberer Abstand - gleich wie links */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;  /* Ausrichtung am oberen Rand statt zentriert */
    gap: 1rem;               /* Abstand zwischen den Überschriften */
    overflow: hidden; /* Verhindert Scrollbalken */
    transition: left 0.3s ease; /* Smooth transition beim Sidebar-Toggle */
    min-height: 100vh; /* Wichtig: Stellt sicher, dass die Seite die volle Höhe einnimmt */
    overscroll-behavior-y: contain; /* Verhindert das native Pull-to-Refresh des Browsers */
}

/* Optional: Visuelles Feedback während des Ziehens */
.home-page.pulling {
    transition: transform 0.2s ease-out;
}

/* Styles für den Text auf der Home-Seite */
.home-page h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 0;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* Anpassung für eingeklappte Sidebar */
.sidebar.collapsed ~ main .home-page {
    left: 48px; /* Angepasst an neue collapsed Breite */
}

/* Button-Variante der nav-items (Speichern, Synchronisieren) */
button.nav-item {
    background: none;
    border: none;
    cursor: pointer;
    width: calc(100% - 1rem);
    text-align: left;
    font-size: inherit;
    font-family: inherit;
}

button.nav-item:hover:not(:disabled) {
    background: var(--sidebar-hover-bg);
}

button.nav-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Zusätzliche Styles für die aktive Navigation */
.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text) !important;
    font-weight: 500;
}

/* Settings Styles */
.settings-container {
    max-width: none;
    padding: 0;
}

.settings-section {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--card-border);
    box-shadow: none;
}

.settings-section h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: var(--sidebar-color);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-actions {
    margin-top: 1rem;
}

.account-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

.account-actions .btn i {
    font-size: 1.1rem;
}

/* Home-Button Styles */
.home-buttons {
    position: absolute;
    bottom: 3rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 3rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5) 30%);
}

.home-nav-button {
    background-color: rgba(46, 100, 160, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--card-radius);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
}

    .home-nav-button:hover:not(:disabled) {
        background-color: rgba(46, 100, 160, 0.95);
    }

    .home-nav-button:disabled,
    .home-nav-button.disabled {
        opacity: 0.4;
        cursor: not-allowed;
        border-color: rgba(255, 255, 255, 0.3);
    }

/* Color Picker Styles */
.color-settings {
    margin-top: 1rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--sidebar-color);  /* Hier geändert */
    font-weight: 500;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-picker-container input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-value {
    font-family: monospace;
    color: #666;
}

/* Debug Color Styles */
.debug-color {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: monospace;
    z-index: 1000;
}

/* Upload Container Styles */
.upload-container {
    border: 2px dashed #d1d5db;
    border-radius: var(--card-radius);
    padding: 2rem;
    text-align: center;
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

.upload-container.dragging {
    background-color: #e9ecef;
    border-color: #0d6efd;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-content i {
    color: #6c757d;
}

.uploaded-files .card {
    transition: all 0.15s ease;
}

.uploaded-files .card:hover {
    border-color: #d1d5db;
}

.uploaded-files .card-img-top {
    height: 150px;
    object-fit: contain;  /* Änderung von 'cover' zu 'contain' */
    background-color: #f8f9fa;  /* Hintergrundfarbe für den weißen Rand */
    padding: 0.5rem;  /* Optional: Kleiner Innenabstand */
}

/* Hamburger-Button: nur auf Mobile sichtbar */
.mobile-hamburger {
    display: none;
}

/* Desktop/Mobile Toggle-Helfer */
.mobile-only {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hamburger-Button fest oben links */
    .mobile-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0.75rem;
        left: 0.75rem;
        z-index: 1050;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 12px;
        background: var(--sidebar-color, #2e64a0);
        color: #fff;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: background 0.2s ease, transform 0.15s ease;
    }

    .mobile-hamburger i {
        margin: 0;
        top: 0;
        width: auto;
        height: auto;
        line-height: 1;
    }

    .mobile-hamburger:active {
        background: var(--sidebar-hover, #1d4e85);
        transform: scale(0.95);
    }

    /* Sidebar komplett verstecken auf Mobile */
    .sidebar {
        background: var(--sidebar-bg);
        width: 280px !important;
        z-index: 1060;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    /* Sidebar öffnen bei mobile-open */
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar.mobile-open .nav-text {
        display: flex !important;
    }

    /* Desktop-Toggle ausblenden, Mobile-Toggle zeigen */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    /* Main-Content volle Breite */
    main {
        padding-left: 0 !important;
    }

    /* Content oben etwas Platz für Hamburger */
    .content {
        padding-top: 3rem !important;
    }

    .sidebar-toggle-btn {
        opacity: 1;
        margin-left: 0;
    }

    .home-page {
        left: 0 !important;
        padding-left: 1.5rem;
        padding-top: 3.5rem;
    }

    .home-page h1 {
        font-size: 2rem;
    }

    .home-buttons {
        flex-direction: column;
        bottom: 1rem;
        gap: 0.75rem;
        padding: 0 1.5rem;
        position: fixed;
        left: 0;
        right: 0;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.6) 20%);
    }

    .home-nav-button {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    main {
        padding-left: 0 !important;
    }

    .top-row {
        padding-left: 0 !important;
    }

    .home-page {
        padding-left: 1rem;
        padding-top: 3.5rem;
    }

    .home-page h1 {
        font-size: 1.75rem;
    }

    .home-buttons {
        left: 0;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .home-nav-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        border-radius: var(--card-radius);
    }

    .verkehrswert-label {
        font-size: 0.65rem;
    }

    .verkehrswert-value {
        font-size: 0.95rem;
    }

    .settings-section {
        padding: 1.25rem 1rem;
    }

    .settings-section h2 {
        font-size: 1rem;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 360px) {
    .home-page h1 {
        font-size: 1.5rem;
    }

    .welcome-message h2 {
        font-size: 1.1rem;
    }

    .home-nav-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .active-bewertung-info {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }

    .settings-section {
        padding: 1rem 0.75rem;
        border-radius: var(--card-radius);
    }
}

/* Welcome Message Styles */
.welcome-message h1 {
    max-width: 600px;
    margin: 0;
    text-align: left;
    line-height: 1.4;
}

.welcome-message h2 {
    color: white;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 0.5rem 0 0 0;
    font-weight: 300;
}

/* Aktive Bewertung Info */
.active-bewertung-info {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.5rem;
    background: rgba(46, 100, 160, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--btn-radius);
    font-size: 0.95rem;
    margin-top: 1rem;
}

.active-bewertung-info.no-bewertung {
    background: rgba(0, 0, 0, 0.4);
}

/* Online-Status Indikator */
.online-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
}

.online-indicator.online {
    background-color: #4ade80;
    box-shadow: 0 0 4px #4ade80;
}

.online-indicator.offline {
    background-color: #94a3b8;
}

/* Dirty-Indikator (ungespeicherte Aenderungen) */
.dirty-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f59e0b;
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
    animation: dirtyPulse 2s ease-in-out infinite;
}

@keyframes dirtyPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Trennlinien in collapsed Sidebar */
.nav-section-divider {
    display: none;
    margin: 0;
    border-color: var(--sidebar-border);
}

.sidebar.collapsed .nav-section-divider {
    display: block;
    width: 100%;
}

/* Loading Screen Branding */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f9fafb;
    color: var(--sidebar-color, #2e64a0);
    gap: 2rem;
}

.loading-logo-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    z-index: 1;
    animation: logo-pulse 2.5s ease-in-out infinite;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: spin 2s linear infinite;
}

.loading-spinner circle {
    fill: none;
    stroke: url(#spinner-gradient);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 120 480;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    .sidebar-overlay.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1055;
    }
}

/* Dialog-Buttons: klar als klickbar erkennbar */
.btn-dialog-open {
    background-color: #f0f6ff !important;
    border: 1px solid #a0c4e8 !important;
    color: #495057 !important;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-dialog-open:hover, .btn-dialog-open:focus {
    background-color: #e0eeff !important;
    border-color: #2e64a0 !important;
    border-style: solid !important;
    color: #2e64a0 !important;
}

.btn-dialog-open .bi-pencil-square,
.btn-dialog-open .bi-bar-chart {
    color: #2e64a0;
}

/* ==================== Modern Card Styling ==================== */
.card {
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: none;
    overflow: visible;
}

.card-header {
    background: #f9fafb;
    color: var(--sidebar-color);
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.card-header strong {
    color: var(--sidebar-color);
}

.card-body {
    background: #fff;
}

/* Moderne Box-Container (sw-tabcard, ew-box, regional-box, pct-grid) */
.kim-box {
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    background: #fff;
    box-shadow: none;
    overflow: visible;
}

.kim-box-header {
    background: #f9fafb;
    color: var(--sidebar-color);
    border-bottom: 1px solid var(--card-border);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

/* Ergebnis-Felder: Sachwert / Ertragswert Highlight */
.result-highlight {
    background: linear-gradient(135deg, #d4edda, #c3e6cb) !important;
    color: #155724 !important;
    font-weight: 600;
    border-color: #a3d9a5 !important;
}

/* Number-Spinner bei allen Eingabefeldern ausblenden (außer Prozent) */
input[type="number"]:not(.percent-input)::-webkit-inner-spin-button,
input[type="number"]:not(.percent-input)::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:not(.percent-input) {
    -moz-appearance: textfield;
}

/* ==================== Expert-Rows (Overview-Seite): Label + Feld nebeneinander ==================== */
.expert-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.expert-label {
    font-weight: normal;
    font-size: 0.875rem;
}

.expert-label.fw-bold {
    font-weight: 600;
}

.expert-field {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    overflow: visible;
}

.expert-field > * {
    flex-shrink: 0;
}

.expert-field > select,
.expert-field > input,
.expert-field > .input-group,
.expert-field > .d-flex {
    flex: 1 1 0%;
    min-width: 0;
}

.expert-field input.text-end {
    padding-right: 0.25rem;
}

/* ==================== InfoTooltip Portal (JS-gerendert am body) ==================== */
#info-tooltip-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1059;
    background: transparent;
}

#info-tooltip-backdrop.info-tooltip-backdrop-mobile {
    background: rgba(0, 0, 0, 0.3);
}

#info-tooltip-bubble {
    position: fixed;
    z-index: 1060;
    background: #fff;
    border-radius: var(--card-radius);
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    pointer-events: auto;
    box-sizing: border-box;
}

#info-tooltip-bubble.info-tooltip-top {
    animation: tooltipFadeInTop 0.15s ease-out;
}

#info-tooltip-bubble.info-tooltip-top::after {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

#info-tooltip-bubble.info-tooltip-bottom {
    animation: tooltipFadeInBottom 0.15s ease-out;
}

#info-tooltip-bubble.info-tooltip-bottom::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #fff;
}

#info-tooltip-bubble.info-tooltip-center {
    animation: tooltipFadeInCenter 0.15s ease-out;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

#info-tooltip-bubble .info-tooltip-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1a1a1a;
    line-height: 1.3;
}

#info-tooltip-bubble .info-tooltip-text {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.55;
}

#info-tooltip-bubble .info-tooltip-link {
    font-size: 0.8rem;
    color: var(--sidebar-color, #1e4685);
    text-decoration: none;
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

#info-tooltip-bubble .info-tooltip-link:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    #info-tooltip-bubble {
        padding: 0.75rem 0.85rem;
    }
    #info-tooltip-bubble .info-tooltip-title {
        font-size: 0.84rem;
    }
    #info-tooltip-bubble .info-tooltip-text {
        font-size: 0.78rem;
    }
}

@media (min-width: 1200px) {
    #info-tooltip-bubble .info-tooltip-title {
        font-size: 0.95rem;
    }
    #info-tooltip-bubble .info-tooltip-text {
        font-size: 0.88rem;
    }
}

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

@keyframes tooltipFadeInBottom {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tooltipFadeInCenter {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Support-Artikel Markdown-Rendering
   (Global weil MarkupString kein Scoped CSS bekommt)
   ============================================ */
.article-markdown h1 {
    font-size: 1rem !important;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--sidebar-color, #2e64a0);
    line-height: 1.3;
}

.article-markdown h2 {
    font-size: 0.92rem !important;
    font-weight: 600;
    color: #111827;
    margin: 1.5rem 0 0.5rem 0;
    line-height: 1.3;
}

.article-markdown h3 {
    font-size: 0.88rem !important;
    font-weight: 600;
    color: #374151;
    margin: 1.25rem 0 0.4rem 0;
    line-height: 1.3;
}

.article-markdown p {
    margin: 0.5rem 0;
}

.article-markdown strong {
    font-weight: 600;
    color: #111827;
}

.article-markdown a {
    color: var(--sidebar-color, #2e64a0);
    text-decoration: underline;
}

.article-markdown a:hover {
    color: #1e4a7a;
}

.article-markdown ul,
.article-markdown ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.article-markdown li {
    margin: 0.25rem 0;
}

.article-markdown img {
    max-width: 100%;
    height: auto;
    border-radius: var(--card-radius, 8px);
    border: 1px solid var(--card-border, #e5e7eb);
    margin: 0.75rem 0;
    display: block;
}

.article-markdown hr {
    border: none;
    border-top: 1px solid var(--card-border, #e5e7eb);
    margin: 1rem 0;
}

.article-markdown blockquote {
    border-left: 3px solid var(--sidebar-color, #2e64a0);
    padding: 0.4rem 1rem;
    margin: 0.75rem 0;
    background: rgba(46, 100, 160, 0.04);
    color: #4b5563;
    font-size: 0.88rem;
}
