/* =========================================================
   EDUHUNT V2.2.320 R105
   Principal teacher list, test-pattern heading and schedule compaction.
   Loaded after the cumulative R104 stylesheet.
========================================================= */

/* CDF keeps its existing desktop title. */
body[data-portal-role="PRINCIPAL"] .principal-pattern-cdf-title-mobile{
  display:none!important;
}

/* Next-exam rows stay compact and do not reserve height for empty chapter text. */
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list article>small:empty{
  display:none!important;
}

@media(max-width:700px){
  /* Teacher row 1: teacher name + subject. Row 2: class/section + four actions. */
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap,
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap table,
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tbody{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap thead{
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tbody{
    display:grid!important;
    gap:7px!important;
    padding:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tr{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto!important;
    gap:7px 9px!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    padding:9px 7px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td{
    display:flex!important;
    align-items:center!important;
    width:auto!important;
    min-width:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td::before,
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td:nth-child(1){
    display:none!important;
    content:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td:nth-child(2){
    grid-column:1!important;
    grid-row:1!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td:nth-child(3){
    grid-column:2!important;
    grid-row:1!important;
    justify-content:flex-end!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td:nth-child(4){
    grid-column:1!important;
    grid-row:2!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td:nth-child(5){
    grid-column:2!important;
    grid-row:2!important;
    justify-content:flex-end!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-name{
    display:block!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:14pt!important;
    line-height:1.15!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-summary{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:3px!important;
    min-width:0!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .assignment-chip{
    display:block!important;
    min-width:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:14pt!important;
    line-height:1.15!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-row-actions,
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .credential-forward-actions--icons{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:3px!important;
    width:auto!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-icon-action{
    width:29px!important;
    min-width:29px!important;
    height:29px!important;
  }

  /* Mobile CDF heading: red CDF followed by the full title, without the dash. */
  body[data-portal-role="PRINCIPAL"] .principal-pattern-cdf-title-desktop{
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-pattern-cdf-title-mobile{
    display:inline!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-pattern-cdf-title-mobile>b{
    color:#ff3b30!important;
  }

  /* FT5, Class and All Subjects share one compact row on every mobile item. */
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list article{
    display:grid!important;
    grid-template-columns:auto auto minmax(0,1fr)!important;
    grid-template-rows:auto!important;
    align-items:center!important;
    gap:6px 10px!important;
    padding:8px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list h3,
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list b,
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list span{
    grid-row:1!important;
    min-width:0!important;
    margin:0!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list h3{
    grid-column:1!important;
    font-size:14pt!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list b{
    grid-column:2!important;
    text-align:left!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list span{
    grid-column:3!important;
    font-size:13px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list small:not(:empty){
    grid-column:1 / -1!important;
    grid-row:2!important;
  }
}
