body, html {
  margin: 0; 
  padding: 0; 
  height: 100%; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
  color: #333333;
  line-height: 1.4;
  font-size: 14px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.header {
  background: #ffffff;
  color: #333333;
  padding: 20px 32px;
  text-align: left;
  font-size: 24px;
  font-weight: 600;
  border-bottom: 1px solid #e8e8e8;
  position: relative;
  box-shadow: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Кнопки */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

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

.btn-secondary {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.header::before {
  display: none;
}

.admin-info {
  font-size: 16px;
  font-weight: 400;
  margin-top: 8px;
  opacity: 0.7;
  color: #666666;
}

.branch-selector {
  background: #ffffff;
  padding: 24px 32px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: none;
  border-bottom: 1px solid #e8e8e8;
}

.branch-selector label {
  color: #333333;
  font-weight: 500;
  margin: 0;
  font-size: 16px;
}

.branch-selector select {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  color: #333333;
  font-size: 14px;
  font-weight: 400;
  min-width: 240px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: none;
}

.branch-selector select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.branch-selector select:hover {
  border-color: #1976d2;
}

.branch-stats {
  background: #ffffff;
  padding: 24px 32px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: none;
}

.stat-item {
  text-align: left;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  min-width: 120px;
  box-shadow: none;
  border: 1px solid #e8e8e8;
  transition: all 0.2s ease;
}

.stat-item:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: #1976d2;
}

.stat-number {
  font-size: 28px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: #666666;
  margin-top: 0;
  font-weight: 400;
}

/* Мобильные стили для статистики */
@media (max-width: 768px) {
  .stat-item {
    padding: 12px;
    min-width: 100px;
  }
  
  .stat-number {
    font-size: 20px;
  }
  
  .stat-label {
    font-size: 11px;
  }
}

@media (max-width: 375px) {
  .stat-item {
    padding: 8px;
    min-width: 80px;
  }
  
  .stat-number {
    font-size: 16px;
  }
  
  .stat-label {
    font-size: 10px;
  }
}

.stat-scheduled { border-left: 4px solid #4a90e2; }
.stat-in-work { border-left: 4px solid #28a745; }
.stat-on-repair { border-left: 4px solid #ffc107; }
.stat-no-show { border-left: 4px solid #dc3545; }

.calendar-toolbar-bottom {
  padding: 0;
}

.toolbar-row {
  display: none;
}

.current-date-display {
  display: none;
}

.view-buttons {
  display: none;
}

.view-btn {
  display: none;
}

.calendar-container {
  max-width: none;
  margin: 0;
  background: #ffffff;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border: none;
}

#mtr-calendar {
  max-width: 100%;
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: none;
}

.status-scheduled { background: #1976d2; }
.status-in-work { background: #2e7d32; }
.status-on-repair { background: #f57c00; }
.status-no-show { background: #c62828; }

/* Скрываем индикаторы статуса в карточках календаря */
.fc-event .status-indicator {
  display: none !important;
}

/* Скрываем индикаторы статуса во всех событиях FullCalendar */
.fc .fc-event .status-indicator,
.fc-event-main .status-indicator,
.fc-event-main-frame .status-indicator {
  display: none !important;
}

/* Скрываем индикаторы статуса в разных видах календаря */
.fc .fc-timegrid-event .status-indicator,
.fc .fc-daygrid-event .status-indicator,
.fc .fc-list-event .status-indicator,
.fc .fc-event-main-frame .status-indicator,
.fc .fc-event-main .status-indicator {
  display: none !important;
}

/* Скрываем индикаторы статуса в заголовках событий */
.fc .fc-event-title .status-indicator,
.fc .fc-event-time .status-indicator {
  display: none !important;
}

/* Скрываем индикаторы статуса во всех дочерних элементах событий */
.fc .fc-event * .status-indicator,
.fc-event * .status-indicator {
  display: none !important;
}

/* Глобальное скрытие индикаторов статуса в календаре */
.fc .status-indicator {
  display: none !important;
}

/* =====================================================
   СТИЛИ КАЛЕНДАРЯ FULLCALENDAR
   ===================================================== */

/* Основные стили календаря */
.fc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #ffffff;
}

/* Контейнер календаря */
.calendar-container {
  position: relative;
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#mtr-calendar {
  width: 100%;
  height: auto;
  min-height: 600px;
}

/* Панель инструментов календаря */
.fc .fc-toolbar {
  margin-bottom: 20px;
}

/* Кастомная панель инструментов */
.calendar-toolbar {
  display: none; /* Скрываем панель инструментов */
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 0;
  border-bottom: 1px solid #e8e8e8;
}

.view-buttons {
  display: flex;
  gap: 8px;
}

.view-btn {
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  color: #333333;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: inherit;
}

.view-btn:hover {
  background: #f5f5f5;
  border-color: #1976d2;
}

.view-btn.active {
  background: #1976d2;
  color: #ffffff;
  border-color: #1976d2;
}

.current-date {
  font-size: 16px;
  font-weight: 500;
  color: #666666;
  padding: 0;
}

.fc .fc-toolbar-title {
  font-size: 24px;
  font-weight: 600;
  color: #333333;
}

/* Кнопки календаря */
.fc .fc-button {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #495057;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.fc .fc-button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.fc .fc-button-active {
  background: #1976d2;
  border-color: #1976d2;
  color: #ffffff;
}

.fc .fc-button-active:hover {
  background: #1565c0;
  border-color: #1565c0;
}

/* Заголовки дней */
.fc .fc-col-header-cell {
  background: #f8f9fa;
  border-color: #dee2e6;
  padding: 12px 8px;
}

.fc .fc-col-header-cell-cushion {
  color: #495057;
  font-weight: 600;
  text-decoration: none;
}

/* Ячейки дней */
.fc .fc-daygrid-day {
  border-color: #dee2e6;
}

.fc .fc-daygrid-day-number {
  color: #495057;
  font-weight: 500;
  padding: 8px;
}

/* Временные слоты (для недели и дня) */
.fc .fc-timegrid-slot {
  border-color: #f0f0f0;
  min-height: 50px;
}

.fc .fc-timegrid-slot-label {
  font-weight: 500;
  color: #666666;
  font-size: 12px;
  padding: 6px;
  background: #fafafa;
}

/* События календаря */
.fc .fc-event {
  border-radius: 6px;
  font-weight: 500;
  font-size: 12px;
  padding: 4px 8px;
  margin: 2px 0;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
}

.fc .fc-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Скрываем время событий во всех видах */
.fc .fc-event-time {
  display: none !important;
}

/* Стили для счетчика событий в ячейках дней */
.fc .fc-daygrid-day {
  position: relative;
}

/* Счетчик событий в левом верхнем углу */
.fc .fc-daygrid-day .event-count {
  position: absolute;
  top: 2px;
  left: 2px;
  background: #1976d2;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .fc .fc-daygrid-day .event-count {
    width: 16px;
    height: 16px;
    font-size: 9px;
    top: 1px;
    left: 1px;
  }
}

/* Цвета для событий по статусам теперь применяются динамически через JavaScript */
/* Старые CSS классы удалены, так как цвета загружаются из вебхука */

/* Стили для индикатора статуса в событиях */
.status-indicator {
  display: inline-block !important;
  margin-right: 6px !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  vertical-align: middle !important;
}



/* Стили для активных кнопок календаря */
.fc-button-active {
  background: #1976d2 !important;
  border-color: #1976d2 !important;
  color: #ffffff !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

.fc-button-active:hover {
  background: #1565c0 !important;
  border-color: #1565c0 !important;
  box-shadow: none !important;
  transform: none !important;
}

.fc-button {
  background: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  color: #333333 !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
  font-weight: 400 !important;
  border-radius: 4px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

.fc-button:hover {
  background: #f8f9fa !important;
  border-color: #1976d2 !important;
  color: #333333 !important;
  transform: none !important;
}

.fc-button:not(.fc-button-active):hover {
  background: #f8f9fa !important;
  color: #333333 !important;
}

/* === МОДАЛЬНОЕ ОКНО CSS в стиле amoCRM === */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100%; height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.2);
  backdrop-filter: none;
}

/* Мобильные стили для модального окна */
@media (max-width: 768px) {
  .modal {
    overflow: hidden; /* Убираем скролл на мобильных */
  }
}

.modal-content {
  background: #ffffff;
  margin: 60px auto;
  padding: 24px;
  border-radius: 4px;
  max-width: 480px;
  position: relative;
  box-shadow: none;
  border: 1px solid #e0e0e0;
}

.modal-close {
  position: absolute;
  right: 20px; top: 20px;
  font-size: 28px;
  font-weight: 600;
  color: #999999;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: none;
  background: transparent;
  border: none;
}

.modal-close:hover { 
  color: #666666; 
  background: transparent;
  border: none;
}

/* Стили для заголовка модалки */
#modal-title {
  font-size: 18px;
  font-weight: 500;
  color: #333333;
  margin: 0 0 16px 0;
  padding: 0;
  line-height: 1.3;
}

/* Стили для содержимого модалки */
#modal-details {
  font-size: 13px;
  line-height: 1.4;
  color: #333333;
}

/* === НОВЫЕ СТИЛИ МОДАЛКИ В СТИЛЕ AMOCRM === */

/* Блок статуса */
.modal-status-block {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  margin-bottom: 12px;
  background: #ffffff;
  border: none;
  border-radius: 0;
}

/* Статусы теперь определяются динамически через JavaScript */

/* Блок даты */
.modal-date-block {
  padding: 12px 0;
  margin-bottom: 12px;
  background: #ffffff;
  border-left: 3px solid #666666;
  border-radius: 0;
}

/* Блок заявки */
.modal-request-block {
  padding: 12px 0;
  margin-bottom: 12px;
  background: #ffffff;
  border-left: 3px solid #1976d2;
  border-radius: 0;
}



/* Заголовки блоков */
.modal-status-block strong,
.modal-date-block strong,
.modal-request-block strong {
  font-size: 11px;
  font-weight: 600;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  display: block;
}

/* Содержимое блоков */
.modal-date-content,
.modal-request-content {
  font-size: 13px;
  line-height: 1.4;
  color: #333333;
  margin-top: 4px;
  padding-left: 0;
  padding-right: 0;
}

/* Специальные стили для поля "ЗАЯВКА" */
.modal-request-content {
  white-space: pre-wrap; /* Сохраняем переносы строк и пробелы */
  word-wrap: break-word; /* Переносим длинные слова */
  overflow-y: auto; /* Вертикальная прокрутка при необходимости */
  padding: 8px; /* Возвращаем отступы со всех сторон */
  background: #f8f9fa; /* Легкий фон для выделения */
  border-radius: 4px; /* Скругленные углы */
}

/* Мобильные стили для блока заявки */
@media (max-width: 768px) {
  .modal-request-content {
    max-height: 60vh; /* На мобильных увеличиваем высоту */
    min-height: 40vh; /* Минимальная высота */
  }
}

/* Стили для переносов строк в поле "ЗАЯВКА" */
.modal-request-content br {
  display: block; /* Принудительно показываем переносы */
  margin: 4px 0; /* Отступы между строками */
}

/* Стили для ссылки на сделку в модальном окне */
/* Убрано - ссылка теперь встроена в заголовок */

/* Стили для ссылки в заголовке модального окна */
.modal-title-link {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.modal-title-link:hover {
  color: #0056b3;
  text-decoration: none;
}

/* =====================================================
   ИНДИКАТОР ЗАГРУЗКИ СОБЫТИЙ (OVERLAY)
   ===================================================== */

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 8px;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-text {
  font-size: 16px;
  color: #666;
  font-weight: 500;
  text-align: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .loading-content {
    padding: 30px 15px;
  }
  
  .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }
  
  .loading-text {
    font-size: 14px;
  }
}

/* Индикатор статуса в модалке */
.modal-status-block .status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block !important; /* Принудительно показываем в модалке */
}

/* === БЛОК ДЕЙСТВИЙ В МОДАЛКЕ === */

/* Блок с кнопкой действия */
.modal-action-block {
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #ffffff;
  border-radius: 0;
  text-align: left;
}

/* Кнопка действия */
.modal-action-button {
  background: #1976d2;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: none;
  font-family: inherit;
  min-width: 200px;
  text-decoration: none; /* Убираем подчеркивание */
}

.modal-action-button:hover {
  background: #1565c0;
  transform: none;
  box-shadow: none;
  text-decoration: none; /* Убираем подчеркивание при наведении */
}

.modal-action-button:active {
  background: #0d47a1;
  text-decoration: none; /* Убираем подчеркивание при нажатии */
}

.modal-action-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
  text-decoration: none; /* Убираем подчеркивание при фокусе */
}

/* Принудительное переопределение для блоков модалки */
.modal-status-block,
.modal-date-block,
.modal-request-block,
.modal-action-block {
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background: #ffffff !important;
}

/* Специально для блока статуса - никаких границ */
.modal-status-block {
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  background: #ffffff !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Принудительное удаление всех границ для всех элементов внутри блока статуса */
.modal-status-block * {
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
}

/* Глобальное переопределение для блока статуса */
.modal-status-block,
.modal-status-block::before,
.modal-status-block::after,
.modal-status-block *,
.modal-status-block *::before,
.modal-status-block *::after {
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.fc .fc-button-group {
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

.fc .fc-button-group .fc-button {
  border-radius: 0 !important;
  margin: 0 !important;
  border-right: 1px solid #e0e0e0 !important;
}

.fc .fc-button-group .fc-button:first-child {
  border-top-left-radius: 6px !important;
  border-bottom-left-radius: 6px !important;
}

.fc .fc-button-group .fc-button:last-child {
  border-bottom-right-radius: 6px !important;
  border-right: none !important;
}

/* Стили для названия филиала */
.branch-name-single {
  background: #4a90e2;
  color: #ffffff;
  padding: 16px 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
  margin: 16px 32px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.branch-name-single::before {
  display: none;
}

/* Стили для информации о филиале в шапке */
.branch-info {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
  color: #333333;
  text-align: center;
  padding: 16px 24px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  box-shadow: none;
  text-shadow: none;
  backdrop-filter: none;
  transition: all 0.2s ease;
}

.branch-info:hover {
  background: #f0f0f0;
  border-color: #4a90e2;
  transform: none;
  box-shadow: none;
}

/* Стили для случая, когда отображается только название филиала */
.branch-info:not(:has(.branch-selector)) {
  background: #f8f9fa;
  font-size: 16px;
  font-weight: 500;
  padding: 16px 24px;
  letter-spacing: normal;
  text-shadow: none;
  border: 1px solid #e8e8e8;
}

.branch-info:not(:has(.branch-selector)):hover {
  background: #f0f0f0;
  transform: none;
  box-shadow: none;
  border-color: #4a90e2;
}

.branch-info .branch-selector {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

.branch-info .branch-selector label {
  color: #333333;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  text-shadow: none;
  letter-spacing: normal;
}

.branch-info .branch-selector select {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #333333;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  min-width: 240px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: none;
}

.branch-info .branch-selector select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
  transform: none;
}

.branch-info .branch-selector select:hover {
  background: #f8f9fa;
  border-color: #4a90e2;
  transform: none;
  box-shadow: none;
}

.branch-info .branch-selector select option {
  background: #ffffff;
  color: #333333;
  padding: 8px;
  font-weight: 400;
}

/* Простой селектор филиалов в шапке */
.simple-branch-selector {
  margin-top: 0;
  text-align: right;
}

.simple-branch-selector select {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #333333;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 400;
  min-width: 180px;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: none;
  font-family: inherit;
}

/* Дополнительные мобильные стили для средних экранов */
@media (max-width: 1024px) {
  .header {
    padding: 16px 24px;
    font-size: 20px;
  }
  

  
  .fc .fc-toolbar {
    padding: 16px 24px 0 24px !important;
  }
}

.simple-branch-selector select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
  transform: none;
}

.simple-branch-selector select:hover {
  background: #f8f9fa;
  border-color: #1976d2;
  transform: none;
  box-shadow: none;
}

.simple-branch-selector select option {
  background: #ffffff;
  color: #333333;
  padding: 8px;
  font-weight: 400;
}

/* Стили для отключенного селектора (обычный пользователь) */
.simple-branch-selector select:disabled {
  background: #f8f9fa;
  color: #666666;
  border-color: #e0e0e0;
  cursor: default;
  opacity: 0.8;
}

.simple-branch-selector select:disabled:hover {
  background: #f8f9fa;
  border-color: #e0e0e0;
  transform: none;
  box-shadow: none;
}

.simple-branch-selector select:disabled:focus {
  outline: none;
  border-color: #e0e0e0;
  box-shadow: none;
}

/* Мобильные стили */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    font-size: 18px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  
  .simple-branch-selector {
    text-align: center;
  }
  
  .simple-branch-selector select {
    min-width: 100%;
    max-width: 250px;
    padding: 4px 8px;
    font-size: 12px;
  }
  

  
  .branch-selector {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .branch-selector select {
    min-width: 100%;
  }
  
  .branch-stats {
    padding: 12px 16px;
    flex-direction: column;
  }
  
  .stat-item {
    min-width: auto;
    width: 100%;
  }
  

  
  .fc .fc-toolbar {
    padding: 12px 16px 0 16px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .fc .fc-toolbar-title {
    font-size: 16px !important;
    text-align: center !important;
  }
  
  .fc .fc-button {
    font-size: 12px !important;
    padding: 6px 12px !important;
    min-height: 32px !important;
  }
  
  .modal-content {
    margin: 0;
    padding: 20px;
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  
  #modal-title {
    font-size: 16px;
    margin-bottom: 14px;
    padding-right: 40px; /* Место для кнопки закрытия */
  }
  
  /* Мобильные стили для новых блоков модалки */
  .modal-status-block {
    padding: 6px 0;
    margin-bottom: 8px;
    gap: 5px;
  }
  
  .modal-date-block,
  .modal-request-block {
    padding: 10px 0;
    margin-bottom: 10px;
  }
  
  /* Увеличиваем высоту блока заявки на мобильных */
  .modal-request-block {
    flex: 1; /* Растягиваем блок */
    display: flex;
    flex-direction: column;
  }
  
  .modal-request-content {
    flex: 1; /* Растягиваем содержимое */
    min-height: 50vh; /* Минимальная высота */
  }
  
  .modal-status-block strong,
  .modal-date-block strong,
  .modal-request-block strong {
    font-size: 10px;
    letter-spacing: 0.6px;
  }
  
  .modal-date-content,
  .modal-request-content {
    font-size: 12px;
  }
  
  /* Мобильные стили для кнопки действия */
  .modal-action-block {
    padding: 10px 0;
    margin-bottom: 10px;
  }
  
  .modal-action-button {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 180px;
  }
}

@media (max-width: 375px) {
  .header {
    padding: 8px 12px;
    font-size: 16px;
    flex-direction: column;
    gap: 6px;
  }
  
  .simple-branch-selector select {
    min-width: 100%;
    max-width: 200px;
    padding: 3px 6px;
    font-size: 11px;
  }
  

  
  .branch-selector {
    padding: 8px 12px;
  }
  
  .branch-stats {
    padding: 8px 12px;
  }
  

  
  .fc .fc-toolbar {
    padding: 8px 12px 0 12px !important;
    gap: 6px !important;
  }
  
  .fc .fc-toolbar-title {
    font-size: 14px !important;
  }
  
  .fc .fc-button {
    font-size: 11px !important;
    padding: 4px 8px !important;
    min-height: 28px !important;
  }
  
  .modal-content {
    margin: 0;
    padding: 16px;
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  
  #modal-title {
    font-size: 15px;
    margin-bottom: 12px;
    padding-right: 40px; /* Место для кнопки закрытия */
  }
  
  /* Мобильные стили для новых блоков модалки на маленьких экранах */
  .modal-status-block {
    padding: 5px 12px;
    margin-bottom: 6px;
    gap: 4px;
  }
  
  .modal-date-block,
  .modal-request-block {
    padding: 8px 12px;
    margin-bottom: 8px;
  }
  
  /* Увеличиваем высоту блока заявки на маленьких экранах */
  .modal-request-block {
    flex: 1; /* Растягиваем блок */
    display: flex;
    flex-direction: column;
  }
  
  .modal-request-content {
    flex: 1; /* Растягиваем содержимое */
    min-height: 45vh; /* Минимальная высота для маленьких экранов */
  }
  
  .modal-status-block strong,
  .modal-date-block strong,
  .modal-request-block strong {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  
  .modal-date-content,
  .modal-request-content {
    font-size: 11px;
  }
  
  /* Мобильные стили для кнопки действия на маленьких экранах */
  .modal-action-block {
    padding: 8px 12px;
    margin-bottom: 8px;
  }
  
  .modal-action-button {
    padding: 6px 12px;
    font-size: 11px;
    min-width: 160px;
  }
}

/* Стили для FullCalendar */
.fc {
  font-family: inherit;
  background: #ffffff;
}

.fc .fc-toolbar {
  padding: 16px 32px 0 32px !important;
  background: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

.fc .fc-toolbar-title {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: #333333 !important;
}

.fc .fc-daygrid-day-number {
  font-weight: 500 !important;
  color: #333333 !important;
  font-size: 14px !important;
}

.fc .fc-col-header-cell {
  background: #f8f9fa !important;
  border-color: #e8e8e8 !important;
  padding: 8px 0 !important;
}

.fc .fc-col-header-cell-cushion {
  font-weight: 600 !important;
  color: #333333 !important;
  padding: 0 !important;
  font-size: 13px !important;
}

.fc .fc-timegrid-slot {
  border-color: #f0f0f0 !important;
  min-height: 50px !important;
}

.fc .fc-timegrid-slot-label {
  font-weight: 500 !important;
  color: #666666 !important;
  font-size: 12px !important;
  padding: 6px !important;
  background: #fafafa !important;
}

.fc .fc-event {
  border-radius: 4px !important;
  font-weight: 500 !important;
  border: 1px solid !important;
  font-size: 12px !important;
  padding: 3px 6px !important;
  margin: 1px 0 !important;
  line-height: 1.3 !important;
  cursor: pointer !important;
  transition: none !important;
  color: #333333 !important;
}

.fc .fc-event-main {
  padding: 1px 2px !important;
}

.fc .fc-event:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Специфичные стили для timeGrid (неделя и день) */
.fc .fc-timegrid-event {
  color: #333333 !important;
}

.fc .fc-timegrid-event .fc-event-main {
  color: #333333 !important;
}

.fc .fc-timegrid-event .fc-event-title {
  color: #333333 !important;
}

/* Стили для всех событий независимо от вида */
.fc-event,
.fc .fc-event,
.fc .fc-timegrid-event,
.fc .fc-daygrid-event,
.fc .fc-list-event {
  color: #333333 !important;
}

.fc-event-main,
.fc .fc-event-main,
.fc .fc-timegrid-event .fc-event-main,
.fc .fc-daygrid-event .fc-event-main,
.fc .fc-list-event .fc-event-main {
  color: #333333 !important;
}

.fc-event-title,
.fc .fc-event-title,
.fc .fc-timegrid-event .fc-event-title,
.fc .fc-daygrid-event .fc-event-title,
.fc .fc-list-event .fc-event-title {
  color: #333333 !important;
}

/* Принудительное переопределение цвета для всех элементов событий */
.fc .fc-timegrid-event *,
.fc .fc-daygrid-event *,
.fc .fc-list-event *,
.fc-event * {
  color: #333333 !important;
}

/* Дополнительные селекторы для timeGrid */
.fc-timegrid-event,
.fc-timegrid-event-main,
.fc-timegrid-event-title,
.fc-timegrid-event-time {
  color: #333333 !important;
}

/* Переопределение встроенных стилей FullCalendar */
.fc .fc-event-main-frame,
.fc .fc-event-main-frame *,
.fc .fc-event-time,
.fc .fc-event-title-container,
.fc .fc-event-title {
  color: #333333 !important;
}

/* Глобальное переопределение для всех событий */
.fc-event,
.fc-event *,
.fc .fc-event,
.fc .fc-event * {
  color: #333333 !important;
}

/* Скрываем время в событиях во всех режимах календаря */
.fc .fc-event-time,
.fc-event-time,
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time {
  display: none !important;
}

/* Скрываем время в заголовках событий */
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-title .fc-event-time,
.fc .fc-event-main-frame .fc-event-time {
  display: none !important;
}

/* Скрываем время в разных видах календаря */
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time {
  display: none !important;
}

/* Принудительное скрытие времени во всех событиях */
.fc .fc-event * .fc-event-time,
.fc-event * .fc-event-time {
  display: none !important;
}

/* Дополнительное скрытие времени во всех возможных местах */
.fc .fc-event-time,
.fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-title .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time {
  display: none !important;
}

/* Скрытие времени в заголовках событий всех типов */
.fc .fc-event-title .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time {
  display: none !important;
}

/* Скрытие времени в разных видах календаря - расширенное */
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time {
  display: none !important;
}

/* Принудительное скрытие времени во всех событиях - максимальное покрытие */
.fc .fc-event * .fc-event-time,
.fc-event * .fc-event-time,
.fc .fc-event-main * .fc-event-time,
.fc .fc-event-main-frame * .fc-event-time,
.fc .fc-event-title-container * .fc-event-time,
.fc .fc-event-title * .fc-event-time {
  display: none !important;
}

/* Дополнительные селекторы для скрытия времени */
.fc .fc-event-time,
.fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-title .fc-event-time,
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-event-title .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time {
  display: none !important;
}

/* Скрытие времени в заголовках событий всех типов - расширенное */
.fc .fc-event-title .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-event-title .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time {
  display: none !important;
}

/* Скрытие времени в разных видах календаря - максимальное покрытие */
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-event-title .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-event-main-frame .fc-event-time,
.fc .fc-event-main .fc-event-time {
  display: none !important;
}

/* Скрываем все элементы легенды FullCalendar */
.fc-legend,
.fc .fc-legend,
.fc-legend-item,
.fc .fc-legend-item,
.fc-legend-title,
.fc .fc-legend-title,
.fc-legend-content,
.fc .fc-legend-content {
  display: none !important;
}

/* Скрываем легенду статусов в разных видах календаря */
.fc .fc-timegrid .fc-legend,
.fc .fc-daygrid .fc-legend,
.fc .fc-list .fc-legend {
  display: none !important;
}

/* Принудительное скрытие всех элементов легенды */
.fc * .fc-legend,
.fc * .fc-legend-item,
.fc * .fc-legend-title {
  display: none !important;
}

/* Мобильные стили для скрытия легенды */
@media (max-width: 768px) {
  .fc-legend,
  .fc .fc-legend,
  .fc-legend-item,
  .fc .fc-legend-item {
    display: none !important;
  }
  
  /* Скрытие времени на планшетах */
.fc-event-time,
.fc .fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-event-main-frame .fc-event-time {
  display: none !important;
}

/* Дополнительное скрытие времени на планшетах */
.fc .fc-event-title .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time {
  display: none !important;
}
}

@media (max-width: 375px) {
  .fc-legend,
  .fc .fc-legend,
  .fc-legend-item,
  .fc .fc-legend-item {
    display: none !important;
  }
  
  /* Скрытие времени на мобильных устройствах */
.fc-event-time,
.fc .fc-event-time,
.fc .fc-event-main .fc-event-time,
.fc .fc-event-main-frame .fc-event-time {
  display: none !important;
}

/* Дополнительное скрытие времени на мобильных */
.fc .fc-event-title .fc-event-time,
.fc .fc-event-title-container .fc-event-time,
.fc .fc-timegrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-list-event .fc-event-time {
  display: none !important;
}
}

/* Скрываем все индикаторы статусов */
.status-indicator {
  display: none !important;
}

/* Скрываем все элементы с классом status-indicator */
span.status-indicator,
div.status-indicator,
.status-indicator {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Скрываем индикаторы в модальном окне */
.modal-status-block .status-indicator {
  display: none !important;
}

/* Скрываем индикаторы в заголовках событий */
.fc-event-title .status-indicator {
  display: none !important;
}

/* Скрываем все элементы с data-атрибутом status */
[data-status] .status-indicator {
  display: none !important;
}

/* Стили для ссылки в заголовке модального окна */
.modal-title-link {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.modal-title-link:hover {
  color: #0056b3;
  text-decoration: none;
}

/* Убираем отступы у всех блоков внутри modal-details */
.modal-details > div {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Специально для блоков статуса, даты, заявки и действия */
.modal-status-block,
.modal-date-block,
.modal-request-block,
.modal-action-block {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

