/* ============================================================
   schedule.css — полный файл стилей для мини-приложения «График»
   Версия: 2.2.0
   ============================================================ */

/* ============ ОБЩИЕ СТИЛИ ============ */
.schedule-app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
    background: #f5f7fc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a202c;
}

/* ============ ШАПКА ============ */
.schedule-header {
    padding: 12px 16px;
    padding-top: max(env(safe-area-inset-top, 0), 12px);
    padding-left: max(env(safe-area-inset-left, 0), 16px);
    padding-right: max(env(safe-area-inset-right, 0), 16px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 56px;
}

.schedule-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.schedule-header-title .menu-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.schedule-header-title .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.schedule-header-title .menu-toggle:active {
    transform: scale(0.95);
}

.schedule-header-title .header-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-header .close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.schedule-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.schedule-header .close-btn:active {
    transform: scale(0.95);
}

/* ============ БОКОВОЕ МЕНЮ ============ */
.schedule-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: #1a202c;
    color: #e2e8f0;
    z-index: 10003;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.schedule-sidebar.open {
    left: 0;
}

.schedule-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.schedule-sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    padding: 20px 20px 16px 20px;
    padding-top: max(env(safe-area-inset-top, 0), 20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-header .logo-text {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.sidebar-header .close-sidebar {
    margin-left: auto;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.sidebar-header .close-sidebar:hover {
    color: white;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.sidebar-nav .nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: white;
    border-left-color: #667eea;
}

.sidebar-nav .nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-nav .nav-item .nav-badge {
    margin-left: auto;
    background: #667eea;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
}

.sidebar-nav .nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: #64748b;
}

.sidebar-footer .version {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============ ОСНОВНОЙ КОНТЕНТ ============ */
.schedule-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: max(env(safe-area-inset-bottom, 0), 16px);
}

/* ============ ОБЩИЕ КНОПКИ ============ */
.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #fc8181;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-sm:hover:not(:disabled) {
    background: #f1f5f9;
}

.btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   ВКЛАДКА «СЕГОДНЯ»
   ============================================================ */

.today-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: #94a3b8;
}

.today-loading i {
    font-size: 32px;
    color: #667eea;
}

.today-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.today-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.today-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.today-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.today-title i {
    color: #667eea;
}

.today-date-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.today-date-nav button {
    padding: 6px 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #4a5568;
}

.today-date-nav button:hover {
    background: #f8fafc;
}

.today-date-nav .today-date-input {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #1a202c;
    width: 140px;
}

.today-date-nav .today-date-today {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.today-date-nav .today-date-today:hover {
    background: #5a67d8;
}

.today-clinic-selector {
    margin-left: 4px;
}

.today-clinic-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 200px;
}

.today-clinic-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.today-header-right {
    display: flex;
    gap: 8px;
}

.today-refresh-btn {
    padding: 8px 12px;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.today-refresh-btn:hover {
    background: #cbd5e0;
}

.today-add-btn {
    padding: 8px 16px;
    background: #667eea;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.today-add-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.today-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.today-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.today-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.today-stat-label {
    font-size: 13px;
    color: #718096;
}

.today-stat-confirmed .today-stat-value { color: #2ecc71; }
.today-stat-pending .today-stat-value { color: #f39c12; }
.today-stat-free .today-stat-value { color: #667eea; }

.today-timeline {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: white;
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.timeline-hour {
    display: flex;
    min-height: 56px;
    border-radius: 6px;
    transition: background 0.2s;
    padding: 2px 0;
}

.timeline-hour:hover {
    background: #f8fafc;
}

.timeline-hour-label {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    padding: 0 8px;
}

.timeline-hour-time {
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
}

.timeline-hour-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 8px 4px 0;
    align-items: center;
}

.today-dayoff {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.today-dayoff-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.today-dayoff-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.today-dayoff-desc {
    font-size: 16px;
    color: #718096;
}

.today-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.today-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.today-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.today-empty-desc {
    font-size: 14px;
    color: #718096;
}

/* ============================================================
   ВКЛАДКА «КАЛЕНДАРЬ»
   ============================================================ */

.calendar-container {
    padding: 20px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header button {
    padding: 10px 16px;
    font-size: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-header button:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.calendar-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #1a202c;
}

.calendar-clinic-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calendar-clinic-selector label {
    font-size: 15px;
    font-weight: 500;
    color: #4a5568;
}

.calendar-clinic-selector select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #4a5568;
    cursor: pointer;
    max-width: 300px;
    min-width: 150px;
}

.calendar-clinic-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.calendar-clinic-selector .btn-secondary {
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.calendar-clinic-selector .btn-secondary:hover {
    background: #5a67d8;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    padding: 12px;
    font-size: 16px;
    color: #94a3b8;
}

.calendar-day {
    padding: 12px 4px;
    text-align: center;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 18px;
    transition: all 0.2s;
    min-height: 48px;
    position: relative;
    background: transparent;
    color: #1a202c;
}

.calendar-day:hover {
    transform: scale(1.05);
    background: #f8fafc;
}

.calendar-day.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.calendar-day.selected:hover {
    background: #5a67d8;
}

.calendar-day.today {
    border-color: #667eea;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.calendar-day.today.selected {
    background: #667eea;
    color: white;
}

.calendar-day.exception {
    background: #fff3e0;
    border-color: #ff9800;
}

.calendar-day.exception:hover {
    background: #ffe0b2;
}

.calendar-day.past {
    color: #b0b8c8;
    opacity: 0.6;
}

.calendar-day.past:hover {
    transform: none;
    background: transparent;
}

.calendar-day.empty {
    visibility: hidden;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    background: transparent;
}

.day-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: #2ecc71;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.calendar-day.selected .day-badge {
    background: white;
    color: #667eea;
}

.calendar-day.today .day-badge {
    background: white;
    color: #667eea;
}

.day-off-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e0;
}

.calendar-slots-section {
    margin-top: 20px;
}

.calendar-slots-section h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.calendar-slots-section .loading-text {
    font-size: 14px;
    font-weight: 400;
    color: #f39c12;
}

#calendarSlots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 60px;
}

.loading-slots {
    color: #94a3b8;
    font-size: 15px;
    padding: 12px 0;
}

.slots-error {
    color: #e74c3c;
    padding: 12px;
    font-size: 14px;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.slots-empty {
    color: #94a3b8;
    padding: 14px;
    font-size: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
    width: 100%;
    text-align: center;
}

.slot-exception-full-day {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: #fff3e0;
    color: #e65100;
    border: 2px solid #ff9800;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
}

.slot-exception-full-day i {
    font-size: 24px;
}

.slot-day-off {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 16px;
    width: 100%;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}

.slot-day-off i {
    margin-right: 10px;
    font-size: 20px;
}

.calendar-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.calendar-actions .btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.calendar-actions .btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.calendar-actions .btn-secondary {
    padding: 10px 20px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.calendar-actions .btn-secondary:hover {
    background: #cbd5e0;
}

/* ============================================================
   ВКЛАДКА «ГРАФИК РАБОТЫ» (НОВЫЙ ДИЗАЙН)
   ============================================================ */

.schedule-controls {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: flex-end;
}

.controls-row-bottom {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

.control-group label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.control-group-clinic {
    flex: 0 0 220px;
}

.control-group-interval {
    flex: 2;
}

.control-group-template {
    flex: 1.5;
}

.control-group-break {
    flex: 2;
}

.schedule-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #1a202c;
    cursor: pointer;
    width: 100%;
    min-height: 40px;
    transition: border-color 0.2s;
}

.schedule-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.schedule-select-sm {
    min-height: 36px;
    font-size: 13px;
    padding: 6px 10px;
    flex: 1;
    min-width: 100px;
}

.interval-presets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 4px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a5568;
    white-space: nowrap;
}

.preset-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
}

.preset-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.interval-custom {
    display: none;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
}

.interval-custom.visible {
    display: flex;
}

.interval-custom input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    min-width: 120px;
}

.interval-custom .btn-apply {
    padding: 6px 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.template-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.template-controls .schedule-input-sm {
    flex: 1;
    min-width: 80px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.break-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.break-controls .break-time-label {
    font-size: 12px;
    color: #718096;
}

/* УВЕЛИЧЕННЫЕ ПОЛЯ ВВОДА ВРЕМЕНИ */
input[type="time"] {
    min-width: 76px !important;
    height: 36px !important;
    padding: 4px 8px !important;
    font-size: 14px !important;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    text-align: center;
    font-family: inherit;
}

input[type="time"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="time"]:disabled {
    background: #f8fafc;
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background: #cbd5e0;
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-label input:checked + .toggle-slider {
    background: #2ecc71;
}

.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

.toggle-sm .toggle-slider {
    width: 30px;
    height: 18px;
}

.toggle-sm .toggle-slider::after {
    width: 14px;
    height: 14px;
}

.schedule-stats {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

.stat-label {
    font-size: 13px;
    color: #94a3b8;
}

.stat-working .stat-value { color: #2ecc71; }
.stat-off .stat-value { color: #e74c3c; }
.stat-exception .stat-value { color: #f39c12; }
.stat-period { margin-left: auto; }
.stat-period .stat-label { font-size: 12px; color: #94a3b8; }

/* КАРТОЧКИ ДНЕЙ */
.schedule-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-card {
    background: white;
    border-radius: 12px;
    border-left: 4px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.day-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.day-card.status-working {
    border-left-color: #2ecc71;
}

.day-card.status-day-off {
    border-left-color: #e74c3c;
    opacity: 0.85;
}

.day-card.status-exception-full {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.day-card.status-exception-partial {
    border-left-color: #f39c12;
    background: #fffbeb;
}

.day-card-today {
    border-left-color: #667eea !important;
    background: #f0f4ff !important;
}

.day-card-past {
    opacity: 0.7;
}

.day-card-locked {
    opacity: 0.85;
}

.day-card-locked .day-controls {
    opacity: 0.4;
    pointer-events: none;
}

.day-card-locked .day-controls .time-group input,
.day-card-locked .day-controls .toggle-label {
    pointer-events: none;
}

.day-card-locked .day-card-right .btn-status {
    display: none !important;
}

.day-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    flex-wrap: nowrap;
    gap: 8px;
}

.day-card-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.day-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.day-name {
    font-weight: 600;
    color: #1a202c;
    white-space: nowrap;
}

.day-date {
    font-weight: 400;
    color: #4a5568;
    white-space: nowrap;
}

.day-badge-today {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.day-badge-past {
    background: #e2e8f0;
    color: #718096;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    white-space: nowrap;
}

.status-badge {
    font-size: 12px;
    padding: 2px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #4a5568;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: default !important;
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
}

.status-badge.status-working {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-day-off {
    background: #fee2e2;
    color: #991b1b;
}

.btn-status {
    padding: 4px 14px;
    font-size: 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-status:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-status:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-status-off {
    border-color: #e74c3c;
    color: #e74c3c;
}

.btn-status-off:hover:not(:disabled) {
    background: #fee2e2;
}

.btn-status-on {
    border-color: #2ecc71;
    color: #2ecc71;
}

.btn-status-on:hover:not(:disabled) {
    background: #d1fae5;
}

.day-card-body {
    padding: 0 16px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-row-time {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.time-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-group label {
    font-size: 12px;
    color: #718096;
}

.day-off-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 14px;
    padding: 4px 0;
}

.exceptions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.exception-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.exception-full {
    background: #fee2e2;
    color: #991b1b;
}

.exception-partial {
    background: #fef3c7;
    color: #92400e;
}

.exception-text {
    flex: 1;
    min-width: 100px;
}

.schedule-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.schedule-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.schedule-btn-danger {
    background: #fee2e2;
    color: #991b1b;
}

.schedule-btn-danger:hover {
    background: #fecaca;
}

/* ============================================================
   ВКЛАДКА «ИСКЛЮЧЕНИЯ»
   ============================================================ */

.exceptions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.exceptions-panel {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.exceptions-panel-top .exceptions-panel-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.exceptions-field {
    flex: 1;
    min-width: 200px;
}

.exceptions-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 4px;
}

.exceptions-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.exceptions-input {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s;
}

.exceptions-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.exceptions-select {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    min-width: 150px;
}

.exceptions-separator {
    color: #94a3b8;
    font-weight: 300;
}

.exceptions-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.exceptions-btn:active {
    transform: scale(0.97);
}

.exceptions-btn-primary {
    background: #667eea;
    color: white;
}

.exceptions-btn-primary:hover {
    background: #5a67d8;
}

.exceptions-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.exceptions-btn-secondary:hover {
    background: #cbd5e0;
}

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

.exceptions-btn-danger:hover {
    background: #f56565;
}

.exceptions-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.exceptions-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 12px;
    align-items: center;
}

.exceptions-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.exceptions-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.exceptions-stat-label {
    font-size: 13px;
    color: #718096;
}

.exceptions-stat-full .exceptions-stat-value {
    color: #2ecc71;
}

.exceptions-stat-partial .exceptions-stat-value {
    color: #f39c12;
}

.exceptions-stat-add {
    margin-left: auto;
}

.exceptions-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.exceptions-empty i {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.exceptions-empty p {
    font-size: 16px;
    margin-bottom: 4px;
}

.exceptions-empty-hint {
    font-size: 13px;
    opacity: 0.7;
}

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

.exceptions-card {
    background: white;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #94a3b8;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.exceptions-card-default {
    border-left-color: #94a3b8;
}

.exceptions-card-vacation {
    border-left-color: #3498db;
    background: #f0f7ff;
}

.exceptions-card-sick {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.exceptions-card-business {
    border-left-color: #f39c12;
    background: #fffbeb;
}

.exceptions-card-study {
    border-left-color: #9b59b6;
    background: #f5f0ff;
}

.exceptions-card-partial {
    border-left-color: #ff9800;
    background: #fff8e1;
}

.exceptions-card-closed {
    border-left-color: #e74c3c;
    background: #ffebee;
}

.exceptions-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.exceptions-card-date {
    display: flex;
    flex-direction: column;
}

.exceptions-card-day {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

.exceptions-card-weekday {
    font-size: 12px;
    color: #718096;
}

.exceptions-card-type {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
}

.exceptions-card-icon {
    font-size: 14px;
}

.exceptions-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exceptions-card-reason {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #1a202c;
}

.exceptions-card-reason i {
    color: #94a3b8;
    font-size: 12px;
}

.exceptions-card-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #718096;
}

.exceptions-card-time i {
    font-size: 12px;
}

.exceptions-card-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* ============================================================
   ВКЛАДКА «НАСТРОЙКИ»
   ============================================================ */

.settings-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: #94a3b8;
}

.settings-loading i {
    font-size: 32px;
    color: #667eea;
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.settings-section-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.settings-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section-header h3 i {
    color: #667eea;
}

.settings-section-header .settings-section-desc {
    font-size: 13px;
    color: #718096;
    display: block;
    margin-top: 4px;
}

.settings-section-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.settings-row:last-child {
    border-bottom: none;
}

.settings-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    flex: 1;
}

.settings-toggle-label span:first-child {
    font-weight: 500;
    color: #1a202c;
}

.settings-toggle-hint {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

.settings-field-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.settings-field-label span:first-child {
    font-weight: 500;
    color: #1a202c;
}

.settings-field-hint {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

.settings-field-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.settings-field-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-field-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.settings-field-group input[type="number"] {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.settings-field-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-field-unit {
    font-size: 13px;
    color: #718096;
}

.settings-field-separator {
    font-size: 13px;
    color: #94a3b8;
}

.settings-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 200px;
    cursor: pointer;
}

.settings-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-channels {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.settings-channel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f8fafc;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.settings-channel:hover {
    background: #edf2f7;
}

.settings-channel input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.settings-channel-icon {
    font-size: 16px;
}

.settings-channel-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-channel-badge {
    font-size: 9px;
    background: #e2e8f0;
    color: #718096;
    padding: 1px 8px;
    border-radius: 12px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* ============================================================
   ВКЛАДКА «УСЛУГИ»
   ============================================================ */

.services-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: #94a3b8;
}

.services-loading i {
    font-size: 32px;
    color: #667eea;
}

.services-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.services-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.services-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 8px;
}

.services-empty-hint {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.services-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.services-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.services-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.services-title i {
    color: #667eea;
}

.services-count {
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.services-active-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #718096;
}

.services-active-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
}

.services-refresh-btn {
    padding: 8px 16px;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.services-refresh-btn:hover {
    background: #cbd5e0;
}

.services-refresh-btn:active {
    transform: scale(0.97);
}

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

.service-card {
    background: white;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    border-left: 4px solid #2ecc71;
}

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

.service-card-inactive {
    border-left-color: #94a3b8;
    opacity: 0.7;
}

.service-card-inactive:hover {
    opacity: 0.9;
}

.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.service-card-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #1a202c;
    flex: 1;
    min-width: 150px;
}

.service-card-icon {
    font-size: 14px;
}

.service-card-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.service-card-status-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-inactive {
    background: #f5f5f5;
    color: #757575;
}

.service-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
}

.service-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.service-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e0;
    transition: 0.3s;
    border-radius: 20px;
}

.service-toggle-slider::before {
    content: '';
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.service-toggle input:checked + .service-toggle-slider {
    background: #2ecc71;
}

.service-toggle input:checked + .service-toggle-slider::before {
    transform: translateX(16px);
}

.service-toggle:hover .service-toggle-slider {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

.service-card-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.service-card-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.service-card-field label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.service-card-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a202c;
}

.service-card-field input {
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    max-width: 80px;
    transition: border-color 0.2s;
}

.service-card-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.service-card-unit {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 2px;
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО ЗАПИСИ
   ============================================================ */

.schedule-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10005;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
}

.schedule-modal {
    background: white;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.schedule-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-modal .modal-header .modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.schedule-modal .modal-header .modal-close:hover {
    background: #f1f5f9;
}

.schedule-modal .step-indicators {
    display: flex;
    padding: 12px 20px;
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f6;
    flex-shrink: 0;
}

.schedule-modal .step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    font-size: 13px;
    color: #94a3b8;
}

.schedule-modal .step-indicator:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 8px;
}

.schedule-modal .step-indicator.active:not(:last-child)::after,
.schedule-modal .step-indicator.completed:not(:last-child)::after {
    background: #667eea;
}

.schedule-modal .step-indicator .step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    background: #e2e8f0;
    color: #94a3b8;
    flex-shrink: 0;
}

.schedule-modal .step-indicator.active .step-num {
    background: #667eea;
    color: white;
}

.schedule-modal .step-indicator.completed .step-num {
    background: #2ecc71;
    color: white;
}

.schedule-modal .step-indicator.active {
    color: #1a202c;
}

.schedule-modal .step-indicator.completed {
    color: #1a202c;
}

.schedule-modal .step-content {
    display: none;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    animation: fadeIn 0.25s ease;
}

.schedule-modal .step-content.active {
    display: block;
}

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

.schedule-modal .calendar-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    padding: 16px;
    margin-bottom: 16px;
}

.schedule-modal .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.schedule-modal .calendar-header button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #94a3b8;
    font-size: 14px;
    border-radius: 6px;
    transition: background 0.2s;
}

.schedule-modal .calendar-header button:hover {
    background: #f1f5f9;
}

.schedule-modal .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.schedule-modal .calendar-grid .calendar-weekday {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-modal .calendar-grid .calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    border: none;
    width: 100%;
    position: relative;
}

.schedule-modal .calendar-grid .calendar-day:hover:not(.empty):not(.past) {
    background: #f1f5f9;
}

.schedule-modal .calendar-grid .calendar-day.empty {
    cursor: default;
}

.schedule-modal .calendar-grid .calendar-day.past {
    color: #cbd5e0;
    cursor: not-allowed;
}

.schedule-modal .calendar-grid .calendar-day.today {
    border: 2px solid #667eea;
}

.schedule-modal .calendar-grid .calendar-day.selected {
    background: #667eea;
    color: white;
}

.schedule-modal .calendar-grid .calendar-day.selected:hover {
    background: #5a67d8;
}

.schedule-modal .calendar-grid .calendar-day.has-slots::after {
    content: '';
    width: 4px;
    height: 4px;
    background: #2ecc71;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
}

.schedule-modal .slots-section {
    margin-bottom: 16px;
}

.schedule-modal .slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #1a202c;
}

.schedule-modal .slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.schedule-modal .slots-grid .slot {
    padding: 8px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #1a202c;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.schedule-modal .slots-grid .slot:hover:not(.disabled) {
    border-color: #667eea;
    background: #f0f4ff;
}

.schedule-modal .slots-grid .slot.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.schedule-modal .slots-grid .slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.schedule-modal .slots-grid .slot .slot-time {
    font-size: 13px;
}

.schedule-modal .slots-grid .slot .slot-status {
    font-size: 9px;
    opacity: 0.7;
}

.schedule-modal .selected-time-display {
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    padding: 8px 0 4px;
}

.schedule-modal .client-search {
    margin-bottom: 16px;
}

.schedule-modal .search-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 12px;
    transition: border-color 0.2s;
}

.schedule-modal .search-wrapper:focus-within {
    border-color: #667eea;
    background: white;
}

.schedule-modal .search-wrapper i {
    color: #94a3b8;
    font-size: 14px;
}

.schedule-modal .search-wrapper .search-input {
    flex: 1;
    padding: 10px 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.schedule-modal .search-results {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #eef2f6;
    display: none;
}

.schedule-modal .search-results.active {
    display: block;
}

.schedule-modal .search-result {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.schedule-modal .search-result:last-child {
    border-bottom: none;
}

.schedule-modal .search-result:hover {
    background: #f8fafc;
}

.schedule-modal .search-result.selected {
    background: #f0f4ff;
}

.schedule-modal .search-result .search-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
    font-size: 14px;
    overflow: hidden;
}

.schedule-modal .search-result .search-result-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.schedule-modal .search-result .search-result-info {
    flex: 1;
}

.schedule-modal .search-result .search-result-name {
    font-weight: 500;
    font-size: 13px;
    color: #1a202c;
}

.schedule-modal .search-result .search-result-phone {
    font-size: 12px;
    color: #94a3b8;
}

.schedule-modal .section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.schedule-modal .client-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-modal .client-list .client-item {
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    border: 1.5px solid transparent;
}

.schedule-modal .client-list .client-item:hover {
    background: #f8fafc;
}

.schedule-modal .client-list .client-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.schedule-modal .client-list .client-item .client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    color: #94a3b8;
    overflow: hidden;
}

.schedule-modal .client-list .client-item .client-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.schedule-modal .client-list .client-item .client-info {
    flex: 1;
}

.schedule-modal .client-list .client-item .client-name {
    font-weight: 500;
    font-size: 13px;
    color: #1a202c;
}

.schedule-modal .client-list .client-item .client-phone {
    font-size: 12px;
    color: #94a3b8;
}

.schedule-modal .client-list .client-item .client-check {
    color: #2ecc71;
    font-size: 16px;
}

.schedule-modal .services-section {
    margin: 12px 0 8px;
}

.schedule-modal .services-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.schedule-modal .services-list .service-item {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.schedule-modal .services-list .service-item:hover:not(.selected) {
    border-color: #cbd5e0;
    background: #f8fafc;
}

.schedule-modal .services-list .service-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.schedule-modal .services-list .service-item .service-name {
    font-weight: 500;
    font-size: 13px;
    color: #1a202c;
}

.schedule-modal .services-list .service-item .service-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #94a3b8;
}

.schedule-modal .services-list .service-item .service-duration {
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
}

.schedule-modal .summary {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.schedule-modal .summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.schedule-modal .summary .summary-label {
    color: #94a3b8;
    font-size: 13px;
}

.schedule-modal .summary .summary-value {
    font-weight: 500;
    font-size: 13px;
    color: #1a202c;
}

.schedule-modal .comment-section {
    margin: 8px 0 4px;
}

.schedule-modal .comment-section .comment-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
    transition: border-color 0.2s;
    background: #fafafa;
}

.schedule-modal .comment-section .comment-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.schedule-modal .modal-footer {
    padding-top: 16px;
    border-top: 1px solid #eef2f6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.schedule-modal .modal-footer .btn-secondary {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #f1f5f9;
    color: #1a202c;
}

.schedule-modal .modal-footer .btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.schedule-modal .modal-footer .btn-primary {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #667eea;
    color: white;
}

.schedule-modal .modal-footer .btn-primary:hover:not(:disabled) {
    background: #5a67d8;
}

.schedule-modal .modal-footer .btn-success {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #2ecc71;
    color: white;
}

.schedule-modal .modal-footer .btn-success:hover:not(:disabled) {
    background: #27ae60;
}

.schedule-modal .modal-footer .btn-danger {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #fee;
    color: #c0392b;
}

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

.schedule-modal .modal-footer .btn-secondary:disabled,
.schedule-modal .modal-footer .btn-primary:disabled,
.schedule-modal .modal-footer .btn-success:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО ИСКЛЮЧЕНИЙ
   ============================================================ */

.exceptions-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.exceptions-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    animation: modalSlideIn 0.3s ease;
}

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

.exceptions-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.exceptions-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.exceptions-modal .modal-header .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 4px;
}

.exceptions-modal .modal-header .modal-close:hover {
    color: #1a202c;
}

.exceptions-modal .form-group {
    margin-bottom: 16px;
}

.exceptions-modal .form-group label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    color: #4a5568;
}

.exceptions-modal .form-group input,
.exceptions-modal .form-group select,
.exceptions-modal .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.exceptions-modal .form-group input:focus,
.exceptions-modal .form-group select:focus,
.exceptions-modal .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.exceptions-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.exceptions-modal .form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.exceptions-modal .form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.exceptions-modal .modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* ============================================================
   СЛОТЫ (общие для всех вкладок)
   ============================================================ */

.slot-block {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 70px;
    justify-content: center;
    border: 2px solid transparent;
    position: relative;
}

.slot-free {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #4caf50;
    cursor: pointer;
}

.slot-free:hover {
    background: #c8e6c9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.slot-free:active {
    transform: scale(0.97);
}

.slot-occupied {
    background: #f5f5f5;
    color: #9e9e9e;
    border-color: #e0e0e0;
    cursor: not-allowed;
}

.slot-past {
    background: #fafafa;
    color: #bdbdbd;
    border-color: #eeeeee;
    cursor: not-allowed;
    opacity: 0.6;
}

.slot-exception {
    background: #fff3e0;
    color: #e65100;
    border-color: #ff9800;
    cursor: not-allowed;
}

.slot-exception.has-tooltip {
    cursor: help;
}

.slot-exception:hover {
    background: #ffe0b2;
}

.slot-break {
    background: #fff8e1;
    color: #f57f17;
    border-color: #ffc107;
    cursor: not-allowed;
}

.slot-time {
    font-weight: 600;
}

.slot-status {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 400;
}

/* ============================================================
   ЗАПИСИ (общие для всех вкладок)
   ============================================================ */

.appointment-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    flex: 1;
    border-left: 4px solid #667eea;
    background: #f8fafc;
}

.appointment-block:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.appointment-block.confirmed {
    border-left-color: #2ecc71;
    background: #f0fff4;
}

.appointment-block.pending {
    border-left-color: #f39c12;
    background: #fffbeb;
}

.appointment-block-time {
    font-weight: 600;
    font-size: 12px;
    color: #4a5568;
    min-width: 44px;
}

.appointment-block-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 80px;
}

.appointment-block-name {
    font-weight: 500;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 4px;
}

.appointment-block-name i {
    font-size: 12px;
    color: #94a3b8;
}

.appointment-block-service {
    font-size: 11px;
    color: #718096;
}

.appointment-block-status {
    font-size: 14px;
    flex-shrink: 0;
}

/* ============================================================
   ТОСТЫ
   ============================================================ */

.schedule-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    color: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10010;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.schedule-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.schedule-toast.success {
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.schedule-toast.error {
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.schedule-toast.warning {
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ============================================================
   НЕТ КЛИНИК
   ============================================================ */

.no-clinic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.no-clinic-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.no-clinic-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.no-clinic-desc {
    font-size: 16px;
    color: #718096;
    max-width: 500px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.no-clinic-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

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

.no-clinic-btn:active {
    transform: scale(0.98);
}

.no-clinic-btn i {
    font-size: 18px;
}

.no-clinic-hint {
    margin-top: 20px;
    font-size: 13px;
    color: #94a3b8;
}

.no-clinic-hint i {
    margin-right: 6px;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 768px) {
    .schedule-sidebar {
        width: 280px;
        left: -280px;
    }

    .schedule-sidebar.open {
        left: 0;
    }

    .today-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .today-header-left {
        flex-wrap: wrap;
    }

    .today-header-right {
        justify-content: stretch;
    }

    .today-header-right button {
        flex: 1;
        justify-content: center;
    }

    .today-stats {
        gap: 12px;
        padding: 10px 14px;
    }

    .today-stat-value {
        font-size: 16px;
    }

    .timeline-hour-label {
        width: 44px;
        font-size: 11px;
    }

    .timeline-hour-content {
        padding: 4px 4px 4px 0;
        gap: 3px;
    }

    .slot-block {
        font-size: 12px;
        padding: 4px 10px;
        min-width: 60px;
    }

    .appointment-block {
        font-size: 12px;
        padding: 4px 10px;
        min-width: 100px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        font-size: 15px;
        padding: 8px 2px;
        min-height: 40px;
    }

    .calendar-weekday {
        font-size: 13px;
        padding: 8px;
    }

    .calendar-header h3 {
        font-size: 18px;
    }

    .calendar-header button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .calendar-clinic-selector select {
        font-size: 14px;
        padding: 8px 12px;
        max-width: 200px;
    }

    .calendar-actions {
        flex-direction: column;
    }

    .calendar-actions .btn-primary,
    .calendar-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .schedule-controls {
        padding: 12px 14px;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .controls-row-bottom {
        margin-top: 8px;
        padding-top: 8px;
    }

    .control-group {
        min-width: 0;
        flex: 1 1 auto;
    }

    .control-group-clinic {
        flex: 1 1 auto;
    }

    .control-group-break .break-controls {
        flex-wrap: wrap;
    }

    .interval-presets {
        flex-wrap: wrap;
    }

    .preset-btn {
        font-size: 11px;
        padding: 4px 10px;
    }

    .interval-custom {
        flex-wrap: wrap;
    }

    .interval-custom input[type="date"] {
        min-width: 100px;
        flex: 1;
    }

    .schedule-stats {
        gap: 10px;
        padding: 10px 14px;
        justify-content: flex-start;
    }

    .stat-value {
        font-size: 16px;
    }
    .stat-label {
        font-size: 12px;
    }
    .stat-period {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .day-card-header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .day-card-left {
        flex-wrap: wrap;
        gap: 4px;
    }

    .day-card-right {
        width: 100%;
        justify-content: flex-start;
    }

    .btn-status {
        width: 100%;
        justify-content: center;
        font-size: 11px;
        padding: 6px 12px;
    }

    .day-card-body {
        padding: 0 14px 10px 14px;
    }

    .control-row-time {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .time-group {
        justify-content: center;
    }

    input[type="time"] {
        min-width: 70px !important;
        height: 34px !important;
        font-size: 13px !important;
    }

    .exception-item {
        font-size: 12px;
        padding: 4px 8px;
    }

    .exception-item .btn-sm {
        font-size: 11px;
        padding: 2px 10px;
    }

    .exceptions-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .exceptions-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .exceptions-stat-add {
        margin-left: 0;
        width: 100%;
    }

    .exceptions-grid {
        grid-template-columns: 1fr;
    }

    .exceptions-modal .form-row {
        grid-template-columns: 1fr;
    }

    .exceptions-modal .modal-actions {
        flex-direction: column;
    }

    .settings-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .settings-field-group {
        flex-wrap: wrap;
    }

    .settings-select {
        width: 100%;
        min-width: auto;
    }

    .settings-channels {
        gap: 8px;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions button {
        width: 100%;
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .services-refresh-btn {
        width: 100%;
        justify-content: center;
    }

    .service-card-body {
        grid-template-columns: 1fr 1fr;
    }

    .schedule-modal .slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .schedule-modal .step-indicator .step-label {
        font-size: 11px;
    }

    .schedule-modal .step-indicator .step-num {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .schedule-modal .modal-footer {
        flex-direction: column;
    }

    .schedule-modal .modal-footer button {
        width: 100%;
        justify-content: center;
    }

    .appointment-detail-modal {
        padding: 0;
        align-items: flex-end;
    }

    .appointment-detail-modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .appointment-detail-modal-content .modal-body {
        max-height: calc(95vh - 130px);
    }

    .appointment-detail-modal-content .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .appointment-detail-modal-content .detail-value {
        text-align: left;
        width: 100%;
    }

    .slot-action-menu {
        left: 10px !important;
        right: 10px !important;
        min-width: auto !important;
        width: calc(100% - 20px);
        top: auto !important;
        bottom: 20px !important;
        border-radius: 16px 16px 16px 16px;
    }

    .slot-action-menu .slot-action-item {
        padding: 16px !important;
    }

    .slot-exception-menu {
        left: 10px !important;
        right: 10px !important;
        min-width: auto !important;
        width: calc(100% - 20px);
        top: auto !important;
        bottom: 20px !important;
        border-radius: 16px 16px 16px 16px;
    }

    .slot-exception-menu .slot-action-item {
        padding: 16px !important;
    }
}

@media (max-width: 480px) {
    .schedule-header-title {
        font-size: 16px;
    }

    .schedule-header-title .menu-toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .schedule-header .close-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .today-title {
        font-size: 16px;
    }

    .today-stats {
        gap: 8px;
        padding: 8px 12px;
    }

    .today-stat-value {
        font-size: 14px;
    }

    .today-stat-label {
        font-size: 11px;
    }

    .timeline-hour {
        min-height: 44px;
        flex-wrap: wrap;
    }

    .timeline-hour-label {
        width: 36px;
        padding: 0 4px;
        font-size: 10px;
    }

    .timeline-hour-content {
        padding: 2px 2px 2px 0;
        gap: 2px;
    }

    .slot-block {
        font-size: 11px;
        padding: 3px 8px;
        min-width: 50px;
    }

    .appointment-block {
        font-size: 11px;
        padding: 3px 8px;
        min-width: 80px;
    }

    .calendar-day {
        font-size: 13px;
        padding: 6px 2px;
        min-height: 34px;
    }

    .calendar-weekday {
        font-size: 11px;
        padding: 6px;
    }

    .calendar-header h3 {
        font-size: 16px;
    }

    .calendar-header button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .calendar-clinic-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-clinic-selector select {
        max-width: 100%;
        font-size: 13px;
    }

    .day-badge {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }

    .schedule-controls {
        padding: 10px 12px;
    }

    .schedule-select {
        font-size: 13px;
        padding: 6px 10px;
        min-height: 36px;
    }

    .schedule-select-sm {
        font-size: 12px;
        min-width: 80px;
    }

    .preset-btn {
        font-size: 10px;
        padding: 3px 8px;
    }

    .interval-custom input[type="date"] {
        font-size: 12px;
        padding: 4px 6px;
        min-width: 80px;
    }

    input[type="time"] {
        min-width: 62px !important;
        height: 32px !important;
        font-size: 12px !important;
        padding: 2px 6px !important;
    }

    .day-card-header {
        padding: 8px 12px;
    }

    .day-card-body {
        padding: 0 12px 8px 12px;
    }

    .day-name {
        font-size: 13px;
    }
    .day-date {
        font-size: 12px;
    }

    .status-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .btn-status {
        font-size: 10px;
        padding: 4px 10px;
    }

    .exception-item {
        font-size: 11px;
        padding: 4px 6px;
        flex-wrap: wrap;
    }

    .exception-item .btn-sm {
        font-size: 10px;
        padding: 2px 8px;
    }

    .schedule-actions {
        justify-content: stretch;
    }

    .schedule-btn {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 10px 16px;
    }

    .service-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .service-card-status {
        width: 100%;
        justify-content: space-between;
    }

    .service-card-body {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .service-card-field input {
        max-width: 100%;
    }

    .schedule-modal .slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .schedule-modal .step-content {
        padding: 12px;
    }

    .schedule-modal .modal-footer {
        flex-direction: column;
    }

    .schedule-modal .modal-footer button {
        width: 100%;
        justify-content: center;
    }

    .exceptions-grid {
        grid-template-columns: 1fr;
    }

    .exceptions-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .exceptions-card-type {
        align-self: flex-start;
    }

    .exceptions-card-day {
        font-size: 16px;
    }

    .exceptions-stat-value {
        font-size: 16px;
    }

    .exceptions-panel {
        padding: 12px 14px;
    }

    .settings-section-header {
        padding: 12px 16px;
    }

    .settings-section-body {
        padding: 12px 16px;
    }

    .settings-field-group input[type="number"] {
        width: 60px;
    }

    .settings-channel {
        font-size: 12px;
        padding: 4px 10px;
    }
}

/* ============================================================
   БЛОК ССЫЛКИ ДЛЯ ЗАПИСИ (в настройках)
   ============================================================ */

.booking-link-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.booking-link-input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.booking-link-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    background: #f8fafc;
    color: #1a202c;
    cursor: text;
    transition: border-color 0.2s;
}

.booking-link-input:focus {
    outline: none;
    border-color: #667eea;
}

.booking-link-input-copy {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: color 0.2s;
}

.booking-link-input-copy:hover {
    color: #667eea;
}

.booking-link-stats {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #718096;
}

.booking-link-stats i {
    width: 16px;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 600px) {
    .booking-link-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .booking-link-wrapper .btn-primary,
    .booking-link-wrapper .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .booking-link-stats {
        gap: 12px;
        font-size: 12px;
    }
}