body {
    background-color: #f8f9fa;
    padding-top: 16px;
    position: relative;
    transition: margin-right 0.3s ease;
}


body.admin-panel-open {
    margin-right: 400px;
}

/* Auf Desktop: Settings-Button ausblenden wenn Panel offen */
@media (min-width: 769px) {
    body.admin-panel-open .admin-toggle {
        display: none !important;
    }
}

/* Auf Tablet: Schmaleres Panel */
@media (min-width: 769px) and (max-width: 1024px) {
    body.admin-panel-open {
        margin-right: 350px;
    }
}
.naechster-termin {
    background-color: #d4edda;
    border-left: 5px solid #28a745;
}
.card {
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
    color: #2c3e50;
    margin-bottom: 30px;
}
.badge-naechster {
    font-size: 0.9rem;
}
.badge-manuell {
    font-size: 0.75rem;
    margin-left: 5px;
}

/* Admin Widget */
#adminWidget {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}
#adminWidget.active {
    transform: translateX(0);
}
.admin-toggle {
    /* normaler Dokumentfluss, scrollt mit dem Inhalt */
}
.admin-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
}
.overlay.active {
    display: block;
}

/* Akkordeon-Sektionen */
.sektion-kopf {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding: 4px 0;
}
.sektion-kopf:hover {
    opacity: 0.75;
}
.sektion-pfeil {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.sektion-kopf.offen .sektion-pfeil {
    transform: rotate(180deg);
}
.sektion-inhalt {
    display: none;
}

/* Button-Group: Alle Buttons mit exakt gleicher Border */
.btn-group > a.btn,
.btn-group > button.btn {
    border: 1px solid #0d6efd !important;
    border-right-width: 0 !important;
}
.btn-group > a.btn:last-child,
.btn-group > button.btn:last-child {
    border-right-width: 1px !important;
}

/* Mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    body.admin-panel-open {
        margin-right: 0;
        overflow: hidden;
    }

    /* Einstellungs-Button ausblenden wenn Panel offen */
    body.admin-panel-open .admin-toggle {
        display: none !important;
    }

    .login-text,
    .settings-text {
        display: none;
    }

    /* Hauptinhalt gleitet nach rechts raus */
    .container {
        transition: transform 0.3s ease;
    }
    body.admin-panel-open .container {
        transform: translateX(-100%);
    }

    /* Widget gleitet von rechts rein */
    #adminWidget {
        position: fixed !important;
        left: auto !important;
        right: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        transform: translateX(100%) !important;
        transition: transform 0.3s ease !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.15) !important;
        border-bottom: none !important;
        overflow-y: auto !important;
        display: block !important;
    }

    #adminWidget.active {
        transform: translateX(0) !important;
    }

    /* Overlay auf mobil nicht benötigt */
    .overlay {
        display: none !important;
    }
}

/* Tablet: Panel ist schmaler */
@media (min-width: 769px) and (max-width: 1024px) {
    #adminWidget {
        width: 350px;
    }
    .overlay {
        display: none !important;
    }
}

/* Desktop: Kein Overlay */
@media (min-width: 1025px) {
    .overlay {
        display: none !important;
    }
}

/* Touch-Drag: verhindert iOS-Scroll-Interferenz auf Personen-Listeneinträgen */
#personenListe .list-group-item {
    touch-action: none;
}

