/* =========================================================
   EDUHUNT V2.2.331 R116
   Consolidated Result WhatsApp controls + searchable Schools
   + collapsible Execution Status + static no-bounce buttons
   + Director LR history and mobile print cleanup.
========================================================= */

/* The selected state may change colour, but controls must never jump, lift,
   shrink or "dance" on hover/click. This applies to all six portals. */
body[data-portal-role] :is(button,.button,a.button,[role="button"]),
body[data-portal-role] :is(button,.button,a.button,[role="button"]):hover,
body[data-portal-role] :is(button,.button,a.button,[role="button"]):active,
body[data-portal-role] :is(button,.button,a.button,[role="button"]):focus{
  transform:none!important;
  translate:none!important;
  transition:background-color .12s ease,border-color .12s ease,color .12s ease,box-shadow .12s ease,filter .12s ease!important;
}

/* One stable top button per Test number. */
body[data-portal-role="PRINCIPAL"][data-portal-module="result-whatsapp-reports"] .rwa-principal-test-tabs{
  min-height:58px!important;
  align-items:stretch!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="result-whatsapp-reports"] .rwa-principal-test-tab{
  min-height:50px!important;
  height:50px!important;
  margin:0!important;
}

/* Class and delivery counts are visible clickable buttons. */
.rwa-class-chip,
.rwa-row-kpi-button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:34px!important;
  min-height:31px!important;
  padding:5px 9px!important;
  border:1px solid #8168ff!important;
  border-radius:8px!important;
  background:#171747!important;
  color:#f5f2ff!important;
  font:inherit!important;
  font-size:13px!important;
  font-weight:950!important;
  line-height:1!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  box-sizing:border-box!important;
}
.rwa-class-chip,
.rwa-row-kpi-button{cursor:pointer!important}
.rwa-class-chip:hover,
.rwa-class-chip:focus-visible,
.rwa-row-kpi-button:hover,
.rwa-row-kpi-button:focus-visible{
  border-color:#b4a6ff!important;
  background:#27236a!important;
  box-shadow:0 0 0 2px rgba(129,104,255,.2)!important;
  outline:0!important;
}
.rwa-table--principal th:not(:nth-last-child(-n+2)),
.rwa-table--principal td:not(:nth-last-child(-n+2)){
  text-align:center!important;
}
.rwa-consolidated-total td{
  border-top:2px solid #4c7796!important;
  background:#0a2944!important;
}

/* School selectors are code/name search controls; the original select stays
   hidden only as the submitted value used by existing APIs. */
.rwa-dashboard-filter .r27-school-native{display:none!important}
.rwa-dashboard-filter .r27-school-search{width:100%!important;min-width:0!important}
.rwa-dashboard-filter .r27-school-search-input{
  width:100%!important;
  min-width:0!important;
  height:36px!important;
  padding:6px 10px!important;
  border:1px solid var(--line,#274560)!important;
  border-radius:9px!important;
  background:var(--panel,#071b2e)!important;
  color:inherit!important;
  font:inherit!important;
  font-size:13px!important;
  font-weight:800!important;
  box-sizing:border-box!important;
}
.rwa-dashboard-filter .r27-school-search-results{
  z-index:80!important;
  max-height:290px!important;
}

/* The complete active Execution Status header is a collapse/expand button. */
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-heading{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto 34px!important;
  align-items:center!important;
  gap:10px!important;
  width:100%!important;
  min-height:62px!important;
  margin:0!important;
  padding:12px 16px!important;
  border:0!important;
  border-radius:0!important;
  background:#116b9f!important;
  color:#fff!important;
  text-align:left!important;
  font:inherit!important;
  cursor:pointer!important;
  box-sizing:border-box!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-heading>span{
  min-width:0!important;
  font-size:20px!important;
  font-weight:950!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-heading>small{
  color:#e7f7ff!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-collapse{
  display:grid!important;
  place-items:center!important;
  width:30px!important;
  height:30px!important;
  border:1px solid rgba(255,255,255,.5)!important;
  border-radius:8px!important;
  color:#fff!important;
  font-size:22px!important;
  line-height:1!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-heading:focus-visible{
  outline:2px solid #8de6ff!important;
  outline-offset:-4px!important;
}

/* CHEMISTRY becomes CHEM and the Subject/Test divider matches all other
   one-pixel table lines. */
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-subject-name{
  white-space:nowrap!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  border-right:1px solid #315873!important;
  box-shadow:none!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-test-name{
  border-left:0!important;
  box-shadow:none!important;
}

/* Dispatch History shows the parcel contents because the current school is
   already identified in the portal header. */
.exam-v3-history-list .exam-v3-parcel-contents{
  min-width:0!important;
}
.exam-v3-history-list .exam-v3-parcel-label{
  display:block!important;
  margin-bottom:5px!important;
  color:#6fd8ff!important;
  font-size:11px!important;
  font-weight:950!important;
  letter-spacing:.08em!important;
}
.exam-v3-history-list .exam-v3-parcel-contents h3{
  margin:0!important;
  color:inherit!important;
  font-size:16px!important;
  line-height:1.25!important;
}
.exam-v3-history-list .exam-v3-parcel-contents p{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:5px!important;
  margin:7px 0 0!important;
}
.exam-v3-history-list .exam-v3-parcel-contents p span{
  display:inline-flex!important;
  align-items:center!important;
  min-height:24px!important;
  padding:3px 8px!important;
  border:1px solid #2b5876!important;
  border-radius:999px!important;
  background:#092944!important;
  color:#bfeaff!important;
  font-size:11px!important;
  font-weight:850!important;
}

/* Exam Dates now has two desktop actions only: Print and WhatsApp. */
body[data-portal-role="PRINCIPAL"][data-portal-module="schedule"] .principal-schedule-actions{
  grid-template-columns:repeat(2,max-content)!important;
}

@media(max-width:1024px){
  /* Printing is a desktop-only action throughout the portal. */
  body[data-portal-role] :is([data-command="print"],[data-command$="-print"],.r116-mobile-print){
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="schedule"] .principal-schedule-actions{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="schedule"] .principal-schedule-actions .button{
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="result-whatsapp-reports"] .rwa-principal-test-tabs{
    min-height:52px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="result-whatsapp-reports"] .rwa-principal-test-tab{
    min-height:46px!important;
    height:46px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-heading{
    grid-template-columns:minmax(0,1fr) auto 32px!important;
    min-height:56px!important;
    padding:10px 12px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-heading>span{
    font-size:17px!important;
  }
}
