/* Academic navigation lists, shared by management, staff and student portals. */
#page .ju .jcAcademicTableWrap {
  width: min(100%, 800px);
  min-height: 0;
  max-height: none;
  border-radius: 9px;
}
#page .ju .jcAcademicTableWrap:has([data-jc-kind="days"]) { width: min(100%, 1040px); }
#page .ju table.jcAcademicTable {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}
#page .ju .jcAcademicTable th,
#page .ju .jcAcademicTable td {
  height: auto;
  padding: 5px 10px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
#page .ju .jcAcademicTable th { padding-block: 7px; font-size: 12px; }
#page .ju .jcAcademicTable[data-jc-kind="sets"] th:nth-child(1) { width: 42%; }
#page .ju .jcAcademicTable[data-jc-kind="sets"] th:nth-child(2) { width: 12%; }
#page .ju .jcAcademicTable[data-jc-kind="sets"] th:nth-child(3) { width: 10%; }
#page .ju .jcAcademicTable[data-jc-kind="sets"] th:nth-child(4) { width: 36%; }
#page .ju .jcAcademicTable[data-jc-kind="days"] th:nth-child(1) { width: 9%; }
#page .ju .jcAcademicTable[data-jc-kind="days"] th:nth-child(2) { width: 17%; }
#page .ju .jcAcademicTable[data-jc-kind="days"] th:nth-child(3) { width: 34%; }
#page .ju .jcAcademicTable[data-jc-kind="days"] th:nth-child(4) { width: 24%; }
#page .ju .jcAcademicTable[data-jc-kind="days"] th:nth-child(5) { width: 16%; }
#page .ju .jcAcademicTable .juBtn {
  min-height: 32px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 12px;
}
#page .ju .jcAcademicTable .juActions { gap: 4px; }
#page .ju:has(.jcAcademicTable,.juExam) .juTop { margin: 0 0 9px; gap: 8px; justify-content: flex-start; }
#page .ju:has(.jcAcademicTable,.juExam) .juTop h2 { margin: 0; }
#page .ju:has(.jcAcademicTable,.juExam) .juTop p { margin: 2px 0 0; }
#page .ju:has(.jcAcademicTable,.juExam) .juTop .juActions { gap: 5px; }
#page .ju .juList:has(> .juExam) {
  gap: 0;
  border: 1px solid #e9e0f6;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}
#page .ju .juList > .juExam {
  display: grid;
  grid-template-columns: minmax(160px, 360px) minmax(0, 1fr);
  justify-content: start;
  align-items: center;
  gap: 6px 12px;
  padding: 7px 10px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #eee7f5;
  border-radius: 0;
  box-shadow: none;
}
#page .ju .juList > .juExam:last-child { border-bottom: 0; }
#page .ju .juExam h3 { margin: 0; font-size: 14px; line-height: 1.4; }
#page .ju .juExam p { margin: 2px 0 0; font-size: 12px; line-height: 1.4; }
#page .ju .juExam p:empty,#page .ju .juExamMeta:empty { display: none; }
#page .ju .juExamMeta { margin-top: 3px; gap: 4px 8px; }
#page .ju .juExam .juActions { width: auto; gap: 4px; justify-content: flex-start; }
#page .ju .juExam .juBtn { min-height: 32px; padding: 4px 9px; border-radius: 7px; font-size: 12px; }
#page .ju .juMonths { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid #e9e0f6; border-radius: 9px; overflow: hidden; }
#page .ju .juMonths > .juMonth {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  min-height: 36px !important;
  padding: 6px 10px !important;
  border: 0;
  border-bottom: 1px solid #eee7f5;
  border-radius: 0 !important;
  box-shadow: none;
}
#page .ju .juMonths > .juMonth:last-child { border-bottom: 0; }
#page .ju .juMonths .juMonth h3 { min-width: 80px; margin: 0; font-size: 13px; }
html[data-joyup-unified] #app:has(#juGradeTabs button) > .main > .top {
  min-height: 72px;
  padding: 8px 16px;
  margin-bottom: 12px;
}
html[data-joyup-unified] #app:has(#juGradeTabs button) #juHeaderMascot { width: 56px; height: 56px; flex-basis: 56px; }
html[data-joyup-unified] #app:has(#juGradeTabs button) #juHeaderMascot img { width: 56px; height: 60px; }
html[data-joyup-unified] #app:has(#juGradeTabs button) #title { font-size: 25px; }
#juSectionBar:has(#juGradeTabs button) { margin-bottom: 9px; }
#juSectionBar #juGradeTabs [role="tab"] { min-height: 34px; padding-block: 6px; }

/* Staff: class, Day and test rows keep their existing click targets. */
#root.jpStaffLayout #jhRoot .jhHeading { margin-bottom: 9px; gap: 8px; }
#root.jpStaffLayout #jhRoot .jhTabs { margin-bottom: 10px; gap: 3px; }
#root.jpStaffLayout #jhRoot .jhTabs button { padding: 8px 12px; }
#root.jpStaffLayout #jhRoot .jhGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid #e8ddfa;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}
#root.jpStaffLayout #jhRoot .jhClass {
  display: grid;
  grid-template-columns: minmax(130px, 280px) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #eee7f5;
  border-radius: 0;
  background: #fff;
}
#root.jpStaffLayout #jhRoot .jhClass:last-child { border-bottom: 0; }
#root.jpStaffLayout #jhRoot .jhClass b { margin: 0; font-size: 14px; grid-column: 1; grid-row: 1; }
#root.jpStaffLayout #jhRoot .jhClass small { grid-column: 3; grid-row: 1; }
#root.jpStaffLayout #jhRoot .jhClass::after { content: "Mở ›"; font-size: 12px; grid-column: 2; grid-row: 1; }
#root.jpStaffLayout #jhRoot .jhDays > div {
  display: grid !important;
  grid-template-columns: minmax(0, 530px) auto;
  justify-content: start;
  align-items: center;
  gap: 6px !important;
  padding: 5px 10px;
  border-bottom: 1px solid #eee7f5;
}
#root.jpStaffLayout #jhRoot .jhDays > div:last-child { border-bottom: 0; }
#root.jpStaffLayout #jhRoot .jhDay {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 44px;
  align-items: center;
  column-gap: 8px;
  min-height: 34px;
  padding: 3px 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
}
#root.jpStaffLayout #jhRoot .jhDay b { margin: 0; font-size: 14px; grid-column: 1; grid-row: 1; }
#root.jpStaffLayout #jhRoot .jhDay span { grid-column: 2; line-height: 1.4; }
#root.jpStaffLayout #jhRoot .jhDay::after { content: "Mở ›"; grid-column: 3; grid-row: 1; font-size: 12px; }
#root.jpStaffLayout #jhRoot .jhDay:disabled::after { content: "🔒"; }
#root.jpStaffLayout #jhRoot .jhDays > div > .jhBtn { min-height: 32px; padding: 4px 9px; border-radius: 7px; font-size: 12px; }
#root.jpStaffLayout #jhTests .jhTest {
  display: grid;
  grid-template-columns: minmax(160px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: 2px 12px;
  padding: 7px 10px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #eee7f5;
  border-radius: 0;
}
#root.jpStaffLayout #jhTests:has(.jhTest) { border: 1px solid #e8ddfa; border-radius: 9px; overflow: hidden; }
#root.jpStaffLayout #jhTests .jhTest:last-child { border-bottom: 0; }
#root.jpStaffLayout #jhTests .jhTest h3 { grid-column: 1; grid-row: 1; margin: 0; font-size: 14px; line-height: 1.4; }
#root.jpStaffLayout #jhTests .jhMeta { grid-column: 1; grid-row: 2; margin: 0; line-height: 1.4; }
#root.jpStaffLayout #jhTests .jhActions { grid-column: 2; grid-row: 1 / span 2; gap: 4px; }
#root.jpStaffLayout #jhTests .jhBtn { min-height: 32px; padding: 4px 9px; border-radius: 7px; font-size: 12px; }

/* Older academic entry points use the same list density. */
#page .unifiedGradeGrid,#page .unifiedModuleGrid { grid-template-columns: 1fr; gap: 0; }
#page .unifiedGradeCard,#page .unifiedModuleCard { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; border-width: 1px; border-radius: 7px; }
#page .unifiedGradeCard b,#page .unifiedModuleCard b { margin: 0; font-size: 14px; min-width: 100px; }
#page .jbEntry { justify-content: flex-start; gap: 8px 12px; padding: 8px 10px; margin: 8px 0; border-radius: 9px; }
#page .jbEntry > div { gap: 5px; }

/* The shared exam library also appears outside the class hub. */
#page .jeRoot .jeHead { margin-bottom: 9px; }
#page .jeRoot .jeFolders { grid-template-columns: 1fr; gap: 0; border: 1px solid #e8ddfa; border-radius: 9px; overflow: hidden; }
#page .jeRoot .jeFolder { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-height: 38px; padding: 7px 10px; border: 0; border-bottom: 1px solid #eee7f5; border-radius: 0; }
#page .jeRoot .jeFolder:last-child { border-bottom: 0; }
#page .jeRoot .jeFolder b { margin: 0; font-size: 14px; min-width: 150px; }
#page .jeRoot .jePapers:has(.jePaper) { border: 1px solid #e8ddfa; border-radius: 9px; overflow: hidden; }
#page .jeRoot .jePaper { display: grid; grid-template-columns: minmax(160px, 360px) minmax(0, 1fr); align-items: center; gap: 2px 12px; margin: 0; padding: 7px 10px; border: 0; border-bottom: 1px solid #eee7f5; border-radius: 0; }
#page .jeRoot .jePaper:last-child { border-bottom: 0; }
#page .jeRoot .jePaper h3 { grid-column: 1; grid-row: 1; margin: 0; font-size: 14px; line-height: 1.4; }
#page .jeRoot .jePaper .jeMeta { grid-column: 1; grid-row: 2; margin: 0; line-height: 1.4; }
#page .jeRoot .jePaper .jeActions { grid-column: 2; grid-row: 1 / span 2; gap: 4px; }
#page .jeRoot .jePaper button { min-height: 32px; padding: 4px 9px; border-radius: 7px; font-size: 12px; }

/* Student Day selection remains one accessible button per lesson. */
body #app .days {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid #e8ddfa;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
body #app .days > .day {
  display: grid;
  grid-template-columns: 75px minmax(0, 480px) auto;
  justify-content: start;
  align-items: center;
  gap: 3px 10px;
  min-height: 44px;
  padding: 7px 12px;
  border: 0 !important;
  border-bottom: 1px solid #eee7f5 !important;
  border-radius: 0;
  box-shadow: none !important;
  text-align: left;
  background: #fff !important;
}
body #app .days > .day:last-child { border-bottom: 0 !important; }
body #app .days > .day b { grid-column: 1; grid-row: 1 / span 2; font-size: 15px; }
body #app .days > .day p { grid-column: 2; grid-row: 1; margin: 0; font-size: 14px; line-height: 1.4; }
body #app .days > .day .small { grid-column: 2; grid-row: 2; line-height: 1.35; font-size: 12px; }
body #app .days > .day .small:empty { display: none; }
body #app .days > .day::after { content: "Mở ›"; position: static; grid-column: 3; grid-row: 1 / span 2; width: auto; height: auto; border-radius: 0; background: transparent !important; font-size: 13px; color: #6032bc; }
body #app .days > .day:disabled::after { content: "🔒"; }
#root.jpStaffLayout #jhRoot .jhClass:hover,#root.jpStaffLayout #jhRoot .jhDay:not(:disabled):hover,body #app .days > .day:not(:disabled):hover { background: #faf7ff; }

@media (max-width: 650px) {
  #page .ju .jcAcademicTable th,#page .ju .jcAcademicTable td { padding-inline: 7px; }
  #page .ju .jcAcademicTable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #page .ju .jcAcademicTable,#page .ju .jcAcademicTable tbody { display: block; }
  #page .ju .jcAcademicTable tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 6px; padding: 6px 8px; border-bottom: 1px solid #eee7f5; align-items: center; }
  #page .ju .jcAcademicTable tbody tr:last-child { border-bottom: 0; }
  #page .ju .jcAcademicTable tbody td { border: 0; padding: 0; min-width: 0; }
  #page .ju .jcAcademicTable tbody td:nth-child(1) { grid-column: 1; grid-row: 1; }
  #page .ju .jcAcademicTable tbody td:nth-child(2) { grid-column: 3; grid-row: 1 / span 2; }
  #page .ju .jcAcademicTable[data-jc-kind="sets"] tbody td:nth-child(3) { grid-column: 2; grid-row: 1; font-size: 12px; }
  #page .ju .jcAcademicTable[data-jc-kind="sets"] tbody td:nth-child(3)::before { content: attr(data-jc-label) ": "; color: #887398; }
  #page .ju .jcAcademicTable[data-jc-kind="sets"] tbody td:nth-child(4) { grid-column: 1 / span 2; grid-row: 2; color: #78658b; font-size: 12px; }
  #page .ju .jcAcademicTable[data-jc-kind="days"] tbody td:nth-child(n+3) { grid-column: 1 / span 2; font-size: 12px; color: #78658b; }
  #page .ju .jcAcademicTable tbody td[colspan] { grid-column: 1 / -1; grid-row: auto; }
  #page .ju .jcAcademicTable .juBtn,#page .ju .juExam .juBtn { min-height: 40px; }
  #page .ju .juList > .juExam { grid-template-columns: 1fr; gap: 5px; }
  #page .ju .juMonths > .juMonth { min-height: 40px !important; }
  #root.jpStaffLayout #jhRoot .jhClass { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; }
  #root.jpStaffLayout #jhRoot .jhClass small { grid-column: 1; grid-row: 2; }
  #root.jpStaffLayout #jhRoot .jhClass::after { grid-column: 2; grid-row: 1 / span 2; }
  #root.jpStaffLayout #jhRoot .jhDays > div { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 7px; }
  #root.jpStaffLayout #jhRoot .jhDay { grid-template-columns: 55px minmax(0, 1fr); min-height: 40px; gap: 3px 6px; }
  #root.jpStaffLayout #jhRoot .jhDay::after { display: none; }
  #root.jpStaffLayout #jhRoot .jhDays > div > .jhBtn { min-height: 40px; padding-inline: 7px; }
  #root.jpStaffLayout #jhTests .jhTest { grid-template-columns: 1fr; gap: 3px; }
  #root.jpStaffLayout #jhTests .jhActions { grid-column: 1; grid-row: 3; }
  #root.jpStaffLayout #jhTests .jhBtn { min-height: 40px; }
  #page .jeRoot .jePaper { grid-template-columns: 1fr; gap: 3px; }
  #page .jeRoot .jePaper .jeActions { grid-column: 1; grid-row: 3; }
  #page .jeRoot .jePaper button { min-height: 40px; }
  body #app .days > .day { grid-template-columns: 60px minmax(0, 1fr) auto; padding-inline: 8px; column-gap: 7px; }
}
