
/* ========================================
   SCHEDULE FORM SPECIFIC STYLES
   ======================================== */

.schedule-form-group {
    margin-bottom: 2.1rem;
}

.schedule-form-label {
    display: block;
    margin-bottom: 0.9rem;
    color: var(--text-primary);
    font-weight: var(--font-weight-normal);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-size: var(--font-size-base);
}

.schedule-form-control {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-md);
}

.schedule-form-control:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.schedule-form-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-end;
}

.schedule-form-group.flex-1 {
    flex: 1;
}

.schedule-form-group.flex-2 {
    flex: 2;
}

.schedule-form-group.flex-0 {
    flex: 0;
}

/* Weekday Selector */
.weekday-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.weekday-option {
    cursor: pointer;
}

.weekday-option input[type="checkbox"] {
    display: none;
}

.weekday-option span {
    display: block;
    background: var(--bg-card);
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    transition: all var(--transition-base);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weekday-option span:hover {
    border-color: var(--primary-gradient-start);
    background: rgba(102, 126, 234, 0.05);
}

.weekday-option input[type="checkbox"]:checked + span {
    border-color: var(--primary-gradient-start);
    background: var(--primary-gradient-start);
    color: white;
}

/* ========================================
   FLOATING ACTION BUTTON
   ======================================== */

.schedule-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary-gradient-start);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    border: none;
}

.schedule-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.schedule-fab .material-symbols-outlined {
    color: white;
    font-size: 28px;
}

/* ========================================
   SCHEDULE MODAL
   ======================================== */

.schedule-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.schedule-modal-overlay.active {
    display: flex;
}

.schedule-modal {
    background: #1A1A1A;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    opacity: 1 !important;
}

.schedule-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #262626 !important;
    z-index: 10;
    opacity: 1 !important;
}

.schedule-modal-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.schedule-modal-title .material-symbols-outlined {
    font-size: 28px;
    color: var(--primary);
}

.schedule-modal-title h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.schedule-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.schedule-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.schedule-modal-close .material-symbols-outlined {
    font-size: 24px;
    color: var(--text-secondary);
}

.schedule-modal-body {
    padding: 2rem;
}

/* Form Styles im Modal */
.schedule-modal .schedule-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.schedule-modal .schedule-form-group {
    flex: 1;
    min-width: 0;
}

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

.schedule-modal .schedule-form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-overlay);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.schedule-modal .schedule-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.schedule-modal .weekday-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.schedule-modal .weekday-option {
    flex: 1;
    min-width: 50px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.schedule-modal .weekday-option input[type="checkbox"] {
    display: none;
}

.schedule-modal .weekday-option:hover {
    border-color: var(--primary);
}

.schedule-modal .weekday-option input[type="checkbox"]:checked + span {
    color: white;
}

.schedule-modal .weekday-option:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.schedule-modal .btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient-start);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.schedule-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.schedule-modal .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   COMPACT SCHEDULES HEADER
   ======================================== */

.section-header-main {
    margin-bottom: 0px !important;
}

.compact-schedules-header {
    margin-bottom: 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.section-header-main.compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-overlay) !important;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.section-header-main.compact .section-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-gradient-start);
}

.section-header-main.compact .section-icon .material-symbols-outlined {
    font-size: 24px;
    color: white;
    font-weight: 600;
}

.section-header-main.compact .section-title-group {
    flex: 1;
    min-width: 0;
}

.section-header-main.compact .section-title-group h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header-main.compact .section-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.compact-right-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-shrink: 0;
}

.schedules-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem var(--spacing-md);
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-lg);
    min-width: 60px;
}

.counter-number {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-gradient-start);
    line-height: 1;
}

.counter-label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.view-schedules-btn {
    background: var(--primary-gradient-start);
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.8rem var(--spacing-md);
    color: white;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-schedules-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.view-schedules-btn .material-symbols-outlined {
    font-size: 20px;
}


/* ========================================
   COMPACT SCHEDULES HEADER - CONNECTED TO CALENDAR
   ======================================== */

.compact-schedules-header {
    margin-bottom: 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.section-header-main.compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.section-header-main.compact .section-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-gradient-start);
}

.section-header-main.compact .section-icon .material-symbols-outlined {
    font-size: 24px;
    color: white;
    font-weight: 600;
}

.section-header-main.compact .section-title-group {
    flex: 1;
    min-width: 0;
}

.section-header-main.compact .section-title-group h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header-main.compact .section-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   CALENDAR SECTION - CONNECTED TO HEADER
   ======================================== */

.calendar-section-main {
    margin-top: 0 !important;
    margin-bottom: var(--spacing-2xl);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.modern-calendar-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
    padding: var(--spacing-xl);
    overflow-x: auto;
    overflow-y: hidden;
    border-top: none !important;
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}

/* Calendar Grid - Minimum width for horizontal scroll */
.modern-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    gap: 2px;
    background: rgba(255, 255, 255, 0.02);
    overflow: visible;
    min-width: 700px;
}

/* Calendar Day - Fixed minimum size */
.modern-calendar-day {
    background: var(--bg-card);
    min-width: 100px;
    min-height: 80px;
    padding: var(--spacing-sm);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .section-header-main.compact {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-lg);
        align-items: stretch;
        text-align: center;
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        border-bottom: none !important;
    }
    
    .modern-calendar-container {
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        border-top: none !important;
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .section-header-main.compact {
        padding: var(--spacing-md);
    }
    
    .modern-calendar-container {
        padding: var(--spacing-md);
    }
}
/* ========================================
   ACTIVE SCHEDULES MODAL
   ======================================== */

.active-schedules-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.active-schedules-modal.active {
    display: flex;
}

.active-schedules-modal-content {
    background: #1A1A1A;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    max-width: 1200px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header-schedules {
    padding: var(--spacing-xl) var(--spacing-2xl);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header-schedules h2 {
    margin: 0;
    font-size: var(--font-size-2xl);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
}

.modal-close-btn {
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
}

.modal-close-btn:hover {
    background: rgba(255, 75, 75, 0.1);
    border-color: rgba(255, 75, 75, 0.5);
    color: var(--color-danger);
}

.modal-close-btn .material-symbols-outlined {
    font-size: 24px;
}

.modal-body-schedules {
    padding: var(--spacing-xl) var(--spacing-2xl);
    overflow-y: auto;
    flex: 1;
}

.modal-body-schedules .modern-schedules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-xl);
}

/* ========================================
   CALENDAR SECTION
   ======================================== */

.calendar-section-main {
    margin-top: 0 !important;
    margin-bottom: var(--spacing-2xl);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.modern-calendar-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
    padding: var(--spacing-xl);
    overflow: hidden;
    border-top: none !important;
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
}

.modern-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
}

.calendar-title-modern {
    font-size: var(--font-size-2xl);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.calendar-nav-modern {
    display: flex;
    gap: var(--spacing-md);
}

.calendar-nav-btn {
    background: var(--bg-overlay);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.calendar-nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-gradient-start);
    color: var(--primary-gradient-start);
}

.modern-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.modern-calendar-day-header {
    background: var(--bg-overlay);
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-secondary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-calendar-day {
    background: var(--bg-card);
    aspect-ratio: 1;
    padding: var(--spacing-sm);
    position: relative;
    min-height: 80px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.modern-calendar-day:hover {
    background: var(--bg-card-hover);
}

.modern-calendar-day.today {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid var(--primary-gradient-start);
}

.modern-calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day-number-modern {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.calendar-doses-modern {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.calendar-dose-modern {
    background: var(--primary-gradient-start) !important;
    color: white !important;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    font-weight: var(--font-weight-medium);
}

/* ========================================
   SCHEDULES SECTION
   ======================================== */

.enhanced-schedules-section,
.enhanced-doses-section {
    margin-bottom: var(--spacing-2xl);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.section-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xl);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
}

.section-title-group h2 {
    margin: 0;
    font-size: var(--font-size-2xl);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
}

.section-description {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin: var(--spacing-xs) 0 0 0;
}

/* ========================================
   ACTIVE SCHEDULES GRID
   ======================================== */

.modern-schedules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-xl);
}

.modern-schedule-item {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.modern-schedule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient-start);
}

.modern-schedule-item:hover {
    border-color: var(--border-secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.schedule-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.schedule-item-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-white);
    margin: 0;
}

.schedule-status-badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    color: #10b981;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-details-modern {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.schedule-detail-modern {
    background: var(--bg-overlay);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.detail-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.detail-value {
    font-size: var(--font-size-lg);
    color: var(--text-white);
    font-weight: var(--font-weight-semibold);
}

.schedule-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-primary);
}

.modern-delete-btn {
    background: var(--bg-danger);
    border: 1px solid var(--border-danger);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.modern-delete-btn:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: rgba(255, 75, 75, 0.5);
    transform: translateY(-1px);
}

/* ========================================
   VIEW CONTROLS
   ======================================== */

.view-controls {
    display: flex;
    gap: var(--spacing-sm);
    background: var(--bg-overlay);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs);
}

.view-btn {
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.view-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary-gradient-start);
    color: white;
}

.view-btn .material-symbols-outlined {
    font-size: 18px;
}

/* ========================================
   DOSE VIEWS
   ======================================== */

.dose-view {
    display: none;
}

.dose-view.active {
    display: block;
}

.modern-doses-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.modern-dose-day {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.dose-day-header-modern {
    background: var(--bg-overlay);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dose-day-title {
    font-size: var(--font-size-xl);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.dose-day-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.today-badge-modern {
    background: var(--primary-gradient-start);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dose-items-container {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.modern-dose-item {
    background: var(--bg-overlay);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.modern-dose-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient-start);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.modern-dose-item:hover::before {
    transform: scaleY(1);
}

.modern-dose-item:hover {
    background: var(--bg-card);
    border-color: var(--border-secondary);
    transform: translateX(8px);
}

.dose-item-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.dose-peptide-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-white);
}

.dose-amount-info {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.dose-amount-value {
    color: var(--primary-gradient-start);
    font-weight: var(--font-weight-semibold);
}

/* ========================================
   COMPLETE BUTTON & STATES
   ======================================== */

.modern-complete-btn {
    background: transparent;
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.modern-complete-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    transform: translate(-50%, -50%);
    transition: all var(--transition-smooth);
}

.modern-complete-btn:hover:not(.completed):not(:disabled) {
    border-color: var(--primary-gradient-start);
    transform: scale(1.05);
}

.modern-complete-btn:hover:not(.completed):not(:disabled)::before {
    width: 100px;
    height: 100px;
}

.modern-complete-btn:hover:not(.completed):not(:disabled) .material-symbols-outlined {
    color: var(--primary-gradient-start);
}

.modern-complete-btn .material-symbols-outlined {
    color: var(--text-secondary);
    font-size: 24px;
    transition: all var(--transition-smooth);
}

.modern-complete-btn.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    animation: completionPulse 0.6s ease-out;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.modern-complete-btn.completed .material-symbols-outlined {
    color: white !important;
    font-weight: bold;
}

.modern-dose-item.completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.modern-dose-item.completed .dose-peptide-name {
    color: #10b981;
}

.modern-dose-item.completed .dose-amount-value {
    color: #10b981;
}

/* Completion Button Position Fix */
.dose-item-info + .modern-complete-btn,
.modern-dose-item .modern-complete-btn {
    align-self: center !important;
    margin-left: auto !important;
}

@keyframes completionPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    }
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    background: var(--bg-overlay);
    border: 1px dashed var(--border-secondary);
    border-radius: var(--radius-xl);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    font-size: var(--font-size-base);
    line-height: 1.6;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ========================================
   MOBILE RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    /* Schedule Form Mobile */
    .schedule-form-row {
        flex-direction: column !important;
        gap: var(--spacing-md) !important;
        align-items: stretch !important;
    }
    
    .schedule-form-group.flex-1,
    .schedule-form-group.flex-2,
    .schedule-form-group.flex-0 {
        flex: none !important;
        width: 100% !important;
    }
    
    .schedule-form-group {
        margin-bottom: 1.2rem !important;
    }
    
    .schedule-form-label {
        margin-bottom: 0.6rem !important;
        font-size: var(--font-size-sm) !important;
    }
    
    .schedule-form-control {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        min-height: 48px !important;
        padding: 0.875rem 1rem !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    .schedule-form-control:focus {
        border-color: var(--mobile-accent) !important;
        box-shadow: 0 0 0 3px var(--mobile-accent-soft) !important;
        background: var(--mobile-surface) !important;
    }
    
    /* Weekday Selector Mobile */
    .weekday-selector {
        gap: var(--spacing-xs) !important;
        margin-top: var(--spacing-sm) !important;
    }
    
    .weekday-option span {
        padding: var(--spacing-sm) !important;
        font-size: var(--font-size-sm) !important;
        min-height: 44px !important;
    }
    
    /* FAB Mobile */
    .schedule-fab {
        background: var(--mobile-accent) !important;
        box-shadow: var(--mobile-shadow-lg) !important;
        bottom: 80px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .schedule-fab:hover {
        box-shadow: 0 8px 24px rgba(62,136,249,.3) !important;
    }
    
    .schedule-fab .material-symbols-outlined {
        font-size: 24px;
        color: white !important;
    }
    
    /* Schedule Modal Mobile */
    .schedule-modal-overlay {
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
        padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
        align-items: flex-start !important;
        padding-top: 20px !important;
    }
    
    .schedule-modal {
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        box-shadow: var(--mobile-shadow-lg) !important;
        max-width: 100%;
        max-height: calc(100vh - 90px - env(safe-area-inset-bottom)) !important;
        margin-top: 10px !important;
        border-radius: var(--radius-xl) !important;
    }
    
    .schedule-modal-header {
        background: var(--mobile-surface) !important;
        border-bottom: 1px solid var(--mobile-border) !important;
        padding: 1rem 1.5rem;
    }
    
    .schedule-modal-title .material-symbols-outlined {
        color: var(--mobile-accent) !important;
    }
    
    .schedule-modal-title h2 {
        font-size: 1.25rem;
        color: var(--mobile-text) !important;
    }
    
    .schedule-modal-close .material-symbols-outlined {
        color: var(--mobile-text-mute) !important;
    }
    
    .schedule-modal-close:hover .material-symbols-outlined {
        color: #dc2626 !important;
    }
    
    .schedule-modal-body {
        background: var(--mobile-surface) !important;
        padding: 1.5rem;
        max-height: calc(100vh - 220px - env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: calc(1.5rem + 20px) !important;
    }
    
    /* Modal Form Elements */
    .schedule-modal .schedule-form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .schedule-modal .schedule-form-label {
        color: var(--mobile-text) !important;
        font-size: var(--font-size-sm);
        margin-bottom: 0.6rem;
    }
    
    .schedule-modal .schedule-form-control {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 16px;
        border-radius: 8px;
    }
    
    .schedule-modal .schedule-form-control:focus {
        border-color: var(--mobile-accent) !important;
        box-shadow: 0 0 0 3px var(--mobile-accent-soft) !important;
        background: var(--mobile-surface) !important;
    }
    
    .schedule-modal .schedule-form-control option {
        background: var(--mobile-surface) !important;
        color: var(--mobile-text) !important;
    }
    
    .schedule-modal .weekday-selector {
        gap: 0.5rem;
    }
    
    .schedule-modal .weekday-option {
        background: var(--mobile-surface-2) !important;
        border: 2px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        padding: 0.5rem;
        font-size: var(--font-size-sm);
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .schedule-modal .weekday-option:hover {
        border-color: var(--mobile-accent) !important;
        background: var(--mobile-accent-soft) !important;
    }
    
    .schedule-modal .weekday-option:has(input:checked) {
        background: var(--mobile-accent) !important;
        border-color: var(--mobile-accent) !important;
        color: white !important;
    }
    
    .schedule-modal .btn-primary {
        background: var(--mobile-accent) !important;
        color: white !important;
        min-height: 48px;
        padding: 1rem;
        box-shadow: var(--mobile-shadow-md) !important;
        font-weight: 600;
    }
    
    .schedule-modal .btn-primary:hover {
        box-shadow: 0 8px 24px rgba(62,136,249,.25) !important;
    }
    
    .schedule-modal .btn-primary .material-symbols-outlined {
        color: white !important;
    }
    
    /* Compact Header Mobile */
    .compact-schedules-header {
        margin-bottom: 0;
    }
    
    .section-header-main.compact {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-lg);
        align-items: stretch;
        text-align: center;
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }
    
    .section-header-main.compact::after {
        background: var(--mobile-border) !important;
    }
    
    .section-header-main.compact .section-icon {
        align-self: center;
        background: var(--mobile-accent) !important;
        box-shadow: var(--mobile-shadow-md) !important;
    }
    
    .section-header-main.compact .section-title-group h2 {
        font-size: 1.5rem;
        color: var(--mobile-text) !important;
    }
    
    .section-header-main.compact .section-description {
        font-size: 0.875rem;
        color: var(--mobile-text-mute) !important;
    }
    
    .compact-right-controls {
        width: 100%;
        flex-direction: row !important; 
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .schedules-counter {
        min-width: auto;
        padding: 0.35rem var(--spacing-md);
        background: var(--mobile-accent-soft) !important;
        border: 1px solid var(--mobile-accent) !important;
    }
    
    .counter-number {
        font-size: 1rem;
        color: white !important;
    }
    
    .counter-label {
        font-size: 0.6rem;
        color: white !important;
    }
    
    .view-schedules-btn {
        flex: 1;
        justify-content: center;
        padding: var(--spacing-md);
        min-height: 44px;
        background: var(--mobile-accent) !important;
        box-shadow: var(--shadow-primary) !important;
        color: white !important;
    }
    
    .view-schedules-btn:hover {
        box-shadow: 0 8px 24px rgba(62,136,249,.25) !important;
    }
    
    /* Active Schedules Modal Mobile */
    .active-schedules-modal {
        padding: 10px;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    .active-schedules-modal-content {
        max-height: 90vh;
        border-radius: var(--radius-lg);
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        box-shadow: var(--mobile-shadow-lg) !important;
    }
    
    .modal-header-schedules {
        padding: var(--spacing-lg);
        background: var(--mobile-surface) !important;
        border-bottom: 1px solid var(--mobile-border) !important;
    }
    
    .modal-header-schedules h2 {
        font-size: var(--font-size-xl);
        color: var(--mobile-text) !important;
    }
    
    .modal-close-btn {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text-mute) !important;
    }
    
    .modal-close-btn:hover {
        background: rgba(220, 38, 38, 0.1) !important;
        border-color: rgba(220, 38, 38, 0.3) !important;
        color: #dc2626 !important;
    }
    
    .modal-body-schedules {
        padding: var(--spacing-lg);
        background: var(--mobile-surface) !important;
    }
    
    .modal-body-schedules .modern-schedules-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Calendar Mobile */
    .calendar-section-main {
        margin-bottom: var(--spacing-xl);
    }
    
    .modern-calendar-container {
        padding: var(--spacing-md) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        border-top: none !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .modern-calendar-grid {
        min-width: 600px;
        grid-template-columns: repeat(7, minmax(85px, 1fr));
    }
    
    .modern-calendar-day {
        min-height: 70px;
    }
    
    .modern-calendar-day-header {
        min-width: 85px;
    }
    
    .modern-calendar-header {
        flex-direction: column;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
        padding: var(--spacing-sm) 0 !important;
    }
    
    .calendar-title-modern {
        font-size: var(--font-size-lg) !important;
        text-align: center;
    }
    
    .calendar-nav-modern {
        justify-content: center;
        gap: var(--spacing-sm);
    }
    
    .calendar-nav-btn {
        padding: var(--spacing-xs) var(--spacing-sm) !important;
        font-size: var(--font-size-xs) !important;
        min-height: 36px !important;
    }
    
    .modern-calendar-grid {
        min-height: auto !important;
        gap: 1px !important;
    }
    
    .modern-calendar-day {
        min-height: 70px !important;
        min-width: 85px !important;
        padding: 2px !important;
        overflow: hidden !important;
    }
    
    .modern-calendar-day-header {
        padding: var(--spacing-xs) !important;
        font-size: 0.6rem !important;
        min-height: 25px !important;
    }
    
    .calendar-day-number-modern {
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
        line-height: 1 !important;
    }
    
    .calendar-doses-modern {
        max-height: 100% !important;
        overflow: hidden !important;
        gap: 1px !important;
    }
    
    .calendar-dose-modern {
        font-size: 0.55rem !important;
        padding: 1px 2px !important;
        line-height: 1.4 !important;
        min-height: 14px !important;
        max-height: 14px !important;
        border-radius: 2px !important;
    }
    
    /* Calendar Scrollbar */
    .modern-calendar-container::-webkit-scrollbar {
        width: 4px;
    }
    
    .modern-calendar-container::-webkit-scrollbar-track {
        background: var(--mobile-surface-2);
        border-radius: 2px;
    }
    
    .modern-calendar-container::-webkit-scrollbar-thumb {
        background: var(--mobile-accent);
        border-radius: 2px;
    }
    
    /* Schedules Grid Mobile */
    .modern-schedules-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .modern-schedule-item {
        padding: var(--spacing-lg);
    }
    
    .schedule-item-title {
        font-size: var(--font-size-lg);
        line-height: 1.3;
    }
    
    .schedule-details-modern {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .schedule-detail-modern {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    /* Dose Items Mobile */
    .modern-dose-item {
        padding: var(--spacing-md);
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-md);
    }
    
    .dose-item-info {
        flex: 1;
        min-width: 0;
    }
    
    .dose-peptide-name {
        font-size: var(--font-size-base);
        line-height: 1.3;
    }
    
    .dose-amount-info {
        font-size: var(--font-size-sm);
    }
    
    /* Complete Button Mobile */
    .modern-complete-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }
    
    .modern-complete-btn .material-symbols-outlined {
        font-size: 20px !important;
    }
    
    /* Dose Day Headers Mobile */
    .dose-day-header-modern {
        padding: var(--spacing-md) var(--spacing-lg);
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .dose-day-title {
        font-size: var(--font-size-lg);
        text-align: center;
    }
    
    .dose-day-meta {
        justify-content: center;
        gap: var(--spacing-sm);
    }
    
    /* Action Buttons Mobile */
    .modern-delete-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
        min-height: 40px;
    }
    
    .schedule-actions {
        justify-content: center;
        padding-top: var(--spacing-md);
    }
    
    /* Empty States Mobile */
    .empty-state {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
    
    .empty-state-icon {
        font-size: 36px;
        margin-bottom: var(--spacing-md);
    }
    
    .empty-state h3 {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-sm);
    }
    
    .empty-state p {
        font-size: var(--font-size-sm);
    }
}

/* ========================================
   EXTRA SMALL SCREENS
   ======================================== */

@media (max-width: 480px) {
    .schedule-fab {
        width: 48px;
        height: 48px;
        bottom: 75px;
    }
    
    .schedule-fab .material-symbols-outlined {
        font-size: 22px;
    }
    
    .schedule-modal-header {
        padding: 1rem;
    }
    
    .schedule-modal-title h2 {
        font-size: 1.1rem;
    }
    
    .schedule-modal-body {
        padding: 1rem;
    }
    
    .schedule-modal .weekday-option {
        font-size: var(--font-size-xs);
        min-height: 40px;
        padding: 0.4rem;
    }
    
    .schedule-form-group {
        margin-bottom: 1rem !important;
    }
    
    .schedule-form-label {
        margin-bottom: 0.5rem !important;
        font-size: var(--font-size-xs) !important;
    }
    
    .schedule-form-control {
        padding: 0.75rem !important;
        font-size: 16px !important;
    }
    
    .weekday-option span {
        padding: var(--spacing-xs) !important;
        font-size: var(--font-size-xs) !important;
        min-height: 40px !important;
    }
    
    .section-header-main.compact {
        padding: var(--spacing-md);
    }
    
    .section-header-main.compact .section-description {
        font-size: 0.8rem;
    }
    
    .compact-right-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .view-schedules-btn {
        width: 100%;
    }
    
    .schedules-counter {
        align-self: center;
    }
    
    .modern-calendar-container {
        padding: var(--spacing-sm) !important;
    }
    
    .modern-calendar-day {
        min-height: 60px !important;
        max-height: 70px !important;
    }
    
    .calendar-day-number-modern {
        font-size: 0.65rem !important;
    }
    
    .modal-header-schedules {
        padding: var(--spacing-md);
    }
    
    .modal-header-schedules h2 {
        font-size: var(--font-size-lg);
    }
    
    .modal-body-schedules {
        padding: var(--spacing-md);
    }
    
    .modern-schedule-item {
        padding: var(--spacing-md);
    }
    
    .modern-dose-item {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .modern-complete-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }
    
    .modern-complete-btn .material-symbols-outlined {
        font-size: 18px !important;
    }
    
    .dose-day-header-modern {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .dose-day-title {
        font-size: var(--font-size-base);
    }
    
    .empty-state {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .empty-state-icon {
        font-size: 28px;
    }
    
    .empty-state h3 {
        font-size: var(--font-size-base);
    }
}

/* ========================================
   LANDSCAPE MODE
   ======================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .schedule-modal {
        max-height: calc(100vh - 70px) !important;
        margin-top: 5px !important;
    }
    
    .schedule-modal-body {
        max-height: calc(100vh - 180px) !important;
    }
    
    .schedule-modal-header {
        padding: 0.75rem 1.5rem !important;
    }
    
}

/* ========================================
   TOUCH & INTERACTION IMPROVEMENTS
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    .modern-complete-btn:hover:not(.completed):not(:disabled) {
        transform: none;
    }
    
    .modern-complete-btn:active:not(.completed):not(:disabled) {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .modern-schedule-item:hover {
        transform: none;
    }
    
    .modern-dose-item:hover {
        transform: none;
    }
    
    .view-btn:active {
        background: var(--primary-gradient-start);
        color: white;
    }
    
    .calendar-nav-btn:active {
        background: var(--primary-gradient-start);
        color: white;
    }
    
    .modern-delete-btn:active {
        background: rgba(255, 75, 75, 0.3);
        transform: scale(0.95);
    }
}

/* ========================================
   SAFE AREA & NOTCH SUPPORT
   ======================================== */

@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .schedule-fab {
            bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
        }
        
        .schedule-modal-body {
            padding-bottom: max(1.5rem, calc(1.5rem + env(safe-area-inset-bottom)));
        }
        
        .section-header-main {
            padding-left: max(var(--spacing-lg), env(safe-area-inset-left));
            padding-right: max(var(--spacing-lg), env(safe-area-inset-right));
        }
    }
}

/* Fallback for browsers without env() support */
@supports not (padding: max(0px)) {
    @media (max-width: 768px) {
        .schedule-modal-overlay {
            padding-bottom: 90px !important;
        }
        
        .schedule-modal {
            max-height: calc(100vh - 110px) !important;
        }
        
        .schedule-modal-body {
            max-height: calc(100vh - 240px) !important;
        }
    }
}

/* Desktop: Button weiter unten */
@media (min-width: 769px) {
    .schedule-fab {
        bottom: 30px;
    }
}

/* Peptide Color Classes for Calendar */
.calendar-dose-modern.peptide-color-0 {
    background: var(--primary-gradient-start) !important;
}

.calendar-dose-modern.peptide-color-1 {
    background: #f97316 !important; /* Orange */
}

.calendar-dose-modern.peptide-color-2 {
    background: #10b981 !important; /* Green */
}

.calendar-dose-modern.peptide-color-3 {
    background: #8b5cf6 !important; /* Purple */
}

.calendar-dose-modern.peptide-color-4 {
    background: #ec4899 !important; /* Pink */
}

.calendar-dose-modern.peptide-color-5 {
    background: #14b8a6 !important; /* Teal */
}

.calendar-dose-modern.peptide-color-6 {
    background: #f59e0b !important; /* Amber */
}

.calendar-dose-modern.peptide-color-7 {
    background: #06b6d4 !important; /* Cyan */
}

/* Dose Highlight Animation */
.modern-dose-item.dose-highlight {
    animation: doseHighlight 2s ease-in-out;
    position: relative;
}

@keyframes doseHighlight {
    0%, 100% {
        background: var(--bg-overlay);
        box-shadow: none;
    }
    10%, 90% {
        background: rgba(102, 126, 234, 0.15);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
        transform: scale(1.02);
    }
    50% {
        background: rgba(102, 126, 234, 0.2);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
        transform: scale(1.02);
    }
}

/* Cursor pointer for clickable calendar doses */
.calendar-dose-modern {
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.calendar-dose-modern:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Mobile White Mode */
@media (max-width: 768px) {
    .calendar-dose-modern:active {
        transform: scale(0.98);
    }
}

/* ============================================
   MULTIPLE DAILY DOSES - NEW STYLES
   ============================================ */

/* Checkbox Label Styling */
.schedule-form-label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.schedule-form-label.checkbox-label:hover {
    color: var(--primary);
}

.schedule-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Multiple Doses Section */
.multiple-doses-section {
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.field-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Multiple Doses Config Section */
#multiple-doses-config {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 1.5rem;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding: 1.5rem;
    }
}

/* Time Input Styling */
input[type="time"].schedule-form-control {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
}

input[type="time"].schedule-form-control::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(1);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

input[type="time"].schedule-form-control:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* Dose Times Container */
#dose-times-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/* Single Dose Time Section */
#single-dose-time-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   DOSE TIME BADGES IN UPCOMING DOSES
   ============================================ */

.dose-time-badge {
    display: inline-block;
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary-gradient-start);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    margin-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dose-amount-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   CALENDAR TIME DISPLAY ENHANCEMENTS
   ============================================ */

.calendar-dose-modern {
    font-size: 0.65rem;
    line-height: 1.3;
    padding: 3px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Better spacing for times in calendar */
.calendar-doses-modern {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ============================================
   MOBILE RESPONSIVE - MULTIPLE DOSES
   ============================================ */

@media (max-width: 768px) {
    /* Multiple Doses Section */
    .multiple-doses-section {
        padding: 1rem;
        margin: 1rem 0;
        background: var(--mobile-surface-2);
        border: 1px solid var(--mobile-border);
    }
    
    .schedule-form-label.checkbox-label {
        font-size: var(--font-size-sm);
    }
    
    .field-hint {
        font-size: 0.75rem;
        color: var(--mobile-text-mute);
    }
    
    /* Multiple Doses Config */
    #multiple-doses-config {
        background: var(--mobile-surface);
        border: 1px solid var(--mobile-border);
        padding: 1rem;
    }
    
    /* Time Inputs */
    input[type="time"].schedule-form-control {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        min-height: 48px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    input[type="time"].schedule-form-control:focus {
        border-color: var(--mobile-accent) !important;
        box-shadow: 0 0 0 3px var(--mobile-accent-soft) !important;
        background: var(--mobile-surface) !important;
    }
    
    /* Time picker indicator */
    input[type="time"].schedule-form-control::-webkit-calendar-picker-indicator {
        filter: brightness(0) invert(1);
        opacity: 0.6;
    }
    
    /* Dose Time Badges */
    .dose-time-badge {
        background: var(--mobile-accent-soft) !important;
        border: 1px solid rgba(102, 126, 234, 0.2);
        color: var(--mobile-accent) !important;
        font-size: 0.7rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    /* Calendar doses - smaller text on mobile */
    .calendar-dose-modern {
        font-size: 0.5rem;
        padding: 2px 4px;
        line-height: 1.2;
    }
    
    /* Dose Times Container */
    #dose-times-container {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .multiple-doses-section {
        padding: 0.875rem;
    }
    
    #multiple-doses-config {
        padding: 0.875rem;
    }
    
    .schedule-form-label.checkbox-label {
        font-size: 0.85rem;
    }
    
    .dose-time-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }
    
    .calendar-dose-modern {
        font-size: 0.45rem;
        padding: 1px 3px;
    }
}

/* ============================================
   ENHANCED VISUAL FEEDBACK
   ============================================ */

/* Highlight for time-based doses */
.modern-dose-item[data-time]:not([data-time=""]) {
    border-left: 3px solid var(--primary);
}

.modern-dose-item[data-time]:not([data-time=""]):hover {
    border-left-color: var(--primary-gradient-end);
}

/* Animation for multiple doses in same day */
.modern-dose-item[data-time] + .modern-dose-item[data-time] {
    margin-top: 0.5rem;
}

/* Success state enhancement */
.modern-dose-item.completed[data-time]:not([data-time=""]) {
    border-left-color: #10b981;
}

/* ============================================
   CALENDAR PEPTIDE COLORS (EXTENDED)
   ============================================ */

.calendar-dose-modern.peptide-color-0 {
    background: var(--primary-gradient-start) !important;
}

.calendar-dose-modern.peptide-color-1 {
    background: #f97316 !important; /* Orange */
}

.calendar-dose-modern.peptide-color-2 {
    background: #10b981 !important; /* Green */
}

.calendar-dose-modern.peptide-color-3 {
    background: #8b5cf6 !important; /* Purple */
}

.calendar-dose-modern.peptide-color-4 {
    background: #ec4899 !important; /* Pink */
}

.calendar-dose-modern.peptide-color-5 {
    background: #14b8a6 !important; /* Teal */
}

.calendar-dose-modern.peptide-color-6 {
    background: #f59e0b !important; /* Amber */
}

.calendar-dose-modern.peptide-color-7 {
    background: #06b6d4 !important; /* Cyan */
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus states for checkboxes */
.schedule-checkbox:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Focus states for time inputs */
input[type="time"].schedule-form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   PRINT STYLES (BONUS)
   ============================================ */

@media print {
    .dose-time-badge {
        background: transparent;
        border: 1px solid #000;
        color: #000;
    }
    
    .calendar-dose-modern {
        background: transparent !important;
        border: 1px solid #000;
        color: #000;
    }
}

/* ========================================
   CALENDAR SECTION - HORIZONTAL SCROLLABLE ON ALL DEVICES
   ======================================== */

.calendar-section-main {
    margin-top: 0 !important;
    margin-bottom: var(--spacing-2xl);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.modern-calendar-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
    padding: var(--spacing-xl);
    border-top: none !important;
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
    
    /* NEW: Horizontal scrolling für alle Geräte */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Calendar Grid - Minimum width für horizontal scroll */
.modern-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 2px;
    background: rgba(255, 255, 255, 0.02);
    min-width: 840px; /* 7 Tage × 120px */
    overflow: visible;
}

/* Calendar Day - Fixed minimum size */
.modern-calendar-day {
    background: var(--bg-card);
    min-width: 120px;
    min-height: 100px;
    padding: var(--spacing-sm);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

/* Desktop Horizontal Scrollbar Styling */
.modern-calendar-container::-webkit-scrollbar {
    height: 8px;
}

.modern-calendar-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 0 var(--radius-xl);
}

.modern-calendar-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modern-calendar-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Firefox Scrollbar */
.modern-calendar-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) rgba(255, 255, 255, 0.02);
}

/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .modern-calendar-container {
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        border-top: none !important;
        padding: var(--spacing-lg);
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .modern-calendar-grid {
        min-width: 700px;
        grid-template-columns: repeat(7, minmax(100px, 1fr));
    }
    
    .modern-calendar-day {
        min-width: 100px;
        min-height: 80px;
    }
    
    /* Mobile Scrollbar */
    .modern-calendar-container::-webkit-scrollbar {
        height: 4px;
    }
    
    .modern-calendar-container::-webkit-scrollbar-track {
        background: var(--mobile-surface-2);
        border-radius: 2px;
    }
    
    .modern-calendar-container::-webkit-scrollbar-thumb {
        background: var(--mobile-accent);
        border-radius: 2px;
    }
}

@media (max-width: 480px) {
    .modern-calendar-container {
        padding: var(--spacing-md);
    }
    
    .modern-calendar-day {
        min-height: 60px !important;
        max-height: 70px !important;
    }
}

/* ========================================
   DESKTOP SPECIFIC - Larger screens
   ======================================== */

@media (min-width: 769px) {
    .modern-calendar-day:hover {
        background: var(--bg-card-hover);
        transform: translateY(-2px);
    }
}

/* ========================================
   SCROLL HINT INDICATOR (Optional)
   ======================================== */

.modern-calendar-container::after {
    content: '← Scroll →';
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(102, 126, 234, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    pointer-events: none;
    opacity: 0;
    animation: scrollHintFade 4s ease-in-out;
}

@keyframes scrollHintFade {
    0%, 20% { opacity: 0; }
    40%, 60% { opacity: 0.8; }
    80%, 100% { opacity: 0; }
}

/* Zeige Scroll-Hint nur wenn Kalender breiter als Container */
.modern-calendar-container:has(.modern-calendar-grid)::after {
    animation: scrollHintFade 4s ease-in-out;
}

/* ========================================
   CALENDAR GRID - CORRECTED FOR GAPS
   ======================================== */

/* Calendar Grid - Minimum width INKLUSIVE gaps */
.modern-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 2px;
    background: rgba(255, 255, 255, 0.02);
    /* KORRIGIERT: 7 Spalten × 120px + 6 gaps × 2px = 852px */
    min-width: 852px;
    overflow: visible;
}

/* Calendar Day - Fixed minimum size */
.modern-calendar-day {
    background: var(--bg-card);
    min-width: 120px;
    min-height: 100px;
    padding: var(--spacing-sm);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

/* ========================================
   MOBILE ADJUSTMENTS - CORRECTED
   ======================================== */

@media (max-width: 768px) {
    .modern-calendar-grid {
        /* KORRIGIERT: 7 Spalten × 100px + 6 gaps × 2px = 712px */
        min-width: 712px;
        grid-template-columns: repeat(7, minmax(100px, 1fr));
        gap: 2px;
    }
    
    .modern-calendar-day {
        min-width: 100px;
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    .modern-calendar-grid {
        /* KORRIGIERT: 7 Spalten × 85px + 6 gaps × 1px = 601px */
        min-width: 601px;
        grid-template-columns: repeat(7, minmax(85px, 1fr));
        gap: 1px; /* Kleinerer gap auf sehr kleinen Bildschirmen */
    }
    
    .modern-calendar-day {
        min-width: 85px;
        min-height: 60px !important;
        max-height: 70px !important;
    }
}

/* ========================================
   CALENDAR HEADER - FIXED, NO HORIZONTAL SCROLL
   ======================================== */

.modern-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);

    /* NEW: Position sticky, scrollt NICHT horizontal mit */
    position: sticky;
    left: 0;
    z-index: 10;
}

.calendar-title-modern {
    font-size: var(--font-size-2xl);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.calendar-nav-modern {
    display: flex;
    gap: var(--spacing-md);
}

.calendar-nav-btn {
    background: var(--bg-overlay);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.calendar-nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-gradient-start);
    color: var(--primary-gradient-start);
}

/* ========================================
   CALENDAR CONTAINER - STRUKTUR ANPASSEN
   ======================================== */

.modern-calendar-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
    padding: var(--spacing-xl);
    border-top: none !important;
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
    
    /* Horizontal scrolling NUR für den Calendar Grid */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   MOBILE: LEFT ALIGNED HEADER (NO SCROLL)
   ======================================== */

@media (max-width: 768px) {
    .modern-calendar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
        padding: var(--spacing-sm) var(--spacing-lg) !important;
        margin-bottom: var(--spacing-lg);
        position: sticky;
        left: 0;
        right: 0;
        z-index: 10;
    }
    
    .calendar-title-modern {
        font-size: var(--font-size-lg) !important;
        color: var(--mobile-text) !important;
        width: 100%;
    }
    
    .calendar-nav-modern {
        width: 100%;
        justify-content: flex-start;
        gap: var(--spacing-sm);
    }
    
    .calendar-nav-btn {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        padding: var(--spacing-xs) var(--spacing-sm) !important;
        font-size: var(--font-size-xs) !important;
        min-height: 36px !important;
        flex: 1;
        justify-content: center;
    }
    
    .calendar-nav-btn:hover,
    .calendar-nav-btn:active {
        background: var(--mobile-accent-soft) !important;
        border-color: var(--mobile-accent) !important;
        color: var(--mobile-accent) !important;
    }
    
    .calendar-nav-btn .material-symbols-outlined {
        font-size: 18px;
    }
    
    .modern-calendar-container {
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        border-top: none !important;
        padding: var(--spacing-lg);
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .modern-calendar-header {
        padding: var(--spacing-sm) var(--spacing-md) !important;
        gap: var(--spacing-sm);
    }
    
    .calendar-title-modern {
        font-size: var(--font-size-base) !important;
    }
    
    .calendar-nav-btn {
        padding: var(--spacing-xs) !important;
        font-size: 0.7rem !important;
        min-height: 32px !important;
    }
    
    .calendar-nav-btn .material-symbols-outlined {
        font-size: 16px;
    }
}

/* ========================================
   SCHEDULE MODAL - iOS SAFARI FIXES
   ======================================== */

/* Problem 1: Horizontal Scroll im Modal Body verhindern */
.schedule-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    overflow: hidden; /* NEW: Verhindert Scroll im Overlay */
}

.schedule-modal {
    background: #1A1A1A;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden; /* NEW: Verhindert horizontalen Scroll */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    opacity: 1 !important;
}

.schedule-modal-body {
    padding: 2rem;
    overflow-x: hidden; /* NEW: Verhindert horizontalen Scroll im Body */
    width: 100%; /* NEW: Volle Breite */
    box-sizing: border-box; /* NEW: Padding inkludiert */
}

/* Problem 2: Input Fields zu breit auf iOS Safari */
.schedule-form-control,
.schedule-form-control[type="text"],
.schedule-form-control[type="number"],
.schedule-form-control[type="date"],
.schedule-form-control[type="time"],
.schedule-form-control select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    padding: 0.8rem !important;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-md);
    
    /* iOS Safari specific fixes */
    -webkit-appearance: none !important;
    appearance: none !important;
    min-width: 0 !important;
}

/* Form Groups - Prevent overflow */
.schedule-form-group {
    margin-bottom: 2.1rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

.schedule-form-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-end;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Multiple Doses Time Container */
#dose-times-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#dose-times-container .schedule-form-row {
    width: 100% !important;
    max-width: 100% !important;
}

#dose-times-container .schedule-form-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

#dose-times-container input[type="time"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* ========================================
   MOBILE SPECIFIC FIXES
   ======================================== */

@media (max-width: 768px) {
    .schedule-modal-overlay {
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(8px) !important;
        padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
        align-items: flex-start !important;
        padding-top: 20px !important;
        overflow: hidden !important; /* NEW: Kein horizontaler Scroll */
    }
    
    .schedule-modal {
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        box-shadow: var(--mobile-shadow-lg) !important;
        max-width: 100%;
        max-height: calc(100vh - 90px - env(safe-area-inset-bottom)) !important;
        margin: 0;
        margin-top: 10px !important;
        border-radius: var(--radius-xl) !important;
        opacity: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important; /* NEW: Kein horizontaler Scroll */
        width: 100% !important;
    }
    
    .schedule-modal-body {
        background: var(--mobile-surface) !important;
        padding: 1.5rem;
        max-height: calc(100vh - 220px - env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important; /* NEW: Kein horizontaler Scroll */
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: calc(1.5rem + 20px) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Form Elements in White Mode - iOS FIX */
    .schedule-modal .schedule-form-row {
        flex-direction: column !important;
        gap: var(--spacing-md) !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .schedule-modal .schedule-form-group {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 1.2rem !important;
        overflow: hidden !important;
        min-width: 0 !important;
    }
    
    .schedule-modal .schedule-form-control {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        min-height: 48px !important;
        padding: 0.875rem 1rem !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        
        /* iOS Safari specific */
        -webkit-appearance: none !important;
        -webkit-box-sizing: border-box !important;
        -webkit-border-radius: 8px !important;
        min-width: 0 !important;
    }
    
    /* Date & Time Inputs - iOS CRITICAL FIX */
    .schedule-modal input[type="date"],
    .schedule-modal input[type="time"] {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        min-height: 48px !important;
        max-height: 48px !important;
        height: 48px !important;
        padding: 0.875rem 1rem !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        
        /* iOS Safari critical fixes */
        -webkit-appearance: none !important;
        appearance: none !important;
        -webkit-box-sizing: border-box !important;
        -webkit-border-radius: 8px !important;
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        min-width: 0 !important;
        flex-shrink: 1 !important;
    }
    
    /* Multiple Doses Config */
    #multiple-doses-config {
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        padding: 1rem;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* Dose Times Container - Mobile Fix */
    #dose-times-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    #dose-times-container .schedule-form-row {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    #dose-times-container .schedule-form-group {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    #dose-times-container input[type="time"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

@media (max-width: 480px) {
    .schedule-modal {
        max-height: calc(100vh - 100px - env(safe-area-inset-bottom)) !important;
    }
    
    .schedule-modal-body {
        padding: 1rem;
        max-height: calc(100vh - 240px - env(safe-area-inset-bottom)) !important;
    }
    
    .schedule-modal input[type="date"],
    .schedule-modal input[type="time"] {
        min-height: 44px !important;
        max-height: 44px !important;
        height: 44px !important;
        padding: 0.75rem 1rem !important;
    }
}

/* iOS Safari specific fixes using feature detection */
@supports (-webkit-touch-callout: none) {
    .schedule-modal-body,
    .schedule-modal-overlay {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden !important;
    }
    
    .schedule-modal input[type="date"],
    .schedule-modal input[type="time"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        min-height: 48px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
}


    /* ========================================
   DOSES SEGMENTED CONTROL
   ======================================== */

.doses-segmented-control {
    display: flex;
    background: var(--bg-overlay);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 4px;
    margin-bottom: var(--spacing-xl);
    gap: 4px;
}

.segment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.segment-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.segment-btn.active {
    background: var(--primary-gradient-start);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.segment-label {
    white-space: nowrap;
}

.segment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 75, 75, 0.9);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: white !important;
}


.segment-btn.active .segment-badge {
    background: rgba(255, 255, 255, 0.25);
}

/* Tab Content */
.doses-tab-content {
    min-height: 200px;
}

.doses-tab-pane {
    animation: fadeInTab 0.3s ease;
}

.doses-tab-pane.active {
    display: block;
}

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

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xl) 0;
}

.load-more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: var(--bg-card);
    border-color:var(--mobile-accent);
    color: var(--mobile-accent);
    transform: translateY(-2px);
}

.load-more-btn .material-symbols-outlined {
    font-size: 20px;
}

/* Empty State for Tabs */
.doses-empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.doses-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.doses-empty-state h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.doses-empty-state p {
    font-size: var(--font-size-base);
    line-height: 1.6;
}

/* ========================================
   SEGMENTED CONTROL - MOBILE WHITE MODE
   ======================================== */

@media (max-width: 768px) {
    .doses-segmented-control {
        background: var(--mobile-surface) !important;
        border: 1px solid var(--mobile-border) !important;
        border-radius: 14px;
        padding: 4px;
        gap: 4px;
        margin-bottom: var(--spacing-lg);
    }
    
    .segment-btn {
        padding: 10px 8px;
        font-size: 13px;
        border-radius: 10px;
        gap: 6px;
    }
    
    .segment-btn:not(.active) {
        color: var(--mobile-text-mute) !important;
    }
    
    .segment-btn:hover:not(.active) {
        background: var(--mobile-surface-2) !important;
        color: var(--mobile-text) !important;
    }
    
    .segment-btn.active {
        background: var(--mobile-accent) !important;
        color: white !important;
        box-shadow: var(--mobile-shadow-md) !important;
    }
    
    .segment-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        padding: 0 5px;
    }
    
    .segment-btn.active .segment-badge {
        background: rgba(255, 255, 255, 0.3) !important;
    }
    
    /* Empty State Mobile */
    .doses-empty-state {
        padding: var(--spacing-xl);
    }
    
    .doses-empty-state .empty-icon {
        font-size: 40px;
    }
    
    .doses-empty-state h3 {
        color: var(--mobile-text) !important;
        font-size: var(--font-size-base);
    }
    
    .doses-empty-state p {
        color: var(--mobile-text-mute) !important;
        font-size: var(--font-size-sm);
    }
    
    /* Load More Button Mobile */
    .load-more-btn {
        background: var(--mobile-surface-2) !important;
        border: 1px solid var(--mobile-border) !important;
        color: var(--mobile-text) !important;
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        min-height: 48px;
    }
    
    .load-more-btn:hover,
    .load-more-btn:active {
        background: var(--mobile-accent-soft) !important;
        border-color: var(--mobile-accent) !important;
        color: var(--mobile-accent) !important;
    }
}

@media (max-width: 480px) {
    .doses-segmented-control {
        padding: 3px;
        gap: 3px;
    }
    
    .segment-btn {
        padding: 8px 6px;
        font-size: 12px;
        gap: 4px;
    }
    
    .segment-badge {
        position: relative;
        top: 0;
    }
}