:root {
  --portal-navy: #0b2344;
  --portal-blue: #123f76;
  --portal-gold: #e2ad2f;
  --portal-green: #14835f;
  --portal-red: #c83e4d;
  --portal-bg: #f2f6fb;
  --portal-line: #d9e3ef;
  --portal-muted: #64748b;
}

[hidden] { display: none !important; }

.preview-banner {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  color: #402d00;
  background: #fff3c4;
  border-bottom: 1px solid #e5bd38;
  text-align: center;
  font-family: "Cairo", sans-serif;
}

.preview-banner strong {
  color: #8a5a00;
}

.preview-entry {
  display: grid;
  gap: 0.2rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px dashed #d4a92d;
  border-radius: 14px;
  color: #0b2344;
  background: #fffaf0;
  text-decoration: none;
}

.preview-entry span {
  color: #5e6878;
  font-size: 0.82rem;
}

.preview-controls {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.exam-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.exam-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #dce5f0;
  border-radius: 18px;
  background: #fff;
}

.exam-preview-card h3,
.exam-preview-card p {
  margin: 0.25rem 0;
}

.exam-preview-card > div > span {
  color: #a06d00;
  font-size: 0.8rem;
  font-weight: 700;
}

.available-exams {
  margin-block: 1.25rem;
}

@media (max-width: 640px) {
  .preview-banner,
  .exam-preview-card {
    align-items: stretch;
    flex-direction: column;
  }
}

* { box-sizing: border-box; }
.portal-body, .dashboard-body { min-height: 100vh; margin: 0; background: var(--portal-bg); color: var(--portal-navy); font-family: "Cairo", sans-serif; }
.portal-header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--portal-line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); }
.portal-header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.portal-header .brand-mark { width: 54px; height: 54px; }
.header-link { border: 1px solid var(--portal-line); border-radius: 12px; padding: 10px 16px; background: #fff; color: var(--portal-navy); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.student-header-actions,.family-header-actions { display: flex; align-items: center; gap: 9px; }
.header-family-action,.header-logout-action { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 14px; padding: 9px 16px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.header-family-action { border: 1px solid #b8d6f5; color: #0b4f93; background: #edf6ff; box-shadow: 0 7px 18px rgba(28,118,209,.09); }
.header-family-action.add-child-action { color: #fff; border-color: #176fcb; background: linear-gradient(135deg,#0f68c5,#278de9); box-shadow: 0 9px 22px rgba(28,118,209,.22); }
.header-family-action.account-password-action { color: #173f70; border-color: #c7d7e9; background: #fff; }
.header-action-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; color: currentColor; background: rgba(255,255,255,.78); font-size: 1.1rem; line-height: 1; }
.add-child-action .header-action-icon { color: #1268bd; }
.header-logout-action { border: 1px solid #d8e0e9; color: #526277; background: #fff; }
.header-family-action:hover,.header-logout-action:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(11,35,68,.13); }
.header-family-action:focus-visible,.header-logout-action:focus-visible { outline: 3px solid rgba(38,135,210,.28); outline-offset: 2px; }
.child-switcher { position: relative; }
.switch-child-chevron { margin-inline-start: 2px; font-size: 1rem; transition: transform .18s ease; }
.child-switcher.is-open .switch-child-chevron { transform: rotate(180deg); }
.child-switch-menu { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 70; width: min(340px,calc(100vw - 28px)); display: grid; gap: 7px; padding: 9px; border: 1px solid #bfd5eb; border-radius: 18px; background: #fff; box-shadow: 0 22px 55px rgba(11,35,68,.2); }
.child-switch-menu[hidden] { display: none; }
.child-switch-option { width: 100%; min-height: 62px; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid transparent; border-radius: 13px; color: var(--portal-navy); background: #f7faff; font: inherit; text-align: start; cursor: pointer; }
.child-switch-option:hover,.child-switch-option:focus-visible { border-color: #8ebce8; background: #edf6ff; outline: none; }
.child-switch-option[aria-checked="true"] { border-color: #79cbb1; background: #edfbf6; }
.child-switch-option:disabled { cursor: wait; opacity: .66; }
.child-switch-check { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #15956c; font-weight: 900; }
.child-switch-option:not([aria-checked="true"]) .child-switch-check { color: #6e8198; background: #e7eef6; }
.child-switch-copy { min-width: 0; display: grid; gap: 2px; }
.child-switch-copy strong,.child-switch-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.child-switch-copy strong { font-size: .9rem; }
.child-switch-copy small { color: #68798e; font-size: .72rem; font-weight: 700; }
.child-switch-loading,.child-switch-error { margin: 0; padding: 14px 12px; color: #68798e; text-align: center; font-weight: 700; }
.child-switch-error { color: #b4233c; }
#student-content.is-switching-child { cursor: progress; }
#student-content.is-switching-child .learning-path-card { opacity: .72; }
.student-page-loading { width: min(100%,680px); min-height: 430px; display: grid; place-items: center; align-content: center; gap: 8px; margin: 34px auto; padding: 38px 26px; border: 1px solid #c9dced; border-radius: 28px; color: var(--portal-navy); background: linear-gradient(145deg,#fff,#f1f7fd); box-shadow: 0 22px 60px rgba(11,35,68,.1); text-align: center; }
.student-page-loading[hidden] { display: none; }
.student-page-loading h1,.student-page-loading p { margin: 0; }
.student-page-loading h1 { font-size: clamp(1.45rem,4vw,2rem); }
.student-page-loading p { color: #526277; font-weight: 700; }
.student-page-loading small { color: #73839a; }
.student-loading-visual { position: relative; width: 90px; height: 90px; margin-bottom: 8px; }
.student-loading-visual .portal-loading-spinner { width: 90px; height: 90px; margin: 0; }
.student-loading-visual > span { position: absolute; inset: 19px; z-index: 1; border-radius: 50%; background: url("../assets/logo.png") center/cover no-repeat; }
.student-loading-lines { width: min(100%,380px); display: grid; gap: 10px; margin-top: 24px; }
.student-loading-lines i { height: 12px; border-radius: 999px; background: linear-gradient(90deg,#e4edf7 20%,#f8fbfe 50%,#e4edf7 80%); background-size: 220% 100%; animation: student-loading-shimmer 1.25s linear infinite; }
.student-loading-lines i:nth-child(2) { width: 82%; }
.student-loading-lines i:nth-child(3) { width: 64%; }
@keyframes student-loading-shimmer { to { background-position: -220% 0; } }
.child-switch-loading-screen { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 22px; background: rgba(7,28,55,.72); backdrop-filter: blur(7px); }
.child-switch-loading-screen[hidden] { display: none; }
.child-switch-loading-card { width: min(100%,460px); display: grid; justify-items: center; gap: 7px; padding: 38px 28px; border: 1px solid rgba(255,255,255,.65); border-radius: 27px; color: var(--portal-navy); background: #fff; box-shadow: 0 30px 85px rgba(0,0,0,.3); text-align: center; }
.child-switch-loading-card h2,.child-switch-loading-card p { margin: 0; }
.child-switch-loading-card h2 { font-size: clamp(1.4rem,4vw,1.9rem); }
.child-switch-loading-card p { color: #526277; font-weight: 700; }
.child-switch-loading-card p strong { color: #0b4f93; }
.child-switch-loading-card small { color: #73839a; }
body.child-switch-in-progress { overflow: hidden; }

.student-suspended-card { width: min(100%,720px); margin: 34px auto; padding: clamp(30px,5vw,50px); border: 1px solid #f0cf88; border-radius: 30px; background: linear-gradient(145deg,#fffdf8,#fff8e8); box-shadow: 0 24px 65px rgba(11,35,68,.12); text-align: center; }
.student-suspended-card[hidden] { display: none; }
.student-suspended-icon { display: grid; place-items: center; width: 78px; height: 78px; margin: 0 auto 16px; border: 7px solid #fff1c9; border-radius: 50%; color: #9b6500; background: #ffd66d; font-size: 1.75rem; font-weight: 900; box-shadow: 0 12px 28px rgba(180,117,0,.18); }
.student-suspended-card h1 { margin: 4px 0 12px; color: var(--portal-navy); font-size: clamp(1.5rem,4vw,2.1rem); }
.student-suspended-card > p:not(.eyebrow) { margin: 0 auto; color: #5f6f83; font-weight: 700; line-height: 1.9; }
.student-suspended-note { display: flex; align-items: flex-start; gap: 12px; margin: 24px 0; padding: 16px 18px; border: 1px solid #f2d895; border-radius: 18px; color: #6d5421; background: rgba(255,247,220,.9); text-align: start; }
.student-suspended-note span { display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: #b77a09; font-family: Georgia,serif; font-weight: 900; }
.student-suspended-note p { margin: 0; line-height: 1.8; }
.student-suspended-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.student-suspended-actions > * { min-width: 210px; }
.child-switch-option.is-suspended { border-color: #efd59d; background: #fffaf0; }
.child-switch-option.is-suspended small { color: #9a6507; font-weight: 800; }
.child-card.is-suspended { border-color: #efd59d; background: linear-gradient(145deg,#fff,#fff9ec); }
.child-card.is-suspended .child-status { color: #986200; background: #fff0bf; }
@media (max-width:600px) { .student-suspended-card { margin: 20px auto; padding: 28px 20px; border-radius: 24px; } .student-suspended-actions { display: grid; } .student-suspended-actions > * { width: 100%; min-width: 0; } }
.exam-launch-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 22px; background: rgba(7,28,55,.82); backdrop-filter: blur(9px); }
.exam-launch-screen[hidden] { display: none; }
.exam-launch-card { width: min(100%,460px); display: grid; justify-items: center; padding: 42px 30px; border: 1px solid rgba(255,255,255,.55); border-radius: 28px; color: var(--portal-navy); background: #fff; box-shadow: 0 32px 80px rgba(0,0,0,.28); text-align: center; }
.exam-launch-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: -28px; border-radius: 50%; color: #fff; background: #15956c; font-size: 1.5rem; box-shadow: 0 9px 24px rgba(21,149,108,.24); }
.portal-loading-spinner { width: 82px; height: 82px; margin: 0 0 18px; border: 5px solid #ddecfb; border-top-color: #1879d4; border-radius: 50%; animation: portal-spin .8s linear infinite; }
.exam-launch-card h2 { margin: 0; font-size: clamp(1.45rem,4vw,2rem); }
.exam-launch-card p { margin: 9px 0 4px; color: #526277; font-weight: 700; }
.exam-launch-card small { color: #7a899d; }
@keyframes portal-spin { to { transform: rotate(360deg); } }
.auth-main { min-height: calc(100vh - 140px); display: grid; align-items: center; padding: 56px 0; background: radial-gradient(circle at 10% 10%, rgba(38,135,210,.13), transparent 35%), linear-gradient(135deg, #eef5fc 0%, #f8fafc 52%, #fff8e7 100%); }
.auth-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.auth-intro h1 { margin: 12px 0 18px; font-size: clamp(2.4rem, 5vw, 4.7rem); line-height: 1.18; letter-spacing: -.04em; }
.auth-intro h1 span { color: var(--portal-blue); }
.auth-intro > p:not(.eyebrow) { max-width: 650px; color: #526277; font-size: 1.08rem; line-height: 2; }
.version-badge, .environment-pill { display: inline-flex; padding: 7px 13px; border-radius: 999px; color: #765711; background: #fff2c9; border: 1px solid #efd683; font-weight: 800; font-size: .8rem; }
.benefit-list { display: grid; gap: 13px; list-style: none; padding: 0; margin: 28px 0 0; }
.benefit-list li { display: flex; gap: 12px; align-items: center; color: #334155; font-weight: 700; }
.benefit-list span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: #fff; background: var(--portal-green); }
.auth-card, .form-card, .process-card, .status-card, .gate-card, .performance-card, .admin-panel-card { background: #fff; border: 1px solid var(--portal-line); border-radius: 24px; box-shadow: 0 24px 60px rgba(11,35,68,.09); }
.auth-card { padding: 34px; }
.auth-card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth-card-heading p, .auth-card-heading h2 { margin: 0; }
.auth-card-heading p { color: var(--portal-muted); font-size: .85rem; }
.card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--portal-navy); color: #fff; font-size: 1.4rem; }
.portal-field { display: grid; gap: 8px; margin-bottom: 18px; font-weight: 700; }
.portal-field > span:first-child { font-size: .92rem; }
.portal-field input, .portal-field select, .panel-toolbar select, .admin-filters select, .toolbar-actions input { width: 100%; min-height: 52px; border: 1px solid #cbd8e7; border-radius: 12px; padding: 0 15px; background: #fbfdff; color: var(--portal-navy); font: inherit; outline: none; }
.portal-field input:focus, .portal-field select:focus { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(18,63,118,.12); }
.portal-field small { color: var(--portal-muted); font-weight: 500; }
.password-shell { display: flex; border: 1px solid #cbd8e7; border-radius: 12px; background: #fbfdff; overflow: hidden; }
.password-shell input { border: 0; border-radius: 0; }
.password-shell button { border: 0; background: transparent; padding: 0 14px; color: var(--portal-blue); font: inherit; font-weight: 700; cursor: pointer; }
.family-account-dialog { width: min(92vw, 520px); padding: 0; border: 0; border-radius: 24px; color: var(--portal-navy); background: #fff; box-shadow: 0 28px 80px rgba(4,17,34,.28); }
.family-account-dialog::backdrop { background: rgba(4,17,34,.58); backdrop-filter: blur(4px); }
.family-account-dialog form { display: grid; gap: 17px; padding: clamp(22px, 5vw, 32px); }
.family-account-dialog-heading { display: flex; align-items: center; gap: 14px; }
.family-account-dialog-heading > span { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 15px; color: #fff; background: var(--portal-navy); font-size: 1.4rem; }
.family-account-dialog-heading h2,.family-account-dialog-heading p { margin: 0; }
.family-account-dialog-heading h2 { font-size: 1.35rem; }
.family-account-dialog-heading p { margin-top: 4px; color: var(--portal-muted); font-size: .84rem; line-height: 1.7; }
.family-account-dialog .portal-field { margin: 0; }
.family-account-dialog .portal-field > small { color: var(--portal-muted); font-size: .74rem; }
.family-account-dialog-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.family-account-dialog-actions .portal-primary,.family-account-dialog-actions .portal-secondary { width: auto; margin: 0; }
.family-account-security-note { margin: -3px 0 0; color: var(--portal-muted); font-size: .75rem; line-height: 1.7; }
.portal-primary, .portal-secondary { min-height: 52px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 0 20px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.portal-primary { border: 1px solid var(--portal-navy); color: #fff; background: var(--portal-navy); box-shadow: 0 12px 24px rgba(11,35,68,.17); }
.portal-secondary { border: 1px solid #bdcde0; color: var(--portal-navy); background: #fff; }
.portal-primary:disabled, .portal-secondary:disabled { opacity: .52; cursor: not-allowed; }
.compact { width: auto; min-height: 42px; padding-inline: 18px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--portal-muted); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--portal-line); }
.security-note { margin: 18px 0 0; text-align: center; color: var(--portal-muted); font-size: .76rem; }
.portal-notice { border: 1px solid #bad4ee; background: #edf6ff; color: #174c7c; border-radius: 12px; padding: 12px 15px; margin: 14px 0; line-height: 1.7; }
.portal-notice[data-type="error"] { border-color: #f0bdc3; background: #fff1f2; color: #a11d2c; }
.portal-notice[data-type="success"] { border-color: #9bd6c3; background: #ecfdf5; color: #0f684d; }
.portal-footer { min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 16px; color: var(--portal-muted); font-size: .82rem; }
.portal-footer p { margin: 0; }.portal-footer a { color: var(--portal-blue); font-weight: 700; }

.form-page { padding: 42px 0 64px; }
.form-page-grid { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 28px; align-items: start; }
.process-card { padding: 28px; position: sticky; top: 104px; }
.process-card h1 { margin: 8px 0 26px; font-size: 1.65rem; }
.process-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.process-list li { display: flex; gap: 13px; opacity: .56; }
.process-list li.active { opacity: 1; }
.process-list li > span { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e8eef6; font-weight: 800; }
.process-list .active > span { background: var(--portal-navy); color: #fff; }
.process-list strong, .process-list small { display: block; }.process-list small { color: var(--portal-muted); margin-top: 3px; }
.whatsapp-warning { margin-top: 28px; padding: 16px; border-radius: 15px; background: #fff8e5; border: 1px solid #f0d58d; }
.whatsapp-warning strong { color: #7b5b0c; }.whatsapp-warning p { margin: 6px 0 0; color: #665322; font-size: .82rem; line-height: 1.8; }
.form-card { padding: 34px; }.section-title > span { color: var(--portal-blue); font-size: .78rem; font-weight: 800; }.section-title h2 { margin: 5px 0; font-size: 1.7rem; }.section-title p { margin: 0 0 26px; color: var(--portal-muted); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.registration-type { border: 0; padding: 0; margin: 6px 0 20px; }.registration-type legend { font-weight: 800; margin-bottom: 10px; }.registration-type label { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--portal-line); border-radius: 12px; margin-bottom: 9px; cursor: pointer; }.registration-type input { margin-top: 5px; }.registration-type strong, .registration-type small { display: block; }.registration-type small { color: var(--portal-muted); margin-top: 2px; }
.confirm-row { display: flex; gap: 10px; align-items: flex-start; padding: 15px; border-radius: 12px; background: #fff8e5; border: 1px solid #efd68d; margin-bottom: 16px; font-weight: 700; line-height: 1.8; }.confirm-row input { margin-top: 7px; }
.whatsapp-button { background: #0c7a55; border-color: #0c7a55; }

.center-page { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 44px 16px; }.status-card { width: min(100%, 580px); padding: 38px; text-align: center; }.status-card-icon { display: grid; place-items: center; width: 66px; height: 66px; margin: auto; border-radius: 22px; color: #fff; background: var(--portal-navy); font-size: 2rem; }.status-card h1 { margin: 8px 0; }.status-card > p { color: var(--portal-muted); }.status-card .portal-field { text-align: right; margin-top: 25px; }.status-result, .status-help { margin-top: 20px; padding: 18px; border-radius: 14px; }.status-result { background: #ecfdf5; border: 1px solid #a9dbc9; }.status-result span,.status-result strong { display: block; }.status-result strong { color: var(--portal-green); font-size: 1.25rem; }.status-help { text-align: right; background: #fff8e5; border: 1px solid #efd68d; }.status-help p { margin: 5px 0 0; color: #665322; }

.dashboard-main, .admin-v9-main { padding: 36px 0 70px; }.student-welcome,.admin-v9-welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }.student-welcome h1,.admin-v9-welcome h1 { margin: 5px 0; font-size: clamp(1.9rem,4vw,3rem); }.student-welcome p,.admin-v9-welcome p { margin: 0; color: var(--portal-muted); }.subscription-pill { padding: 12px 18px; border-radius: 15px; background: #e8f8f2; border: 1px solid #a5dbc8; }.subscription-pill span,.subscription-pill strong { display: block; }.subscription-pill span { font-size: .72rem; color: var(--portal-muted); }.subscription-pill strong { color: var(--portal-green); }
.student-stats,.admin-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; margin-bottom: 24px; }.student-stats article,.admin-kpis article { background: #fff; border: 1px solid var(--portal-line); border-radius: 17px; padding: 20px; }.student-stats span,.admin-kpis span { color: var(--portal-muted); }.student-stats strong,.admin-kpis strong { display: block; margin-top: 8px; font-size: 1.7rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 24px; }.dashboard-section { background: #fff; border: 1px solid var(--portal-line); border-radius: 22px; padding: 26px; }.units-list { display: grid; gap: 12px; }.unit-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--portal-line); border-radius: 15px; padding: 18px; }.unit-card h3,.unit-card p { margin: 3px 0; }.unit-card p { color: var(--portal-muted); }.unit-card button { width: auto; }
.empty-state { min-height: 190px; display: grid; place-items: center; align-content: center; text-align: center; padding: 25px; border: 1px dashed #b9cadd; border-radius: 16px; color: var(--portal-muted); }.empty-state > span { font-size: 2rem; color: var(--portal-blue); }.empty-state strong { color: var(--portal-navy); margin-top: 8px; }.empty-state p { margin: 4px 0 0; }.empty-state.large { min-height: 320px; }
.performance-card { padding: 24px; align-self: start; }.performance-card h2 { margin-top: 5px; }.performance-row { padding: 14px; border-radius: 12px; margin: 10px 0; }.performance-row span,.performance-row strong { display: block; }.performance-row span { font-size: .75rem; }.performance-row.strength { background: #eaf9f3; color: #106b4e; }.performance-row.weakness { background: #fff4e5; color: #875a09; }.gate-card { max-width: 560px; padding: 42px; margin: 60px auto; text-align: center; }.gate-card > span { font-size: 2.5rem; }.gate-card p { color: var(--portal-muted); }.gate-card .portal-primary { max-width: 260px; margin: 20px auto 0; }
.learning-report { margin-top: 28px; padding: 28px; border: 1px solid var(--portal-line); border-radius: 22px; background: #fff; }
.learning-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.learning-insight { padding: 20px; border-radius: 15px; }
.learning-insight span,.learning-insight strong { display: block; }
.learning-insight span { font-size: .78rem; font-weight: 800; }
.learning-insight strong { margin-top: 5px; font-size: 1.1rem; }
.learning-insight p { margin: 7px 0 0; line-height: 1.8; }
.strength-insight { background: #eaf9f3; color: #106b4e; }
.weakness-insight { background: #fff4e5; color: #875a09; }
.parent-result-guidance { max-width: 780px; margin: 22px auto 0; padding: 24px 26px; border: 1px solid #c9d9ea; border-radius: 18px; color: var(--portal-navy); background: #f7fbff; text-align: center; }
.parent-result-guidance > span,.parent-result-guidance > strong { display: block; }
.parent-result-guidance > span { color: #65758a; font-size: .78rem; font-weight: 800; }
.parent-result-guidance > strong { margin-top: 5px; font-size: clamp(1.25rem,3vw,1.7rem); }
.parent-result-guidance > p { margin: 10px 0 0; color: #42536a; font-weight: 700; line-height: 1.9; }
.parent-result-guidance[data-status="strength"] { border-color: #a9dfcb; background: #eefaf5; }
.parent-result-guidance[data-status="strength"] > strong { color: #0d7655; }
.parent-result-guidance[data-status="review"] { border-color: #eed28a; background: #fff9e9; }
.parent-result-guidance[data-status="review"] > strong { color: #8b650a; }
.parent-result-guidance[data-status="training"] { border-color: #efbbc2; background: #fff3f5; }
.parent-result-guidance[data-status="training"] > strong { color: #b43243; }
.parent-score-recommendation { padding-block: 18px; }

.admin-user span,.admin-user strong { display: block; text-align: left; }.admin-user span { font-size: .72rem; color: var(--portal-muted); }.admin-kpis { grid-template-columns: repeat(4,1fr); }.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: 24px 0; border: 1px solid var(--portal-line); border-radius: 15px; background: #fff; }.admin-tabs button { flex: 0 0 auto; border: 0; border-radius: 10px; padding: 11px 16px; background: transparent; color: var(--portal-muted); font: inherit; font-weight: 700; cursor: pointer; }.admin-tabs button[aria-selected="true"] { background: var(--portal-navy); color: #fff; }.admin-tab-panel { outline: none; }.admin-content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }.admin-panel-card { padding: 24px; }.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; margin-bottom: 16px; border: 1px solid var(--portal-line); border-radius: 18px; background: #fff; }.panel-toolbar h2,.panel-toolbar p { margin: 0; }.panel-toolbar p { color: var(--portal-muted); }.panel-toolbar select { width: auto; min-width: 190px; }.toolbar-actions { display: flex; gap: 10px; }.bulk-toolbar,.admin-filters { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 14px; background: #fff; border: 1px solid var(--portal-line); border-radius: 14px; }.bulk-toolbar button { border: 1px solid var(--portal-line); background: #f8fafc; border-radius: 9px; padding: 8px 12px; font: inherit; }.bulk-toolbar span { margin-inline-start: auto; color: var(--portal-muted); }.admin-filters select { min-height: 42px; }
.admin-login-card { max-width: 760px; margin: 22px auto; }
.admin-inline-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; }
.admin-record-list { display: grid; gap: 14px; }
.admin-record { display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 10px 30px rgba(11,35,68,.06); }
.admin-record h3,.admin-record p { margin: 4px 0; }
.admin-record small { color: var(--portal-muted); }
.admin-create-form { margin-bottom: 16px; }
.admin-create-form h3 { margin-top: 0; }
.admin-checkbox-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.admin-checkbox-grid label,.portal-check { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 11px 14px; border: 1px solid var(--portal-line); border-radius: 12px; background: #f8fafc; color: var(--portal-navy); font-weight: 700; }
.admin-checkbox-grid input,.portal-check input { width: 18px; height: 18px; accent-color: var(--portal-navy); }

@media (max-width: 900px) {
  .auth-grid,.form-page-grid,.dashboard-grid,.admin-content-grid,.learning-report-grid { grid-template-columns: 1fr; }
  .auth-main { padding: 34px 0; }.auth-intro { text-align: center; }.benefit-list { justify-items: center; }.process-card { position: static; }.student-stats,.admin-kpis { grid-template-columns: 1fr 1fr; }.performance-card { order: -1; }.admin-v9-welcome,.panel-toolbar,.admin-record { align-items: flex-start; flex-direction: column; }.toolbar-actions { width: 100%; }.admin-inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .portal-header-inner { min-height: 68px; gap: 8px; }.portal-header .brand-copy small { display: none; }.header-link { padding: 8px 10px; font-size: .78rem; }.student-header-actions,.family-header-actions { gap: 5px; }.header-family-action,.header-logout-action { min-height: 42px; gap: 5px; padding: 7px 9px; border-radius: 11px; font-size: .74rem; }.header-action-icon { width: 22px; height: 22px; border-radius: 7px; font-size: .92rem; }.header-logout-action { width: 42px; padding-inline: 0; }.logout-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }.auth-intro h1 { font-size: 2.35rem; }.auth-card,.form-card,.process-card,.status-card { padding: 22px; border-radius: 19px; }.field-pair,.student-stats,.admin-kpis,.admin-checkbox-grid { grid-template-columns: 1fr; }.portal-footer { flex-direction: column; gap: 6px; }.student-welcome { align-items: flex-start; flex-direction: column; }.unit-card { align-items: stretch; flex-direction: column; }.unit-card button { width: 100%; }.panel-toolbar select,.toolbar-actions { width: 100%; }.toolbar-actions { flex-direction: column; }.bulk-toolbar,.admin-filters { align-items: stretch; flex-wrap: wrap; }.bulk-toolbar span { margin-inline-start: 0; width: 100%; }.admin-user { display: none; }
}
@media (max-width: 420px) { .dashboard-header .brand-copy { display: none; }.header-family-action { padding-inline: 7px; }.child-switch-menu { position: fixed; top: 76px; inset-inline: 14px; width: auto; max-height: calc(100vh - 92px); overflow-y: auto; } }

/* يحافظ على المؤقت والتقدم ظاهرين على شاشات الهاتف أثناء الامتحان. */
@media (max-width: 768px) {
  .exam-overview { position: sticky; top: 0; z-index: 50; padding: 10px 0; box-shadow: 0 8px 24px rgba(11,35,68,.12); }
  .exam-overview-grid { display: flex; align-items: center; gap: 8px; }
  .exam-title-block h1,.exam-title-block p,.live-label,.sound-toggle { display: none; }
  .exam-controls { width: 100%; }
  .timer-card { width: 100%; min-height: 52px; justify-content: center; }
  .exam-progress { margin-top: 8px; }
  .progress-copy { font-size: .74rem; }
  .question-sidebar { padding-bottom: 82px; }
  .finish-button { position: sticky; bottom: 10px; z-index: 45; box-shadow: 0 12px 30px rgba(200,62,77,.28); }
}

/* Student dashboard V9 */
.student-hero { position: relative; overflow: hidden; padding: 28px 30px; border: 1px solid rgba(18,63,118,.15); border-radius: 24px; background: linear-gradient(135deg,#fff 0%,#f3f8ff 65%,#fff7dd 100%); box-shadow: 0 18px 44px rgba(11,35,68,.08); }
.student-hero::after { content: ""; position: absolute; inset-inline-end: -45px; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; background: rgba(226,173,47,.13); }
.student-profile-heading { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.student-avatar { flex: 0 0 68px; height: 68px; display: grid; place-items: center; border-radius: 22px; color: #fff; background: linear-gradient(145deg,var(--portal-blue),var(--portal-navy)); box-shadow: 0 12px 26px rgba(11,35,68,.2); font-size: 1.8rem; font-weight: 800; }
.student-meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.student-meta-chips span { padding: 7px 11px; border: 1px solid #cddbec; border-radius: 999px; color: #40536c; background: rgba(255,255,255,.82); font-size: .78rem; font-weight: 700; }
.student-hero .subscription-pill { position: relative; z-index: 1; min-width: 126px; text-align: center; }
.student-stats { grid-template-columns: repeat(4,1fr); }
.student-stats article { position: relative; min-height: 142px; padding: 20px 22px; box-shadow: 0 10px 28px rgba(11,35,68,.045); }
.student-stats article::before { content: ""; position: absolute; top: 0; inset-inline-start: 22px; width: 38px; height: 4px; border-radius: 0 0 8px 8px; background: var(--portal-gold); }
.student-stats small { display: block; margin-top: 6px; color: var(--portal-muted); line-height: 1.6; }
.latest-parent-summary { margin-bottom: 24px; overflow: hidden; border: 1px solid #cbdced; border-radius: 20px; background: #fff; box-shadow: 0 13px 32px rgba(11,35,68,.06); }
.latest-parent-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid #e2e9f1; background: linear-gradient(135deg,#f7fbff,#fffaf0); }
.latest-parent-heading span,.latest-parent-details span,.latest-recommendation span { color: var(--portal-muted); font-size: .76rem; font-weight: 800; }
.latest-parent-heading h2 { margin: 4px 0 0; color: var(--portal-navy); font-size: clamp(1.15rem,2.2vw,1.55rem); }
.latest-parent-heading time { display: block; margin-top: 4px; color: var(--portal-muted); font-size: .76rem; }
.latest-parent-heading > strong { min-width: 90px; color: var(--portal-navy); text-align: center; font-size: 2rem; }
.latest-parent-details { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1px; background: #e2e9f1; }
.latest-parent-details article { padding: 18px 22px; background: #fff; }
.latest-parent-details strong { display: block; margin-top: 5px; color: var(--portal-navy); }
.latest-parent-details small { display: block; margin-top: 4px; color: var(--portal-muted); line-height: 1.65; }
.latest-parent-details [data-trend="improving"] strong { color: #087a52; }
.latest-parent-details [data-trend="declining"] strong { color: #b43642; }
.latest-parent-details [data-trend="stable"] strong { color: #9a6a00; }
.latest-recommendation { padding: 18px 22px; border-top: 1px solid #e2e9f1; background: #f7fafc; }
.latest-recommendation p { margin: 6px 0 0; color: #183a63; font-weight: 700; line-height: 1.9; }
.learning-path-card,.parent-report { margin-top: 26px; padding: 30px; border: 1px solid var(--portal-line); border-radius: 24px; background: #fff; box-shadow: 0 20px 50px rgba(11,35,68,.065); }
.learning-path-heading,.parent-report-heading { text-align: center; }
.section-kicker,.parent-report-heading > span,.exam-performance-heading > div > span { color: #9a6b08; font-size: .78rem; font-weight: 800; }
.learning-path-heading h2,.parent-report-heading h2 { margin: 6px 0; color: var(--portal-navy); font-size: clamp(1.7rem,3vw,2.3rem); }
.learning-path-heading p,.parent-report-heading p { margin: 0; color: var(--portal-muted); }
.selection-steps { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px auto; color: var(--portal-muted); font-size: .86rem; font-weight: 700; }
.selection-steps span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 12px; background: #f4f7fb; }
.selection-steps span.is-active { color: var(--portal-blue); background: #eaf3ff; }
.selection-steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: #fff; background: var(--portal-blue); font-size: .72rem; }
.selection-steps i { color: #9aabba; font-style: normal; }
.professional-units { grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 14px; }
.professional-unit-card { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; padding: 20px; border: 1px solid #d8e3ef; border-radius: 18px; background: linear-gradient(180deg,#fff,#fbfdff); transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.professional-unit-card:hover { transform: translateY(-2px); border-color: #a9bfd9; box-shadow: 0 12px 28px rgba(11,35,68,.08); }
.unit-number { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: var(--portal-navy); font-size: 1.1rem; font-weight: 800; }
.unit-card-copy span { color: #9a6b08; font-size: .74rem; font-weight: 800; }
.unit-card-copy h3 { margin: 4px 0; font-size: 1.12rem; }
.unit-card-copy p { margin: 0; color: var(--portal-muted); font-size: .84rem; }
.unit-select { grid-column: 1 / -1; min-height: 44px; border: 1px solid #c6d5e5; border-radius: 12px; color: var(--portal-blue); background: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.unit-select:hover,.unit-select.is-selected { color: #fff; border-color: var(--portal-navy); background: var(--portal-navy); }
.available-exams { margin-top: 26px; padding: 30px; }
.exams-section-title { text-align: center; }
.exams-section-title b { color: var(--portal-blue); }
.student-exam-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; border: 1px solid #d8e3ef; border-radius: 17px; background: #fff; }
.student-exam-main { min-width: 0; }
.student-exam-main h3 { margin: 6px 0 10px; color: var(--portal-navy); font-size: 1.18rem; }
.exam-type { display: inline-flex; padding: 5px 10px; border-radius: 999px; color: #765711; background: #fff3cf; font-size: .7rem; font-weight: 800; }
.exam-card-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.exam-card-meta span { padding-inline-end: 8px; color: var(--portal-muted); font-size: .8rem; }
.exam-card-meta span:not(:last-child) { border-inline-end: 1px solid #d5dfeb; }
.student-exam-action { flex: 0 0 170px; display: grid; gap: 8px; text-align: center; }
.best-result-label { color: var(--portal-green); font-size: .78rem; font-weight: 800; }
.parent-report { margin-bottom: 28px; }
.parent-report-heading { padding-bottom: 24px; border-bottom: 1px solid #e3eaf2; }
.report-summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 22px; }
.report-summary-card { padding: 20px; border-radius: 16px; }
.report-summary-card span,.report-summary-card strong { display: block; }
.report-summary-card span { font-size: .75rem; font-weight: 800; }
.report-summary-card strong { margin-top: 6px; line-height: 1.7; }
.report-level { color: #164b7d; background: #eaf3ff; }
.report-strength { color: #106b4e; background: #eaf9f3; }
.report-review { color: #875a09; background: #fff4e5; }
.report-recommendation { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; margin-top: 14px; padding: 17px 20px; border: 1px solid #ecd58f; border-radius: 15px; background: #fffaf0; }
.report-recommendation span { color: #765711; font-size: .8rem; font-weight: 800; }
.report-recommendation p { margin: 0; color: #51451f; line-height: 1.8; }
.exam-performance-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 32px 0 15px; }
.exam-performance-heading h3 { margin: 4px 0 0; font-size: 1.55rem; }
.exam-performance-heading p { max-width: 520px; margin: 0; color: var(--portal-muted); font-size: .84rem; line-height: 1.8; }
.exam-performance-list { display: grid; gap: 14px; }
.exam-performance-card { overflow: hidden; border: 1px solid #d9e3ef; border-radius: 18px; background: #fff; }
.exam-performance-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: #f8fafc; border-bottom: 1px solid #e2e9f1; }
.exam-performance-card header span { color: var(--portal-muted); font-size: .74rem; }
.exam-performance-card h4 { margin: 3px 0 0; font-size: 1.08rem; }
.performance-status { padding: 6px 10px; border-radius: 999px; font-size: .75rem; white-space: nowrap; }
.status-strength .performance-status { color: #106b4e; background: #dff6ed; }
.status-review .performance-status { color: #875a09; background: #fff0c8; }
.status-training .performance-status { color: #a11d2c; background: #ffe5e8; }
.performance-numbers { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid #e2e9f1; }
.performance-numbers div { padding: 14px 20px; }
.performance-numbers div:not(:last-child) { border-inline-end: 1px solid #e2e9f1; }
.performance-numbers span,.performance-numbers strong { display: block; }
.performance-numbers span { color: var(--portal-muted); font-size: .72rem; }
.performance-numbers strong { margin-top: 3px; font-size: 1.2rem; }
.performance-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 20px; }
.performance-details section { padding: 15px; border-radius: 13px; }
.performance-details section > span { font-size: .76rem; font-weight: 800; }
.performance-details ul { margin: 8px 0 0; padding-inline-start: 20px; line-height: 1.8; }
.detail-strength { color: #106b4e; background: #effaf6; }
.detail-review { color: #875a09; background: #fff8e8; }
.report-empty { margin: 8px 0 0; font-size: .83rem; }
.exam-recommendation { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid #e2e9f1; background: #fbfdff; }
.exam-recommendation span { flex: 0 0 auto; color: var(--portal-blue); font-size: .78rem; font-weight: 800; }
.exam-recommendation p { margin: 0; color: #526277; line-height: 1.7; }

@media (max-width: 900px) {
  .student-stats { grid-template-columns: 1fr 1fr; }
  .report-summary-grid { grid-template-columns: 1fr; }
  .exam-performance-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .latest-parent-heading { align-items: flex-start; padding: 17px; }
  .latest-parent-heading > strong { min-width: auto; font-size: 1.7rem; }
  .latest-parent-details { grid-template-columns: 1fr; }
  .latest-parent-details article,.latest-recommendation { padding: 15px 17px; }
  .student-hero,.student-exam-card,.exam-performance-card > header { align-items: stretch; flex-direction: column; }
  .student-profile-heading { align-items: flex-start; }
  .student-hero .subscription-pill { width: 100%; }
  .student-stats { grid-template-columns: 1fr; }
  .learning-path-card,.parent-report,.available-exams { padding: 20px; border-radius: 19px; }
  .selection-steps { gap: 6px; font-size: .74rem; }
  .selection-steps span { padding: 7px 9px; }
  .professional-units { grid-template-columns: 1fr; }
  .student-exam-action { flex-basis: auto; width: 100%; }
  .report-recommendation { grid-template-columns: 1fr; }
  .performance-numbers { grid-template-columns: 1fr; }
  .performance-numbers div:not(:last-child) { border-inline-end: 0; border-bottom: 1px solid #e2e9f1; }
  .performance-details { grid-template-columns: 1fr; }
  .exam-recommendation { flex-direction: column; }
}

.parent-report-launch { margin: -10px 0 24px; border: 1px solid #cbdced; border-radius: 19px; background: #fff; box-shadow: 0 13px 32px rgba(11,35,68,.065); }
.parent-report-toggle { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 15px; padding: 18px 22px; border: 0; border-radius: 18px; color: var(--portal-navy); background: #fff; text-align: right; font: inherit; cursor: pointer; }
.report-toggle-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: var(--portal-blue); font-size: 1.45rem; }
.parent-report-toggle small,.parent-report-toggle strong,.parent-report-toggle em { display: block; }
.parent-report-toggle small { color: #9a6b08; font-size: .7rem; font-weight: 800; }
.parent-report-toggle strong { margin: 1px 0; font-size: 1.22rem; }
.parent-report-toggle em { color: var(--portal-muted); font-size: .78rem; font-style: normal; }
.parent-report-toggle > b { color: var(--portal-blue); font-size: 1.5rem; transition: transform .18s ease; }
.parent-report-toggle.is-open > b { transform: rotate(180deg); }
.parent-report-panel { padding: 22px; border-top: 1px solid #e1e9f2; background: #fbfdff; border-radius: 0 0 18px 18px; }
.simple-selector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.simple-selector-grid .portal-field { margin-bottom: 0; }
.selection-message { margin-top: 14px; padding: 14px 16px; border: 1px dashed #b9cadd; border-radius: 13px; color: var(--portal-muted); background: #fff; text-align: center; }
.selected-report { overflow: hidden; margin-top: 16px; border: 1px solid #d9e3ef; border-radius: 17px; background: #fff; }
.selected-report-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; border-bottom: 1px solid #e2e9f1; background: #f8fafc; }
.selected-report-header span { color: var(--portal-muted); font-size: .74rem; }
.selected-report-header h3 { margin: 3px 0 0; }
.study-selectors { margin-top: 26px; }
.study-selectors label > span { display: flex; align-items: center; gap: 8px; }
.study-selectors label > span b { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--portal-blue); font-size: .72rem; }
.selected-exam-card { display: grid; grid-template-columns: minmax(0,1fr) auto 190px; align-items: center; gap: 22px; margin-top: 16px; padding: 22px; border: 1px solid #cddbec; border-radius: 18px; background: linear-gradient(135deg,#fff,#f6faff); box-shadow: 0 12px 30px rgba(11,35,68,.06); }
.selected-exam-copy h3 { margin: 7px 0 10px; font-size: 1.25rem; }
.selected-exam-result { min-width: 120px; padding: 12px 15px; border-radius: 13px; color: #106b4e; background: #eaf9f3; text-align: center; }
.selected-exam-result span,.selected-exam-result strong { display: block; }
.selected-exam-result span { font-size: .68rem; }
.selected-exam-result strong { margin-top: 3px; font-size: 1.15rem; }
.selected-exam-card .portal-primary { width: 190px; }

@media (max-width: 760px) {
  .simple-selector-grid { grid-template-columns: 1fr; }
  .selected-exam-card { grid-template-columns: 1fr; }
  .selected-exam-card .portal-primary { width: 100%; }
  .selected-report-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .parent-report-toggle { padding: 16px; }
  .parent-report-toggle em { display: none; }
  .parent-report-panel { padding: 16px; }
}

/* Family account settings and subscription renewal */
.selector-header-actions { display: flex; align-items: center; gap: 10px; }
.student-access-summary { display: grid; justify-items: stretch; gap: 8px; min-width: min(100%, 260px); }
.subscription-renewal-reminder { padding: 9px 12px; border: 1px solid #e7b84f; border-radius: 12px; color: #77500a; background: #fff5d9; font: 800 .76rem/1.5 Cairo,sans-serif; cursor: pointer; }
.subscription-renewal-reminder:hover { background: #ffedb9; }
.family-settings-dialog { width: min(720px, calc(100% - 28px)); max-height: min(820px, calc(100dvh - 28px)); padding: 0; border: 0; border-radius: 24px; color: var(--portal-navy); background: #fff; box-shadow: 0 30px 90px rgba(4,22,48,.3); }
.family-settings-dialog::backdrop { background: rgba(4,22,48,.58); backdrop-filter: blur(4px); }
.family-settings-shell { max-height: min(820px, calc(100dvh - 28px)); overflow: auto; overscroll-behavior: contain; }
.family-settings-heading { position: sticky; top: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px 19px; border-bottom: 1px solid #dfe8f2; background: rgba(255,255,255,.96); backdrop-filter: blur(9px); }
.family-settings-heading span { color: var(--portal-blue); font-size: .72rem; font-weight: 800; }
.family-settings-heading h2 { margin: 2px 0 4px; font-size: 1.55rem; }
.family-settings-heading p { margin: 0; color: var(--portal-muted); font-size: .82rem; line-height: 1.7; }
.family-settings-close { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #d3dfec; border-radius: 13px; color: var(--portal-navy); background: #f7faff; font: 600 1.7rem/1 Arial,sans-serif; cursor: pointer; }
.family-settings-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 20px 26px 0; padding: 6px; border-radius: 15px; background: #edf3fa; }
.family-settings-tabs button { min-height: 44px; border: 0; border-radius: 11px; color: #627289; background: transparent; font: 800 .82rem Cairo,sans-serif; cursor: pointer; }
.family-settings-tabs button[aria-selected="true"] { color: var(--portal-navy); background: #fff; box-shadow: 0 6px 18px rgba(11,35,68,.1); }
.family-settings-panel { padding: 24px 26px 28px; }
.settings-panel-intro { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; padding: 16px; border: 1px solid #d8e5f2; border-radius: 15px; background: #f7faff; }
.settings-panel-intro > span { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--portal-blue); font-size: 1.25rem; }
.settings-panel-intro h3 { margin: 0 0 3px; font-size: 1.03rem; }
.settings-panel-intro p { margin: 0; color: var(--portal-muted); font-size: .78rem; line-height: 1.7; }
.family-settings-password-form { display: grid; gap: 14px; }
.family-settings-password-form .portal-field { margin: 0; }
.family-settings-password-form > .portal-primary { margin-top: 4px; }
.family-settings-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 160px; color: var(--portal-muted); font-weight: 700; }
.family-settings-loading > span { width: 22px; height: 22px; border: 3px solid #d9e5f1; border-top-color: var(--portal-blue); border-radius: 50%; animation: portal-spin .75s linear infinite; }
.family-renewal-students { display: grid; gap: 11px; }
.family-renewal-student { position: relative; display: grid; grid-template-columns: auto auto minmax(0,1fr); align-items: center; gap: 11px; padding: 15px; border: 1px solid #d5e1ee; border-radius: 15px; background: #fff; cursor: pointer; transition: border-color .15s ease,background .15s ease; }
.family-renewal-student:hover { border-color: #87b8ed; background: #f8fbff; }
.family-renewal-student input { position: absolute; opacity: 0; pointer-events: none; }
.family-renewal-check { width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid #b9c9da; border-radius: 8px; color: transparent; background: #fff; font-weight: 900; }
.family-renewal-student:has(input:checked) { border-color: var(--portal-blue); background: #f1f7ff; }
.family-renewal-student:has(input:checked) .family-renewal-check { color: #fff; border-color: var(--portal-blue); background: var(--portal-blue); }
.family-renewal-student-copy { min-width: 0; display: grid; gap: 2px; }
.family-renewal-student-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-renewal-student-copy small { color: var(--portal-muted); }
.family-renewal-student-copy em { width: fit-content; margin-top: 4px; padding: 4px 8px; border-radius: 999px; color: #17694f; background: #e5f7ef; font-size: .68rem; font-style: normal; font-weight: 800; }
.family-renewal-student[data-access="expiring"] .family-renewal-student-copy em { color: #77500a; background: #fff0c4; }
.family-renewal-student[data-access="expired"] .family-renewal-student-copy em,
.family-renewal-student[data-access="suspended"] .family-renewal-student-copy em { color: #a12636; background: #ffe8eb; }
.family-renewal-student.is-disabled { opacity: .72; cursor: default; background: #f7fafc; }
.family-renewal-student.is-disabled:hover { border-color: #d5e1ee; }
.family-renewal-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 17px; }
.family-renewal-actions a { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.family-renewal-actions [aria-disabled="true"] { opacity: .5; pointer-events: none; }
.family-renewal-note { margin: 11px 0 0; color: var(--portal-muted); font-size: .72rem; line-height: 1.7; text-align: center; }
.family-renewal-empty { margin: 0; padding: 30px 15px; color: var(--portal-muted); text-align: center; }
.child-access-status { width: fit-content; margin: 7px 0 0 !important; padding: 5px 9px; border-radius: 999px; color: #17694f !important; background: #e6f7ef; font-size: .69rem !important; font-weight: 800; }
.child-card[data-access="expiring"] .child-access-status { color: #77500a !important; background: #fff0c4; }
.child-card[data-access="expired"] .child-access-status,
.child-card[data-access="suspended"] .child-access-status { color: #a12636 !important; background: #ffe8eb; }

@media (max-width: 680px) {
  .selector-header-actions { gap: 6px; }
  .selector-header-actions .header-family-action { min-width: 44px; padding: 9px; }
  .selector-header-actions .header-family-action > span:last-child { display: none; }
  .student-access-summary { width: 100%; }
  .family-settings-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  .family-settings-shell { max-height: calc(100dvh - 16px); }
  .family-settings-heading { padding: 20px 18px 16px; }
  .family-settings-heading h2 { font-size: 1.3rem; }
  .family-settings-tabs { margin: 15px 18px 0; }
  .family-settings-tabs button { font-size: .74rem; }
  .family-settings-panel { padding: 19px 18px 22px; }
  .family-renewal-actions { grid-template-columns: 1fr; }
  .family-renewal-student { padding: 13px; }
}
