.summary {
    width: 100%;
    background: var(--color-surface-muted);
    padding: 1rem;
    border-radius: var(--bradius);
    margin-bottom: 1rem;
}

#bookingListe {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 1rem;
    min-width: 0; /* erlaubt Kindern zu schrumpfen */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#bookingListe h3 {
    margin: 0;
    font-size: 1.2rem;
    white-space: nowrap;
}

/* Menu Buttons */
.mb-div {
    display: none;
}

.mb-div.selected {
    display: block;
}

/* Overview */
.overview-controls {
    display: none;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.booking-switches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.booking-switch-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-default);
    border-radius: var(--bradius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

@media (max-width: 1000px) {
    .booking-switches {
        grid-template-columns: 1fr;
    }
}

.booking-switch-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}

.booking-view-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.booking-scope-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.booking-scope-pill {
    border: 1px solid var(--color-border-default);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.booking-scope-pill.is-active {
    border-color: var(--color-primary);
    background: var(--color-surface-muted);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.booking-scope-pill:hover {
    border-color: var(--color-primary);
}

.single-booking-filters {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.single-booking-filters__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.single-booking-filters__field select,
.single-booking-filters__field input[type="date"] {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border-default);
    border-radius: var(--bradius);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

.single-booking-filters__field select:focus,
.single-booking-filters__field input[type="date"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.booking-view-switch label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.booking-view-pill {
    position: relative;
    border: 1px solid var(--color-border-default);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    background: var(--color-surface);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.booking-view-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.booking-view-pill img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.booking-view-pill:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-surface-muted);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.booking-view-pill:hover {
    border-color: var(--color-primary);
}

.bookingContainer.view-list {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
}

.bookingContainer.view-list .card.small {
    width: 100%;
    max-width: 680px;
    margin-left: 0;
    margin-right: 0;
}

.bookingContainer.view-table {
    display: none;
}

.booking-table-section {
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-default);
    border-radius: var(--bradius);
}

.booking-table-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.booking-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.booking-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.booking-table th,
.booking-table td {
    padding: 0.75rem 0.8rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border-default);
}

.booking-table th {
    background: var(--color-surface-muted);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.booking-table td {
    font-size: 0.95rem;
}

.booking-table tbody tr:hover {
    background: var(--color-surface-muted);
}

.booking-table-cancel-btn {
    width: auto;
    min-width: 0;
    padding-inline: 0.9rem;
    white-space: nowrap;
}

.booking-table-edit-btn {
    width: auto;
    min-width: 0;
    padding-inline: 0.9rem;
    white-space: nowrap;
}

.booking-table-deadline {
    white-space: nowrap;
}

.booking-table-note {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.table-booking-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.table-booking-edit-modal.show {
    display: flex;
}

.table-booking-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.table-booking-edit-dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: 90vh;
    overflow: auto;
    z-index: 1;
}

.table-edit-card {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
}

.table-edit-card > :not(.slot-overlay) {
    display: none !important;
}

.table-edit-card .slot-overlay {
    position: static;
    display: flex;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 247, 250, 0.98) 100%);
    padding: 1rem;
    min-height: 320px;
}

.overview-controls .dropdown {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.overview-controls .dropdown-btn {
    width: auto;
    padding: 0.75rem 1rem;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border-default);
    border-radius: var(--bradius);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.overview-controls .dropdown-btn:hover {
    background: var(--color-border-default);
}

.overview-controls .dropdown-content {
    position: absolute;
    top: 100%;
    width: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border-default);
    border-top: none;
    border-radius: 0 0 var(--bradius) var(--bradius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.overview-controls .dropdown-content.show {
    display: block;
}

.overview-controls .dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border-default);
    transition: background-color 0.2s;
}

.overview-controls .dropdown-item:hover {
    background: var(--color-surface-muted);
}

.overview-controls .dropdown-item:last-child {
    border-bottom: none;
}

.overview-controls .dropdown-arrow {
    transition: transform 0.2s;
}

/* --- */

#bookingDetails {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Wochenplan Kalender */
.kalender-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background-color:var(--color-surface-muted);
    border: 1px solid var(--color-surface-muted);
    margin-top: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: max-content;
    min-width: 100%;
}

.zeit-spalte,
.tag-spalte {
    background-color: var(--color-surface);
}

.kalender-header {
    background-color: var(--color-surface-muted);
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-surface-muted);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Wochenplan Header */
.wochenplan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.wochenplan-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.wochenplan-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.wochenplan-print-buttons {
    display: flex;
    gap: 0.5rem;
}

.print-btn {
    padding: 0.5rem 1rem;
    background: var(--color-text-muted);
    color: var(--color-surface);
    border: none;
    border-radius: var(--bradius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.print-btn:hover {
    background: var(--primary-dark, var(--color-info));
}

.zeit-slot,
.tag-slot {
    height: 40px;
    border-bottom: 1px solid var(--color-surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.zeit-slot {
    background-color: var(--color-surface);
    font-weight: 500;
    padding: 0 0.5rem;
}

.tag-slot.buchung-slot {
    background-color: var(--color-surface-muted) !important;
}

.buchung-info {
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.1;
    font-weight: 500;
}

/* Mobile Anpassungen für Wochenplan */
@media (max-width: 1000px) {
    .kalender-grid {
        display: grid;
        grid-template-columns: 50px repeat(7, minmax(100px, 1fr));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
        width: max-content;
        min-width: 100%;
    }

    .zeit-slot,
    .tag-slot {
        height: 30px;
    }

    .buchung-info {
        font-size: 0.6rem;
    }

    .overview-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .booking-view-switch {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .single-booking-filters {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .overview-controls .dropdown {
        min-width: auto;
    }

    .wochenplan-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wochenplan-print-buttons {
        width: 100%;
        justify-content: center;
    }

    .print-btn {
        flex: 1;
        text-align: center;
    }
}

/* Wochenplan: eigener Wrapper scrollfähig */
.wochenplanCard,
.week-grid,
#week-overview-grid {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wochenplanCard .kalender-grid,
#week-overview-grid .kalender-grid {
    min-width: 720px;
}
