/* Chi tiết yêu cầu chờ duyệt — theo ảnh duyệt 30/10/2026.
   Scoped riêng, tái sử dụng token và khung giảng viên từ teacher-layout.css. */
.teacher-request-detail-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-min-height);
  max-width: 100%;
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid #93c5fd;
  border-radius: var(--control-radius);
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.teacher-request-detail-page .back-link:hover {
  background: var(--color-primary-tint);
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
}

.teacher-request-detail-page .back-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.teacher-request-detail-page .page-header {
  display: block;
}

.teacher-request-detail-page .request-detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.teacher-request-detail-page .status-badge--pending {
  display: inline-flex;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-warning-bg);
  color: var(--color-warning-fg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.teacher-request-detail-page .request-detail {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
}

.teacher-request-detail-page .request-detail > section {
  min-width: 0;
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  background: var(--color-surface);
}

.teacher-request-detail-page .request-detail h2 {
  margin-bottom: var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: 1.4;
  color: var(--color-heading);
}

.teacher-request-detail-page .request-detail :is(p, dd) {
  line-height: 1.65;
  color: var(--color-muted-foreground);
  overflow-wrap: anywhere;
}

.teacher-request-detail-page .request-detail dt {
  color: var(--color-heading);
  font-weight: var(--weight-semibold);
}

.teacher-request-detail-page .request-topic {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-6);
}

.teacher-request-detail-page .request-topic__image {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: var(--control-radius);
  background: var(--media-placeholder-bg);
  color: var(--media-placeholder-icon);
}

.teacher-request-detail-page .request-topic__image svg {
  width: 4.5rem;
  height: 4.5rem;
}

.teacher-request-detail-page .request-topic__content {
  min-width: 0;
}

.teacher-request-detail-page .request-topic h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-6);
}

.teacher-request-detail-page .request-topic__meta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: var(--space-3) var(--space-6);
}

.teacher-request-detail-page .request-topic__meta > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-3);
}

.teacher-request-detail-page .request-topic__meta > div:nth-child(n + 3) {
  grid-template-columns: 6rem minmax(0, 1fr);
}

.teacher-request-detail-page .request-student__content {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-6);
}

.teacher-request-detail-page .request-student__avatar {
  display: grid;
  place-items: center;
  width: 6rem;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background: var(--color-info-bg);
  color: var(--color-primary);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
}

.teacher-request-detail-page .request-student__meta {
  display: grid;
  gap: var(--space-3);
}

.teacher-request-detail-page .request-student__meta > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-4);
}

.teacher-request-detail-page .request-attachments {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.teacher-request-detail-page .request-attachments h2 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.teacher-request-detail-page .request-attachments__file {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.teacher-request-detail-page .request-attachments__file svg {
  width: 2rem;
  height: 2.5rem;
  flex-shrink: 0;
  color: var(--color-primary);
}

.teacher-request-detail-page :is(.request-action, .request-attachments__download) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-min-height);
  padding: 0.625rem var(--space-4);
  border: 1px solid var(--button-secondary-border);
  border-radius: var(--control-radius);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-fg);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  text-align: center;
}

.teacher-request-detail-page :is(.request-action, .request-attachments__download) svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.teacher-request-detail-page .request-detail__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
}

.teacher-request-detail-page .request-action--reject {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.teacher-request-detail-page .request-action--reject:hover {
  background: var(--color-danger-bg);
}

.teacher-request-detail-page .request-action--approve {
  border-color: var(--button-primary-bg);
  background: var(--button-primary-bg);
  color: var(--button-primary-fg);
}

.teacher-request-detail-page .request-action--approve:hover {
  border-color: var(--button-primary-bg-hover);
  background: var(--button-primary-bg-hover);
}

.teacher-request-detail-page .request-attachments__download:disabled {
  background: var(--color-disabled-bg);
  color: var(--color-disabled-fg);
  border-color: var(--color-disabled-border);
  cursor: not-allowed;
}

/* Dialog dùng chung teacher-dialogs.css với mục Bài nộp.
   Chỉ giữ giới hạn form, thông báo lỗi HTML và chiều cao ô lý do riêng. */
.teacher-request-detail-page .request-proposal-dialog .topic-dialog__form {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
}

.teacher-request-detail-page .request-proposal-dialog .topic-dialog__form > * {
  min-width: 0;
}

.teacher-request-detail-page #rejection-reason {
  min-height: 7.5rem;
  resize: vertical;
}

.teacher-request-detail-page #rejection-reason:user-invalid {
  border-color: var(--color-danger);
}

.teacher-request-detail-page .rejection-reason-error {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-danger-fg);
}

.teacher-request-detail-page #rejection-reason[aria-invalid="true"] {
  border-color: var(--color-danger-fg);
}

.teacher-request-detail-page :is(.proposal-demo-note, .proposal-feedback) {
  margin-bottom: var(--space-4);
  overflow-wrap: anywhere;
  color: var(--color-muted-foreground);
}

.teacher-request-detail-page .proposal-feedback:empty {
  display: none;
}

.teacher-request-detail-page .proposal-form-error {
  color: var(--color-danger-fg);
  overflow-wrap: anywhere;
}

.teacher-request-detail-page .status-badge[data-status="approved"] {
  background: var(--color-success-bg);
  color: var(--color-success-fg);
}

.teacher-request-detail-page .status-badge[data-status="rejected"] {
  background: var(--color-danger-bg);
  color: var(--color-danger-fg);
}

@media (max-width: 47.99875rem) {
  .teacher-request-detail-page .request-proposal-dialog .topic-dialog__header {
    padding-inline: var(--space-4);
  }

  .teacher-request-detail-page .request-proposal-dialog .topic-dialog__form {
    padding: var(--space-4);
  }
}

@media (max-width: 74.99rem) {
  .teacher-request-detail-page .request-topic__meta {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-flow: row;
  }

  .teacher-request-detail-page .request-topic__meta > div:nth-child(n) {
    grid-template-columns: 7rem minmax(0, 1fr);
  }
}

@media (max-width: 47.99rem) {
  .teacher-request-detail-page .request-detail {
    gap: var(--space-4);
  }

  .teacher-request-detail-page .request-detail > section {
    padding: var(--space-4);
  }

  .teacher-request-detail-page :is(.request-topic, .request-student__content) {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .teacher-request-detail-page .request-topic h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
  }

  .teacher-request-detail-page .request-detail__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 29.99rem) {
  .teacher-request-detail-page .request-topic__meta > div:nth-child(n),
  .teacher-request-detail-page .request-student__meta > div,
  .teacher-request-detail-page .request-attachments,
  .teacher-request-detail-page .request-detail__actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .teacher-request-detail-page .request-topic__meta > div:nth-child(n),
  .teacher-request-detail-page .request-student__meta > div {
    gap: var(--space-1);
  }
}
