/* EDUHUNT R544 | Principal-only spacing + Students search/edit row.
   Never applies to other roles or changes application/business logic. */

/* Dashboard: make the space after Upcoming Exams match the KPI card row gap.
   Desktop KPI gap is 14px. R412 uses 8px for <=1024px and 6px for <=560px. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .principal-next-exam {
  margin-bottom:14px!important;
}
@media (max-width:1024px) {
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .principal-next-exam {
    margin-bottom:8px!important;
  }
}
@media (max-width:560px) {
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .principal-next-exam {
    margin-bottom:6px!important;
  }
}
/* The portal supports physical phones even with Desktop Site enabled. */
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .principal-next-exam {
  margin-bottom:9px!important;
}
@media (max-width:1024px) {
  html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .principal-next-exam {
    margin-bottom:8px!important;
  }
}
@media (max-width:560px) {
  html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .principal-next-exam {
    margin-bottom:6px!important;
  }
}

/* Principal > People > Students > Existing Students:
   Put the working search input and original edit button on exactly one row. */
body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-student-inline-tools {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) max-content!important;
  grid-template-rows:auto!important;
  align-items:center!important;
  column-gap:11px!important;
  row-gap:0!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-student-inline-tools > .principal-student-search {
  display:block!important;
  grid-column:1!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  box-sizing:border-box!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-existing-card #principalStudentSearch {
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  box-sizing:border-box!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-student-inline-tools > #principalStudentEditButton {
  display:inline-flex!important;
  grid-column:2!important;
  grid-row:1!important;
  align-items:center!important;
  justify-content:center!important;
  align-self:center!important;
  width:max-content!important;
  max-width:100%!important;
  min-width:125px!important;
  min-height:44px!important;
  margin:0!important;
  padding:9px 12px!important;
  flex:none!important;
  white-space:nowrap!important;
  box-sizing:border-box!important;
}
@media(max-width:700px) {
  body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-student-inline-tools {
    column-gap:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-student-inline-tools > #principalStudentEditButton {
    min-width:68px!important;
    min-height:40px!important;
    padding:7px 9px!important;
  }
  /* Existing short labels are provided by the original application. */
  body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-edit-label-full {display:none!important;}
  body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-edit-label-short {display:inline!important;}
}
@media(max-width:370px) {
  body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-student-inline-tools {
    column-gap:6px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-existing-card .principal-student-inline-tools > #principalStudentEditButton {
    min-width:62px!important;
    padding:7px!important;
  }
}

/* Editing student names: keep SAVE NAME + DONE EDITING.
   Hide only the circled RESULTS action while Edit mode is active.
   :has() covers current browsers; the tiny R544 script supports older devices. */
body[data-portal-role="PRINCIPAL"] .principal-student-existing-card.r544-is-editing #principalStudentsTable [data-command="principal-student-results"],
body[data-portal-role="PRINCIPAL"] .principal-student-existing-card:has(#principalStudentEditButton.button--success) #principalStudentsTable [data-command="principal-student-results"] {
  display:none!important;
}

