/* Grundgerüst */
:root {
    --brascon-navy: #0f172a;
    --brascon-navy-2: #182235;
    --brascon-ink: #111827;
    --brascon-red: #dc2626;
    --brascon-red-dark: #991b1b;
    --brascon-orange: #f97316;
    --brascon-slate: #475569;
}

html, body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

.page {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- SIDEBAR BASIS --- */
.sidebar {
    background-color: #0f172a;
    width: 260px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

    .sidebar.collapsed {
        width: 72px;
    }

    .sidebar .top-row {
        height: 4.5rem;
        border-bottom: 1px solid #1e293b;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        overflow: hidden;
    }

    .sidebar.collapsed .top-row {
        padding: 0;
        justify-content: center;
    }

    .sidebar .navbar-brand {
        font-size: 1.35rem;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    .sidebar.collapsed .navbar-brand {
        display: none;
    }

.toggle-btn {
    color: #94a3b8;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

    .toggle-btn:hover {
        background-color: #1e293b;
        color: #f8fafc;
    }

/* --- NAVIGATION CONTAINER --- */
.nav-scrollable {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 1.5rem;
}

.nav-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.custom-link {
    color: #94a3b8 !important;
    border-radius: 10px;
    padding: 10px 16px;
    margin: 0 12px 8px 12px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
    font-size: 1.05rem;
    white-space: nowrap;
    background-color: transparent !important;
}

    .custom-link:hover {
        background-color: #1e293b !important;
        color: #f8fafc !important;
    }

    .custom-link.active {
        background-color: #ef4444 !important;
        color: #ffffff !important;
        box-shadow: none !important;
    }

.icon-fixed-width {
    font-size: 1.3rem;
    width: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
}

.sidebar.collapsed .custom-link {
    padding: 0;
    margin: 0 12px 12px 12px;
    justify-content: center;
    height: 48px;
    width: 48px;
    border-radius: 12px;
}

.sidebar.collapsed .icon-fixed-width {
    margin-right: 0;
    width: auto;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.mt-auto {
    margin-top: auto;
}

.logout-link:hover {
    color: #f87171 !important;
}

    .logout-link:hover .icon-fixed-width {
        color: #f87171 !important;
    }

/* --- MAIN CONTENT --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #f8fafc;
}

    main .top-row {
        background-color: #ffffff;
        height: 4.5rem;
        border-bottom: 1px solid #e2e8f0;
    }

.modern-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    background-color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Einheitliche Modul-Koepfe, Tabs und Formularraster */
.app-module-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, auto);
    gap: 1rem;
    align-items: center;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, .18), transparent 34%),
        linear-gradient(135deg, var(--brascon-navy) 0%, var(--brascon-navy-2) 58%, #241124 100%);
    color: #fff;
    padding: 1.25rem;
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .18);
}

.app-module-hero-icon {
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 1.45rem;
    flex: 0 0 auto;
}

.app-module-kicker {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .7);
    font-weight: 900;
    margin-bottom: .25rem;
}

.app-module-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.55rem, 5vw, 2.1rem);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0;
}

.app-module-subtitle {
    color: rgba(255, 255, 255, .72);
    line-height: 1.5;
    max-width: 62rem;
    margin: .45rem 0 0;
}

.app-module-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

.app-module-tabs {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: .35rem;
    max-width: 100%;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 18px;
    padding: .35rem;
    box-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .07);
    backdrop-filter: blur(8px);
}

.app-module-tab {
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.9rem;
    padding: .55rem .9rem;
    font-weight: 850;
    line-height: 1.1;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.app-module-tab.active {
    background: linear-gradient(135deg, var(--brascon-ink), var(--brascon-navy));
    color: #fff;
    box-shadow: 0 .45rem 1rem rgba(15, 23, 42, .2);
}

.app-module-tab small {
    color: inherit;
    opacity: .78;
    font-weight: 700;
}

.app-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.app-field-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-field-grid .form-select,
.app-field-grid .form-control,
.app-smart-select {
    width: 100%;
    min-height: 2.75rem;
}

.app-select-shell {
    display: inline-flex;
    align-items: center;
    flex: 0 1 min(100%, 18rem);
    max-width: min(100%, 18rem);
    min-height: 2.65rem;
    gap: .55rem;
    overflow: visible;
}

.app-select-shell .form-select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.app-select-shell label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.app-switch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.app-switch-tile {
    min-height: 3.1rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    background: #fff;
    padding: .65rem .8rem;
}

.app-switch-tile .form-check-input {
    margin-left: 0;
    flex: 0 0 auto;
}

.app-switch-tile .form-check-label {
    margin: 0;
    min-width: 0;
    font-weight: 700;
    color: #334155;
}

[data-ui-mode="compact"] .expert-only,
[data-ui-mode="compact"] .detail-only,
[data-ui-mode="compact"] .diagnostic-panel,
[data-ui-mode="compact"] .legende-box,
[data-ui-mode="compact"] .disclaimer-box {
    display: none !important;
}

[data-ui-mode="expert"] .compact-only {
    display: none !important;
}

.form-select, .form-control {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

    .form-select:focus, .form-control:focus {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
        border-color: #ef4444 !important;
    }

.btn-qty {
    border-color: #cbd5e1;
    color: #475569;
    background-color: #f8fafc;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-qty:hover {
        background-color: #e2e8f0;
        color: #0f172a;
    }

.auto-save-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1050;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 72px;
        position: fixed;
        height: 100vh;
    }

        .sidebar:not(.collapsed) {
            width: 260px;
            z-index: 1050;
        }

    main {
        margin-left: 72px;
    }

    .auto-save-toast {
        bottom: 20px;
        right: 20px;
    }
}

/* --- KALENDER & TOUCH OPTIMIERUNG --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

.calendar-header {
    text-align: center;
    padding-bottom: 8px;
    font-size: 0.78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.calendar-cell {
    aspect-ratio: 1;
    border-radius: 16px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 .45rem 1rem rgba(15, 23, 42, .06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.25rem;
    color: #334155;
    transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.calendar-cell *,
.schedule-calendar-card,
.schedule-calendar-card * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

    .calendar-cell:hover:not(.empty) {
        box-shadow: 0 .75rem 1.4rem rgba(15, 23, 42, .1);
        transform: translateY(-1px);
    }

    .calendar-cell.empty {
        background-color: transparent;
        border-color: transparent;
        cursor: default;
    }

    .calendar-cell:active:not(.empty) {
        transform: scale(0.92);
    }

.shift-1 {
    background-color: #3b82f6;
    border-color: #2563eb;
    color: white;
}

.shift-2 {
    background-color: #ef4444;
    border-color: #dc2626;
    color: white;
}

.shift-3 {
    background: linear-gradient(135deg, #3b82f6 50%, #ef4444 50%);
    border-color: #1e293b;
    color: white;
}

.legend-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* --- ÜBERSTUNDEN --- */
.ot-item {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

    .ot-item:hover {
        border-color: #cbd5e1;
    }
/* ... dein bisheriger CSS Code ... */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animation-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Optimierung für die Schnellauswahl Buttons */
.btn-white {
    background-color: #ffffff;
    color: #334155;
}

/* --- DARK MODE SURFACE SYSTEM --- */
html[data-bs-theme="dark"] {
    color-scheme: dark;
    --app-dark-bg: #090d16;
    --app-dark-page: #0b101b;
    --app-dark-surface: #121a28;
    --app-dark-surface-2: #172131;
    --app-dark-surface-3: #1d2a3d;
    --app-dark-surface-4: #243247;
    --app-dark-border: rgba(148, 163, 184, .26);
    --app-dark-text: #edf3fb;
    --app-dark-muted: #aebbd0;
    --app-dark-soft: rgba(255, 255, 255, .07);
    --bs-body-bg: var(--app-dark-bg);
    --bs-body-color: var(--app-dark-text);
    --bs-card-bg: var(--app-dark-surface);
    --bs-tertiary-bg: var(--app-dark-surface-2);
    --bs-secondary-bg: var(--app-dark-surface-3);
    --bs-light-rgb: 23, 33, 49;
    --bs-white-rgb: 18, 26, 40;
}

html[data-bs-theme="dark"],
html[data-bs-theme="dark"] body {
    background: var(--app-dark-bg) !important;
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] main,
html[data-bs-theme="dark"] .main-content,
html[data-bs-theme="dark"] .public-main,
html[data-bs-theme="dark"] .content-article,
html[data-bs-theme="dark"] .container,
html[data-bs-theme="dark"] .container-fluid {
    background: var(--app-dark-bg) !important;
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] .bg-white,
html[data-bs-theme="dark"] .bg-light,
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .modern-card,
html[data-bs-theme="dark"] .list-group-item,
html[data-bs-theme="dark"] .accordion-item,
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .dropdown-menu,
html[data-bs-theme="dark"] .app-select-shell,
html[data-bs-theme="dark"] .app-switch-tile,
html[data-bs-theme="dark"] .auto-save-toast,
html[data-bs-theme="dark"] .calendar-cell,
html[data-bs-theme="dark"] .ot-item {
    background-color: var(--app-dark-surface) !important;
    background-image: none !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .card-body,
html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .card-footer,
html[data-bs-theme="dark"] .schedule-config-card,
html[data-bs-theme="dark"] .schedule-config-card .card-body,
html[data-bs-theme="dark"] .calendar-time-box,
html[data-bs-theme="dark"] .custom-shift-item,
html[data-bs-theme="dark"] .template-item,
html[data-bs-theme="dark"] .statistik-filter-card,
html[data-bs-theme="dark"] .statistik-kpi-card,
html[data-bs-theme="dark"] .statistik-section-card,
html[data-bs-theme="dark"] .salary-kpi-card,
html[data-bs-theme="dark"] .salary-chart-card,
html[data-bs-theme="dark"] .besoldung-stage-summary,
html[data-bs-theme="dark"] .besoldung-family-group {
    background: var(--app-dark-surface) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .app-module-tabs,
html[data-bs-theme="dark"] .salary-chart-toggle-bar {
    background: rgba(20, 27, 42, .92) !important;
    border-color: var(--app-dark-border) !important;
    box-shadow: 0 .7rem 1.5rem rgba(0, 0, 0, .28) !important;
}

html[data-bs-theme="dark"] .app-module-tab {
    color: var(--app-dark-muted) !important;
}

html[data-bs-theme="dark"] .app-module-tab.active {
    background: #e5edf8 !important;
    color: #0f172a !important;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] .input-group-text,
html[data-bs-theme="dark"] .btn-white {
    background-color: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .form-control::placeholder {
    color: #7f8da3 !important;
    opacity: 1;
}

html[data-bs-theme="dark"] .text-dark,
html[data-bs-theme="dark"] .fw-bold.text-dark,
html[data-bs-theme="dark"] .form-check-label.text-dark,
html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6 {
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] .text-muted,
html[data-bs-theme="dark"] small,
html[data-bs-theme="dark"] .small {
    color: var(--app-dark-muted) !important;
}

html[data-bs-theme="dark"] .border,
html[data-bs-theme="dark"] .border-top,
html[data-bs-theme="dark"] .border-bottom,
html[data-bs-theme="dark"] .border-start,
html[data-bs-theme="dark"] .border-end {
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--app-dark-surface);
    --bs-table-color: var(--app-dark-text);
    --bs-table-border-color: var(--app-dark-border);
    --bs-table-striped-bg: var(--app-dark-surface-2);
    --bs-table-striped-color: var(--app-dark-text);
    --bs-table-hover-bg: var(--app-dark-surface-3);
    --bs-table-hover-color: var(--app-dark-text);
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .table-light,
html[data-bs-theme="dark"] .table-dark,
html[data-bs-theme="dark"] .table thead,
html[data-bs-theme="dark"] .table th {
    background-color: #202b3d !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .alert:not(.alert-danger):not(.alert-success):not(.alert-warning) {
    background-color: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, .16) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, .3) !important;
}

html[data-bs-theme="dark"] .alert-danger,
html[data-bs-theme="dark"] .bg-danger.bg-opacity-10 {
    background-color: rgba(220, 38, 38, .16) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, .35) !important;
}

html[data-bs-theme="dark"] .alert-success,
html[data-bs-theme="dark"] .bg-success.bg-opacity-10 {
    background-color: rgba(34, 197, 94, .15) !important;
    color: #bbf7d0 !important;
    border-color: rgba(74, 222, 128, .32) !important;
}

html[data-bs-theme="dark"] .app-info-panel {
    background: linear-gradient(180deg, rgba(18, 26, 40, .98), rgba(24, 34, 53, .98)) !important;
    color: var(--app-dark-text) !important;
    border-color: rgba(248, 113, 113, .28) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .35) !important;
}

html[data-bs-theme="dark"] .app-info-caret {
    background: #121a28 !important;
    border-color: rgba(248, 113, 113, .28) !important;
}

html[data-bs-theme="dark"] .app-footer {
    background: #111827 !important;
    color: var(--app-dark-muted) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] .app-footer a {
    color: #dbeafe !important;
}

html[data-bs-theme="dark"] .progress,
html[data-bs-theme="dark"] .salary-chart-plot,
html[data-bs-theme="dark"] .salary-chart-area,
html[data-bs-theme="dark"] .chart-shell,
html[data-bs-theme="dark"] .vacation-day-card {
    background: var(--app-dark-surface-2) !important;
    border-color: var(--app-dark-border) !important;
}

/* Critical fallback styles loaded before Blazor so iOS/iPad never sees an unstyled login shell. */
.login-page-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    background: #050811;
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
}

.login-inner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-page-container .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.login-page-container .col-12 {
    width: 100%;
}

@media (min-width: 992px) {
    .login-page-container .col-lg-6 {
        width: 50%;
        flex: 0 0 auto;
    }

    .login-page-container .col-xl-5 {
        width: 41.666667%;
        flex: 0 0 auto;
    }
}

.login-page-container .presentation-column,
.login-card-wrapper {
    position: relative;
    z-index: 1;
}

.login-card-wrapper {
    width: 100%;
    background: #0d1321;
    border: 1.5px solid rgba(255,255,255,.12) !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,.45) !important;
}

.text-gradient-fire {
    background: linear-gradient(135deg, #ff4545 0%, #ff8c3b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nrw-badge-large {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 20px;
    background: rgba(239, 68, 68, .15);
    border: 1px solid rgba(239, 68, 68, .35);
    color: #ff6b6b;
    font-weight: 800;
}

.custom-pills {
    display: flex;
    list-style: none;
    padding: .35rem !important;
    margin-left: 0;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
}

.custom-pills .nav-item {
    flex: 1 1 0;
}

.custom-pills .nav-link {
    display: block;
    width: 100%;
    color: rgba(255,255,255,.75);
    border-radius: 8px;
    background: transparent;
}

.custom-pills .nav-link.active {
    background: #fff !important;
    color: #050811 !important;
}

.dark-input-group {
    display: flex;
    align-items: stretch;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px;
    overflow: hidden;
}

.dark-input-group .input-group-text {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 0;
    padding-left: 15px;
}

.dark-input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #fff !important;
    padding: 14px 15px;
}

.btn-fire-gradient {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    border: 0 !important;
    color: #fff !important;
}

html[data-bs-theme="light"] .login-page-container {
    background: #f8fafc;
    color: #0f172a;
}

html[data-bs-theme="light"] .login-card-wrapper {
    background: #fff;
    border-color: rgba(15,23,42,.12) !important;
    box-shadow: 0 15px 35px rgba(15,23,42,.08) !important;
}

html[data-bs-theme="light"] .login-card-wrapper .text-white,
html[data-bs-theme="light"] .presentation-column h1,
html[data-bs-theme="light"] .presentation-column h5 {
    color: #0f172a !important;
}

html[data-bs-theme="light"] .text-white-75,
html[data-bs-theme="light"] .presentation-column .lead {
    color: #334155 !important;
}

html[data-bs-theme="light"] .text-white-50,
html[data-bs-theme="light"] .presentation-column p {
    color: #64748b !important;
}

html[data-bs-theme="light"] .custom-pills {
    background: rgba(15,23,42,.06);
    border-color: rgba(15,23,42,.1);
}

html[data-bs-theme="light"] .custom-pills .nav-link {
    color: #475569;
}

html[data-bs-theme="light"] .custom-pills .nav-link.active {
    background: #0f172a !important;
    color: #fff !important;
}

html[data-bs-theme="light"] .dark-input-group {
    background: #fff;
    border-color: #cbd5e1;
}

html[data-bs-theme="light"] .dark-input-group .form-control {
    color: #0f172a !important;
}

@media (prefers-color-scheme: light) {
    .login-page-container {
        background: #f8fafc;
        color: #0f172a;
    }

    .login-card-wrapper {
        background: #fff;
        border-color: rgba(15,23,42,.12) !important;
        box-shadow: 0 15px 35px rgba(15,23,42,.08) !important;
    }

    .login-card-wrapper .text-white,
    .presentation-column h1,
    .presentation-column h5 {
        color: #0f172a !important;
    }

    .text-white-75,
    .presentation-column .lead {
        color: #334155 !important;
    }

    .text-white-50,
    .presentation-column p {
        color: #64748b !important;
    }

    .custom-pills {
        background: rgba(15,23,42,.06);
        border-color: rgba(15,23,42,.1);
    }

    .custom-pills .nav-link {
        color: #475569;
    }

    .custom-pills .nav-link.active {
        background: #0f172a !important;
        color: #fff !important;
    }

    .dark-input-group {
        background: #fff;
        border-color: #cbd5e1;
    }

    .dark-input-group .form-control {
        color: #0f172a !important;
    }
}

/* Final dark-mode hardening for page-local styles and Bootstrap utility leftovers. */
html[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] #app,
html[data-bs-theme="dark"] .page,
html[data-bs-theme="dark"] main,
html[data-bs-theme="dark"] .content {
    background:
        radial-gradient(circle at top right, rgba(220, 38, 38, .08), transparent 30rem),
        var(--app-dark-bg) !important;
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] body .bg-white,
html[data-bs-theme="dark"] body .bg-light,
html[data-bs-theme="dark"] body .bg-light-subtle,
html[data-bs-theme="dark"] body .text-bg-light,
html[data-bs-theme="dark"] body .modern-card,
html[data-bs-theme="dark"] body .card,
html[data-bs-theme="dark"] body .version-summary,
html[data-bs-theme="dark"] body .besoldung-compare-toggle,
html[data-bs-theme="dark"] body .besoldung-stage-summary,
html[data-bs-theme="dark"] body .besoldung-family-group,
html[data-bs-theme="dark"] body .salary-kpi-card,
html[data-bs-theme="dark"] body .salary-chart-card,
html[data-bs-theme="dark"] body .salary-chart-section,
html[data-bs-theme="dark"] body .statistik-kpi-card,
html[data-bs-theme="dark"] body .statistik-section-card,
html[data-bs-theme="dark"] body .statistik-filter-card,
html[data-bs-theme="dark"] body .schedule-config-card,
html[data-bs-theme="dark"] body .schedule-calendar-card,
html[data-bs-theme="dark"] body .schedule-overtime-card,
html[data-bs-theme="dark"] body .calendar-time-box,
html[data-bs-theme="dark"] body .custom-shift-item,
html[data-bs-theme="dark"] body .template-item,
html[data-bs-theme="dark"] body .ot-item,
html[data-bs-theme="dark"] body .login-card-wrapper,
html[data-bs-theme="dark"] body .modal-content,
html[data-bs-theme="dark"] body .dropdown-menu,
html[data-bs-theme="dark"] body .list-group-item,
html[data-bs-theme="dark"] body .accordion-item,
html[data-bs-theme="dark"] body .accordion-button {
    background: var(--app-dark-surface) !important;
    background-image: none !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
    box-shadow: 0 .8rem 1.8rem rgba(0, 0, 0, .28) !important;
}

html[data-bs-theme="dark"] body .card-header,
html[data-bs-theme="dark"] body .card-footer,
html[data-bs-theme="dark"] body .table-light,
html[data-bs-theme="dark"] body .table-light > *,
html[data-bs-theme="dark"] body .input-group-text,
html[data-bs-theme="dark"] body .btn-qty,
html[data-bs-theme="dark"] body .app-select-shell,
html[data-bs-theme="dark"] body .app-switch-tile,
html[data-bs-theme="dark"] body .app-module-tabs,
html[data-bs-theme="dark"] body .salary-chart-toggle-bar,
html[data-bs-theme="dark"] body .salary-chart-legend,
html[data-bs-theme="dark"] body .salary-filter-chip,
html[data-bs-theme="dark"] body .chart-shell,
html[data-bs-theme="dark"] body .chart-area,
html[data-bs-theme="dark"] body .salary-chart-plot,
html[data-bs-theme="dark"] body .vacation-day-card {
    background: var(--app-dark-surface-2) !important;
    background-image: none !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .besoldung-retro-card,
html[data-bs-theme="dark"] body .alert-success,
html[data-bs-theme="dark"] body .bg-success.bg-opacity-10 {
    background: linear-gradient(135deg, rgba(22, 101, 52, .28), rgba(18, 26, 40, .98)) !important;
    color: #d1fae5 !important;
    border-color: rgba(74, 222, 128, .34) !important;
}

html[data-bs-theme="dark"] body .alert-danger,
html[data-bs-theme="dark"] body .bg-danger.bg-opacity-10 {
    background: linear-gradient(135deg, rgba(127, 29, 29, .32), rgba(18, 26, 40, .98)) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, .36) !important;
}

html[data-bs-theme="dark"] body .alert-warning,
html[data-bs-theme="dark"] body .bg-warning,
html[data-bs-theme="dark"] body .bg-warning-subtle {
    background: linear-gradient(135deg, rgba(113, 63, 18, .28), rgba(18, 26, 40, .98)) !important;
    color: #fde68a !important;
    border-color: rgba(251, 191, 36, .34) !important;
}

html[data-bs-theme="dark"] body .form-control,
html[data-bs-theme="dark"] body .form-select,
html[data-bs-theme="dark"] body textarea,
html[data-bs-theme="dark"] body input[type="date"],
html[data-bs-theme="dark"] body input[type="time"],
html[data-bs-theme="dark"] body input[type="number"],
html[data-bs-theme="dark"] body input[type="text"],
html[data-bs-theme="dark"] body input[type="email"],
html[data-bs-theme="dark"] body input[type="password"] {
    background-color: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03) !important;
}

html[data-bs-theme="dark"] body .table {
    --bs-table-bg: var(--app-dark-surface);
    --bs-table-color: var(--app-dark-text);
    --bs-table-border-color: var(--app-dark-border);
    --bs-table-striped-bg: var(--app-dark-surface-2);
    --bs-table-striped-color: var(--app-dark-text);
    --bs-table-hover-bg: var(--app-dark-surface-3);
    --bs-table-hover-color: var(--app-dark-text);
    background: var(--app-dark-surface) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .table > :not(caption) > * > *,
html[data-bs-theme="dark"] body .table tbody,
html[data-bs-theme="dark"] body .table td,
html[data-bs-theme="dark"] body .table th {
    background-color: transparent !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .table thead,
html[data-bs-theme="dark"] body .table thead th,
html[data-bs-theme="dark"] body .table-dark,
html[data-bs-theme="dark"] body .table-dark > * {
    background-color: var(--app-dark-surface-4) !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, .32) !important;
}

html[data-bs-theme="dark"] body .text-dark,
html[data-bs-theme="dark"] body .text-body,
html[data-bs-theme="dark"] body .text-black,
html[data-bs-theme="dark"] body .form-check-label,
html[data-bs-theme="dark"] body label,
html[data-bs-theme="dark"] body .dropdown-item,
html[data-bs-theme="dark"] body .accordion-button,
html[data-bs-theme="dark"] body .btn-outline-dark {
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] body .text-muted,
html[data-bs-theme="dark"] body .text-secondary,
html[data-bs-theme="dark"] body .small,
html[data-bs-theme="dark"] body small {
    color: var(--app-dark-muted) !important;
}

html[data-bs-theme="dark"] body .btn-outline-dark,
html[data-bs-theme="dark"] body .btn-outline-secondary,
html[data-bs-theme="dark"] body .btn-white {
    background: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .btn-outline-dark:hover,
html[data-bs-theme="dark"] body .btn-outline-secondary:hover,
html[data-bs-theme="dark"] body .btn-white:hover {
    background: var(--app-dark-surface-3) !important;
    color: #fff !important;
}

html[data-bs-theme="dark"] body .calendar-cell:not(.shift-1):not(.shift-2):not(.shift-3):not(.vacation-day),
html[data-bs-theme="dark"] body .calendar-cell.empty {
    background-color: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .app-module-tab.active {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: #fff !important;
    box-shadow: 0 .55rem 1.2rem rgba(220, 38, 38, .24) !important;
}

html[data-bs-theme="dark"] body .app-module-tab:not(.active) {
    color: var(--app-dark-muted) !important;
}

html[data-bs-theme="dark"] body .login-page-container {
    background:
        radial-gradient(circle at top left, rgba(239, 68, 68, .12), transparent 24rem),
        #050811 !important;
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] body .custom-pills .nav-link.active {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: #fff !important;
}

html[data-bs-theme="dark"] body svg text,
html[data-bs-theme="dark"] body .chart-axis-label,
html[data-bs-theme="dark"] body .chart-label {
    fill: var(--app-dark-muted) !important;
    color: var(--app-dark-muted) !important;
}

/* Dark mode: catch page-local light panels and utility leftovers without turning the UI flat black. */
html[data-bs-theme="dark"] body .btn-light,
html[data-bs-theme="dark"] body .btn-outline-light,
html[data-bs-theme="dark"] body .badge.bg-light,
html[data-bs-theme="dark"] body .bg-white-subtle,
html[data-bs-theme="dark"] body .border-light,
html[data-bs-theme="dark"] body .border-light-subtle,
html[data-bs-theme="dark"] body .input-group,
html[data-bs-theme="dark"] body .custom-editor,
html[data-bs-theme="dark"] body .security-section,
html[data-bs-theme="dark"] body .password-rules,
html[data-bs-theme="dark"] body .password-rule,
html[data-bs-theme="dark"] body .info-panel,
html[data-bs-theme="dark"] body .app-info-panel,
html[data-bs-theme="dark"] body .stundenkonto-empty,
html[data-bs-theme="dark"] body .stundenkonto-mobile-card,
html[data-bs-theme="dark"] body .stundenkonto-value-pill,
html[data-bs-theme="dark"] body .abrechnung-mobile-card,
html[data-bs-theme="dark"] body .abrechnung-value-box,
html[data-bs-theme="dark"] body .vacation-compact-summary,
html[data-bs-theme="dark"] body .vacation-hero-stat,
html[data-bs-theme="dark"] body .vacation-mini-stat,
html[data-bs-theme="dark"] body .vacation-balance-grid,
html[data-bs-theme="dark"] body .vacation-stat-card,
html[data-bs-theme="dark"] body .vacation-month-strip,
html[data-bs-theme="dark"] body .vacation-month-tile,
html[data-bs-theme="dark"] body .vacation-date-chip,
html[data-bs-theme="dark"] body .version-summary,
html[data-bs-theme="dark"] body .legal-card {
    background: var(--app-dark-surface-2) !important;
    background-image: none !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
    box-shadow: 0 .45rem 1.25rem rgba(0, 0, 0, .24) !important;
}

html[data-bs-theme="dark"] body .vacation-date-chip.timeoff,
html[data-bs-theme="dark"] body .vacation-month-tile.has-days {
    background: linear-gradient(135deg, rgba(15, 118, 110, .28), var(--app-dark-surface-2)) !important;
    color: #ccfbf1 !important;
    border-color: rgba(45, 212, 191, .28) !important;
}

html[data-bs-theme="dark"] body .vacation-stat-icon,
html[data-bs-theme="dark"] body .stat-card-icon.success,
html[data-bs-theme="dark"] body .vacation-month-bar,
html[data-bs-theme="dark"] body .vacation-month-tile.has-days .vacation-month-bar {
    background: linear-gradient(180deg, #22c55e, #047857) !important;
    color: #fff !important;
}

html[data-bs-theme="dark"] body .vacation-stat-number,
html[data-bs-theme="dark"] body .vacation-balance-number,
html[data-bs-theme="dark"] body .vacation-mini-stat strong,
html[data-bs-theme="dark"] body .vacation-date-chip small,
html[data-bs-theme="dark"] body .vacation-date-chip.timeoff small {
    color: #bbf7d0 !important;
}

html[data-bs-theme="dark"] body .statistik-subtabs,
html[data-bs-theme="dark"] body .statistik-pill-group,
html[data-bs-theme="dark"] body .custom-pills {
    background: rgba(18, 26, 40, .94) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .statistik-subtab.active,
html[data-bs-theme="dark"] body .btn-dark {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: #fff !important;
    border-color: rgba(248, 113, 113, .36) !important;
}

html[data-bs-theme="dark"] body select option {
    background: var(--app-dark-surface-2);
    color: var(--app-dark-text);
}

    .btn-white:hover {
        background-color: #f1f5f9;
    }

/* --- TOUCH-FREUNDLICHE INFO-HINWEISE --- */
.app-info-hint {
    display: inline-flex;
    align-items: center;
    position: relative;
    max-width: 100%;
    vertical-align: super;
    line-height: 1;
    margin-left: 0.28em;
    z-index: auto;
}

.app-info-toggle {
    border: none;
    background: transparent;
    color: var(--brascon-slate);
    width: 0.95em;
    height: 0.95em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 0.58em;
    box-shadow: none;
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
    touch-action: manipulation;
}

.app-info-toggle:hover,
.app-info-toggle:focus,
.app-info-toggle.active {
    color: var(--brascon-red);
    background: transparent !important;
    outline: none;
}

.app-info-toggle.text-light,
.app-info-toggle.text-white {
    color: rgba(255, 255, 255, .75) !important;
    background: transparent;
}

.app-info-toggle.text-light:hover,
.app-info-toggle.text-light:focus,
.app-info-toggle.text-light.active,
.app-info-toggle.text-white:hover,
.app-info-toggle.text-white:focus,
.app-info-toggle.text-white.active {
    color: #fff !important;
    background: transparent !important;
}

.app-info-toggle:active {
    transform: scale(.92);
}

.app-info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    display: block;
    width: min(42rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    max-height: min(34rem, calc(100dvh - 2rem));
    overflow-y: auto;
    border: 1px solid rgba(220, 38, 38, .28);
    background: #fff;
    color: #1f2937;
    border-radius: 1.1rem;
    padding: 1.05rem 2.75rem 1.05rem 1.15rem;
    font-size: .92rem;
    line-height: 1.5;
    font-weight: 500;
    box-shadow: 0 1.5rem 4rem rgba(15, 23, 42, .28);
    animation: appInfoIn .18s cubic-bezier(.2, .8, .2, 1);
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
    z-index: 2147483000;
    backdrop-filter: blur(12px);
}

.app-info-close {
    position: absolute;
    top: .55rem;
    right: .55rem;
    width: 1.8rem;
    height: 1.8rem;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, .16);
    color: inherit;
    line-height: 1;
}

.app-info-close:hover,
.app-info-close:focus {
    background: rgba(220, 38, 38, .14);
    color: var(--brascon-red);
    outline: none;
}

.app-info-panel::before {
    content: none;
}

.app-info-caret {
    display: none;
}

.app-info-panel.block {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(42rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    margin-top: 0;
}

.app-info-panel.dark {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: rgba(248, 113, 113, .48) !important;
    box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, .42) !important;
}

html[data-bs-theme="dark"] .app-info-panel:not(.dark),
html[data-bs-theme="dark"] body .app-info-panel:not(.dark) {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: rgba(248, 113, 113, .48) !important;
    box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, .42) !important;
}

.modern-card:has(.app-info-panel),
.app-module-hero:has(.app-info-panel),
.schedule-config-card:has(.app-info-panel),
.statistik-section-card:has(.app-info-panel),
.salary-chart-card:has(.app-info-panel) {
    overflow: visible !important;
    z-index: 2147482000;
}

.app-info-panel.dark .app-info-caret {
    background: #0f172a;
    border-color: rgba(248, 113, 113, .28);
}

@keyframes appInfoIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(.98); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- MOBILE VERDICHTUNG FUER ALLE MODULE --- */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.nav-pills {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}

.nav-pills .nav-item,
.nav-pills .btn {
    flex: 0 0 auto;
}

.amount,
.money-value {
    white-space: nowrap;
}

@media (max-width: 768px) {
    h1.display-4 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.45rem;
    }

    h4,
    .h4 {
        font-size: 1.15rem;
    }

    .card-body.p-4 {
        padding: 1rem !important;
    }

    .btn-group {
        display: flex;
        overflow-x: visible;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        flex-wrap: wrap;
    }

    .btn-group > .btn {
        flex: 1 1 auto;
        white-space: normal;
        min-width: min(12rem, 100%);
    }

    .app-info-hint {
        align-items: center;
    }

    .app-info-panel {
        min-width: 0;
        max-width: calc(100vw - 2rem);
    }
}

@media (max-width: 991.98px) {
    .app-module-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .app-module-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: stretch;
    }

    .app-module-actions > * {
        flex: 1 1 auto;
    }

    .app-select-shell,
    .app-select-shell .form-select {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .app-module-hero {
        grid-template-columns: 1fr;
        border-radius: 18px;
        padding: 1rem;
    }

    .app-module-tabs {
        width: 100%;
        grid-auto-flow: row;
        grid-template-columns: 1fr;
    }

    .app-module-tab {
        white-space: normal;
    }

    .app-field-grid,
    .app-field-grid.three,
    .app-switch-grid {
        grid-template-columns: 1fr;
    }

    .app-select-shell,
    .app-select-shell .form-select {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    main {
        margin-left: 64px;
    }

    .sidebar {
        width: 64px;
    }

    .container,
    .container-fluid {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }

    .modern-card {
        border-radius: 12px;
    }

    .btn:not(.rounded-circle),
    label.btn:not(.rounded-circle) {
        white-space: normal;
    }

    .calendar-grid {
        gap: 6px;
    }

    .calendar-cell {
        border-radius: 10px;
        font-size: 1rem;
        border-width: 1px;
    }

    .calendar-header {
        font-size: .72rem;
    }

    .app-info-panel,
    .app-info-panel.block {
        display: block;
        left: .75rem;
        right: .75rem;
        width: auto;
        min-width: 0;
        max-width: none;
        margin-top: 0;
    }

    .table-responsive {
        overflow-x: hidden !important;
        max-width: 100%;
    }

    .table-responsive > .table,
    .table-responsive > table,
    table.table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto;
        font-size: .72rem !important;
    }

    .table th,
    .table td {
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: normal;
        padding: .45rem .35rem !important;
        max-width: 34vw;
    }

    .table.text-nowrap,
    .text-nowrap {
        white-space: normal !important;
    }

    .nav-pills {
        overflow-x: visible;
        flex-wrap: wrap;
        width: 100%;
    }

    .nav-pills .nav-item,
    .nav-pills .btn,
    .nav-pills .nav-link {
        flex: 1 1 auto;
        min-width: min(11rem, 100%);
        white-space: normal;
        text-align: center;
    }

    .d-flex.justify-content-between {
        min-width: 0;
    }

    .d-flex.justify-content-between > * {
        min-width: 0;
    }
}

.app-module-hero .app-select-shell,
html[data-bs-theme="dark"] .app-module-hero .app-select-shell,
html[data-bs-theme="light"] .app-module-hero .app-select-shell {
    background: rgba(255, 255, 255, .1) !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    padding: .55rem .65rem !important;
    color: #fff !important;
    min-width: min(100%, 13rem);
    max-width: min(100%, 17rem);
}

.app-module-hero .app-select-shell label,
html[data-bs-theme="dark"] .app-module-hero .app-select-shell label,
html[data-bs-theme="light"] .app-module-hero .app-select-shell label {
    color: rgba(255, 255, 255, .78) !important;
    font-size: .76rem;
    letter-spacing: .04em;
}

.app-module-hero .app-select-shell .form-select,
.app-module-hero .app-select-shell .app-smart-select,
html[data-bs-theme="dark"] .app-module-hero .app-select-shell .form-select,
html[data-bs-theme="dark"] .app-module-hero .app-select-shell .app-smart-select,
html[data-bs-theme="light"] .app-module-hero .app-select-shell .form-select,
html[data-bs-theme="light"] .app-module-hero .app-select-shell .app-smart-select {
    background-color: rgba(255, 255, 255, .14) !important;
    border: 0 !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-weight: 900;
    min-height: 2.45rem;
}

.app-module-hero .app-select-shell .form-select option,
.app-module-hero .app-select-shell .app-smart-select option {
    color: #111827;
    background: #fff;
}

/* --- MOBILE TOOLTIP BOTTOM SHEET SYSTEM --- */
@media (max-width: 767.98px) {
    .app-info-panel,
    .app-info-panel.block {
        left: 1rem !important;
        right: 1rem !important;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        transform: none !important;
        position: fixed !important;
        width: auto !important;
        max-width: none !important;
        max-height: min(70dvh, 34rem) !important;
        overflow-y: auto !important;
        border-radius: 1rem !important;
        padding: 1rem 2.75rem 1rem 1rem !important;
        font-size: .95rem !important;
        line-height: 1.45 !important;
        box-shadow: 0 -0.5rem 2.5rem rgba(15, 23, 42, .32) !important;
        animation: appInfoMobileIn .24s cubic-bezier(.16, 1, .3, 1) !important;
    }
}

@keyframes appInfoMobileIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-info-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, .08);
    backdrop-filter: blur(1px);
    z-index: 2147482990;
    cursor: default;
}

/* --- FINAL DARK CONTRAST PASS ---
   Central dark-mode layer with higher specificity than page-local utility styles. */
html[data-bs-theme="dark"] {
    --app-dark-bg: #080c14;
    --app-dark-page: #0b111d;
    --app-dark-surface: #111827;
    --app-dark-surface-2: #172033;
    --app-dark-surface-3: #1e293b;
    --app-dark-surface-4: #263449;
    --app-dark-raised: #151e2e;
    --app-dark-border: rgba(148, 163, 184, .28);
    --app-dark-border-strong: rgba(203, 213, 225, .38);
    --app-dark-text: #f1f5f9;
    --app-dark-muted: #b6c2d4;
    --app-dark-subtle: #8ea0b8;
    --app-dark-accent-soft: rgba(220, 38, 38, .18);
    --app-dark-focus: rgba(96, 165, 250, .55);
    --bs-body-bg: var(--app-dark-bg);
    --bs-body-color: var(--app-dark-text);
    --bs-card-bg: var(--app-dark-surface);
    --bs-border-color: var(--app-dark-border);
    --bs-tertiary-bg: var(--app-dark-surface-2);
    --bs-secondary-bg: var(--app-dark-surface-3);
}

html[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] body main,
html[data-bs-theme="dark"] body .main-content,
html[data-bs-theme="dark"] body .public-main,
html[data-bs-theme="dark"] body .content-article,
html[data-bs-theme="dark"] body .container,
html[data-bs-theme="dark"] body .container-fluid {
    background:
        radial-gradient(circle at top right, rgba(220, 38, 38, .08), transparent 28rem),
        var(--app-dark-bg) !important;
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] body .top-header-bar,
html[data-bs-theme="dark"] body .app-footer,
html[data-bs-theme="dark"] body .cookie-banner {
    background: rgba(13, 19, 31, .96) !important;
    color: var(--app-dark-muted) !important;
    border-color: var(--app-dark-border) !important;
    box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .24) !important;
}

html[data-bs-theme="dark"] body .bg-white,
html[data-bs-theme="dark"] body .bg-light,
html[data-bs-theme="dark"] body .card,
html[data-bs-theme="dark"] body .modern-card,
html[data-bs-theme="dark"] body .card-body,
html[data-bs-theme="dark"] body .card-header,
html[data-bs-theme="dark"] body .card-footer,
html[data-bs-theme="dark"] body .list-group-item,
html[data-bs-theme="dark"] body .accordion-item,
html[data-bs-theme="dark"] body .accordion-button,
html[data-bs-theme="dark"] body .modal-content,
html[data-bs-theme="dark"] body .dropdown-menu,
html[data-bs-theme="dark"] body .app-select-shell,
html[data-bs-theme="dark"] body .app-switch-tile,
html[data-bs-theme="dark"] body .schedule-config-card,
html[data-bs-theme="dark"] body .calendar-time-box,
html[data-bs-theme="dark"] body .custom-shift-item,
html[data-bs-theme="dark"] body .template-item,
html[data-bs-theme="dark"] body .schedule-monthbar,
html[data-bs-theme="dark"] body .schedule-calendar-card,
html[data-bs-theme="dark"] body .schedule-legend,
html[data-bs-theme="dark"] body .schedule-sick-panel,
html[data-bs-theme="dark"] body .schedule-overtime-card,
html[data-bs-theme="dark"] body .calendar-feed-dialog,
html[data-bs-theme="dark"] body .schedule-export-dropdown,
html[data-bs-theme="dark"] body .statistik-filter-card,
html[data-bs-theme="dark"] body .statistik-kpi-card,
html[data-bs-theme="dark"] body .statistik-section-card,
html[data-bs-theme="dark"] body .salary-kpi-card,
html[data-bs-theme="dark"] body .salary-chart-card,
html[data-bs-theme="dark"] body .salary-chart-shell,
html[data-bs-theme="dark"] body .salary-toggle-grid,
html[data-bs-theme="dark"] body .salary-toggle-tile,
html[data-bs-theme="dark"] body .besoldung-card,
html[data-bs-theme="dark"] body .besoldung-stage-summary,
html[data-bs-theme="dark"] body .besoldung-family-group,
html[data-bs-theme="dark"] body .besoldung-compact-summary,
html[data-bs-theme="dark"] body .legal-card,
html[data-bs-theme="dark"] body .version-summary,
html[data-bs-theme="dark"] body .security-section,
html[data-bs-theme="dark"] body .password-rules,
html[data-bs-theme="dark"] body .password-rule,
html[data-bs-theme="dark"] body .stundenkonto-mobile-card,
html[data-bs-theme="dark"] body .abrechnung-mobile-card,
html[data-bs-theme="dark"] body .vacation-stat-card,
html[data-bs-theme="dark"] body .vacation-mini-stat,
html[data-bs-theme="dark"] body .vacation-balance-grid,
html[data-bs-theme="dark"] body .vacation-month-strip,
html[data-bs-theme="dark"] body .vacation-month-tile,
html[data-bs-theme="dark"] body .vacation-date-chip {
    background-color: var(--app-dark-surface) !important;
    background-image: none !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
    box-shadow: 0 .85rem 2.2rem rgba(0, 0, 0, .22) !important;
}

html[data-bs-theme="dark"] body .bg-light,
html[data-bs-theme="dark"] body .card-header,
html[data-bs-theme="dark"] body .card-footer,
html[data-bs-theme="dark"] body .input-group,
html[data-bs-theme="dark"] body .input-group-text,
html[data-bs-theme="dark"] body .form-control,
html[data-bs-theme="dark"] body .form-select,
html[data-bs-theme="dark"] body textarea,
html[data-bs-theme="dark"] body .custom-editor,
html[data-bs-theme="dark"] body .schedule-legend > div,
html[data-bs-theme="dark"] body .schedule-month-trigger:hover,
html[data-bs-theme="dark"] body .schedule-sick-hint,
html[data-bs-theme="dark"] body .calendar-cell:not(.shift-1):not(.shift-2):not(.shift-3):not(.vacation-day),
html[data-bs-theme="dark"] body .calendar-cell.empty,
html[data-bs-theme="dark"] body .salary-chart-area,
html[data-bs-theme="dark"] body .salary-chart-plot,
html[data-bs-theme="dark"] body .chart-shell,
html[data-bs-theme="dark"] body .progress,
html[data-bs-theme="dark"] body .stundenkonto-empty,
html[data-bs-theme="dark"] body .abrechnung-value-box,
html[data-bs-theme="dark"] body .stundenkonto-value-pill,
html[data-bs-theme="dark"] body .vacation-compact-summary,
html[data-bs-theme="dark"] body .vacation-day-card {
    background-color: var(--app-dark-surface-2) !important;
    background-image: none !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .table,
html[data-bs-theme="dark"] body table {
    --bs-table-bg: var(--app-dark-surface);
    --bs-table-color: var(--app-dark-text);
    --bs-table-border-color: var(--app-dark-border);
    --bs-table-striped-bg: var(--app-dark-surface-2);
    --bs-table-striped-color: var(--app-dark-text);
    --bs-table-hover-bg: var(--app-dark-surface-3);
    --bs-table-hover-color: #fff;
    background-color: var(--app-dark-surface) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .table thead,
html[data-bs-theme="dark"] body .table-light,
html[data-bs-theme="dark"] body .table th,
html[data-bs-theme="dark"] body table th {
    background-color: var(--app-dark-surface-3) !important;
    color: #e5edf8 !important;
    border-color: var(--app-dark-border-strong) !important;
}

html[data-bs-theme="dark"] body .table td,
html[data-bs-theme="dark"] body table td {
    background-color: transparent !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .text-dark,
html[data-bs-theme="dark"] body .fw-bold.text-dark,
html[data-bs-theme="dark"] body .text-body,
html[data-bs-theme="dark"] body .form-check-label.text-dark,
html[data-bs-theme="dark"] body .statistik-kpi-value,
html[data-bs-theme="dark"] body .salary-kpi-value,
html[data-bs-theme="dark"] body .abrechnung-card-title,
html[data-bs-theme="dark"] body .stundenkonto-card-note,
html[data-bs-theme="dark"] body .schedule-export-dropdown .dropdown-item,
html[data-bs-theme="dark"] body h1,
html[data-bs-theme="dark"] body h2,
html[data-bs-theme="dark"] body h3,
html[data-bs-theme="dark"] body h4,
html[data-bs-theme="dark"] body h5,
html[data-bs-theme="dark"] body h6,
html[data-bs-theme="dark"] body strong {
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] body .text-muted,
html[data-bs-theme="dark"] body .text-secondary,
html[data-bs-theme="dark"] body .small,
html[data-bs-theme="dark"] body small,
html[data-bs-theme="dark"] body label,
html[data-bs-theme="dark"] body .form-label,
html[data-bs-theme="dark"] body .statistik-kpi-label,
html[data-bs-theme="dark"] body .statistik-kpi-meta,
html[data-bs-theme="dark"] body .salary-kpi-label,
html[data-bs-theme="dark"] body .salary-kpi-meta,
html[data-bs-theme="dark"] body .salary-card-kicker,
html[data-bs-theme="dark"] body .app-module-kicker {
    color: var(--app-dark-muted) !important;
}

html[data-bs-theme="dark"] body .form-control::placeholder,
html[data-bs-theme="dark"] body textarea::placeholder {
    color: var(--app-dark-subtle) !important;
    opacity: 1;
}

html[data-bs-theme="dark"] body .form-control:focus,
html[data-bs-theme="dark"] body .form-select:focus,
html[data-bs-theme="dark"] body textarea:focus {
    background-color: var(--app-dark-surface-3) !important;
    color: #fff !important;
    border-color: rgba(96, 165, 250, .72) !important;
    box-shadow: 0 0 0 .22rem rgba(96, 165, 250, .18) !important;
}

html[data-bs-theme="dark"] body .btn-outline-dark,
html[data-bs-theme="dark"] body .btn-outline-secondary,
html[data-bs-theme="dark"] body .btn-light,
html[data-bs-theme="dark"] body .btn-white {
    background-color: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border-strong) !important;
}

html[data-bs-theme="dark"] body .btn-outline-dark:hover,
html[data-bs-theme="dark"] body .btn-outline-secondary:hover,
html[data-bs-theme="dark"] body .btn-light:hover,
html[data-bs-theme="dark"] body .btn-white:hover {
    background-color: var(--app-dark-surface-4) !important;
    color: #fff !important;
}

html[data-bs-theme="dark"] body .badge.bg-light,
html[data-bs-theme="dark"] body .badge.bg-white,
html[data-bs-theme="dark"] body .badge.text-dark,
html[data-bs-theme="dark"] body .bg-dark.bg-opacity-10,
html[data-bs-theme="dark"] body .stat-card-icon,
html[data-bs-theme="dark"] body .salary-status-pill,
html[data-bs-theme="dark"] body .color-picker-toggle {
    background-color: var(--app-dark-surface-3) !important;
    color: var(--app-dark-text) !important;
    border: 1px solid var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .stat-card-icon.success {
    background-color: rgba(34, 197, 94, .18) !important;
    color: #bbf7d0 !important;
}

html[data-bs-theme="dark"] body .stat-card-icon.warning {
    background-color: rgba(245, 158, 11, .18) !important;
    color: #fde68a !important;
}

html[data-bs-theme="dark"] body .stat-card-icon.info {
    background-color: rgba(59, 130, 246, .2) !important;
    color: #bfdbfe !important;
}

html[data-bs-theme="dark"] body .stat-card-icon.danger,
html[data-bs-theme="dark"] body .schedule-sick-icon,
html[data-bs-theme="dark"] body .section-icon {
    background-color: rgba(220, 38, 38, .2) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, .34) !important;
}

html[data-bs-theme="dark"] body .alert,
html[data-bs-theme="dark"] body .info-panel {
    background-color: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .alert-warning {
    background-color: rgba(245, 158, 11, .17) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, .34) !important;
}

html[data-bs-theme="dark"] body .alert-danger,
html[data-bs-theme="dark"] body .bg-danger.bg-opacity-10 {
    background-color: rgba(220, 38, 38, .18) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, .38) !important;
}

html[data-bs-theme="dark"] body .alert-success,
html[data-bs-theme="dark"] body .bg-success.bg-opacity-10 {
    background-color: rgba(34, 197, 94, .16) !important;
    color: #bbf7d0 !important;
    border-color: rgba(74, 222, 128, .34) !important;
}

html[data-bs-theme="dark"] body .border,
html[data-bs-theme="dark"] body .border-top,
html[data-bs-theme="dark"] body .border-bottom,
html[data-bs-theme="dark"] body .border-start,
html[data-bs-theme="dark"] body .border-end,
html[data-bs-theme="dark"] body .border-light,
html[data-bs-theme="dark"] body .border-light-subtle {
    border-color: var(--app-dark-border) !important;
}

html[data-bs-theme="dark"] body .app-module-tabs,
html[data-bs-theme="dark"] body .statistik-subtabs,
html[data-bs-theme="dark"] body .statistik-pill-group,
html[data-bs-theme="dark"] body .salary-chart-toggle-bar,
html[data-bs-theme="dark"] body .custom-pills {
    background: rgba(17, 24, 39, .94) !important;
    border-color: var(--app-dark-border) !important;
    box-shadow: 0 .7rem 1.6rem rgba(0, 0, 0, .28) !important;
}

html[data-bs-theme="dark"] body .app-module-tab:not(.active),
html[data-bs-theme="dark"] body .statistik-subtab:not(.active),
html[data-bs-theme="dark"] body .salary-chart-toggle:not(.active) {
    color: var(--app-dark-muted) !important;
}

html[data-bs-theme="dark"] body .app-module-tab.active,
html[data-bs-theme="dark"] body .statistik-subtab.active,
html[data-bs-theme="dark"] body .salary-chart-toggle.active,
html[data-bs-theme="dark"] body .btn-dark {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: #fff !important;
    border-color: rgba(248, 113, 113, .42) !important;
    box-shadow: 0 .7rem 1.5rem rgba(220, 38, 38, .22) !important;
}

html[data-bs-theme="dark"] body .app-info-panel {
    background: linear-gradient(180deg, rgba(17, 24, 39, .98), rgba(23, 32, 51, .98)) !important;
    color: var(--app-dark-text) !important;
    border-color: rgba(248, 113, 113, .42) !important;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .46) !important;
}

html[data-bs-theme="dark"] body .app-info-backdrop {
    background: rgba(2, 6, 23, .42) !important;
}

html[data-bs-theme="dark"] body .app-module-hero .app-select-shell,
html[data-bs-theme="dark"] body .app-module-hero .form-select,
html[data-bs-theme="dark"] body .app-module-hero .app-smart-select {
    background-color: rgba(255, 255, 255, .12) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, .24) !important;
}

html[data-bs-theme="dark"] body .app-module-hero .app-select-shell option,
html[data-bs-theme="dark"] body select option {
    background: var(--app-dark-surface-2) !important;
    color: var(--app-dark-text) !important;
}

html[data-bs-theme="dark"] body svg text,
html[data-bs-theme="dark"] body .chart-axis-label,
html[data-bs-theme="dark"] body .chart-label {
    fill: var(--app-dark-muted) !important;
    color: var(--app-dark-muted) !important;
}

html[data-bs-theme="dark"] body ::-webkit-scrollbar-thumb {
    background: #475569;
}

html[data-bs-theme="dark"] body ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

html[data-bs-theme="dark"] [style*="background: #cbd5e1"],
html[data-bs-theme="dark"] [style*="background-color: #cbd5e1"] {
    background: var(--app-dark-border) !important;
    background-color: var(--app-dark-border) !important;
}

/* === INFO-HINWEISE: robustes Modal-Pattern =========================================
   Das Panel wird IM Backdrop zentriert (statt separat position:fixed). Dadurch faengt
   das Backdrop jeden Klick ausserhalb des Panels ab und schliesst zuverlaessig —
   auch wenn ein transformierter Vorfahre (Chart-Animationen, Cards) sonst ein
   separat fixiertes Panel fehlplatzieren und die App blockieren wuerde. */
.app-info-backdrop {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    background: rgba(15, 23, 42, .32) !important;
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    z-index: 2147483600 !important;
    overflow-y: auto !important;
    cursor: pointer;
}

.app-info-backdrop .app-info-panel {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    width: min(42rem, 100%) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 2rem) !important;
    overflow-y: auto !important;
    cursor: auto;
    animation: appInfoModalIn .16s ease-out;
}

@keyframes appInfoModalIn {
    from { opacity: 0; transform: scale(.97); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 767.98px) {
    .app-info-backdrop {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .app-info-backdrop .app-info-panel {
        width: 100% !important;
        max-height: 82dvh !important;
        border-radius: 1rem 1rem 0 0 !important;
        animation: appInfoMobileIn .22s cubic-bezier(.16, 1, .3, 1);
    }
}
