/* ============================================================
   Общие стили для модалок и оверлея
   ============================================================ */
#doctor-time-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9990;
}

.slot-btn.disabled-slot {
  pointer-events: none;
  opacity: 0.6;
  cursor: default;
}

.doctor-time-popup {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10000;
}

.doctor-time-popup .popup-close {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ============================================================
   Сетка календаря
   ============================================================ */
.calendar-container {
  margin-bottom: 20px;
}

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

.calendar-header .calendar-nav {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1rem;
}

.calendar-header .calendar-title {
  flex: 1;
  text-align: center;
  margin: 0 10px;
  font-size: 1.2rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 100px;     /* фиксированная высота строк */
  gap: 8px;
}

/* Заголовки дней недели */
.calendar-grid .weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

/* Пустые ячейки */
.calendar-grid .blank {
  /* просто пустая ячейка для выравнивания */
}

/* Ячейка с кнопкой */
.calendar-grid .calday {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: flex-start; по умолчанию */
}

.dt-popup-slots {
    /* gap: unset; */
    display: flex
;
    gap: 10px 10px;
    flex-wrap: wrap;
    justify-content: space-evenly;
}
button.day-slot-off {
    background: #bad7d8;
}


/* Общий стиль кнопки */
.calendar-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  padding: 8px;
  transition: background .2s, color .2s;
}

/* Дата (спан сверху) */
.calendar-grid button .dt-day-date {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: #fff;
}

/* Текст кнопки (спан снизу) */
.calendar-grid button .dt-day-label {
  font-size: 0.85rem;
  color: #fff;
}

/* Доступные дни */
.calendar-grid button.day-slot-available {
  background-color: #4caf50;
  border-color: #4caf50;
}

.calendar-grid button.day-slot-available:hover {
  background-color: #43a047;
}

/* Недоступные дни */
.calendar-grid button.day-slot-unavailable {
  background-color: #eee;
  border-color: #ccc;
  color: #999;
  cursor: default;
}

.calendar-grid button.day-slot-unavailable .dt-day-date,
.calendar-grid button.day-slot-unavailable .dt-day-label {
  color: #666;
}

/* ============================================================
   Стили попапа со слотами
   ============================================================ */
#popup-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 15px;
}

.slot-btn {
  flex: 1 0 calc(25% - 10px);
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #4caf50;
  background: #fff;
  color: #4caf50;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.slot-btn.available:hover {
  background: #4caf50;
  color: #fff;
}

.slot-btn.booked {
  background: #ddd;
  border-color: #ccc;
  color: #777;
  cursor: default;
}

/* ============================================================
   Стили форм внутри попапов
   ============================================================ */
.doctor-time-popup input[type="text"],
.doctor-time-popup select {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.doctor-time-popup label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.doctor-time-popup .button {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.doctor-time-popup .button-primary {
  background: #4caf50;
  color: #fff;
}

.doctor-time-popup .button-secondary {
  background: #eee;
  color: #333;
  margin-left: 6px;
}

button.slot-btn.second-shift.available {
    background: #f4fcff;
}