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: 10px;
  flex-shrink: 0;
}

.calendar-header .header-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.calendar-header {
  --header-control-height: 36px;
}

.header-employees-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--header-control-height);
  height: var(--header-control-height);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #ffffff;
  color: #888888;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.header-employees-btn:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
  color: #666666;
}

.header-employees-btn:focus-visible {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
}

.header-employees-btn__icon {
  display: block;
}

.header-diag-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--header-control-height, 36px);
  padding: 0 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #ffffff;
  color: #555555;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.header-diag-btn:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
  color: #333333;
}

.header-diag-btn:focus-visible {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
}

.mtr-network-diag {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  overflow: auto;
  background: rgba(245, 247, 250, 0.98);
  padding: 16px;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a1a;
}

.mtr-network-diag__card {
  max-width: 520px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.mtr-network-diag__card--loading {
  text-align: center;
  padding: 32px 16px;
}

.mtr-network-diag__title {
  font-size: 18px;
  margin: 0 0 12px;
}

.mtr-network-diag__hint {
  margin: 0 0 12px;
  color: #555555;
}

.mtr-network-diag__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mtr-network-diag__item {
  padding: 10px 0;
  border-bottom: 1px solid #eeeeee;
}

.mtr-network-diag__vpn {
  margin-top: 12px;
  padding: 10px;
  background: #fff8e6;
  border-radius: 8px;
  font-size: 13px;
  color: #664d00;
}

.mtr-network-diag__vpn-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.mtr-network-diag__env {
  margin: 12px 0 0;
  padding: 10px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.mtr-network-diag__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mtr-network-diag__btn {
  padding: 10px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #ffffff;
  color: #333333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mtr-network-diag__btn--primary {
  border-color: #1976d2;
  background: #1976d2;
  color: #ffffff;
}

.mtr-network-diag__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mtr-network-diag__spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid #e9ecef;
  border-top-color: #1976d2;
  border-radius: 50%;
  animation: mtr-spin 0.9s linear infinite;
}

.mtr-network-diag__loading-text {
  margin: 0;
  color: #555555;
}

@keyframes mtr-spin {
  to { transform: rotate(360deg); }
}

.mtr-app-footer {
  text-align: center;
  padding: 16px 20px 24px;
  color: #666666;
  font-size: 12px;
  border-top: 1px solid #eeeeee;
  margin-top: 40px;
}

.mtr-app-footer__credit {
  margin: 12px 0 0;
  line-height: 1.45;
}

.mtr-app-footer__credit a {
  color: inherit;
  text-decoration: none;
}

.mtr-app-footer__credit a:hover {
  text-decoration: underline;
}

.mtr-footer-diag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 10px 20px;
  border: 1px solid #1976d2;
  border-radius: 8px;
  background: #ffffff;
  color: #1976d2;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mtr-footer-diag-btn:hover {
  background: #1976d2;
  color: #ffffff;
}

.mtr-footer-diag-btn:focus-visible {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
}

/* Кнопки */
.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 {
  --calendar-page-padding-x: 32px;
  --calendar-page-padding-top: 12px;
  --calendar-page-padding-bottom: 16px;
  position: relative;
  max-width: none;
  margin: 0;
  padding: var(--calendar-page-padding-top) var(--calendar-page-padding-x) var(--calendar-page-padding-bottom);
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
  border: none;
  box-sizing: border-box;
}

#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 выше */
.calendar-container {
  border-radius: 0;
  box-shadow: none;
}

#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;
}

.calendar-nav-block {
  background: #ffffff;
}

/* Навигация по дате: ‹ дата › */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 8px;
  background: #ffffff;
}

.calendar-nav__btn {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #666666;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav__btn:hover {
  background: #f5f5f5;
  color: #333333;
}

.calendar-nav__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  text-align: center;
  white-space: nowrap;
}

.calendar-today {
  display: flex;
  justify-content: center;
  padding: 0 0 6px;
}

.calendar-today[hidden] {
  display: none !important;
}

.calendar-today__btn {
  border: none;
  background: transparent;
  color: #888888;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  padding: 2px 12px 4px;
  cursor: pointer;
  border-radius: 6px;
}

.calendar-today__btn:hover {
  background: #f5f5f5;
  color: #666666;
}

.fc .fc-toolbar-title {
  display: none !important;
}

/* Кнопки календаря */
.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;
}



/* Стили для кнопок вида FullCalendar (месяц / неделя / день / список) */
.fc .fc-button,
.fc-button {
  background: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  color: #333333 !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 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 .fc-button:not(.fc-button-active):hover,
.fc-button:not(.fc-button-active):hover {
  background: #f8f9fa !important;
  border-color: #1976d2 !important;
  color: #333333 !important;
  transform: none !important;
}

.fc .fc-button.fc-button-active,
.fc-button.fc-button-active {
  background: #1976d2 !important;
  border-color: #1976d2 !important;
  color: #ffffff !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

.fc .fc-button.fc-button-active:hover,
.fc-button.fc-button-active:hover {
  background: #1565c0 !important;
  border-color: #1565c0 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transform: none !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: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.modal-content {
  background: #ffffff;
  margin: 60px auto;
  padding: 24px 24px 20px;
  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: visible;
  padding: 8px 8px 12px;
  background: #f8f9fa;
  border-radius: 4px;
}

/* Мобильные стили для блока заявки */
@media (max-width: 768px) {
  .modal-request-content {
    max-height: none;
    min-height: 0;
  }
}

/* Стили для переносов строк в поле "ЗАЯВКА" */
.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;
}

.calendar-notice {
  position: absolute;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
  box-sizing: border-box;
}

.calendar-notice[hidden] {
  display: none !important;
}

.calendar-notice__dialog {
  position: relative;
  width: min(100%, 360px);
  padding: 28px 20px 20px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  box-sizing: border-box;
}

.calendar-notice__close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.calendar-notice__text {
  margin: 0 0 16px;
  padding: 0 8px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  color: #666666;
}

.calendar-notice__btn {
  min-width: 120px;
  padding: 10px 20px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #f8f9fa;
  color: #495057;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.calendar-notice__btn:hover {
  background: #e9ecef;
}

.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); }
}

/* Блок ошибки с кнопкой копирования */
.mtr-error-copy-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 16px;
}

.mtr-error-copy-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  background: #f8f9fa;
  border: 1px solid #e0e4e8;
  border-radius: 10px;
  text-align: left;
}

.mtr-error-copy-text {
  flex: 1;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mtr-error-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  color: #495057;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mtr-error-copy-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.mtr-error-copy-btn:active {
  transform: scale(0.96);
}

.mtr-error-copy-btn--copied {
  background: #d1e7dd;
  border-color: #a3cfbb;
  color: #0f5132;
}

.mtr-error-copy-btn--failed {
  background: #f8d7da;
  border-color: #f1aeb5;
  color: #842029;
}

.mtr-error-copy-hint,
.mtr-error-footer {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin-top: 8px;
}

.mtr-error-retry {
  margin-top: 12px;
  text-align: center;
}

/* Адаптивность для мобильных устройств */
@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 {
  display: flex !important;
  width: 100%;
  flex-wrap: nowrap;
  max-width: 100%;
  border: 1px solid #e0e0e0 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: none !important;
  box-sizing: border-box;
  vertical-align: top;
}

.fc .fc-button-group .fc-button {
  border-radius: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-right: 1px solid #e0e0e0 !important;
  white-space: nowrap !important;
  flex: 1 1 0 !important;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

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

.fc .fc-button-group .fc-button:last-child {
  border-right: none !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !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;
  flex: 1;
  min-width: 0;
  max-width: 220px;
}

.simple-branch-selector select {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #333333;
  height: var(--header-control-height, 36px);
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  width: 100%;
  min-width: 0;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: none;
  font-family: inherit;
  box-sizing: border-box;
}

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

  
  .fc .fc-toolbar {
    padding: 8px 0 0 !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: row;
    gap: 10px;
    align-items: center;
  }

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

  .header-actions {
    flex: 0 1 auto;
    justify-content: flex-end;
    min-width: 0;
    gap: 6px;
  }

  .header-diag-btn {
    padding: 0 8px;
    font-size: 11px;
  }

  .header-employees-btn {
    width: var(--header-control-height);
    height: var(--header-control-height);
  }
  
  .simple-branch-selector {
    flex: 1;
    min-width: 0;
    max-width: none;
    text-align: right;
  }
  
  .simple-branch-selector select {
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 0 10px;
    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%;
  }
  

  
  .calendar-container {
    --calendar-page-padding-x: 16px;
    --calendar-page-padding-top: 8px;
    --calendar-page-padding-bottom: 16px;
  }

  .fc .fc-toolbar {
    padding: 6px 0 0 !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .fc .fc-toolbar-chunk:has(.fc-button-group) {
    order: 1;
    width: 100%;
  }

  .calendar-nav {
    padding: 10px 0 6px;
  }

  .calendar-nav__title {
    font-size: 16px;
  }

  .calendar-nav__btn {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    font-size: 26px;
  }

  .fc .fc-toolbar-chunk:has(.fc-button-group) .fc-button-group {
    width: 100%;
    display: flex !important;
  }

  .fc .fc-toolbar-chunk:has(.fc-button-group) .fc-button-group .fc-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 6px !important;
    font-size: 12px !important;
  }
  
  .fc .fc-button {
    font-size: 12px !important;
    padding: 6px 12px !important;
    min-height: 32px !important;
  }
  
  .modal-content {
    margin: 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    max-width: 100vw;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    height: auto;
    border-radius: 0;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #modal-details {
    padding-bottom: 20px;
  }
  
  #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 {
    display: block;
  }

  .modal-request-content {
    min-height: 0;
  }
  
  .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;
  }

  .calendar-container {
    --calendar-page-padding-x: 12px;
    --calendar-page-padding-top: 6px;
    --calendar-page-padding-bottom: 12px;
  }
  
  .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: 4px 0 0 !important;
    gap: 0 !important;
  }

  .fc .fc-toolbar-chunk .fc-button-group .fc-button {
    padding: 5px 4px !important;
    font-size: 11px !important;
    min-height: 30px !important;
  }
  
  .fc .fc-button {
    font-size: 11px !important;
    padding: 4px 8px !important;
    min-height: 28px !important;
  }
  
  .modal-content {
    margin: 0;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    max-width: 100vw;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    height: auto;
    border-radius: 0;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  
  #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 {
    display: block;
  }

  .modal-request-content {
    min-height: 0;
  }
  
  .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: 8px 0 0 !important;
  background: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
  gap: 8px !important;
  width: 100%;
}

.fc .fc-toolbar-chunk {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.fc .fc-toolbar-chunk:has(.fc-button-group) {
  flex-wrap: nowrap;
  width: 100%;
  flex: 1 1 100%;
  overflow: visible;
  box-sizing: border-box;
}

.fc .fc-toolbar-chunk:empty {
  display: none !important;
}

.fc .fc-prev-button,
.fc .fc-next-button {
  display: none !important;
}

.fc .fc-today-button {
  display: none !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;
}

/* Пустое состояние — как счётчик «Всего: N сотрудников» */
.calendar-empty-note {
  margin: 0;
  padding: 8px 0 12px;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: #888888;
  line-height: 1.2;
  font-weight: 400;
}

.calendar-empty-note[hidden] {
  display: none !important;
}

.fc .fc-list:has(.fc-list-empty) {
  border: none !important;
}

.fc .fc-list-empty {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  background: transparent !important;
  background-color: transparent !important;
  padding: 0 !important;
}

.fc .fc-list-empty-cushion.calendar-empty-note,
.fc .fc-list-empty-cushion {
  margin: 0 !important;
  padding: 8px 0 12px !important;
  width: 100%;
  text-align: left !important;
  font-size: 14px !important;
  color: #888888 !important;
  line-height: 1.2 !important;
  font-weight: 400 !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;
}

/* Форма ответа мастера (Mini App mode=reply) */
.mtr-reply-form {
  max-width: 480px;
  margin: 24px auto;
  padding: 24px 20px 32px;
}

.mtr-reply-form__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: #212529;
}

.mtr-reply-form__hint {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.45;
  color: #6c757d;
}

.mtr-reply-form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #495057;
}

.mtr-reply-form__textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid #ced4da;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
}

.mtr-reply-form__textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.mtr-reply-form__error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5f5;
  color: #c92a2a;
  font-size: 14px;
  line-height: 1.4;
}

.mtr-reply-form__submit {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: #007bff;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.mtr-reply-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.mtr-reply-form--modal {
  max-width: none;
  margin: 0 0 16px;
  padding: 0;
}

.modal-reply-form {
  margin: 0 0 16px;
  padding: 0 0 4px;
  border-bottom: 1px solid #e9ecef;
}

.modal-reply-form[hidden] {
  display: none !important;
}

.mtr-reply-form--modal .mtr-reply-form__textarea {
  min-height: 96px;
}

.mtr-reply-form--success {
  text-align: center;
}

/* Форма «Принят в работу» (Mini App mode=diag_accept) */
.mtr-diag-form {
  max-width: 480px;
  margin: 24px auto;
  padding: 24px 20px 32px;
}

.mtr-diag-form__label {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.mtr-diag-form__types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.mtr-diag-form__type-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 12px;
  background: #f8f9fa;
  color: #495057;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mtr-diag-form__type-btn--active {
  border-color: #007bff;
  background: #fff;
  color: #007bff;
  box-shadow: 0 0 0 1px #007bff inset;
}

.mtr-diag-form__textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid #ced4da;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
}

.mtr-diag-form__textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.mtr-diag-form__error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5f5;
  color: #c92a2a;
  font-size: 14px;
  line-height: 1.4;
}

.mtr-diag-form__submit {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: #007bff;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.mtr-diag-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.mtr-diag-form--modal {
  max-width: none;
  margin: 0 0 16px;
  padding: 0;
}

.mtr-diag-actions__buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mtr-diag-actions__btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.mtr-diag-form--modal .mtr-diag-form__textarea {
  min-height: 96px;
}

.modal-diag-actions {
  margin: 0 0 16px;
}

.modal-diag-actions[hidden] {
  display: none !important;
}

.modal-diag-actions__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-diag-actions__btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #1976d2;
  border-radius: 10px;
  background: #1976d2;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}

.modal-diag-actions__btn--secondary {
  background: #fff;
  color: #1976d2;
}

.modal-diag-actions__btn--full {
  grid-column: 1 / -1;
}

.modal-diag-actions__btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .modal-diag-actions__grid {
    grid-template-columns: 1fr;
  }
}

