/* =========================================================
   EDUHUNT V2.2.319 R104 — PRINCIPAL STUDENTS + STAFF + EXECUTION COMPACT UI
   Frontend only. No permissions, data or calculations change.
========================================================= */

/* Full school identity: dynamically fitted by app-r29.js. */
body[data-portal-role="PRINCIPAL"] .topbar-title{
  flex:1 1 0!important;
  min-width:0!important;
  overflow:hidden!important;
}

/* =========================================================
   R104 TRUE FINAL CASCADE
   These overrides intentionally follow all inherited R101-R103 layers.
========================================================= */
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active{
  border-color:#45c8ef!important;
  background:linear-gradient(135deg,#087db5,#16a58f)!important;
  color:#fff!important;
  box-shadow:0 0 0 2px rgba(69,200,239,.18)!important;
}
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active :is(span,b){color:#fff!important}
body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:none!important}
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance>div{display:grid!important;gap:3px!important}
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance p{margin:0!important;font-size:14px!important;line-height:1.35!important}

@media(max-width:900px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head{
    grid-template-columns:minmax(72px,1.05fr) minmax(66px,.85fr) minmax(88px,1.1fr)!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head>*{
    padding:8px 4px!important;
    font-size:13pt!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    white-space:nowrap!important;
  }
}

@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:7px!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-search{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools #principalStudentEditButton{
    grid-column:2!important;
    grid-row:1!important;
    width:auto!important;
    min-width:66px!important;
    min-height:40px!important;
    padding:7px 9px!important;
    justify-content:center!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-full{display:none!important}
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:inline!important}
}

/* R104 — Students: visible selected state and Search-first compact actions. */
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active{
  border-color:#45c8ef!important;
  background:linear-gradient(135deg,#087db5,#16a58f)!important;
  color:#fff!important;
  box-shadow:0 0 0 2px rgba(69,200,239,.18)!important;
}
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active :is(span,b){color:#fff!important}
body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:none}
body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools #principalStudentEditButton{
  flex:0 0 auto!important;
  width:auto!important;
  white-space:nowrap!important;
}

/* R104 — Staff guidance and HOD cards. */
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance>div{display:grid;gap:3px}
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance p{
  margin:0!important;
  font-size:14px!important;
  line-height:1.35!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-card-icon svg{
  width:20px!important;
  height:20px!important;
}

@media(max-width:900px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head{
    grid-template-columns:minmax(72px,1.05fr) minmax(66px,.85fr) minmax(88px,1.1fr)!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head>*{
    padding:8px 4px!important;
    font-size:13pt!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    white-space:nowrap!important;
  }
}

@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-search{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools #principalStudentEditButton{
    grid-column:2!important;
    grid-row:1!important;
    min-width:66px!important;
    min-height:40px!important;
    padding:7px 9px!important;
    justify-content:center!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-full{display:none!important}
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:inline!important}
}

/* =========================================================
   R102 — PRINCIPAL EXAM OPERATIONS + RESOURCE COMPACTION
========================================================= */

/* The school identity is the school name only; app-r29.js removes town data. */
body[data-portal-role="PRINCIPAL"] #topbarPortal{
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  font-weight:800!important;
  letter-spacing:0!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
}

/* Seven Principal home cards, with Tasks as the seventh item. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
}

/* Execution Status: larger guide and data text, without duplicate captions. */
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-legend{
  gap:8px 18px!important;
  margin:0 0 10px!important;
  padding:10px 12px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-legend span{
  font-size:14pt!important;
  font-weight:800!important;
  line-height:1.2!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-legend i{
  width:10px!important;
  height:10px!important;
  flex:0 0 10px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell>small{
  display:none!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell>b,
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-identity,
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-test-name,
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-subject-name{
  font-size:14pt!important;
  line-height:1.15!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell{
  min-height:58px!important;
  padding:8px 5px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row{
  min-height:58px!important;
}

/* CDF class selectors stay in one horizontal row on every screen. */
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-stack{
  display:grid!important;
  gap:8px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-tabs{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  width:100%!important;
  min-width:0!important;
  min-height:62px!important;
  padding:8px 5px!important;
  border:1px solid #37627e!important;
  border-radius:10px!important;
  background:#0a2944!important;
  color:#eaf6ff!important;
  text-align:center!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle.is-active{
  border-color:#3dbfe7!important;
  background:#106b9f!important;
  box-shadow:0 0 0 2px rgba(61,191,231,.16)!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle>span{
  font-size:14pt!important;
  font-weight:950!important;
  line-height:1!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle>small{
  display:block!important;
  color:#9fc9e2!important;
  font-size:10pt!important;
  font-weight:850!important;
  line-height:1!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle.is-active>small{
  color:#fff!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-body{
  margin:0!important;
  border:1px solid #294d68!important;
  border-radius:10px!important;
  background:#061a2d!important;
  padding:7px!important;
}

/* Mobile-only CDF header: Subject, Test and Date share the top row. */
body[data-portal-role="PRINCIPAL"] .exam-v3-principal-cdf-mobile-head{
  display:none;
}

/* Correct dark surfaces for every Principal execution-status layer. */
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-shell,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-shell{
  color:#e9f5ff!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] :is(.exam-v3-principal-type,.exam-v3-principal-type-body,.exam-v3-principal-type--static>.exam-v3-principal-type-body),
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] :is(.exam-v3-principal-type,.exam-v3-principal-type-body,.exam-v3-principal-type--static>.exam-v3-principal-type-body){
  border-color:#294e69!important;
  background:#05182a!important;
  color:#e9f5ff!important;
  box-shadow:none!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] :is(.exam-v3-principal-legend,.exam-v3-principal-abbreviations),
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] :is(.exam-v3-principal-legend,.exam-v3-principal-abbreviations){
  border-color:#315873!important;
  background:#08243c!important;
  color:#dcefff!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-toggle,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-type-toggle{
  border-color:#315873!important;
  background:#092844!important;
  color:#e9f5ff!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-table,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table{
  border-color:#315873!important;
  background:#061a2d!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-identity,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-identity{
  border-color:#315873!important;
  background:#09253e!important;
  color:#f3f9ff!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row{
  border-color:#315873!important;
  background:#071d31!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-complete,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-complete{background:#0b3a31!important;color:#75efbf!important}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-waiting,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-waiting{background:#453510!important;color:#ffd572!important}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-pending,
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-locked,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] :is(.exam-v3-principal-cell.is-pending,.exam-v3-principal-cell.is-locked){background:#3b2028!important;color:#ff9fa7!important}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-date,
html.eh-force-mobile body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cell.is-date{background:#0c3455!important;color:#7dcbff!important}

/* Responsive Test Pattern labels. Desktop keeps the existing wording. */
body[data-portal-role="PRINCIPAL"] .principal-pattern-label-short{display:none}

@media(max-width:1024px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }

  /* Ten Exam Operations buttons: two rows of five with no page scroll. */
  body[data-portal-role="PRINCIPAL"] .principal-mobile-hub--exams{
    padding-bottom:0!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-mobile-hub--exams .principal-app-page-head{
    margin:0 0 9px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-mobile-hub--exams .principal-hub-grid{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:5px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-mobile-hub--exams .principal-hub-item{
    min-height:82px!important;
    padding:6px 3px!important;
    gap:4px!important;
    border-radius:10px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-mobile-hub--exams .principal-hub-emoji{
    width:30px!important;
    height:30px!important;
    flex:0 0 30px!important;
    border-radius:8px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-mobile-hub--exams .principal-hub-emoji svg{
    width:17px!important;
    height:17px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-mobile-hub--exams .principal-hub-item b{
    font-size:10px!important;
    line-height:1.08!important;
    overflow-wrap:anywhere!important;
  }

  /* Five compact pattern buttons in one line. */
  body[data-portal-role="PRINCIPAL"] .principal-pattern-tabs{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:5px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-pattern-tabs button{
    min-width:0!important;
    min-height:42px!important;
    padding:6px 3px!important;
    font-size:14pt!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-pattern-label-long{display:none!important}
  body[data-portal-role="PRINCIPAL"] .principal-pattern-label-short{display:inline!important}

  /* Download and Forward stay together: one pair per row. */
  body[data-portal-role="PRINCIPAL"] .principal-pattern-detail>.actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-pattern-detail>.actions .principal-external-actions{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:6px!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-pattern-detail>.actions .button{
    width:100%!important;
    min-width:0!important;
    min-height:40px!important;
    padding:7px 5px!important;
    justify-content:center!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-pattern-table b,
  body[data-portal-role="PRINCIPAL"] .principal-pattern-table span{
    font-size:15px!important;
    line-height:1.35!important;
  }
}

@media(max-width:900px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-tabs{
    gap:5px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle{
    min-height:68px!important;
    padding:7px 3px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle>span{
    font-size:14pt!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-class-toggle>small{
    font-size:9pt!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:0!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head{
    grid-column:1 / -1!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)!important;
    align-items:center!important;
    min-height:52px!important;
    border-bottom:1px solid #315873!important;
    background:#09253e!important;
    color:#f4f9ff!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head>*{
    min-width:0!important;
    padding:8px 5px!important;
    border-right:1px solid #315873!important;
    font-size:14pt!important;
    font-weight:900!important;
    line-height:1.1!important;
    overflow-wrap:anywhere!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head>*:last-child{
    border-right:0!important;
    color:#7dcbff!important;
    text-align:center!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-subject-name,
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-test-name,
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell:nth-child(6){
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell{
    min-height:72px!important;
    padding:27px 5px 8px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell>b{
    font-size:14pt!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell::before{
    top:8px!important;
    font-size:9px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell:nth-child(4)::before{content:'DISPATCH'!important}
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell:nth-child(5)::before{content:'SCHOOL RECEIVED'!important}
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell:nth-child(7)::before{content:'TEST CONDUCTED'!important}
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row.is-cdf>.exam-v3-principal-cell:nth-child(8)::before{content:'RESULT UPLOADED'!important}
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-table-row:not(.is-cdf) .exam-v3-principal-cell>b{
    font-size:14pt!important;
  }
}

@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-legend{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-legend span{
    font-size:14pt!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-omr-links{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-omr-links .principal-external-actions{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:6px!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-omr-links .button{
    width:100%!important;
    min-width:0!important;
    min-height:40px!important;
    padding:7px 5px!important;
    justify-content:center!important;
  }
}

/* R102 final dashboard cascade: keep Tasks as the seventh card after R101. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
}
@media(max-width:1024px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* =========================================================
   R101 — APP-LIKE DENSITY, ZERO HORIZONTAL PAGE SCROLL
========================================================= */

body[data-portal-role="PRINCIPAL"],
body[data-portal-role="PRINCIPAL"] .portal-view,
body[data-portal-role="PRINCIPAL"] .portal-main,
body[data-portal-role="PRINCIPAL"] .topbar,
body[data-portal-role="PRINCIPAL"] .content,
body[data-portal-role="PRINCIPAL"] #content{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
  box-sizing:border-box!important;
}
body[data-portal-role="PRINCIPAL"] #content>*{
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}

/* Compact page headers: title and action share one row. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .page-head,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-head,
body[data-portal-role="PRINCIPAL"][data-portal-module="teachers"] .page-head{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin:0 0 10px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .page-head>div:first-child,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-head>div:first-child,
body[data-portal-role="PRINCIPAL"][data-portal-module="teachers"] .page-head>div:first-child{
  min-width:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .page-head h2,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-head h2,
body[data-portal-role="PRINCIPAL"][data-portal-module="teachers"] .page-head h2{
  margin:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .page-actions,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-actions,
body[data-portal-role="PRINCIPAL"][data-portal-module="teachers"] .page-actions{
  flex:0 0 auto!important;
  margin:0 0 0 auto!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .page-actions .button,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-actions .button,
body[data-portal-role="PRINCIPAL"][data-portal-module="teachers"] .page-actions .button{
  min-height:36px!important;
  padding:7px 11px!important;
  white-space:nowrap!important;
}

/* Dashboard: icon left, number beside it, label directly below the number. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:8px!important;
  overflow:visible!important;
  padding:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  column-gap:8px!important;
  row-gap:2px!important;
  align-items:center!important;
  min-width:0!important;
  min-height:78px!important;
  padding:10px!important;
  text-align:left!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-top{
  grid-column:1!important;
  grid-row:1 / span 2!important;
  display:block!important;
  min-width:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-icon{
  width:34px!important;
  height:34px!important;
  margin:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-top>.kpi-trend{
  display:none!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>b{
  grid-column:2!important;
  grid-row:1!important;
  width:auto!important;
  margin:0!important;
  align-self:end!important;
  font-size:25px!important;
  line-height:1!important;
  text-align:left!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>span{
  grid-column:2!important;
  grid-row:2!important;
  width:auto!important;
  margin:1px 0 0!important;
  align-self:start!important;
  font-size:14pt!important;
  line-height:1.12!important;
  text-align:left!important;
  overflow-wrap:anywhere!important;
}

/* Medal page: one compact header row, one explanatory line, no repetition. */
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-page-summary{
  margin:0 0 9px!important;
  color:#ffe3a2!important;
  font-size:14pt!important;
  font-weight:800!important;
  line-height:1.35!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-page-summary--confirmed{
  color:#bff2d1!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-page-list{
  gap:8px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-programme-section{
  margin:0!important;
  border-radius:12px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-programme-title{
  padding:8px 10px!important;
  flex-wrap:nowrap!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head{
  gap:7px!important;
  margin:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head .status-badge,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head strong,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress span,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress b{
  font-size:14pt!important;
  line-height:1.25!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress{
  gap:10px!important;
  margin:4px 0 0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-programme-title .medal-spell-label{
  flex:0 0 auto!important;
  margin-left:auto!important;
  font-size:12pt!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-panel{
  padding:8px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-grid{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-card{
  padding:8px!important;
  border-radius:10px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-candidate{
  grid-template-columns:48px minmax(0,1fr) auto!important;
  gap:6px!important;
  padding:6px 0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-rank{
  width:44px!important;
  min-width:44px!important;
  min-height:28px!important;
  padding:3px 4px!important;
  font-size:14pt!important;
  line-height:1!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-candidate strong{
  font-size:12pt!important;
  line-height:1.18!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-score{
  font-size:14pt!important;
}

/* Student strength: readable labels, dark-mode surfaces and no slider. */
body[data-portal-role="PRINCIPAL"] .principal-strength-grid{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  padding:0!important;
}
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button{
  width:100%!important;
  min-width:0!important;
  min-height:78px!important;
  padding:8px 6px!important;
}
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button span{
  display:block!important;
  font-size:14pt!important;
  font-weight:800!important;
  line-height:1.12!important;
  text-transform:none!important;
  overflow-wrap:anywhere!important;
}
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button b{
  margin-top:5px!important;
  font-size:23px!important;
  line-height:1!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"] .principal-strength-grid button,
body[data-portal-role="PRINCIPAL"][data-student-theme="dark"] .principal-strength-grid button{
  border-color:#315b78!important;
  background:#092844!important;
  color:#dcecff!important;
}
body[data-portal-role="PRINCIPAL"][data-desktop-theme="dark"] .principal-strength-grid button b,
body[data-portal-role="PRINCIPAL"][data-student-theme="dark"] .principal-strength-grid button b{
  color:#fff!important;
}

/* Principal tables fit their container instead of creating horizontal bars. */
body[data-portal-role="PRINCIPAL"] .table-wrap{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
}
body[data-portal-role="PRINCIPAL"] .table-wrap table{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
body[data-portal-role="PRINCIPAL"] .table-wrap th,
body[data-portal-role="PRINCIPAL"] .table-wrap td{
  min-width:0!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList table{
  min-width:0!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(1){width:5%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(2){width:25%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(3){width:16%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(4){width:18%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(5){width:36%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList td{
  padding:7px 6px!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-summary{
  gap:3px!important;
  overflow:visible!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList .assignment-chip{
  min-width:0!important;
  padding:3px 5px!important;
}

@media(max-width:1024px){
  /* Restore the real slide-out sidebar so the three-line button works. */
  body[data-portal-role="PRINCIPAL"] .sidebar{
    position:fixed!important;
    inset:0 auto 0 0!important;
    z-index:1500!important;
    width:min(88vw,310px)!important;
    height:100dvh!important;
    display:flex!important;
    transform:translateX(-105%)!important;
    transition:transform .2s ease!important;
    box-shadow:0 0 50px rgba(0,0,0,.36)!important;
  }
  body[data-portal-role="PRINCIPAL"] .sidebar.open{
    transform:translateX(0)!important;
  }
  body[data-portal-role="PRINCIPAL"] .drawer-backdrop:not([hidden]){
    position:fixed!important;
    inset:0!important;
    z-index:1450!important;
    display:block!important;
    background:rgba(0,7,16,.68)!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-strength-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-strength-grid button,
  body[data-portal-role="PRINCIPAL"] .principal-strength-grid button b{
    color:#fff!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-strength-grid button{
    border-color:#315b78!important;
    background:#092844!important;
  }
}

@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"] .content{
    padding:10px 10px calc(92px + env(safe-area-inset-bottom))!important;
  }
  body[data-portal-role="PRINCIPAL"] .page-head h2{
    font-size:23px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] .page-actions .button{
    max-width:48vw!important;
    padding:6px 8px!important;
    font-size:11px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-head h2{
    font-size:20px!important;
    line-height:1.08!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .page-actions .button{
    min-height:34px!important;
    padding:6px 9px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card{
    grid-template-columns:30px auto!important;
    column-gap:6px!important;
    justify-content:center!important;
    min-height:92px!important;
    padding:8px 6px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-icon{
    width:30px!important;
    height:30px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>b{
    font-size:23px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>span{
    grid-column:1 / -1!important;
    grid-row:2!important;
    font-size:14pt!important;
    text-align:center!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-strength-card{
    padding:8px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-strength-grid button{
    min-height:82px!important;
    border-radius:10px!important;
  }

  /* Generic Principal tables become vertical cards, never horizontal scrollers. */
  body[data-portal-role="PRINCIPAL"] .table-wrap table,
  body[data-portal-role="PRINCIPAL"] .table-wrap thead,
  body[data-portal-role="PRINCIPAL"] .table-wrap tbody{
    display:block!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .table-wrap thead{
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"] .table-wrap tbody{
    display:grid!important;
    gap:8px!important;
    padding:8px!important;
  }
  body[data-portal-role="PRINCIPAL"] .table-wrap tr{
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%!important;
    min-width:0!important;
    padding:7px!important;
    border:1px solid #294e68!important;
    border-radius:10px!important;
    background:#071b2f!important;
  }
  body[data-portal-role="PRINCIPAL"] .table-wrap td{
    display:grid!important;
    grid-template-columns:minmax(92px,34%) minmax(0,1fr)!important;
    align-items:center!important;
    gap:7px!important;
    width:100%!important;
    padding:6px 4px!important;
    border:0!important;
    background:transparent!important;
    font-size:12pt!important;
  }
  body[data-portal-role="PRINCIPAL"] .table-wrap td::before{
    content:attr(data-label)!important;
    display:block!important;
    color:#8fb7d2!important;
    font-size:9px!important;
    font-weight:900!important;
    letter-spacing:.035em!important;
    text-transform:uppercase!important;
  }

  /* Teachers use one dense information row: Name | Subject | Class | Actions. */
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tbody{
    gap:7px!important;
    padding:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tr{
    display:grid!important;
    grid-template-columns:minmax(70px,1.1fr) minmax(52px,.72fr) minmax(42px,.55fr) auto!important;
    gap:4px!important;
    align-items:center!important;
    padding:7px 5px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td{
    display:flex!important;
    align-items:center!important;
    width:auto!important;
    min-width:0!important;
    padding:3px!important;
    font-size:14pt!important;
    line-height:1.16!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td::before{
    display:none!important;
    content:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td:nth-child(1){
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-name{
    overflow:visible!important;
    font-size:14pt!important;
    line-height:1.16!important;
    text-overflow:clip!important;
    white-space:normal!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-summary{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:2px!important;
    overflow:visible!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .assignment-chip{
    padding:0!important;
    border:0!important;
    background:transparent!important;
    font-size:14pt!important;
    line-height:1.16!important;
    white-space:normal!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-row-actions{
    gap:3px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-icon-action{
    width:29px!important;
    min-width:29px!important;
    height:29px!important;
    border-radius:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-icon-action svg{
    width:15px!important;
    height:15px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-programme-title{
    align-items:flex-start!important;
    gap:6px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head,
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress{
    flex-wrap:wrap!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head .status-badge,
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head strong,
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress,
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress span,
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress b{
    font-size:14pt!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-grid{
    grid-template-columns:1fr!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-candidate{
    grid-template-columns:48px minmax(0,1fr) auto!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-score{
    grid-column:3!important;
    text-align:right!important;
  }
}

/* =========================================================
   R104 FINAL CASCADE — intentionally last in this stylesheet.
========================================================= */
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active{
  border-color:#45c8ef!important;
  background:linear-gradient(135deg,#087db5,#16a58f)!important;
  color:#fff!important;
  box-shadow:0 0 0 2px rgba(69,200,239,.18)!important;
}
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active :is(span,b){color:#fff!important}
body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:none!important}
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance>div{display:grid!important;gap:3px!important}
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance p{margin:0!important;font-size:14px!important;line-height:1.35!important}

@media(max-width:900px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head{
    grid-template-columns:minmax(72px,1.05fr) minmax(66px,.85fr) minmax(88px,1.1fr)!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head>*{
    padding:8px 4px!important;
    font-size:13pt!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    white-space:nowrap!important;
  }
}

@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:7px!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-search{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools #principalStudentEditButton{
    grid-column:2!important;
    grid-row:1!important;
    width:auto!important;
    min-width:66px!important;
    min-height:40px!important;
    padding:7px 9px!important;
    justify-content:center!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-full{display:none!important}
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:inline!important}
}

/* R104 final cascade — keep these rules after every cumulative legacy layer. */
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active{
  border-color:#45c8ef!important;
  background:linear-gradient(135deg,#087db5,#16a58f)!important;
  color:#fff!important;
  box-shadow:0 0 0 2px rgba(69,200,239,.18)!important;
}
body[data-portal-role="PRINCIPAL"] .principal-strength-grid button.active :is(span,b){color:#fff!important}
body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:none!important}
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance>div{display:grid!important;gap:3px!important}
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance p{margin:0!important;font-size:14px!important;line-height:1.35!important}

@media(max-width:900px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head{
    grid-template-columns:minmax(72px,1.05fr) minmax(66px,.85fr) minmax(88px,1.1fr)!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="exam-monitoring"] .exam-v3-principal-cdf-mobile-head>*{
    padding:8px 4px!important;
    font-size:13pt!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    white-space:nowrap!important;
  }
}

@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:7px!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-search{grid-column:1!important;grid-row:1!important;width:100%!important;min-width:0!important}
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools #principalStudentEditButton{
    grid-column:2!important;
    grid-row:1!important;
    width:auto!important;
    min-width:66px!important;
    min-height:40px!important;
    padding:7px 9px!important;
    justify-content:center!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-full{display:none!important}
  body[data-portal-role="PRINCIPAL"] .principal-edit-label-short{display:inline!important}
}

/* R103 — OMR Guide: desktop keeps both processes; mobile uses exclusive tabs. */
.principal-omr-guide-tabs{display:none}
.principal-guide-email{font:inherit!important;font-weight:inherit!important;color:inherit!important;letter-spacing:inherit!important}

/* R103 — Exam Schedule: next exam first, centered KPIs and compact controls. */
body[data-portal-role="PRINCIPAL"] .principal-next-exam{margin-bottom:10px!important;padding:12px 14px!important}
body[data-portal-role="PRINCIPAL"] .principal-next-exam .eyebrow{margin:0 0 6px!important;font-size:14px!important;letter-spacing:.06em!important}
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list{display:grid;gap:6px}
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list article{display:grid;grid-template-columns:minmax(150px,1.25fr) 92px 140px minmax(190px,1.5fr);align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:color-mix(in srgb,var(--panel) 82%,transparent)}
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list h3,
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list b,
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list span,
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list small{margin:0;min-width:0;font-size:14px;line-height:1.3;color:var(--text)}
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list h3{font-size:16px}
body[data-portal-role="PRINCIPAL"] .principal-next-exam-list small{color:var(--muted)}
body[data-portal-role="PRINCIPAL"] .principal-schedule-summary{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:8px!important;margin-bottom:10px!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .schedule-kpi-card{position:relative!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;min-height:108px!important;padding:12px 44px!important;text-align:center!important;border-radius:11px!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .kpi-top{position:absolute!important;left:12px!important;top:50%!important;transform:translateY(-50%)!important;margin:0!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .schedule-kpi-card>strong{font-size:28px!important;line-height:1!important;text-align:center!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .schedule-kpi-card>span{font-size:15px!important;line-height:1.2!important;text-align:center!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-card{padding:12px!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
body[data-portal-role="PRINCIPAL"] .principal-schedule-toolbar .schedule-active-view{margin:0!important;padding:8px 12px!important;white-space:nowrap;font-size:15px!important}
body[data-portal-role="PRINCIPAL"] .schedule-type-chips{display:flex!important;align-items:center!important;gap:6px!important;margin:0!important;flex-wrap:wrap!important}
body[data-portal-role="PRINCIPAL"] .schedule-type-chips .test-type-chip{min-width:54px!important;border-radius:8px!important;padding:8px 12px!important;font-size:14px!important;line-height:1!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;padding-bottom:10px;border-bottom:1px solid var(--line)}
body[data-portal-role="PRINCIPAL"] .principal-schedule-filters{display:grid!important;grid-template-columns:repeat(2,minmax(150px,230px))!important;gap:8px!important;margin:0!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-filters label{font-size:14px!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-filters select{min-height:40px!important;font-size:14px!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-actions{display:grid!important;grid-template-columns:repeat(3,max-content)!important;gap:6px!important;margin:0!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-actions .button{min-height:40px!important;font-size:14px!important;border-radius:8px!important}
body[data-portal-role="PRINCIPAL"] .principal-schedule-actions svg{width:17px!important;height:17px!important}

@media (min-width:701px){
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-guide-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-panel{display:block!important}
}

@media (max-width:700px){
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 9px}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-tabs button{display:flex;min-width:0;min-height:58px;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:7px 5px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);font:inherit;cursor:pointer}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-tabs button.is-active{border-color:#22c9ed;background:linear-gradient(135deg,#087dc0,#14b8a6);color:#fff}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-tabs span{font-size:13px;font-weight:700;line-height:1.1}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-tabs b{font-size:16px;line-height:1.15}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-guide-grid{display:block!important}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-panel{display:none!important}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-panel.is-active{display:block!important}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-card{padding:9px!important}
  :is(body[data-portal-role="PRINCIPAL"],body[data-portal-role="TEACHER"]) .principal-omr-guide-card .principal-video{margin-bottom:9px!important}

  body[data-portal-role="PRINCIPAL"] .principal-next-exam{padding:10px!important}
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list article{grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:8px}
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list h3{grid-column:1;font-size:15px}
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list b{grid-column:2;grid-row:1;text-align:right}
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list span{grid-column:1;font-size:13px}
  body[data-portal-role="PRINCIPAL"] .principal-next-exam-list small{grid-column:1 / -1;font-size:13px}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .schedule-kpi-card{min-height:100px!important;padding:10px 35px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .kpi-top{left:8px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .schedule-kpi-card>strong{font-size:27px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-summary .schedule-kpi-card>span{font-size:14px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-card{padding:8px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:7px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-toolbar .schedule-active-view{grid-row:1;padding:7px 9px!important;text-align:center!important}
  body[data-portal-role="PRINCIPAL"] .schedule-type-chips{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;width:100%!important;gap:4px!important}
  body[data-portal-role="PRINCIPAL"] .schedule-type-chips .test-type-chip{width:100%!important;min-width:0!important;padding:9px 2px!important;border-radius:7px!important;font-size:13px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-controls{grid-template-columns:1fr!important;gap:8px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-filters select{width:100%!important;min-width:0!important;font-size:14px!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important}
  body[data-portal-role="PRINCIPAL"] .principal-schedule-actions .button{min-width:0!important;padding:8px 4px!important;font-size:13px!important;white-space:nowrap!important}
}

/* R102 absolute-final cascade: Tasks remains seventh after all R101 rules. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
}
@media(max-width:1024px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
body[data-portal-role="PRINCIPAL"] #topbarPortal{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  overflow:hidden!important;
  color:#087be2!important;
  font-size:var(--principal-school-font,26px)!important;
  font-weight:800!important;
  letter-spacing:0!important;
  line-height:1.05!important;
  text-overflow:clip!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
}

/* Six Principal dashboard KPI buttons remain one centered row. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding-bottom:3px!important;
  scrollbar-width:thin!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card{
  min-width:0!important;
  min-height:106px!important;
  padding:12px 9px!important;
  text-align:center!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-top{
  justify-content:center!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-icon{
  margin-inline:auto!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>b,
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>span{
  width:100%!important;
  text-align:center!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>b{
  margin-top:8px!important;
  font-size:25px!important;
}

/* Medal Winners: four balanced class cards on desktop, clean responsive fallbacks. */
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-page-list{
  gap:10px!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-programme-section{
  margin-top:0!important;
}
body[data-portal-role="PRINCIPAL"] .medal-programme-title,
body[data-portal-role="PRINCIPAL"] .medal-status-panel{
  padding:10px!important;
}
body[data-portal-role="PRINCIPAL"] .medal-class-card{
  min-width:0!important;
  padding:9px 10px!important;
}
body[data-portal-role="PRINCIPAL"] .medal-class-card h4{
  margin-bottom:5px!important;
}
body[data-portal-role="PRINCIPAL"] .medal-candidate{
  grid-template-columns:58px minmax(0,1fr) auto!important;
  gap:6px!important;
  padding:7px 0!important;
}
body[data-portal-role="PRINCIPAL"] .medal-rank{
  min-width:54px!important;
  min-height:27px!important;
  padding:4px 6px!important;
  font-size:.70rem!important;
}
body[data-portal-role="PRINCIPAL"] .medal-candidate strong{
  font-size:.78rem!important;
  overflow-wrap:anywhere!important;
}
body[data-portal-role="PRINCIPAL"] .medal-candidate small,
body[data-portal-role="PRINCIPAL"] .medal-score{
  font-size:.72rem!important;
}
@media(min-width:1100px){
  body[data-portal-role="PRINCIPAL"] .medal-class-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:9px!important;
  }
}
@media(min-width:721px) and (max-width:1099px){
  body[data-portal-role="PRINCIPAL"] .medal-class-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

/* Teachers: one compact data row and four icon-only actions. */
body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap{
  overflow-x:auto!important;
  overflow-y:visible!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList table{
  width:100%!important;
  min-width:760px!important;
  table-layout:fixed!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(1){width:6%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(2){width:27%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(3){width:17%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(4){width:20%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th:nth-child(5){width:30%!important}
body[data-portal-role="PRINCIPAL"] #principalTeacherList th,
body[data-portal-role="PRINCIPAL"] #principalTeacherList td{
  padding:9px 8px!important;
  vertical-align:middle!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList td{
  white-space:nowrap!important;
}
body[data-portal-role="PRINCIPAL"] .principal-teacher-name{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  color:inherit!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body[data-portal-role="PRINCIPAL"] .principal-teacher-summary{
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:4px!important;
  overflow:hidden!important;
  white-space:nowrap!important;
}
body[data-portal-role="PRINCIPAL"] .principal-teacher-summary .assignment-chip{
  margin:0!important;
  padding:4px 8px!important;
  white-space:nowrap!important;
}
body[data-portal-role="PRINCIPAL"] .principal-teacher-row-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  flex-wrap:nowrap!important;
}
body[data-portal-role="PRINCIPAL"] .principal-teacher-row-actions .credential-forward-actions--icons{
  display:contents!important;
}
body[data-portal-role="PRINCIPAL"] .principal-icon-action{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  display:inline-grid!important;
  place-items:center!important;
  padding:0!important;
  border:1px solid transparent!important;
  border-radius:9px!important;
  color:#fff!important;
  cursor:pointer!important;
}
body[data-portal-role="PRINCIPAL"] .principal-icon-action svg{
  width:18px!important;
  height:18px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  stroke-width:1.9!important;
}
body[data-portal-role="PRINCIPAL"] .principal-icon-action--edit{background:#6b67e8!important}
body[data-portal-role="PRINCIPAL"] .principal-icon-action--deactivate{background:#d43e56!important}
body[data-portal-role="PRINCIPAL"] .principal-icon-action--activate{background:#148c57!important}
body[data-portal-role="PRINCIPAL"] .principal-icon-action--whatsapp{background:#139a53!important}
body[data-portal-role="PRINCIPAL"] .principal-icon-action--password{background:#d98200!important}
body[data-portal-role="PRINCIPAL"] .principal-icon-action:hover,
body[data-portal-role="PRINCIPAL"] .principal-icon-action:focus-visible{
  filter:brightness(1.12)!important;
  transform:translateY(-1px)!important;
}
body[data-portal-role="PRINCIPAL"] .principal-icon-action:disabled{
  cursor:not-allowed!important;
  filter:grayscale(.55)!important;
  opacity:.45!important;
}

/* Undo legacy mobile teacher-card stacking; retain one horizontal information row. */
@media(max-width:760px){
  body[data-portal-role="PRINCIPAL"] #principalTeacherList table{display:table!important}
  body[data-portal-role="PRINCIPAL"] #principalTeacherList thead{
    position:static!important;
    width:auto!important;
    height:auto!important;
    clip:auto!important;
    clip-path:none!important;
    overflow:visible!important;
    white-space:normal!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList tbody{display:table-row-group!important}
  body[data-portal-role="PRINCIPAL"] #principalTeacherList tr{display:table-row!important}
  body[data-portal-role="PRINCIPAL"] #principalTeacherList td{
    display:table-cell!important;
    width:auto!important;
    min-width:0!important;
    border-radius:0!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList td::before{display:none!important;content:none!important}
}

/* Students: remove empty panels and keep Edit + Search on one line. */
body[data-portal-role="PRINCIPAL"] .principal-student-existing-card{
  padding:14px!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-tools{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin-bottom:12px!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-tools h3{
  margin:0!important;
  white-space:nowrap!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  min-width:0!important;
  flex:1 1 auto!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-search{
  width:min(430px,55vw)!important;
  min-width:150px!important;
}
body[data-portal-role="PRINCIPAL"] .principal-student-search .search-box,
body[data-portal-role="PRINCIPAL"] .principal-student-search input{
  width:100%!important;
}
@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"] .principal-student-tools{
    align-items:stretch!important;
    flex-direction:column!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools{
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-inline-tools .button{
    flex:0 0 auto!important;
    padding-inline:10px!important;
  }
  body[data-portal-role="PRINCIPAL"] .principal-student-search{
    width:auto!important;
    flex:1 1 auto!important;
  }
}

/* EduHunt Staff: one guidance line and compact contact cards without repetition. */
body[data-portal-role="PRINCIPAL"] .staff-directory-contact-guidance{
  margin:10px 0 14px!important;
  padding:10px 12px!important;
  font-size:13px!important;
  line-height:1.35!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-section{
  margin-top:14px!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-section .staff-directory-grid{
  gap:9px!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple{
  min-height:82px!important;
  grid-template-columns:40px minmax(0,1fr) auto!important;
  gap:11px!important;
  padding:11px 13px!important;
  align-items:center!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-card-icon{
  width:38px!important;
  height:38px!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-card-copy>span{
  font-size:10px!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-card-copy h3{
  margin:1px 0 4px!important;
  font-size:16px!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-mobile{
  margin:0!important;
}
body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-actions{
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:7px!important;
  justify-content:flex-end!important;
}
@media(max-width:760px){
  body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple{
    grid-template-columns:38px minmax(0,1fr) auto!important;
    gap:8px!important;
    padding:10px!important;
  }
  body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-actions{
    grid-column:auto!important;
    padding-left:0!important;
  }
  body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-actions .button{
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    padding:0!important;
    overflow:hidden!important;
    font-size:0!important;
  }
  body[data-portal-role="PRINCIPAL"] .staff-directory-card--simple .staff-directory-actions .button svg{
    width:18px!important;
    height:18px!important;
  }
}

@media(max-width:900px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(6,minmax(122px,1fr))!important;
    gap:8px!important;
  }
  body[data-portal-role="PRINCIPAL"] #topbarPortal{
    font-size:var(--principal-school-font,18px)!important;
  }
}

/* R101 final cascade: intentionally last so legacy R100 mobile rules cannot
   restore sliders, oversized pills or the old teacher table. */
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  gap:8px!important;
  overflow:visible!important;
  padding:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  column-gap:8px!important;
  row-gap:2px!important;
  min-height:78px!important;
  padding:10px!important;
  text-align:left!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-top{
  grid-column:1!important;
  grid-row:1 / span 2!important;
  display:block!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-icon{
  width:34px!important;
  height:34px!important;
  margin:0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>b{
  grid-column:2!important;
  grid-row:1!important;
  width:auto!important;
  margin:0!important;
  align-self:end!important;
  font-size:25px!important;
  text-align:left!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>span{
  grid-column:2!important;
  grid-row:2!important;
  width:auto!important;
  margin:1px 0 0!important;
  align-self:start!important;
  font-size:14pt!important;
  line-height:1.12!important;
  text-align:left!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap{
  overflow-x:hidden!important;
}
body[data-portal-role="PRINCIPAL"] #principalTeacherList table{
  min-width:0!important;
  table-layout:fixed!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-candidate{
  grid-template-columns:48px minmax(0,1fr) auto!important;
  gap:6px!important;
  padding:6px 0!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-rank{
  width:44px!important;
  min-width:44px!important;
  min-height:28px!important;
  padding:3px 4px!important;
  font-size:14pt!important;
}
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head .status-badge,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-status-head strong,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress span,
body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-class-progress b{
  font-size:14pt!important;
}

@media(max-width:1024px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:7px!important;
  }
}

@media(max-width:700px){
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card{
    grid-template-columns:30px auto!important;
    column-gap:6px!important;
    justify-content:center!important;
    min-height:102px!important;
    padding:8px 6px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-icon{
    width:30px!important;
    height:30px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="dashboard"] #content>.kpi-grid .kpi-card>span{
    grid-column:1 / -1!important;
    grid-row:2!important;
    font-size:14pt!important;
    line-height:1.12!important;
    text-align:center!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap table,
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tbody{
    display:block!important;
    width:100%!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap thead{
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tbody{
    display:grid!important;
    gap:7px!important;
    padding:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap tr{
    display:grid!important;
    grid-template-columns:minmax(70px,1.1fr) minmax(52px,.72fr) minmax(42px,.55fr) auto!important;
    gap:4px!important;
    align-items:center!important;
    width:100%!important;
    padding:7px 5px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td{
    display:flex!important;
    align-items:center!important;
    width:auto!important;
    min-width:0!important;
    padding:3px!important;
    border:0!important;
    background:transparent!important;
    font-size:14pt!important;
    line-height:1.16!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td::before{
    display:none!important;
    content:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .table-wrap td:nth-child(1){
    display:none!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-name,
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .assignment-chip{
    padding:0!important;
    border:0!important;
    background:transparent!important;
    font-size:14pt!important;
    line-height:1.16!important;
    white-space:normal!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-teacher-row-actions{
    gap:3px!important;
  }
  body[data-portal-role="PRINCIPAL"] #principalTeacherList .principal-icon-action{
    width:29px!important;
    min-width:29px!important;
    height:29px!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-candidate{
    grid-template-columns:48px minmax(0,1fr) auto!important;
  }
  body[data-portal-role="PRINCIPAL"][data-portal-module="medal-selection"] .medal-score{
    grid-column:3!important;
    text-align:right!important;
  }
}
