/* 
   eduslot – Modern Design 2026
   Soft Elevation · Fluid Interactions · Refined Typography
   Typografie: Poppins (Headings + Body) + Space Mono (Akzente)
*/

:root {
    /* Typografie */
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Space Mono', monospace;
    /* Primärfarbe */
    --primary: #E91E63;
    --primary-rgb: 233, 30, 99;
    --primary-dark: #C2185B;
    --primary-light: #FCE4EC;
    --accent: #10b981;
    --accent-warn: #f59e0b;
    /* Neutrale Grautöne – heller, luftiger */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    /* Soft Multi-Layer Elevation – kein Neo-Brutalist mehr */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.09), 0 4px 10px rgba(0,0,0,0.05);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.11), 0 6px 16px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    /* Radien – etwas großzügiger für 2026 */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    /* Glass-Effekte */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-blur: blur(16px) saturate(180%);
    --glass-border: rgba(255, 255, 255, 0.5);
    /* Spezielle Farben */
    --danger: #DC2626;
    --login-gradient: #f5f5f7;
    --success-bg: #f0fdf4;
    --success-text: #166534;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
    --blocked-bg: #fef2f2;
    --blocked-text: #991b1b;
    --error: #ef4444;
    /* Karten & Inputs */
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-text: #1e40af;
    /* Kurs-Slot-Farben */
    --slot-course-warm: #f59e6e;
    --slot-course-warm-text: #7c2d12;
    --slot-course-cool: #60a5d4;
    --slot-course-cool-text: #1e3a4f;
    --slot-course-green: #4aba9a;
    --slot-course-green-text: #14532d;
    --slot-course-pink: #d98fa0;
    --slot-course-pink-text: #5d1e2e;
    --slot-course-neutral: #94a3b8;
    --slot-course-neutral-text: #1e293b;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;
    --highlight-bg: #f0fdf4;
    --highlight-border: #86efac;
    --highlight-text: #166534;
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input, textarea, select, button {
    font-family: inherit;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    background-image:
        radial-gradient(ellipse 80% 60% at 20% -10%, rgba(var(--primary-rgb), 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 110%, rgba(var(--primary-rgb), 0.03) 0%, transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* Modern Thin Scrollbars Globally */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border, #cbd5e1);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary, #94a3b8);
}

/* Background Glow Orbs for Aero Glass Effect */
.bg-glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -10;
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.5s ease;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: transparent;
    top: -150px;
    right: -150px;
    animation: float-orb-1 25s ease-in-out infinite;
}

.orb-2 {
    width: 700px;
    height: 700px;
    background: transparent;
    bottom: -200px;
    left: -200px;
    animation: float-orb-2 30s ease-in-out infinite;
}

@keyframes float-orb-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(70px, 50px) scale(1.08); }
    66% { transform: translate(-50px, 70px) scale(0.95); }
}

@keyframes float-orb-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-90px, -60px) scale(1.12); }
}

[data-theme="dark"] .bg-glow-orb {
    opacity: 0.35;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2.5rem;
    box-sizing: border-box;
}

/* Top Navigation - Glassmorphism 2026 */
.top-nav {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.55rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all var(--transition);
    box-shadow: 0 1px 0 rgba(255,255,255,0.6), 0 2px 8px rgba(0,0,0,0.05);
}

.top-nav nav {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}

.nav-links-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mobile-menu-btn {
    display: none;
}

.nav-logo-link {
    display: flex;
    align-items: center;
    margin-right: auto;
    padding: 0 !important;
}

.nav-logo {
    height: 34px;
    width: auto;
    transition: all var(--transition);
}

.nav-logo:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.top-nav nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.84rem;
    position: relative;
}

.top-nav nav a:hover {
    background: rgba(var(--primary-rgb), 0.07);
    color: var(--primary);
    transform: none;
}

.top-nav nav a.active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-weight: 600;
}

/* Rechte Nav-Gruppe: Design-Dropdown, Nutzer, Logout */
.nav-tools {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: 1.25rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--border-light);
}

.nav-tools .user-info {
    margin-left: 0;
}

/* User Info in Navigation */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: var(--radius-2xl);
    margin-left: 0.5rem;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.user-role-badge.admin {
    background: var(--primary);
    color: white;
}

.user-role-badge.teacher {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Exclusive Booking Styles */
.exclusive-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.exclusive-checkbox {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    padding: 0.75rem;
    border-radius: 8px;
}

.warning-text {
    color: var(--primary-dark);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.exclusive-booking-group {
    margin-top: 1rem;
}

/* Prominente Exklusiv-Buchung Hervorhebung */
.exclusive-highlight {
    background: var(--primary-light);
    border: 3px solid var(--primary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
    animation: pulse-border 2s ease-in-out infinite;
}

.exclusive-highlight .checkbox-text strong {
    color: var(--primary-dark);
    font-size: 1rem;
}

.exclusive-highlight .warning-text {
    background: rgba(255, 255, 255, 0.7);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.75rem;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(233, 30, 99, 0.35);
    }
}

/* Exklusiver Slot in Wochenübersicht */
.period-exclusive {
    background: var(--primary-light) !important;
    border: 2px solid var(--primary) !important;
}

.exclusive-header {
    background: var(--primary);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exclusive-star {
    font-size: 1.1rem;
    margin-right: 0.25rem;
}

.exclusive-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem;
    font-size: 0.8rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    border-radius: 7px;
    min-height: 74px;
}

.exclusive-student {
    font-weight: 600;
    color: var(--primary-dark);
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.exclusive-teacher {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.exclusive-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto;
}

.exclusive-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.6rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 6px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.15;
    cursor: pointer;
}

.exclusive-action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.exclusive-action-btn.danger {
    color: #991b1b;
    border-color: #fecaca;
}

.exclusive-action-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

/* Pending exclusive booking indicator */
.pending-exclusive {
    background: var(--primary-light);
    border: 2px dashed var(--primary);
    padding: 0.5rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.pending-exclusive-text {
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-weight: 500;
}

/* Pending Exclusive Hint in Slot */
.pending-exclusive-hint {
    background: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--primary-dark);
    margin-bottom: 0.4rem;
}

.pending-exclusive-hint .pending-icon {
    font-size: 0.8rem;
}

.pending-exclusive-hint .pending-text {
    font-weight: 600;
    word-break: break-word;
}

/* Pending Exclusive Admin Section */
.pending-stat {
    background: var(--primary-light) !important;
    border: 2px solid var(--primary) !important;
}

.pending-stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pending-stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-pending-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    border: 2px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.admin-pending-alert-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

.pending-exclusive-section {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.pending-exclusive-section .section-header h3 {
    color: var(--primary-dark);
}

.pending-exclusive-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pending-exclusive-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pending-info {
    flex: 1;
    min-width: 200px;
}

.pending-date {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.date-badge, .period-badge {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.period-badge {
    background: var(--accent);
}

.pending-teacher {
    margin-bottom: 0.3rem;
}

.pending-student {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.pending-offer {
    font-size: 0.85rem;
    color: #888;
}

.pending-notes {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin-top: 0.3rem;
}

/* Notizen (Einzelbuchungen) – kompakt in Widgets/Slots */
.booking-note-snippet {
    margin-top: 0.45rem;
    padding: 0.45rem 0.55rem;
    background: var(--warning-bg, #fffbeb);
    border: 1px solid var(--warning-border, #fde68a);
    border-left: 3px solid var(--accent-warn, #f59e0b);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--warning-text, #92400e);
}

.booking-note-snippet .notes-text {
    color: inherit;
    font-style: normal;
    word-break: break-word;
}

.booking-note-snippet--compact {
    margin-top: 0.35rem;
    font-size: 0.7rem;
}

.booking-note-snippet--slot {
    margin-bottom: 0.35rem;
}

.exclusive-info .booking-note-snippet {
    width: 100%;
    text-align: left;
}

.booking-notes .notes-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.booking-exclusive-status {
    margin-top: 0.5rem;
}

[data-theme="dark"] .booking-note-snippet {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.pending-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-approve, .btn-reject {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-approve {
    background: #d4edda;
    color: #155724;
}

.btn-approve:hover {
    background: #28a745;
    color: white;
}

.btn-reject {
    background: #f8d7da;
    color: #721c24;
}

.btn-reject:hover {
    background: #dc3545;
    color: white;
}

@media (max-width: 768px) {
    .pending-exclusive-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pending-actions {
        justify-content: center;
    }
}

/* User Info - Mobile */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.3rem 0.5rem;
    }
    
    .user-name {
        font-size: 0.7rem;
        max-width: 100px;
    }
    
    .user-role-badge {
        font-size: 0.55rem;
        padding: 0.1rem 0.4rem;
    }
}

/* Main Content */
main {
    min-height: 85vh;
    padding: 2rem 0;
}

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.75rem 0;
    color: var(--text-primary);
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem 0;
    color: var(--text-primary);
}

/* Flash Messages - Modern */
.messages {
    margin-bottom: 1.5rem;
}

.message {
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 4px solid;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    animation: messageFadeIn 0.5s ease 0.05s forwards;
}

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

.message-success {
    border-color: var(--accent);
    color: var(--success-text);
    background: var(--success-bg);
}

.message-error {
    border-color: #EF4444;
    color: var(--error-text);
    background: var(--error-bg);
}

.login-main-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Login Page - Modern 2026 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--brand-primary, #E91E63) 8%, #f8f9fa) 0%,
        #f9fafb 40%,
        color-mix(in srgb, var(--brand-primary, #E91E63) 4%, #f9fafb) 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.login-box {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
    padding: 2.75rem 2.5rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 200px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: none;
    transition: transform var(--transition-slow);
}

.login-logo img:hover {
    transform: scale(1.05) rotate(2deg);
}

.login-box h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Form Inputs - Modern */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) inset;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12), 0 1px 2px rgba(0,0,0,0.04) inset;
}

/* Email Confirmation Checkbox */
.email-confirmation-group {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    border: 1px solid var(--border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.checkbox-icon {
    font-size: 1.1rem;
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-left: 2rem;
}

.btn, button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.3rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: var(--radius);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    gap: 0.45rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(var(--primary-rgb), 0.3), 0 0 0 0 rgba(var(--primary-rgb), 0);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: var(--success-text);
}

.btn-block {
    background: var(--error-text);
    color: white;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.btn-block:hover {
    background: var(--blocked-text);
}

.btn-small {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Dashboard Top Section - Unified Cards */
.dashboard-top-section {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.dashboard-card .card-icon {
    font-size: 1.1rem;
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 10px;
    line-height: 1;
    flex-shrink: 0;
    overflow: hidden;
}

.dashboard-card .card-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.dashboard-card-title {
    flex: 1;
    min-width: 200px;
}

.dashboard-card-title .card-text {
    font-size: 1rem;
    color: var(--primary);
}

/* ── Dashboard Ticker / Laufschrift ── */
.dashboard-ticker-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ticker-scroll-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
    display: flex;
    align-items: center;
}

.ticker-scroll-text {
    display: flex;
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary);
    /* Animation startet erst NACH JS-Duplizierung – sonst springt der Text */
    will-change: transform;
}
.ticker-scroll-text[data-ticker-inited="1"] {
    animation: ticker-scroll 30s linear infinite;
}

.ticker-scroll-text:hover {
    animation-play-state: paused;
}

.ticker-inner {
    flex-shrink: 0;
    padding-right: 5rem;
    min-width: var(--ticker-viewport-width, 0px);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(calc(-1 * var(--ticker-w, 50%))); }
}

/* ── Dashboard Notice Ticker ── */
.dashboard-notice-ticker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.9rem;
    margin-bottom: 0.3rem;
    overflow: hidden;
}

.notice-ticker-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
}

.notice-ticker-text {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-secondary);
    animation-duration: 28s;
}

.dashboard-card-date {
    min-width: fit-content;
}

.date-form-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.date-input-inline {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.date-input-inline:hover {
    border-color: var(--primary);
}

.date-input-inline:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.calendar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.calendar-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Hilfe-Sektion (aufklappbar) */
.help-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 0;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    overflow: hidden;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.help-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transition: background 0.2s;
    list-style: none;
}

.help-toggle::-webkit-details-marker {
    display: none;
}

.help-toggle:hover {
    background: var(--bg-secondary);
}

.help-icon {
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 10px;
}

.toggle-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

details.help-section[open] .toggle-arrow {
    transform: rotate(180deg);
}

.help-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.help-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.help-card:hover {
    box-shadow: var(--shadow);
    border-color: rgba(var(--primary-rgb), 0.15);
}

.help-card h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-steps {
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.help-steps li {
    margin-bottom: 0.5rem;
}

.help-steps li strong {
    color: var(--text-primary);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-icon {
    font-size: 1rem;
}

.faq-item {
    margin-bottom: 1rem;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 0;
}

.slot-type-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slot-type {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.help-card-full {
    grid-column: 1 / -1;
}

.help-card-exclusive {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    grid-column: 1 / -1;
}

.help-card-exclusive h4 {
    color: var(--primary-dark);
}

.exclusive-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.exclusive-info-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.exclusive-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.exclusive-step .step-icon {
    font-size: 1rem;
}

.exclusive-note {
    background: rgba(233, 30, 99, 0.08);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary-dark);
    margin: 0;
}

[data-theme="dark"] .help-card-exclusive {
    background: var(--primary-light);
    border-color: var(--primary);
}

[data-theme="dark"] .help-card-exclusive h4 {
    color: var(--primary);
}

[data-theme="dark"] .exclusive-step {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
}

[data-theme="dark"] .exclusive-note {
    background: rgba(233, 30, 99, 0.15);
    color: var(--primary);
}

.offer-descriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.offer-desc {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
}

.offer-desc strong {
    display: block;
    color: var(--primary);
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.offer-desc p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 0;
    line-height: 1.5;
}

.thanks-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.thanks-content p {
    margin: 0 0 1rem 0;
}

.thanks-content p:last-child {
    margin-bottom: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--primary);
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.type-badge.type-fest {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.type-badge.type-frei {
    background: var(--success-bg);
    color: var(--success-text);
}

@media (max-width: 768px) {
    .dashboard-top-section {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dashboard-card {
        padding: 0.75rem 1rem;
    }
    
    .dashboard-card-title {
        min-width: unset;
    }
    
    .dashboard-card .card-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
    }
    
    .help-toggle {
        padding: 0.75rem 1rem;
    }
    
    .help-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    .help-content {
        padding: 1rem;
    }
}

.dashboard-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-title .title-icon {
    font-size: 1rem;
}

.title-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Week Title Styling */
.week-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.week-icon {
    font-size: 1.75rem;
}

.week-dates {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    margin-left: 0.5rem;
}

/* Dashboard */
.dashboard {
    max-width: 100%;
}

.dashboard.booking-dashboard {
    max-width: min(var(--dashboard-page-width, 1180px), 100%) !important;
    width: 100%;
}

.dashboard > h2 {
    margin-bottom: 2rem;
}

/* Date Selector - Modern */
.date-selector {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.date-selector form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-selector label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.date-selector input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.date-selector input:hover {
    border-color: var(--primary);
}

/* Selected Date Info */
.selected-date-info {
    margin-bottom: 0;
}

.selected-date-info h3 {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.85rem 1.5rem;
    margin: 0;
    border-radius: var(--radius-lg);
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3), 0 1px 4px rgba(var(--primary-rgb), 0.2);
    letter-spacing: -0.01em;
}

/* Week Overview - Modern Card 2026 */
.week-overview {
    background: var(--bg-primary);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: min(var(--week-plan-max-width, 900px), 100%);
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border);
    box-sizing: border-box;
}

.week-header-with-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
}

.week-header-with-nav h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    border: none;
    flex: 1;
    text-align: center;
}

.week-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.week-nav-arrow:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.week-nav-arrow .arrow-icon {
    font-size: 1rem;
}

/* Week Table Wrapper - Desktop */
.week-table-wrapper {
    position: relative;
}

.scroll-hint {
    display: none;
}

/* Week Table - Modern Grid 2026 */
.week-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    margin-top: 0;
    table-layout: fixed;
}

.week-table th,
.week-table td {
    padding: 0.35rem 0.2rem;
    text-align: center;
    vertical-align: top;
    border: none;
    width: 16%;
    overflow: visible;
}

.week-table th:first-child,
.week-table td:first-child {
    width: 8%;
}

.week-table th {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: var(--radius-sm);
    border-bottom: none;
}

.week-table th:first-child {
    border-top-left-radius: var(--radius-sm);
}

.week-table th:last-child {
    border-top-right-radius: var(--radius-sm);
}

.week-day-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    white-space: nowrap;
    overflow: visible;
}

.day-name {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.day-date {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 500;
    white-space: nowrap;
}

/* Heutiger Tag - modern hervorheben */
.week-table th.today-column {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.week-table td.today-column {
    background: rgba(var(--primary-rgb), 0.03);
    outline: 2px solid rgba(var(--primary-rgb), 0.12);
    outline-offset: -1px;
}

.week-table tr:last-child td.today-column {
    border-bottom: none;
}

.today-header {
    position: relative;
}

.today-header::after {
    content: "Heute";
    position: absolute;
    top: -2px;
    right: -2px;
    background: white;
    color: var(--primary);
    font-size: 0.5rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.week-table td {
    font-size: 0.8125rem;
    background: transparent;
    transition: all var(--transition-fast);
}

.week-table td:hover {
    background: rgba(0,0,0,0.01);
}

/* Period Styles */
.period-header {
    font-weight: 600;
    margin-bottom: 0.4rem;
    padding: 0.35rem 0.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
}

.period-fest .period-header {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.period-frei .period-header {
    background: var(--success-bg);
    color: var(--success-text);
}

.period-blocked {
    background: #fafafa !important;
    opacity: 1;
}

.period-blocked:hover {
    background: #f5f5f5 !important;
}

.blocked-header {
    background: #f8f9fa;
    color: #666;
    border: 1px dashed #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.5rem;
    border-radius: var(--radius);
    min-height: 0;
    justify-content: center;
    text-align: center;
}

.blocked-icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

.blocked-header .slot-detail {
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 0;
}

.blocked-note {
    margin-top: 0.25rem;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-style: italic;
    line-height: 1.35;
    color: #7f1d1d;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    word-break: break-word;
}

.blocked-badge {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
}

.period-past {
    opacity: 0.5;
    background: var(--bg-secondary) !important;
}

.slot-detail {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ===== Slot-Karten – Modern 2026 ===== */
.slot-card {
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    position: relative;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    transition: all var(--transition-fast);
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.slot-card:hover,
.slot-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    border-color: rgba(var(--primary-rgb), 0.25);
    z-index: 3;
    overflow: visible;
}

/* Clickable slot for desktop booking */

.slot-course-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-style: italic;
    font-size: 0.8rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.slot-students-list {
    font-size: 0.7rem;
    color: #555;
    margin-bottom: 0.3rem;
    line-height: 1.4;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Gruppen-Tag in Widgets/Agenda nicht über den Rand laufen lassen */
.booking-students-inline {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.slot-students-list .student-name {
    display: block;
    margin: 0.1rem 0;
    font-size: 0.7rem;
    color: #666;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

/* Gruppen-Pille im gebuchten Slot: nicht breiter als der Slot, Umbruch erlauben */
.slot-students-list .student-name.group-name-tag {
    white-space: normal;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.slot-students-list .student-name.blurred {
    filter: blur(3px);
    user-select: none;
}

.slot-footer {
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.course-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    color: #333;
    white-space: nowrap;
}

.course-tag .tag-icon {
    font-size: 0.75rem;
}

.slot-availability {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.slot-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.2;
}

.slot-status-pill.status-exclusive {
    color: #5b21b6;
    background: #f5f3ff;
    border-color: #c4b5fd;
}

.slot-status-pill.status-full {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fca5a5;
}

.slot-status-pill.status-booked {
    color: #14532d;
    background: #ecfdf5;
    border-color: #86efac;
}

.slot-status-pill.status-available {
    color: #1e40af;
    background: #eff6ff;
    border-color: #93c5fd;
}

.slot-availability .book-link {
    color: var(--primary);
    text-decoration: none;
}

.slot-availability .book-link:hover {
    text-decoration: underline;
}

.slot-availability .full-text {
    color: var(--error);
    font-weight: 700;
}

.slot-availability .status-text {
    color: var(--text-secondary);
}

.slot-availability .booked-indicator {
    color: var(--primary);
    font-weight: 700;
}

/* Slot mit Buchungen – leicht hervorgehoben */
.slot-card.slot-has-bookings {
    border-width: 2px;
    border-left: 4px solid #22c55e;
    box-shadow: 0 2px 8px rgba(34,197,94,0.12);
}

/* Ausgebuchter Slot */
.slot-card.slot-full {
    border-color: #ef4444 !important;
    border-left: 4px solid #ef4444 !important;
    background: rgba(239,68,68,0.05) !important;
    opacity: 0.85;
}

/* Booking-Fortschrittsbalken */
.slot-booking-bar {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.08);
    border-radius: 2px;
    margin: 4px 0 6px;
    overflow: hidden;
}

.slot-booking-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    min-width: 4px;
}

.slot-booking-bar-fill.bar-low  { background: #22c55e; }
.slot-booking-bar-fill.bar-high { background: color-mix(in srgb, var(--room-color, var(--primary)) 75%, white); }
.slot-booking-bar-fill.bar-full { background: var(--room-color, var(--primary)); }

/* Kursfarben – vereinfacht auf 2 Stile: Fest (alle fixen Kurse einheitlich) & Frei */

/* Alle festen Kurstypen: einheitliche neutrale Farbe */
.course-wochenstart,
.course-motorik,
.course-koordination,
.course-atem,
.course-bodyscan,
.course-sozial,
.course-fitness,
.course-ruhe,
.course-turnen,
.course-konflikt,
.course-default {
    border-color: var(--slot-course-neutral);
}
.course-wochenstart .course-tag,
.course-motorik .course-tag,
.course-koordination .course-tag,
.course-atem .course-tag,
.course-bodyscan .course-tag,
.course-sozial .course-tag,
.course-fitness .course-tag,
.course-ruhe .course-tag,
.course-turnen .course-tag,
.course-konflikt .course-tag,
.course-default .course-tag {
    background: var(--slot-course-neutral);
    color: var(--slot-course-neutral-text);
}

/* Freie Wahl: bleibt weißer Hintergrund mit Raumfarbe (in dashboard.html überschrieben) */
.course-frei {
    border-color: var(--slot-course-neutral);
}
.course-frei .course-tag {
    background: var(--slot-course-neutral);
    color: var(--slot-course-neutral-text);
}

/* Drag-and-Drop: Ziel-Slot Hervorhebung */
.week-table td.drop-target {
    background: color-mix(in srgb, var(--primary) 8%, transparent) !important;
    outline: 2px dashed var(--primary) !important;
    outline-offset: -2px;
}
.week-table td.drop-invalid {
    background: rgba(239, 68, 68, 0.06) !important;
    outline: 2px dashed #ef4444 !important;
    outline-offset: -2px;
    cursor: not-allowed;
}
.draggable-booking {
    cursor: grab;
    border-radius: 4px;
    touch-action: none;
    user-select: none;
    transition: opacity 0.15s, background .15s, box-shadow .15s;
}
.draggable-booking:active { cursor: grabbing; }
.booking-dragging {
    opacity: 0.45;
    transform: scale(0.97);
}
.booking-drag-ghost {
    position: fixed !important;
    z-index: 10000 !important;
    pointer-events: none !important;
    opacity: .96 !important;
    margin: 0 !important;
    transform-origin: top left;
    will-change: transform;
    box-shadow: 0 18px 36px rgba(15, 23, 42, .2), 0 4px 10px rgba(15, 23, 42, .12) !important;
    background: var(--bg-card, #fff) !important;
}
.booking-pointer-drag-active,
.booking-pointer-drag-active * {
    cursor: grabbing !important;
    user-select: none !important;
}

/* Badge: Verschiebung ausstehend */
.badge-move-pending {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 4px;
    margin-top: 0.15rem;
    white-space: nowrap;
    cursor: help;
}
.booking-move-pending {
    opacity: 0.75;
}

/* Widget: Verschiebungsanfrage-Item */
.approval-item-move {
    border-left: 3px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.04) !important;
}

/* Admin Block Button in neuen Karten */
.slot-card .admin-block-form {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
}

.slot-card .slot-block-mini {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
    opacity: 0.5;
}

.slot-card:hover .slot-block-mini {
    opacity: 1;
}

/* Buchen-Button - immer sichtbar */
.book-btn {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    background: var(--primary);
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 4px rgb(var(--primary-rgb) / 0.3);
    transition: all 0.2s;
}

.book-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgb(var(--primary-rgb) / 0.4);
    background: var(--primary-dark);
}

.book-btn:active {
    transform: translateY(0);
}

/* Desktop: Kleinerer Button, aber sichtbar */
@media (min-width: 768px) {
    .book-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }
    
    /* Slot-Card Hover-Effekt für bessere Klickbarkeit */
    .clickable-slot {
        cursor: pointer;
    }
    
    .clickable-slot:hover .slot-card {
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgb(var(--primary-rgb) / 0.25);
        border-color: var(--primary);
    }
}

/* Mobile: Größerer Button */
@media (max-width: 768px) {
    .book-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .slot-availability .availability-text {
        display: block;
        color: var(--text-secondary);
    }
}

/* Booking Info - Optimized */
.booking-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    text-align: left;
}

.slot-stat {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    text-align: center;
}

.booking-entry {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--border-light);
}

.booking-entry:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.booking-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.student-name {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* Datenschutz: Geblurrte Schülernamen für andere Benutzer */
.student-blurred .blurred-text {
    filter: blur(4px);
    user-select: none;
    display: inline-block;
    -webkit-filter: blur(4px);
}

.student-blurred {
    color: var(--text-secondary);
    opacity: 0.7;
    font-style: italic;
}

/* Slot Actions - All Buttons Equal Size */
.slot-actions {
    margin-top: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.slot-actions form {
    margin: 0;
}

.slot-btn {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.slot-btn-primary {
    background: var(--primary);
    color: white;
}

.slot-btn-primary:hover {
    background: var(--primary-dark);
}

.slot-btn-success {
    background: var(--room-color, var(--accent));
    color: white;
}

.slot-btn-success:hover {
    background: color-mix(in srgb, var(--room-color, var(--accent)) 82%, black);
}

.slot-btn-block {
    background: var(--accent-warn);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
}

.slot-btn-block:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    font-size: 1rem;
    display: inline-block;
}

.slot-btn-disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Day Schedule - Modern Table */
.day-schedule {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.day-schedule h3 {
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
}

.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-table th,
.schedule-table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.schedule-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.schedule-table tbody tr:hover {
    background: var(--bg-secondary);
}

.schedule-table tbody tr:last-child td {
    border-bottom: none;
}

.blocked-row {
    background: #FEF2F2 !important;
}

.past-row {
    opacity: 0.5;
}

.unbookable-row {
    opacity: 0.6;
    background: var(--bg-tertiary) !important;
    pointer-events: none;
}

.unbookable-row td {
    color: var(--text-tertiary);
}

.weekend-row {
    opacity: 0.5;
    background: #FEF3C7 !important;
}

.time-restricted-row {
    opacity: 0.65;
    background: #FEF3C7 !important;
}

.capacity {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
}

.capacity.full {
    background: #FEE2E2;
    color: #991B1B;
}

.blocked-text {
    color: #DC2626;
    font-weight: 600;
}

.time-message {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Booking Form - Modern */
.booking-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
}

.booking-info-box {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--primary);
}

.student-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.student-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.student-item input {
    flex: 1;
}

.btn-remove {
    padding: 0.5rem 0.75rem;
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #FEF2F2;
}

.btn-add {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-add:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* Admin Panel - Modern Layout */
.admin-panel {
    display: grid;
    gap: 1.5rem;
}

.admin-section {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.admin-section h3 {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.user-list,
.booking-list {
    list-style: none;
}

.user-item,
.booking-item {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:last-child,
.booking-item:last-child {
    border-bottom: none;
}

.user-item:hover,
.booking-item:hover {
    background: var(--bg-secondary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-teacher {
    background: #D1FAE5;
    color: #065F46;
}

/* Filter Form */
@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

/* Responsive - Mobile Optimierung */
@media (max-width: 1023px) {
    /* Container & Spacing */
    .container {
        padding: 0 0.75rem;
    }
    
    main {
        padding: 1rem 0;
    }
    
    /* Typography */
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    /* Login Page */
    .login-container {
        padding: 0.5rem;
    }
    
    .login-box {
        padding: 1.5rem 1rem;
        max-width: 100%;
    }
    
    .login-logo img {
        max-width: 160px;
        max-height: 80px;
    }
    /* Navigation */
    .top-nav {
        padding: 0.5rem 0;
    }
    
    .top-nav nav {
        justify-content: flex-end;
        position: relative;
    }
    
    .logo-text-desktop {
        display: none !important;
    }
    
    .logo-text-mobile {
        display: inline !important;
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 22px;
        height: 16px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        margin-left: 0.75rem;
        z-index: 101;
    }
    
    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--text-primary);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .nav-links-wrapper {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 1.25rem 1.5rem;
        gap: 0.5rem;
        box-shadow: var(--shadow-md);
        z-index: 1000;
        animation: navSlideDown 0.25s ease-out;
    }
    
    .nav-links-wrapper.active {
        display: flex;
    }
    
    .nav-links-wrapper a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem !important;
        border-radius: var(--radius);
        font-size: 0.9rem !important;
        color: var(--text-primary) !important;
        font-weight: 500;
        transition: background 0.15s;
    }
    
    .nav-links-wrapper a:hover,
    .nav-links-wrapper a:active {
        background: var(--bg-tertiary) !important;
    }
    
    .nav-links-wrapper .user-info {
        margin: 0.5rem 0;
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-light);
        margin-left: 0;
    }
    
    .nav-links-wrapper a.logout-link {
        color: var(--danger) !important;
        border: 1px solid rgba(220, 38, 38, 0.15);
        background: rgba(220, 38, 38, 0.05) !important;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .nav-links-wrapper a.logout-link:hover,
    .nav-links-wrapper a.logout-link:active {
        background: rgba(220, 38, 38, 0.1) !important;
    }
    
    .nav-links-wrapper .nav-tools {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        margin-left: 0;
        padding: 0.85rem 0.25rem 0;
        border-left: none;
        border-top: 1px solid var(--border-light);
        margin-top: 0.35rem;
    }

    .nav-links-wrapper .nav-theme-picker {
        width: 100%;
        padding: 0 0.25rem;
    }

    .nav-links-wrapper .admin-theme-select {
        flex: 1;
        width: 100%;
        max-width: none;
    }

    .notification-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        right: 10px !important;
        min-width: auto !important;
        max-width: none !important;
        width: calc(100% - 20px) !important;
        margin: 0 !important;
        z-index: 1001 !important;
    }
    
    /* Buttons - Größer für Touch */
    .btn, button[type="submit"] {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
        min-height: 44px;
    }
    
    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    /* Form Inputs - Größer für Touch */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    /* Date Selector */
    .date-selector {
        padding: 0.75rem;
    }
    
    .date-selector form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .date-selector input {
        width: 100%;
    }
    
    /* Dashboard – kein horizontaler Seiten-Scroll */
    .dashboard {
        max-width: 100%;
        overflow-x: clip;
    }

    .dashboard-layout > * {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-left-panel,
    .dashboard-ticker,
    .draggable-widget,
    .dashboard-widget {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dashboard-card-date {
        width: 100%;
    }

    .date-form-inline {
        flex: 1;
        flex-wrap: wrap;
        min-width: 0;
    }

    .date-input-inline {
        max-width: 100%;
    }

    .edit-mode-btn {
        width: 100%;
        justify-content: center;
    }

    /* Dashboard Layout – Mobil */
    .dashboard-control-bar {
        flex-wrap: wrap;
        justify-content: stretch;
        gap: 0.5rem;
        padding: 0 0.5rem;
        max-width: 100%;
    }

    .dashboard-control-bar.edit-mode-active {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-control-bar.edit-mode-active .calendar-width-control,
    .dashboard-control-bar.edit-mode-active .week-plan-width-control {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-layout {
        padding: 0 0.35rem;
        gap: 1rem;
        max-width: 100% !important;
    }

    .dashboard-ticker {
        position: static;
        top: auto;
    }

    /* Week Overview */
    .week-overview {
        padding: 0.65rem;
        overflow: visible;
        max-width: 100% !important;
        width: 100%;
        margin: 0;
    }
    
    .week-header-with-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.65rem;
    }

    .week-title-area {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
        order: 0;
    }
    
    .week-header-with-nav h3,
    .week-title-area .week-title {
        font-size: 0.82rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.35;
        text-align: center;
    }

    .week-title {
        flex-direction: column;
        gap: 0.35rem;
    }
    
    .week-nav-arrow {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    /* Week Table Wrapper – horizontal wischen */
    .week-table-wrapper {
        position: relative;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .scroll-hint {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 12;
        pointer-events: none;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        color: white;
        background: var(--primary);
        border-radius: 50%;
        box-shadow: var(--shadow-sm);
        opacity: 0.85;
    }

    .scroll-hint-left {
        left: 58px;
    }

    .scroll-hint-right {
        right: 0.15rem;
    }
    
    .week-table {
        table-layout: fixed;
        font-size: 0.8rem;
        min-width: max-content;
        width: max-content;
    }
    
    .week-table th,
    .week-table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.75rem;
        vertical-align: top;
        scroll-snap-align: start;
    }
    
    /* Erste Spalte (Stunde) - fixiert */
    .week-table th:first-child,
    .week-table td:first-child {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
        position: sticky;
        left: 0;
        background: var(--bg-primary);
        z-index: 10;
        border-right: 1px solid var(--border);
        box-shadow: 4px 0 12px -4px rgba(0, 0, 0, 0.1);
    }

    .week-table tr.week-row-pause td:first-child {
        background: color-mix(in srgb, #dcc08a 42%, var(--bg-secondary));
    }
    
    .week-table th:not(:first-child),
    .week-table td:not(:first-child) {
        min-width: 148px;
        width: 148px;
        max-width: 148px;
        padding: 0.4rem 0.35rem;
    }

    .slot-card .slot-course-name {
        font-size: 0.78rem;
        line-height: 1.25;
        word-break: break-word;
    }

    .book-btn {
        min-height: 36px;
        padding: 0.4rem 0.5rem;
        font-size: 0.78rem;
    }
    
    .day-name {
        font-size: 1rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: visible;
    }
    
    .day-date {
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .week-day-header {
        overflow: visible;
        white-space: nowrap;
    }
    
    .period-header {
        font-size: 0.65rem;
        padding: 0.25rem;
        margin-bottom: 0.25rem;
        line-height: 1.1;
    }
    
    .slot-card {
        min-height: 55px;
        padding: 0.3rem;
    }
    
    .booking-info {
        font-size: 0.65rem;
        padding: 0.3rem;
        margin-top: 0.3rem;
    }
    
    .slot-stat {
        font-size: 0.65rem;
        margin-bottom: 0.2rem;
    }
    
    .booking-entry {
        margin-top: 0.2rem;
        padding-top: 0.2rem;
    }
    
    .booking-title {
        font-size: 0.65rem;
    }
    
    .student-name {
        font-size: 0.6rem;
    }
    
    .slot-actions {
        gap: 0.2rem;
        margin-top: 0.3rem;
    }
    
    .slot-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-height: 28px;
    }
    
    /* Compact Slot Mobile - Größer und lesbarer */
    .slot-compact {
        gap: 0.2rem;
        padding: 0.3rem;
    }
    
    .slot-type-label {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    .slot-capacity {
        font-size: 0.65rem;
        padding: 0.15rem 0.25rem;
    }
    
    .slot-book-btn {
        font-size: 0.65rem;
        padding: 0.3rem;
    }
    
    .slot-full {
        font-size: 0.65rem;
        padding: 0.25rem;
    }
    
    .booking-offer {
        font-size: 0.6rem;
        padding: 0.1rem 0.2rem;
    }
    
    .mini-student {
        font-size: 0.55rem;
        padding: 0.1rem 0.15rem;
    }
    
    .slot-block-mini {
        font-size: 0.6rem;
        padding: 0.2rem;
    }
    
    /* Day Schedule */
    .day-schedule {
        padding: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .schedule-table {
        min-width: 600px;
        font-size: 0.8125rem;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    /* Booking Form */
    .booking-form {
        padding: 1rem;
    }
    
    .booking-info-box {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .booking-info-box h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .booking-info-box p {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .student-list {
        margin-bottom: 1rem;
    }
    
    .student-item {
        margin-bottom: 0.75rem;
    }
    
    /* Admin Panel */
    .admin-section {
        padding: 1rem;
    }
    
    .user-item,
    .booking-item {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Filter Form */
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Selected Date Info */
    .selected-date-info h3 {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Credits Button - Kleiner auf Mobile */
    .credits-button {
        width: 44px;
        height: 44px;
        bottom: 15px;
        right: 15px;
        font-size: 1.25rem;
    }
    
    .credits-content {
        width: 95%;
        margin: 15% auto;
        padding: 1.5rem;
    }
    
    .credits-content h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .credits-content p {
        font-size: 0.875rem;
    }
    
    .credits-close {
        font-size: 1.75rem;
        right: 1rem;
        top: 1rem;
    }
    
    /* Messages */
    .messages {
        margin-bottom: 1rem;
    }
    
    .message {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .container {
        padding: 0 0.25rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .login-logo img {
        max-width: 140px;
        max-height: 70px;
    }
    
    .week-header-with-nav {
        padding: 0 0.25rem;
    }
    
    .week-header-with-nav h3 {
        font-size: 0.7rem;
    }
    
    .week-title {
        font-size: 0.85rem;
    }
    
    .week-icon {
        font-size: 1rem;
    }
    
    .week-dates {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
        display: block;
        margin-top: 0.25rem;
        margin-left: 0;
    }
    
    .week-nav-arrow {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    
    /* Wochentabelle - 2 Tage sichtbar auf kleinen Handys */
    .week-overview {
        padding: 0.4rem;
    }
    
    .week-table th:not(:first-child),
    .week-table td:not(:first-child) {
        min-width: 140px;
        width: 140px;
        padding: 0.25rem;
    }
    
    .week-table th:first-child,
    .week-table td:first-child {
        width: 58px;
        min-width: 58px;
        font-size: 0.65rem;
    }
    
    .day-name {
        font-size: 0.75rem;
    }
    
    .day-date {
        font-size: 0.6rem;
    }
    
    .slot-compact {
        gap: 0.15rem;
        padding: 0.25rem;
    }
    
    .slot-type-label {
        font-size: 0.55rem;
        padding: 0.1rem 0.2rem;
    }
    
    .slot-capacity {
        font-size: 0.55rem;
        padding: 0.1rem 0.15rem;
    }
    
    .slot-book-btn {
        font-size: 0.55rem;
        padding: 0.25rem;
    }
    
    .slot-full {
        font-size: 0.55rem;
        padding: 0.2rem;
    }
    
    .booking-offer {
        font-size: 0.5rem;
        padding: 0.05rem 0.1rem;
    }
    
    .mini-student {
        display: none;
    }
    
    .slot-block-mini {
        font-size: 0.5rem;
        padding: 0.15rem;
    }
    
    .credits-button {
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 10px;
        font-size: 1.125rem;
    }
}

/* Credits / About (unten rechts) */
.credits-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, var(--brand-primary, var(--primary)) 0%, var(--brand-secondary, var(--primary-dark)) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1000;
}

.credits-button:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
}

.credits-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.credits-modal {
    display: none;
    position: fixed;
    bottom: 76px;
    right: 20px;
    left: auto;
    top: auto;
    width: min(320px, calc(100vw - 32px));
    height: auto;
    z-index: 10001;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: 16px;
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.18));
    overflow: hidden;
    backdrop-filter: none;
}

.credits-modal.open {
    display: block;
}

.credits-header {
    background: linear-gradient(135deg, var(--brand-primary, var(--primary)) 0%, var(--brand-secondary, var(--primary-dark)) 100%);
    color: #fff;
    padding: 18px 20px 16px;
    position: relative;
}

.credits-header h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 700;
}

.credits-version {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.78rem;
    opacity: 0.92;
}

.credits-version-badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 600;
}

.credits-content {
    padding: 16px 20px 18px;
}

.credits-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary, #9ca3af);
    margin: 0 0 6px;
}

.credits-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.84rem;
    color: var(--text-primary, #374151);
    margin: 3px 0;
}

.credits-row span:last-child {
    color: var(--text-secondary, #6b7280);
    text-align: right;
}

.credits-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #f0f0f0);
}

.credits-links a {
    font-size: 0.8rem;
    color: var(--brand-primary, var(--primary));
    text-decoration: none;
    font-weight: 600;
}

.credits-footer {
    margin-top: 12px;
    font-size: 0.72rem;
    color: var(--text-tertiary, #9ca3af);
}

.credits-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credits-close:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* Footer */
footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Notification System Styles */
.notification-container {
    position: relative;
    display: inline-block;
    margin: 0 10px;
}

.notification-bell {
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    position: relative;
    padding: 4px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.notification-bell:hover {
    transform: scale(1.08);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #EF4444;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 350px;
    max-width: 400px;
    max-height: 500px;
    overflow: hidden;
    z-index: 1000;
    margin-top: 10px;
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.mark-all-read:hover {
    background: var(--bg-secondary);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.read {
    opacity: 0.6;
}

.notification-content {
    flex: 1;
}

.notification-message {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.notification-time {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.mark-read-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 10px;
    flex-shrink: 0;
}

.mark-read-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.no-notifications {
    padding: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Kontakt-Information Box */
.contact-info-box {
    margin: 2rem auto;
    max-width: 800px;
    background: var(--room-color, var(--primary));
    border: 1px solid color-mix(in srgb, var(--room-color, var(--primary)) 70%, white);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md), 0 0 30px rgba(var(--primary-rgb), 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
}

.contact-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.contact-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
}

.contact-text {
    flex: 1;
}

.contact-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    line-height: 1.6;
}

.contact-text strong {
    color: #ffffff;
    font-weight: 600;
}

.contact-text a,
.contact-text a:visited {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-text a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.contact-text small {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Responsive: Mobile */
@media (max-width: 480px) {
    .contact-info-box {
        padding: 1rem 1.25rem;
        margin: 1.5rem 1rem;
    }
    
    .contact-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .contact-logo {
        width: 60px;
        height: 60px;
    }
    
    .contact-text p {
        font-size: 0.9rem;
    }
}

/* IServ SSO Login Styles */
.login-separator {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
}

.login-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.login-separator span {
    background: var(--bg-primary);
    padding: 0 1rem;
    position: relative;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-iserv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
}

.btn-iserv:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-iserv:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-iserv svg {
    flex-shrink: 0;
}

/* ============================================
   BULK-SPERRUNG ADMIN PAGE
   ============================================ */

.admin-page {
    padding: 2rem 0;
}

.admin-page .admin-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-page .admin-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-page .admin-header p {
    color: var(--text-secondary);
    margin: 0;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.bulk-block-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.bulk-block-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.bulk-block-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.bulk-unblock-card {
    border-color: var(--accent);
}

.blocked-overview {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.btn-full-width {
    width: 100%;
    margin-top: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.periods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Reason Icon Buttons für Slot-Sperrung */
.reason-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.reason-icon-btn {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reason-icon-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.1);
}

.reason-icon-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.period-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-light);
}

.period-checkbox:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.period-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.period-checkbox span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.bulk-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.bulk-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.blocked-slots-list {
    max-height: 400px;
    overflow-y: auto;
}

.blocked-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.blocked-table th,
.blocked-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.blocked-table th {
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blocked-table td {
    color: var(--text-secondary);
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.no-data {
    text-align: center;
    color: var(--text-tertiary);
    padding: 2rem;
}

.hint {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .bulk-block-section {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .periods-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bulk-actions {
        flex-direction: column;
    }
}

/* Dark Mode spezifische Anpassungen (legacy, nicht mehr aktiv) */
[data-theme="dark"] .message-success {
    border-color: var(--accent);
    color: var(--success-text);
    background: var(--success-bg);
}

[data-theme="dark"] .message-error {
    border-color: #f87171;
    color: var(--error-text);
    background: var(--error-bg);
}

[data-theme="dark"] .period-fest .period-header {
    background: #78350f;
    color: #fcd34d;
}

[data-theme="dark"] .period-frei .period-header {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .period-blocked {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .blocked-header {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .blocked-note {
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
    border-color: rgba(252, 165, 165, 0.45);
}

[data-theme="dark"] .blocked-badge {
    color: #fde68a;
    background: rgba(146, 64, 14, 0.35);
    border-color: rgba(251, 191, 36, 0.55);
}

[data-theme="dark"] .blocked-icon {
    color: var(--text-tertiary);
}

[data-theme="dark"] .blocked-text {
    color: var(--text-secondary);
}

[data-theme="dark"] .type-badge.type-fest {
    background: var(--primary-light);
    color: var(--primary);
}

[data-theme="dark"] .type-badge.type-frei {
    background: var(--success-bg);
    color: var(--success-text);
}

[data-theme="dark"] .capacity.full {
    background: var(--blocked-bg);
    color: var(--blocked-text);
}

[data-theme="dark"] .blocked-row {
    background: var(--blocked-bg) !important;
}

[data-theme="dark"] .btn-remove {
    background: var(--blocked-bg);
    color: var(--error-text);
}

[data-theme="dark"] .credits-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .booking-info-box {
    background: var(--bg-tertiary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-block {
    background: #dc2626;
}

[data-theme="dark"] .week-dates {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Dark Mode - Weitere Komponenten */
[data-theme="dark"] .dashboard-header {
    background: var(--bg-secondary);
    border-left-color: var(--primary);
}

[data-theme="dark"] .btn-primary {
    background: var(--primary);
    color: #0f172a;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--primary-dark);
    color: #0f172a;
}

[data-theme="dark"] .btn-success {
    background: var(--accent);
    color: #0f172a;
}

[data-theme="dark"] .btn-success:hover {
    background: #6ee7b7;
    color: #0f172a;
}

[data-theme="dark"] .slot-btn-primary {
    background: var(--primary);
    color: #0f172a;
}

[data-theme="dark"] .slot-btn-primary:hover {
    background: var(--primary-dark);
}

[data-theme="dark"] .slot-btn-success {
    background: var(--accent);
    color: #0f172a;
}

[data-theme="dark"] .slot-btn-success:hover {
    background: #6ee7b7;
}

[data-theme="dark"] .week-nav-arrow {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .week-nav-arrow:hover {
    background: var(--primary);
    color: #0f172a;
}

[data-theme="dark"] .admin-stats-card,
[data-theme="dark"] .admin-quick-actions,
[data-theme="dark"] .admin-section {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .admin-header {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .stat-number {
    color: var(--primary-dark);
}

[data-theme="dark"] .quick-link {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .quick-link:hover {
    background: var(--primary);
    color: #0f172a;
}

[data-theme="dark"] .selected-date-info h3 {
    background: #1e3a5f;
}

[data-theme="dark"] .notification-dropdown {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .notification-item {
    border-color: var(--border-light);
}

[data-theme="dark"] .notification-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .credits-button {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .credits-modal {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .help-toggle {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .help-toggle:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .help-card {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="dark"] .schedule-table th {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .schedule-table tbody tr:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .week-table th {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .date-selector {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .date-selector input {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* Dashboard Dark Mode Anpassungen (Slot-Karten, Kursfarben, Buchungs-Buttons, Kontakt-Kachel) */
[data-theme="dark"] .slot-card {
    background: rgba(30, 30, 48, 0.45) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Kategorie-spezifische Rahmenfarben für Slot-Karten im Dark Mode (dezent und elegant) */
[data-theme="dark"] .slot-card.course-wochenstart,
[data-theme="dark"] .slot-card.course-motorik,
[data-theme="dark"] .slot-card.course-koordination,
[data-theme="dark"] .slot-card.course-atem,
[data-theme="dark"] .slot-card.course-bodyscan,
[data-theme="dark"] .slot-card.course-sozial,
[data-theme="dark"] .slot-card.course-fitness,
[data-theme="dark"] .slot-card.course-ruhe,
[data-theme="dark"] .slot-card.course-turnen,
[data-theme="dark"] .slot-card.course-konflikt,
[data-theme="dark"] .slot-card.course-frei,
[data-theme="dark"] .slot-card.course-default {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .slot-course-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .slot-students-list .student-name {
    color: #e2e8f0 !important;
    font-weight: 500;
}

[data-theme="dark"] .slot-availability .status-text {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .slot-availability .availability-text {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .slot-availability .full-text {
    color: var(--error) !important;
}

[data-theme="dark"] .slot-status-pill.status-exclusive {
    color: #ddd6fe;
    background: rgba(91, 33, 182, 0.45);
    border-color: rgba(196, 181, 253, 0.45);
}

[data-theme="dark"] .slot-status-pill.status-full {
    color: #fecaca;
    background: rgba(153, 27, 27, 0.42);
    border-color: rgba(252, 165, 165, 0.5);
}

[data-theme="dark"] .slot-status-pill.status-booked {
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.48);
    border-color: rgba(134, 239, 172, 0.45);
}

[data-theme="dark"] .slot-status-pill.status-available {
    color: #bfdbfe;
    background: rgba(30, 64, 175, 0.45);
    border-color: rgba(147, 197, 253, 0.45);
}

/* Kurs-Tags in edlem Translucent-Design im Dark Mode (kein Bunt-Lärm, perfekte Lesbarkeit) */
[data-theme="dark"] .course-tag {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .course-wochenstart .course-tag,
[data-theme="dark"] .course-motorik .course-tag {
    background: rgba(232, 168, 124, 0.12) !important;
    color: #ffd8a8 !important;
    border: 1px solid rgba(232, 168, 124, 0.35) !important;
}
[data-theme="dark"] .course-koordination .course-tag,
[data-theme="dark"] .course-atem .course-tag,
[data-theme="dark"] .course-bodyscan .course-tag {
    background: rgba(130, 180, 212, 0.12) !important;
    color: #c5e1f5 !important;
    border: 1px solid rgba(130, 180, 212, 0.35) !important;
}
[data-theme="dark"] .course-sozial .course-tag,
[data-theme="dark"] .course-fitness .course-tag,
[data-theme="dark"] .course-ruhe .course-tag {
    background: rgba(122, 191, 168, 0.12) !important;
    color: #c6f6d5 !important;
    border: 1px solid rgba(122, 191, 168, 0.35) !important;
}
[data-theme="dark"] .course-turnen .course-tag,
[data-theme="dark"] .course-konflikt .course-tag {
    background: rgba(240, 98, 146, 0.12) !important;
    color: #fbcfe8 !important;
    border: 1px solid rgba(240, 98, 146, 0.35) !important;
}
[data-theme="dark"] .course-frei .course-tag,
[data-theme="dark"] .course-default .course-tag {
    background: rgba(176, 184, 187, 0.12) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(176, 184, 187, 0.35) !important;
}

/* Vergangene Termine (period-past) im Dark Mode: dezent abgeblendet, aber lesbar */
[data-theme="dark"] .period-past {
    opacity: 0.7 !important;
    background: transparent !important;
}
[data-theme="dark"] .period-past .slot-card {
    opacity: 0.55 !important;
    background: rgba(20, 20, 30, 0.2) !important;
    border: 1px dashed rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}
[data-theme="dark"] .period-past .slot-course-name {
    color: var(--text-tertiary) !important;
}
[data-theme="dark"] .period-past .course-tag {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-tertiary) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}
[data-theme="dark"] .period-past .slot-availability .availability-text {
    color: var(--text-tertiary) !important;
}

/* Kurs-spezifische Farben im Dark Mode */

/* "Jetzt buchen" Button im Dark Mode */
[data-theme="dark"] .book-btn {
    background: var(--primary) !important;
    color: #0f172a !important;
    box-shadow: none !important;
}
[data-theme="dark"] .book-btn:hover {
    background: var(--primary-dark) !important;
}

/* Freigeben / Success-Button in modernem, neutralem Design im Dark Mode (kein Bunt-Lärm) */
[data-theme="dark"] .slot-btn-success {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
}
[data-theme="dark"] .slot-btn-success:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--text-secondary) !important;
}

/* Exklusive Slots (Einzelangebote) im Dark Mode - Im edlen Dark-Pink/Rose Mix */
[data-theme="dark"] .period-exclusive {
    background: rgb(var(--primary-rgb) / 0.08) !important;
    border: 2px solid var(--primary-dark) !important;
    box-shadow: 0 4px 12px rgb(var(--primary-rgb) / 0.15) !important;
}
[data-theme="dark"] .exclusive-header {
    background: var(--primary) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .exclusive-student {
    color: var(--primary) !important;
}
[data-theme="dark"] .exclusive-teacher {
    color: var(--text-secondary) !important;
    opacity: 0.85;
}

/* Angefragte exklusive Slots (Pending) im Dark Mode - Im edlen Dark-Pink/Rose Mix */
[data-theme="dark"] .pending-exclusive {
    background: rgb(var(--primary-rgb) / 0.05) !important;
    border: 2px dashed var(--primary-light) !important;
}
[data-theme="dark"] .pending-exclusive-text {
    color: var(--primary) !important;
}
[data-theme="dark"] .pending-exclusive-hint {
    background: rgb(var(--primary-rgb) / 0.08) !important;
    border: 1.5px dashed var(--primary-light) !important;
    color: var(--primary) !important;
}
[data-theme="dark"] .pending-stat {
    background: rgb(var(--primary-rgb) / 0.05) !important;
    border: 2px solid var(--primary-light) !important;
}
[data-theme="dark"] .pending-exclusive-section {
    background: rgb(var(--primary-rgb) / 0.05) !important;
    border: 2px solid var(--primary-light) !important;
}

/* Kontakt-Kachel im Dark Mode */
[data-theme="dark"] .contact-info-box {
    background: var(--primary) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: var(--shadow-lg);
    color: #ffffff;
}

[data-theme="dark"] .contact-text p {
    color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .contact-text strong,
[data-theme="dark"] .contact-text a,
[data-theme="dark"] .contact-text a:visited {
    color: #ffffff !important;
}

/* ===== Kompakte Slot-Darstellung ===== */
.slot-compact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.35rem;
    min-height: auto;
}

.slot-header-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
}

.slot-type-label {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: visible;
    max-width: none;
    flex-shrink: 0;
}

.slot-type-label.type-fest {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.slot-type-label.type-frei {
    background: var(--success-bg);
    color: var(--success-text);
}

.slot-capacity {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.slot-book-btn {
    display: block;
    width: 100%;
    padding: 0.35rem 0.25rem;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-book-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.slot-full {
    display: block;
    width: 100%;
    padding: 0.3rem;
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
}

.slot-bookings {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-light);
}

.slot-booking-entry {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem;
    align-items: center;
}

.booking-offer {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    margin-right: 0.15rem;
    word-break: break-word;
    max-width: 100%;
}

.mini-student {
    font-size: 0.6rem;
    padding: 0.1rem 0.2rem;
    background: var(--bg-secondary);
    border-radius: 3px;
    color: var(--text-secondary);
}

.mini-student.blurred {
    filter: blur(3px);
}

.admin-block-form {
    margin: 0;
}

.slot-block-mini {
    width: 100%;
    padding: 0.25rem;
    font-size: 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.slot-block-mini:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* ===== Modern Admin Panel ===== */
.admin-panel-modern {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
}

.admin-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-icon {
    font-size: 1.5rem;
}

.admin-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.admin-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
    background: linear-gradient(135deg, var(--bg-primary), rgba(var(--primary-rgb), 0.02));
}

.admin-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.admin-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.admin-card .card-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.admin-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--primary);
    border-radius: var(--radius-lg);
    color: white;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.admin-section-modern {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.section-icon {
    font-size: 1.2rem;
}

.info-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-avatar.admin {
    background: var(--primary);
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-badge-modern {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge-modern.admin {
    background: var(--primary);
    color: white;
}

.role-badge-modern.teacher {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.filter-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-inline form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-inline input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.btn-filter {
    padding: 0.4rem 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-filter-reset {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
}

.bookings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ── Kompakte Buchungsliste ─────────────────────────────────── */
.bookings-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.booking-compact-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}
.booking-compact-row:last-child { border-bottom: none; }
.booking-compact-row:hover { background: var(--bg-hover, var(--bg-primary)); }

.bcr-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 0.55rem 0.6rem;
    background: var(--primary);
    color: #fff;
    align-self: stretch;
    text-align: center;
    flex-shrink: 0;
}
.bcr-day {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.bcr-period {
    font-size: 0.68rem;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
}

.bcr-main {
    flex: 1;
    padding: 0.45rem 0.75rem;
    min-width: 0;
}
.bcr-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.18rem;
}
.bcr-teacher {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.bcr-class {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}
.bcr-bottom {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 0;
}
.bcr-offer {
    font-weight: 500;
    color: var(--text-primary);
}
.bcr-sep { color: var(--border); }
.bcr-students { color: var(--text-secondary); }
.bcr-note {
    color: #b45309;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bcr-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0 0.6rem;
    flex-shrink: 0;
}
.bcr-btn-edit, .bcr-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem 0.35rem;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.12s;
    text-decoration: none;
}
.bcr-btn-edit:hover  { background: rgba(59,130,246,.12); }
.bcr-btn-delete:hover { background: rgba(239,68,68,.12); }

/* ── Einzelbuchung-Hervorhebung ─────────────────────────────── */
.booking-compact-row.booking-exclusive {
    background: #fffbf0;
    border-left: 3px solid #f59e0b;
}
.booking-compact-row.booking-exclusive .bcr-date {
    background: #d97706;
}
.booking-compact-row.booking-exclusive:hover {
    background: #fff7e0;
}
.bcr-badge-exclusive {
    font-size: 0.68rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    padding: 0.05rem 0.45rem;
    white-space: nowrap;
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
    .booking-compact-row.booking-exclusive { background: rgba(245,158,11,.07); }
    .booking-compact-row.booking-exclusive:hover { background: rgba(245,158,11,.12); }
    .bcr-badge-exclusive { color: #fcd34d; background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.3); }
}

.booking-admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.booking-admin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
}

.booking-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius);
    min-width: 45px;
}

.date-day {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.date-month {
    font-size: 0.7rem;
    opacity: 0.9;
}

.booking-time {
    flex: 1;
}

.period-num {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.offer-name {
    font-size: 0.8rem;
    opacity: 0.9;
}

.booking-admin-body {
    padding: 1rem;
}

.teacher-info {
    margin-bottom: 0.75rem;
}

.teacher-info strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.teacher-class {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.students-info {
    background: var(--bg-primary);
    padding: 0.75rem;
    border-radius: var(--radius);
}

.students-count {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.students-mini-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.students-mini-list li {
    padding: 0.15rem 0;
}

.booking-notes {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #FFF3E0;
    border-radius: var(--radius);
    border-left: 3px solid #FF9800;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.notes-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notes-text {
    font-size: 0.8rem;
    color: #795548;
    line-height: 1.4;
}

[data-theme="dark"] .booking-notes {
    background: #3E2723;
    border-left-color: #FFB74D;
}

[data-theme="dark"] .notes-text {
    color: #FFCC80;
}

.booking-admin-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
}

.btn-action {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-action.edit {
    background: var(--primary);
    color: white;
}

.btn-action.edit:hover {
    background: var(--primary-dark);
}

.btn-action.delete {
    background: var(--error);
    color: white;
}

.btn-action.delete:hover {
    background: #c0392b;
}

.no-bookings-admin {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-bookings-admin .no-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .admin-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-stats {
        gap: 1rem;
    }
    
    .stat-card {
        padding: 0.75rem 1.25rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .bookings-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Meine Buchungen Seite ===== */
.my-bookings-page {
    max-width: 1220px;
    margin: 0 auto;
    padding: 1rem 0;
}

.my-bookings-page .page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.my-bookings-page .page-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.my-bookings-page .page-icon {
    font-size: 1.5rem;
}

.my-bookings-page .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.booking-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.booking-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.booking-card.booking-past {
    opacity: 0.65;
    background: rgba(var(--primary-rgb), 0.05);
}

.booking-card.booking-locked .booking-actions {
    background: var(--bg-tertiary);
    opacity: 0.85;
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.4rem;
    background: var(--primary);
    border-bottom: 1px solid var(--glass-border);
    color: white;
}

.booking-date-info {
    display: flex;
    flex-direction: column;
}

.booking-weekday {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.booking-date {
    font-size: 0.88rem;
    opacity: 0.95;
    font-weight: 500;
}

.booking-period {
    text-align: right;
}

.period-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(5px);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.88rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.period-time {
    display: block;
    font-size: 0.78rem;
    opacity: 0.9;
    margin-top: 0.25rem;
    font-weight: 500;
}

.booking-body {
    padding: 1.5rem;
}

.booking-body .booking-offer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.booking-body .offer-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    background: none;
    padding: 0;
}

.offer-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.offer-type-badge.type-fest {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
}

.offer-type-badge.type-frei {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(76, 175, 80, 0.15);
}

.booking-teacher-info {
    margin-bottom: 1rem;
    padding: 0.6rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.teacher-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
    font-weight: 500;
}

.teacher-name {
    font-weight: 600;
    color: var(--text-primary);
}

.booking-students {
    margin-bottom: 1rem;
}

.students-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.students-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.students-list li {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.booking-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.created-at {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.booking-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.4rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.booking-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.booking-actions .btn-edit {
    background: var(--primary);
    color: white;
}

.booking-actions .btn-edit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.booking-actions .btn-delete {
    background: var(--error);
    color: white;
}

.booking-actions .btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow), 0 0 15px rgba(220, 38, 38, 0.25);
}

.booking-actions .btn-icon {
    font-size: 1rem;
}

.locked-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.lock-icon {
    font-size: 1rem;
}

.no-bookings {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.no-bookings-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-bookings h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-bookings p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Edit My Booking Page */
.my-booking-edit .booking-info-summary {
    background: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.my-booking-edit .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.my-booking-edit .info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.my-booking-edit .info-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.my-booking-edit .form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Mobile Responsive für Meine Buchungen */
@media (max-width: 768px) {
    .my-bookings-page .page-header h2 {
        font-size: 1.35rem;
    }
    
    .booking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .booking-period {
        text-align: left;
    }
    
    .booking-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .booking-actions .btn {
        justify-content: center;
        width: 100%;
    }
    
    .locked-info {
        justify-content: center;
    }
    
    .my-booking-edit .booking-info-summary {
        grid-template-columns: 1fr;
    }
}

/* ===== Modal für Slot-Sperrung ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

/* Form inside modal must pass through flex layout so body scrolls and footer stays visible */
.modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
    /* min-height:0 erlaubt dem Flex-Kind zu schrumpfen, damit overflow-y greift
       und der Footer (Buttons) nie aus dem max-height:95vh herausgeschoben wird. */
    min-height: 0;
}

.modal-slot-info {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.25rem;
    text-align: center;
}

.modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Icon Picker */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
}

.icon-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.icon-option input[type="radio"] {
    display: none;
}

.icon-option input[type="radio"]:checked + .icon-display {
    transform: scale(1.2);
}

.icon-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.icon-display {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    transition: transform 0.2s;
}

.icon-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    /* Footer immer sichtbar – darf nicht wegschrumpfen, wenn der Body scrollt. */
    flex-shrink: 0;
}

.modal-footer .btn {
    padding: 0.625rem 1.25rem;
    font-weight: 600;
}

.modal-footer .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.modal-footer .btn-secondary:hover {
    background: var(--border-light);
}

.modal-footer .btn-danger {
    background: var(--error-text);
    color: white;
    border: none;
}

.modal-footer .btn-danger:hover {
    background: #B71C1C;
}

/* Mobile Modal */
@media (max-width: 480px) {
    .modal-overlay {
        align-items: flex-end !important;
        overflow-y: auto !important;
        padding: 0 !important;
    }

    .modal-content {
        max-height: 92vh !important;
        max-width: 100vw !important;
        width: 100vw !important;
        margin: 0 !important;
        border-radius: 1.25rem 1.25rem 0 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-body {
        overflow-y: auto !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        flex-shrink: 0 !important;
        flex-direction: column;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    .icon-picker {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .icon-option {
        padding: 0.5rem 0.25rem !important;
    }
    
    .icon-display {
        font-size: 1.35rem !important;
        margin-bottom: 0.15rem !important;
    }
    
    .icon-label {
        font-size: 0.65rem !important;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dashboard Layout & Ticker */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    --dashboard-side-width: 290px;
    --dashboard-side-width-tablet: 280px;
    --week-plan-max-width: 900px;
    --dashboard-layout-max-width: 1550px;
    gap: 1rem;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* Widgets row: JS sets width to match exact rendered calendar width */
.dashboard-widgets-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: min(var(--week-plan-max-width, 900px), 100%);
    margin-left: auto;
    margin-right: auto;
    align-items: start;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .dashboard-widgets-row {
        grid-template-columns: 1fr;
    }
}

.dashboard-ticker {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    position: sticky;
    top: 20px;
    transition: all var(--transition);
}

.ticker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.ticker-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ticker-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.ticker-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar for ticker */
.ticker-list::-webkit-scrollbar {
    width: 4px;
}
.ticker-list::-webkit-scrollbar-track {
    background: transparent;
}
.ticker-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: transform 0.2s, border-color 0.2s;
}

.ticker-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.my-blocked-slot {
    border-left: 3px solid var(--primary);
}

.ticker-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.ticker-details {
    flex-grow: 1;
    min-width: 0;
}

.ticker-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.ticker-time strong {
    color: var(--text-primary);
}

.ticker-reason {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.ticker-author {
    margin-top: 0.2rem;
}

.author-tag {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.author-tag.me {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.ticker-action {
    flex-shrink: 0;
}

.ticker-unblock-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.ticker-unblock-btn:hover {
    color: var(--error);
}

.ticker-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Dashboard Widgets (Left Panel) */
.dashboard-left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* dashboard-left-panel is now inside .dashboard-widgets-row (below calendar) */

.dashboard-widget {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    transition: all var(--transition);
}

.dashboard-widget:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--primary-rgb), 0.12);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.widget-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.widget-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.widget-badge.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.widget-badge.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.widget-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar */
.widget-list::-webkit-scrollbar {
    width: 4px;
}
.widget-list::-webkit-scrollbar-track {
    background: transparent;
}
.widget-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.widget-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: transform 0.2s, border-color 0.2s;
}

.widget-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.widget-details {
    flex-grow: 1;
    min-width: 0;
}

.booking-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.booking-time strong {
    color: var(--text-primary);
}

.booking-teacher {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

.booking-offer {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.booking-students {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    word-break: break-word;
}

.badge-status {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
}

.badge-status.approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-status.series {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.booking-actions, .approval-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-cancel-booking, .btn-reject, .btn-approve {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.btn-cancel-booking, .btn-reject {
    color: var(--text-tertiary);
}

.btn-cancel-booking:hover, .btn-reject:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.btn-approve {
    color: #10b981;
}

.btn-approve:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* Kompakte „Meine Buchungen“ (Dashboard-Widget) */
.my-bookings-widget .widget-list {
    gap: 0.35rem;
}

.my-bookings-widget .widget-item.booking-item-compact {
    padding: 0.45rem 0.55rem;
    gap: 0.4rem;
    align-items: flex-start;
}

.my-bookings-widget .booking-time {
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
    line-height: 1.35;
}

.my-bookings-widget .booking-period-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.my-bookings-widget .booking-offer {
    font-size: 0.78rem;
    line-height: 1.3;
}

.my-bookings-widget .booking-students-inline {
    font-size: 0.68rem;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-bookings-widget .btn-cancel-booking {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
}

.my-bookings-widget .btn-action-booking {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}
.my-bookings-widget .btn-action-booking.action-absagen {
    background: color-mix(in srgb, var(--warning, #f59e0b) 12%, transparent);
    color: var(--warning-dark, #b45309);
    border-color: color-mix(in srgb, var(--warning, #f59e0b) 25%, transparent);
}
.my-bookings-widget .btn-action-booking.action-absagen:hover {
    background: var(--warning, #f59e0b);
    color: white;
    border-color: var(--warning, #f59e0b);
}
.my-bookings-widget .btn-action-booking.action-delete {
    background: color-mix(in srgb, var(--error, #ef4444) 10%, transparent);
    color: var(--error, #ef4444);
    border-color: color-mix(in srgb, var(--error, #ef4444) 20%, transparent);
}
.my-bookings-widget .btn-action-booking.action-delete:hover {
    background: var(--error, #ef4444);
    color: white;
    border-color: var(--error, #ef4444);
}
.my-bookings-widget .btn-action-booking.action-series {
    background: color-mix(in srgb, var(--primary, #6366f1) 12%, transparent);
    color: var(--primary, #6366f1);
    border-color: color-mix(in srgb, var(--primary, #6366f1) 25%, transparent);
}
.my-bookings-widget .btn-action-booking.action-series:hover {
    background: var(--primary, #6366f1);
    color: white;
    border-color: var(--primary, #6366f1);
}

/* Kompakte „Meine Buchungen“-Seite */
.my-bookings-page .bookings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 0.4rem;
    align-items: start;
}

.my-bookings-page .booking-card-compact {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.my-bookings-page .booking-card-compact:hover {
    transform: none;
}

.my-bookings-page .booking-header-compact {
    padding: 0.35rem 0.55rem;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.my-bookings-page .booking-header-compact .booking-date-info {
    flex: 1;
    min-width: 0;
}

.my-bookings-page .booking-header-compact .booking-weekday {
    font-size: 0.75rem;
    font-weight: 700;
}

.my-bookings-page .booking-header-compact .booking-date,
.my-bookings-page .booking-header-compact .period-time {
    font-size: 0.68rem;
    opacity: 0.9;
    display: inline;
}

.my-bookings-page .booking-header-compact .period-time::before {
    content: " · ";
}

.my-bookings-page .booking-header-compact .period-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-bookings-page .booking-body-compact {
    padding: 0.35rem 0.55rem 0.45rem;
}

.my-bookings-page .booking-offer-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.my-bookings-page .booking-offer-compact .offer-label {
    font-size: 0.78rem;
}

.my-bookings-page .booking-students .students-label {
    font-size: 0.7rem;
}

.my-bookings-page .booking-students .students-list {
    margin: 0.15rem 0 0;
    padding-left: 0.85rem;
    font-size: 0.72rem;
    line-height: 1.4;
}

.my-bookings-page .booking-meta .created-at {
    font-size: 0.65rem;
}

.my-bookings-page .booking-actions {
    padding: 0.3rem 0.55rem;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.my-bookings-page .booking-actions .btn {
    padding: 0.25rem 0.45rem;
    font-size: 0.7rem;
}

.my-bookings-page .booking-exclusive-status .badge-status {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

.my-bookings-page .booking-notes {
    font-size: 0.7rem;
    padding: 0.3rem 0.45rem;
}

.my-bookings-page .booking-notes .notes-label,
.my-bookings-page .booking-notes .notes-text {
    font-size: 0.68rem;
}

.my-bookings-page .booking-card-exclusive {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245,158,11,0.07) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 0 0 1px rgba(245,158,11,0.25), var(--shadow-sm);
}

.my-bookings-page .booking-card-exclusive .booking-header-compact {
    background: linear-gradient(90deg, rgba(245,158,11,0.18) 0%, rgba(245,158,11,0.06) 100%);
}

@media (max-width: 900px) {
    .my-bookings-page {
        max-width: 100%;
    }

    .my-bookings-page .bookings-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 0.55rem;
    }
}

@media (max-width: 640px) {
    .my-bookings-page .bookings-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Große Pausen im Wochenplan – ganze Zeile/Spalte warm hervorgehoben */
.week-table .period-row-label {
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: left;
    padding: 0.5rem 0.45rem;
    vertical-align: middle;
}

.week-table .period-row-label-title {
    display: block;
    font-weight: 700;
}

.week-table .period-row-label-pause {
    background: color-mix(in srgb, #dcc08a 38%, var(--bg-secondary));
    border-right: 3px solid color-mix(in srgb, #c9954a 55%, transparent);
    text-align: center;
}

.week-table .period-row-label-pause .period-row-label-title {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    color: color-mix(in srgb, #5c4520 90%, var(--text-primary));
    margin-bottom: 0.2rem;
}

.week-table .period-row-label-pause .period-row-time {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono, ui-monospace, monospace);
    color: color-mix(in srgb, #7a5c28 95%, var(--text-secondary));
    letter-spacing: 0.02em;
    white-space: normal;
    overflow-wrap: anywhere;
}

.week-table tr.week-row-pause td {
    background: color-mix(in srgb, #edd9b0 40%, var(--bg-primary));
    border-top: 2px solid color-mix(in srgb, #c9954a 40%, var(--border-light));
    border-bottom: 2px solid color-mix(in srgb, #c9954a 40%, var(--border-light));
    border-left-color: color-mix(in srgb, #d9b067 35%, var(--border-light));
    border-right-color: color-mix(in srgb, #d9b067 35%, var(--border-light));
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.week-table tr.week-row-pause td:first-child {
    background: color-mix(in srgb, #dcc08a 42%, var(--bg-secondary));
}

.week-table tr.week-row-pause td.period-pause.today-column {
    background: color-mix(
        in srgb,
        #edd9b0 38%,
        color-mix(in srgb, var(--primary) 8%, var(--bg-primary))
    );
    border-left-color: color-mix(in srgb, #c9954a 45%, var(--primary-light));
    border-right-color: color-mix(in srgb, #c9954a 45%, var(--primary-light));
}

.week-table tr.week-row-pause td:hover {
    background: color-mix(in srgb, #e8c992 40%, var(--bg-primary));
}

.week-table tr.week-row-pause td:first-child:hover {
    background: color-mix(in srgb, #dcc08a 48%, var(--bg-secondary));
}

@media (max-width: 900px) {
    .week-table .period-row-label {
        padding: 0.42rem 0.25rem;
        line-height: 1.2;
    }

    .week-table .period-row-label-pause .period-row-label-title {
        font-size: 0.68rem;
        margin-bottom: 0.12rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .week-table .period-row-label-pause .period-row-time {
        font-size: 0.58rem;
        letter-spacing: 0;
        line-height: 1.1;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .week-table .period-row-label-pause .period-row-label-title {
        font-size: 0.62rem;
    }

    .week-table .period-row-label-pause .period-row-time {
        font-size: 0.52rem;
    }
}

.week-table td.period-pause .slot-card.course-pause {
    background: color-mix(in srgb, #f7edd9 55%, transparent);
    border-color: color-mix(in srgb, #c9954a 45%, var(--border));
    border-left: 4px solid color-mix(in srgb, #b8843a 75%, #c9954a);
    box-shadow: none;
    min-height: 58px;
}

.slot-card.course-pause .slot-course-name {
    color: color-mix(in srgb, #5c4520 85%, var(--text-primary));
    font-weight: 700;
}

.course-pause .course-tag {
    background: color-mix(in srgb, #e0c48a 50%, var(--bg-tertiary));
    color: color-mix(in srgb, #6b5428 95%, var(--text-secondary));
    border: 1px solid color-mix(in srgb, #c9954a 45%, transparent);
    font-weight: 600;
}

.period-pause.clickable-slot {
    cursor: pointer;
}

.widget-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.widget-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 380px;
    background: rgba(23, 23, 28, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.15rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    opacity: 0;
    border-left: 4px solid var(--text-tertiary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--primary);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    color: #f8fafc;
    font-size: 0.85rem;
    font-weight: 500;
    flex-grow: 1;
    line-height: 1.4;
}

.toast-icon {
    color: #ffffff;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #ffffff;
}

/* ==========================================
   Occupancy Widget
   ========================================== */
.occupancy-widget {
    background: var(--bg-primary);
}

.occupancy-bar-container {
    margin-top: 0.75rem;
}

.occupancy-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.775rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.occupancy-stats-value {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar-track {
    height: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   Calendar Week Dropdown Selector
   ========================================== */
.week-title-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

@media (min-width: 640px) {
    .week-title-area {
        flex-direction: row;
        justify-content: center;
        gap: 1.25rem;
    }
    
    .week-title-area .week-title {
        flex: 0 1 auto;
    }
}

.week-selector-container {
    position: relative;
    display: inline-block;
}

.week-selector-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.week-selector-btn:hover {
    background: var(--border-light);
    border-color: var(--text-tertiary);
}

.week-selector-btn::after {
    content: "▼";
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-left: 0.2rem;
    transition: transform 0.2s;
}

.week-selector-container:focus-within .week-selector-btn::after,
.week-selector-container:hover .week-selector-btn::after {
    transform: rotate(180deg);
}

.week-selector-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 1000;
    min-width: 220px;
    background: rgba(22, 22, 28, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 0.35rem;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s, opacity 0.2s, visibility 0.2s;
}

.week-selector-container:focus-within .week-selector-dropdown,
.week-selector-container:hover .week-selector-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.week-option {
    display: block;
    width: 100%;
    padding: 0.45rem 0.65rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.week-option:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.week-option.selected {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

/* ==========================================
   Transition classes
   ========================================== */
.widget-item.fade-out, .ticker-item.fade-out {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   Dashboard Edit Mode & Widget Controls
   ========================================== */

/* Control Bar */
.dashboard-control-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    max-width: min(var(--dashboard-layout-max-width, 1550px), 100%);
    margin: 0 auto 0.75rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

.calendar-width-control {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.dashboard-control-bar.edit-mode-active .calendar-width-control,
.dashboard-control-bar.edit-mode-active .week-plan-width-control {
    display: inline-flex;
}

.dashboard-control-bar.plan-width-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: -.25rem;
}

.dashboard-control-bar.plan-width-controls .week-plan-width-control {
    display: inline-flex;
}

.plan-width-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
}

.plan-width-reset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.week-plan-width-control {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    flex-wrap: wrap;
}

.week-plan-width-control label,
.calendar-width-control label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.week-plan-width-control input[type="range"],
.calendar-width-control input[type="range"] {
    width: min(140px, 42vw);
    min-width: 80px;
}

.week-plan-width-control .week-plan-width-value,
.calendar-width-control .calendar-width-value {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 72px;
    text-align: right;
}

.edit-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.edit-mode-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.edit-mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.edit-mode-btn .btn-icon {
    font-size: 1rem;
}

/* Widget Drag Handles */
.widget-drag-handle {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    cursor: grab;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    padding: 0.2rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    z-index: 5;
}

.widget-drag-handle:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.widget-drag-handle:active {
    cursor: grabbing;
}

.edit-mode-active .widget-drag-handle {
    display: block;
}

/* Draggable Widget Wrapper */
.draggable-widget {
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.draggable-widget.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

/* Drop Zone Highlighting */
.dashboard-left-panel,
.dashboard-right-panel {
    position: relative;
    min-height: 50px;
    transition: all var(--transition);
}

.edit-mode-active .dashboard-left-panel,
.edit-mode-active .dashboard-right-panel {
    border: 2px dashed transparent;
    border-radius: var(--radius-lg);
    padding: 0.5rem;
}

.dashboard-left-panel.dragover,
.dashboard-right-panel.dragover {
    border-color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.04);
}

/* Drop Placeholder */
.drop-placeholder {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin: 0.35rem 0;
    transition: height 0.15s ease;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.3);
}

/* Widget Visibility Toggle */
.widget-visibility-panel {
    display: none;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.edit-mode-active .widget-visibility-panel {
    display: block;
}

.widget-visibility-panel h5 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.visibility-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
}

.visibility-toggle label {
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
}

/* Mini Toggle Switch */
.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* ==========================================
   Occupancy Widget
   ========================================== */
.occupancy-widget {
    text-align: center;
}

.occupancy-ring-container {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0.75rem auto;
}

.occupancy-ring {
    transform: rotate(-90deg);
    width: 110px;
    height: 110px;
}

.occupancy-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.occupancy-ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.occupancy-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.occupancy-ring-pct {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.occupancy-ring-label {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.occupancy-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
    text-align: left;
}

.occupancy-stat-item {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.occupancy-stat-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.occupancy-stat-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.occupancy-peak {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-primary);
}

.occupancy-peak strong {
    color: var(--primary);
}

.occupancy-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.occupancy-actions .btn-report {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.occupancy-actions .btn-report:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* ==========================================
   Occupancy Analysis Modal
   ========================================== */
.analysis-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
    animation: modalFadeIn 0.3s ease;
}

.analysis-modal-overlay.show {
    display: flex;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.analysis-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.analysis-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.analysis-modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.analysis-modal-close:hover {
    background: var(--error-bg);
    color: var(--error-text);
}

.analysis-modal-body {
    padding: 1.5rem;
}

/* Summary Stats Cards */
.analysis-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.analysis-stat-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-align: center;
}

.analysis-stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.analysis-stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

/* Day Breakdown Table */
.analysis-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
}

.analysis-table thead {
    background: var(--bg-secondary);
}

.analysis-table th {
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.analysis-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.analysis-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.analysis-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.analysis-table tbody tr:hover {
    background: var(--bg-secondary);
}

.analysis-table .pct-bar {
    display: inline-block;
    height: 6px;
    border-radius: 3px;
    background: var(--primary);
    min-width: 4px;
    vertical-align: middle;
    margin-right: 0.4rem;
}

/* Modal Action Bar */
.analysis-modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    justify-content: flex-end;
    flex-wrap: wrap;
}

.analysis-modal-actions button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.analysis-modal-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.analysis-modal-actions .btn-csv {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.analysis-modal-actions .btn-csv:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Dark Mode for new elements */
[data-theme="dark"] .edit-mode-btn {
    background: rgba(30, 30, 48, 0.6);
    border-color: var(--border);
}

[data-theme="dark"] .occupancy-stat-item {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="dark"] .analysis-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

[data-theme="dark"] .analysis-stat-card {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="dark"] .analysis-table thead {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .analysis-modal-actions button {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="dark"] .widget-visibility-panel {
    background: rgba(30, 30, 48, 0.6);
}

/* Print Styles for Reports */
@media print {
    body * {
        visibility: hidden;
    }
    .analysis-modal,
    .analysis-modal * {
        visibility: visible;
    }
    .analysis-modal {
        position: fixed;
        inset: 0;
        max-height: none;
        overflow: visible;
        box-shadow: none;
        border-radius: 0;
    }
    .analysis-modal-overlay {
        position: fixed;
        inset: 0;
        background: white;
        display: flex !important;
    }
    .analysis-modal-actions,
    .analysis-modal-close {
        display: none !important;
    }
}

/* ==========================================
   Admin Quick-Access Split Menu (Base styles for all themes)
   ========================================== */
.admin-menu-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.admin-menu-split-link {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.admin-plus-btn {
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid var(--border-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.admin-plus-btn:hover {
    background: rgba(var(--primary-rgb), 0.18);
}

.admin-menu-split-link .nav-link-admin {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}

.admin-quick-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    margin-top: 4px;
}

.admin-quick-menu.show {
    display: flex;
}

.admin-quick-menu a {
    display: block !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid var(--border-light) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    text-align: left !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    transform: none !important;
    background: transparent !important;
}

.admin-quick-menu a:last-child {
    border-bottom: none !important;
}

.admin-quick-menu a:hover {
    background: rgba(var(--primary-rgb), 0.06) !important;
    color: var(--primary) !important;
    transform: none !important;
}

/* ── Room Browser Tabs – mobile scrollbar ── */
.room-browser-tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}
.room-browser-tabs::-webkit-scrollbar { display: none; }

.room-browser-tab {
    scroll-snap-align: start;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Fade-Effekt an den Rändern (zeigt an, dass es mehr Tabs gibt) */
.room-browser-tabs-wrapper {
    position: relative;
}
.room-browser-tabs-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 36px;
    background: transparent;
    pointer-events: none;
    border-radius: 0 0 0 0;
}

/* ── Flash-Message Auto-Dismiss ── */
@keyframes messageDismiss {
    0%   { opacity: 1; transform: translateX(0);   max-height: 120px; margin-bottom: 0.75rem; padding: 1rem 1.25rem; }
    60%  { opacity: 0; transform: translateX(30px); max-height: 120px; }
    100% { opacity: 0; max-height: 0; margin-bottom: 0; padding: 0; }
}
.message.dismissing {
    animation: messageDismiss 0.5s ease-in forwards;
    overflow: hidden;
    pointer-events: none;
}

/* Base style for Quick Menu Section headers in dropdown */
.quick-menu-group-title {
    display: block;
    padding: 0.45rem 0.75rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}
.quick-menu-group-title:first-of-type {
    margin-top: 0.15rem;
}

/* Slotra Reloaded Layout Compact overrides */
.dashboard > div[style*="background"],
.dashboard > .dashboard-top-section,
.dashboard > .help-section,
.dashboard > .selected-date-info {
    margin-top: 0.35rem !important;
    margin-bottom: 0.35rem !important;
}
.dashboard > .dashboard-top-section {
    gap: 0.4rem !important;
}
.dashboard-layout {
    gap: 0.75rem !important;
}
.dashboard-card {
    padding: 0.45rem 0.85rem !important;
}
.help-toggle {
    padding: 0.45rem 0.85rem !important;
}
.selected-date-info h3 {
    padding: 0.6rem 1rem !important;
}


/* ╔══════════════════════════════════════════════════════╗
   ║     SIDEBAR LAYOUT – eduslot 2026 Overhaul         ║
   ╚══════════════════════════════════════════════════════╝ */

:root {
    --sidebar-width: 216px;
}

@media (min-width: 1201px) {
    :root {
        --sidebar-width: var(--custom-sidebar-width, clamp(212px, 14vw, 236px));
    }
}

/* Layout wrapper splits sidebar + content */
.app-layout-wrapper.has-sidebar {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar Shell ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.07);
}

/* Main content area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem 2rem 2rem;
    min-height: 100vh;
    box-sizing: border-box;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: calc(100vw - var(--sidebar-width));
}

/* ── Sidebar Header ── */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0.9rem 0.9rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    gap: 0.5rem;
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    transition: opacity var(--transition-fast);
}
.sidebar-logo-link:hover { opacity: 0.82; }

.sidebar-logo-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.14);
}

.sidebar-logo-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-school-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sidebar-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
    opacity: 0.6;
}
.sidebar-collapse-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    opacity: 1;
}

/* Schließen-Button (✕) – nur auf Mobile/Tablet sichtbar (siehe Media-Queries) */
.sidebar-close-btn {
    display: none;
    background: var(--bg-secondary, #f3f4f6);
    border: none;
    cursor: pointer;
    color: var(--text-primary, #111);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}
.sidebar-close-btn:active { background: var(--border, #e5e7eb); }

/* ── Sidebar Nav ── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.65rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section-label {
    font-size: 0.61rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-secondary);
    padding: 0.9rem 0.6rem 0.2rem;
    opacity: 0.6;
    pointer-events: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.58rem 0.7rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(var(--primary-rgb), 0.07);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: rgba(var(--primary-rgb), 0.11);
    color: var(--primary);
    font-weight: 600;
}

/* Kontextaktionen der Sidebar: Sekundärfunktionen bleiben aus der normalen
   Navigation heraus und erscheinen nur per Rechtsklick bzw. mobilem ⋯. */
.sidebar-action-menu {
    position: fixed;
    z-index: 10070;
    width: min(248px, calc(100vw - 16px));
    padding: .4rem;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 11px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #172033);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .22), 0 2px 8px rgba(15, 23, 42, .1);
}

.sidebar-action-menu[hidden],
.sidebar-action-backdrop[hidden] {
    display: none !important;
}

.sidebar-action-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10060;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(1px);
}

.sidebar-action-menu__heading {
    overflow: hidden;
    padding: .38rem .58rem .48rem;
    color: var(--text-secondary, #64748b);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-action-menu__item {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr);
    align-items: center;
    gap: .46rem;
    width: 100%;
    min-height: 40px;
    padding: .5rem .6rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .82rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.sidebar-action-menu__item:hover,
.sidebar-action-menu__item:focus-visible {
    outline: none;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
}

.sidebar-action-menu__item.is-danger {
    color: #b42318;
}

.sidebar-action-menu__item.is-danger:hover,
.sidebar-action-menu__item.is-danger:focus-visible {
    background: #fff1f2;
    color: #b42318;
}

.sidebar-mobile-options {
    display: none;
}

@media (max-width: 1024px), (pointer: coarse) {
    .sidebar-link.has-sidebar-context {
        padding-right: 3.15rem !important;
    }

    .sidebar-mobile-options {
        position: absolute;
        top: 50%;
        right: .42rem;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0 0 .36rem;
        border: 1px solid color-mix(in srgb, var(--text-secondary) 28%, transparent);
        border-radius: 9px;
        background: color-mix(in srgb, var(--bg-primary, #fff) 88%, transparent);
        color: var(--text-primary);
        box-shadow: 0 2px 7px rgba(15, 23, 42, .07);
        font-size: 1.3rem;
        font-weight: 800;
        line-height: 1;
        transform: translateY(-50%);
        -webkit-tap-highlight-color: transparent;
    }

    .sidebar-mobile-options:active {
        background: color-mix(in srgb, var(--primary) 10%, var(--bg-primary, #fff));
        transform: translateY(-50%) scale(.95);
    }

    .sidebar-action-menu.is-mobile-sheet {
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: min(72vh, 560px);
        overflow-y: auto;
        padding: .48rem .7rem calc(.75rem + env(safe-area-inset-bottom, 0px));
        border-width: 1px 0 0;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -14px 36px rgba(15, 23, 42, .24);
    }

    .sidebar-action-menu.is-mobile-sheet::before {
        content: '';
        display: block;
        width: 42px;
        height: 4px;
        margin: .08rem auto .42rem;
        border-radius: 999px;
        background: #cbd5e1;
    }

    .sidebar-action-menu.is-mobile-sheet .sidebar-action-menu__item {
        grid-template-columns: 1.7rem minmax(0, 1fr);
        min-height: 52px;
        padding: .68rem .72rem;
        border-top: 1px solid color-mix(in srgb, var(--text-secondary) 18%, transparent);
        border-radius: 0;
        font-size: .95rem;
    }
}

.sidebar-link-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    line-height: 1;
}

.sidebar-link-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-fav-star {
    margin-left: auto;
    font-size: 0.75rem;
    color: #f59e0b;
    opacity: 0.75;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-fav-link {
    --sidebar-link-color: var(--sidebar-room-color, var(--primary));
    padding-left: 1.2rem;
    border-left: 4px solid var(--sidebar-link-color);
    background: color-mix(in srgb, var(--sidebar-link-color) 6%, transparent);
    margin-bottom: 4px;
    border-radius: 0 6px 6px 0;
}

.sidebar-fav-link .sidebar-link-text {
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-fav-link .sidebar-link-icon {
    /* Emojis might not inherit color, but regular icons will */
    color: var(--sidebar-link-color);
    text-shadow: 0 0 1px rgba(0,0,0,0.1);
    font-size: 1.1rem;
}

.sidebar-fav-link:hover {
    background: color-mix(in srgb, var(--sidebar-link-color) 12%, transparent);
    transform: translateX(2px);
}

.sidebar-fav-link:hover .sidebar-fav-star,
.sidebar-fav-link.active .sidebar-fav-star {
    opacity: 1;
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

.sidebar-fav-link.active {
    background: color-mix(in srgb, var(--sidebar-room-color, var(--primary)) 11%, transparent) !important;
    color: var(--sidebar-room-color, var(--primary)) !important;
}

.sidebar-fav-list {
    overflow: hidden;
    max-height: 1500px;
    transition: max-height 0.25s ease;
    flex-shrink: 0;
}

/* Ein-/Ausklappen über die Klasse .is-collapsed (per max-height) — NICHT über
   eine Fensterbreiten-Media-Query und NICHT über Abwesenheit von .is-open.
   Default (keine Klasse) = sichtbar. So sind die Favoriten selbst dann sichtbar,
   wenn das JS nicht läuft oder ein alter localStorage-Wert vorliegt. Nur ein
   bewusstes Einklappen (.is-collapsed) versteckt sie. */
.sidebar-fav-list.is-collapsed {
    max-height: 0;
}

/* ── Rollen-Umschalter (Ansicht) in der Sidebar-Fußzeile ── */
.sidebar-role-switch {
    margin-top: 0.6rem;
}
.sidebar-role-switch summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}
.sidebar-role-switch summary::-webkit-details-marker { display: none; }
.sidebar-role-switch summary::marker { content: ""; }
.srs-caret { font-size: 0.7rem; transition: transform 0.15s ease; }
.sidebar-role-switch[open] .srs-caret { transform: rotate(180deg); }
.sidebar-role-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}
.sidebar-role-menu a {
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-decoration: none;
}
.sidebar-role-menu a:hover { background: rgba(var(--primary-rgb), 0.08); }
.sidebar-role-menu a.active {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-role-menu a.srs-exit { color: #dc2626; margin-top: 2px; }

.sidebar-fav-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sidebar-fav-main-link {
    flex: 1;
    min-width: 0;
}

.sidebar-fav-toggle-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    margin-right: 4px;
    opacity: 0.55;
}
@media (max-width: 1024px) {
    .sidebar-fav-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        opacity: 1;
        background: rgba(var(--primary-rgb), 0.08);
        border-radius: 8px;
    }
    .sidebar-fav-row:hover .sidebar-fav-toggle-btn,
    .sidebar-fav-toggle-btn:hover { opacity: 1; }
}

.sidebar-fav-toggle-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    opacity: 1;
}

.sidebar-fav-row:hover .sidebar-fav-toggle-btn {
    opacity: 0.9;
}

.sidebar-badge {
    background: var(--primary);
    color: white;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.67rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
    border-top: 1px solid var(--glass-border);
    padding: 0.8rem 0.7rem;
    flex-shrink: 0;
}

.sidebar-demo-tag {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.07em;
    margin-bottom: 0.55rem;
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.4);
    overflow: hidden;
}

.sidebar-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    padding: 0.15rem 0.2rem;
    margin: -0.15rem -0.2rem;
    transition: background 0.15s;
}

.sidebar-profile-link:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-user-role {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
}
.sidebar-user-role.admin { color: var(--primary); }
.sidebar-user-role.teacher { color: var(--text-secondary); }

.sidebar-version {
    font-size: 0.6rem;
    color: var(--text-secondary);
    opacity: 0.55;
    padding-top: 3px;
    text-align: center;
    letter-spacing: 0.02em;
    line-height: 1.2;
    user-select: none;
}

.sidebar-logout-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    opacity: 0.7;
}
.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    opacity: 1;
}

/* ── Mobile overlay & toggle ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 201;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: var(--shadow-md);
    transition: background var(--transition-fast);
}
.sidebar-toggle-btn:hover { background: var(--bg-secondary); }

.sidebar-toggle-btn span {
    display: block;
    width: 17px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.22s ease;
}

/* ╔══════════════════════════════════════════════════════╗
   ║     ANIMATED ROOM TABS                               ║
   ╚══════════════════════════════════════════════════════╝ */

@keyframes tabSlideDown {
    from { opacity: 0; transform: translateY(-10px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.room-tabs-bar {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
}

.room-tab-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    position: relative;
    flex: 0 0 auto !important;
}

.has-tooltip {
    position: relative;
    display: inline-flex;
}

.has-tooltip .tooltip-text {
    visibility: hidden;
    width: max-content;
    background-color: #1a1c28;
    color: #ffffff;
    text-align: center;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    position: absolute;
    z-index: 1000;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    font-size: 0.72rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    pointer-events: none;
    white-space: nowrap;
}

.has-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1a1c28 transparent transparent transparent;
}

.has-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.room-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 1.05rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    background: color-mix(in srgb, var(--tab-color) 10%, white);
    color: var(--tab-color);
    border: 2px solid color-mix(in srgb, var(--tab-color) 22%, transparent);
    transform: none;
    will-change: background, border-color;
}

[data-theme="dark"] .room-tab {
    background: color-mix(in srgb, var(--tab-color) 16%, #1e1e2e);
}

.room-tab:hover {
    box-shadow: 0 2px 8px color-mix(in srgb, var(--tab-color) 28%, transparent);
    background: color-mix(in srgb, var(--tab-color) 18%, white);
    border-color: color-mix(in srgb, var(--tab-color) 40%, transparent);
}

.room-tab.active {
    background: var(--tab-color);
    color: white;
    border-color: var(--tab-color);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--tab-color) 40%, transparent);
}

.room-tab.is-navigating {
    opacity: 0.88;
}

.room-item-pill.room-tab-hidden {
    display: none !important;
}

.room-tab-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.room-tab-name {
    line-height: 1;
}

.room-tab-badge {
    font-size: 0.78rem;
    line-height: 1;
    opacity: 0.85;
    margin-left: -0.1rem;
}

.room-drag-handle {
    font-size: 0.85rem;
    opacity: 0;
    margin-left: 0.15rem;
    cursor: grab;
    color: var(--tab-color);
    transition: opacity .15s;
    user-select: none;
    touch-action: none;
}
.room-tab:hover .room-drag-handle {
    opacity: 0.5;
}
.room-tab.tab-dragging,
.room-tab-wrap.tab-dragging .room-tab {
    opacity: 0.45;
    transform: scale(0.96);
    box-shadow: 0 0 0 2px var(--tab-color);
}
.room-tab.tab-drag-over,
.room-tab-wrap.tab-drag-over .room-tab {
    outline: 2px dashed var(--tab-color);
    outline-offset: 2px;
    background: color-mix(in srgb, var(--tab-color) 18%, white);
}

/* Category tabs (dashboard) */
.category-tabs-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.category-tab-wrap {
    display: inline-flex;
}

.category-drag-handle {
    font-size: 0.85rem;
    opacity: 0;
    margin-right: 0.25rem;
    cursor: grab;
    color: inherit;
    transition: opacity .15s;
    user-select: none;
    touch-action: none;
}

.category-tab:hover .category-drag-handle {
    opacity: 0.5;
}

.category-tab-wrap.tab-dragging .category-tab {
    opacity: 0.45;
    transform: scale(0.96);
    box-shadow: 0 0 0 2px var(--primary);
}

.category-tab-wrap.tab-drag-over .category-tab {
    outline: 2px dashed var(--primary);
    outline-offset: 2px;
}

.category-tab-wrap.room-drop-over-category .category-tab {
    outline: 2px dashed var(--primary);
    outline-offset: 2px;
    background: color-mix(in srgb, var(--primary) 12%, white);
}

@media (hover: none) {
    .room-drag-handle,
    .category-drag-handle {
        opacity: 0.55 !important;
    }
}

/* Single room chip (when only 1 room) */
.room-single-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 1.1rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--tab-color) 11%, white);
    color: var(--tab-color);
    border: 2px solid color-mix(in srgb, var(--tab-color) 22%, transparent);
    font-weight: 600;
    font-size: 0.86rem;
    margin-bottom: 0.75rem;
}

/* Room Dropdown (≥5 rooms) */
.room-dropdown-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 0 0.9rem;
}

.room-dropdown-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

.room-dropdown-select {
    padding: 0.52rem 2.2rem 0.52rem 0.9rem;
    border-radius: 9999px;
    border: 2px solid color-mix(in srgb, var(--primary) 22%, transparent);
    background: color-mix(in srgb, var(--primary) 8%, white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
    max-width: 320px;
}

.room-dropdown-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.room-dropdown-select:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
    background-color: color-mix(in srgb, var(--primary) 13%, white);
}

[data-theme="dark"] .room-dropdown-select {
    background-color: color-mix(in srgb, var(--primary) 14%, #1e1e2e);
    color: var(--primary);
}

/* ╔══════════════════════════════════════════════════════╗
   ║     DATE STRIP (replaces old date header cards)      ║
   ╚══════════════════════════════════════════════════════╝ */

.dash-date-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: 0.85rem;
    border-left: 4px solid var(--room-color, var(--primary));
    box-shadow: var(--shadow-sm);
}

.dash-date-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.dash-date-weekday {
    color: var(--room-color, var(--primary));
    font-weight: 700;
}

.dash-date-sep {
    color: var(--border);
    font-weight: 300;
}

.dash-date-value { color: var(--text-secondary); }

.dash-date-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.dash-cal-btn {
    font-size: 1.05rem;
    text-decoration: none;
    padding: 0.28rem 0.42rem;
    border-radius: var(--radius);
    transition: background var(--transition-fast);
    line-height: 1;
}
.dash-cal-btn:hover { background: rgba(var(--primary-rgb), 0.08); }

/* Hide the old top-section date cards (replaced by dash-date-strip) */
.dashboard .dashboard-top-section {
    display: none !important;
}

/* ╔══════════════════════════════════════════════════════╗
   ║     RESPONSIVE BREAKPOINTS FOR SIDEBAR               ║
   ╚══════════════════════════════════════════════════════╝ */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: min(320px, 88vw);
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        z-index: 9998;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,0.2);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .sidebar-toggle-btn {
        display: none !important;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }

    /* Explizite display-Werte statt 'revert' – 'revert' setzt Flex/Inline-Block
       auf den Browser-Default zurück und verzerrt die mobile Sidebar. */
    .sidebar-link-text { display: inline-block !important; }
    .sidebar-school-name { display: inline-block !important; }
    .sidebar-category { display: block !important; flex-shrink: 0 !important; line-height: 1.2 !important; }
    .sidebar-fav-star { display: inline-block !important; }
    .sidebar-user-info { display: block !important; }
    .sidebar-tier-row { display: flex !important; }
    .sidebar-demo-tag { display: inline-block !important; }
    .sidebar-section-label { display: block !important; }
    .sidebar-version { display: block !important; }
    .sidebar-link { flex-shrink: 0 !important; }

    .sidebar-fav-list {
        display: block !important;
    }

    .sidebar-fav-header #sidebarFavToggleBtn {
        display: none !important;
    }

    .sidebar-link {
        justify-content: flex-start !important;
        padding: 0.65rem 0.85rem !important;
    }

    .sidebar-fav-link {
        padding-left: 2.3rem !important;
    }

    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
    }

    .notification-container {
        right: 12px !important;
        top: 12px !important;
    }
}

@media (min-width: 1025px) {
    .sidebar-toggle-btn {
        display: none;
    }

    /* Desktop: Sidebar offen — kein Transform, Inhalt bündig mit Sidebar-Breite */
    .app-layout-wrapper.has-sidebar .sidebar:not(.collapsed) {
        transform: none;
    }

    .app-layout-wrapper.has-sidebar .main-content {
        margin-left: var(--sidebar-width);
        max-width: calc(100vw - var(--sidebar-width));
        padding-left: 2rem;
    }

    .app-layout-wrapper.has-sidebar.sidebar-is-collapsed .sidebar,
    .app-layout-wrapper.has-sidebar:has(#appSidebar.collapsed) .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .app-layout-wrapper.has-sidebar.sidebar-is-collapsed .main-content,
    .app-layout-wrapper.has-sidebar:has(#appSidebar.collapsed) .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
        padding-left: 60px !important;
    }

    .app-layout-wrapper.has-sidebar.sidebar-is-collapsed .footer-legal,
    .app-layout-wrapper.has-sidebar:has(#appSidebar.collapsed) .footer-legal {
        margin-left: 0 !important;
    }

    /* Push down footer + credits so they clear sidebar */
    .footer-legal {
        margin-left: var(--sidebar-width);
    }
    .credits-button {
        /* already fixed bottom-right, fine */
    }
}

/* ── Compact icon-only sidebar for small desktops (1025-1200px) ── */
@media (min-width: 1025px) and (max-width: 1200px) {
    :root {
        --sidebar-width: 64px;
    }

    .sidebar-link-text,
    .sidebar-school-name,
    .sidebar-section-label,
    .sidebar-fav-star,
    .sidebar-user-info,
    .sidebar-tier-row,
    .sidebar-demo-tag,
    .sidebar-version {
        display: none !important;
    }

    .sidebar-fav-toggle-btn,
    .sidebar-badge,
    .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-footer .sidebar-user-info {
        display: none !important;
    }

    .sidebar-footer .sidebar-user-row {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }

    .sidebar-footer .sidebar-profile-link {
        justify-content: center;
    }

    .sidebar-footer .sidebar-user-avatar {
        width: 36px;
        height: 36px;
    }

    .sidebar-link {
        justify-content: center;
        padding: 0.65rem 0;
        border-radius: var(--radius-md);
        position: relative;
    }

    /* Tooltip on hover so icons are still understandable */
    .sidebar-link[title]:hover::after,
    .sidebar-link:hover > .sidebar-link-text {
        display: none;
    }

    .sidebar-link-icon {
        width: auto;
        font-size: 1.25rem;
        margin: 0;
    }

    .sidebar-header {
        justify-content: center;
        padding: 0.9rem 0.4rem;
        gap: 0;
    }

    .sidebar-logo-link {
        flex: 0 0 auto;
        gap: 0;
    }

    .sidebar-footer {
        padding: 0.6rem 0.3rem;
    }

    .sidebar-user-row {
        justify-content: center;
    }

    .sidebar-user-avatar {
        margin: 0 auto;
    }

    .sidebar-nav {
        padding: 0.5rem 0.3rem;
        align-items: stretch;
    }

    .sidebar-fav-row {
        justify-content: center;
    }

    .sidebar-fav-main-link {
        flex: 0 0 auto;
    }

    .sidebar-fav-link {
        padding-left: 0.7rem !important;
    }
}

/* ── CSS-driven sidebar collapsed state (no JS inline styles needed) ──
   Wrapper-Klasse .sidebar-is-collapsed + :has() als Fallback. */
@media (min-width: 1025px) {
    .app-layout-wrapper.has-sidebar.sidebar-is-collapsed #sidebarToggleBtn,
    .app-layout-wrapper.has-sidebar:has(#appSidebar.collapsed) #sidebarToggleBtn {
        display: flex !important;
    }
    .app-layout-wrapper.has-sidebar:not(.sidebar-is-collapsed):not(:has(#appSidebar.collapsed)) #sidebarToggleBtn {
        display: none;
    }
}

/* Dashboard: Datum-Streifen und Kursinhalt gleiche linke Kante */
.dashboard .dash-date-strip,
.dashboard .course-dashboard-container {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    box-sizing: border-box;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║   COMPREHENSIVE MOBILE & TABLET RESPONSIVE STYLES           ║
   ║   Covers: phones ≤ 480px, tablets ≤ 768px, ≤ 960px         ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* ── Global touch-target & form improvements ── */
@media (max-width: 960px) {
    /* Tighten main-content left padding so hamburger doesn't eat too much */
    .main-content {
        padding: 0.75rem 0.75rem 1.5rem 3.5rem !important;
    }

    /* Form controls: guaranteed touch-friendly height */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    input[type="search"],
    select,
    textarea,
    .form-control {
        min-height: 44px;
        font-size: 16px !important; /* prevents iOS zoom on focus */
        box-sizing: border-box;
    }

    /* All admin / content tables get horizontal scroll */
    .admin-table-wrap,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table:not(.week-table) {
        min-width: 500px;
    }

    /* Wrap tables that don't already have a scroll container */
    .admin-section table:not(.week-table),
    .admin-panel table:not(.week-table),
    .cms-table-wrap table:not(.week-table) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Notification bell: smaller on mobile so it doesn't dominate */
    .notification-bell {
        font-size: 1.2rem !important;
        padding: 8px !important;
    }

    /* Credits button: move higher so it doesn't overlap mobile nav bar */
    .credits-button {
        bottom: 70px;
        right: 14px;
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    /* About modal: anchor to bottom-right on mobile */
    .credits-modal {
        bottom: 88px;
        right: 12px;
        left: auto;
        width: min(320px, calc(100vw - 24px));
    }

    .credits-button {
        bottom: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
    }

    /* Dashboard layout: tighter padding on mobile */
    .dashboard-layout {
        padding: 0 !important;
        gap: 1rem;
    }

    /* Dashboard right panel: collapsible/compact on mobile */
    .dashboard-right-panel {
        min-height: unset !important;
    }

    /* Slot book buttons: stack vertically when space is tight */
    .slot-card > div[style*="flex"] {
        flex-wrap: wrap !important;
    }

    /* Book button: full width when stacked */
    .book-btn {
        min-height: 40px;
        touch-action: manipulation;
    }

    /* Week room tag: hide on very small slots, show in header */
    .week-room-tag {
        font-size: 0.7rem !important;
        padding: 0.1rem 0.4rem !important;
    }

    /* Make week selector dropdown scroll on mobile */
    .week-selector-dropdown {
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Sidebar footer: ensure user row doesn't overflow */
    .sidebar-user-info {
        min-width: 0;
        overflow: hidden;
    }
    .sidebar-user-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Footer: allow wrapping on narrow screens */
    .footer-legal {
        padding: 16px 8px;
        margin-left: 0 !important;
        font-size: 0.76rem;
    }
}

/* ── Tablet portrait & large phone landscape (≤ 768px) ── */
@media (max-width: 768px) {
    .main-content {
        padding: 0.75rem 0.6rem 1.5rem 3rem !important;
    }

    /* Modal: wider on tablets */
    .modal-content {
        max-width: 95vw !important;
        width: 95vw !important;
        margin: auto !important;
    }

    /* Quick-book modal: full width */
    #quickBookModal .modal-content {
        max-width: 98vw !important;
        width: 98vw !important;
    }

    /* Quick-book booking-type radio row: stack */
    #quickBookModal div[style*="display:flex"][style*="gap:0.5rem"] {
        flex-direction: column !important;
    }

    /* Admin form groups: full width */
    .form-row {
        flex-direction: column !important;
        gap: 0.75rem;
    }
    .form-group {
        width: 100% !important;
    }

    /* Slot card book buttons: stack on small slots */
    .slot-card .book-btn {
        font-size: 0.72rem;
        padding: 0.45rem 0.3rem;
    }

    /* Week title: wrap the room tag below on narrow screens */
    .week-title {
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }
    .week-room-tag {
        order: 3;
    }
    .week-dates {
        order: 2;
    }

    /* Dashboard widgets: disable sticky on mobile (causes layout issues) */
    .dashboard-ticker {
        position: static !important;
        top: auto !important;
    }

    /* Admin CMS tabs: horizontal scroll */
    .admin-tabs,
    .tab-nav,
    .cms-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        gap: 0.25rem;
    }

    /* Settings panels: stack 2-column grids */
    .settings-grid,
    .admin-grid-2col {
        grid-template-columns: 1fr !important;
    }

    /* Branding color pickers: wrap */
    .color-row,
    .color-picker-row {
        flex-wrap: wrap !important;
        gap: 0.5rem;
    }

    /* Room tabs: scroll horizontally, no wrapping mess */
    .room-tabs-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.4rem;
    }
    .room-tabs-bar::-webkit-scrollbar { display: none; }
    .room-tab {
        flex-shrink: 0 !important;
        padding: 0.48rem 1rem !important;
        font-size: 0.82rem !important;
    }

    /* Date strip: compact on tablet */
    .dash-date-strip {
        padding: 0.5rem 0.85rem;
    }
    .dash-date-left {
        font-size: 0.85rem;
    }

    /* Week overview: allow scroll if table overflows */
    .week-overview {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Help grid: single column */
    .help-grid {
        grid-template-columns: 1fr !important;
    }

    /* Slot card: tighter */
    .slot-card {
        font-size: 0.8rem !important;
    }
}

/* ── Phone portrait (≤ 480px) ── */
@media (max-width: 480px) {
    /* Less left padding — hamburger is only 44px wide, 2.8rem is enough */
    .main-content {
        padding: 0.6rem 0.5rem 1.5rem 2.8rem !important;
    }

    /* Notification bell: compact */
    .notification-bell {
        font-size: 1rem !important;
        padding: 6px !important;
    }
    .notification-container {
        top: 10px !important;
        right: 10px !important;
    }
    #notificationDropdown {
        min-width: 280px !important;
        max-width: calc(100vw - 20px) !important;
        right: -10px !important;
    }

    /* Hide room tag in week title on very small phones */
    .week-room-tag {
        display: none !important;
    }

    /* Week selector button: full width */
    .week-selector-btn {
        font-size: 0.72rem;
        padding: 0.3rem 0.5rem;
    }

    /* Slot block mini button: always visible + easier to tap on touch */
    .slot-block-mini {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        opacity: 1 !important;
    }
    .slot-card .slot-block-mini {
        opacity: 1 !important;
    }

    /* Credits button: hide on very small phones (too cluttered) */
    .credits-button {
        display: none !important;
    }

    /* Dashboard notices: smaller text */
    .dashboard > div[style*="background:#fef3c7"],
    .dashboard > div[style*="background:#fef9c3"] {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* Admin section headings */
    .admin-section h2,
    .page-title {
        font-size: 1.15rem;
    }

    /* Setup wizard card padding */
    .wizard-card-header {
        padding: 18px 18px 14px !important;
    }
    .wizard-card-body,
    .wizard-card > form {
        padding: 18px !important;
    }

    /* Wizard step circles: smaller */
    .step-circle {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
    }

    /* ── Dashboard: phone-specific fixes ── */

    /* Room tabs: horizontal scroll, no wrap */
    .room-tabs-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        gap: 0.3rem !important;
        /* hide scrollbar visually */
        scrollbar-width: none;
    }
    .room-tabs-bar::-webkit-scrollbar { display: none; }

    /* Room tab pills: smaller on phone */
    .room-tab {
        padding: 0.42rem 0.85rem !important;
        font-size: 0.78rem !important;
        flex-shrink: 0 !important;
    }

    /* Date strip: stack weekday+date on top, date-input+cal below */
    .dash-date-strip {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }
    .dash-date-left {
        font-size: 0.82rem;
        flex: 1 1 100%;
    }
    .dash-date-right {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
    .dash-date-right input[type="date"] {
        flex: 1;
        min-width: 0;
    }

    /* Help/FAQ section: tighter */
    .help-section summary.help-toggle {
        font-size: 0.78rem !important;
        padding: 0.4rem 0.75rem !important;
    }
    .help-content {
        padding: 0.6rem 0.5rem !important;
    }
    .help-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .help-card {
        padding: 0.75rem !important;
    }

    /* Slot cards: tighter text */
    .slot-card {
        font-size: 0.78rem !important;
    }
    .slot-course-name {
        font-size: 0.78rem !important;
    }
    .book-btn {
        font-size: 0.75rem !important;
        padding: 0.45rem 0.5rem !important;
    }

    /* Week table: allow horizontal scroll when needed */
    .week-overview {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Week title: compact */
    .week-title {
        font-size: 0.85rem !important;
    }
    .week-header-with-nav {
        gap: 0.3rem !important;
    }

    /* Widgets row: stack, no gap waste */
    .dashboard-widgets-row {
        gap: 0.6rem !important;
    }

    /* Ticker/widget cards: tighter */
    .dashboard-ticker,
    .week-overview {
        border-radius: var(--radius-lg) !important;
    }

    /* Week nav arrows: bigger tap target */
    .week-nav-arrow {
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 1rem !important;
    }
}

/* ── Landscape phone (short viewport) ── */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    /* Bottom-sheet modals: limit height in landscape */
    #quickBookModal .modal-content,
    #blockModal .modal-content {
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    .main-content {
        padding-top: 0.4rem !important;
    }
}


/* ================================================================
   MOBILE THEME — Topbar + Bottom Navigation
   Aktiv bei ≤ 768px (Handys & kleine Tablets)
   ================================================================ */

/* ── Mobile Topbar ── */
.mobile-topbar {
    display: none; /* nur auf mobile sichtbar */
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 54px;
    z-index: 5000;
    background: var(--bg-primary, #fff);
    border-bottom: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    align-items: center;
    padding: 0 10px;
    gap: 8px;
}

.mobile-topbar-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.mobile-topbar-menu:active { background: var(--border, #e5e7eb); }
.mobile-topbar-menu span {
    display: block;
    width: 18px; height: 2px;
    background: var(--text-primary, #111);
    border-radius: 2px;
}

.mobile-topbar-brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 0;
}
.mobile-topbar-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.mobile-topbar-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, #111);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.mobile-topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px; height: 40px;
    border: none;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-primary, #333);
    transition: background 0.15s;
}
.mobile-topbar-btn:active { background: var(--border, #e5e7eb); }
.mobile-topbar-badge {
    position: absolute;
    top: 3px; right: 3px;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

/* ── Mobile Bottom Navigation Bar ── */
.mobile-bottom-nav {
    display: none; /* nur auf mobile sichtbar */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 62px;
    z-index: 5000;
    background: var(--bg-primary, #fff);
    border-top: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
    align-items: stretch;
    padding: 0;
    /* Safe area for iPhone home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-secondary, #888);
    font-size: 0.66rem;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px 4px 4px;
    position: relative;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}
.mobile-nav-item svg {
    transition: color 0.15s, transform 0.15s;
}
.mobile-nav-item:active svg {
    transform: scale(0.9);
}
.mobile-nav-item.active {
    color: var(--brand-primary, #E91E63);
}
.mobile-nav-item.active svg {
    stroke: var(--brand-primary, #E91E63);
}
/* Dot indicator for active item */
.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px; height: 3px;
    background: var(--brand-primary, #E91E63);
    border-radius: 0 0 3px 3px;
}

.mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

/* ════════════════════════════════════════════════
   MOBILE LAYOUT OVERRIDES (≤ 768px)
   Topbar + Bottom-Nav ersetzen hamburger + floating buttons
   ════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Zeige Topbar + Bottom-Nav */
    .mobile-topbar { display: flex; }
    .mobile-bottom-nav { display: flex; }

    /* Verstecke alten Hamburger-Button — Bottom-Nav "Mehr" übernimmt */
    .sidebar-toggle-btn { display: none !important; }

    /* Slot block mini button: immer sichtbar (kein Hover auf Touch-Geräten) */
    .slot-block-mini,
    .slot-card .slot-block-mini {
        opacity: 1 !important;
    }

    /* Verstecke Desktop-Bell und Nachrichten-Toggle — Topbar übernimmt */
    .notification-container { display: none !important; }
    #nachrichtenToggle { display: none !important; }
    .credits-button { display: none !important; }

    /* Main-Content: Raum für Topbar (oben) + Bottom-Nav (unten) */
    /* Kein links-Padding mehr für Hamburger */
    .main-content {
        padding: 0.75rem 0.875rem 1.5rem !important;
        margin-left: 0 !important;
        max-width: 100vw !important;
        padding-top: calc(54px + 0.75rem) !important;
        padding-bottom: calc(62px + 1rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Notification-Dropdown: an Topbar andocken statt floating */
    #notificationDropdown {
        position: fixed !important;
        top: 54px !important;
        right: 8px !important;
        left: 8px !important;
        min-width: unset !important;
        max-width: unset !important;
        width: auto !important;
        border-radius: 12px !important;
    }

    /* Nachrichten-Panel: volle Höhe minus Topbar */
    .nachr-panel {
        top: 54px !important;
        height: calc(100dvh - 54px) !important;
    }

    /* Sidebar: volle Höhe, überdeckt Topbar und Bottom-Nav */
    .sidebar {
        top: 0 !important;
        height: 100dvh !important;
        z-index: 6000 !important;
    }
    .sidebar-overlay {
        top: 0 !important;
        z-index: 5999 !important;
    }

    /* Footer: kein linker Margin, genug unten */
    .footer-legal {
        margin-left: 0 !important;
        padding-bottom: calc(62px + 0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Modals: auch unterhalb Topbar beginnen lassen */
    .modal-overlay,
    #quickBookModal,
    #blockModal {
        padding-top: 62px !important;
    }

    /* Quick-book modal bleibt bottom-sheet */
    #quickBookModal {
        align-items: flex-end !important;
        padding-top: 0 !important;
    }
    #blockModal {
        align-items: flex-end !important;
        padding-top: 0 !important;
    }

    /* Page headings: etwas kompakter */
    .page-title h1,
    .admin-section h1,
    h1.page-title {
        font-size: 1.35rem !important;
    }

    /* Booking cards in Meine Buchungen: volle Breite */
    .booking-card,
    .buchung-card {
        border-radius: 12px !important;
    }

    /* Admin panels: kein horizontales Überlaufen */
    .admin-panel,
    .settings-panel {
        border-radius: 12px !important;
        overflow: hidden;
    }
}

/* ── Tablet landscape / large phone (768px–960px): Topbar ausblenden ── */
@media (min-width: 769px) and (max-width: 960px) {
    .mobile-topbar { display: none !important; }
    .mobile-bottom-nav { display: none !important; }
    /* Hamburger bleibt hier sichtbar (≤960px) */
}

/* ── Sehr kleines Handy (≤ 390px) ── */
@media (max-width: 390px) {
    .mobile-topbar-name { display: none; } /* Logo reicht */
    .mobile-nav-item span { font-size: 0.6rem; }
    .mobile-nav-item svg { width: 19px; height: 19px; }
}

/* ╔══════════════════════════════════════════════════════╗
   ║     PINNWAND – Rechte Sidebar                        ║
   ╚══════════════════════════════════════════════════════╝ */

:root {
    --pinboard-width: 260px;
}

.pinboard-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--pinboard-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid var(--glass-border);
    z-index: 190;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.07);
}

.pinboard-sidebar.pinboard-collapsed {
    transform: translateX(100%);
}

/* ── Header ── */
.pinboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0.9rem 0.9rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    gap: 0.5rem;
}

.pinboard-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.pinboard-header-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.pinboard-header-text {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.pinboard-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
    opacity: 0.6;
}
.pinboard-collapse-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    opacity: 1;
}

/* ── Admin bar ── */
.pinboard-admin-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.pinboard-new-btn,
.pinboard-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.pinboard-new-btn:hover,
.pinboard-new-btn.active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.3);
}
.pinboard-toggle-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.25);
}

/* ── Vertikale Pinnwand-Bereiche ── */
.pinboard-section {
    position: relative;
    min-height: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.pinboard-mail-section {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
}
.pinboard-mail-section .pinboard-mail-preview {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
}
.pinboard-articles-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 140px;
}
.pinboard-articles-section .pinboard-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.pinboard-activity-section {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 72px;
}
.pinboard-activity-section .pinboard-activity {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.pinboard-section-resize {
    position: absolute;
    z-index: 30;
    left: .35rem;
    right: .35rem;
    bottom: -1px;
    height: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: ns-resize;
    opacity: 0;
    transition: opacity .15s ease;
    touch-action: none;
}
.pinboard-section-resize span {
    display: block;
    width: 42px;
    height: 3px;
    margin: 6px auto 0;
    border-radius: 99px;
    background: var(--text-tertiary, #94a3b8);
    transition: background .15s ease, width .15s ease;
}
.pinboard-section-resize[hidden] { display: none !important; }
.pinboard-section > [hidden] { display: none !important; }
.pinboard-section-toggle { display:block; flex:0 0 40px; width:100%; min-height:40px; padding:8px 14px; text-align:left; border:0; background:transparent; color:var(--text-primary); font:600 .8rem/1.3 system-ui; cursor:pointer; }
.pinboard-section-toggle:focus-visible { outline:2px solid var(--primary); outline-offset:-3px; }
.pinboard-section.pinboard-section-collapsed { min-height:40px!important; }
#tabPanelPinnwand { overflow-y: auto; overflow-anchor: none; }
.pinboard-section:hover > .pinboard-section-resize,
.pinboard-section:focus-within > .pinboard-section-resize,
.pinboard-section-resize:focus-visible,
.pinboard-section-resize:active,
html.pinboard-section-resizing .pinboard-section-resize {
    opacity: 1;
}
.pinboard-section-resize:hover span,
.pinboard-section-resize:focus-visible span,
html.pinboard-section-resizing .pinboard-section-resize span {
    width: 64px;
    background: var(--primary);
}
html.pinboard-section-resizing,
html.pinboard-section-resizing * {
    cursor: ns-resize !important;
    user-select: none !important;
}

/* ── New article form ── */
.pinboard-new-form {
    padding: 0.7rem 0.7rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.pinboard-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    margin-bottom: 0.4rem;
    box-sizing: border-box;
    transition: border-color var(--transition-fast);
}
.pinboard-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
}

.pinboard-textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    resize: vertical;
    min-height: 80px;
    margin-bottom: 0.4rem;
    box-sizing: border-box;
    transition: border-color var(--transition-fast);
}
.pinboard-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
}

.pinboard-file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px dashed var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}
.pinboard-file-label:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pinboard-file-input {
    display: none;
}

.pinboard-form-btns {
    display: flex;
    gap: 0.4rem;
}

.pinboard-save-btn {
    flex: 1;
    padding: 0.38rem 0;
    border-radius: var(--radius-sm);
    font-size: 0.79rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--primary);
    color: #fff;
    transition: background var(--transition-fast);
}
.pinboard-save-btn:hover { background: var(--primary-dark); }

.pinboard-cancel-btn {
    flex: 1;
    padding: 0.38rem 0;
    border-radius: var(--radius-sm);
    font-size: 0.79rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.pinboard-cancel-btn:hover { background: var(--bg-tertiary); }

/* ── Content / Articles ── */
.pinboard-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.65rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.pinboard-content::-webkit-scrollbar { width: 4px; }
.pinboard-content::-webkit-scrollbar-track { background: transparent; }
.pinboard-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.pinboard-empty {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    padding: 2rem 0.5rem;
    line-height: 1.6;
}

/* ── Single article ── */
.pinboard-article {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
    flex-shrink: 0;
}
.pinboard-article:hover {
    box-shadow: var(--shadow);
}

.pinboard-article-hidden {
    opacity: 0.5;
    border-style: dashed;
}

.pinboard-article-img-wrap {
    width: 100%;
    max-height: 160px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.pinboard-article-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pinboard-article-body {
    padding: 0.65rem 0.7rem 0.5rem;
}

.pinboard-article-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.pinboard-article-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.pinboard-text-wrap {
    position: relative;
}
.pinboard-text-wrap.pinboard-text-collapsed {
    max-height: 76px;
    overflow: hidden;
}
.pinboard-text-wrap.pinboard-text-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
    pointer-events: none;
}

.pinboard-readmore-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid var(--border-light);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0;
    margin-top: 0.25rem;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.01em;
    transition: opacity var(--transition-fast);
}
.pinboard-readmore-btn:hover {
    opacity: 0.75;
}

.pinboard-article-date {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-top: 0.4rem;
}

/* ── Admin controls per article ── */
.pinboard-article-admin {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.55rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}
.pinboard-article-admin form {
    display: contents;
}

.pinboard-art-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.pinboard-art-btn svg {
    stroke: currentColor;
    flex-shrink: 0;
}
.pinboard-art-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.25);
}
.pinboard-art-del:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #EF4444 !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}

/* ── Drag handle ── */
.pinboard-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 28px;
    cursor: grab;
    color: var(--text-tertiary);
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: color var(--transition-fast), opacity var(--transition-fast);
    margin-right: 0.1rem;
}
.pinboard-article:hover .pinboard-drag-handle,
.pinboard-article:focus-within .pinboard-drag-handle,
.pinboard-drag-handle:active,
.pinboard-article.pinboard-dragging .pinboard-drag-handle {
    opacity: 1;
}
.pinboard-drag-handle:hover {
    color: var(--text-secondary);
}
.pinboard-drag-handle:active {
    cursor: grabbing;
}

/* ── Drag states ── */
.pinboard-article.pinboard-dragging {
    opacity: 0.35;
    box-shadow: none !important;
}
.pinboard-article.pinboard-drag-over {
    outline: 2px solid rgba(var(--primary-rgb), 0.45);
    outline-offset: 1px;
    background: rgba(var(--primary-rgb), 0.04);
}

/* ── Open button (when collapsed) ── */
.pinboard-open-btn {
    position: fixed;
    top: 50%;
    right: var(--pinboard-width);
    transform: translateY(-50%);
    z-index: 9999;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    width: 36px;
    height: 64px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.85rem;
    box-shadow: -4px 0 16px rgba(var(--primary-rgb), 0.35);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s ease, background 0.2s ease;
}
.pinboard-open-btn:hover {
    width: 44px;
    background: var(--primary-dark);
}
.pinboard-open-btn .pinboard-tab-icon {
    font-size: 0.9rem;
    line-height: 1;
}
.pinboard-open-btn .pinboard-tab-arrow {
    color: rgba(255,255,255,0.9);
    transition: transform 0.3s ease;
}
.pinboard-open-btn.is-collapsed {
    right: 0;
}
.pinboard-open-btn.is-collapsed .pinboard-tab-arrow {
    transform: rotate(180deg);
}
.pinboard-open-btn.pinboard-open-btn-disabled {
    right: 0;
    background: var(--text-muted, #9ca3af);
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
}
.pinboard-open-btn.pinboard-open-btn-disabled .pinboard-tab-arrow {
    transform: rotate(180deg);
}

/* ── Admin reactivate panel (when pinboard globally disabled) ── */
.pinboard-reactivate-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--pinboard-width);
    background: var(--bg-primary, #fff);
    border-left: 1px solid var(--glass-border, #e5e7eb);
    z-index: 9998;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.10);
    display: none;
}
.pinboard-reactivate-panel.is-open {
    display: flex;
}

/* ── Layout adjustments ── */
@media (min-width: 1025px) {
    .main-content.has-pinboard {
        margin-right: var(--pinboard-width);
    }
    .footer-legal.has-pinboard {
        margin-right: var(--pinboard-width);
    }
}

/* ── Inline Edit Form ── */
.pinboard-edit-form {
    border-top: 1px solid var(--border-light);
    padding: 0.75rem 0.85rem 0.6rem;
    background: var(--bg-secondary);
}
.pinboard-edit-form form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── Mobile: Pinnwand als Overlay ── */
@media (max-width: 1024px) {
    .pinboard-sidebar {
        width: min(92vw, 380px);
        z-index: 9997;
        box-shadow: -8px 0 40px rgba(0,0,0,0.18);
        /* Standardmäßig unsichtbar – User öffnet manuell */
        transform: translateX(100%);
    }
    .pinboard-sidebar.pinboard-mobile-open {
        transform: none !important;
    }
    .pinboard-open-btn {
        display: none !important;
    }
}

.pinboard-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9996;
    backdrop-filter: blur(2px);
}

/* ╔══════════════════════════════════════════════════════╗
   ║  SIDEBAR TABS (Pinnwand / To-do)                     ║
   ╚══════════════════════════════════════════════════════╝ */

.sidebar-tabs {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 2px;
    overflow: hidden;
}

.sidebar-tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.35rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    letter-spacing: -0.01em;
}
.sidebar-tab-btn:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
}
.sidebar-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.07);
}

.sidebar-tab-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  TODO PANEL                                          ║
   ╚══════════════════════════════════════════════════════╝ */

.todo-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.todo-add-form {
    padding: 0.65rem 0.75rem 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.todo-input-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.todo-input {
    flex: 1;
    padding: 0.42rem 0.6rem;
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    min-width: 0;
}
.todo-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
}

.todo-add-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.12s;
}
.todo-add-btn:hover {
    background: var(--primary-dark, var(--primary));
    transform: scale(1.1);
}

.todo-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.todo-empty {
    padding: 1.2rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.42rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: background 0.12s;
    position: relative;
}
.todo-item:hover {
    background: rgba(var(--primary-rgb), 0.05);
}
.todo-item:hover .todo-actions {
    opacity: 1;
}

.todo-check-form {
    flex-shrink: 0;
    margin-top: 1px;
}

.todo-check-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    padding: 0;
    flex-shrink: 0;
}
.todo-check-btn:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}
.todo-done .todo-check-btn {
    border-color: var(--primary);
    background: var(--primary);
}
/* Unicode-Icon-Styling für Todo-Buttons */
.todo-add-btn {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}
.todo-check-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}
.todo-edit-btn,
.todo-del-btn {
    font-size: 0.8rem;
    line-height: 1;
}

.todo-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.todo-text {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
    cursor: text;
    transition: color 0.15s;
}
.todo-done .todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}
.todo-text:hover {
    color: var(--primary);
}

.todo-edit-form {
    margin-top: 0.25rem;
}
.todo-edit-input {
    width: 100%;
    padding: 0.32rem 0.5rem;
    font-size: 0.76rem;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
    box-sizing: border-box;
}
.todo-edit-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.todo-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.15s;
    margin-top: 1px;
}
/* Auf Mobile kein Hover → Aktions-Icons immer komplett sichtbar */
@media (max-width: 960px) {
    .todo-actions {
        opacity: 1;
    }
}

.todo-edit-btn,
.todo-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
    color: var(--text-muted);
}
.todo-edit-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}
.todo-del-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Mobile: main content Padding damit Bottom-Nav nichts verdeckt */
@media (max-width: 960px) {
    .main-content {
        padding-bottom: 76px;
    }
}


/* --- Mobile Agenda View --- */
.mobile-agenda-wrapper {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .week-table-wrapper {
        display: none !important;
    }
    .mobile-agenda-wrapper {
        display: flex !important;
    }
}

.agenda-day {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.agenda-day.today {
    border: 2px solid var(--primary, #6366f1);
}

.agenda-day-header {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.agenda-day.today .agenda-day-header {
    background: var(--primary, #6366f1);
    color: #fff;
}

.agenda-day-header .day-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.agenda-day-header .day-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

.agenda-slots {
    display: flex;
    flex-direction: column;
}

.agenda-slot {
    display: flex;
    border-bottom: 1px solid var(--border, #e5e7eb);
    position: relative;
    background: var(--bg-card, #fff);
}

.agenda-slot:last-child {
    border-bottom: none;
}

.agenda-slot-time {
    width: 65px;
    flex-shrink: 0;
    padding: 1rem 0.5rem;
    text-align: center;
    border-right: 1px solid var(--border, #e5e7eb);
    background: var(--bg-body, #f8fafc);
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.agenda-slot-time strong {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.agenda-slot-content {
    flex-grow: 1;
    padding: 0.8rem;
    min-width: 0; /* for text truncation */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.agenda-slot.period-blocked .agenda-slot-content {
    background: repeating-linear-gradient(45deg, var(--bg-body) 0, var(--bg-body) 10px, var(--bg-card) 10px, var(--bg-card) 20px);
}

.agenda-slot.period-exclusive {
    border-left: 3px solid var(--primary);
}

.agenda-slot.clickable-slot {
    cursor: pointer;
    transition: background 0.2s;
}

.agenda-slot.clickable-slot:hover {
    background: rgba(var(--primary-rgb, 99, 102, 241), 0.05);
}

.agenda-slot .period-header {
    margin-bottom: 0.4rem;
}

/* UX Audit Part 2: Max-Width global constraints */
@media (min-width: 1400px) {
    .main-content {
        padding-left: calc((100vw - var(--sidebar-width) - var(--dashboard-page-width, 1200px)) / 2 + 2rem) !important;
        padding-right: calc((100vw - var(--sidebar-width) - var(--dashboard-page-width, 1200px)) / 2 + 2rem) !important;
    }
}
@media (min-width: 1400px) {
    .app-layout-wrapper.has-sidebar.sidebar-is-collapsed .main-content,
    .app-layout-wrapper.has-sidebar:has(#appSidebar.collapsed) .main-content {
        padding-left: calc((100vw - 60px - var(--dashboard-page-width, 1200px)) / 2 + 2rem) !important;
        padding-right: calc((100vw - 60px - var(--dashboard-page-width, 1200px)) / 2 + 2rem) !important;
    }
}

/* Resizing state: disable transitions and backdrop-filters to prevent layout wobble and repaint flickering */
html.is-resizing *,
html.is-resizing {
    transition: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.is-resizing .sidebar {
    will-change: width;
    background: var(--bg-primary, #fff) !important;
}

html.is-resizing .main-content {
    margin-left: var(--sidebar-width-frozen, var(--sidebar-width)) !important;
    max-width: calc(100vw - var(--sidebar-width-frozen, var(--sidebar-width))) !important;
    will-change: margin-left, max-width;
}

/* ╔══════════════════════════════════════════════════════╗
   ║  SIDEBAR DYNAMIC RESPONSIVE FIX                      ║
   ╚══════════════════════════════════════════════════════╝ */

/* Sidebar-Kategorie-Labels immer truncaten */
.sidebar-category {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex-shrink: 0 !important;
    line-height: 1.2 !important;
    /* Einheitliche Typografie für ALLE Abschnitts-Überschriften.
       Vorher hatten nur STAMMDATEN/SYSTEM inline-Styles → die großen
       Überschriften erbten Body-Default (zu groß/dunkel, wirkte verbogen). */
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    opacity: 0.7;
    padding: 0 0.7rem 0.35rem;
}

/* Sidebar-Link-Text: explizit kein Wrap + Ellipsis */
.sidebar-link-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Sidebar-Link: kein horizontales Überlaufen */
.sidebar-link {
    max-width: 100%;
    min-width: 0;
}

/* Sidebar-School-Name: harter Truncate auch auf Zwischengrößen */
.sidebar-school-name {
    max-width: calc(var(--sidebar-width) - 80px);
}

/* Smooth transition der Sidebar-Breite bei Resize */
.sidebar,
.main-content {
    transition:
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon-only Modus (1025–1200 px): Tooltip auf Sidebar-Links zeigen */
@media (min-width: 1025px) and (max-width: 1200px) {
    .sidebar-link {
        position: relative;
        overflow: visible;
    }
    .sidebar-link:hover::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-primary, #fff);
        border: 1px solid var(--border, #e2e8f0);
        border-radius: 7px;
        padding: 0.3rem 0.65rem;
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--text-primary, #1e293b);
        white-space: nowrap;
        z-index: 9999;
        box-shadow: 0 4px 14px rgba(0,0,0,0.12);
        pointer-events: none;
    }
}

/* Mittelgröße (769–960px): main-content Padding für Hamburger */
@media (min-width: 769px) and (max-width: 960px) {
    .main-content {
        padding-left: 3.8rem !important;
    }
}

/* Hauptinhalt auf sehr schmalen Fenstern nie überlaufen */
@media (max-width: 480px) {
    .main-content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .sidebar-school-name {
        max-width: 140px;
    }
}

/* Drag-and-Drop: Unterdrückung von Scrollen/Panning/Auswahl bei aktivem Ziehvorgang */
body.is-dragging-active,
body.is-dragging-active * {
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* ============================================================
   INVENTAR-MODUL – Mobile-Feinschliff (Tablet/Handy · Inventur)
   Klassen stammen aus den admin_resource_*-Templates.
   Zentral hier, damit nicht 7 Template-<style>-Bloecke noetig sind.
   ============================================================ */

/* Listen-Tabelle: lieber horizontal scrollen als Spalten quetschen */
.il-table { min-width: 600px; }

@media (max-width: 768px) {
    .res-stats { grid-template-columns: repeat(2, 1fr) !important; }
    .rd-grid   { grid-template-columns: repeat(2, 1fr) !important; }
    /* Massenbearbeitungs-Leiste nicht klebend (ueberdeckt sonst Inhalt) */
    .il-bulk { position: static; box-shadow: none; }
    .il-inp, .il-btn { min-height: 40px; }
}

@media (max-width: 480px) {
    .res-stats { grid-template-columns: 1fr 1fr !important; }
    .rd-grid   { grid-template-columns: 1fr !important; }
    /* Filterleiste gestapelt, volle Breite */
    .il-bar { flex-direction: column; align-items: stretch; }
    .il-bar > div { width: 100%; }
    .il-bar .il-inp, .il-bar input[type="search"] { width: 100% !important; min-width: 0 !important; }
    /* Bulk-Leiste gestapelt */
    .il-bulk { flex-direction: column; align-items: stretch; }
    .il-bulk .il-inp, .il-bulk .il-btn { width: 100%; }
    /* Reservierungs-/Dokument-Formulare bequem stapeln */
    .rd-card form { flex-direction: column; align-items: stretch; }
}

/* Finaler Wochenplan-Hardening-Block: spaet im CSS, damit alte Slot-Regeln
   die Buttons nicht wieder ineinander schieben. */
.week-table .slot-card {
    overflow: hidden !important;
}

.week-table .slot-book-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: .35rem !important;
    width: 100% !important;
    margin-top: .35rem !important;
}

.week-table .slot-book-actions > .book-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: .42rem .35rem !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.15 !important;
    font-size: .68rem !important;
    box-sizing: border-box !important;
}

.week-table .slot-book-actions > .book-btn:not(:first-child) {
    padding-left: .22rem !important;
    padding-right: .22rem !important;
    font-size: .64rem !important;
}

.week-table .slot-book-actions > .book-btn:first-child {
    grid-column: 1 / -1 !important;
}

.week-table .slot-book-actions > .book-btn:nth-child(2):last-child {
    grid-column: 1 / -1 !important;
}

.week-table .slot-card .slot-block-mini {
    position: absolute !important;
    right: .28rem !important;
    bottom: .28rem !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: rgba(255,255,255,.78) !important;
    box-shadow: none !important;
    font-size: .65rem !important;
    opacity: .62 !important;
    z-index: 2 !important;
}

/* Admin-Modus: Slotwerkzeuge als schmale Seitenleiste statt mitten im Inhalt. */
.slot-card.has-admin-rail,
.exclusive-info.has-admin-rail {
    position: relative;
    padding-right: 2rem !important;
}

.slot-admin-rail {
    position: absolute;
    top: .28rem;
    right: .28rem;
    bottom: .28rem;
    width: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .22rem;
    z-index: 4;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.slot-admin-rail::-webkit-scrollbar {
    display: none;
}

.slot-admin-rail::before {
    content: "";
    position: absolute;
    inset: -.15rem;
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(148,163,184,.24);
    box-shadow: 0 4px 12px rgba(15,23,42,.08);
}

.slot-admin-rail-form {
    display: flex;
    margin: 0 !important;
}

.slot-admin-rail .slot-admin-btn,
.slot-admin-rail .booking-gear-btn,
.slot-admin-rail .slot-block-mini {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 1.1rem !important;
    height: 1.1rem !important;
    min-width: 1.1rem !important;
    min-height: 1.1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-secondary);
    font-size: .67rem !important;
    line-height: 1 !important;
    opacity: .58;
}

.slot-admin-rail .slot-admin-btn:hover,
.slot-admin-rail .booking-gear-btn:hover,
.slot-admin-rail .slot-block-mini:hover {
    opacity: 1;
    color: #fff !important;
    background: var(--primary, #6366f1) !important;
}

.slot-admin-rail .booking-trash-btn {
    color: #b91c1c;
}

.slot-admin-rail .booking-trash-btn:hover {
    background: #dc2626 !important;
    color: #fff !important;
}

.slot-admin-rail .slot-lock-btn {
    color: #d97706;
}

.slot-admin-rail .slot-lock-btn:hover {
    background: #f59e0b !important;
    color: #fff !important;
}

.slot-admin-rail .slot-lock-icon {
    display: block;
    line-height: 1;
    transform: translateY(-.04rem);
}

.slot-card:hover .slot-admin-rail .slot-admin-btn,
.slot-card:focus-within .slot-admin-rail .slot-admin-btn,
.exclusive-info:hover .slot-admin-rail .slot-admin-btn,
.exclusive-info:focus-within .slot-admin-rail .slot-admin-btn {
    opacity: .92;
}

.week-table .booking-admin-wrap .booking-actions {
    display: none !important;
}
