/* mod_doctor_schedule — mobile-first, компактная таблица расписания */
.mod-doctor-schedule {
  --mod-ds-text-dark: #202124;
  --mod-ds-text-light: #5f6368;
  --mod-ds-border: #ddd;
  --mod-ds-header-bg: #f0f0f0;
  --mod-ds-row-even: #ffffff;
  --mod-ds-row-odd: #f9f9f9;
  --mod-ds-weekend-bg: #ffe6e6;
  --mod-ds-time-pill-bg: #e6ffe6;
  --mod-ds-time-pill-text: #1e3a1e;
  --mod-ds-today-bg: #e8f4fc;
  --mod-ds-today-accent: #1a73e8;

  color: var(--mod-ds-text-dark) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  background: #ffffff !important;
  padding: 0.5rem !important;
  border-radius: 6px !important;
  border: 1px solid var(--mod-ds-border) !important;
}

.mod-doctor-schedule__block {
  border: 1px solid var(--mod-ds-border) !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  background: #fff !important;
}

.mod-doctor-schedule__tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.15rem !important;
  padding: 0.25rem 0.35rem 0.5rem !important;
  margin-bottom: 0.35rem !important;
  background: var(--mod-ds-header-bg) !important;
  border-bottom: 1px solid var(--mod-ds-border) !important;
}

.mod-doctor-schedule__tab {
  padding: 0.3rem 0.5rem !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: var(--mod-ds-text-light) !important;
  background: #fff !important;
  border: 1px solid var(--mod-ds-border) !important;
  border-radius: 4px !important;
  border-bottom-color: transparent !important;
  margin-bottom: -1px !important;
  cursor: pointer !important;
  transition: background 0.15s, color 0.15s !important;
}

.mod-doctor-schedule__tab:hover {
  color: var(--mod-ds-text-dark) !important;
  background: #f5f5f5 !important;
}

.mod-doctor-schedule__tab.is-active {
  color: var(--mod-ds-text-dark) !important;
  background: #fff !important;
  border-bottom-color: #fff !important;
  font-weight: 600 !important;
}

.mod-doctor-schedule__table-wrap {
  overflow: auto !important; /* вертикальный и горизонтальный скролл внутри блока — шапка с датами остаётся видимой */
  max-height: 55vh !important;
  -webkit-overflow-scrolling: touch !important;
  border-radius: 0 !important;
  border: none !important;
  margin-top: 0.25rem !important;
}

.mod-doctor-schedule__table-wrap::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}

.mod-doctor-schedule__table-wrap::-webkit-scrollbar-track {
  background: #f5f5f5 !important;
}

.mod-doctor-schedule__table-wrap::-webkit-scrollbar-thumb {
  background: #bbb !important;
  border-radius: 3px !important;
}

.mod-doctor-schedule__panel {
  padding: 0 !important;
}

.mod-doctor-schedule__table {
  width: 100% !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  color: var(--mod-ds-text-dark) !important;
  font-size: 0.75rem !important;
}

.mod-doctor-schedule__table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  padding: 0.2rem 0.25rem !important;
  text-align: center !important;
  border: 1px solid var(--mod-ds-border) !important;
  background: var(--mod-ds-header-bg) !important;
  color: var(--mod-ds-text-dark) !important;
  white-space: nowrap !important;
  font-weight: 600 !important;
  font-size: 0.7rem !important;
  line-height: 1.2 !important;
}

.mod-doctor-schedule__th-spec {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 3 !important; /* выше остальных th — угол «специалист» поверх строки дат при скролле */
  background: var(--mod-ds-header-bg) !important;
  text-align: left !important;
  box-shadow: 2px 0 0 0 var(--mod-ds-border);
  min-width: 0 !important;
  width: 7rem !important;
}

.mod-doctor-schedule__th-date {
  min-width: 2.2rem !important;
  font-size: 0.65rem !important;
}

.mod-doctor-schedule__th--weekend {
  background: var(--mod-ds-weekend-bg) !important;
}

.mod-doctor-schedule__th-date--today {
  background: var(--mod-ds-today-bg) !important;
  color: var(--mod-ds-today-accent) !important;
  font-weight: 700 !important;
  box-shadow: inset 0 -3px 0 0 var(--mod-ds-today-accent) !important;
}

.mod-doctor-schedule__table tbody tr:nth-child(even) {
  background: var(--mod-ds-row-even) !important;
}

.mod-doctor-schedule__table tbody tr:nth-child(odd) {
  background: var(--mod-ds-row-odd) !important;
}

.mod-doctor-schedule__cell-spec {
  position: sticky !important;
  left: 0 !important;
  z-index: 1 !important;
  padding: 0.25rem 0.35rem !important;
  border: 1px solid var(--mod-ds-border) !important;
  font-weight: 400 !important;
  white-space: normal !important;
  min-width: 7rem !important;
  font-size: 0.75rem !important;
  line-height: 1.25 !important;
  background: inherit !important;
  box-shadow: 2px 0 0 0 var(--mod-ds-border);
  overflow: visible !important;
  vertical-align: middle !important;
}

.mod-doctor-schedule__cell-spec-name {
  display: block;
  white-space: nowrap;
}

/* ФИО-ссылка: визуально выделяем, чтобы было понятно, что это ссылка */
.mod-doctor-schedule__cell-spec-name--link {
  color: var(--mod-ds-today-accent) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.mod-doctor-schedule__cell-spec-name--link:hover {
  color: #1557b0 !important;
  text-decoration-thickness: 2px;
}

.mod-doctor-schedule__cell-spec-list {
  display: block;
  font-size: 0.85em;
  color: var(--mod-ds-text-light);
  margin-top: 0.1rem;
  white-space: normal;
}

.mod-doctor-schedule__table tbody tr:nth-child(even) .mod-doctor-schedule__cell-spec {
  background: var(--mod-ds-row-even) !important;
}

.mod-doctor-schedule__table tbody tr:nth-child(odd) .mod-doctor-schedule__cell-spec {
  background: var(--mod-ds-row-odd) !important;
}

.mod-doctor-schedule__cell-date {
  padding: 0.15rem 0.25rem !important;
  border: 1px solid var(--mod-ds-border) !important;
  white-space: normal !important;
  color: var(--mod-ds-text-light) !important;
  text-align: center !important;
  font-size: 0.75rem !important;
  vertical-align: middle !important;
}

.mod-doctor-schedule__cell--weekend {
  background: var(--mod-ds-weekend-bg) !important;
}

.mod-doctor-schedule__cell-date--today {
  background: var(--mod-ds-today-bg) !important;
}

.mod-doctor-schedule__cell--has-time {
  color: var(--mod-ds-text-light) !important;
}

.mod-doctor-schedule__time-pill {
  display: inline-block !important;
  padding: 0.15rem 0.35rem !important;
  margin: 0.1rem 0.15rem 0.1rem 0 !important;
  background: var(--mod-ds-time-pill-bg) !important;
  color: var(--mod-ds-time-pill-text) !important;
  border-radius: 4px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}

/* Кнопка-слот записи: сброс стилей кнопки, курсор указатель */
.mod-doctor-schedule__time-pill--booking {
  border: none !important;
  cursor: pointer !important;
  font-family: inherit !important;
}

.mod-doctor-schedule__time-pill--booking:hover {
  filter: brightness(0.95) !important;
}

/* Прошедший день: слот неактивен, только отображение */
.mod-doctor-schedule__time-pill--past {
  opacity: 0.6 !important;
  cursor: default !important;
  background: var(--mod-ds-header-bg) !important;
  color: var(--mod-ds-text-light) !important;
}

.mod-doctor-schedule__no-data {
  padding: 1rem !important;
  text-align: center !important;
  color: var(--mod-ds-text-light) !important;
  font-size: 0.875rem !important;
  background: #f8f9fa !important;
  border-radius: 4px !important;
  border: 1px dashed var(--mod-ds-border) !important;
}

.mod-doctor-schedule__debug {
  margin-top: 0.75rem !important;
  padding: 0.75rem !important;
  background: #fef3c7 !important;
  border-left: 4px solid #f59e0b !important;
  border-radius: 4px !important;
  font-family: 'Courier New', monospace !important;
  font-size: 0.75rem !important;
  color: #92400e !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Широкие экраны: усиление отступов и размеров */
@media (min-width: 768px) {
  .mod-doctor-schedule {
    padding: 0.75rem !important;
  }

  .mod-doctor-schedule__tabs {
    padding: 0.35rem 0.5rem 0.5rem !important;
    margin-bottom: 0.4rem !important;
    gap: 0.2rem !important;
  }

  .mod-doctor-schedule__tab {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.85rem !important;
  }

  .mod-doctor-schedule__table-wrap {
    max-height: 60vh !important;
  }

  .mod-doctor-schedule__table {
    font-size: 0.85rem !important;
  }

  .mod-doctor-schedule__table thead th {
    padding: 0.25rem 0.35rem !important;
    font-size: 0.8rem !important;
  }

  .mod-doctor-schedule__th-spec {
    width: 12rem !important;
    max-width: 12rem !important;
  }

  .mod-doctor-schedule__th-date {
    min-width: 2.8rem !important;
    font-size: 0.8rem !important;
  }

  .mod-doctor-schedule__cell-spec {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.85rem !important;
    min-width: 12rem !important;
  }

  .mod-doctor-schedule__cell-date {
    padding: 0.2rem 0.35rem !important;
    font-size: 0.85rem !important;
  }

  .mod-doctor-schedule__time-pill {
    padding: 0.2rem 0.45rem !important;
    font-size: 0.85rem !important;
  }
}
