@font-face {
  font-family: "Tajawal";
  src: url("/static/Tajawal.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --brand-ink: #0A1931;
  --brand-blue: #1A3D63;
  --brand-mid: #4A7FA7;
  --brand-pale: #B3CFE5;
  --brand-paper: #F6FAFD;
  --brand-line: #D9E6F0;
  --brand-muted: #60758B;
  --brand-shadow: 0 16px 40px rgba(10, 25, 49, .09);
  color-scheme: light;
}

html { scroll-behavior: smooth; }
body, button, input, select, textarea, option {
  font-family: "Tajawal", sans-serif !important;
}
body {
  background-color: var(--brand-paper) !important;
  color: #19334D;
  -webkit-font-smoothing: antialiased;
}
button, [role="button"], input[type="button"], input[type="submit"] {
  transition: transform .18s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
button:active, [role="button"]:active, input[type="button"]:active, input[type="submit"]:active {
  transform: translateY(1px) scale(.985);
}
:is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(74, 127, 167, .32) !important;
  outline-offset: 2px;
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  border-color: var(--brand-line);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-mid) !important;
  box-shadow: 0 0 0 4px rgba(74, 127, 167, .13) !important;
}
table {
  border-radius: 16px;
  box-shadow: var(--brand-shadow);
}
table:not(#tbl) thead th, table:not(#tbl) th {
  background: var(--brand-ink) !important;
}
tr:hover td { background-color: #EDF5FB; }
footer { color: var(--brand-muted) !important; }

/* Home attendance: refined, official and comfortable for touch. */
body:has(#absenceForm) {
  background:
    radial-gradient(ellipse at 50% -12%, rgba(179, 207, 229, .66), transparent 43%),
    linear-gradient(180deg, #EFF6FB 0%, var(--brand-paper) 52%, #EAF2F8 100%) !important;
}
#absenceForm { text-align: right; }
body:has(#absenceForm) .container {
  border: 1px solid rgba(179, 207, 229, .7);
  box-shadow: 0 24px 60px rgba(10, 25, 49, .13);
}
body:has(#absenceForm) .top-actions {
  background: linear-gradient(135deg, var(--brand-ink), var(--brand-blue)) !important;
  border: 0;
}
body:has(#absenceForm) h2 { color: #fff !important; }
body:has(#absenceForm) .header-line { background: var(--brand-pale); }
body:has(#absenceForm) .teacher-box,
body:has(#absenceForm) .field-box,
body:has(#absenceForm) .students-section,
body:has(#absenceForm) .switch-area {
  border: 1px solid var(--brand-line);
  box-shadow: 0 8px 24px rgba(10, 25, 49, .055);
}
body:has(#absenceForm) .students-heading-title { color: var(--brand-ink); }
body:has(#absenceForm) .students-count,
body:has(#absenceForm) .student-number { background: var(--brand-blue) !important; }
body:has(#absenceForm) .student-card {
  border: 1px solid #E1EAF2;
  border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
body:has(#absenceForm) .student-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-pale);
  box-shadow: 0 8px 20px rgba(26, 61, 99, .09);
}
body:has(#absenceForm) #submitBtn {
  background: linear-gradient(135deg, var(--brand-ink), var(--brand-mid)) !important;
  box-shadow: 0 12px 24px rgba(26, 61, 99, .24);
}
body:has(#absenceForm) #submitBtn:not(:disabled):hover { box-shadow: 0 16px 28px rgba(26, 61, 99, .30); }
#confirmPopup, #successPopup {
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  background: rgba(10, 25, 49, .55) !important;
}
#confirmContent, #successContent {
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 26px 75px rgba(10,25,49,.28) !important;
}

/* Existing confirmation panels and floating feedback across the system. */
#confirmBox, #noteContent, .modal-content, .modal-dialog, [role="dialog"] {
  border-radius: 22px !important;
  box-shadow: 0 24px 70px rgba(10, 25, 49, .22) !important;
}
.brand-toast {
  position: fixed;
  z-index: 2147483647;
  inset: auto 50% 26px auto;
  transform: translate(50%, 16px);
  width: max-content;
  max-width: min(92vw, 520px);
  padding: 13px 20px;
  border: 1px solid rgba(179, 207, 229, .35);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-ink), var(--brand-blue));
  color: white;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 16px 42px rgba(10, 25, 49, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s cubic-bezier(.2,.8,.2,1);
}
.brand-toast.is-visible { opacity: 1; transform: translate(50%, 0); }

@media (max-width: 700px) {
  body { font-size: 16px; }
  main, .page-wrapper, .container, .content, .wrapper { max-width: 100%; }
  .page-wrapper, .content, .wrapper { padding-inline: 12px !important; }
  table:not(#tbl) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { white-space: nowrap; }
  button, input[type="button"], input[type="submit"], .btn, a.button {
    min-height: 42px;
    touch-action: manipulation;
  }
  .brand-toast { bottom: max(18px, env(safe-area-inset-bottom)); font-size: 14px; }
  body:has(#absenceForm) .container {
    width: calc(100% - 12px);
    margin-top: max(6px, env(safe-area-inset-top));
    border-radius: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Attendance page: one calm, premium visual system. */
body:has(#absenceForm) .container {
  width: min(740px, calc(100% - 28px));
  margin: 24px auto 36px;
  padding: 0 28px 30px;
  border: 1px solid rgba(179, 207, 229, .8);
  border-radius: 30px;
  background: linear-gradient(180deg, #fff 0%, #FCFEFF 100%);
  box-shadow: 0 28px 72px rgba(10, 25, 49, .15), 0 3px 10px rgba(10, 25, 49, .035);
}
body:has(#absenceForm) .top-actions {
  min-height: 88px;
  margin: 0 -28px 24px;
  padding: 0 76px;
  border: 0;
  background: linear-gradient(118deg, #0A1931 0%, #1A3D63 68%, #315E82 100%) !important;
}
body:has(#absenceForm) .right-title h2 {
  font-size: 25px;
  letter-spacing: 0;
}
body:has(#absenceForm) .header-line {
  width: 74px;
  height: 3px;
  background: #B3CFE5;
  box-shadow: 0 0 14px rgba(179, 207, 229, .45);
}
body:has(#absenceForm) .menuIcon {
  width: 46px;
  height: 46px;
  color: #fff;
  background: rgba(246, 250, 253, .1);
  border: 1px solid rgba(246, 250, 253, .28);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
}
body:has(#absenceForm) .menuIcon:hover,
body:has(#absenceForm) .menuIcon.open {
  background: rgba(246, 250, 253, .19);
  border-color: rgba(246, 250, 253, .48);
}
body:has(#absenceForm) .burger span { background: #fff; }
body:has(#absenceForm) .logoutIcon {
  position: absolute;
  top: 50%;
  right: 18px;
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 1px solid rgba(246, 250, 253, .28);
  border-radius: 14px;
  background: rgba(246, 250, 253, .1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
  color: #fff;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
body:has(#absenceForm) .logoutIcon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body:has(#absenceForm) .logoutIcon:hover,
body:has(#absenceForm) .logoutIcon:focus-visible {
  transform: translateY(-50%) scale(1.04);
  border-color: rgba(246, 250, 253, .48);
  background: rgba(246, 250, 253, .19);
}
body:has(#absenceForm) .teacher-box {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 17px 19px;
  border: 1px solid rgba(179, 207, 229, .35);
  border-radius: 20px;
  background: linear-gradient(118deg, #0A1931 0%, #1A3D63 72%, #315E82 100%);
  box-shadow: 0 14px 28px rgba(10, 25, 49, .16);
}
body:has(#absenceForm) .teacher-box::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  left: -62px;
  top: -95px;
  border: 1px solid rgba(179, 207, 229, .19);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(179, 207, 229, .045), 0 0 0 38px rgba(179, 207, 229, .035);
  pointer-events: none;
}
body:has(#absenceForm) .teacher-caption {
  color: #B3CFE5;
  font-size: 12px;
  letter-spacing: .15px;
}
body:has(#absenceForm) .teacher-name-display { font-size: 18px; }
body:has(#absenceForm) .selection-grid {
  gap: 14px;
  margin-bottom: 17px;
}
body:has(#absenceForm) .field-box {
  padding: 14px;
  border: 1px solid #E1EAF2;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #FBFDFF);
  box-shadow: 0 8px 20px rgba(10, 25, 49, .045);
}
body:has(#absenceForm) .field-box label {
  margin-bottom: 9px;
  color: #1A3D63;
  font-size: 14px;
}
body:has(#absenceForm) .field-box select {
  min-height: 50px;
  border: 1px solid #D4E2EE;
  border-radius: 14px;
  background-color: #F8FBFE;
  color: #19334D;
  font-size: 15px;
  font-weight: 700;
}
body:has(#absenceForm) .switch-area {
  margin: 0 0 19px;
  padding: 0;
  border: 0;
  box-shadow: none;
}
body:has(#absenceForm) .switch-label {
  min-height: 46px;
  gap: 10px;
  padding: 10px 15px;
  border: 1px solid #D6E5F0;
  border-radius: 14px;
  background: #F3F8FC;
  color: #1A3D63;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
body:has(#absenceForm) .switch-label:has(#noAbsenceToggle:checked) {
  background: #EAF4FB;
  border-color: #9CBBD3;
  box-shadow: 0 5px 14px rgba(26, 61, 99, .08);
}
body:has(#absenceForm) .students-section {
  margin-top: 0;
  padding: 17px;
  border: 1px solid #E1EAF2;
  border-radius: 20px;
  background: #FCFEFF;
  box-shadow: 0 10px 24px rgba(10, 25, 49, .05);
}
body:has(#absenceForm) .students-heading {
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid #E6EEF5;
}
body:has(#absenceForm) .students-heading-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #0A1931;
  font-size: 17px;
}
body:has(#absenceForm) .students-heading-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 99px;
  background: linear-gradient(180deg, #4A7FA7, #1A3D63);
}
body:has(#absenceForm) .students-count {
  min-width: 38px;
  padding: 5px 11px;
  border: 1px solid #C9DCEB;
  background: #EAF3FA !important;
  color: #1A3D63;
  font-size: 12px;
}
body:has(#absenceForm) #studentCards { gap: 9px; }
body:has(#absenceForm) .student-card {
  min-height: 60px;
  padding: 10px 12px;
  border-color: #E0E9F1;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(10, 25, 49, .035);
}
body:has(#absenceForm) .student-card:hover {
  border-color: #B3CFE5;
  box-shadow: 0 9px 20px rgba(26, 61, 99, .09);
}
body:has(#absenceForm) .student-number {
  border-radius: 11px;
  background: #EAF3FA !important;
  color: #1A3D63;
}
body:has(#absenceForm) .student-card.selected {
  border-color: #DFAFB6;
  background: linear-gradient(105deg, #FFF8F8, #fff 62%);
  box-shadow: 0 7px 16px rgba(180, 35, 24, .07);
}
body:has(#absenceForm) .student-card.late-selected {
  border-color: #E6C987;
  background: linear-gradient(105deg, #FFFBF2, #fff 62%);
}
body:has(#absenceForm) .students-empty {
  padding: 26px 16px;
  border-color: #C8D9E7;
  background: linear-gradient(135deg, #F6FAFD, #FCFEFF);
  color: #60758B;
}
body:has(#absenceForm) #submitBtn {
  min-height: 56px;
  margin-top: 18px;
  border: 1px solid rgba(179, 207, 229, .35);
  border-radius: 16px;
  background: linear-gradient(110deg, #0A1931 0%, #1A3D63 62%, #4A7FA7 100%) !important;
  box-shadow: 0 13px 27px rgba(10, 25, 49, .2);
  font-size: 16px;
  letter-spacing: .1px;
}
body:has(#absenceForm) #submitBtn:not(:disabled):hover {
  box-shadow: 0 17px 32px rgba(10, 25, 49, .26);
}
body:has(#absenceForm) #submitBtn:disabled {
  border-color: #D8E2EB;
  background: linear-gradient(110deg, #B9C7D4, #CBD7E1) !important;
  color: #F8FBFD;
  opacity: 1;
}
body:has(#absenceForm) .status {
  border-radius: 15px;
  box-shadow: 0 8px 18px rgba(10, 25, 49, .06);
}
@media (max-width: 640px) {
  body:has(#absenceForm) .container {
    width: calc(100% - 14px);
    margin: max(7px, env(safe-area-inset-top)) auto 22px;
    padding: 0 13px 20px;
    border-radius: 24px;
  }
  body:has(#absenceForm) .top-actions { margin: 0 -13px 16px; min-height: 74px; }
  body:has(#absenceForm) .right-title h2 { font-size: 21px; }
  body:has(#absenceForm) .teacher-box { margin-bottom: 14px; padding: 14px 15px; border-radius: 17px; }
  body:has(#absenceForm) .selection-grid { gap: 9px; margin-bottom: 13px; }
  body:has(#absenceForm) .field-box { padding: 11px; border-radius: 15px; }
  body:has(#absenceForm) .field-box select { min-height: 47px; font-size: 14px; }
  body:has(#absenceForm) .students-section { padding: 13px 11px; border-radius: 17px; }
  body:has(#absenceForm) .student-card { min-height: 55px; padding: 8px; }
  body:has(#absenceForm) .student-name-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
  }
  body:has(#absenceForm) .student-actions { flex: 0 0 auto; }
  body:has(#absenceForm) #submitBtn { min-height: 52px; font-size: 15px; }
}

/* Student violations: matching school identity with clearer selection cards. */
body:has(#violationForm) {
  background:
    radial-gradient(ellipse at 88% -12%, rgba(179, 207, 229, .62), transparent 40%),
    linear-gradient(180deg, #EFF6FB 0%, #F6FAFD 56%, #EAF2F8 100%) !important;
}
body:has(#violationForm) .wrap { max-width: 1200px; }
body:has(#violationForm) .hero {
  min-height: 158px;
  border: 1px solid rgba(179, 207, 229, .3);
  border-radius: 25px;
  background: linear-gradient(118deg, #0A1931 0%, #1A3D63 70%, #315E82 100%);
  box-shadow: 0 22px 52px rgba(10, 25, 49, .19);
}
body:has(#violationForm) .eyebrow { color: #B3CFE5; }
body:has(#violationForm) .eyebrow::before { background: #4A7FA7; }
body:has(#violationForm) .hero p { color: #D8E7F3; }
body:has(#violationForm) .hero-back {
  min-height: 44px;
  border-radius: 13px;
  border-color: rgba(179, 207, 229, .38);
  background: rgba(246, 250, 253, .1);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
body:has(#violationForm) .hero-back:hover {
  transform: translateY(-2px);
  background: rgba(246, 250, 253, .18);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}
body:has(#violationForm) .card {
  padding: 23px;
  border-color: #DCE8F1;
  border-radius: 21px;
  background: linear-gradient(180deg, #fff 0%, #FCFEFF 100%);
  box-shadow: 0 14px 34px rgba(10, 25, 49, .065);
}
body:has(#violationForm) .section-head h2 { color: #0A1931; }
body:has(#violationForm) .section-head p { color: #60758B; }
body:has(#violationForm) .section-tag {
  border-color: #C9DCEB;
  background: #EAF3FA;
  color: #1A3D63;
}
body:has(#violationForm) .field select,
body:has(#violationForm) .field input {
  height: 50px;
  border-color: #D4E2EE;
  border-radius: 13px;
  background: #F8FBFE;
  color: #19334D;
}
body:has(#violationForm) .field select:focus,
body:has(#violationForm) .field input:focus {
  border-color: #4A7FA7;
  box-shadow: 0 0 0 4px rgba(74, 127, 167, .14);
}
body:has(#violationForm) .rows { gap: 13px; }
body:has(#violationForm) .student {
  padding: 16px 17px 17px;
  border-color: #DFE9F1;
  border-radius: 17px;
  background: linear-gradient(180deg, #fff, #FCFEFF);
  box-shadow: 0 7px 19px rgba(10, 25, 49, .045);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
body:has(#violationForm) .student:hover {
  transform: translateY(-2px);
  border-color: #B3CFE5;
  box-shadow: 0 12px 26px rgba(26, 61, 99, .09);
}
body:has(#violationForm) .student.selected {
  border-color: #9ABBD4;
  background: linear-gradient(115deg, #F0F7FC, #fff 72%);
  box-shadow: inset -3px 0 #4A7FA7, 0 9px 22px rgba(26, 61, 99, .08);
}
body:has(#violationForm) .student-head { color: #0A1931; }
body:has(#violationForm) .student-index {
  width: 32px;
  height: 32px;
  border: 1px solid #D3E2ED;
  border-radius: 11px;
  background: #EAF3FA;
  color: #1A3D63;
}
body:has(#violationForm) .choice span {
  min-height: 39px;
  padding: 9px 13px;
  border-color: #D8E5EF;
  border-radius: 11px;
  background: #F7FAFD;
  color: #36516C;
}
body:has(#violationForm) .choice:hover span {
  border-color: #AAC6DC;
  background: #EDF5FA;
}
body:has(#violationForm) .choice input:checked + span {
  border-color: #1A3D63;
  background: linear-gradient(120deg, #0A1931, #1A3D63);
  color: #fff;
  box-shadow: 0 7px 15px rgba(26, 61, 99, .19);
}
body:has(#violationForm) .other-field {
  border-color: #D4E2EE;
  border-radius: 12px;
  background: #FBFDFF;
}
body:has(#violationForm) .save-bar {
  bottom: max(10px, env(safe-area-inset-bottom));
  border-color: rgba(179, 207, 229, .8);
  border-radius: 17px;
  background: rgba(246, 250, 253, .96);
  box-shadow: 0 16px 38px rgba(10, 25, 49, .16);
}
body:has(#violationForm) .save-bar strong { color: #0A1931; }
body:has(#violationForm) .save-bar small { color: #60758B; }
body:has(#violationForm) .save {
  min-height: 48px;
  padding-inline: 22px;
  border-color: #0A1931;
  border-radius: 13px;
  background: linear-gradient(115deg, #0A1931, #1A3D63 68%, #4A7FA7);
  box-shadow: 0 9px 20px rgba(10, 25, 49, .2);
  transition: transform .18s ease, box-shadow .18s ease;
}
body:has(#violationForm) .save:hover {
  transform: translateY(-2px);
  filter: none;
  box-shadow: 0 13px 26px rgba(10, 25, 49, .24);
}
@media (max-width: 760px) {
  body:has(#violationForm) .hero { border-radius: 20px; }
  body:has(#violationForm) .card { padding: 16px; border-radius: 17px; }
  body:has(#violationForm) .student { padding: 14px 13px; }
  body:has(#violationForm) .save-bar { gap: 9px; }
  body:has(#violationForm) .save-actions { width: 100%; }
  body:has(#violationForm) .save-actions .save { width: 100%; }
}

/* Student affairs dashboard: make violation records read like polished cards on phones. */
.student-affairs-page {
  background:
    radial-gradient(ellipse at 92% -10%, rgba(179, 207, 229, .58), transparent 40%),
    linear-gradient(180deg, #EFF6FB 0%, #F6FAFD 58%, #EAF2F8 100%) !important;
  color: #19334D;
}
.student-affairs-page .wrap { max-width: 1320px; }
.student-affairs-page .hero {
  border: 1px solid rgba(179, 207, 229, .34);
  border-radius: 25px;
  background: linear-gradient(118deg, #0A1931 0%, #1A3D63 70%, #315E82 100%);
  box-shadow: 0 22px 52px rgba(10, 25, 49, .18);
}
.student-affairs-page .eyebrow {
  border-color: rgba(179, 207, 229, .3);
  background: rgba(179, 207, 229, .12);
  color: #D8E7F3;
}
.student-affairs-page .eyebrow::before { background: #4A7FA7; }
.student-affairs-page .hero p { color: #D8E7F3; }
.student-affairs-page .links a {
  min-height: 44px;
  border-color: rgba(179, 207, 229, .36);
  border-radius: 13px;
  background: rgba(246, 250, 253, .1);
}
.student-affairs-page .links a.primary {
  border-color: #EAF3FA;
  background: #EAF3FA;
  color: #1A3D63;
}
.student-affairs-page .card {
  border-color: #DCE8F1;
  border-radius: 21px;
  background: linear-gradient(180deg, #fff, #FCFEFF);
  box-shadow: 0 14px 34px rgba(10, 25, 49, .065);
}
.student-affairs-page .section-title h2 { color: #0A1931; }
.student-affairs-page .section-title p { color: #60758B; }
.student-affairs-page .total-pill {
  border: 1px solid #C9DCEB;
  background: #EAF3FA;
  color: #1A3D63;
}
.student-affairs-page .field label { color: #36516C; }
.student-affairs-page input,
.student-affairs-page select,
.student-affairs-page textarea {
  border-color: #D4E2EE;
  border-radius: 13px;
  background: #F8FBFE;
  color: #19334D;
}
.student-affairs-page input:focus,
.student-affairs-page select:focus,
.student-affairs-page textarea:focus {
  border-color: #4A7FA7;
  box-shadow: 0 0 0 4px rgba(74, 127, 167, .14);
}
.student-affairs-page .btn:not(.secondary):not(.danger) {
  background: linear-gradient(115deg, #0A1931, #1A3D63 70%, #4A7FA7);
  box-shadow: 0 8px 18px rgba(10, 25, 49, .15);
}
.student-affairs-page .btn.secondary {
  border: 1px solid #D5E3EE;
  background: #F1F6FA;
  color: #1A3D63;
}
.student-affairs-page .table-wrap {
  border-color: #DCE8F1;
  border-radius: 17px;
  box-shadow: 0 7px 20px rgba(10, 25, 49, .045);
}
.student-affairs-page th {
  background: #0A1931 !important;
  color: #fff;
}
.student-affairs-page tbody tr:hover { background: #F1F7FB; }
.student-affairs-page .student-link {
  color: #1A3D63;
  text-decoration-color: #9ABBD4;
}
.student-affairs-page .student-link:hover { color: #4A7FA7; }
.student-affairs-page .count {
  border: 1px solid #CDE3D8;
  background: #EDF7F1;
  color: #2C7655;
}
.student-affairs-page .count.repeat {
  border-color: #EBD8B5;
  background: #FFF8EA;
  color: #94651C;
}
.student-affairs-page .modal-card {
  border: 1px solid rgba(179, 207, 229, .58);
  border-radius: 22px;
}
.student-affairs-page .modal-head {
  background: linear-gradient(118deg, #0A1931, #1A3D63 76%, #315E82);
}
.student-affairs-page .detail-item {
  border-color: #DCE8F1;
  border-right-color: #4A7FA7;
  border-radius: 14px;
  background: #FBFDFF;
}
.student-affairs-page .teacher-chip {
  border: 1px solid #D5E5EF;
  background: #EFF6FB;
  color: #1A3D63;
}
@media (max-width: 680px) {
  .student-affairs-page .hero { border-radius: 20px; }
  .student-affairs-page .card { border-radius: 18px; }
  .student-affairs-page .table-wrap {
    overflow: visible;
    border: 0;
    box-shadow: none;
  }
  .student-affairs-page table {
    display: block;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: none;
  }
  .student-affairs-page tbody { gap: 13px; }
  .student-affairs-page tbody tr,
  .student-affairs-page tbody tr:nth-child(even) {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 14px;
    padding: 14px 15px 12px;
    border: 1px solid #DCE8F1;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, #FCFEFF);
    box-shadow: 0 9px 23px rgba(10, 25, 49, .065);
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .student-affairs-page tbody tr:hover {
    transform: translateY(-1px);
    background: #fff;
    box-shadow: 0 12px 27px rgba(10, 25, 49, .09);
  }
  .student-affairs-page td {
    min-width: 0;
    padding: 9px 0;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
    white-space: normal;
    color: #19334D;
  }
  .student-affairs-page td::before {
    margin-bottom: 5px;
    color: #71859A;
    font-size: 10px;
    letter-spacing: .1px;
  }
  .student-affairs-page td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 2px 0 11px;
    margin-bottom: 3px;
    border-bottom: 1px solid #E7EEF4;
  }
  .student-affairs-page td:nth-child(2)::before { color: #4A7FA7; }
  .student-affairs-page td:nth-child(2) .student-link {
    display: block;
    width: 100%;
    color: #0A1931;
    font-size: 16px;
    line-height: 1.5;
    text-align: right;
    text-decoration: none;
    overflow-wrap: anywhere;
  }
  .student-affairs-page td:nth-child(1) { grid-column: 1; grid-row: 2; }
  .student-affairs-page td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .student-affairs-page td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .student-affairs-page td:nth-child(5) { grid-column: 2; grid-row: 3; }
  .student-affairs-page td:nth-child(6) {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 4px;
    padding: 10px 0 0;
    border-top: 1px solid #E7EEF4;
    text-align: left;
  }
  .student-affairs-page td:nth-child(6)::before { display: none; }
  .student-affairs-page td:nth-child(6) .btn { min-height: 39px; border-radius: 11px; }
}

/* Attendance submenu drawer. */
body:has(#sideOverlay) .sideOverlay {
  background: rgba(4, 13, 27, .62);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}
body:has(#sideOverlay) .sideOverlay.open {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body:has(#sideOverlay) .sideMenu {
  width: 350px;
  max-width: min(90vw, 390px);
  background: linear-gradient(180deg, #F6FAFD 0%, #EEF5FA 100%);
  border-right: 1px solid rgba(179, 207, 229, .8);
  box-shadow: 24px 0 70px rgba(4, 13, 27, .3);
}
body:has(#sideOverlay) .sideOverlay.open .sideMenu {
  box-shadow: 28px 0 82px rgba(4, 13, 27, .34);
}
body:has(#sideOverlay) .sideMenu::after {
  width: 2px;
  background: linear-gradient(180deg, transparent, #4A7FA7, #B3CFE5, transparent);
  opacity: .85;
}
body:has(#sideOverlay) .sideHead {
  min-height: 132px;
  padding: max(24px, env(safe-area-inset-top)) 20px 18px;
  border-bottom: 1px solid rgba(179, 207, 229, .28);
  background:
    radial-gradient(circle at 12% 15%, rgba(179, 207, 229, .18), transparent 30%),
    linear-gradient(125deg, #0A1931 0%, #1A3D63 72%, #315E82 100%);
}
body:has(#sideOverlay) .sideTitle {
  font-size: 18px;
  letter-spacing: .1px;
}
body:has(#sideOverlay) .sideTitle > span { gap: 12px; }
body:has(#sideOverlay) .sideTitle > span::before {
  width: 9px;
  height: 9px;
  flex-basis: 9px;
  background: #B3CFE5;
  box-shadow: 0 0 0 6px rgba(179, 207, 229, .16), 0 0 18px rgba(179, 207, 229, .5);
}
body:has(#sideOverlay) .sideSubtitle {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  color: rgba(232, 242, 250, .78);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease .18s, transform .35s ease .18s;
}
body:has(#sideOverlay.open) .sideSubtitle {
  opacity: 1;
  transform: translateY(0);
}
body:has(#sideOverlay) .closeX {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(246, 250, 253, .12);
  border-color: rgba(246, 250, 253, .28);
}
body:has(#sideOverlay) .closeX:hover { background: rgba(246, 250, 253, .22); }
body:has(#sideOverlay) .sideBody {
  padding: 17px 13px max(18px, env(safe-area-inset-bottom));
  scrollbar-color: #B3CFE5 transparent;
}
body:has(#sideOverlay) .sideBody::before {
  content: "الخدمات المتاحة";
  margin: 1px 7px 12px;
  color: #60758B;
  font-size: 11px;
  letter-spacing: .15px;
}
body:has(#sideOverlay) .sideLink {
  min-height: 66px;
  gap: 12px;
  margin: 9px 0;
  padding: 14px 14px;
  border: 1px solid #DCE8F1;
  border-radius: 17px;
  background: linear-gradient(135deg, #fff, #FBFDFF);
  box-shadow: 0 8px 20px rgba(10, 25, 49, .055);
  color: #19334D;
  font-size: 14px;
}
body:has(#sideOverlay) .sideLink:hover {
  border-color: #B3CFE5;
  background: linear-gradient(135deg, #fff, #F0F7FC);
  box-shadow: 0 13px 26px rgba(26, 61, 99, .11);
  transform: translateX(3px) scale(1.005);
}
body:has(#sideOverlay) .sideLink::before {
  width: 4px;
  background: linear-gradient(180deg, #4A7FA7, #1A3D63);
}
body:has(#sideOverlay) .sideLink > span:first-child {
  line-height: 1.55;
}
body:has(#sideOverlay) .sideNote {
  color: #6B8297;
  font-size: 10px;
}
body:has(#sideOverlay) .extMark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: #EAF3FA;
  color: #1A3D63;
}
@media (max-width: 640px) {
  body:has(#sideOverlay) .sideMenu {
    width: min(350px, 90vw);
    max-width: 90vw;
    height: 100dvh;
  }
  body:has(#sideOverlay) .sideHead { min-height: 124px; }
  body:has(#sideOverlay) .sideLink { min-height: 64px; padding: 13px 12px; }
}

/* Student health transfer: calm, formal and easy to complete on a phone. */
body:has(#healthClass) {
  background:
    radial-gradient(ellipse at 92% -12%, rgba(179, 207, 229, .62), transparent 41%),
    linear-gradient(180deg, #EFF6FB 0%, #F6FAFD 58%, #EAF2F8 100%) !important;
  color: #19334D;
}
body:has(#healthClass) .page { width: min(760px, 100%); }
body:has(#healthClass) .header {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(179, 207, 229, .34);
  border-radius: 24px;
  padding: 24px 26px;
  background: linear-gradient(118deg, #0A1931 0%, #1A3D63 72%, #315E82 100%);
  box-shadow: 0 22px 48px rgba(10, 25, 49, .2);
}
body:has(#healthClass) .header::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  left: -90px;
  top: -145px;
  border: 1px solid rgba(179, 207, 229, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(179, 207, 229, .055), 0 0 0 48px rgba(179, 207, 229, .04);
  pointer-events: none;
}
body:has(#healthClass) .brand { position: relative; z-index: 1; gap: 15px; }
body:has(#healthClass) .icon {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(179, 207, 229, .35);
  border-radius: 18px;
  background: rgba(246, 250, 253, .13);
  box-shadow: inset 0 1px rgba(255,255,255,.16), 0 8px 18px rgba(0,0,0,.12);
}
body:has(#healthClass) h1 { color: #fff; font-size: 23px; }
body:has(#healthClass) .header p { color: #D8E7F3; font-size: 13px; }
body:has(#healthClass) .card {
  margin-top: 18px;
  padding: 23px;
  border: 1px solid #DCE8F1;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #FCFEFF);
  box-shadow: 0 15px 36px rgba(10, 25, 49, .075);
}
body:has(#healthClass) .welcome {
  position: relative;
  margin-bottom: 21px;
  padding: 15px 17px;
  border: 1px solid #D1E2EF;
  border-right: 4px solid #4A7FA7;
  border-radius: 15px;
  background: linear-gradient(110deg, #F5F9FC, #EAF3FA);
  color: #1A3D63;
  font-size: 14px;
  line-height: 1.8;
}
body:has(#healthClass) label {
  margin: 16px 0 8px;
  color: #294A68;
  font-size: 13px;
}
body:has(#healthClass) select,
body:has(#healthClass) input {
  min-height: 51px;
  padding: 12px 14px;
  border-color: #D4E2EE;
  border-radius: 14px;
  background: #F8FBFE;
  color: #19334D;
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
body:has(#healthClass) select:focus,
body:has(#healthClass) input:focus {
  border-color: #4A7FA7;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(74, 127, 167, .14);
}
body:has(#healthClass) #individualSubjectWrap { margin-top: 12px !important; }
body:has(#healthClass) .btns { gap: 11px; margin-top: 22px; }
body:has(#healthClass) button.send,
body:has(#healthClass) a.btn.back {
  min-height: 50px;
  border-radius: 14px;
  font-size: 14px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
body:has(#healthClass) button.send {
  border: 1px solid #0A1931;
  background: linear-gradient(115deg, #0A1931, #1A3D63 70%, #4A7FA7);
  box-shadow: 0 10px 22px rgba(10, 25, 49, .2);
}
body:has(#healthClass) a.btn.back {
  border: 1px solid #D3E1EC !important;
  background: #F1F6FA;
  color: #1A3D63;
}
body:has(#healthClass) button.send:hover,
body:has(#healthClass) a.btn.back:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 27px rgba(10, 25, 49, .17);
}
body:has(#healthClass) .note { color: #71859A; line-height: 1.8; }
body:has(#healthClass) .status { border-radius: 14px; line-height: 1.8; }
body:has(#healthClass) .confirm-overlay { background: rgba(4, 13, 27, .62); backdrop-filter: blur(9px); }
body:has(#healthClass) .confirm-modal {
  border: 1px solid #DCE8F1;
  border-radius: 24px;
  box-shadow: 0 28px 78px rgba(4, 13, 27, .3);
}
body:has(#healthClass) .confirm-icon {
  border: 1px solid #D4E4EF;
  background: linear-gradient(145deg, #EFF6FB, #DFECF5);
  color: #1A3D63;
}
body:has(#healthClass) .confirm-info {
  border-color: #DCE8F1;
  background: #F7FAFD;
}
body:has(#healthClass) .confirm-info b { color: #1A3D63; }
body:has(#healthClass) .confirm-submit {
  background: linear-gradient(115deg, #0A1931, #1A3D63 70%, #4A7FA7);
}
@media (max-width: 520px) {
  body:has(#absenceForm) .logoutIcon { right: 13px; width: 42px; height: 42px; }
  body:has(#healthClass) { padding: max(10px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom)); }
  body:has(#healthClass) .header { padding: 17px; border-radius: 20px; }
  body:has(#healthClass) .icon { width: 49px; height: 49px; border-radius: 15px; }
  body:has(#healthClass) h1 { font-size: 19px; }
  body:has(#healthClass) .card { padding: 16px; border-radius: 18px; }
  body:has(#healthClass) .welcome { padding: 12px 13px; font-size: 13px; }
  body:has(#healthClass) .btns { gap: 9px; }
}

/* Attendance drawer: icon-led navigation inspired by the supplied side-drawer reference. */
body:has(#sideOverlay) .sideHeadIcon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #B3CFE5;
}
body:has(#sideOverlay) .sideTitle > span::before { display: none; }
body:has(#sideOverlay) .sideLink {
  justify-content: flex-start;
  text-align: right;
}
body:has(#sideOverlay) button.sideLink {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
}
body:has(#sideOverlay) .sideLinkMain {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
body:has(#sideOverlay) .sideIcon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #DCE8F1;
  border-radius: 14px;
  background: linear-gradient(145deg, #F5F9FC, #EAF2F8);
  color: #1A3D63;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
body:has(#sideOverlay) .sideIcon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body:has(#sideOverlay) .sideLabel {
  min-width: 0;
  color: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}
body:has(#sideOverlay) .sideLink.myScheduleLink {
  border-color: rgba(74, 127, 167, .46);
  background: linear-gradient(115deg, #4A7FA7, #2D6795 78%, #1A3D63);
  box-shadow: 0 11px 23px rgba(26, 61, 99, .2);
  color: #fff;
}
body:has(#sideOverlay) .myScheduleLink .sideIcon {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .16);
  color: #fff;
}
body:has(#sideOverlay) .myScheduleLink:hover {
  border-color: #4A7FA7;
  background: linear-gradient(115deg, #568bb2, #376f9b 78%, #234a70);
}
body:has(#sideOverlay) .sideLink.logoutLink {
  margin-top: 16px;
  border-color: #F0DFDF;
  background: linear-gradient(135deg, #fff, #FFFAFA);
  color: #8D3636;
}
body:has(#sideOverlay) .logoutLink .sideIcon {
  border-color: #F0DFDF;
  background: #FFF3F2;
  color: #A63838;
}
body:has(#sideOverlay) .sideLink.logoutLink::before { background: linear-gradient(180deg, #D16B67, #A63838); }
body:has(#sideOverlay) .closeX svg { width: 19px; height: 19px; }

/* Teacher weekly schedule opened from the drawer. */
body:has(#absenceForm) .teacherScheduleOverlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(4, 13, 27, .64);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .24s ease, visibility .24s ease, backdrop-filter .24s ease;
}
body:has(#absenceForm) .teacherScheduleOverlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body:has(#absenceForm) .teacherSchedulePanel {
  width: min(1120px, 100%);
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(179, 207, 229, .72);
  border-radius: 25px;
  background: #F6FAFD;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
  transform: translateY(12px) scale(.985);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
body:has(#absenceForm) .teacherScheduleOverlay.open .teacherSchedulePanel { transform: translateY(0) scale(1); }
body:has(#absenceForm) .teacherScheduleHead {
  display: flex;
  min-height: 92px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
  background: linear-gradient(118deg, #0A1931, #1A3D63 72%, #315E82);
  color: #fff;
}
body:has(#absenceForm) .teacherScheduleEyebrow { color: #B3CFE5; font-size: 11px; font-weight: 700; }
body:has(#absenceForm) .teacherScheduleHead h2 { margin: 3px 0 0; color: #fff; font-size: 22px; font-weight: 800; }
body:has(#absenceForm) .teacherScheduleClose {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 250, 253, .28);
  border-radius: 14px;
  background: rgba(246, 250, 253, .11);
  color: #fff;
  cursor: pointer;
}
body:has(#absenceForm) .teacherScheduleClose svg { width: 20px; height: 20px; }
body:has(#absenceForm) .teacherScheduleClose:hover { background: rgba(246, 250, 253, .2); }
body:has(#absenceForm) .teacherScheduleBody { min-height: 0; overflow: auto; padding: 20px 22px 24px; }
body:has(#absenceForm) .teacherScheduleName {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  color: #0A1931;
  font-size: 16px;
  font-weight: 800;
}
body:has(#absenceForm) .teacherScheduleAvatar {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid #DCE8F1;
  border-radius: 13px;
  background: #EAF2F8;
  color: #1A3D63;
}
body:has(#absenceForm) .teacherScheduleAvatar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
body:has(#absenceForm) .scheduleLegend { display: flex; flex-wrap: wrap; gap: 9px 16px; margin: 0 0 13px; color: #60758B; font-size: 12px; font-weight: 700; }
body:has(#absenceForm) .scheduleLegend > span { display: inline-flex; align-items: center; gap: 7px; }
body:has(#absenceForm) .scheduleLegend i { width: 10px; height: 10px; display: inline-block; border-radius: 4px; }
body:has(#absenceForm) .regularLegend { background: #DDEBF5; }
body:has(#absenceForm) .reserveLegend { background: #E7B458; }
body:has(#absenceForm) .scheduleTableScroll { max-width: 100%; overflow: auto; border: 1px solid #DCE8F1; border-radius: 17px; background: #fff; -webkit-overflow-scrolling: touch; }
body:has(#absenceForm) .teacherScheduleTable {
  width: 100%;
  min-width: 790px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  box-shadow: none;
  color: #19334D;
  font-size: 12px;
}
body:has(#absenceForm) .teacherScheduleTable th,
body:has(#absenceForm) .teacherScheduleTable td {
  width: 96px;
  min-height: 55px;
  padding: 7px;
  border: 0;
  border-left: 1px solid #E7EEF4;
  border-bottom: 1px solid #E7EEF4;
  background: #fff !important;
  color: #19334D !important;
  text-align: center;
  vertical-align: middle;
  white-space: normal !important;
}
body:has(#absenceForm) .teacherScheduleTable th:first-child { width: 98px; }
body:has(#absenceForm) .teacherScheduleTable thead th { background: #EFF5FA !important; color: #1A3D63 !important; font-weight: 800; }
body:has(#absenceForm) .teacherScheduleTable tbody th { position: sticky; right: 0; z-index: 1; background: #F7FAFD !important; font-weight: 800; }
body:has(#absenceForm) .scheduleCellEntries { display: grid; gap: 5px; }
body:has(#absenceForm) .scheduleEntry { display: grid; gap: 3px; padding: 7px 6px; border: 1px solid #DCE8F1; border-radius: 10px; background: #F0F6FA; color: #1A3D63; line-height: 1.45; overflow-wrap: anywhere; }
body:has(#absenceForm) .scheduleEntry strong { font-size: 11px; font-weight: 800; }
body:has(#absenceForm) .scheduleEntry span { font-size: 11px; font-weight: 700; }
body:has(#absenceForm) .scheduleEntry small { color: #71879C; font-size: 10px; }
body:has(#absenceForm) .scheduleEntry.reserve { border-color: #F0D39B; background: linear-gradient(145deg, #FFF6E2, #FFEFCB); color: #77501A; box-shadow: inset 3px 0 #D79A35; }
body:has(#absenceForm) .scheduleEntry.reserve small { color: #8B6228; }
body:has(#absenceForm) .scheduleEmptyCell { color: #C1CFDB; }
body:has(#absenceForm) .scheduleEmptyState { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #60758B; text-align: center; }
body:has(#absenceForm) .scheduleEmptyState strong { font-size: 14px; }
body:has(#absenceForm) .scheduleEmptyIcon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #DCE8F1; border-radius: 18px; background: #EDF4F9; color: #4A7FA7; }
body:has(#absenceForm) .scheduleEmptyIcon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) {
  body:has(#absenceForm) .sideIcon { width: 40px; height: 40px; border-radius: 13px; }
  body:has(#absenceForm) .sideLink { min-height: 60px; margin: 7px 0; padding: 10px 12px; border-radius: 16px; }
  body:has(#absenceForm) .teacherScheduleOverlay { padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); }
  body:has(#absenceForm) .teacherSchedulePanel { width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 21px; }
  body:has(#absenceForm) .teacherScheduleHead { min-height: 78px; padding: 13px 16px; }
  body:has(#absenceForm) .teacherScheduleHead h2 { font-size: 20px; }
  body:has(#absenceForm) .teacherScheduleBody { padding: 15px 12px 17px; }
  body:has(#absenceForm) .teacherScheduleName { font-size: 14px; }
  body:has(#absenceForm) .teacherScheduleTable { min-width: 760px; font-size: 11px; }
  body:has(#absenceForm) .teacherScheduleTable th, body:has(#absenceForm) .teacherScheduleTable td { width: 91px; padding: 6px; }
  body:has(#absenceForm) .teacherScheduleTable th:first-child { width: 86px; }
}

/* Student absence exclusion page: refined cards and an integrated return control. */
body:has(#excludeForm) {
  min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) 16px max(26px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 8% 0%, rgba(179, 207, 229, .5), transparent 34%),
    linear-gradient(180deg, #EAF2F8 0, #F6FAFD 310px, #F6FAFD 100%) !important;
  color: #19334D;
}
body:has(#excludeForm) .page-wrapper { width: min(100%, 920px); max-width: 920px; margin: 0 auto; }
body:has(#excludeForm) .hero {
  min-height: 112px;
  margin: 0 0 17px !important;
  padding: 20px 24px !important;
  display: flex;
  align-items: center;
  border: 1px solid rgba(179, 207, 229, .36) !important;
  border-radius: 25px !important;
  background:
    radial-gradient(circle at 88% 12%, rgba(179, 207, 229, .18), transparent 28%),
    linear-gradient(118deg, #0A1931 0%, #1A3D63 68%, #315E82 100%) !important;
  box-shadow: 0 19px 44px rgba(10, 25, 49, .18) !important;
}
body:has(#excludeForm) .hero-content {
  width: 100%;
  min-height: 66px;
  justify-content: center !important;
  gap: 0 !important;
}
body:has(#excludeForm) .hero-title { width: 100%; padding: 0 70px; text-align: center; }
body:has(#excludeForm) .hero-title h1 {
  font-size: clamp(20px, 3.2vw, 29px) !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  text-align: center;
}
body:has(#excludeForm) .hero-icon {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 54px !important;
  height: 54px !important;
  flex: 0 0 54px !important;
  transform: translateY(-50%);
  border: 1px solid rgba(246, 250, 253, .26) !important;
  border-radius: 17px !important;
  background: rgba(246, 250, 253, .12) !important;
  color: #D9EAF6 !important;
  font-size: 0 !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.1) !important;
}
body:has(#excludeForm) .hero-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
body:has(#excludeForm) .hero-back {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 20px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(246, 250, 253, .3);
  border-radius: 15px;
  background: rgba(246, 250, 253, .11);
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .12);
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
body:has(#excludeForm) .hero-back svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
body:has(#excludeForm) .hero-back:hover,
body:has(#excludeForm) .hero-back:focus-visible { transform: translateY(-50%) scale(1.04); border-color: rgba(246, 250, 253, .55); background: rgba(246, 250, 253, .2); }
body:has(#excludeForm) .teacher-card {
  gap: 13px !important;
  margin: 0 0 16px !important;
  padding: 15px 18px !important;
  border: 1px solid rgba(179, 207, 229, .72) !important;
  border-radius: 19px !important;
  background: linear-gradient(135deg, #fff, #F7FAFD) !important;
  box-shadow: 0 10px 25px rgba(10, 25, 49, .065) !important;
}
body:has(#excludeForm) .teacher-avatar {
  width: 46px !important;
  height: 46px !important;
  flex-basis: 46px !important;
  border: 1px solid rgba(179, 207, 229, .38);
  border-radius: 15px !important;
  background: linear-gradient(135deg, #0A1931, #1A3D63) !important;
  color: #D9EAF6 !important;
  font-size: 0 !important;
  box-shadow: 0 8px 17px rgba(10, 25, 49, .16) !important;
}
body:has(#excludeForm) .teacher-avatar svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
body:has(#excludeForm) .teacher-label { color: #71879C !important; font-size: 11px !important; }
body:has(#excludeForm) .teacher-name { color: #0A1931 !important; font-size: 15px !important; }
body:has(#excludeForm) .teacher-badge { border-color: #DCE8F1 !important; background: #F0F6FA !important; color: #426785 !important; }
body:has(#excludeForm) .status { margin-bottom: 15px; padding: 12px 15px; border-radius: 15px; box-shadow: 0 5px 15px rgba(10, 25, 49, .045); }
body:has(#excludeForm) .container {
  max-width: none;
  padding: 23px 24px 25px;
  border: 1px solid rgba(179, 207, 229, .75) !important;
  border-top: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, #FCFEFF);
  box-shadow: 0 20px 48px rgba(10, 25, 49, .095), 0 3px 10px rgba(10, 25, 49, .03);
}
body:has(#excludeForm) .field { margin-bottom: 16px; }
body:has(#excludeForm) label.field-label { margin-bottom: 8px; color: #203A53; font-size: 13px; font-weight: 800; }
body:has(#excludeForm) #classSelect,
body:has(#excludeForm) select:not(.hidden-select),
body:has(#excludeForm) textarea {
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #D9E6F0;
  border-radius: 13px;
  background: #FBFDFF;
  color: #19334D;
  font-size: 14px;
}
body:has(#excludeForm) #classSelect:focus,
body:has(#excludeForm) select:focus,
body:has(#excludeForm) textarea:focus { border-color: #4A7FA7; box-shadow: 0 0 0 4px rgba(74, 127, 167, .13); }
body:has(#excludeForm) .selection-layout { gap: 15px !important; margin-top: 5px !important; }
body:has(#excludeForm) .selection-panel { border: 1px solid #DCE8F1 !important; border-radius: 18px !important; background: #fff !important; box-shadow: 0 8px 22px rgba(10, 25, 49, .045); }
body:has(#excludeForm) .panel-head { min-height: 48px !important; padding: 10px 13px !important; background: linear-gradient(135deg, #F5F9FC, #EDF4F9) !important; border-bottom: 1px solid #E2EBF2 !important; }
body:has(#excludeForm) .panel-title { color: #1A3D63 !important; font-size: 14px !important; }
body:has(#excludeForm) .students-grid,
body:has(#excludeForm) .lessons-grid { gap: 8px !important; padding: 12px !important; }
body:has(#excludeForm) .student-item label { min-height: 43px; padding: 9px 10px; border-radius: 12px; background: #fff; font-size: 13px; }
body:has(#excludeForm) .student-item input:checked + label { border-color: #4A7FA7; background: #EFF6FB; color: #0A1931; }
body:has(#excludeForm) .student-item input:checked + label::before { border-color: #1A3D63; background: #1A3D63; }
body:has(#excludeForm) .lesson-item label { min-height: 43px; border-radius: 12px; font-size: 12px; }
body:has(#excludeForm) .lesson-item input:checked + label { border-color: #1A3D63; background: linear-gradient(135deg, #0A1931, #1A3D63); box-shadow: 0 6px 14px rgba(26, 61, 99, .18); }
body:has(#excludeForm) textarea { min-height: 90px; line-height: 1.7; }
body:has(#excludeForm) .reason-field { margin-top: 17px; }
body:has(#excludeForm) .form-footer { margin-top: 17px; padding-top: 17px; border-color: #E5EEF4; }
body:has(#excludeForm) #submitBtn { min-height: 48px; padding: 10px 24px; border: 0; border-radius: 14px; background: linear-gradient(115deg, #0A1931, #1A3D63 70%, #4A7FA7); box-shadow: 0 10px 22px rgba(10, 25, 49, .2); font-size: 14px; }
body:has(#excludeForm) #submitBtn:hover { background: linear-gradient(115deg, #102546, #234C73 70%, #588AB0); }
body:has(#excludeForm) #submitBtn:disabled { box-shadow: none; }
body:has(#excludeForm) #confirmOverlay { z-index: 1600; background: rgba(4, 13, 27, .62); backdrop-filter: blur(8px); }
body:has(#excludeForm) #confirmBox { border: 1px solid #DCE8F1; border-top: 4px solid #4A7FA7; border-radius: 22px; box-shadow: 0 28px 78px rgba(4, 13, 27, .3); }
body:has(#excludeForm) #confirmBox h3 { color: #0A1931; }
body:has(#excludeForm) .btn-gray,
body:has(#excludeForm) .btn-ok { min-height: 42px; border-radius: 12px !important; }
body:has(#excludeForm) .btn-ok { background: linear-gradient(115deg, #0A1931, #1A3D63); }
@media (max-width: 700px) {
  body:has(#excludeForm) { padding: max(12px, env(safe-area-inset-top)) 10px max(20px, env(safe-area-inset-bottom)); }
  body:has(#excludeForm) .hero { min-height: 92px; margin-bottom: 13px !important; padding: 14px 12px !important; border-radius: 20px !important; }
  body:has(#excludeForm) .hero-content { min-height: 60px; }
  body:has(#excludeForm) .hero-title { padding: 0 60px; }
  body:has(#excludeForm) .hero-title h1 { font-size: clamp(17px, 5vw, 22px) !important; }
  body:has(#excludeForm) .hero-icon { right: 13px; width: 46px !important; height: 46px !important; flex-basis: 46px !important; border-radius: 14px !important; }
  body:has(#excludeForm) .hero-icon svg { width: 22px; height: 22px; }
  body:has(#excludeForm) .hero-back { left: 12px; width: 43px; height: 43px; border-radius: 13px; }
  body:has(#excludeForm) .teacher-card { padding: 12px 13px !important; border-radius: 16px !important; }
  body:has(#excludeForm) .container { padding: 16px 13px 19px; border-radius: 20px; }
  body:has(#excludeForm) .selection-layout { grid-template-columns: 1fr !important; gap: 11px !important; }
  body:has(#excludeForm) .students-grid { max-height: 330px; }
  body:has(#excludeForm) .lessons-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body:has(#excludeForm) .lesson-item label { min-height: 43px; font-size: 12px; }
  body:has(#excludeForm) .form-footer { justify-content: stretch; }
  body:has(#excludeForm) #submitBtn { width: 100%; }
}
