/* Дашборд преподавателей — glass, bento-grid, без градиентов */

.screen--teachers-dashboard {
  --td-glass: rgba(26, 29, 36, 0.72);
  --td-glass-border: rgba(148, 163, 184, 0.14);
  --td-radius: 18px;
  --td-radius-sm: 14px;
  position: relative;
  width: 100%;
}

[data-color-scheme="light"] .screen--teachers-dashboard {
  --td-glass: rgba(255, 255, 255, 0.82);
  --td-glass-border: rgba(11, 15, 25, 0.1);
}

[data-color-scheme="light"] .screen--teachers-dashboard .card {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.08);
}

.screen--teachers-dashboard .teachers-dashboard {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 32px;
  box-sizing: border-box;
}

.screen--teachers-dashboard .teachers-dashboard,
.screen--teachers-dashboard .teachers-dashboard * {
  box-sizing: border-box;
}

/* ——— Glass-панели ——— */
.screen--teachers-dashboard .card {
  border-radius: var(--td-radius);
  border: 1px solid var(--td-glass-border);
  background: var(--td-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.screen--teachers-dashboard .card:hover {
  transform: none;
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 48px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(59, 130, 246, 0.08);
}

/* Шапка */
.screen--teachers-dashboard .teachers-page-header.zoom-header {
  position: static !important;
  top: auto !important;
  margin: 0;
}

.screen--teachers-dashboard .teachers-page-header.card {
  overflow: visible;
  background: var(--td-glass);
}

.screen--teachers-dashboard .teachers-page-header__content {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 20px;
}

.screen--teachers-dashboard .teachers-page-header__back {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.screen--teachers-dashboard .teachers-page-header__back svg {
  margin-right: 0 !important;
}

.screen--teachers-dashboard .teachers-page-header .zoom-header__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-align: left;
  color: var(--color-text);
}

/* Выбор преподавателя — выпадающий список (не на всю ширину экрана) */
.teacher-select {
  width: min(100%, 22rem);
  max-width: 100%;
}

.teacher-select__label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.teacher-select__dropdown {
  width: 100%;
}

.screen--teachers-dashboard .teacher-select .searchable-dropdown {
  width: 100%;
  max-width: 22rem;
}

.teacher-select__empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-text-secondary);
  border-radius: var(--td-radius-sm);
  border: 1px solid var(--td-glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.screen--teachers-dashboard .teacher-select .searchable-dropdown__trigger {
  min-height: 42px;
  padding: 10px 34px 10px 14px;
  border: 1px solid var(--td-glass-border);
  border-radius: var(--td-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-color-scheme="light"] .screen--teachers-dashboard .teacher-select .searchable-dropdown__trigger {
  background: #ffffff;
}

.screen--teachers-dashboard .teacher-select .searchable-dropdown.open .searchable-dropdown__trigger {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: none;
}

.screen--teachers-dashboard .teacher-select .searchable-dropdown__panel {
  border: 1px solid var(--td-glass-border);
  border-radius: var(--td-radius-sm);
  background: var(--td-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-color-scheme="light"] .screen--teachers-dashboard .teacher-select .searchable-dropdown__panel {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Контент: bento */
.screen--teachers-dashboard .teachers-dashboard__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.screen--teachers-dashboard .teachers-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.screen--teachers-dashboard .teachers-stats .stats__card.teachers-kpi-card {
  border-radius: var(--td-radius-sm);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.teachers-kpi-card__body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 160px;
  padding: 14px 16px 12px !important;
  gap: 0;
}

.teachers-kpi-card__head {
  flex-shrink: 0;
  text-align: left;
}

.teachers-kpi-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.teachers-kpi-card__label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.teachers-kpi-card__icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  margin: 10px 0;
  border-radius: 14px;
  border: 1px solid var(--td-glass-border);
  background: rgba(59, 130, 246, 0.06);
  color: var(--color-primary);
}

.teachers-kpi-card__icon svg {
  width: clamp(36px, 45%, 56px);
  height: clamp(36px, 45%, 56px);
  stroke-width: 1.75;
}

.teachers-kpi-card--lessons .teachers-kpi-card__icon {
  background: rgba(16, 185, 129, 0.08);
  color: var(--color-success);
}

.teachers-kpi-card--min .teachers-kpi-card__icon {
  background: rgba(245, 158, 11, 0.08);
  color: var(--color-warning);
}

.teachers-kpi-card__scale {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teachers-kpi-card__meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
  border: 1px solid var(--td-glass-border);
}

.teachers-kpi-card__meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary);
  transition: width 0.45s ease;
}

.teachers-kpi-card--lessons .teachers-kpi-card__meter-fill {
  background: var(--color-success);
}

.teachers-kpi-card--min .teachers-kpi-card__meter-fill {
  background: var(--color-warning);
}

.teachers-kpi-card__ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  opacity: 0.75;
}

.teachers-kpi-card__hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text-secondary);
}

/* Графики */
.teachers-gauges-card .card__body {
  padding: 16px 18px;
}

.teachers-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.teachers-gauge-slot {
  border-radius: var(--td-radius-sm);
  border: 1px solid var(--td-glass-border);
  padding: 10px 8px 6px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.02);
}

.teachers-gauge-slot:first-child {
  background: rgba(59, 130, 246, 0.06);
}

.teachers-gauge-slot:last-child {
  background: rgba(16, 185, 129, 0.06);
}

.teachers-gauge-wrap {
  position: relative;
  height: 100px;
  max-height: 100px;
  overflow: hidden;
}

.teachers-gauge-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100px !important;
  max-height: 100px;
}

.teachers-gauge__center {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  text-align: center;
  pointer-events: none;
}

.teachers-gauge__number {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text);
  line-height: 1.15;
}

.teachers-gauge__sub {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.teachers-gauge__caption {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Лекции */
.teachers-lectures-card .card__body {
  padding: 18px 20px 22px;
}

.teachers-lectures-card .rag-section__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.screen--teachers-dashboard .teachers-lectures-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  width: 100%;
}

.screen--teachers-dashboard .teachers-lectures-list .rag-item {
  border-radius: var(--td-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--td-glass-border);
  padding: 18px;
  box-shadow: none;
}

.screen--teachers-dashboard .teachers-lectures-list .rag-item::before,
.screen--teachers-dashboard .teachers-lectures-list .rag-item:hover::before {
  display: none;
}

.screen--teachers-dashboard .teachers-lectures-list .rag-item:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
}

.teachers-lecture__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.teachers-lecture__head .rag-item__title {
  margin-bottom: 0;
  flex: 1;
  font-size: 15px;
}

.teachers-lecture__score-badge {
  flex-shrink: 0;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 8px;
  padding: 4px 10px;
}

.teachers-lecture-item .rag-item__meta {
  margin-bottom: 10px;
}

.teachers-lecture-item .rag-item__content {
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--td-glass-border);
  padding: 14px;
  max-height: 200px;
}

[data-color-scheme="light"] .teachers-lecture-item .rag-item__content {
  background: rgba(11, 15, 25, 0.03);
}

.teachers-lecture-item .rag-item__content.teachers-lecture__summary--collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.teachers-lecture-item .rag-item__content.teachers-lecture__summary--empty {
  font-style: italic;
  color: var(--color-text-secondary);
}

.teachers-lecture-item .rag-item__toggle-summary {
  margin-bottom: 10px;
  border-radius: 999px;
}

.teachers-lecture-item .rag-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--td-glass-border);
}

.teachers-lecture-item .rag-item__actions .btn {
  width: auto;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.teachers-lecture-item .rag-item__actions .btn--primary {
  margin-left: auto;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.teachers-dashboard__loading,
.teachers-dashboard__empty {
  text-align: center;
  padding: 24px;
  color: var(--color-text-secondary);
}

/* Отступ main */
.main:has(#teachersDashboardScreen.active) {
  padding-top: 12px;
}

/* Модалки */
.teachers-lecture-modal__content {
  max-width: 640px;
  width: 92%;
}

.teachers-lecture-modal__text {
  margin: 0;
  padding: 16px;
  border-radius: var(--td-radius-sm);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow-y: auto;
}

.teachers-lecture-modal__loader {
  text-align: center;
  padding: 24px;
  color: var(--color-text-secondary);
}

.teachers-materials-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.teachers-materials-modal__item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--td-radius-sm);
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-secondary);
}

.teachers-materials-modal__info {
  flex: 1;
  min-width: 0;
}

.teachers-materials-modal__name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.teachers-materials-modal__action {
  flex-shrink: 0;
  align-self: center;
}

.teachers-materials-modal__action .btn {
  white-space: nowrap;
}

.teachers-materials-modal__type {
  margin-left: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.teachers-materials-modal__links {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-light);
}

.teachers-materials-modal__links a {
  color: var(--color-primary);
  font-size: 14px;
}

.teachers-materials-modal__no-link {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ——— Desktop bento ——— */
@media (min-width: 901px) {
  .main:has(#teachersDashboardScreen.active) {
    padding-top: 0;
    padding-left: 20px;
    padding-right: 20px;
    width: 100%;
    max-width: none;
  }

  .screen--teachers-dashboard .teachers-dashboard {
    gap: 18px;
  }

  .screen--teachers-dashboard .teachers-page-header__content {
    padding: 16px 24px;
    justify-content: space-between;
  }

  .screen--teachers-dashboard .teachers-page-header .zoom-header__title {
    flex: 0 1 auto;
    text-align: right;
    font-size: 22px;
  }

  .screen--teachers-dashboard .teachers-lectures-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1100px) {
  .screen--teachers-dashboard .teachers-dashboard__content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    align-items: stretch;
  }

  .screen--teachers-dashboard .teachers-stats {
    grid-column: 1 / 9;
    grid-row: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .screen--teachers-dashboard .teachers-gauges-card {
    grid-column: 9 / 13;
    grid-row: 1;
    display: flex;
    flex-direction: column;
  }

  .screen--teachers-dashboard .teachers-gauges-card .card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .screen--teachers-dashboard .teachers-gauges {
    grid-template-columns: 1fr;
    gap: 10px;
    height: 100%;
  }

  .screen--teachers-dashboard .teachers-lectures-card {
    grid-column: 1 / 13;
    grid-row: 2;
  }

  .screen--teachers-dashboard .teachers-lectures-list {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

@media (min-width: 1400px) {
  .screen--teachers-dashboard .teachers-lectures-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ——— Mobile ——— */
@media (max-width: 900px) {
  .screen--teachers-dashboard .teachers-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .screen--teachers-dashboard .teachers-dashboard {
    gap: 12px;
    padding-bottom: 20px;
  }

  .teachers-gauge-wrap,
  .teachers-gauge-wrap canvas {
    height: 84px !important;
    max-height: 84px !important;
  }

  .screen--teachers-dashboard .teachers-lectures-list {
    grid-template-columns: 1fr;
  }

  .teachers-lecture-item .rag-item__actions .btn--primary {
    margin-left: 0;
    width: 100%;
  }

  .teachers-lecture-item .rag-item__actions .btn--secondary {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .screen--teachers-dashboard .teachers-page-header__back-label {
    display: none;
  }

  .screen--teachers-dashboard .teachers-page-header__back {
    min-width: 36px;
    padding: 6px 10px;
    justify-content: center;
  }

  .screen--teachers-dashboard .teachers-page-header__content {
    padding: 12px 14px;
  }

  .teachers-lecture__head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Вкладки */
.teachers-dashboard-tabs {
  margin-bottom: 4px;
}

.teachers-tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.teachers-tab-panel.active {
  display: flex;
}

.teachers-company__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.teachers-company-intro__label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.teachers-company-intro__name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.teachers-company-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .teachers-company-highlights {
    grid-template-columns: 1fr;
  }
}

.teachers-company-highlight .card__body {
  padding: 12px 14px;
}

.teachers-company-highlight__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.teachers-company-highlight--best {
  border-left: 3px solid rgba(16, 185, 129, 0.65);
}

.teachers-company-highlight--worst {
  border-left: 3px solid rgba(245, 158, 11, 0.75);
}

.teachers-company-highlight__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.teachers-company-highlight__badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teachers-company-highlight__score {
  flex-shrink: 0;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
  color: var(--color-text);
}

.teachers-company-highlight__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.teachers-company-highlight__teacher {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teachers-company-highlight__lecture {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teachers-company-highlight__date {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.teachers-company-highlight__empty {
  margin: 4px 0 0;
  font-size: 13px;
}

.teachers-company-criteria-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 16px;
  margin-top: 14px;
  width: 100%;
}

@media (min-width: 700px) {
  .teachers-company-criteria-gauges {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

.teachers-company-criterion-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 14px 10px 10px;
  border-radius: var(--td-radius-sm);
  border: 1px solid var(--td-glass-border);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.teachers-company-criterion-gauge__label {
  margin: 0 0 6px;
  width: 100%;
  min-height: 2.8em;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.teachers-company-criterion-gauge__slot {
  width: 100%;
  padding: 4px 6px 2px;
}

.teachers-company-criterion-gauge__wrap {
  height: 92px;
  max-height: 92px;
}

.teachers-company-criterion-gauge__wrap canvas {
  height: 92px !important;
  max-height: 92px !important;
}

.teachers-company-criterion-gauge .teachers-gauge__caption {
  display: none;
}

.teachers-company-criterion-gauge .teachers-gauge__number {
  font-size: 1.15rem;
}

.teachers-kpi-card--staff .teachers-kpi-card__icon {
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
}

@media (min-width: 1100px) {
  .teachers-company__content .teachers-company-stats {
    grid-column: auto;
  }
}
