.class-management-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 20px; height: 100%; min-height: 0; }
/* Keep fields readable and scroll the form instead of shrinking its rows. */
@media screen and (min-width: 821px) {
  .schedule-form { grid-template-rows: repeat(8, max-content) minmax(64px, 1fr) max-content; overflow: auto; align-content: start; }
  .schedule-form .student-picker-field { min-height: 300px; }
  .schedule-form .student-list { grid-template-columns: repeat(3, minmax(126px, 1fr)); }
}
.student-class-column h3 { white-space: normal; line-height: 1.4; font-size: 13px; overflow-wrap: anywhere; }
.student-option { min-height: 30px; padding: 5px 4px; font-size: 14px; line-height: 1.4; }
.student-option strong.student-name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.student-week-count, .student-statistics-summary { font-size: 12px; }
.disabled-option { opacity: .72; }
.disabled-option .student-name { color: #56616a; }
.assignment-row .row-actions { flex-wrap: wrap; }
.learning-detail-close { color: #ffffff; background: #213c4a; }
.learning-detail-close:hover { color: #ffffff; background: #355767; }
.student-statistics-filters label { font-size: 13px; }
@media screen {
  .timetable { border-collapse: separate; border-spacing: 0; }
  .timetable tr > th:first-child { position: sticky; left: 0; width: 96px; min-width: 96px; z-index: 2; }
  .timetable tr > th:nth-child(2) { position: sticky; left: 96px; width: 64px; min-width: 64px; z-index: 2; }
  .timetable thead th { position: sticky; top: 0; z-index: 3; }
  .timetable thead th:first-child, .timetable thead th:nth-child(2) { z-index: 4; }
}
@media screen and (min-width: 821px) {
  .schedule-presentation-panel { display: flex; align-items: center; gap: 16px; padding: 8px 12px; }
  .schedule-presentation-panel .panel-heading { margin: 0; flex: 0 0 auto; }
  .schedule-presentation-panel .muted, .schedule-presentation-hint { display: none; }
  .schedule-presentation-panel h2 { font-size: 14px; }
  .schedule-presentation-fields { flex: 1; gap: 12px; }
  .schedule-presentation-fields label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
  .schedule-presentation-fields select { min-width: 0; }
}
@media screen and (min-width: 1181px) {
  .schedule-dashboard { min-height: 0; overflow: hidden; }
  .schedule-form .form-actions { position: sticky; bottom: -10px; z-index: 2; background: #ffffff; padding: 8px 0; }
}
@media screen and (min-width: 821px) and (max-width: 1180px) {
  .schedule-dashboard { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; flex: 0 0 auto; }
  .schedule-form { grid-row: auto; min-height: 620px; }
  .day-list-panel { min-height: 280px; max-height: 460px; }
  .schedule-timetable { min-height: 350px; height: 520px; }
}
.class-directory, .class-members { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.class-directory { border-right: 1px solid #d5e0e5; padding-right: 18px; }
.class-directory form { display: grid; gap: 10px; }
.class-directory-heading, .class-members-toolbar, .class-directory-row > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.class-directory-heading h2, .class-members-toolbar h2, .class-directory h2 { margin: 0; font-size: 16px; }
.class-directory-list { flex: 1; min-height: 0; overflow: auto; }
.class-directory-row { padding: 12px 0; border-top: 1px solid #d5e0e5; display: grid; gap: 8px; overflow-wrap: anywhere; }
.class-directory-row .row-actions { justify-content: flex-start; }
.class-member-filters { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 2fr); gap: 12px; }
.class-students-scroll { flex: 1; min-height: 180px; overflow: auto; scrollbar-gutter: stable; border: 1px solid #d5e0e5; }
.class-students-table { width: 100%; border-collapse: collapse; }
.class-students-table th, .class-students-table td { text-align: left; padding: 10px 12px; font-size: 14px; border-bottom: 1px solid #e1e7eb; overflow-wrap: anywhere; }
.class-students-table th { position: sticky; top: 0; z-index: 1; background: #edf3f5; }
.class-students-table th:first-child { width: 42px; }
.class-students-table input { width: 18px; height: 18px; }
.class-assignment-bar { display: flex; align-items: end; gap: 12px; border-top: 1px solid #d5e0e5; padding-top: 12px; }
.class-assignment-bar label { flex: 1; margin: 0; }
.class-assignment-bar button { flex: 0 0 auto; min-height: 36px; }
.class-members-toolbar { flex-wrap: wrap; }
.class-members-toolbar > span { margin-left: auto; }
@media screen and (max-width: 820px) {
  .class-management-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .class-directory { border-right: 0; border-bottom: 1px solid #d5e0e5; padding: 0 0 12px; }
  .class-directory-list { max-height: 240px; flex: none; }
  .class-students-scroll { max-height: 440px; flex: none; }
  .class-member-filters { grid-template-columns: minmax(0, 1fr); }
  .class-students-table td, .class-students-table th { padding: 10px 6px; }
  .class-management-layout input:not([type=checkbox]), .class-management-layout select { min-height: 44px; font-size: 16px; }
  .class-management-layout button { min-height: 44px; }
}
