/* Directory-only overrides, including the existing grades-directory layer. */
@layer grades-directory {
  html body #workspace[data-view="students"] #studentDirectoryPane .studentDirectoryToolbar > .studentDirectoryBar { justify-content:flex-start !important; }
  html body #workspace[data-view="students"] #studentDirectoryPane .studentDirectoryFilterPanel .studentAdminFilter { width:100% !important; max-width:none !important; min-width:0 !important; }
  html body #studentDialog.studentProfileDialog select { appearance:none !important; -webkit-appearance:none !important; padding-right:36px !important; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2352637a' stroke-width='1.6' d='m4 6 4 4 4-4'/%3E%3C/svg%3E") !important; background-repeat:no-repeat !important; background-position:right 12px center !important; background-size:16px !important; }
  html body #workspace[data-view="students"] :is(.studentSubjectTags span,.studentStatusBadges span,.studentDiscountBadge,.studentKpi) { background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; }
  html body #workspace[data-view="students"] .studentDirectoryTable :is(th,td) { width:auto !important; display:table-cell !important; position:static !important; grid-column:auto !important; grid-row:auto !important; }
  html body #workspace[data-view="students"] .studentDirectoryTable { display:table !important; table-layout:auto !important; width:100% !important; min-width:1080px !important; }
  html body #workspace[data-view="students"] .studentDirectoryTable thead { display:table-header-group !important; }
  html body #workspace[data-view="students"] .studentDirectoryTable tbody { display:table-row-group !important; }
  html body #workspace[data-view="students"] .studentDirectoryTable tr { display:table-row !important; }
  html body #workspace[data-view="students"] .studentDirectoryTable td::before { display:none !important; }
}
html body #workspace[data-view="students"] .studentDirectoryToolbar > .studentDirectoryBar { display:flex; align-items:center; justify-content:flex-start !important; gap:10px; width:100%; min-width:0; }
html body #workspace[data-view="students"] .studentDirectoryKpis { flex:0 0 auto; margin:0 !important; gap:10px !important; }
html body #workspace[data-view="students"] .studentKpi { border:0 !important; padding:0 !important; border-radius:0 !important; background:transparent !important; }
html body #workspace[data-view="students"] .studentKpi strong { font-size:18px !important; }
html body #workspace[data-view="students"] .studentDirectoryBar .studentAdminSearch { flex:1 1 220px !important; width:auto !important; max-width:none !important; }
html body #workspace[data-view="students"] .studentDirectoryFilters { flex:0 0 auto; position:relative; }
html body #workspace[data-view="students"] .studentDirectoryFilters > summary { cursor:pointer; min-height:44px; display:flex; align-items:center; gap:6px; padding:6px 10px; color:var(--accent,#087f76); font-weight:600; }
html body #workspace[data-view="students"] .studentDirectoryFilterPanel { position:absolute; z-index:30; right:0; top:100%; width:min(480px,calc(100vw - 48px)); padding:14px; border:1px solid var(--border,#dbe4ed); border-radius:10px; background:var(--surface,#fff); box-shadow:0 8px 22px #0002; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
html body #workspace[data-view="students"] #studentDirectoryPane .studentDirectoryFilterPanel .studentAdminFilter { display:grid !important; width:100% !important; max-width:none !important; min-width:0; gap:5px; }
html body #workspace[data-view="students"] .studentDirectoryFilterPanel #btnClearStudentFilters { grid-column:1 / -1; justify-self:end; min-height:44px; }
html body #workspace[data-view="students"] .studentDirectoryFilterPanel .studentAdminFilter > span { display:block !important; }
html body #workspace[data-view="students"] .studentDirectoryFilterPanel select { width:100%; min-height:44px; }
html body #workspace[data-view="students"] .studentDirectoryToolbar { position:relative; }
html body #workspace[data-view="students"] .studentDirectoryBar > button { flex:0 0 auto; min-height:44px; white-space:nowrap; }
html body #workspace[data-view="students"] .studentSubjectTags span,
html body #workspace[data-view="students"] .studentStatusBadges span,
html body #workspace[data-view="students"] .studentDiscountBadge { background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; padding:0 !important; }
html body #workspace[data-view="students"] .studentSubjectTags { display:block; }
html body #workspace[data-view="students"] .studentSubjectTags span { color:inherit !important; font-size:inherit; font-weight:400; }
html body #workspace[data-view="students"] .studentSubjectTags span + span::before { content:' · '; }
html body #workspace[data-view="students"] .studentDiscountBadge { min-height:44px; padding-inline:6px !important; text-decoration:underline; cursor:pointer; }
html body #workspace[data-view="students"] .studentDirectoryTable th { white-space:nowrap; }
html body #workspace[data-view="students"] .studentCodeCell { white-space:nowrap; font-variant-numeric:tabular-nums; }
html body #workspace[data-view="students"] .studentAdminWrap { overflow-x:auto !important; max-width:100%; }
html body .studentProfileDialog .studentCoreFields { margin-top:14px; }
html body .studentProfileDialog .studentCoreFields input[readonly] { cursor:default; background:transparent; box-shadow:none; }
html body .studentProfileDialog .studentAutoStudySummary { padding:0; border:0; background:transparent; font-size:14px; color:var(--muted,#52637a); }
html body .studentProfileDialog .studentDiscountEditorHead { cursor:pointer; min-height:44px; margin:0; background:transparent; }
html body .studentProfileDialog .studentDiscountEditorActions { padding:10px; }
html body .studentProfileDialog select { appearance:none !important; -webkit-appearance:none !important; padding-right:36px !important; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2352637a' stroke-width='1.6' d='m4 6 4 4 4-4'/%3E%3C/svg%3E") !important; background-repeat:no-repeat !important; background-position:right 12px center !important; background-size:16px !important; }
@media(max-width:1100px) {
  html body #workspace[data-view="students"] .studentDirectoryFilters { position:static; }
  html body #workspace[data-view="students"] .studentDirectoryFilterPanel { top:auto; right:0; }
  html body #workspace[data-view="students"] .studentDirectoryBar { flex-wrap:wrap; }
  html body #workspace[data-view="students"] .studentDirectoryKpis { width:100%; }
  html body #workspace[data-view="students"] .studentDirectoryBar .studentAdminSearch { flex-basis:180px !important; }
}
@media(max-width:600px) {
  html body #workspace[data-view="students"] .studentDirectoryBar { gap:8px; }
  html body #workspace[data-view="students"] .studentKpi span { display:flex !important; gap:4px; }
  html body #workspace[data-view="students"] .studentKpi small { font-size:11px !important; }
  html body #workspace[data-view="students"] .studentDirectoryBar .studentAdminSearch { flex:1 1 calc(100% - 150px) !important; }
  html body #workspace[data-view="students"] .studentDirectoryFilters { position:static; }
  html body #workspace[data-view="students"] .studentDirectoryFilterPanel { top:auto; right:0; grid-template-columns:minmax(0,1fr); max-height:65dvh; overflow-y:auto; }
  html body #workspace[data-view="students"] .studentDirectoryBar > button { flex:1 1 auto; }
}
