.institution-view,
.subject-view,
.teacher-view,
.status-view {
  display: grid;
  gap: 16px;
  max-height: none;
  min-height: auto;
  overflow: visible;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafb 0%, #f4f7f6 100%);
  animation: viewContentIn 0.18s ease-out;
}

.institution-group,
.subject-group,
.teacher-group,
.status-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.institution-group-head,
.subject-group-head,
.teacher-group-head,
.status-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  background: #fbfcfd;
}

.institution-group-head h3,
.subject-group-head h3,
.teacher-group-head h3,
.status-group-head h3 {
  min-width: 0;
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.institution-metrics,
.subject-metrics,
.teacher-metrics,
.status-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.institution-metrics span,
.institution-subjects span,
.subject-metrics span,
.subject-institutions span,
.teacher-metrics span,
.teacher-subjects span,
.status-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: #f3f6f5;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.institution-metrics strong,
.institution-subjects strong,
.subject-metrics strong,
.subject-institutions strong,
.teacher-metrics strong,
.teacher-subjects strong,
.status-metrics strong {
  color: var(--ink);
  font-size: 14px;
}

.institution-subjects,
.subject-institutions,
.teacher-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 0;
}

.institution-courses,
.subject-courses,
.teacher-courses,
.status-courses {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
}

.institution-course,
.subject-course,
.teacher-course,
.status-course {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 142px) minmax(92px, 124px);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.status-course {
  padding-right: 18px;
}

.institution-course.completed,
.subject-course.completed,
.teacher-course.completed,
.status-course.completed {
  border-left-color: var(--green);
}

.institution-course.cancelled,
.institution-course.missed,
.institution-course.leave,
.subject-course.cancelled,
.subject-course.missed,
.subject-course.leave,
.teacher-course.cancelled,
.teacher-course.missed,
.teacher-course.leave,
.status-course.cancelled,
.status-course.missed,
.status-course.leave {
  border-left-color: var(--amber);
}

.institution-course.conflict,
.subject-course.conflict,
.teacher-course.conflict,
.status-course.conflict {
  border-left-color: var(--red);
}

.status-group.conflict .status-group-head {
  background: #fff5f5;
}

.status-group.scheduled .status-group-head {
  background: #f3f7ff;
}

.institution-course-main,
.subject-course-main,
.teacher-course-main,
.status-course-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.institution-course-main strong,
.institution-course-main span,
.institution-course-main small,
.subject-course-main strong,
.subject-course-main span,
.subject-course-main small,
.teacher-course-main strong,
.teacher-course-main span,
.teacher-course-main small,
.status-course-main strong,
.status-course-main span,
.status-course-main small {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.institution-course-main strong,
.subject-course-main strong,
.teacher-course-main strong,
.status-course-main strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.institution-course-main span,
.institution-course-main small,
.institution-course-side small,
.subject-course-main span,
.subject-course-main small,
.subject-course-side small,
.teacher-course-main span,
.teacher-course-main small,
.teacher-course-side small,
.status-course-main span,
.status-course-main small,
.status-course-side small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.institution-course-side,
.subject-course-side,
.teacher-course-side,
.status-course-side {
  display: grid;
  gap: 4px;
  min-width: 0;
  justify-items: start;
}

.institution-course-side strong,
.subject-course-side strong,
.teacher-course-side strong,
.status-course-side strong {
  min-width: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.institution-actions,
.subject-actions,
.teacher-actions,
.status-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, max-content));
  gap: 8px;
  justify-self: end;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
