/* Sunshine English School - Student Grade Portal Stylesheet */
@font-face {
  font-family: 'Sequel Sans';
  src: url('../../assets/fonts/SequelSans-RomanHead.woff2') format('woff2'),
       url('../../assets/fonts/SequelSans-RomanHead.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sequel Sans';
  src: url('../../assets/fonts/SequelSans-MediumHead.woff2') format('woff2'),
       url('../../assets/fonts/SequelSans-MediumHead.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sequel Sans';
  src: url('../../assets/fonts/SequelSans-SemiBoldHead.woff2') format('woff2'),
       url('../../assets/fonts/SequelSans-SemiBoldHead.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sequel Sans';
  src: url('../../assets/fonts/SequelSans-BoldHead.woff2') format('woff2'),
       url('../../assets/fonts/SequelSans-BoldHead.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sequel Sans';
  src: url('../../assets/fonts/SequelSans-HeavyDisp.woff2') format('woff2'),
       url('../../assets/fonts/SequelSans-HeavyDisp.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #1E40AF;
  --color-primary-hover: #1E3A8A;
  --color-on-primary: #FFFFFF;
  --color-secondary: #3B82F6;
  --color-accent: #16A34A;
  --color-accent-bg: #DCFCE7;
  --color-accent-text: #166534;
  --color-background: #EFF6FF;
  --color-foreground: #0F172A;
  --color-heading: #1E3A8A;
  --color-card: #FFFFFF;
  --color-muted: #F1F5F9;
  --color-muted-foreground: #475569;
  --color-border: #CBD5E1;
  --color-border-blue: #BFDBFE;
  --color-destructive: #DC2626;
  --color-destructive-bg: #FEF2F2;
  --color-destructive-border: #FECACA;
  --color-ring: #1E40AF;
  --font-sans: 'Sequel Sans', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Sequel Sans', 'IBM Plex Sans Arabic', Georgia, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-foreground);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

/* ================= LANGUAGE SWITCHER & DIALOG ================= */
.lang-bar {
  position: fixed;
  inset-block-start: 1rem;
  inset-inline-end: 1rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border-blue);
  border-radius: 999px;
  padding: 0.25rem;
  box-shadow: 0 6px 18px -6px rgba(30, 58, 138, 0.15);
}

.lang-pill {
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.lang-pill:hover {
  color: var(--color-heading);
  background: var(--color-muted);
}

.lang-pill.active {
  background: var(--color-primary);
  color: #FFFFFF;
}

dialog:modal {
  overscroll-behavior: contain;
  border: 1px solid var(--color-border-blue);
  border-radius: 18px;
  padding: 1.75rem 1.5rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  background: #FFFFFF;
  color: var(--color-foreground);
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.lang-dialog-head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.lang-dialog-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  display: block;
  border: 2px solid var(--color-border-blue);
}

.lang-dialog-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-heading);
}

.lang-dialog-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted-foreground);
}

.lang-choices {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lang-choice-btn {
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--color-border);
  background: #FFFFFF;
  color: var(--color-foreground);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}

.lang-choice-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-background);
}

.lang-choice-btn.is-main {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #FFFFFF;
}

.lang-choice-btn.is-main:hover {
  background: var(--color-primary-hover);
}

.lang-choice-tag {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}

/* ================= LOGIN PAGE ================= */
.login-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1rem 2rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.14), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(22, 163, 74, 0.10), transparent 45%),
    var(--color-background);
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--color-card);
  border: 1px solid var(--color-border-blue);
  border-radius: 18px;
  box-shadow: 0 20px 45px -15px rgba(30, 58, 138, 0.15);
  padding: 2.25rem 2rem 2rem;
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  display: block;
  border: 2px solid var(--color-border-blue);
  box-shadow: 0 8px 20px -8px rgba(30, 58, 138, 0.25);
}

.alert-error {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--color-destructive-bg);
  border: 1px solid var(--color-destructive-border);
  color: var(--color-destructive);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: 0.4rem;
  text-align: start;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  color: var(--color-muted-foreground);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  min-height: 48px;
  padding-block: 0.65rem;
  padding-inline-start: 2.7rem;
  padding-inline-end: 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-foreground);
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-input.has-toggle {
  padding-inline-end: 3.1rem;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
  outline: none;
}

.toggle-pw {
  position: absolute;
  inset-inline-end: 0.35rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-muted-foreground);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.toggle-pw:hover {
  color: var(--color-primary);
  background: var(--color-muted);
}

.btn-primary {
  width: 100%;
  min-height: 48px;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.12s ease;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* ================= REPORT TOOLBAR ================= */
.report-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-blue);
  padding: 0.65rem 1rem;
  box-shadow: 0 4px 16px -6px rgba(30, 58, 138, 0.08);
}

.toolbar-inner {
  max-width: 210mm;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.toolbar-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1;
}

.toolbar-student {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.toolbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-background);
  color: var(--color-heading);
  border: 1px solid var(--color-border-blue);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.toolbar-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: var(--color-muted);
  border-radius: 999px;
  padding: 0.2rem;
}

.toolbar-lang .lang-pill {
  min-height: 30px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.logout-form {
  margin: 0;
}

.btn-action {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-download {
  background: var(--color-primary);
  color: #FFFFFF;
}

.btn-download:hover {
  background: var(--color-primary-hover);
}

.btn-download:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-print {
  background: #FFFFFF;
  color: var(--color-heading);
  border-color: var(--color-border);
}

.btn-print:hover {
  background: var(--color-muted);
}

.btn-logout {
  background: #FFFFFF;
  color: var(--color-destructive);
  border-color: var(--color-destructive-border);
}

.btn-logout:hover {
  background: var(--color-destructive-bg);
}

/* ================= A4 PAPER REPORT ================= */
.report-stage {
  padding: 1.5rem 0.625rem 2.5rem;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.a4-zoom-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: visible;
}

.a4-sheet {
  width: 210mm;
  min-height: 297mm;
  flex-shrink: 0;
  transform-origin: top center;
  background: #FFFFFF;
  color: #111827;
  padding: 0;
  box-shadow: 0 20px 50px -18px rgba(17, 24, 39, 0.16);
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.a4-sheet::before {
  content: '';
  display: block;
  height: 2mm;
  width: 100%;
  background: #111827;
  flex-shrink: 0;
}

.a4-frame {
  padding: 10mm 12mm 9mm;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.official-header {
  text-align: center;
  padding-bottom: 4.5mm;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 4.5mm;
}

.ministry-logo {
  width: 21mm;
  height: 21mm;
  object-fit: contain;
  margin: 0 auto 2mm;
  display: block;
}

.gov-title {
  font-size: 8.2pt;
  font-weight: 600;
  color: #6B7280;
  margin: 0;
}

.school-title {
  font-family: var(--font-serif);
  font-size: 20pt;
  font-weight: 700;
  color: #111827;
  margin: 1mm 0;
  line-height: 1.15;
}

.report-subtitle {
  font-size: 8.5pt;
  font-weight: 600;
  color: #4B5563;
  margin: 0;
}

/* Clean Horizontal Student Bar */
.student-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 5mm;
  overflow: hidden;
}

.sb-cell {
  display: flex;
  flex-direction: column;
  text-align: start;
  padding: 2.8mm 3.5mm;
  border-inline-start: 1px solid #E2E8F0;
}

.sb-cell:first-child {
  border-inline-start: none;
}

.sb-lbl {
  font-size: 7pt;
  font-weight: 600;
  color: #64748B;
}

.sb-val {
  font-size: 10pt;
  font-weight: 700;
  color: #0F172A;
  margin-top: 0.4mm;
}

/* Spacious Modern Transcript Table */
.grades-table-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.grades-table-card {
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
}

.grades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8pt;
  table-layout: fixed;
}

.grades-table th,
.grades-table td {
  border-bottom: 1px solid #E2E8F0;
  padding: 2.5mm 0.5mm;
  text-align: center;
  vertical-align: middle;
}

.grades-table tbody tr:last-child th,
.grades-table tbody tr:last-child td {
  border-bottom: none;
}

.grades-table thead th.th-group,
.grades-table thead th.th-head,
.grades-table thead th.th-final-head {
  background: #F1F5F9;
  color: #0F172A;
  font-size: 8pt;
  font-weight: 700;
  padding: 2.2mm 0.6mm;
  border-bottom: 1px solid #CBD5E1;
}

.grades-table thead th.th-sub {
  background: #F8FAFC;
  color: #475569;
  font-size: 6.6pt;
  font-weight: 600;
  padding: 1.7mm 0.3mm;
  line-height: 1.15;
  white-space: nowrap;
  border-bottom: 1.5px solid #94A3B8;
}

.grades-table thead th.th-sub small {
  font-size: 6pt;
  color: #94A3B8;
  font-weight: 600;
}

.grades-table thead th.th-sub-res {
  color: #1E40AF;
  font-weight: 700;
}

.grades-table .col-num {
  width: 6.5mm;
  font-weight: 600;
  color: #94A3B8;
}

.grades-table .col-subject {
  width: 34mm;
  text-align: start;
  padding-inline: 2.5mm;
  font-weight: 700;
}

.grades-table tbody th[scope="row"] {
  text-align: start;
  padding-inline: 2.5mm;
  font-weight: 600;
  color: #0F172A;
  font-size: 8.4pt;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grades-table tbody tr:nth-child(even) {
  background: #FAFAF9;
}

.grades-table .col-score {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 8pt;
  color: #334155;
}

.grades-table .col-final {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #1E40AF;
  background: #F8FAFC;
}

.grades-table .col-grand-final {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #0F172A;
  background: #EFF6FF;
}

.grades-table .b-sep {
  border-inline-start: 1px solid #CBD5E1 !important;
}

.grades-table .col-final-head {
  width: 13mm;
}

.summary-strip {
  margin-top: 4mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4mm;
}

.summary-avg-pill {
  display: inline-flex;
  align-items: center;
  gap: 3mm;
  background: #0F172A;
  color: #FFFFFF;
  padding: 2mm 4.5mm;
  border-radius: 10px;
}

.summary-lbl {
  font-size: 8pt;
  font-weight: 600;
  color: #CBD5E1;
}

.summary-val {
  font-size: 11pt;
  font-weight: 700;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

.table-legend {
  margin: 0;
  font-size: 7pt;
  font-weight: 500;
  color: #94A3B8;
  text-align: end;
}

/* Official Footer & Principal Signature */
.report-footer {
  margin-top: 5mm;
  padding-top: 3.5mm;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.principal-box {
  text-align: center;
  min-width: 48mm;
}

.principal-role {
  font-size: 7.2pt;
  font-weight: 600;
  color: #6B7280;
  margin: 0;
}

.principal-name {
  font-family: var(--font-serif);
  font-size: 13pt;
  font-weight: 700;
  color: #0F172A;
  margin: 1.5mm 0 0;
}

/* Responsive toolbar on mobile (A4 paper scales smoothly via .a4-zoom-wrap) */
@media screen and (max-width: 768px) {
  .report-toolbar {
    padding: 0.55rem 0.75rem;
  }

  .toolbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .toolbar-top-row {
    justify-content: space-between;
    gap: 0.4rem;
  }

  .toolbar-badge {
    font-size: 0.74rem;
    padding: 0.22rem 0.55rem;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.4rem;
    width: 100%;
  }

  .btn-action {
    min-height: 38px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }

  .report-stage {
    padding: 0.85rem 0.625rem 2rem;
  }
}

/* ================= iPHONE / iOS LUXURY APP UI ================= */
.ios-body {
  background: #F2F2F7;
  color: #1C1C1E;
  min-height: 100dvh;
}

.ios-shell {
  max-width: 540px;
  margin: 0 auto;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

/* Circular Header Bar (bottom-sheet-header-style spec) */
.ios-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: rgba(242, 242, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.ios-brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.ios-school-avatar {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  object-fit: cover;
  border: 1.2px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.ios-brand-meta {
  display: flex;
  flex-direction: column;
  text-align: start;
  min-width: 0;
}

.ios-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1C1C1E;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-brand-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: #6E6E73;
  margin-top: 1px;
}

.ios-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ios-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: #FFFFFF;
  border: 1.2px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.04);
  color: #1C1C1E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.16s ease;
}

.ios-circle-btn:active {
  transform: scale(0.94);
}

.ios-circle-btn.ios-circle-sm {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: #F2F2F7;
  border-color: transparent;
  box-shadow: none;
}

.ios-circle-btn.ios-circle-primary {
  background: #007AFF;
  border-color: #007AFF;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.28);
}

.ios-circle-btn.ios-circle-danger {
  color: #FF3B30;
}

.ios-circle-btn .icon {
  width: 20px;
  height: 20px;
}

.ios-content {
  padding: 0.25rem 1.05rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

/* 1. Clean Apple iOS Student Summary Widget */
.ios-hero-card {
  background: #FFFFFF;
  color: #1C1C1E;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  padding: 1.15rem 1.2rem 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.ios-hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.ios-hero-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-align: start;
  min-width: 0;
  flex: 1;
}

.ios-student-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #F2F2F7;
  border: 1px solid rgba(0, 0, 0, 0.07);
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.ios-hero-text {
  min-width: 0;
}

.ios-hero-student {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1C1C1E;
  line-height: 1.25;
}

.ios-hero-meta {
  margin: 3px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8E8E93;
}

.ios-ring-wrap {
  position: relative;
  width: 66px;
  height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-ring-svg {
  width: 66px;
  height: 66px;
  transform: rotate(-90deg);
}

.ios-ring-track {
  fill: none;
  stroke: #F2F2F7;
  stroke-width: 6;
}

.ios-ring-value {
  fill: none;
  stroke: #34C759;
  stroke-width: 6;
  stroke-linecap: round;
}

.ios-ring-num {
  position: absolute;
  font-size: 0.92rem;
  font-weight: 800;
  color: #1C1C1E;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.ios-ring-num small {
  font-size: 0.65rem;
  font-weight: 700;
  color: #8E8E93;
}

.ios-hero-divider {
  height: 1px;
  background: rgba(60, 60, 67, 0.08);
  margin: 0.9rem 0 0.8rem;
}

.ios-hero-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ios-hero-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6E6E73;
}

.ios-hero-cta {
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: #007AFF;
  color: #FFFFFF;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.24);
  transition: transform 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.ios-hero-cta:hover {
  background: #0066D6;
}

.ios-hero-cta:active {
  transform: scale(0.95);
}

.ios-hero-cta .icon {
  width: 17px;
  height: 17px;
  color: #FFFFFF;
}

/* 2. 2-Column Bento Quick Widgets */
.ios-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.ios-bento-tile {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  padding: 0.95rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: start;
}

.ios-bento-meta {
  display: flex;
  flex-direction: column;
}

.ios-bento-lbl {
  font-size: 0.74rem;
  font-weight: 600;
  color: #8E8E93;
}

.ios-bento-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1C1C1E;
  line-height: 1.25;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.ios-arrow-sep {
  font-size: 0.95rem;
  color: #8E8E93;
  font-weight: 600;
}

.ios-bento-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6E6E73;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tinted Squircle Icon Badges (custom-menu-dashboard: 38x38, radius 12) */
.ios-squircle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-squircle .icon {
  width: 20px;
  height: 20px;
}

.tint-indigo  { background: rgba(99, 102, 241, 0.12);  border-color: rgba(99, 102, 241, 0.22);  color: #4F46E5; }
.tint-blue    { background: rgba(0, 122, 255, 0.12);   border-color: rgba(0, 122, 255, 0.22);   color: #007AFF; }
.tint-teal    { background: rgba(20, 184, 166, 0.12);  border-color: rgba(20, 184, 166, 0.22);  color: #0D9488; }
.tint-purple  { background: rgba(168, 85, 247, 0.12);  border-color: rgba(168, 85, 247, 0.22);  color: #9333EA; }
.tint-emerald { background: rgba(52, 199, 89, 0.14);   border-color: rgba(52, 199, 89, 0.24);   color: #16A34A; }
.tint-sky     { background: rgba(14, 165, 233, 0.12);  border-color: rgba(14, 165, 233, 0.22);  color: #0284C7; }
.tint-amber   { background: rgba(245, 158, 11, 0.14);  border-color: rgba(245, 158, 11, 0.24);  color: #D97706; }
.tint-green   { background: rgba(34, 197, 94, 0.12);   border-color: rgba(34, 197, 94, 0.22);   color: #15803D; }
.tint-rose    { background: rgba(244, 63, 94, 0.12);   border-color: rgba(244, 63, 94, 0.22);   color: #E11D48; }
.tint-pink    { background: rgba(236, 72, 153, 0.12);  border-color: rgba(236, 72, 153, 0.22);  color: #DB2777; }
.tint-violet  { background: rgba(139, 92, 246, 0.12);  border-color: rgba(139, 92, 246, 0.22);  color: #7C3AED; }
.tint-orange  { background: rgba(249, 115, 22, 0.12);  border-color: rgba(249, 115, 22, 0.22);  color: #EA580C; }
.tint-cyan    { background: rgba(6, 182, 212, 0.12);   border-color: rgba(6, 182, 212, 0.22);   color: #0891B2; }

/* 3. iOS Segmented Control */
.ios-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(118, 118, 128, 0.12);
  padding: 3px;
  border-radius: 13px;
  gap: 2px;
}

.ios-seg-btn {
  min-height: 36px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: #636366;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ios-seg-btn.is-active {
  background: #FFFFFF;
  color: #1C1C1E;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10), 0 0.5px 1px rgba(0, 0, 0, 0.04);
}

/* 4. Micro-Section Header (custom-menu-dashboard) */
.ios-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 0.25rem;
  margin-bottom: -0.45rem;
}

.ios-section-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ios-section-bar {
  width: 3.5px;
  height: 14px;
  border-radius: 2px;
  background: #007AFF;
}

.ios-section-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #6E6E73;
}

.ios-section-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: #007AFF;
  background: rgba(0, 122, 255, 0.10);
  padding: 2px 9px;
  border-radius: 999px;
}

/* 5. iOS Grouped Subject List Card */
.ios-grouped-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.ios-row {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.82rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  text-align: start;
  transition: background-color 0.14s ease;
}

.ios-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.ios-row:active {
  background: rgba(0, 0, 0, 0.05);
}

.ios-row-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.ios-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: start;
}

.ios-row-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1C1C1E;
  line-height: 1.25;
}

.ios-row-sub {
  font-size: 0.74rem;
  font-weight: 500;
  color: #8E8E93;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.ios-row-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.ios-score-capsule {
  min-width: 46px;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tone-emerald { background: rgba(52, 199, 89, 0.14);  color: #15803D; }
.tone-blue    { background: rgba(0, 122, 255, 0.12);  color: #0066CC; }
.tone-amber   { background: rgba(245, 158, 11, 0.15); color: #B45309; }
.tone-red     { background: rgba(255, 59, 48, 0.14);  color: #DC2626; }
.tone-muted   { background: #F2F2F7;                  color: #8E8E93; }

.ios-row-chevron {
  color: #C7C7CC;
  display: inline-flex;
}

.ios-row-chevron .icon {
  width: 17px;
  height: 17px;
}

.ios-inset-divider {
  height: 1px;
  background: rgba(60, 60, 67, 0.08);
  margin-inline: 16px;
}

.ios-tap-hint {
  margin: -0.35rem 0 0;
  font-size: 0.74rem;
  font-weight: 500;
  color: #8E8E93;
  text-align: center;
}

/* 6. Principal Card */
.ios-principal-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.ios-principal-text {
  display: flex;
  flex-direction: column;
  text-align: start;
  flex: 1;
  min-width: 0;
}

.ios-principal-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8E8E93;
}

.ios-principal-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1C1C1E;
}

.ios-print-pill {
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: #F2F2F7;
  color: #1C1C1E;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.ios-print-pill .icon {
  width: 16px;
  height: 16px;
}

/* ================= LUXURY iOS BOTTOM SHEET (<dialog>) ================= */
dialog.ios-sheet:modal {
  margin: auto auto 0;
  width: 100%;
  max-width: 520px;
  border: none;
  border-radius: 28px 28px 0 0;
  padding: 0.65rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: #FFFFFF;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  animation: iosSheetUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
  dialog.ios-sheet:modal {
    margin: auto;
    border-radius: 26px;
  }
}

@keyframes iosSheetUp {
  from { transform: translateY(36px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.ios-sheet-handle {
  width: 40px;
  height: 4.5px;
  border-radius: 999px;
  background: #D1D1D6;
  margin: 0 auto 0.95rem;
}

.ios-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  text-align: start;
}

.ios-sheet-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1C1C1E;
}

.ios-sheet-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #8E8E93;
}

.ios-sheet-score-banner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.ios-sheet-kpi {
  background: #F2F2F7;
  border-radius: 16px;
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  text-align: start;
}

.ios-sheet-kpi-lbl {
  font-size: 0.74rem;
  font-weight: 600;
  color: #8E8E93;
}

.ios-sheet-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #007AFF;
  font-variant-numeric: tabular-nums;
}

.ios-sheet-terms {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ios-sheet-term-card {
  background: #F8F9FA;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px;
  padding: 0.85rem;
}

.ios-sheet-term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 800;
  color: #1C1C1E;
  margin-bottom: 0.6rem;
}

.ios-sheet-term-head strong {
  color: #007AFF;
  background: rgba(0, 122, 255, 0.10);
  padding: 2px 10px;
  border-radius: 999px;
}

.ios-sheet-chips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.ios-sheet-chip {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #6E6E73;
  font-weight: 600;
}

.ios-sheet-chip small {
  color: #AEAEB2;
}

.ios-sheet-chip strong {
  color: #1C1C1E;
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ================= HIDDEN A4 PDF HOST (VISIBLE ON PRINT / CAPTURE) ================= */
.pdf-export-host {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 210mm;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

.pdf-export-host.is-capturing {
  left: 0;
  opacity: 1;
  z-index: -1;
}

/* ================= PRINT / A4 PDF STYLES ================= */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html, body, .ios-body {
    background: #FFFFFF !important;
    width: 210mm;
    height: 297mm;
  }

  .no-print,
  dialog {
    display: none !important;
  }

  .pdf-export-host {
    position: static !important;
    left: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: auto !important;
    width: 210mm !important;
  }

  .a4-sheet {
    width: 210mm !important;
    min-height: 297mm !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    page-break-after: avoid;
  }

  .a4-frame,
  .a4-frame::after {
    border-radius: 0 !important;
  }

  .student-bar,
  .grades-table thead th,
  .grades-table .col-final,
  .grades-table .col-grand-final,
  .summary-avg-pill,
  .a4-sheet::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
