/* =====================================================================
   EDUHUNT V2.2.342 R127
   Principal Test Keys, clean Principal hubs, and six-portal theme control.
   Presentation only: no API, permission, database, or calculation changes.
   ===================================================================== */

/* One compact appearance control on phones and tablets. */
@media screen and (max-width:1024px){
  body[data-portal-role] .student-theme-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 40px;
    width:40px;
    height:40px;
    min-height:40px;
    padding:0;
    border:1px solid #315875;
    border-radius:12px;
    background:#0b2942;
    color:#ffd84d;
    box-shadow:0 0 16px rgba(49,216,255,.12);
  }
  body[data-portal-role] .student-theme-toggle b{display:none!important}
  body[data-portal-role] .student-theme-toggle span{display:grid;place-items:center;font-size:19px;line-height:1}
  body[data-portal-role] #studentThemeIcon svg{display:none;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  body[data-portal-role] #studentThemeIcon[data-icon-mode="light"] [data-theme-icon="light"],
  body[data-portal-role] #studentThemeIcon[data-icon-mode="dark"] [data-theme-icon="dark"]{display:block}
  body[data-portal-role][data-desktop-theme="light"] .student-theme-toggle{
    border-color:#b8cbe0;
    background:#fff;
    color:#7054d8;
    box-shadow:0 3px 12px rgba(20,52,84,.10);
  }

  /* The mobile stylesheets are dark-first. These scoped resets expose the
     existing light design only after the user explicitly selects Light. */
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]){
    color-scheme:light;
    --canvas:#f2f6fb;
    --surface:#fff;
    --surface-soft:#f7fbff;
    --ink-950:#10233f;
    --ink-800:#183a5b;
    --ink-700:#405972;
    --ink-600:#60758d;
    --ink-500:#7489a0;
    --line:#bfd0e2;
    --line-strong:#9fb8cf;
    background:#f2f6fb!important;
    color:#10233f!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(.portal-view,.portal-main,.content){
    background:#f2f6fb!important;
    color:#10233f!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) .topbar{
    background:#fff!important;
    color:#10233f!important;
    border-color:#c8d7e6!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(.topbar-title>span,.topbar-title h1,.topbar-role-label){
    color:#0b78c8!important;
    text-shadow:none!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(.card,.kpi-card,.filter-bar,.table-card,.programme-card,.schedule-card,.resource-card,.subject-card,.doc-card,.empty-state,.role-report-card,.principal-hub-item){
    background:#fff!important;
    color:#10233f!important;
    border-color:#bfd0e2!important;
    box-shadow:0 4px 14px rgba(20,52,84,.07)!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) #content :is(h1,h2,h3,h4,.page-head h2,.section-title,.card-head h3,.cell-primary,strong,b){
    color:#10233f;
    text-shadow:none!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) #content :is(p,small,.page-head p,.card-head p,.cell-secondary,.help-text){
    color:#526b84;
    text-shadow:none!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(input,select,textarea){
    background:#fff!important;
    color:#10233f!important;
    border-color:#aabfd4!important;
    -webkit-text-fill-color:#10233f!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(input,textarea)::placeholder{
    color:#60758d!important;
    -webkit-text-fill-color:#60758d!important;
    opacity:1!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(.table-wrap,table){
    background:#fff!important;
    color:#10233f!important;
    border-color:#bfd0e2!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) table th{
    background:#e8f2fb!important;
    color:#143f65!important;
    border-color:#b8cbe0!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) table td{
    background:#fff!important;
    color:#183a5b!important;
    border-color:#d0dce8!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(.principal-bottom-nav,.student-bottom-nav,.role-bottom-nav){
    background:#fff!important;
    border-top-color:#bfd0e2!important;
  }
  :is(body[data-portal-role][data-desktop-theme="light"],html.eh-force-mobile body[data-portal-role][data-desktop-theme="light"]) :is(.principal-bottom-nav,.student-bottom-nav,.role-bottom-nav) button{
    color:#405972!important;
  }
}

/* Principal Test Keys: only meaningful released content is shown. */
body[data-portal-role="PRINCIPAL"][data-portal-module="downloads-test-keys"] .r862-key-filters>label:only-child,
body[data-portal-role="PRINCIPAL"][data-portal-module="test-keys"] .r862-key-filters>label:only-child{
  grid-column:1/-1;
}
body[data-portal-role="PRINCIPAL"] .r862-key-info{
  font-size:14px;
  font-weight:500;
}
body[data-portal-role="PRINCIPAL"] .r862-key-info b{font-weight:700}
body[data-portal-role="PRINCIPAL"] .r862-key-card{
  min-height:0;
}
body[data-portal-role="PRINCIPAL"] .r862-key-actions>.button:only-child{
  grid-column:1/-1;
}
body[data-portal-role="PRINCIPAL"] .r862-key-actions>.r862-obj-done{
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0;
  min-height:42px;
  grid-column:span 2;
}
body[data-portal-role="PRINCIPAL"] .r862-camera-button{
  border-color:#25b994!important;
  color:#0b795f!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"] .r862-camera-button{
  background:#0b332d!important;
  border-color:#2a8e75!important;
  color:#79f0ce!important;
}

/* People: remove the redundant intro and use the open area for concise login help. */
body[data-portal-role="PRINCIPAL"] .principal-people-login-guide{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:16px;
  padding:12px;
  border:1px solid #264b67;
  border-radius:14px;
  background:#071b2f;
}
body[data-portal-role="PRINCIPAL"] .principal-people-login-guide>div{
  min-width:0;
  padding:10px;
  border-radius:11px;
  background:#0a2640;
}
body[data-portal-role="PRINCIPAL"] .principal-people-login-guide b,
body[data-portal-role="PRINCIPAL"] .principal-people-login-guide strong{
  display:block;
  color:#61ead1;
  font-size:12px;
  font-weight:700;
  line-height:1.25;
}
body[data-portal-role="PRINCIPAL"] .principal-people-login-guide span{
  display:block;
  margin-top:4px;
  color:#d8e6f3;
  font-size:12px;
  line-height:1.4;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="light"] .principal-people-login-guide{
  background:#edf6ff;
  border-color:#bfd5e8;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="light"] .principal-people-login-guide>div{background:#fff}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="light"] .principal-people-login-guide b,
body[data-portal-role="PRINCIPAL"][data-desktop-theme="light"] .principal-people-login-guide strong{color:#087c61}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="light"] .principal-people-login-guide span{color:#405972}

/* Micro Schedules: the Programme buttons already provide scope, so each card
   shows only the applicable Class and the existing secure actions. */
body[data-portal-role="PRINCIPAL"][data-portal-module="micro-schedules"] .principal-micro-card{
  display:block!important;
  min-height:86px!important;
  padding:14px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="micro-schedules"] .principal-micro-card-copy{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="micro-schedules"] .principal-micro-card-copy>strong{
  margin:0!important;
  font-size:16px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="micro-schedules"] .principal-micro-card .row-actions{
  margin:0!important;
  flex-wrap:nowrap;
}

@media screen and (max-width:800px){
  body[data-portal-role="PRINCIPAL"] .r862-key-actions>.r862-obj-done{grid-column:auto}
}

@media screen and (max-width:520px){
  body[data-portal-role="PRINCIPAL"] .principal-people-login-guide{
    grid-template-columns:1fr;
  }
  body[data-portal-role="PRINCIPAL"] .r862-key-info{font-size:13px}
  body[data-portal-role="PRINCIPAL"] .r862-key-coordinator{align-items:flex-start}
  body[data-portal-role="PRINCIPAL"][data-portal-module="micro-schedules"] .principal-micro-card-copy{
    align-items:flex-start;
    flex-direction:column;
  }
}
