@layer grades-directory {
  .studentAdminStudentCell code, .studentNameMain small { display:none !important; }
  .studentAdminStudentCell strong, .studentNameMain strong { font-size:16px !important; font-weight:500 !important; line-height:1.4 !important; }
  .studentDirectoryTable :is(th,td) { padding:8px 10px !important; height:auto !important; }
  .studentAdminActions { gap:4px !important; justify-content:center !important; }
  .studentAdminActions > button { width:36px !important; height:36px !important; min-height:36px !important; padding:6px !important; }
  #workspace[data-view="students"] .studentAdminWrap { max-height:var(--ui-table-max-height,none) !important; min-height:0 !important; height:auto !important; }
  .studentAdminPager { position:relative !important; flex-shrink:0 !important; min-height:48px !important; padding:6px 10px !important; flex-wrap:wrap !important; }
  .studentAdminPager :is(button,select) { min-height:36px !important; height:36px !important; padding:4px 8px !important; }
  .studentGradeCharts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .studentGradeChart { min-width:0; margin:0; padding:12px; border:1px solid var(--border,#dbe4ed); border-radius:12px; }
  .studentGradeChart figcaption { font-weight:500; margin-bottom:10px; }
  .studentGradeBars { display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; }
  .studentGradeBar { flex:1 0 28px; text-align:center; font-size:12px; }
  .studentGradeBarTrack { height:120px; display:flex; align-items:flex-end; justify-content:center; border-bottom:1px solid var(--border,#dbe4ed); }
  .studentGradeBarTrack i { display:block; width:20px; background:var(--primary,#008b8b); border-radius:4px 4px 0 0; }
  [data-grade-average][data-score-band="good"], .studentGradeBarTrack i[data-score-band="good"] { background:#d9ead3 !important; color:#166534 !important; }
  [data-grade-average][data-score-band="average"], .studentGradeBarTrack i[data-score-band="average"] { background:#ffe599 !important; color:#854d0e !important; }
  [data-grade-average][data-score-band="low"], .studentGradeBarTrack i[data-score-band="low"] { background:#ea9999 !important; color:#7f1d1d !important; }
  @media(min-width:921px) {
    .studentDirectoryTable { table-layout:fixed !important; width:100% !important; min-width:0 !important; }
    .studentDirectoryTable :is(th,td):nth-child(1) { width:25% !important; }
    .studentDirectoryTable :is(th,td):nth-child(2) { width:8% !important; }
    .studentDirectoryTable :is(th,td):nth-child(3) { width:20% !important; }
    .studentDirectoryTable :is(th,td):nth-child(4) { width:20% !important; }
    .studentDirectoryTable :is(th,td):nth-child(5) { width:12% !important; }
    .studentDirectoryTable :is(th,td):nth-child(6) { width:6% !important; }
    .studentDirectoryTable :is(th,td):nth-child(7) { width:9% !important; }
  }
  @media(max-width:920px) {
    .studentDirectoryTable { display:block !important; width:100% !important; min-width:0 !important; }
    .studentAdminStudentCell { min-width:0 !important; }
    .studentAdminStudentCell strong { white-space:normal !important; overflow-wrap:anywhere !important; }
    .studentDirectoryTable tr[data-code] { width:100% !important; box-sizing:border-box !important; padding:10px !important; gap:6px 8px !important; grid-template-columns:minmax(0,1fr) auto !important; }
    .studentDirectoryTable tr[data-code] > td { padding:0 !important; min-height:0 !important; }
    .studentDirectoryTable tbody { min-width:0 !important; width:100% !important; }
    .studentGradeCharts { grid-template-columns:minmax(0,1fr); }
    .studentAdminActions > button { width:44px !important; height:44px !important; min-height:44px !important; }
    #attendanceRows [data-grade-average],#attendanceRows [data-grade-rank] { display:none !important; }
  }
}
