/* ========================================================================
   EDUHUNT R405 — PRINCIPAL STUDENT HISTORY TABLE CONSISTENCY
   UI-only final override. Keeps Subject Performance and Question-wise
   Response as real tables on desktop, tablet and physical mobile.
   Loaded after all legacy portal/principal styles.
   ======================================================================== */

/* Never allow legacy responsive CSS to convert these two result tables into cards. */
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table .table-card,
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table .table-card,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table .table-card,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table .table-card{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  padding:0!important;
}

body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-toolbar,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-toolbar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  width:100%!important;
}

body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-wrap,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-wrap{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
  overflow-y:visible!important;
}

body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) table,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) table{
  display:table!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}

body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) thead,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) thead{
  display:table-header-group!important;
}
body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) tbody,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) tbody{
  display:table-row-group!important;
  width:auto!important;
  padding:0!important;
}
body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) tr,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) tr{
  display:table-row!important;
  width:auto!important;
  max-width:none!important;
  padding:0!important;
  margin:0!important;
  border-radius:0!important;
}
body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) th,
body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) td,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) th,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) td{
  display:table-cell!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  white-space:normal!important;
  overflow:visible!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  vertical-align:middle!important;
  border-radius:0!important;
}

/* Remove labels inserted by legacy card-mode CSS. */
body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) td::before,
body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) th::before,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) td::before,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) th::before{
  content:none!important;
  display:none!important;
}

/* SUBJECT PERFORMANCE: six stable columns on every device. */
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table th:nth-child(1),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table td:nth-child(1){width:11%!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table th:nth-child(2),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table td:nth-child(2){width:27%!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table th:nth-child(3),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table td:nth-child(3){width:11%!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table th:nth-child(4),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table td:nth-child(4),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table th:nth-child(5),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table td:nth-child(5),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table th:nth-child(6),
body[data-portal-role="PRINCIPAL"] #content .principal-history-subject-table td:nth-child(6){width:17%!important;text-align:center!important}

/* QUESTION-WISE RESPONSE: compact six-column table on every device. */
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table th:nth-child(1),
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table td:nth-child(1){width:9%!important;text-align:center!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table th:nth-child(2),
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table td:nth-child(2){width:10%!important;text-align:center!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table th:nth-child(3),
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table td:nth-child(3){width:25%!important;text-align:center!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table th:nth-child(4),
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table td:nth-child(4){width:25%!important;text-align:center!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table th:nth-child(5),
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table td:nth-child(5){width:16%!important;text-align:center!important}
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table th:nth-child(6),
body[data-portal-role="PRINCIPAL"] #content .principal-history-response-table td:nth-child(6){width:15%!important;text-align:center!important}

/* Tablet + mobile typography compresses, but layout remains the SAME table. */
@media(max-width:1100px){
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-toolbar{padding:9px 9px!important}
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-toolbar strong{font-size:11px!important}
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) th{padding:7px 4px!important;font-size:9px!important;line-height:1.1!important;letter-spacing:0!important}
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) td{padding:7px 4px!important;font-size:10px!important;line-height:1.15!important}
}
@media(max-width:600px){
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-toolbar{padding:8px 7px!important}
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) .table-toolbar strong{font-size:10px!important}
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) th{padding:6px 2px!important;font-size:7.5px!important;line-height:1.08!important}
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) td{padding:6px 2px!important;font-size:8.5px!important;line-height:1.1!important}
  body[data-portal-role="PRINCIPAL"] #content .principal-history-result-symbol{width:20px!important;height:20px!important;font-size:14px!important}
}
@media(max-width:420px){
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) th{font-size:7px!important;padding:5px 1px!important}
  body[data-portal-role="PRINCIPAL"] #content :is(.principal-history-subject-table,.principal-history-response-table) td{font-size:8px!important;padding:5px 1px!important}
}
