body {
    background-color: #f8f9fa;
}


/* Jahreskalender */
.planning-year-calendar {
    margin-top: 0.25rem;
}

.planning-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.15rem;
}

.planning-weekday {
    font-size: 0.7rem;
    padding: 0.1rem 0;
}

.planning-day {
    position: relative;
    min-height: 2.4rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    background-color: #ffffff;
    font-size: 0.7rem;
    overflow: hidden;
}

.planning-day-inner {
    position: relative;
    z-index: 1;
    padding: 0.15rem 0.2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.planning-day-number {
    font-weight: 500;
    margin-bottom: 0.05rem;
}

.planning-day-badges {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
}

.planning-day-outside {
    background-color: transparent;
    border: none;
}

.planning-day-weekend {
    background-color: #f3f4f6;
}

.planning-day-today {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

/* Feiertage */
.planning-day-holiday {
    background-color: #e9ecef;
}

/* Urlaub voll */
.planning-day-leave-full {
    background-color: var(--leave-color, #0d6efd);
    color: #ffffff;
}

/* Halbe Tage diagonal */
.planning-day-leave-am::before,
.planning-day-leave-pm::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--leave-color, #0d6efd);
    opacity: 0.9;
    z-index: 0;
}

.planning-day-leave-am::before {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.planning-day-leave-pm::before {
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* Offene Anträge */
.planning-day-leave-pending {
    box-shadow: inset 0 0 0 2px rgba(255, 193, 7, 0.7);
}

/* Legende-Swatches */
.legend-swatch {
    display: inline-block;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.legend-swatch-leave {
    background: #0d6efd;
}

.legend-swatch-leave-am {
    background: linear-gradient(to bottom right, #0d6efd 0%, #0d6efd 50%, transparent 50%, transparent 100%);
}

.legend-swatch-leave-pm {
    background: linear-gradient(to bottom right, transparent 0%, transparent 50%, #0d6efd 50%, #0d6efd 100%);
}

.legend-swatch-holiday {
    background: #e9ecef;
}

.legend-swatch-today {
    background: #ffffff;
    box-shadow: 0 0 0 2px #0d6efd inset;
}


/* Team-Monatskalender */


.team-month-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
}

.team-month-table {
    width: max-content;
    min-width: 100%;
}

.team-month-table th,
.team-month-table td {
    white-space: nowrap;
}

.team-month-sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--bs-body-bg, #ffffff);
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.1);
}

.team-month-sticky-col-header {
    z-index: 4;
    background: var(--bs-table-bg, #f8f9fa);
}

.team-month-table {
    font-size: 0.75rem;
}

.tm-day-cell {
    position: relative;
    min-width: 1.8rem;
    height: 2.1rem;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.03);
    vertical-align: middle;
    overflow: hidden;
}

.tm-day-inner {
    position: relative;
    z-index: 1;
    padding: 0.1rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
}

.tm-day-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    justify-content: center;
}

/* Wochenende */
.tm-day-weekend {
    background-color: #f3f4f6;
}

/* Feiertag (benutzerspezifisch) */
.tm-day-holiday {
    background-color: #e9ecef;
}

/* Urlaub voll */
.tm-day-leave-full {
    background-color: var(--leave-color, #0d6efd);
    color: #ffffff;
}

/* Halbe Tage diagonal */
.tm-day-leave-am::before,
.tm-day-leave-pm::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--leave-color, #0d6efd);
    opacity: 0.9;
    z-index: 0;
}

.tm-day-leave-am::before {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.tm-day-leave-pm::before {
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* Offene Anträge */
.tm-day-leave-pending {
    box-shadow: inset 0 0 0 2px rgba(255, 193, 7, 0.7);
}


.planning-day-icon-wrapper {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 0.7rem;
    opacity: 0.9;
}


/* Jahresansicht – zusätzliche Zustände und Legende */

.planning-day-selected {
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.8);
    background-color: rgba(13, 110, 253, 0.06);
}

.planning-day-range-start::after,
.planning-day-range-end::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid rgba(13, 110, 253, 0.9);
    border-radius: 0.25rem;
    pointer-events: none;
}

.planning-day-past {
    opacity: 0.4;
    cursor: not-allowed;
}

.planning-day-clickable {
    cursor: pointer;
}

/* Sperrzeiten in der Jahresansicht */
.planning-day-blackout-full {
    background-image: repeating-linear-gradient(
        135deg,
        rgba(220, 53, 69, 0.18) 0,
        rgba(220, 53, 69, 0.18) 6px,
        transparent 6px,
        transparent 12px
    );
}

.planning-day-blackout-warning {
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 193, 7, 0.18) 0,
        rgba(255, 193, 7, 0.18) 6px,
        transparent 6px,
        transparent 12px
    );
}

/* Legende-Swatches */
.legend-box {
    display: inline-block;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.legend-box.bg-weekend {
    background-color: #f3f4f6;
}

.legend-box.bg-holiday {
    background-color: #e9ecef;
}

.legend-box.bg-blackout-full {
    background-image: repeating-linear-gradient(
        135deg,
        rgba(220, 53, 69, 0.25) 0,
        rgba(220, 53, 69, 0.25) 6px,
        transparent 6px,
        transparent 12px
    );
}

.legend-box.bg-blackout-warning {
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 193, 7, 0.25) 0,
        rgba(255, 193, 7, 0.25) 6px,
        transparent 6px,
        transparent 12px
    );
}

.legend-box.bg-selection {
    background-color: rgba(13, 110, 253, 0.1);
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.4);
}


/* Custom Overlay für Storno-Dialog im Jahreskalender */
.leave-cancel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background-color: rgba(15, 23, 42, 0.55); /* halbtransparent dunkel */
    display: flex;
    align-items: center;
    justify-content: center;
}

.leave-cancel-overlay.d-none {
    display: none !important;
}

.leave-cancel-dialog {
    max-width: 420px;
    width: 100%;
}


/* Jahreskalender: einheitliche Monats-Cards und Tageszellen */
.planning-year-month-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.planning-year-month-card .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.planning-year-month-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.75rem;
}

.planning-year-month-table th,
.planning-year-month-table td {
    width: calc(100% / 7);
    padding: 0;
    vertical-align: top;
}

.planning-year-month-table th {
    text-align: center;
    font-weight: 600;
}

.planning-day {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0.15rem;
    overflow: hidden;
}

/* Inhalt in der Zelle zentriert halten */
.planning-day > * {
    position: relative;
    z-index: 1;
}


/* Icon in der Zelle wieder unten rechts positionieren */
.planning-day .planning-day-icon-wrapper {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 0.7rem;
    opacity: 0.9;
    z-index: 3;
}


/* Teamkalender: spezielle Darstellung */
.team-month-cell {
    position: relative;
    padding: 0.25rem;
}

.team-month-cell[data-leave-id] {
    cursor: pointer;
}


.team-month-half-indicator {
    position: absolute;
    left: 2px;
    top: 2px;
    bottom: 2px;
    width: 4px;
    border-radius: 999px;
    opacity: 0.9;
}

/* === Stronger highlighting for Teamkalender (Wochenenden/Feiertage/Heute) === */
.planning-day-weekend {
    background-color: #fff3cd; /* warm yellow for weekends */
}

.planning-day-holiday {
    background-color: #ffe5e5; /* light red/pink for holidays */
}

.planning-day-today {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, .25);
}

/* Legend boxes for weekend/holiday */
.legend-box.bg-weekend {
    background-color: #fff3cd;
}

.legend-box.bg-holiday {
    background-color: #ffe5e5;
}


/* Sticky table headers (z.B. Benutzerverwaltung) */
.table-sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #ffffff;
}

.table thead.sticky-top,
.table thead.sticky-top th {
    z-index: 2;
}


/* Leichter Schatten unter der Hauptnavigation (Sticky Navbar) */
.navbar.sticky-top {
    position: sticky;
    z-index: 1085;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.08);
}

.navbar.sticky-top .dropdown-menu {
    z-index: 1090;
}

/* Sticky Footer mit Schatten (analog zur Navbar) */
.site-footer {
    background-color: #ffffff;
    box-shadow: 0 -0.25rem 0.5rem rgba(0, 0, 0, 0.08);
    z-index: 1020;
}

.site-footer.sticky-bottom {
    position: sticky;
    bottom: 0;
}



.app-main-content {
    position: relative;
}

.app-toast-container {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1085;
    width: auto;
    max-width: calc(100vw - 2rem);
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.625rem;
    pointer-events: none;
}

.app-toast-container .toast,
.app-toast-container .app-notification-toast {
    width: auto;
    max-width: min(22rem, calc(100vw - 2rem));
    margin-left: auto;
    pointer-events: auto;
}

.app-notification-toast {
    box-shadow: 0 0.375rem 1.125rem rgba(0, 0, 0, 0.16);
    border-radius: 0.875rem;
    overflow: hidden;
    transform: translate3d(1.25rem, 0, 0);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.18s ease;
}

.app-notification-toast.show,
.app-notification-toast.is-visible {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.app-notification-toast.is-hovered {
    box-shadow: 0 0.5rem 1.35rem rgba(0, 0, 0, 0.2);
}

.app-notification-inner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 0;
    padding: 0.6875rem 0.8125rem;
}

.app-notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.95rem;
    line-height: 1;
    flex: 0 0 1rem;
}

.app-notification-body {
    flex: 0 1 auto;
    padding: 0;
    margin: 0;
    white-space: pre-line;
    font-size: 0.92rem;
    line-height: 1.35;
}

.app-notification-close {
    flex: 0 0 auto;
    align-self: center;
    margin: 0 0 0 0.125rem;
    opacity: 0.78;
}

.app-notification-close:hover,
.app-notification-close:focus {
    opacity: 1;
}


.admin-filter-toolbar .form-label {
    margin-bottom: 0.375rem;
}

.admin-filter-toolbar .form-select,
.admin-filter-toolbar .form-control {
    min-height: 2.35rem;
}

.admin-action-toolbar {
    display: grid;
    grid-template-columns: minmax(14rem, max-content) minmax(16rem, 1fr) max-content;
    align-items: center;
    gap: 1rem;
}

.admin-action-toolbar-left {
    justify-self: start;
}

.admin-action-toolbar-center {
    justify-self: center;
    width: min(100%, 34rem);
}

.admin-action-toolbar-right {
    justify-self: end;
}

.admin-bulk-group .form-select {
    width: auto;
    min-width: 10rem;
    max-width: 24rem;
    flex: 0 1 auto;
}

.admin-export-buttons .btn {
    min-width: 2.5rem;
}

.admin-reset-button {
    min-width: 8rem;
}


.admin-toolbar-card {
    border: 0;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

.admin-toolbar-card .card-body {
    padding: 1rem 1rem 0.85rem;
}

.admin-toolbar-card .admin-filter-toolbar {
    margin-bottom: 0;
}

.admin-action-toolbar {
    min-height: 2.5rem;
}

.admin-action-toolbar-right .btn-group,
.admin-action-toolbar-right .btn-toolbar {
    flex-wrap: nowrap;
}

.admin-action-toolbar .btn,
.admin-action-toolbar .form-select,
.admin-action-toolbar .form-control {
    min-height: 2.15rem;
}

.admin-bulk-group {
    justify-content: center;
}

.admin-bulk-group .input-group {
    width: auto;
    max-width: 100%;
}

.admin-bulk-group .btn {
    white-space: nowrap;
}

.admin-export-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-export-buttons .btn {
    min-width: 2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-export-buttons .btn i {
    line-height: 1;
    font-size: 0.95rem;
}

.admin-list-footer {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.75rem;
}

.admin-filter-toolbar .form-control.admin-filter-search {
    min-width: min(100%, 18rem);
}

@media (max-width: 767.98px) {
    .admin-toolbar-card .card-body {
        padding-bottom: 1rem;
    }

    .admin-export-buttons {
        justify-content: flex-end;
    }
}

@media (max-width: 991.98px) {
    .admin-action-toolbar {
        grid-template-columns: 1fr;
    }

    .admin-action-toolbar-left,
    .admin-action-toolbar-center,
    .admin-action-toolbar-right {
        justify-self: stretch;
        width: 100%;
    }

    .admin-action-toolbar-right .btn-group,
    .admin-action-toolbar-right .btn-toolbar {
        width: 100%;
        justify-content: flex-end;
    }

    .admin-bulk-group .form-select {
        min-width: 0;
        width: 100%;
    }
}

/* Dashboard Heatmap / Analytics */
.dashboard-heatmap th,
.dashboard-heatmap td {
    white-space: nowrap;
    font-size: 0.8rem;
}
.dashboard-heatmap th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}
.dashboard-heatmap-cell {
    min-width: 2.25rem;
    text-align: center;
    border-radius: .4rem;
    font-weight: 600;
}
.dashboard-heatmap-success {
    background: rgba(25, 135, 84, 0.15);
    color: #146c43;
}
.dashboard-heatmap-warning {
    background: rgba(255, 193, 7, 0.18);
    color: #997404;
}
.dashboard-heatmap-danger {
    background: rgba(220, 53, 69, 0.16);
    color: #b02a37;
}
.dashboard-heatmap-wrap {
    overflow-x: auto;
}


/* Bootstrap-Modals müssen über der Sticky-Navigation liegen */
.modal-backdrop.show {
    z-index: 1095 !important;
}

.modal {
    z-index: 1100 !important;
}

.modal-dialog {
    position: relative;
    z-index: 1101;
}

.table-sort-link { color: inherit; font-weight: 600; }
.table-sort-link:hover, .table-sort-link:focus { color: inherit; }
.table-sort-link.active { color: var(--bs-primary); }
.table-sort-link[data-dir="asc"]::after { content: "\2191"; margin-left: .25rem; font-size: .75em; }
.table-sort-link[data-dir="desc"]::after { content: "\2193"; margin-left: .25rem; font-size: .75em; }

.holiday-filter-year-col{max-width:9rem;}
.holiday-filter-state-col{max-width:18rem;}


.team-month-sort-link { font-weight: 600; }
.team-month-sort-link:hover { text-decoration: none; }
.team-month-sort-arrow { font-size: 0.75rem; line-height: 1; }


.app-global-loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.45);
    backdrop-filter: blur(1.5px);
    z-index: 2000;
    padding: 1rem;
}
.app-global-loading-overlay.is-visible {
    display: flex;
}
.app-global-loading-chip {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .95rem;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 .25rem 1rem rgba(0,0,0,.12);
    color: #495057;
    font-size: .95rem;
    font-weight: 500;
}
body.app-busy {
    cursor: progress;
}
body.app-busy .app-global-loading-overlay {
    pointer-events: auto;
}
body.modal-open .app-global-loading-overlay {
    z-index: 1040;
    pointer-events: none;
    background: rgba(255,255,255,.18);
}
.btn.is-loading,
button.is-loading,
a.is-loading {
    pointer-events: none;
    opacity: .8;
}
.btn.is-loading::after,
button.is-loading::after,
a.is-loading::after {
    content: '';
    display: inline-block;
    width: .9rem;
    height: .9rem;
    margin-left: .5rem;
    vertical-align: -0.125em;
    border: .14em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: dategaButtonSpinner .6s linear infinite;
}
@keyframes dategaButtonSpinner {
    to { transform: rotate(360deg); }
}
