/* Сброс стилей и базовые настройки */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.conversion-rate.rate-green {
    color: green;
    background: #d4edda;  
    padding: 2px 6px;
    border-radius: 4px;
}

.conversion-rate.rate-yellow {
    color: orange;
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
}

.conversion-rate.rate-red {
    color: red;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 4px;
}

.no-teachers {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #0ea5e9;
  --background: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Контейнер */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Хедер */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* Основной контент */
.main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* Футер */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 4rem;
}

/* Лейаут расписания */
.schedule-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  margin-top: 2rem;
}

/* Секция календаря */
.calendar-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.calendar-header h2 {
  flex: 1;
  font-size: 1.5rem;
}

/* Новые стили для календаря с временем внутри дней */
.calendar-grid-new {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.day-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.day-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  text-align: center;
}

.day-name {
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.day-date {
  font-size: 0.75rem;
  opacity: 0.9;
}

.time-slots-container {
  padding: 0.5rem;
  max-height: 600px;
  overflow-y: auto;
}

.time-slot {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  position: relative;
}

.time-slot:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.time-slot.selected {
  background: #dbeafe;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.time-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.slot-status {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.slot-status.available {
  background: #d1fae5;
  color: #065f46;
}

.time-slot .booking-indicator {
  display: block;
  margin-top: 0.25rem;
}

/* Скроллбар для временных слотов */
.time-slots-container::-webkit-scrollbar {
  width: 6px;
}

.time-slots-container::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 3px;
}

.time-slots-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.time-slots-container::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Боковая панель */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filters-card,
.teachers-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.filters-card h3,
.teachers-card h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

/* Фильтры по предметам */
.subject-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.subject-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.subject-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.subject-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Поиск */
.search-box {
  margin-top: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Список преподавателей */
.teachers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 600px;
  overflow-y: auto;
  padding: 20px;
}

.teacher-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.teacher-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.teacher-info {
  margin-bottom: 0.75rem;
}

.teacher-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.conversion-rate {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--success-color);
  background: #d1fae5;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.teacher-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.teacher-contact {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.teacher-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Кнопки */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-icon,
.btn-info,
.btn-success {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
}

.btn-icon:hover {
  background: var(--background);
}

.btn-info {
  background: var(--info-color);
  color: white;
}

.btn-info:hover {
  background: #0284c7;
}

/* Модальные окна */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Формы */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Профиль преподавателя */
.profile-info {
  padding: 1rem;
}

.profile-info h3 {
  margin-bottom: 1rem;
}

.profile-field {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--background);
  border-radius: 6px;
}

/* Личный кабинет менеджера */
.manager-header {
  margin-bottom: 2rem;
}

.manager-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Вкладки */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Таблица */
.table-container {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--background);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.data-table tr:hover {
  background: var(--background);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.status-confirmed {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 0.25rem;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

/* Карточки преподавателей */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.teacher-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.teacher-card h3 {
  margin-bottom: 1rem;
}

.teacher-details {
  margin-bottom: 1rem;
}

.teacher-details p {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

/* Статистика */
.stats-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.stat-section {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.stat-section h3 {
  margin-bottom: 1rem;
}

.chart-placeholder {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border-radius: 8px;
  color: var(--text-secondary);
}

/* Страница входа */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.login-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.btn-full {
  width: 100%;
}



.alert {
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Добавлены стили для классического календаря */
.calendar-month-grid {
  margin-top: 1.5rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.weekday-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  background: var(--background);
  border-radius: 6px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.calendar-day:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
  transform: scale(1.05);
}

.calendar-day.selected {
  background: #dbeafe;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calendar-day.empty {
  border: none;
  cursor: default;
  background: transparent;
}

.calendar-day.empty:hover {
  transform: none;
}

.day-number {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.day-indicator {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: var(--primary-color);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Стили для панели временных слотов */
.day-slots-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--background);
  border-radius: 8px;
  border: 2px solid var(--primary-color);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-header h3 {
  font-size: 1.125rem;
  color: var(--primary-color);
}

.day-slots-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.time-slot-item {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  text-align: center;
}

.time-slot-item.available:hover {
  border-color: var(--success-color);
  background: #d1fae5;
}

.time-slot-item.available.selected {
  background: #d1fae5;
  border: 2px solid var(--success-color);
}

.time-slot-item.occupied {
  background: #fee2e2;
  border-color: #fecaca;
  cursor: not-allowed;
  opacity: 0.7;
}

.time-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.slot-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.slot-badge.available {
  background: #d1fae5;
  color: #065f46;
}

.slot-badge.occupied {
  background: #fee2e2;
  color: #991b1b;
}

/* Адаптивность для календаря */
@media (max-width: 1024px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .calendar-days {
    gap: 0.25rem;
  }

  .calendar-day {
    padding: 0.25rem;
  }

  .day-number {
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .day-slots-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Календарь с временными слотами в ячейках */
.calendar-days-with-slots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

.calendar-day-cell {
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.calendar-day-cell.empty {
  border: none;
  background: transparent;
}

.calendar-day-cell .day-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.75rem;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 2px solid var(--border);
}

.calendar-day-cell .time-slots-container {
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
  max-height: 400px;
}

.calendar-day-cell .time-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}

.calendar-day-cell .time-slot.available:hover {
  border-color: var(--success-color);
  background: #f0fdf4;
  transform: translateX(2px);
}

.calendar-day-cell .time-slot.available.selected {
  background: #d1fae5;
  border: 2px solid var(--success-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.calendar-day-cell .time-slot.occupied {
  background: #fef2f2;
  border-color: #fecaca;
  cursor: not-allowed;
  opacity: 0.7;
}

.calendar-day-cell .time-slot.occupied:hover {
  transform: none;
}

.time-text {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.slot-indicator {
  font-size: 1rem;
  font-weight: bold;
}

.slot-indicator.available {
  color: var(--success-color);
}

.slot-indicator.occupied {
  color: var(--danger-color);
}

/* Скроллбар для временных слотов в ячейках */
.calendar-day-cell .time-slots-container::-webkit-scrollbar {
  width: 4px;
}

.calendar-day-cell .time-slots-container::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 2px;
}

.calendar-day-cell .time-slots-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.calendar-day-cell .time-slots-container::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Адаптивность для нового календаря */
@media (max-width: 1200px) {
  .calendar-days-with-slots {
    gap: 0.5rem;
  }

  .calendar-day-cell {
    min-height: 180px;
  }

  .calendar-day-cell .day-number {
    font-size: 1rem;
    padding: 0.5rem;
  }

  .calendar-day-cell .time-slot {
    padding: 0.4rem 0.6rem;
  }

  .time-text {
    font-size: 0.75rem;
  }
}

@media (max-width: 1024px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .calendar-days-with-slots {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .calendar-days-with-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-day-cell {
    min-height: 150px;
  }
}

@media (max-width: 480px) {
  .calendar-days-with-slots {
    grid-template-columns: 1fr;
  }
}

/* Недельный календарь */
.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.calendar-day-column {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Убрана фиксированная высота для показа всех слотов */
}

.day-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  text-align: center;
  border-bottom: 2px solid var(--border);
}

.day-name {
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.day-date {
  font-size: 0.875rem;
  opacity: 0.95;
  font-weight: 500;
}

.time-slots-list {
  padding: 0.5rem;
  /* Убрана прокрутка и ограничение высоты - все слоты показываются полностью */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Временные слоты без индикаторов */
.time-slot {
  /* Уменьшен padding для компактности */
  padding: 0.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  text-align: center;
}

/* Подсветка свободного времени преподавателя */
.time-slot.teacher-available {
  background: #d1fae5;
  border-color: var(--success-color);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

.time-slot.teacher-available:hover {
  background: #a7f3d0;
  border-color: #059669;
  transform: translateY(-2px);
}

.time-text {
  font-weight: 600;
  /* Уменьшен размер шрифта для компактности */
  font-size: 0.8rem;
  color: var(--text-primary);
  display: block;
}

/* Адаптивность для недельного календаря */
@media (max-width: 1400px) {
  .calendar-week-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Уменьшен padding для компактности на меньших экранах */
  .time-slot {
    padding: 0.4rem;
  }
}

@media (max-width: 1024px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .calendar-week-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .calendar-week-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .time-slot {
    padding: 0.4rem;
  }

  .time-text {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .calendar-week-grid {
    grid-template-columns: 1fr;
  }
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.radio-label input:checked + .radio-custom {
    border-color: var(--primary-color);
}

.radio-label input:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.time-slot.occupied small {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

input[type="radio"] {
    display: none;
}

.subject-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
}

.subject-sposop-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: #e5e3e3;
    color: #ff3b00;
    border-radius: 4px;
    font-weight: bold;
}

.suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 200px;           /* ← Максимальная высота */
    overflow-y: auto;            /* ← Прокрутка при переполнении */
    max-width: 500px;
    background: white;
    border: 1px solid #ccc;
    z-index: 1000;
    width: 100%;
}
.suggestions-list li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.suggestions-list li:hover {
    background-color: #f0f0f0;
}
.suggestions-list li:last-child {
    border-bottom: none;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}