/* ========================================================================
   EDUHUNT R437 — Principal Dashboard / Medal / Theme compact cleanup
   Scope: Principal Portal only.
   - Mobile/tablet upcoming exam details stay on one horizontal line.
   - Medal report actions are compact icon-only; Back is removed in JS.
   - Principal Light/Dark switch shows icons only, no words.
   ======================================================================== */

/* ------------------------------------------------------------------------
   PRINCIPAL DASHBOARD — one-line upcoming CDF exam information on mobile/tab
   ------------------------------------------------------------------------ */
@media (max-width:1024px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
    min-width:0!important;
    width:100%!important;
    overflow:hidden!important;
    padding-top:8px!important;
    padding-bottom:8px!important;
  }

  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > h3,
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-classes,
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-subject,
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-chapter{
    display:block!important;
    position:static!important;
    float:none!important;
    grid-column:auto!important;
    grid-row:auto!important;
    margin:0!important;
    padding:0!important;
    white-space:nowrap!important;
    line-height:1.12!important;
  }

  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > h3{
    flex:0 0 auto!important;
    font-size:18px!important;
    font-weight:950!important;
  }

  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-classes,
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-subject{
    flex:0 0 auto!important;
    font-size:14px!important;
  }

  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-chapter{
    flex:1 1 auto!important;
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font-size:14px!important;
  }
}

@media (max-width:520px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf{gap:4px!important}

  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > h3{font-size:17px!important}

  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-classes,
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-subject,
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"]
  .principal-next-exam-list--grouped > article.is-cdf > .principal-next-exam-chapter{
    font-size:12.5px!important;
  }
}

/* ------------------------------------------------------------------------
   PRINCIPAL MEDAL PAGE — actions are clean square icons only
   ------------------------------------------------------------------------ */
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-top-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:nowrap!important;
  gap:8px!important;
  width:auto!important;
}

body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-action{
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  padding:0!important;
  gap:0!important;
  border-radius:10px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
}

body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-action svg{
  width:20px!important;
  height:20px!important;
}

body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-action span{
  display:none!important;
}

body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-action--back{
  display:none!important;
}

@media (max-width:720px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:8px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-head .medal-top-actions{
    justify-self:end!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-action{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    border-radius:9px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-action svg{
    width:18px!important;
    height:18px!important;
  }
}

/* ------------------------------------------------------------------------
   PRINCIPAL THEME CONTROL — icon-only Light / Dark buttons
   ------------------------------------------------------------------------ */
body[data-portal-role="PRINCIPAL"] #desktopThemeSwitcher{
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  padding:3px!important;
  width:auto!important;
  min-width:0!important;
}

body[data-portal-role="PRINCIPAL"] #desktopThemeSwitcher .desktop-theme-choice{
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  min-height:34px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  cursor:pointer!important;
}

body[data-portal-role="PRINCIPAL"] #desktopThemeSwitcher .desktop-theme-choice > b{
  display:none!important;
}

body[data-portal-role="PRINCIPAL"] #desktopThemeSwitcher .desktop-theme-choice > span{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  font-size:16px!important;
  line-height:1!important;
}
