/* ===== SCHEDULE SETTINGS MODAL ===== */
.schedule-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 768px) {
    .schedule-modal-overlay {
        align-items: center;
    }
}

.schedule-modal {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    touch-action: pan-y;
    overflow: hidden;
}

@media (min-width: 768px) {
    .schedule-modal {
        border-radius: 20px;
        max-height: 80vh;
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.schedule-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.schedule-modal-back,
.schedule-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.schedule-modal-back:hover,
.schedule-modal-close:hover {
    background: #f5f5f5;
}

.schedule-modal-back svg,
.schedule-modal-close svg {
    width: 24px;
    height: 24px;
    stroke: #666;
}

.schedule-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.schedule-modal-search {
    padding: 16px 20px;
    position: relative;
    flex-shrink: 0;
}

.schedule-modal-search svg {
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: #999;
    pointer-events: none;
}

.schedule-modal-search input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.schedule-modal-search input:focus {
    border-color: #dd1847;
}

.schedule-modal-filters {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    flex-shrink: 0;
}

.schedule-filter-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.schedule-filter-btn.active {
    background: #dd1847;
    color: white;
}

/* Обертка для списка сотрудников с прокруткой */
.schedule-employees-list-wrapper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px;
}

.schedule-employees-list {
    display: flex;
    flex-direction: column;
}

.schedule-employee-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}

.schedule-employee-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.schedule-employee-item.selected .schedule-employee-checkbox {
    background: #dd1847;
    border-color: #dd1847;
}

.schedule-employee-checkbox svg {
    width: 16px;
    height: 16px;
    stroke: white;
    display: none;
}

.schedule-employee-item.selected .schedule-employee-checkbox svg {
    display: block;
}

.schedule-employee-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.schedule-employee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 8px;
}

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

.schedule-employee-name {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.schedule-employee-role {
    font-size: 14px;
    color: #888;
}

/* Футер */
.schedule-modal-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    margin-top: auto;
}

.schedule-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.schedule-btn-primary {
    background: #dd1847;
    color: white;
}

.schedule-btn-primary:hover {
    background: #c4153e;
}

.schedule-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Типы графика */
.schedule-type-options {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-type-card:hover {
    border-color: #dd1847;
    background: #fdf2f5;
}

.schedule-type-icon {
    width: 48px;
    height: 48px;
    background: #f5f5f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.schedule-type-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.schedule-type-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.schedule-type-content p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Настройки времени */
.schedule-time-settings {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.schedule-setting-section {
    margin-bottom: 24px;
}

.schedule-setting-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

/* Дни недели */
.weekdays-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.weekday-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid #f0f0f0;
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.weekday-btn.active {
    background: #dd1847;
    border-color: #dd1847;
    color: white;
}

/* Время */
.schedule-time-range {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.schedule-time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    padding: 8px 16px;
    border-radius: 12px;
}

.schedule-time-input-group span {
    color: #666;
}

.schedule-time-input {
    border: none;
    background: transparent;
    font-size: 16px;
    padding: 8px 0;
    outline: none;
    font-family: inherit;
}

.schedule-time-option {
    margin-bottom: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.schedule-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    color: #1a1a1a;
}

.schedule-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #dd1847;
}

/* Перерывы */
.schedule-add-break-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    background: none;
    border: none;
    color: #dd1847;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.schedule-add-break-btn svg {
    width: 20px;
    height: 20px;
    stroke: #dd1847;
}

.break-time-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 12px;
    margin-bottom: 8px;
}

.break-time-item .schedule-time-input-group {
    flex: 1;
    background: white;
}

.break-remove-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #999;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
}

.break-remove-btn:hover {
    color: #dd1847;
}

.break-remove-btn svg {
    width: 20px;
    height: 20px;
}

/* Циклические опции */
.schedule-cyclic-options {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-cyclic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    color: #1a1a1a;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.schedule-cyclic-item:hover {
    background: #f0f0f0;
}

.schedule-cyclic-badge {
    font-size: 14px;
    color: #888;
}

/* Своя схема */
.schedule-custom-scheme {
    padding: 20px;
}

.custom-scheme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.custom-scheme-label {
    font-size: 16px;
    color: #1a1a1a;
}

.custom-scheme-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scheme-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid #f0f0f0;
    background: white;
    font-size: 20px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.scheme-control-btn:hover {
    border-color: #dd1847;
    color: #dd1847;
}

.custom-scheme-control span {
    font-size: 18px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.custom-scheme-preview {
    margin-top: 24px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
    color: #666;
}

.custom-scheme-preview span {
    font-weight: 600;
    color: #dd1847;
    font-size: 18px;
}

/* Доступность */
@media (prefers-reduced-motion: reduce) {
    .schedule-modal { animation: none; }
}

/* Исправление для таблицы графика */
.schedule-table-wrapper {
    position: relative !important;
    overflow: auto !important;
    height: auto !important;
    min-height: 400px !important;
    flex: 1 !important;
    opacity: 1 !important;
}

.schedule-content-area {
    position: relative !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.schedule-view-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 500px !important;
}

.schedule-skeleton.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    z-index: 1 !important;
}

/* ===== ИСПРАВЛЕННАЯ ВЫСОТА И ВЫДЕЛЕНИЕ ЯЧЕЕК ГРАФИКА ===== */
.schedule-cell {
    min-height: 80px !important;
    height: 80px !important;
    min-width: 110px !important;
    width: 110px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.schedule-time {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    height: 44px !important;
    width: 100% !important;
    padding: 0 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-radius: 10px !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    user-select: none !important;
    background: #f8f8f8 !important;
    color: #1a1a1a !important;
    border: 2px solid transparent !important;
    letter-spacing: -0.2px !important;
}

.schedule-time.weekend {
    background: #f8f8f8 !important;
    color: #1a1a1a !important;
}

.schedule-time.selected {
    background: #fdf2f5 !important;
    color: #dd1847 !important;
    border-color: #dd1847 !important;
    box-shadow: 0 0 0 2px rgba(221, 24, 71, 0.15) !important;
}

.schedule-time:hover {
    border-color: #dd1847 !important;
    background: #fdf2f5 !important;
}

.schedule-fixed-cell {
    min-height: 80px !important;
    min-width: 150px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.schedule-header-cell {
    min-height: 80px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    box-sizing: border-box !important;
}

.schedule-date-weekday {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #888 !important;
}

.schedule-date-day {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    line-height: 1.2 !important;
}

.schedule-date-month {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #888 !important;
}

.schedule-row {
    display: flex !important;
    align-items: stretch !important;
    min-height: 80px !important;
}

/* Скоуплено под график работы — не влияет на другие разделы */
.schedule-fixed-cell .employee-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.employee-name-short {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100px !important;
}