/* Zeitfelder nebeneinander */
.time-row {
    display: flex;
    gap: 1rem;
}

.time-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.time-group label {
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-group input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    background: white;
}

.time-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile Anpassung für Zeitfelder */
@media (max-width: 768px) {
    .time-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .time-group {
        flex: none;
    }
    
    .time-group input {
        padding: 0.8rem;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
}

/* Bestehende CSS-Regeln bleiben unverändert... */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e40af, #3730a3);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left, .header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header i {
    font-size: 1.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.user-info i {
    color: #60a5fa;
}

/* Desktop-only Elemente */
.desktop-only {
    display: inline;
}

/* Buttons */
.add-btn, .login-btn, .logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.add-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.add-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.login-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.login-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(139, 92, 246, 0.3);
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(239, 68, 68, 0.3);
}

/* Action Container für Admin */
.action-container {
    background: white;
    padding: 1rem;
    margin: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.public-link {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.public-link:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Filter Section */
.filter-section, .filter-container {
    background: white;
    padding: 1rem;
    margin: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select, select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Farblegende */
.farblegende, .legende {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    margin-top: 0.5rem;
}

.farblegende-titel {
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.farblegende-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.farblegende-item, .legende-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.farblegende-item:hover, .legende-item:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.farbe {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Info Box für öffentliche Ansicht */
.info-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    margin: 1rem;
    overflow: hidden;
}

.info-content {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-content i {
    color: #0ea5e9;
    font-size: 1.5rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.info-text h3 {
    color: #0c4a6e;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-text p {
    color: #075985;
    line-height: 1.5;
    margin: 0;
}

/* Kalender Navigation */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.nav-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.current-month {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

/* Kalender Container */
.calendar-container {
    background: white;
    margin: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calendar-header, .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-day-header, .weekday {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
}

.calendar-grid, .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 80px;
    padding: 0.25rem;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    background: white;
}

.calendar-day:hover {
    background-color: #f9fafb;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.other-month {
    background-color: #f9fafb;
    color: #9ca3af;
}

.calendar-day.today {
    background-color: #eff6ff;
    border: 2px solid #3b82f6;
}

.calendar-day.has-termine {
    background-color: #fefce8;
}

.day-number {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.day-termine {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.termin-indicator {
    background: #3b82f6;
    color: white;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.625rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 2px;
}

.weitere-termine {
    color: #6b7280;
    font-size: 0.625rem;
    text-align: center;
    margin-top: 2px;
}

/* Tooltips */
.tooltip {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s;
    max-width: 250px;
    font-size: 0.875rem;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-termine {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tooltip-termin {
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.tooltip-termin-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tooltip-mannschaft {
    font-weight: 600;
    font-size: 0.75rem;
}

.tooltip-zeit {
    background: #f3f4f6;
    color: #374151;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 500;
}

.tooltip-termin-main {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.tooltip-termin-details {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.tooltip-typ {
    background: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

/* Modal - KORRIGIERT */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.3s;
}

.modal.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.modal.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.close-btn, .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.25rem;
    border-radius: 4px;
}

.close-btn:hover, .close:hover {
    color: #374151;
    background: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-help {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Wiederholung */
.wiederholung-group {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1rem;
}

.wiederholung-options {
    background: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 1rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-primary, .btn-secondary, .submit-btn, .cancel-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    flex: 1;
}

.btn-primary, .submit-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover, .submit-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-secondary, .cancel-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover, .cancel-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Termin Details */
.termin-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.termin-detail:last-child {
    border-bottom: none;
}

.termin-detail i {
    color: #6b7280;
    width: 1rem;
    text-align: center;
}

.termin-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.edit-btn, .delete-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.edit-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.edit-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Loading */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
}

.loading i {
    font-size: 2rem;
    color: #3b82f6;
}

.hidden {
    display: none !important;
}

/* Login Styles */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6b7280;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-btn-submit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.login-btn-submit:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #374151;
}

/* Mobile-Optimierungen */
@media (max-width: 768px) {
    /* Body und App-Container */
    body {
        padding-bottom: 2rem;
        overflow-x: hidden;
    }
    
    #app {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        padding-bottom: 0.5rem;
    }
    
    /* Desktop-only Elemente ausblenden */
    .desktop-only {
        display: none !important;
    }
    
    /* Header optimiert für Mobile */
    .header {
        padding: 0.5rem 0;
        position: sticky;
        top: 0;
    }
    
    .header-content {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }
    
    .header h1 {
        font-size: 0.95rem;
    }
    
    .header-title {
        flex: 1;
        min-width: 0;
    }
    
    .header-right {
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    /* User-Info kompakter */
    .user-info {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
        border-radius: 15px;
    }
    
    /* Buttons mobil-optimiert */
    .add-btn, .logout-btn, .public-link {
        padding: 0.6rem;
        min-width: 42px;
        min-height: 42px;
        justify-content: center;
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .add-btn i, .logout-btn i {
        font-size: 1.1rem;
    }
    
    /* Filter-Section mobil - SCHMALER */
    .filter-section {
        margin: 0.5rem 0.25rem;
        padding: 0.75rem 0.5rem;
        flex-direction: column;
        gap: 0.75rem;
        border-radius: 10px;
    }
    
    .filter-header {
        font-size: 0.9rem;
        align-self: flex-start;
    }
    
    .filter-select {
        width: 100%;
        padding: 0.75rem 0.5rem;
        font-size: 1rem;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }
    
    /* Legende mobil-optimiert - KOMPAKTER */
    .legende {
        gap: 0.4rem;
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .legende-item {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
        border-radius: 12px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }
    
    .farbe {
        width: 0.7rem;
        height: 0.7rem;
        border: 2px solid white;
        flex-shrink: 0;
    }
    
    /* Kalender-Navigation mobil - SCHMALER */
    .calendar-nav {
        margin: 0 0.25rem;
        padding: 0.6rem 0.5rem;
        border-radius: 10px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
    }
    
    .current-month {
        font-size: 1.1rem;
        text-align: center;
        font-weight: 600;
    }
    
    /* Kalender mobil-optimiert - SCHMALER UND HÖHER */
    .calendar-container {
        margin: 0.5rem 0.25rem;
        margin-bottom: 1.5rem;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .weekdays {
        background: linear-gradient(135deg, #f8fafc, #e2e8f0);
        padding: 0.3rem 0;
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 1px;
        background-color: #e5e7eb;
    }
    
    .weekday {
        padding: 0.4rem 0.1rem;
        font-size: 0.65rem;
        font-weight: 600;
        color: #475569;
        text-align: center;
        background: #f8fafc;
    }
    
    .calendar-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 1px;
        background-color: #e5e7eb;
    }
    
    /* KALENDER-ZELLEN SCHMALER UND HÖHER */
    .calendar-day {
        min-height: 70px;
        padding: 0.25rem 0.15rem;
        background: white;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        border: none;
        transition: all 0.2s;
        overflow: hidden;
    }
    
    .calendar-day:hover {
        background-color: #f1f5f9;
    }
    
    .calendar-day:active {
        background-color: #e2e8f0;
        transform: scale(0.98);
    }
    
    .calendar-day.today {
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        border: 1px solid #3b82f6;
        box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
    }
    
    .calendar-day.has-termine {
        background: linear-gradient(135deg, #fefce8, #fef3c7);
    }
    
    .calendar-day.other-month {
        background-color: #f8fafc;
        opacity: 0.6;
    }
    
    /* Tag-Nummer mobil - ZENTRIERT */
    .day-number {
        font-size: 0.7rem;
        font-weight: 600;
        margin-bottom: 0.2rem;
        line-height: 1;
        color: #374151;
        text-align: center;
    }
    
    .calendar-day.today .day-number {
        color: #1e40af;
        font-weight: 700;
    }
    
    /* Termine-Container optimiert */
    .day-termine {
        display: flex;
        flex-direction: column;
        gap: 1px;
        flex-grow: 1;
        overflow: hidden;
        align-items: center;
    }
    
    /* Termin-Indikatoren mobil - SCHMALER */
    .termin-indicator {
        font-size: 0.5rem;
        padding: 2px 3px;
        margin-bottom: 1px;
        border-radius: 3px;
        line-height: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 500;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        width: 100%;
        text-align: center;
        max-width: none;
    }
    
    /* Weitere Termine Anzeige - SCHMALER */
    .weitere-termine {
        font-size: 0.45rem;
        margin-top: 2px;
        color: #6b7280;
        text-align: center;
        font-weight: 500;
        padding: 1px 2px;
        background: rgba(107, 114, 128, 0.1);
        border-radius: 6px;
        width: 100%;
    }
    
    /* Modal mobil-optimiert */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
        border-radius: 12px;
    }
    
    .modal-header, .modal-body {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    /* Form mobil-optimiert */
    .form-group {
        gap: 0.5rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.8rem;
        font-size: 1rem;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }
    
    .form-group input:focus,
    .form-group select:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    
    /* Zeitfelder mobil */
    .time-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .time-group {
        flex: none;
    }
    
    .time-group input {
        padding: 0.8rem;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    /* Buttons in Formularen */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
        border-radius: 10px;
        font-weight: 600;
    }
    
    /* Termin-Details mobil */
    .edit-btn, .delete-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 8px;
        font-weight: 600;
    }
    
    /* Loading Spinner */
    .loading {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .loading i {
        font-size: 1.5rem;
    }
    
    /* Touch-optimierte Buttons */
    button, .btn, .nav-btn, .add-btn, .logout-btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    /* Action Container mobil */
    .action-container, .filter-container {
        margin: 0.5rem;
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    /* Info Box mobil */
    .info-content {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .info-content i {
        margin-top: 0;
        font-size: 1.5rem;
    }
    
    /* Tooltip mobil */
    .tooltip {
        max-width: 250px;
        font-size: 0.8rem;
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    /* Login-Container mobil */
    .login-container {
        margin: 0.75rem;
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .login-header i {
        font-size: 2rem;
    }
    
    .login-header h1 {
        font-size: 1.2rem;
    }
    
    /* Safe Area für neue iPhones */
    @supports (padding: max(0px)) {
        body {
            padding-bottom: max(2rem, env(safe-area-inset-bottom));
        }
        
        .calendar-container {
            margin-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.5rem));
        }
    }
}

/* Sehr kleine Bildschirme (< 480px) - NOCH SCHMALER */
@media (max-width: 480px) {
    .header {
        padding: 0.4rem 0;
    }
    
    .header h1 {
        font-size: 0.85rem;
    }
    
    .user-info {
        max-width: 100px;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .add-btn, .logout-btn {
        min-width: 38px;
        min-height: 38px;
        padding: 0.5rem;
    }
    
    .add-btn i, .logout-btn i {
        font-size: 1rem;
    }
    
    /* FILTER UND NAVIGATION NOCH SCHMALER */
    .filter-section {
        padding: 0.5rem 0.3rem;
        margin: 0.3rem 0.1rem;
    }
    
    .calendar-nav {
        margin: 0 0.1rem;
        padding: 0.5rem 0.3rem;
    }
    
    /* KALENDER CONTAINER MINIMALE MARGINS */
    .calendar-container {
        margin: 0.1rem;
        margin-bottom: 1rem;
    }
    
    .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .current-month {
        font-size: 1rem;
    }
    
    /* WOCHENTAGE NOCH KLEINER */
    .weekday {
        padding: 0.3rem 0.05rem;
        font-size: 0.6rem;
    }
    
    /* KALENDER-ZELLEN FÜR KLEINE BILDSCHIRME */
    .calendar-day {
        min-height: 65px;
        padding: 0.2rem 0.1rem;
    }
    
    .day-number {
        font-size: 0.65rem;
        margin-bottom: 0.15rem;
    }
    
    .termin-indicator {
        font-size: 0.45rem;
        padding: 1px 2px;
    }
    
    .weitere-termine {
        font-size: 0.4rem;
        padding: 1px;
    }
    
    .modal-content {
        width: 98%;
        margin: 2vh auto;
    }
    
    .modal-header, .modal-body {
        padding: 0.75rem;
    }
    
    /* LEGENDE NOCH KOMPAKTER */
    .legende-item {
        font-size: 0.6rem;
        padding: 0.2rem 0.3rem;
    }
    
    .farbe {
        width: 0.6rem;
        height: 0.6rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.75rem;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .btn-primary, .btn-secondary {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Landscape-Modus für kleine Bildschirme - EXTRA KOMPAKT */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 0.3rem 0;
    }
    
    .filter-section {
        padding: 0.5rem;
        margin: 0.3rem;
    }
    
    .calendar-nav {
        padding: 0.5rem;
        margin: 0 0.3rem;
    }
    
    /* LANDSCAPE: SEHR KOMPAKTE ZELLEN */
    .calendar-day {
        min-height: 35px;
        padding: 0.15rem;
    }
    
    .day-number {
        font-size: 0.65rem;
        margin-bottom: 0.05rem;
    }
    
    .termin-indicator {
        font-size: 0.45rem;
        padding: 1px 2px;
    }
    
    .weitere-termine {
        font-size: 0.4rem;
    }
    
    .weekday {
        padding: 0.3rem 0.1rem;
        font-size: 0.65rem;
    }
    
    .modal-content {
        max-height: 80vh;
    }
    
    .modal-header, .modal-body {
        padding: 0.5rem;
    }
    
    .calendar-container {
        margin-bottom: 0.5rem;
    }
}

/* Zusätzliche Sicherheits-Regeln für sehr kleine Viewports */
@media (max-height: 600px) {
    .calendar-day {
        min-height: 40px !important;
    }
    
    .day-number {
        font-size: 0.65rem !important;
        margin-bottom: 0.1rem !important;
    }
    
    .termin-indicator {
        font-size: 0.45rem !important;
        padding: 1px 2px !important;
    }
}

@media (max-height: 500px) {
    .calendar-day {
        min-height: 35px !important;
    }
    
    .filter-section {
        margin: 0.2rem !important;
        padding: 0.4rem !important;
    }
    
    .calendar-nav {
        margin: 0 0.2rem !important;
        padding: 0.4rem !important;
    }
    
    .calendar-container {
        margin: 0.2rem !important;
        margin-bottom: 0.5rem !important;
    }
}