:root {
    --purple: #4B3B7A;
    --purple-dark: #35265f;
    --purple-soft: #eeeaf7;
    --cream: #FBF8F2;
    --gold: #D4AF37;
    --gold-soft: #f7edc9;
    --ink: #262231;
    --muted: #706a78;
    --white: #ffffff;
    --danger: #a83b48;
    --danger-bg: #fff0f1;
    --success: #276749;
    --success-bg: #ebf8f1;
    --border: #ded8e7;
    --card-radius: 18px;
    --control-radius: 11px;
    --panel-radius: 24px;
    --glass: rgba(255, 255, 255, .72);
    --glass-strong: rgba(255, 255, 255, .88);
    --glass-border: rgba(255, 255, 255, .82);
    --purple-gradient: linear-gradient(135deg, #4B3B7A 0%, #66519B 100%);
    --gold-gradient: linear-gradient(135deg, #E6C755 0%, #D4AF37 100%);
    --shadow-sm: 0 5px 16px rgba(58, 46, 92, .07);
    --shadow-md: 0 14px 36px rgba(58, 46, 92, .11);
    --shadow-lg: 0 24px 64px rgba(58, 46, 92, .16);
    --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, .78);
    --blur: 20px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --speed-fast: 180ms;
    --speed: 280ms;
    --mobile-text-scale: 1rem;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 5%, rgba(212, 175, 55, .09), transparent 24rem),
        var(--cream);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body,
.urdu-preview { font-family: Inter, "Noto Nastaliq Urdu", serif; }

button, input, select, textarea { font: inherit; }
a { color: var(--purple); font-weight: 700; text-underline-offset: 3px; }

.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;
}

.topbar {
    position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between;
    height: 68px; padding: 0 20px; background: rgba(251, 248, 242, .95); border-bottom: 1px solid rgba(75, 59, 122, .12);
}

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--purple); text-decoration: none; font-size: 1rem; }
.brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 50%; }

.menu-button {
    width: 44px; height: 44px; display: grid; place-content: center; gap: 5px; border: 0;
    border-radius: var(--control-radius); color: var(--purple); background: var(--purple-soft); cursor: pointer;
}
.menu-button span { display: block; width: 21px; height: 2px; background: currentColor; border-radius: 2px; }

.site-menu {
    position: absolute; inset-block-start: 58px; inset-inline-end: 18px; width: min(260px, calc(100vw - 36px));
    padding: 10px; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius);
    box-shadow: 0 10px 28px rgba(53, 38, 95, .12);
}
.site-menu strong { display: block; padding: 10px 12px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.site-menu a { display: block; padding: 12px; border-radius: 8px; text-decoration: none; font-size: .92rem; }
.site-menu a:hover { background: var(--purple-soft); }
.site-menu .menu-install {
    display: block; width: 100%; padding: 12px; border: 0; border-radius: 8px;
    color: var(--purple); background: transparent; font: inherit; font-size: .92rem;
    text-align: start; cursor: pointer;
}
.site-menu .menu-install:hover { background: var(--purple-soft); }
[data-install-app][hidden] { display: none !important; }
.site-menu .menu-logout { margin-top: 7px; padding-top: 14px; color: var(--danger); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.site-menu .menu-logout:hover { background: var(--danger-bg); }

.page-shell { min-height: calc(100vh - 68px); padding: 26px 18px 40px; display: grid; place-items: center; }
.splash { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; padding: 30px; background: var(--cream); z-index: 100; }
.splash img { width: min(280px, 72vw); aspect-ratio: 1; object-fit: contain; animation: rise .65s ease-out both; }
.splash p { margin: 10px 0 24px; color: var(--purple); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
.splash-loader { width: 140px; height: 3px; overflow: hidden; background: var(--purple-soft); border-radius: 10px; }
.splash-loader span { display: block; width: 100%; height: 100%; background: var(--gold); transform-origin: left; animation: load 3s linear both; }
html[dir="rtl"] .splash-loader span { transform-origin: right; }

@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.centered-card, .form-card {
    width: min(100%, 520px); padding: 26px 22px; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: var(--card-radius);
}
.logo-block { display: flex; justify-content: center; margin: -6px auto 10px; }
.logo-block img { width: 116px; height: 116px; object-fit: contain; }
.card-heading { margin-bottom: 22px; text-align: center; }
.card-heading h1 { margin: 5px 0 8px; color: var(--purple-dark); font-size: clamp(1.55rem, 7vw, 2.2rem); line-height: 1.2; }
.card-heading p { margin: 0; color: var(--muted); line-height: 1.65; }
.eyebrow { color: var(--gold) !important; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.language-options { display: grid; gap: 12px; }
.language-option {
    display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 14px; width: 100%; padding: 15px;
    text-align: start; color: var(--ink); background: var(--cream); border: 1px solid var(--border); border-radius: var(--card-radius); cursor: pointer;
    transition: border-color .2s, transform .2s, background .2s;
}
.language-option:hover, .language-option:focus-visible { border-color: var(--gold); background: var(--gold-soft); transform: translateY(-1px); outline: none; }
.language-option strong, .language-option small { display: block; }
.language-option small { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.language-mark { width: 50px; height: 50px; display: grid; place-items: center; color: var(--white); background: var(--purple); border-radius: 50%; font-size: .8rem; font-weight: 800; }

.auth-layout { width: min(100%, 940px); display: grid; gap: 24px; align-items: center; }
.auth-brand { display: none; text-align: center; color: var(--purple); font-weight: 700; letter-spacing: .08em; }
.auth-brand .logo-block img { width: min(300px, 80%); height: auto; }
.form-card { margin-inline: auto; }
.form-stack { display: grid; gap: 15px; }
.form-stack label { display: grid; gap: 7px; color: var(--purple-dark); font-size: .85rem; font-weight: 700; }
.form-stack input, .form-stack select, .form-stack textarea {
    width: 100%; min-height: 48px; padding: 11px 13px; color: var(--ink); background: var(--cream);
    border: 1px solid var(--border); border-radius: var(--control-radius); outline: none;
}
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(75, 59, 122, .10); }
.form-stack textarea { resize: vertical; }
.password-field { position: relative; display: block; }
.password-field input { padding-inline-end: 52px; }
.password-toggle {
    position: absolute; inset-block: 2px; inset-inline-end: 2px; width: 44px; display: grid; place-items: center;
    padding: 0; color: var(--purple); background: transparent; border: 0; border-radius: 7px; cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { background: var(--purple-soft); outline: none; }
.password-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-closed, .password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }
.button {
    min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px;
    border: 1px solid transparent; border-radius: var(--control-radius); text-align: center; text-decoration: none; font-weight: 800; cursor: pointer;
}
.button-primary { color: var(--white); background: var(--purple); }
.button-primary:hover { background: var(--purple-dark); }
.button-secondary { color: var(--purple); background: var(--white); border-color: var(--purple); }
.button-disabled { color: #817b88; background: #e8e5e9; cursor: not-allowed; }
.button.compact { min-height: 40px; padding: 8px 13px; font-size: .84rem; }
.form-footer { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: .88rem; }
.form-link-row { display: flex; justify-content: flex-end; margin-top: -4px; font-size: .84rem; }
html[dir="rtl"] .form-link-row { justify-content: flex-start; }
.text-link { display: block; margin-top: 20px; text-align: center; }

.alert { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: var(--control-radius); font-size: .86rem; line-height: 1.5; }
.alert p { margin: 0; }
.alert p + p { margin-top: 6px; }
.alert-error { color: var(--danger); background: var(--danger-bg); border-color: #efc4ca; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: #bfe3cf; }
.alert-success.is-toast {
    position: fixed; z-index: 220; inset-block-start: 88px; inset-inline-end: 18px;
    display: flex; align-items: center; gap: 12px; width: min(390px, calc(100vw - 24px));
    margin: 0; padding-block: 13px; padding-inline: 16px 44px; box-shadow: 0 16px 38px rgba(40,97,69,.18);
    animation: toast-in .2s ease-out both;
}
.alert-success.is-toast.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease; }
.toast-close {
    position: absolute; inset-inline-end: 8px; inset-block-start: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: var(--success);
    background: transparent; font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.toast-close:hover,.toast-close:focus-visible { background: rgba(40,97,69,.1); outline: none; }
.field-help { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; line-height: 1.45; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

.setup-card .button { width: 100%; margin-top: 12px; }
.placeholder-panel { padding: 22px; text-align: center; color: var(--muted); background: var(--cream); border: 1px dashed var(--gold); border-radius: var(--card-radius); }
.placeholder-icon, .large-icon { margin-bottom: 8px; color: var(--gold); font-size: 2rem; }
.status-card { text-align: center; }
.status-pill { display: inline-flex; margin-bottom: 18px; padding: 7px 13px; color: var(--purple); background: var(--purple-soft); border-radius: 99px; font-size: .78rem; font-weight: 800; text-transform: capitalize; }
.narrow-card { max-width: 440px; }
.admin-card { border-top: 4px solid var(--gold); }
.admin-shell { width: min(100%, 960px); align-self: start; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.admin-heading h1 { margin: 3px 0 0; color: var(--purple-dark); }
.metric-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-grid article { min-height: 135px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); }
.metric-grid span { color: var(--muted); font-size: .84rem; }
.metric-grid strong { color: var(--purple); font-size: 2rem; }

.dashboard-shell, .attendance-shell { width: min(100%, 980px); align-self: start; }
.dashboard-welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dashboard-welcome h1, .attendance-heading h1 { margin: 3px 0 4px; color: var(--purple-dark); font-size: clamp(1.7rem, 8vw, 2.5rem); }
.dashboard-welcome p { margin: 0; color: var(--muted); }
.dashboard-welcome .academy-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin-top: 8px; }
.academy-name span, .academy-name strong { font-size: clamp(1.2rem, 5vw, 1.65rem); font-weight: 800; line-height: 1.25; }
.academy-name span { color: var(--gold); }
.academy-name strong { color: var(--purple-dark); }
.dashboard-welcome .status-pill { flex: 0 0 auto; margin: 4px 0 0; }
.academy-switcher { display: grid; gap: 7px; margin-bottom: 24px; }
.academy-switcher label, .course-filter label { color: var(--purple-dark); font-size: .78rem; font-weight: 800; }
.academy-switcher select, .course-filter select, .date-control input {
    width: 100%; min-height: 46px; padding: 9px 12px; color: var(--ink); background: var(--white);
    border: 1px solid var(--border); border-radius: var(--control-radius); outline: none;
}
.academy-switcher select:focus, .course-filter select:focus, .date-control input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(75, 59, 122, .1); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.section-title h2 { margin: 0; color: var(--purple-dark); font-size: 1rem; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.summary-card { min-height: 132px; padding: 14px 10px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); }
.summary-card strong { margin-top: auto; color: var(--purple-dark); font-size: clamp(1.15rem, 5vw, 1.65rem); }
.summary-card p { margin: 4px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.3; }
.summary-icon { width: 31px; height: 31px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 8px; font-size: .82rem; font-weight: 800; }
.summary-icon.purple { color: var(--purple); background: var(--purple-soft); }
.summary-icon.green { color: var(--success); background: var(--success-bg); }
.summary-icon.gold { color: #725b0a; background: var(--gold-soft); }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.action-card { min-height: 112px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 16px; color: var(--purple-dark); background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); text-decoration: none; }
.action-card > span { width: 35px; height: 35px; display: grid; place-items: center; color: var(--purple); background: var(--purple-soft); border-radius: 9px; font-size: 1.1rem; }
.action-card strong { font-size: .88rem; }
.action-card small { color: var(--muted); font-size: .6rem; font-weight: 500; }
.action-card.primary-action { color: var(--white); background: var(--purple); border-color: var(--purple); }
.action-card.primary-action > span { color: var(--purple); background: var(--gold); }
.action-card.is-upcoming { opacity: .75; cursor: default; }

.attendance-heading { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; margin-bottom: 20px; }
.attendance-heading h1 { font-size: clamp(1.55rem, 7vw, 2.2rem); }
.attendance-heading .eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.back-link, .date-nav { width: 44px; height: 44px; display: grid; place-items: center; color: var(--purple); background: var(--white); border: 1px solid var(--border); border-radius: var(--control-radius); text-decoration: none; font-size: 1.8rem; line-height: 1; }
html[dir="rtl"] .back-link { transform: scaleX(-1); }
.date-badge { padding: 7px 10px; color: #725b0a; background: var(--gold-soft); border-radius: 99px; font-size: .7rem; font-weight: 800; }
.inline-filter { margin-bottom: 12px; }
.attendance-controls { display: grid; grid-template-columns: 44px 1fr 44px; align-items: end; gap: 9px; margin-bottom: 12px; }
.date-nav.disabled { color: #aaa4ae; background: #eeeadd; }
.date-control { display: grid; gap: 5px; color: var(--purple-dark); font-size: .72rem; font-weight: 800; }
.audit-notice { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; padding: 10px 12px; color: #725b0a; background: var(--gold-soft); border: 1px solid #ead27e; border-radius: var(--control-radius); font-size: .72rem; line-height: 1.45; }
.course-filter { display: grid; gap: 6px; margin-bottom: 16px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 17px 0 10px; }
.list-toolbar > div { display: grid; gap: 3px; }
.list-toolbar strong { color: var(--purple-dark); }
.list-toolbar small { color: var(--muted); font-size: .7rem; }
.mark-all-button { min-height: 42px; padding: 8px 11px; color: var(--success); background: var(--success-bg); border-color: #abd5be; font-size: .72rem; }
.student-list { display: grid; gap: 8px; }
.student-row { position: relative; min-height: 72px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 10px; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); }
.student-row[data-status="present"] { border-inline-start: 4px solid var(--success); }
.student-row[data-status="absent"] { border-inline-start: 4px solid var(--danger); }
.student-row[data-status="leave"] { border-inline-start: 4px solid var(--gold); }
.student-identity { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 9px; padding: 2px; color: var(--ink); background: transparent; border: 0; text-align: start; cursor: pointer; }
.student-identity strong, .student-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-identity strong { font-size: .84rem; }
.student-identity small { margin-top: 3px; color: var(--muted); font-size: .65rem; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; color: var(--purple); background: var(--purple-soft); border-radius: 50%; font-size: .84rem; font-weight: 800; }
.attendance-buttons { display: flex; gap: 5px; }
.status-button { width: 42px; height: 42px; padding: 0; border: 1px solid; border-radius: 9px; font-weight: 900; cursor: pointer; transition: transform .12s; }
.status-button:active { transform: scale(.94); }
.status-button.present { color: var(--success); background: var(--success-bg); border-color: #b7dbc6; }
.status-button.absent { color: var(--danger); background: var(--danger-bg); border-color: #efc4ca; }
.status-button.leave { color: #725b0a; background: var(--gold-soft); border-color: #ead27e; }
.status-button.active.present { color: var(--white); background: var(--success); border-color: var(--success); }
.status-button.active.absent { color: var(--white); background: var(--danger); border-color: var(--danger); }
.status-button.active.leave { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.status-button:disabled { cursor: wait; opacity: .55; }
.save-indicator { position: absolute; inset-block-start: -5px; inset-inline-end: -4px; width: 19px; height: 19px; display: grid; place-items: center; color: var(--white); background: var(--purple); border-radius: 50%; font-size: .65rem; font-weight: 900; }
.empty-state { padding: 40px 22px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed var(--border); border-radius: var(--card-radius); }
.empty-state span { color: var(--gold); font-size: 2rem; }

.update-sheet { width: 100%; max-width: none; height: 100%; max-height: none; padding: 0; margin: 0; background: transparent; border: 0; overflow: hidden; }
.update-sheet::backdrop { background: rgba(26, 18, 44, .48); }
.sheet-backdrop { position: absolute; inset: 0; }
.sheet-backdrop button { width: 100%; height: 100%; padding: 0; background: transparent; border: 0; }
.sheet-panel { position: absolute; inset-inline: 0; bottom: 0; max-height: 88vh; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; background: var(--cream); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(35, 25, 60, .18); }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 18px; background: #c8c1ce; border-radius: 99px; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-heading h2 { margin: 3px 0 0; color: var(--purple-dark); font-size: 1.35rem; }
.sheet-close { width: 42px; height: 42px; padding: 0; color: var(--purple); background: var(--purple-soft); border: 0; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.test-fields { display: grid; gap: 15px; padding: 14px; background: var(--gold-soft); border-radius: var(--card-radius); }
.toggle-row { display: flex !important; grid-template-columns: auto !important; align-items: center; gap: 10px !important; cursor: pointer; }
.toggle-row > input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-control { position: relative; width: 44px; height: 25px; flex: 0 0 auto; background: #c9c4ce; border-radius: 99px; }
.toggle-control::after { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: var(--white); border-radius: 50%; transition: transform .2s; }
.toggle-row input:checked + .toggle-control { background: var(--purple); }
.toggle-row input:checked + .toggle-control::after { transform: translateX(19px); }
html[dir="rtl"] .toggle-control::after { left: auto; right: 3px; }
html[dir="rtl"] .toggle-row input:checked + .toggle-control::after { transform: translateX(-19px); }
.sheet-feedback { min-height: 20px; color: var(--success); font-size: .78rem; font-weight: 700; }

.management-shell { width: min(100%, 1040px); align-self: start; }
.narrow-management { max-width: 680px; }
.screen-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 12px; margin-bottom: 24px; }
.screen-heading:has(.icon-action) { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.screen-heading h1 { margin: 3px 0 5px; color: var(--purple-dark); font-size: clamp(1.65rem, 7vw, 2.35rem); line-height: 1.15; }
.screen-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.screen-heading .eyebrow { color: var(--gold); }
.icon-action { width: 44px; height: 44px; display: grid; place-items: center; color: var(--white); background: var(--purple); border-radius: var(--control-radius); text-decoration: none; font-size: 1.45rem; }
.management-grid { display: grid; gap: 24px; align-items: start; }
.management-form, .student-form { width: 100%; }
.text-start { text-align: start; }
.text-start h2 { margin: 0; color: var(--purple-dark); font-size: 1.18rem; }
.duration-guide { display: grid; gap: 10px; padding: 15px; color: var(--ink); background: var(--gold-soft); border: 1px solid #ead27e; border-radius: var(--card-radius); }
.duration-guide > strong { color: #725b0a; font-size: .84rem; }
.duration-guide div { padding-top: 9px; border-top: 1px solid rgba(114, 91, 10, .18); }
.duration-guide span { color: var(--purple-dark); font-size: .75rem; font-weight: 800; }
.duration-guide p { margin: 3px 0 0; color: #655c42; font-size: .7rem; line-height: 1.5; }
.records-column { min-width: 0; }
.course-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; padding: 16px; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); }
.course-card h3 { margin: 0 0 8px; color: var(--purple-dark); font-size: .98rem; }
.course-card small { display: block; margin-top: 7px; color: var(--muted); font-size: .68rem; }
.duration-badge { display: inline-flex; padding: 5px 8px; color: #725b0a; background: var(--gold-soft); border-radius: 99px; font-size: .65rem; font-weight: 800; }
.record-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.record-actions form { margin: 0; }
.button-danger { color: var(--danger); background: var(--danger-bg); border-color: #efc4ca; }
.button-danger:hover { color: var(--white); background: var(--danger); }
.button-danger:disabled { color: #958d98; background: #eeeadd; border-color: #ddd8df; cursor: not-allowed; }
.course-required h2 { color: var(--purple-dark); font-size: 1.1rem; }
.course-required .button { margin-top: 12px; }

.student-filters { margin-bottom: 18px; padding: 14px; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); }
.search-field { position: relative; display: block; margin-bottom: 12px; }
.search-field > span[aria-hidden] { position: absolute; inset-inline-start: 13px; top: 50%; color: var(--purple); transform: translateY(-50%); font-size: 1.3rem; }
.search-field input { width: 100%; min-height: 48px; padding: 10px 13px; padding-inline-start: 43px; color: var(--ink); background: var(--cream); border: 1px solid var(--border); border-radius: var(--control-radius); outline: none; }
.search-field input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(75, 59, 122, .1); }
.filter-grid { display: grid; gap: 10px; }
.filter-grid label { display: grid; gap: 5px; color: var(--purple-dark); font-size: .7rem; font-weight: 800; }
.filter-grid select { width: 100%; min-height: 44px; padding: 8px 10px; background: var(--cream); border: 1px solid var(--border); border-radius: var(--control-radius); }
.filter-actions { display: flex; gap: 8px; margin-top: 12px; }
.filter-actions .button { flex: 1; }
.profile-list { display: grid; gap: 8px; }
.profile-row { min-height: 76px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto 18px; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink); background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); text-decoration: none; }
.profile-row:hover { border-color: var(--purple); }
.profile-row-main { min-width: 0; }
.profile-row-main strong, .profile-row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row-main strong { color: var(--purple-dark); font-size: .86rem; }
.profile-row-main small { margin-top: 4px; color: var(--muted); font-size: .67rem; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.profile-row .profile-badges { max-width: 118px; justify-content: flex-end; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: .59rem; font-weight: 800; white-space: nowrap; }
.badge-active, .badge-paid { color: var(--success); background: var(--success-bg); }
.badge-completed { color: var(--purple); background: var(--purple-soft); }
.badge-incomplete, .badge-unpaid { color: var(--danger); background: var(--danger-bg); }
.row-chevron { color: var(--gold); font-size: 1.35rem; }

.profile-shell { max-width: 900px; }
.student-profile-hero { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 14px; align-items: center; margin-bottom: 16px; padding: 18px; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); }
.large-avatar { width: 64px; height: 64px; display: grid; place-items: center; color: var(--purple); background: var(--purple-soft); border-radius: 50%; font-size: 1.4rem; font-weight: 800; }
.student-profile-hero h2 { margin: 0; color: var(--purple-dark); font-size: 1.25rem; }
.student-profile-hero p { margin: 4px 0 8px; color: var(--muted); font-size: .78rem; }
.student-profile-hero > .button { grid-column: 1 / -1; }
.profile-summary { margin-bottom: 16px; }
.summary-icon.red { color: var(--danger); background: var(--danger-bg); }
.profile-section { margin-bottom: 14px; padding: 18px; background: var(--white); border: 1px solid var(--border); border-radius: var(--card-radius); }
.profile-section > h2 { margin: 0 0 16px; color: var(--purple-dark); font-size: 1rem; }
.edit-section summary { color: var(--purple); font-weight: 800; cursor: pointer; }
.edit-section[open] summary { margin-bottom: 18px; }
.muted-copy { margin: 0; color: var(--muted); font-size: .8rem; }
.timeline { display: grid; }
.timeline article { position: relative; display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 14px; padding: 0 0 20px; }
.timeline article:not(:last-child)::after { content: ''; position: absolute; inset-inline-start: 93px; top: 21px; bottom: 4px; width: 1px; background: var(--border); }
.timeline time { color: var(--muted); font-size: .66rem; }
.timeline article > div { position: relative; padding-inline-start: 15px; }
.timeline article > div::before { content: ''; position: absolute; inset-inline-start: 0; top: 5px; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }
.timeline strong { color: var(--purple-dark); font-size: .82rem; }
.timeline p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.rating { display: block; margin-top: 6px; color: var(--gold); letter-spacing: 2px; font-size: .7rem; }
.test-grid { display: grid; gap: 9px; }
.test-card { position: relative; padding: 14px; background: var(--cream); border: 1px solid var(--border); border-radius: var(--control-radius); }
.test-card time { color: var(--muted); font-size: .65rem; }
.test-card h3 { margin: 6px 0; color: var(--purple-dark); font-size: .86rem; }
.test-card > strong { color: var(--purple); }
.test-card.final-test { border: 2px solid var(--gold); background: var(--gold-soft); }
.final-label { position: absolute; inset-block-start: 9px; inset-inline-end: 9px; padding: 4px 7px; color: #725b0a; background: var(--white); border-radius: 99px; font-size: .58rem; font-weight: 800; }

.month-navigation { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; gap:10px; margin-bottom:13px; padding:12px; background:var(--white); border:1px solid var(--border); border-radius:var(--card-radius); }
.month-navigation > div { display:grid; justify-items:center; gap:3px; }
.month-navigation span { color:var(--muted); font-size:.65rem; }
.month-navigation strong { color:var(--purple-dark); font-size:1rem; }
.fee-overview { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:center; gap:10px; margin-bottom:13px; padding:15px; background:var(--white); border:1px solid var(--border); border-radius:var(--card-radius); }
.fee-overview .summary-icon { margin:0; }
.fee-overview strong { color:var(--danger); font-size:1.5rem; }
.fee-overview p { margin:2px 0 0; color:var(--muted); font-size:.72rem; }
.fee-overview .button { grid-column:1/-1; }
.permission-card { margin-bottom:13px; padding:15px; background:var(--gold-soft); border:1px solid #ead27e; border-radius:var(--card-radius); }
.permission-card > div > strong { color:var(--purple-dark); font-size:.86rem; }
.permission-card p { margin:4px 0 13px; color:#655c42; font-size:.7rem; line-height:1.5; }
.permission-card .toggle-row b { color:var(--purple-dark); font-size:.74rem; }
.permission-card > small { display:block; min-height:17px; margin-top:8px; color:var(--success); font-weight:700; }
.fee-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-bottom:14px; padding:13px; background:var(--white); border:1px solid var(--border); border-radius:var(--card-radius); }
.fee-filters label { display:grid; gap:5px; color:var(--purple-dark); font-size:.7rem; font-weight:800; }
.fee-filters select { min-width:0; min-height:43px; padding:8px; background:var(--cream); border:1px solid var(--border); border-radius:var(--control-radius); }
.fee-filters .button { grid-column:1/-1; }
.fee-list { display:grid; gap:8px; }
.fee-row { position:relative; min-height:78px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; padding:10px; background:var(--white); border:1px solid var(--border); border-radius:var(--card-radius); }
.fee-row .student-identity { cursor:default; }
.fee-row[data-status="paid"] { border-inline-start:4px solid var(--success); }
.fee-row[data-status="unpaid"] { border-inline-start:4px solid var(--danger); }
.fee-toggle { display:flex; gap:5px; }
.fee-status-button { min-width:62px; min-height:42px; padding:7px 9px; border:1px solid; border-radius:9px; font-size:.68rem; font-weight:800; cursor:pointer; }
.fee-status-button.paid { color:var(--success); background:var(--success-bg); border-color:#b7dbc6; }
.fee-status-button.unpaid { color:var(--danger); background:var(--danger-bg); border-color:#efc4ca; }
.fee-status-button.paid.active { color:var(--white); background:var(--success); border-color:var(--success); }
.fee-status-button.unpaid.active { color:var(--white); background:var(--danger); border-color:var(--danger); }
.fee-status-button:disabled { opacity:.55; cursor:wait; }
.fee-save-indicator { position:absolute; inset-block-start:-5px; inset-inline-end:-4px; width:19px; height:19px; display:grid; place-items:center; color:var(--white); background:var(--purple); border-radius:50%; font-size:.65rem; font-weight:900; }
.due-shell { max-width:780px; }
.due-document-preview { overflow:hidden; margin-bottom:14px; background:var(--white); border:1px solid var(--border); border-radius:var(--card-radius); }
.due-document-preview > header { display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:9px; padding:14px; border-bottom:3px solid var(--purple); }
.due-document-preview header img { width:48px; height:48px; object-fit:contain; }
.due-document-preview header div { display:grid; }
.due-document-preview header div strong { color:var(--purple); font-size:1.05rem; }
.due-document-preview header div span { color:#8a7220; font-size:.55rem; letter-spacing:.08em; text-transform:uppercase; }
.due-document-preview header > b { color:var(--purple-dark); font-size:.7rem; }
.due-preview-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 14px 10px; }
.due-preview-heading h2 { margin:0; color:var(--purple-dark); font-size:1rem; }
.due-preview-heading span { padding:5px 8px; color:var(--danger); background:var(--danger-bg); border-radius:99px; font-size:.62rem; font-weight:800; }
.due-preview-list { padding:0 14px 14px; }
.due-preview-list article { display:grid; grid-template-columns:24px minmax(0,1fr) auto; align-items:center; gap:9px; padding:10px 0; border-bottom:1px solid var(--border); }
.due-preview-list article > b { width:24px; height:24px; display:grid; place-items:center; color:var(--purple); background:var(--purple-soft); border-radius:50%; font-size:.65rem; }
.due-preview-list article div { min-width:0; display:grid; gap:3px; }
.due-preview-list article div strong { overflow:hidden; color:var(--purple-dark); font-size:.8rem; text-overflow:ellipsis; white-space:nowrap; }
.due-preview-list article div span, .due-preview-list article p small { color:var(--muted); font-size:.6rem; }
.due-preview-list article p { display:grid; gap:2px; margin:0; text-align:end; font-size:.7rem; }
.due-document-preview footer { padding:10px 14px; color:var(--muted); background:var(--cream); border-top:1px solid var(--gold); font-size:.58rem; text-align:center; }
.due-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.due-actions .button:disabled { opacity:.5; cursor:not-allowed; }
.due-actions .button[aria-disabled="true"] { opacity:.5; cursor:wait; pointer-events:none; }
.report-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.report-options-card { width:100%; }
.report-type-options { display:grid; gap:9px; margin:0; padding:0; border:0; }
.report-type-options legend { margin-bottom:7px; color:var(--purple-dark); font-size:.85rem; font-weight:800; }
.report-type-card { position:relative; display:block!important; cursor:pointer; }
.report-type-card input { position:absolute; opacity:0; pointer-events:none; }
.report-type-card > span { display:block; padding:15px; background:var(--cream); border:1px solid var(--border); border-radius:var(--card-radius); }
.report-type-card b,.report-type-card small { display:block; }
.report-type-card b { color:var(--purple-dark); font-size:.85rem; }
.report-type-card small { margin-top:5px; color:var(--muted); font-size:.68rem; line-height:1.45; }
.report-type-card input:checked + span { background:var(--purple-soft); border:2px solid var(--purple); box-shadow:inset 4px 0 0 var(--gold); }
html[dir="rtl"] .report-type-card input:checked + span { box-shadow:inset -4px 0 0 var(--gold); }
.report-type-card.disabled { opacity:.55; cursor:not-allowed; }
.report-language-field select { cursor:pointer; border-color:rgba(212,175,55,.7); background-color:var(--white); }
.report-language-field select:hover { border-color:var(--gold); }
.report-preview-shell { max-width:920px; }
.pdf-preview { height:min(68vh,760px); margin-bottom:13px; overflow:hidden; background:#5c5862; border:1px solid var(--border); border-radius:var(--card-radius); }
.pdf-preview iframe { width:100%; height:100%; border:0; }
.due-pdf-preview { height:min(68vh,760px); }

.account-type-options { display:grid; gap:12px; }
.account-type-options form { margin:0; }
.account-type-card { width:100%; min-height:112px; display:grid; grid-template-columns:48px minmax(0,1fr) 18px; align-items:center; gap:12px; padding:16px; color:var(--purple-dark); background:var(--white); border:1px solid var(--border); border-radius:var(--card-radius); font:inherit; text-align:start; text-decoration:none; cursor:pointer; }
.account-type-card:hover,.account-type-card:focus-visible { border-color:var(--gold); outline:3px solid var(--gold-soft); }
.account-type-card > span:nth-child(2) { min-width:0; }
.account-type-card strong,.account-type-card small { display:block; }
.account-type-card strong { font-size:1rem; line-height:1.3; }
.account-type-card small { margin-top:5px; color:var(--muted); font-size:.72rem; line-height:1.5; }
.account-type-card > b { color:var(--gold); font-size:1.5rem; }
.account-type-icon { width:48px; height:48px; display:grid!important; place-items:center; color:var(--purple); background:var(--purple-soft); border-radius:50%; font-size:1.1rem; }
.account-type-card.solo-card { color:var(--white); background:var(--purple); border-color:var(--purple); }
.account-type-card.solo-card small { color:#eee9fa; }
.account-type-card.solo-card .account-type-icon { color:var(--purple-dark); background:var(--gold); }
.solo-account-badge { width:max-content; margin:8px 0 0; padding:5px 10px; color:var(--purple-dark); background:var(--gold-soft); border:1px solid var(--gold); border-radius:99px; font-size:.72rem; font-weight:800; }

/* Nastaliq glyphs extend well above and below the baseline, so Urdu needs
   deliberate vertical breathing room instead of the compact Latin metrics. */
html[dir="rtl"] .setup-card .logo-block { margin-bottom:18px; }
html[dir="rtl"] .setup-card .card-heading { margin-bottom:28px; }
html[dir="rtl"] .setup-card .card-heading h1 { margin-block:0 6px; line-height:2; }
html[dir="rtl"] .setup-card .card-heading p { line-height:2.1; }
html[dir="rtl"] .account-type-card { min-height:132px; padding-block:19px; }
html[dir="rtl"] .account-type-card strong { line-height:2; }
html[dir="rtl"] .account-type-card small { margin-top:1px; line-height:2.1; }

@media (max-width: 390px) {
    .student-row { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 7px; }
    .student-identity { grid-template-columns: 34px minmax(0, 1fr); gap: 6px; }
    .avatar { width: 34px; height: 34px; }
    .status-button { width: 37px; height: 40px; }
    .profile-row { grid-template-columns: 38px minmax(0,1fr) 18px; }
    .profile-row .avatar { width: 38px; height: 38px; }
    .profile-row .profile-badges { grid-column: 2 / 3; justify-content: flex-start; max-width: none; }
    .profile-row .row-chevron { grid-column: 3; grid-row: 1 / 3; }
}

/* Public landing page */
[data-pwa-splash][hidden] { display: none !important; }
.landing-page {
    width: min(100%, 1120px);
    display: grid;
    gap: 34px;
    margin: 0 auto;
    color: #3A2E5C;
}
.landing-header,
.landing-brand,
.landing-nav,
.landing-actions,
.landing-trust,
.landing-footer,
.landing-footer nav {
    display: flex;
    align-items: center;
}
.landing-header { justify-content: space-between; gap: 22px; }
.landing-brand { gap: 10px; color: inherit; text-decoration: none; font-size: 1.08rem; font-weight: 800; }
.landing-brand img { width: 48px; height: 48px; object-fit: contain; }
.landing-nav { gap: 22px; }
.landing-nav > a:not(.button),
.landing-language-link,
.landing-footer a { color: #4B3B7A; font-weight: 700; text-decoration: none; }
.landing-nav > a:not(.button):hover,
.landing-language-link:hover,
.landing-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.landing-nav .compact { min-height: 42px; padding: 9px 17px; }
.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    align-items: center;
    gap: clamp(34px, 7vw, 82px);
    padding: clamp(34px, 6vw, 72px);
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 10%, rgba(212,175,55,.19), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,.97), rgba(247,243,251,.98));
    border: 1px solid rgba(75,59,122,.14);
    border-radius: 30px;
    box-shadow: 0 24px 60px rgba(58,46,92,.1);
}
.landing-copy { min-width: 0; }
.landing-dua-block { width: fit-content; margin: 0 0 20px; text-align: center; }
.landing-dua,
.landing-dua-meaning { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; }
.landing-dua { margin: 0; color: #4B3B7A; font-size: clamp(1.55rem, 2.5vw, 2rem); line-height: 1.9; }
.landing-dua-meaning { margin: -4px 0 0; color: #9A6F08; font-size: .82rem; line-height: 2; }
.landing-page .eyebrow { margin: 0 0 10px; color: #B68516; font-size: .78rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.landing-copy h1 { max-width: 680px; margin: 0; color: #3A2E5C; font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1.04; letter-spacing: -.045em; }
.landing-intro { max-width: 650px; margin: 22px 0 0; color: #6B5F8A; font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.72; }
.landing-actions { flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.landing-actions .button { min-width: 150px; }
.landing-language-link { display: inline-block; margin-top: 18px; font-size: .88rem; }
.landing-visual {
    position: relative;
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 22px;
    background: #FFFFFF;
    border: 1px solid #DDD4EC;
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(58,46,92,.13);
    transform: rotate(1.5deg);
}
.landing-visual::before { content: ''; position: absolute; inset: 10px -12px -12px 12px; z-index: -1; background: #F3E8B7; border-radius: inherit; opacity: .62; }
.landing-visual-brand { display: grid; grid-template-columns: 48px 1fr; column-gap: 10px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid #4B3B7A; }
.landing-visual-brand img { grid-row: 1 / 3; width: 48px; height: 48px; object-fit: contain; }
.landing-visual-brand strong { align-self: end; font-size: 1.13rem; }
.landing-visual-brand span { align-self: start; color: #B68516; font-size: .68rem; font-weight: 700; }
.landing-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.landing-mini-grid article { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; min-width: 0; padding: 12px; background: #FBF8F2; border: 1px solid #EEE8F5; border-radius: 13px; }
.landing-mini-grid b { display: grid; place-items: center; width: 34px; height: 34px; color: #FFFFFF; background: #58448F; border-radius: 10px; }
.landing-mini-grid span { min-width: 0; font-size: .77rem; font-weight: 800; overflow-wrap: anywhere; }
.landing-report-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 14px; background: #EEEAF7; border-radius: 12px; font-size: .76rem; }
.landing-report-strip b { color: #276749; }
.landing-trust { justify-content: center; flex-wrap: wrap; gap: 12px 34px; color: #6B5F8A; font-size: .88rem; font-weight: 800; }
.landing-trust span::before { content: '✓'; margin-inline-end: 7px; color: #B68516; }
.landing-features { scroll-margin-top: 24px; }
.landing-section-heading { max-width: 720px; margin-bottom: 22px; }
.landing-section-heading h2,
.landing-audience h2 { margin: 0; color: #3A2E5C; font-size: clamp(1.7rem, 3vw, 2.55rem); line-height: 1.16; }
.landing-section-heading > p:last-child,
.landing-audience > div > p:last-child { margin: 12px 0 0; color: #6B5F8A; line-height: 1.7; }
.landing-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }
.landing-feature-grid article { min-width: 0; padding: 22px; background: rgba(255,255,255,.88); border: 1px solid #DDD4EC; border-radius: 20px; box-shadow: 0 13px 28px rgba(58,46,92,.06); }
.landing-feature-grid article > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 17px; color: #FFFFFF; background: #58448F; border-radius: 12px; font-size: 1.1rem; font-weight: 900; }
.landing-feature-grid h3 { margin: 0 0 9px; color: #3A2E5C; font-size: 1.05rem; }
.landing-feature-grid p { margin: 0; color: #6B5F8A; font-size: .88rem; line-height: 1.62; }
.landing-content-section { min-width: 0; }
.landing-step-grid,
.landing-record-grid,
.landing-workflow-grid,
.landing-confidence-grid { display: grid; gap: 15px; }
.landing-step-grid,
.landing-record-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.landing-workflow-grid,
.landing-confidence-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.landing-step-grid article,
.landing-record-grid article,
.landing-workflow-grid article,
.landing-confidence-grid article { min-width: 0; padding: 24px; background: rgba(255,255,255,.88); border: 1px solid #DDD4EC; border-radius: 20px; box-shadow: 0 13px 28px rgba(58,46,92,.06); }
.landing-step-grid article > span { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 16px; color: #3A2E5C; background: #F1D77A; border-radius: 50%; font-weight: 900; }
.landing-step-grid h3,
.landing-record-grid h3,
.landing-workflow-grid h3,
.landing-confidence-grid h2 { margin: 0 0 10px; color: #3A2E5C; font-size: 1.08rem; line-height: 1.35; }
.landing-step-grid p,
.landing-record-grid p,
.landing-workflow-grid p,
.landing-confidence-grid p { margin: 0; color: #6B5F8A; font-size: .9rem; line-height: 1.7; }
.landing-confidence-grid article { padding: clamp(24px, 4vw, 36px); background: linear-gradient(145deg, #FFFFFF, #F7F3FB); }
.landing-confidence-grid h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.landing-faq-list { display: grid; gap: 10px; }
.landing-faq-list details { padding: 0 20px; background: rgba(255,255,255,.9); border: 1px solid #DDD4EC; border-radius: 15px; }
.landing-faq-list summary { padding: 17px 28px 17px 0; color: #3A2E5C; cursor: pointer; font-weight: 800; line-height: 1.45; }
.landing-faq-list p { margin: 0; padding: 0 0 18px; color: #6B5F8A; font-size: .9rem; line-height: 1.7; }
html[dir="rtl"] .landing-faq-list summary { padding: 17px 0 17px 28px; }
.landing-audience { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: clamp(26px, 5vw, 48px); background: #4B3B7A; border-radius: 26px; box-shadow: 0 20px 45px rgba(58,46,92,.14); }
.landing-audience > div { max-width: 720px; }
.landing-audience h2 { color: #FFFFFF; }
.landing-audience > div > p:last-child { color: #E7DFF2; }
.landing-audience .button { flex: 0 0 auto; color: #3A2E5C; background: #F1D77A; border-color: #F1D77A; }
.landing-footer { justify-content: space-between; gap: 18px; padding: 6px 4px 14px; color: #6B5F8A; font-size: .82rem; }
.landing-footer nav { flex-wrap: wrap; gap: 18px; }
html[dir="rtl"] .landing-copy h1 { letter-spacing: 0; line-height: 1.45; }
html[dir="rtl"] .landing-page .eyebrow { letter-spacing: 0; }
html[dir="rtl"] .landing-intro,
html[dir="rtl"] .landing-section-heading > p:last-child,
html[dir="rtl"] .landing-audience > div > p:last-child { line-height: 2; }
@media (max-width: 900px) {
    .landing-hero { grid-template-columns: 1fr; }
    .landing-visual { width: min(100%, 560px); margin-inline: auto; transform: none; }
    .landing-feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .landing-step-grid,
    .landing-record-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .landing-page { gap: 27px; }
    .landing-header { align-items: flex-start; }
    .landing-brand img { width: 42px; height: 42px; }
    .landing-nav { gap: 8px; }
    .landing-nav > a:not(.button) { display: none; }
    .landing-hero { padding: 27px 20px 30px; border-radius: 22px; }
    .landing-dua-block { margin-bottom: 16px; }
    .landing-copy h1 { font-size: clamp(2.05rem, 11vw, 3rem); }
    .landing-actions { align-items: stretch; }
    .landing-actions .button { flex: 1 1 100%; width: 100%; }
    .landing-visual { padding: 16px; border-radius: 18px; }
    .landing-mini-grid { grid-template-columns: 1fr; }
    .landing-feature-grid { grid-template-columns: 1fr; }
    .landing-workflow-grid,
    .landing-confidence-grid { grid-template-columns: 1fr; }
    .landing-audience { align-items: stretch; flex-direction: column; border-radius: 22px; }
    .landing-audience .button { width: 100%; }
    .landing-footer { align-items: flex-start; flex-direction: column; }
    html[dir="rtl"] .landing-copy { padding-inline: 5px; }
    html[dir="rtl"] .landing-copy h1 { font-size: 1.9rem; line-height: 1.7; }
}

@media (min-width: 760px) {
    .page-shell { padding: 46px 28px; }
    .auth-layout { grid-template-columns: 1fr 1fr; }
    .auth-brand { display: block; }
    .form-card { padding: 34px; }
    .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary-card { padding: 18px; }
    .summary-card p { font-size: .78rem; }
    .sheet-panel { inset-inline-start: 50%; width: min(600px, 100%); transform: translateX(-50%); border-radius: 18px 18px 0 0; }
    html[dir="rtl"] .sheet-panel { transform: translateX(50%); }
    .management-grid { grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); }
    .filter-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .student-profile-hero { grid-template-columns: 72px minmax(0,1fr) auto; }
    .student-profile-hero > .button { grid-column: auto; }
    .test-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .fee-overview { grid-template-columns:42px minmax(0,1fr) auto; }
    .fee-overview .button { grid-column:auto; }
    .fee-filters { grid-template-columns:repeat(2,minmax(0,1fr)) auto; align-items:end; }
    .fee-filters .button { grid-column:auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ================================================================
   Premium morphism visual layer
   Presentation only: existing structure, hooks and behaviour remain intact.
   ================================================================ */

html { color-scheme:light; overflow-x:hidden; }
body {
    position:relative;
    overflow-x:hidden;
    color:var(--purple-dark);
    background:
        radial-gradient(circle at 8% 2%, rgba(212,175,55,.14), transparent 27rem),
        radial-gradient(circle at 92% 20%, rgba(75,59,122,.13), transparent 31rem),
        linear-gradient(145deg, #fffdf9 0%, var(--cream) 46%, #f6f0e9 100%);
    background-attachment:fixed;
}
body::before,
body::after {
    content:'';
    position:fixed;
    z-index:0;
    width:19rem;
    height:19rem;
    border-radius:50%;
    filter:blur(64px);
    opacity:.22;
    pointer-events:none;
}
body::before { inset-block-start:18%; inset-inline-start:-11rem; background:#b6a1db; }
body::after { inset-block-end:-8rem; inset-inline-end:-9rem; background:#e7cb65; }
.page-shell,.topbar { position:relative; }
.page-shell { z-index:1; grid-template-columns:minmax(0,1fr); padding:28px 16px calc(44px + env(safe-area-inset-bottom)); }

::selection { color:var(--white); background:var(--purple); }
:focus-visible { outline:3px solid rgba(212,175,55,.55); outline-offset:3px; }
input::placeholder,textarea::placeholder { color:#a39ab5; opacity:1; }

.topbar {
    position:sticky;
    inset-block-start:0;
    height:66px;
    padding-inline:max(17px,env(safe-area-inset-left)) max(17px,env(safe-area-inset-right));
    background:rgba(251,248,242,.74);
    border-color:rgba(75,59,122,.1);
    box-shadow:0 6px 24px rgba(58,46,92,.055);
    -webkit-backdrop-filter:blur(22px) saturate(145%);
    backdrop-filter:blur(22px) saturate(145%);
}
.brand { gap:10px; font-size:1.02rem; font-weight:800; letter-spacing:-.015em; }
.brand img { width:40px; height:40px; background:rgba(255,255,255,.8); box-shadow:0 5px 14px rgba(58,46,92,.13); }
.menu-button {
    border:1px solid rgba(75,59,122,.09);
    border-radius:13px;
    background:rgba(238,234,247,.82);
    box-shadow:var(--inner-highlight),var(--shadow-sm);
    transition:transform var(--speed-fast) var(--ease),background var(--speed-fast),box-shadow var(--speed-fast);
}
.menu-button:hover { background:var(--white); box-shadow:var(--inner-highlight),0 8px 20px rgba(58,46,92,.12); }
.menu-button:active { transform:scale(.94); }
.menu-button[aria-expanded="true"] span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:nth-child(2) { opacity:0; transform:scaleX(.3); }
.menu-button[aria-expanded="true"] span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }
.menu-button span { transition:transform var(--speed) var(--ease),opacity var(--speed-fast); }
.site-menu {
    inset-block-start:57px;
    padding:11px;
    background:rgba(255,255,255,.84);
    border:1px solid rgba(255,255,255,.92);
    border-radius:18px;
    box-shadow:var(--shadow-lg),0 0 0 1px rgba(75,59,122,.07);
    -webkit-backdrop-filter:blur(24px) saturate(150%);
    backdrop-filter:blur(24px) saturate(150%);
    transform-origin:top right;
    animation:menu-in var(--speed) var(--ease) both;
}
html[dir="rtl"] .site-menu { transform-origin:top left; }
.site-menu a { border-radius:11px; transition:color var(--speed-fast),background var(--speed-fast),transform var(--speed-fast); }
.site-menu a:hover { color:var(--purple-dark); background:rgba(238,234,247,.85); transform:translateX(2px); }
html[dir="rtl"] .site-menu a:hover { transform:translateX(-2px); }
.menu-language summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border-radius:11px; cursor:pointer; font-size:.92rem; font-weight:700; list-style:none; }
.menu-language summary::-webkit-details-marker { display:none; }
.menu-language summary:hover, .menu-language[open] summary { background:var(--purple-soft); }
.menu-language summary b { color:var(--purple); font-size:.8rem; }
.menu-language .app-language-choices { margin:4px 0 8px; }
.app-language-choices { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.app-language-choices button { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:40px; padding:8px 12px; color:var(--purple-dark); background:rgba(255,255,255,.78); border:1px solid var(--border); border-radius:11px; cursor:pointer; font-size:.84rem; font-weight:700; transition:background var(--speed-fast),border-color var(--speed-fast),transform var(--speed-fast); }
.app-language-choices button:hover { background:var(--gold-soft); border-color:var(--gold); }
.app-language-choices button:active { transform:scale(.98); }
.app-language-choices button[aria-current="true"] { background:var(--purple-soft); border-color:var(--purple); }
.app-language-choices button:focus-visible, .menu-language summary:focus-visible { outline:3px solid rgba(212,175,55,.62); outline-offset:2px; }
.menu-language .app-language-choices button { flex:1 1 100%; }

.centered-card,.form-card {
    width:100%;
    max-width:520px;
    background:var(--glass);
    border:1px solid var(--glass-border);
    border-radius:var(--panel-radius);
    box-shadow:var(--inner-highlight),var(--shadow-md),0 0 0 1px rgba(75,59,122,.055);
    -webkit-backdrop-filter:blur(var(--blur)) saturate(135%);
    backdrop-filter:blur(var(--blur)) saturate(135%);
}
.centered-card { padding:28px 22px; }
.form-card { padding:27px 22px; }
.logo-block img { filter:drop-shadow(0 11px 18px rgba(58,46,92,.13)); }
.card-heading h1,.screen-heading h1,.dashboard-welcome h1,.attendance-heading h1,.admin-heading h1 { letter-spacing:-.035em; }
.card-heading p,.screen-heading p { color:var(--muted); }
.eyebrow { letter-spacing:.16em; }

.form-stack { gap:17px; }
.form-stack label { gap:8px; font-size:.82rem; }
.form-stack input,.form-stack select,.form-stack textarea,
.academy-switcher select,.course-filter select,.date-control input,
.search-field input,.filter-grid select,.fee-filters select {
    min-height:50px;
    background:rgba(255,255,255,.73);
    border:1px solid rgba(75,59,122,.16);
    border-radius:12px;
    box-shadow:var(--inner-highlight),inset 0 0 0 1px rgba(255,255,255,.25);
    transition:border-color var(--speed-fast),box-shadow var(--speed),background var(--speed-fast),transform var(--speed-fast);
}
.form-stack input:hover,.form-stack select:hover,.form-stack textarea:hover,
.academy-switcher select:hover,.course-filter select:hover,.date-control input:hover,
.search-field input:hover,.filter-grid select:hover,.fee-filters select:hover { border-color:rgba(75,59,122,.3); }
.form-stack input:focus,.form-stack select:focus,.form-stack textarea:focus,
.academy-switcher select:focus,.course-filter select:focus,.date-control input:focus,
.search-field input:focus,.filter-grid select:focus,.fee-filters select:focus {
    background:rgba(255,255,255,.94);
    border-color:var(--purple);
    box-shadow:0 0 0 4px rgba(75,59,122,.11),var(--inner-highlight),0 8px 18px rgba(58,46,92,.07);
}
.password-toggle { inset-block:3px; border-radius:10px; transition:color var(--speed-fast),background var(--speed-fast),transform var(--speed-fast); }
.password-toggle:active { transform:scale(.9); }

.button {
    min-height:50px;
    border-radius:12px;
    box-shadow:var(--inner-highlight);
    transition:transform var(--speed-fast) var(--ease),box-shadow var(--speed),filter var(--speed-fast),border-color var(--speed-fast),background var(--speed-fast);
}
.button:hover { transform:translateY(-2px); }
.button:active { transform:scale(.97); }
.button-primary {
    background:var(--purple-gradient);
    box-shadow:var(--inner-highlight),0 10px 22px rgba(75,59,122,.22);
}
.button-primary:hover { background:var(--purple-gradient); filter:brightness(1.07); box-shadow:var(--inner-highlight),0 14px 28px rgba(75,59,122,.28); }
.button-secondary { background:rgba(255,255,255,.64); border-color:rgba(75,59,122,.28); }
.button-secondary:hover { background:var(--white); border-color:var(--purple); }
.button-danger { box-shadow:none; }
.button:disabled,.button-disabled { transform:none!important; box-shadow:none; }

.language-option,.account-type-card {
    border-color:rgba(75,59,122,.12);
    border-radius:17px;
    background:rgba(255,255,255,.65);
    box-shadow:var(--inner-highlight),var(--shadow-sm);
    transition:transform var(--speed) var(--ease),box-shadow var(--speed),border-color var(--speed),background var(--speed);
}
.language-option:hover,.language-option:focus-visible,
.account-type-card:hover,.account-type-card:focus-visible { transform:translateY(-3px); background:rgba(255,255,255,.9); box-shadow:var(--inner-highlight),var(--shadow-md); }
.language-option:active,.account-type-card:active { transform:scale(.985); }
.language-mark,.account-type-icon { box-shadow:var(--inner-highlight),0 8px 18px rgba(75,59,122,.18); }
.account-type-card.solo-card { background:var(--purple-gradient); box-shadow:var(--inner-highlight),0 15px 30px rgba(75,59,122,.24); }
.account-type-card.solo-card:hover { background:var(--purple-gradient); filter:brightness(1.04); }

.alert { border-radius:13px; box-shadow:var(--inner-highlight); }
.alert-error { background:rgba(255,240,241,.78); }
.alert-success { background:rgba(235,248,241,.8); }
.placeholder-panel,.empty-state {
    background:rgba(255,255,255,.5);
    border-color:rgba(75,59,122,.18);
    border-radius:18px;
    box-shadow:var(--inner-highlight);
}

.dashboard-welcome {
    padding:20px;
    background:linear-gradient(135deg,rgba(255,255,255,.8),rgba(255,255,255,.52));
    border:1px solid var(--glass-border);
    border-radius:22px;
    box-shadow:var(--inner-highlight),var(--shadow-md);
    -webkit-backdrop-filter:blur(18px);
    backdrop-filter:blur(18px);
}
.status-pill,.solo-account-badge,.date-badge,.duration-badge,.badge,.final-label {
    box-shadow:inset 0 1px 0 rgba(255,255,255,.65),0 4px 10px rgba(58,46,92,.055);
}
.status-pill { color:var(--purple-dark); background:linear-gradient(135deg,rgba(238,234,247,.95),rgba(255,255,255,.72)); border:1px solid rgba(75,59,122,.08); }
.section-title h2 { font-size:1.08rem; letter-spacing:-.015em; }
.section-title::after { content:''; width:28px; height:3px; margin-inline-start:auto; background:var(--gold-gradient); border-radius:99px; }

.summary-card,.action-card,.metric-grid article,.course-card,.student-row,.profile-row,
.student-profile-hero,.profile-section,.test-card,.month-navigation,.fee-overview,
.permission-card,.fee-row,.due-document-preview,.report-type-card > span,.student-filters,.fee-filters {
    border-color:rgba(75,59,122,.105);
    box-shadow:var(--inner-highlight),var(--shadow-sm);
}
.summary-card,.action-card,.metric-grid article,.course-card,.student-row,.profile-row,
.student-profile-hero,.profile-section,.month-navigation,.fee-overview,.fee-row,.student-filters,.fee-filters {
    background:rgba(255,255,255,.72);
    -webkit-backdrop-filter:blur(16px) saturate(125%);
    backdrop-filter:blur(16px) saturate(125%);
}
.summary-card { min-height:138px; border-radius:17px; }
.summary-icon,.action-card > span,.avatar,.large-avatar {
    background:linear-gradient(145deg,rgba(255,255,255,.9),var(--purple-soft));
    box-shadow:var(--inner-highlight),0 7px 17px rgba(58,46,92,.11);
}
.summary-icon { border-radius:10px; }
.summary-card strong { letter-spacing:-.04em; }
.action-card {
    min-height:116px;
    border-radius:17px;
    transition:transform var(--speed) var(--ease),box-shadow var(--speed),border-color var(--speed),background var(--speed);
}
.action-card:hover,.course-card:hover,.profile-row:hover { transform:translateY(-3px); border-color:rgba(75,59,122,.25); box-shadow:var(--inner-highlight),var(--shadow-md); }
.action-card:active,.profile-row:active { transform:scale(.985); }
.action-card.primary-action { background:var(--purple-gradient); border-color:transparent; box-shadow:var(--inner-highlight),0 16px 30px rgba(75,59,122,.24); }
.action-card.primary-action > span { background:var(--gold-gradient); box-shadow:var(--inner-highlight),0 8px 18px rgba(212,175,55,.2); }
.action-card.is-upcoming:hover { transform:none; box-shadow:var(--inner-highlight),var(--shadow-sm); }

.back-link,.date-nav,.icon-action,.sheet-close {
    border-radius:13px;
    box-shadow:var(--inner-highlight),var(--shadow-sm);
    transition:transform var(--speed-fast),box-shadow var(--speed),background var(--speed-fast);
}
.back-link:hover,.date-nav:hover,.icon-action:hover,.sheet-close:hover { transform:translateY(-2px); box-shadow:var(--inner-highlight),var(--shadow-md); }
.back-link:active,.date-nav:active,.icon-action:active,.sheet-close:active { transform:scale(.93); }
.icon-action { background:var(--purple-gradient); box-shadow:var(--inner-highlight),0 10px 20px rgba(75,59,122,.22); }
.academy-switcher,.course-filter { padding:13px; background:rgba(255,255,255,.48); border:1px solid rgba(255,255,255,.72); border-radius:15px; box-shadow:var(--inner-highlight),var(--shadow-sm); }
.inline-filter { margin-bottom:12px; }
.student-filters,.fee-filters { padding:15px; border-radius:18px; }
.search-field > span[aria-hidden] { z-index:1; }

.student-row,.profile-row,.fee-row,.course-card { border-radius:15px; transition:transform var(--speed),box-shadow var(--speed),border-color var(--speed); }
.student-row:hover,.fee-row:hover { box-shadow:var(--inner-highlight),0 10px 24px rgba(58,46,92,.09); }
.avatar,.large-avatar { color:var(--purple-dark); }
.status-button,.fee-status-button {
    box-shadow:var(--inner-highlight),0 5px 12px rgba(58,46,92,.07);
    transition:transform var(--speed-fast),box-shadow var(--speed-fast),filter var(--speed-fast);
}
.status-button:hover,.fee-status-button:hover { transform:translateY(-1px); box-shadow:var(--inner-highlight),0 8px 16px rgba(58,46,92,.11); }
.status-button:active,.fee-status-button:active { transform:scale(.94); }
.status-button.active,.fee-status-button.active { box-shadow:var(--inner-highlight),0 7px 16px rgba(58,46,92,.14); }
.save-indicator,.fee-save-indicator { background:var(--purple-gradient); box-shadow:0 4px 10px rgba(75,59,122,.25); animation:check-in 260ms var(--ease) both; }

.update-sheet::backdrop { background:rgba(29,21,48,.45); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.update-sheet[open] .sheet-panel { animation:sheet-in 340ms var(--ease) both; }
.sheet-panel {
    background:rgba(251,248,242,.92);
    border:1px solid rgba(255,255,255,.9);
    border-bottom:0;
    border-radius:24px 24px 0 0;
    box-shadow:0 -22px 60px rgba(35,25,60,.2),var(--inner-highlight);
    -webkit-backdrop-filter:blur(24px) saturate(140%);
    backdrop-filter:blur(24px) saturate(140%);
}
.sheet-handle { background:linear-gradient(90deg,#cfc8d9,#9f91b6,#cfc8d9); }
.test-fields,.duration-guide,.permission-card { background:linear-gradient(145deg,rgba(247,237,201,.8),rgba(255,255,255,.62)); }
.toggle-control { box-shadow:inset 0 2px 5px rgba(38,34,49,.15); transition:background var(--speed); }
.toggle-control::after { box-shadow:0 3px 8px rgba(38,34,49,.2); transition:transform var(--speed) var(--ease); }

.student-profile-hero,.profile-section { border-radius:19px; }
.student-profile-hero { background:linear-gradient(135deg,rgba(255,255,255,.82),rgba(247,237,201,.28)); }
.profile-section { transition:box-shadow var(--speed),border-color var(--speed); }
.profile-section:hover { border-color:rgba(75,59,122,.18); box-shadow:var(--inner-highlight),var(--shadow-md); }
.timeline article > div::before { box-shadow:0 0 0 4px rgba(212,175,55,.17); }
.test-card { border-radius:14px; background:rgba(255,255,255,.56); }
.test-card.final-test { background:linear-gradient(145deg,rgba(247,237,201,.86),rgba(255,255,255,.68)); }

.month-navigation,.fee-overview { border-radius:17px; }
.permission-card { border-color:rgba(212,175,55,.36); border-radius:17px; }
.fee-status-button { border-radius:11px; }
.due-document-preview { border-radius:20px; box-shadow:var(--inner-highlight),var(--shadow-md); }
.due-document-preview > header { background:linear-gradient(135deg,rgba(238,234,247,.65),rgba(255,255,255,.7)); }
.report-type-card > span { border-radius:15px; background:rgba(255,255,255,.62); transition:transform var(--speed),box-shadow var(--speed),border-color var(--speed),background var(--speed); }
.report-type-card:hover > span { transform:translateY(-2px); box-shadow:var(--inner-highlight),var(--shadow-md); }
.report-type-card input:checked + span { background:linear-gradient(135deg,rgba(238,234,247,.96),rgba(255,255,255,.78)); box-shadow:inset 4px 0 0 var(--gold),var(--inner-highlight),var(--shadow-sm); }
.report-language-field select { background-color:rgba(255,255,255,.82); box-shadow:var(--inner-highlight),var(--shadow-sm); transition:border-color var(--speed-fast),box-shadow var(--speed-fast),transform var(--speed-fast); }
.report-language-field select:active { transform:scale(.99); }
.pdf-preview { border-radius:18px; box-shadow:var(--shadow-lg); }

.splash {
    background:
        radial-gradient(circle at 50% 43%,rgba(212,175,55,.2),transparent 13rem),
        radial-gradient(circle at 50% 50%,rgba(75,59,122,.12),transparent 24rem),
        var(--cream);
}
.splash img { filter:drop-shadow(0 20px 32px rgba(58,46,92,.18)); animation:splash-logo 750ms var(--ease) both; }
.splash p { animation:fade-up 500ms 380ms var(--ease) both; }
.splash-loader { height:4px; background:rgba(75,59,122,.1); box-shadow:inset 0 1px 3px rgba(58,46,92,.11); animation:fade-up 400ms 520ms var(--ease) both; }
.splash-loader span { background:var(--gold-gradient); box-shadow:0 0 12px rgba(212,175,55,.45); }

.page-shell > section { animation:page-enter 420ms var(--ease) backwards; }
.summary-card,.action-card,.profile-row,.student-row,.fee-row,.course-card,.metric-grid article { animation:card-enter 400ms var(--ease) backwards; }
.summary-card:nth-child(2),.action-card:nth-child(2),.profile-row:nth-child(2),.student-row:nth-child(2),.fee-row:nth-child(2),.course-card:nth-child(2),.metric-grid article:nth-child(2) { animation-delay:45ms; }
.summary-card:nth-child(3),.action-card:nth-child(3),.profile-row:nth-child(3),.student-row:nth-child(3),.fee-row:nth-child(3),.course-card:nth-child(3),.metric-grid article:nth-child(3) { animation-delay:90ms; }
.action-card:nth-child(4),.profile-row:nth-child(4),.student-row:nth-child(4),.fee-row:nth-child(4),.course-card:nth-child(4),.metric-grid article:nth-child(4) { animation-delay:135ms; }
.action-card:nth-child(5),.profile-row:nth-child(5),.student-row:nth-child(5),.fee-row:nth-child(5),.course-card:nth-child(5) { animation-delay:180ms; }
.action-card:nth-child(6),.profile-row:nth-child(6),.student-row:nth-child(6),.fee-row:nth-child(6),.course-card:nth-child(6) { animation-delay:225ms; }

@keyframes menu-in { from { opacity:0; transform:translateY(-8px) scale(.97); } to { opacity:1; transform:none; } }
@keyframes page-enter { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes card-enter { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes sheet-in { from { opacity:.6; transform:translateY(28px) scale(.985); } to { opacity:1; transform:none; } }
@keyframes check-in { 0% { opacity:0; transform:scale(.6); } 70% { transform:scale(1.12); } 100% { opacity:1; transform:none; } }
@keyframes splash-logo { from { opacity:0; transform:translateY(10px) scale(.9); filter:drop-shadow(0 0 0 rgba(212,175,55,0)); } to { opacity:1; transform:none; filter:drop-shadow(0 20px 32px rgba(58,46,92,.18)); } }
@keyframes fade-up { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:none; } }

@media (max-width:430px) {
    .page-shell { padding-inline:12px; padding-block-start:20px; }
    .centered-card,.form-card { padding:24px 18px; }
    .dashboard-welcome { padding:17px; }
    .summary-grid { gap:7px; }
    .summary-card { min-height:130px; padding:13px 9px; }
    .action-grid { gap:9px; }
    .action-card { min-height:108px; padding:14px; }
    .student-filters,.fee-filters { padding:12px; }
    .alert-success.is-toast { inset-block-start: 76px; inset-inline: 12px; width: auto; }
}

@media (min-width:760px) {
    .page-shell { padding:48px 30px 64px; }
    .centered-card { padding:34px 32px; }
    .form-card { padding:34px; }
    .dashboard-welcome { padding:24px 26px; }
    .summary-grid,.action-grid { gap:15px; }
}

@media (prefers-reduced-motion:reduce) {
    .page-shell > section,.summary-card,.action-card,.profile-row,.student-row,.fee-row,.course-card,.metric-grid article,.site-menu,.update-sheet[open] .sheet-panel { animation:none!important; }
    .button:hover,.action-card:hover,.course-card:hover,.profile-row:hover,.back-link:hover,.date-nav:hover,.icon-action:hover,.sheet-close:hover { transform:none; }
}

/* ================================================================
   Small-screen type and fit system
   Scales every rem-based label and sentence while retaining 44px+ targets.
   ================================================================ */

@media (max-width:430px) {
    html { font-size:15px; }

    h1,h2,h3,p,strong,small,label,a,button,span { overflow-wrap:anywhere; }
    input,select,textarea { font-size:16px; } /* Prevent automatic zoom on iOS. */

    .topbar { height:62px; }
    .brand { font-size:.94rem; }
    .brand img { width:37px; height:37px; }
    .menu-button { width:42px; height:42px; }
    .site-menu { inset-block-start:54px; }
    .site-menu strong { font-size:.7rem; }
    .site-menu a { padding:11px; font-size:.86rem; }

    .page-shell { min-height:calc(100vh - 62px); }
    .card-heading h1 { font-size:clamp(1.55rem,7vw,1.9rem); }
    .card-heading p { font-size:.92rem; }
    .screen-heading h1,.dashboard-welcome h1,.attendance-heading h1 { font-size:clamp(1.55rem,7vw,2.05rem); }
    .screen-heading p { font-size:.88rem; }
    .eyebrow { font-size:.69rem; letter-spacing:.12em; }

    .button { padding-inline:14px; font-size:.9rem; }
    .button.compact { font-size:.78rem; }
    .form-stack label { font-size:.78rem; }
    .form-footer,.form-link-row,.alert { font-size:.8rem; }

    .language-option { grid-template-columns:46px minmax(0,1fr); gap:11px; padding:13px; }
    .language-mark { width:46px; height:46px; font-size:.72rem; }
    .language-option strong { font-size:.92rem; }
    .language-option small { font-size:.68rem; }
    .account-type-card { grid-template-columns:44px minmax(0,1fr) 14px; gap:10px; padding-inline:13px; }
    .account-type-icon { width:44px; height:44px; }
    .account-type-card strong { font-size:.91rem; }
    .account-type-card small { font-size:.67rem; }

    .dashboard-welcome { gap:10px; }
    .dashboard-welcome > div { min-width:0; }
    .dashboard-welcome h1,.academy-name strong { overflow-wrap:anywhere; word-break:break-word; }
    .academy-name span,.academy-name strong { font-size:clamp(1.05rem,4.8vw,1.35rem); }
    .status-pill,.solo-account-badge { padding:5px 8px; font-size:.66rem; }
    .section-title { margin-block:19px 10px; }
    .section-title h2 { font-size:.98rem; }
    .summary-card strong { font-size:clamp(1.08rem,4.6vw,1.4rem); }
    .summary-card p { font-size:.62rem; }
    .summary-icon { width:29px; height:29px; margin-bottom:10px; font-size:.74rem; }
    .action-card strong { font-size:.8rem; }
    .action-card small { font-size:.56rem; }
    .action-card > span { width:33px; height:33px; font-size:1rem; }

    .screen-heading { grid-template-columns:40px minmax(0,1fr); gap:10px; margin-bottom:20px; }
    .screen-heading:has(.icon-action) { grid-template-columns:40px minmax(0,1fr) 40px; }
    .back-link,.date-nav,.icon-action { width:40px; height:40px; }
    .screen-heading .eyebrow,.attendance-heading .eyebrow { max-width:100%; white-space:normal; }
    .attendance-heading { grid-template-columns:40px minmax(0,1fr) auto; gap:8px; }
    .date-badge { padding:5px 7px; font-size:.63rem; }
    .attendance-controls { grid-template-columns:40px minmax(0,1fr) 40px; gap:7px; }
    .date-control,.audit-notice,.list-toolbar small,.mark-all-button { font-size:.66rem; }
    .list-toolbar { align-items:flex-start; }
    .list-toolbar strong { font-size:.9rem; }
    .mark-all-button { padding-inline:9px; white-space:normal; }

    .student-row,.fee-row { gap:6px; }
    .student-identity strong { font-size:.78rem; }
    .student-identity small { font-size:.6rem; }
    .status-button { width:39px; height:40px; }
    .attendance-buttons { gap:4px; }
    .profile-row-main strong { font-size:.8rem; }
    .profile-row-main small { font-size:.62rem; }
    .badge { padding:4px 7px; font-size:.55rem; }

    .text-start h2,.student-profile-hero h2 { font-size:1.08rem; }
    .course-card h3 { font-size:.9rem; }
    .course-card small,.duration-guide p { font-size:.63rem; }
    .duration-guide > strong { font-size:.77rem; }
    .duration-guide span { font-size:.7rem; }
    .profile-section { padding:15px; }
    .profile-section > h2 { font-size:.92rem; }
    .timeline { min-width:0; }
    .timeline article { grid-template-columns:72px minmax(0,1fr); gap:9px; }
    .timeline article:not(:last-child)::after { inset-inline-start:76px; }
    .timeline time { font-size:.59rem; }
    .timeline strong { font-size:.75rem; }
    .timeline p { font-size:.65rem; }
    .test-card h3 { font-size:.79rem; }

    .month-navigation strong { font-size:.9rem; }
    .month-navigation span,.fee-overview p { font-size:.61rem; }
    .fee-overview strong { font-size:1.3rem; }
    .permission-card > div > strong { font-size:.78rem; }
    .permission-card p,.fee-filters label { font-size:.64rem; }
    .fee-status-button { min-width:57px; padding-inline:7px; font-size:.62rem; }
    .due-document-preview header div strong { font-size:.94rem; }
    .due-document-preview header div span { font-size:.5rem; }
    .due-preview-heading h2 { font-size:.9rem; }
    .due-preview-list article div strong { font-size:.73rem; }
    .due-preview-list article div span,.due-preview-list article p small { font-size:.55rem; }
    .due-preview-list article p { font-size:.63rem; }
    .due-preview-list article > * { min-width:0; }
    .due-preview-list article p { max-width:112px; overflow-wrap:anywhere; }

    .report-type-options legend,.report-type-card b { font-size:.78rem; }
    .report-type-card small { font-size:.62rem; }
    .report-language-field { font-size:.68rem; }
    .due-actions .button { min-width:0; font-size:.78rem; line-height:1.25; }
}

@media (max-width:390px) {
    html { font-size:14.5px; }
    .page-shell { padding-inline:10px; }
    .centered-card,.form-card { padding-inline:16px; }
    .dashboard-welcome { padding:15px; }
    .summary-grid { gap:6px; }
    .summary-card { min-height:122px; padding:11px 7px; }
    .action-card { min-height:102px; padding:12px; }
    .student-row,.fee-row { padding-inline:7px; }
    .fee-toggle { gap:3px; }
}

@media (max-width:360px) {
    html { font-size:14px; }
    .topbar { padding-inline:12px; }
    .centered-card,.form-card { padding:21px 14px; }
    .card-heading { margin-bottom:18px; }
    .dashboard-welcome { flex-wrap:wrap; }
    .dashboard-welcome .status-pill { margin-inline-start:auto; }
    .summary-card p { font-size:.6rem; }
    .screen-heading,.attendance-heading { gap:7px; }
    .attendance-heading { grid-template-columns:38px minmax(0,1fr) auto; }
    .back-link,.date-nav,.icon-action { width:38px; height:38px; }
    .status-button { width:36px; height:39px; }
    .student-identity { grid-template-columns:32px minmax(0,1fr); gap:5px; }
    .avatar { width:32px; height:32px; }
    .fee-status-button { min-width:52px; min-height:40px; padding-inline:5px; }
    .course-card { align-items:flex-start; flex-wrap:wrap; }
    .record-actions { width:100%; justify-content:flex-end; }
    .filter-actions,.due-actions { gap:6px; }
    .filter-actions .button,.due-actions .button { padding-inline:8px; }
}

@media (max-width:430px) {
    html[dir="rtl"] body { line-height:1.8; }
    html[dir="rtl"] p,html[dir="rtl"] small { line-height:1.95; }
    html[dir="rtl"] .card-heading h1,
    html[dir="rtl"] .screen-heading h1,
    html[dir="rtl"] .dashboard-welcome h1,
    html[dir="rtl"] .attendance-heading h1,
    html[dir="rtl"] .section-title h2 { line-height:1.85; letter-spacing:0; }
    html[dir="rtl"] .button,
    html[dir="rtl"] .site-menu a,
    html[dir="rtl"] .badge,
    html[dir="rtl"] .status-pill { line-height:1.7; }
    html[dir="rtl"] .account-type-card strong { line-height:1.9; }
    html[dir="rtl"] .account-type-card small { line-height:2; }
    html[dir="rtl"] .card-heading h1,
    html[dir="rtl"] .setup-card .card-heading h1 { margin-block-start:18px; margin-block-end:8px; }
    html[dir="rtl"] .card-heading > p:last-child { margin-block-start:3px; }
}

/* ================================================================
   Urdu / Nastaliq typography system
   Nastaliq has tall ascenders and deep descenders. These final RTL rules
   intentionally override compact Latin metrics across every app screen.
   ================================================================ */

html[dir="rtl"] body {
    font-family:Inter,"Noto Nastaliq Urdu","Noto Naskh Arabic",serif;
    line-height:1.95;
    text-rendering:optimizeLegibility;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
    line-height:1.95;
    letter-spacing:0;
    padding-block:.08em .16em;
}
html[dir="rtl"] p,
html[dir="rtl"] small,
html[dir="rtl"] .muted-copy {
    line-height:2.1;
}
html[dir="rtl"] .eyebrow {
    padding-block:2px 4px;
    line-height:2;
    letter-spacing:0;
    text-transform:none;
}

html[dir="rtl"] .card-heading { margin-bottom:26px; }
html[dir="rtl"] .card-heading h1,
html[dir="rtl"] .setup-card .card-heading h1 {
    margin-block:16px 9px;
    line-height:2;
}
html[dir="rtl"] .card-heading p { line-height:2.1; }
html[dir="rtl"] .screen-heading h1,
html[dir="rtl"] .dashboard-welcome h1,
html[dir="rtl"] .attendance-heading h1,
html[dir="rtl"] .admin-heading h1 {
    margin-block:5px 7px;
    line-height:1.95;
}
html[dir="rtl"] .screen-heading p { line-height:2.05; }

html[dir="rtl"] .form-stack { gap:18px; }
html[dir="rtl"] .form-stack label,
html[dir="rtl"] .filter-grid label,
html[dir="rtl"] .fee-filters label,
html[dir="rtl"] .academy-switcher label,
html[dir="rtl"] .course-filter label,
html[dir="rtl"] .date-control {
    gap:4px;
    line-height:1.9;
}
html[dir="rtl"] .form-stack label > span:first-child,
html[dir="rtl"] .filter-grid label > span:first-child,
html[dir="rtl"] .fee-filters label > span:first-child,
html[dir="rtl"] .date-control > span:first-child { padding-block:2px 4px; }
html[dir="rtl"] .form-stack input,
html[dir="rtl"] .form-stack select,
html[dir="rtl"] .form-stack textarea,
html[dir="rtl"] .academy-switcher select,
html[dir="rtl"] .course-filter select,
html[dir="rtl"] .date-control input,
html[dir="rtl"] .search-field input,
html[dir="rtl"] .filter-grid select,
html[dir="rtl"] .fee-filters select {
    min-height:56px;
    padding-block:10px;
    line-height:1.9;
}
html[dir="rtl"] textarea { min-height:104px; }

html[dir="rtl"] .button,
html[dir="rtl"] .site-menu a,
html[dir="rtl"] .text-link,
html[dir="rtl"] .edit-section summary {
    min-height:50px;
    padding-block:8px;
    line-height:1.85;
}
html[dir="rtl"] .button.compact { min-height:44px; padding-block:6px; }
html[dir="rtl"] .site-menu strong { padding-block:7px; line-height:1.85; }
html[dir="rtl"] .site-menu a { display:flex; align-items:center; }
html[dir="rtl"] .form-footer,
html[dir="rtl"] .form-link-row,
html[dir="rtl"] .alert { line-height:2; }

html[dir="rtl"] .language-option,
html[dir="rtl"] .account-type-card { padding-block:18px; }
html[dir="rtl"] .language-option strong,
html[dir="rtl"] .account-type-card strong { line-height:1.95; }
html[dir="rtl"] .language-option small,
html[dir="rtl"] .account-type-card small { margin-top:0; line-height:2.05; }
html[dir="rtl"] .language-mark,
html[dir="rtl"] .account-type-icon { line-height:1; }

html[dir="rtl"] .academy-name span,
html[dir="rtl"] .academy-name strong { line-height:1.9; }
html[dir="rtl"] .status-pill,
html[dir="rtl"] .solo-account-badge,
html[dir="rtl"] .date-badge,
html[dir="rtl"] .duration-badge,
html[dir="rtl"] .badge,
html[dir="rtl"] .final-label {
    align-items:center;
    padding-block:4px 6px;
    line-height:1.65;
}
html[dir="rtl"] .section-title { align-items:center; }
html[dir="rtl"] .section-title h2 { line-height:1.9; }
html[dir="rtl"] .summary-card { min-height:148px; padding-block:15px; }
html[dir="rtl"] .summary-card strong { line-height:1.7; }
html[dir="rtl"] .summary-card p { margin-top:1px; line-height:1.95; }
html[dir="rtl"] .summary-icon,
html[dir="rtl"] .action-card > span { line-height:1; }
html[dir="rtl"] .action-card { min-height:126px; padding-block:16px; }
html[dir="rtl"] .action-card strong { line-height:1.9; }
html[dir="rtl"] .action-card small { line-height:2; }

html[dir="rtl"] .attendance-heading { align-items:center; }
html[dir="rtl"] .audit-notice,
html[dir="rtl"] .list-toolbar small { line-height:2; }
html[dir="rtl"] .mark-all-button { line-height:1.75; }
html[dir="rtl"] .student-row,
html[dir="rtl"] .fee-row { min-height:84px; padding-block:10px; }
html[dir="rtl"] .student-identity strong,
html[dir="rtl"] .profile-row-main strong { line-height:1.8; }
html[dir="rtl"] .student-identity small,
html[dir="rtl"] .profile-row-main small { margin-top:0; line-height:1.95; }
html[dir="rtl"] .status-button,
html[dir="rtl"] .fee-status-button,
html[dir="rtl"] .back-link,
html[dir="rtl"] .date-nav,
html[dir="rtl"] .icon-action,
html[dir="rtl"] .sheet-close,
html[dir="rtl"] .row-chevron { line-height:1; }

html[dir="rtl"] .sheet-heading h2 { line-height:1.9; }
html[dir="rtl"] .toggle-row strong { line-height:1.9; }
html[dir="rtl"] .sheet-feedback { min-height:28px; line-height:1.9; }
html[dir="rtl"] .duration-guide > strong,
html[dir="rtl"] .duration-guide span,
html[dir="rtl"] .course-card h3 { line-height:1.9; }
html[dir="rtl"] .duration-guide p,
html[dir="rtl"] .course-card small { margin-top:1px; line-height:2; }
html[dir="rtl"] .course-card { padding-block:17px; }

html[dir="rtl"] .profile-row { min-height:88px; padding-block:11px; }
html[dir="rtl"] .student-profile-hero h2 { line-height:1.9; }
html[dir="rtl"] .student-profile-hero p { margin-block:0 6px; line-height:2; }
html[dir="rtl"] .profile-section > h2,
html[dir="rtl"] .timeline strong,
html[dir="rtl"] .test-card h3 { line-height:1.9; }
html[dir="rtl"] .timeline time { line-height:1.8; }
html[dir="rtl"] .timeline p { margin-top:1px; line-height:2; }
html[dir="rtl"] .test-card { padding-block:16px; }

html[dir="rtl"] .month-navigation span,
html[dir="rtl"] .month-navigation strong,
html[dir="rtl"] .fee-overview strong,
html[dir="rtl"] .fee-overview p,
html[dir="rtl"] .permission-card > div > strong,
html[dir="rtl"] .permission-card p,
html[dir="rtl"] .permission-card .toggle-row b { line-height:1.95; }
html[dir="rtl"] .fee-status-button { padding-block:5px; line-height:1.7; }
html[dir="rtl"] .due-document-preview header div strong,
html[dir="rtl"] .due-document-preview header div span,
html[dir="rtl"] .due-document-preview header > b,
html[dir="rtl"] .due-preview-heading h2,
html[dir="rtl"] .due-preview-heading span,
html[dir="rtl"] .due-preview-list article div strong,
html[dir="rtl"] .due-preview-list article div span,
html[dir="rtl"] .due-preview-list article p { line-height:1.9; }
html[dir="rtl"] .due-preview-list article { padding-block:13px; }
html[dir="rtl"] .due-document-preview footer { padding-block:10px 13px; line-height:1.9; }

html[dir="rtl"] .report-type-options legend,
html[dir="rtl"] .report-type-card b,
html[dir="rtl"] .report-language-field { line-height:1.9; }
html[dir="rtl"] .report-type-card small { margin-top:0; line-height:2; }
html[dir="rtl"] .report-type-card > span { padding-block:17px; }

.urdu-preview strong { line-height:1.95; }
.urdu-preview small { line-height:2.05; }
.urdu-preview .language-mark { line-height:1; }

@media (max-width:430px) {
    html[dir="rtl"] body { line-height:1.9; }
    html[dir="rtl"] .card-heading h1,
    html[dir="rtl"] .setup-card .card-heading h1 { margin-block-start:20px; }
    html[dir="rtl"] .screen-heading h1,
    html[dir="rtl"] .dashboard-welcome h1,
    html[dir="rtl"] .attendance-heading h1 { line-height:1.9; }
    html[dir="rtl"] .summary-card { min-height:140px; }
    html[dir="rtl"] .action-card { min-height:116px; }
    html[dir="rtl"] .student-row,
    html[dir="rtl"] .fee-row { min-height:80px; }
}

/* Nastaliq glyphs can paint outside their nominal line box. Padding on the
   following heading creates real, non-collapsing separation from eyebrows. */
html[dir="rtl"] .card-heading > .eyebrow + h1 {
    margin-block-start:0;
    padding-block-start:46px;
}
html[dir="rtl"] .screen-heading .eyebrow + h1,
html[dir="rtl"] .dashboard-welcome .eyebrow + h1,
html[dir="rtl"] .attendance-heading .eyebrow + h1,
html[dir="rtl"] .admin-heading .eyebrow + h1,
html[dir="rtl"] .sheet-heading .eyebrow + h2 {
    margin-block-start:0;
    padding-block-start:28px;
}
html[dir="rtl"] .card-heading h1 + p,
html[dir="rtl"] .screen-heading h1 + p {
    padding-block-start:10px;
}

/* ================================================================
   TaleemDiary logo presentation
   Uses the transparent badge asset without a visible box or hard container.
   ================================================================ */

.logo-block {
    position:relative;
    isolation:isolate;
    width:max-content;
    max-width:100%;
    margin:-4px auto 20px;
}
.logo-block::before {
    content:'';
    position:absolute;
    z-index:-1;
    inset:5% -10% -8%;
    border-radius:50%;
    background:
        radial-gradient(circle at 48% 45%,rgba(212,175,55,.18) 0 22%,rgba(75,59,122,.1) 44%,transparent 72%);
    filter:blur(16px);
    pointer-events:none;
}
.logo-block img {
    position:relative;
    display:block;
    width:clamp(128px,34vw,152px);
    height:auto;
    aspect-ratio:1;
    object-fit:contain;
    background:transparent;
    box-shadow:none;
    filter:drop-shadow(0 11px 16px rgba(58,46,92,.14)) drop-shadow(0 3px 5px rgba(212,175,55,.1));
    transform-origin:center;
    animation:logo-enter 620ms var(--ease) both;
}
.auth-brand .logo-block img { width:clamp(210px,26vw,278px); height:auto; }

.brand img {
    background:transparent;
    box-shadow:none;
    filter:drop-shadow(0 4px 7px rgba(58,46,92,.16));
}
.due-document-preview header img {
    background:transparent;
    filter:drop-shadow(0 5px 8px rgba(58,46,92,.13));
}
.splash img {
    width:clamp(220px,60vw,310px);
    height:auto;
    background:transparent;
    filter:drop-shadow(0 18px 27px rgba(58,46,92,.17)) drop-shadow(0 0 20px rgba(212,175,55,.11));
    animation:logo-enter 650ms var(--ease) both;
}

@keyframes logo-enter {
    from { opacity:0; transform:translateY(8px) scale(.94); }
    to { opacity:1; transform:translateY(0) scale(1); }
}

@media (max-width:390px) {
    .logo-block { margin-bottom:17px; }
    .logo-block img { width:clamp(124px,36vw,140px); }
}

@media (prefers-reduced-motion:reduce) {
    .logo-block img,.splash img { animation:none!important; }
}

/* Official two-tone TaleemDiary wordmark. */
.brand-name {
    display:inline-flex;
    align-items:baseline;
    gap:0;
    direction:ltr;
    unicode-bidi:isolate;
    white-space:nowrap;
    font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
    font-weight:800;
    line-height:1;
    letter-spacing:-.035em;
    text-transform:none;
    filter:drop-shadow(0 2px 3px rgba(58,46,92,.08));
}
.brand-taleem { color:#4B3B7A; }
.brand-diary { color:#D4AF37; }

@supports ((-webkit-background-clip:text) or (background-clip:text)) {
    .brand-taleem {
        color:transparent;
        background:linear-gradient(155deg,#7563A6 0%,#4B3B7A 38%,#392A63 76%,#5D488E 100%);
        -webkit-background-clip:text;
        background-clip:text;
    }
    .brand-diary {
        color:transparent;
        background:linear-gradient(150deg,#F3DC7A 0%,#D4AF37 36%,#B48719 72%,#E3C35B 100%);
        -webkit-background-clip:text;
        background-clip:text;
    }
}

.eyebrow .brand-name { font-size:1.08em; letter-spacing:-.025em; }
.brand > .brand-name { font-size:1em; }
.due-document-preview .brand-name { font-size:1.05rem; }

/* ================================================================
   Premium opening splash
   Isolated to the index loading screen and its existing three-second flow.
   ================================================================ */

.splash {
    isolation:isolate;
    min-height:100vh;
    min-height:100dvh;
    overflow:hidden;
    padding:
        max(28px,env(safe-area-inset-top))
        max(24px,env(safe-area-inset-right))
        max(28px,env(safe-area-inset-bottom))
        max(24px,env(safe-area-inset-left));
    background:
        radial-gradient(circle at 50% 38%,rgba(212,175,55,.16),transparent 14rem),
        radial-gradient(circle at 78% 22%,rgba(75,59,122,.12),transparent 22rem),
        radial-gradient(circle at 18% 82%,rgba(212,175,55,.1),transparent 20rem),
        linear-gradient(145deg,#fffdf9 0%,#FBF8F2 48%,#f3ece8 100%);
    opacity:1;
    transition:opacity 400ms var(--ease);
    -webkit-backdrop-filter:blur(20px);
    backdrop-filter:blur(20px);
}
.splash::before,
.splash::after {
    content:'';
    position:absolute;
    z-index:-1;
    border-radius:50%;
    filter:blur(54px);
    pointer-events:none;
}
.splash::before {
    width:min(72vw,420px);
    aspect-ratio:1;
    inset-block-start:-18%;
    inset-inline-end:-28%;
    background:rgba(75,59,122,.13);
}
.splash::after {
    width:min(66vw,360px);
    aspect-ratio:1;
    inset-block-end:-20%;
    inset-inline-start:-22%;
    background:rgba(212,175,55,.12);
}
.splash-content {
    position:relative;
    z-index:1;
    width:min(100%,360px);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    transform:scale(1);
    transition:transform 400ms var(--ease),opacity 350ms var(--ease);
}
.splash-logo-wrap {
    position:relative;
    display:grid;
    place-items:center;
    isolation:isolate;
    margin-bottom:22px;
}
.splash-logo-wrap::before {
    content:'';
    position:absolute;
    z-index:-1;
    width:120%;
    aspect-ratio:1;
    border-radius:50%;
    background:radial-gradient(circle,rgba(212,175,55,.2) 0 22%,rgba(75,59,122,.12) 44%,transparent 72%);
    filter:blur(17px);
    animation:splash-ambient 3s ease-in-out infinite;
}
.splash .splash-logo-wrap img {
    width:clamp(188px,52vw,244px);
    height:auto;
    margin:0;
    filter:drop-shadow(0 20px 28px rgba(58,46,92,.18)) drop-shadow(0 4px 8px rgba(212,175,55,.12));
    animation:splash-premium-logo 720ms var(--ease) both;
}
.splash-wordmark {
    margin:0;
    font-size:clamp(1.55rem,6vw,1.9rem);
    font-weight:800;
    filter:drop-shadow(0 3px 5px rgba(58,46,92,.1));
    animation:splash-copy-in 520ms 260ms var(--ease) both;
}
.splash .splash-tagline {
    margin:10px 0 30px;
    color:#6B5F8A;
    font-family:Inter,"Noto Nastaliq Urdu",sans-serif;
    font-size:clamp(.68rem,2.6vw,.78rem);
    font-weight:600;
    line-height:1.7;
    letter-spacing:.17em;
    text-transform:uppercase;
    animation:splash-copy-in 500ms 440ms var(--ease) both;
}
.splash-loader {
    position:relative;
    width:clamp(138px,40vw,164px);
    height:4px;
    overflow:hidden;
    background:rgba(75,59,122,.1);
    border:1px solid rgba(75,59,122,.07);
    border-radius:999px;
    box-shadow:inset 0 1px 3px rgba(58,46,92,.1),0 5px 14px rgba(58,46,92,.06);
    animation:splash-copy-in 400ms 600ms var(--ease) both;
}
.splash-loader span {
    display:block;
    width:100%;
    height:100%;
    border-radius:inherit;
    background:linear-gradient(90deg,#4B3B7A 0%,#6A55A3 58%,#D4AF37 88%,#F0D874 100%);
    box-shadow:0 0 10px rgba(212,175,55,.32);
    transform:scaleX(0);
    transform-origin:left;
    animation:splash-progress 2.2s 650ms var(--ease) both;
}
html[dir="rtl"] .splash-loader span { transform-origin:right; }
.splash.is-leaving { opacity:0; }
.splash.is-leaving .splash-content { opacity:.92; transform:scale(1.02); }

@keyframes splash-premium-logo {
    from { opacity:0; transform:translateY(8px) scale(.9); }
    to { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes splash-copy-in {
    from { opacity:0; transform:translateY(7px); }
    to { opacity:1; transform:translateY(0); }
}
@keyframes splash-progress {
    0% { transform:scaleX(0); }
    72% { transform:scaleX(.82); }
    100% { transform:scaleX(1); }
}
@keyframes splash-ambient {
    0%,100% { opacity:.72; transform:scale(.97); }
    50% { opacity:1; transform:scale(1.03); }
}

@media (max-width:390px) {
    .splash-content { width:min(100%,320px); }
    .splash-logo-wrap { margin-bottom:19px; }
    .splash .splash-logo-wrap img { width:clamp(178px,52vw,210px); }
    .splash .splash-tagline { margin-block:8px 27px; }
}

@media (prefers-reduced-motion:reduce) {
    .splash,.splash-content { transition:none; }
    .splash-logo-wrap::before,
    .splash .splash-logo-wrap img,
    .splash-wordmark,
    .splash .splash-tagline,
    .splash-loader,
    .splash-loader span { animation:none!important; }
    .splash-loader span { transform:scaleX(1); }
}

/* Authentication policy UI: unobtrusive links and a readable native dialog. */
.auth-legal-note {
    margin: 19px 0 0;
    color: #6B5F8A;
    font-size: .78rem;
    line-height: 1.7;
    text-align: center;
}
.legal-link {
    display: inline;
    padding: 6px 2px;
    color: #4B3B7A;
    background: none;
    border: 0;
    border-bottom: 1px solid currentColor;
    border-radius: 0;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease;
}
.legal-link:hover { color: #9F7820; }
.legal-link:focus-visible,
.legal-back:focus-visible,
.legal-close:focus-visible,
.legal-agreement input:focus-visible {
    outline: 3px solid rgba(212,175,55,.68);
    outline-offset: 3px;
}
.legal-agreement {
    display: grid;
    grid-template-columns: 24px minmax(0,1fr);
    align-items: start;
    column-gap: 11px;
    padding: 4px 0;
    color: #3A2E5C;
    font-size: .86rem;
    line-height: 1.65;
}
.form-stack .legal-agreement > input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 2px 0 0;
    padding: 0;
    border-radius: 5px;
    accent-color: #4B3B7A;
    cursor: pointer;
    transition: transform 180ms ease;
}
.legal-agreement > input[type="checkbox"]:checked { transform: scale(1.05); }
.legal-agreement > input[type="checkbox"]:disabled { cursor: not-allowed; }
.legal-agreement-copy { min-width: 0; }
.form-stack .legal-agreement-copy label {
    display: inline;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.legal-agreement-copy .legal-link { font-size: inherit; }
.legal-inline-error {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: #A83B48;
    font-size: .8rem;
    line-height: 1.5;
}
.form-stack > button[type="submit"]:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.legal-dialog {
    position: fixed;
    inset: 0;
    width: min(100vw, 800px);
    height: min(100dvh, 880px);
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    color: #3A2E5C;
    background: #FBF8F2;
    border: 1px solid #DDD4EC;
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(58,46,92,.22);
}
.legal-dialog::backdrop {
    background: rgba(35,25,62,.52);
    backdrop-filter: blur(6px);
}
.legal-dialog[open] { animation: legal-enter 300ms cubic-bezier(.2,.8,.2,1) both; }
.legal-sheet { display: flex; flex-direction: column; height: 100%; }
.legal-sheet-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) 44px;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 10px 18px;
    background: rgba(251,248,242,.94);
    border-bottom: 1px solid #DDD4EC;
    backdrop-filter: blur(14px);
}
.legal-sheet-header h2 {
    min-width: 0;
    margin: 0;
    color: #3A2E5C;
    font-size: clamp(1.08rem,4vw,1.35rem);
    line-height: 1.4;
    text-align: center;
}
.legal-back,
.legal-close {
    min-height: 44px;
    color: #4B3B7A;
    background: rgba(255,255,255,.74);
    border: 1px solid #DDD4EC;
    border-radius: 11px;
    cursor: pointer;
}
.legal-back { padding: 0 12px; font-size: .85rem; font-weight: 700; }
.legal-back span { margin-inline-end: 4px; }
.legal-close { width: 44px; font-size: 1.6rem; line-height: 1; }
.legal-sheet-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px clamp(18px,4vw,44px) max(32px,env(safe-area-inset-bottom));
}
.legal-document {
    max-width: 68ch;
    margin-inline: auto;
    color: #3A2E5C;
    font-size: clamp(.94rem,2.8vw,1rem);
    line-height: 1.85;
}
.legal-document-text {
    overflow-wrap: anywhere;
    font-family: Inter, system-ui, sans-serif;
    line-height: 1.85;
    text-align: start;
}
.legal-line { margin: 0; }
.legal-gap { height: 1.25em; }
.legal-document-title {
    width: fit-content;
    max-width: 100%;
    padding-bottom: 9px;
    color: #4B3B7A;
    border-bottom: 2px solid #D4AF37;
    font-size: clamp(1.12rem,4vw,1.35rem);
    font-weight: 800;
    letter-spacing: .025em;
    line-height: 1.4;
}
.legal-date-line {
    color: #6B5F8A;
    font-size: .9em;
    font-weight: 600;
}
.legal-date-line + .legal-date-line { margin-top: 2px; }
.legal-section-title {
    padding: 9px 12px;
    color: #4B3B7A;
    background: rgba(212,175,55,.09);
    border-inline-start: 3px solid #D4AF37;
    border-radius: 0 8px 8px 0;
    font-size: clamp(1rem,3vw,1.08rem);
    font-weight: 800;
    line-height: 1.55;
}
.legal-bullet-line { padding-inline-start: 2px; color: #3A2E5C; }
.legal-bullet-mark { color: #B28B22; font-weight: 800; }
.legal-contact-label { color: #4B3B7A; font-weight: 800; }
.legal-contact-value { color: #4B3B7A; font-weight: 600; }
.legal-body-line { color: #3A2E5C; }
.legal-unavailable {
    margin: 0;
    padding: 18px;
    color: #6B5F8A;
    background: rgba(255,255,255,.72);
    border: 1px solid #DDD4EC;
    border-radius: 12px;
}
html[dir="rtl"] .auth-legal-note,
html[dir="rtl"] .legal-agreement,
html[dir="rtl"] .legal-document { line-height: 2.25; }
html[dir="rtl"] .legal-sheet-header h2 { line-height: 1.9; }
html[dir="rtl"] .legal-sheet-header { min-height: 88px; }
html[dir="rtl"] .legal-back span { display: inline-block; transform: rotate(180deg); }
@keyframes legal-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
    .legal-dialog {
        inset: auto 0 0;
        width: 100vw;
        height: 100dvh;
        margin: 0;
        border-radius: 20px 20px 0 0;
    }
    .legal-sheet-header { padding-top: max(10px,env(safe-area-inset-top)); }
}
@media (max-width: 390px) {
    .auth-legal-note { font-size: .76rem; }
    .legal-agreement { font-size: .82rem; }
    .legal-sheet-header { gap: 6px; padding-inline: 12px; }
    .legal-back { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .legal-dialog[open] { animation: none; }
    .legal-link,
    .legal-agreement > input[type="checkbox"] { transition: none; }
}

/* Phase 7: Settings, teacher invitations, and the business-only admin list. */
.settings-shell { width: min(100%, 1000px); align-self: start; }
.settings-grid { display: grid; gap: 16px; }
.settings-panel {
    min-width: 0;
    padding: clamp(18px, 4vw, 25px);
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(75,59,122,.14);
    border-radius: 20px;
    box-shadow: var(--inner-highlight), var(--shadow-sm);
    backdrop-filter: blur(12px);
}
.settings-panel h2 { margin: 0 0 18px; color: #3A2E5C; font-size: 1.15rem; }
.settings-panel h3 { margin: 16px 0 6px; color: #4B3B7A; font-size: 1rem; }
.settings-panel .form-stack { margin-top: 12px; }
.settings-panel .form-stack .button { width: fit-content; min-width: 140px; }
.settings-separator { height: 1px; margin: 20px 0; background: #DDD4EC; }
.settings-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 2px;
    color: #4B3B7A;
    text-decoration: none;
    border-bottom: 1px solid #DDD4EC;
}
.settings-action strong { color: #6B5F8A; font-size: .85rem; }
.settings-action:focus-visible,
.settings-legal-actions .legal-link:focus-visible { outline: 3px solid rgba(212,175,55,.62); outline-offset: 3px; }
.settings-logout { color: var(--danger); border-bottom: 0; }
.readonly-setting { display: grid; gap: 3px; padding: 10px 0; color: #3A2E5C; }
.readonly-setting > span { font-size: .82rem; font-weight: 700; }
.readonly-setting strong { font-size: .95rem; }
.readonly-setting small { color: #6B5F8A; line-height: 1.6; }
.settings-details { margin-top: 20px; padding-top: 14px; border-top: 1px solid #DDD4EC; }
.settings-details summary { min-height: 44px; color: #4B3B7A; font-weight: 800; cursor: pointer; }
.setting-switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.setting-switch input { width: 23px; height: 23px; margin: 2px 0 0; accent-color: #4B3B7A; flex: none; }
.setting-switch span { display: grid; gap: 3px; }
.setting-switch strong { color: #3A2E5C; font-size: .95rem; }
.setting-switch small { color: #6B5F8A; font-size: .8rem; line-height: 1.6; }
.settings-legal-actions { display: grid; gap: 8px; margin-bottom: 14px; }
.settings-legal-actions .legal-link {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 2px;
    text-align: start;
    border-bottom-color: #DDD4EC;
}
.invite-share {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 16px;
    background: #FBF8F2;
    border: 1px solid #D4AF37;
    border-radius: 12px;
}
.invite-share p { margin: 0; color: #3A2E5C; font-weight: 700; }
.invite-local-note { padding: 10px 12px; color: #805D17; background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.4); border-radius: 9px; font-size: .82rem; line-height: 1.6; }
.invite-share input {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    color: #4B3B7A;
    background: #FFFFFF;
    border: 1px solid #DDD4EC;
    border-radius: 8px;
    font-size: .78rem;
}
.invite-share .button { justify-self: start; }
.invite-share [role="status"] { color: #276749; font-size: .8rem; }
.settings-teacher-list { margin-top: 20px; }
.setting-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #DDD4EC;
}
.setting-person > span { display: grid; gap: 3px; min-width: 0; }
.setting-person strong { color: #3A2E5C; overflow-wrap: anywhere; }
.setting-person small { color: #6B5F8A; }
.invite-landing { width: min(100%, 560px); }
.invite-landing .button { margin-top: 12px; }
.invite-academy { color: #6B5F8A; text-align: center; line-height: 1.65; }
.invite-academy strong { display: block; color: #4B3B7A; font-size: 1.3rem; }
.invite-language { display: flex; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.invite-language a { min-width: 72px; min-height: 38px; display: grid; place-items: center; padding: 6px 10px; color: #4B3B7A; background: #FBF8F2; border: 1px solid #DDD4EC; border-radius: 99px; text-decoration: none; font-size: .78rem; }
.invite-language a[aria-current="true"] { color: #FFFFFF; background: #4B3B7A; border-color: #4B3B7A; }
.invite-language a:focus-visible { outline: 3px solid rgba(212,175,55,.6); outline-offset: 3px; }
.invite-landing .legal-agreement { margin-top: 4px; }
.admin-customers-link { margin-top: 20px; }
.admin-academies-shell { width: min(100%, 1120px); }
.admin-academies-shell .admin-heading p { margin: 8px 0 0; color: #6B5F8A; }
.admin-customer-filters {
    display: grid;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid #DDD4EC;
    border-radius: 14px;
}
.admin-customer-filters label { display: grid; gap: 6px; color: #3A2E5C; font-size: .83rem; font-weight: 700; }
.admin-customer-filters input,
.admin-customer-filters select {
    width: 100%;
    min-height: 43px;
    padding: 9px 11px;
    color: #3A2E5C;
    background: #FBF8F2;
    border: 1px solid #DDD4EC;
    border-radius: 9px;
}
.admin-customer-table-wrap { overflow-x: auto; background: #FFFFFF; border: 1px solid #DDD4EC; border-radius: 14px; }
.admin-customer-table { width: 100%; min-width: 780px; border-collapse: collapse; text-align: start; }
.admin-customer-table th,
.admin-customer-table td { padding: 14px 12px; border-bottom: 1px solid #DDD4EC; text-align: start; font-size: .86rem; }
.admin-customer-table th { color: #3A2E5C; background: #F4F0FA; font-weight: 800; }
.admin-customer-table tr:last-child td { border-bottom: 0; }
.teachers-shell .list-toolbar { margin-top: 22px; }
.teacher-student-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 15px; border-bottom: 1px solid #EEE8F5; background: #FFFFFF; }
.teacher-student-row:last-child { border-bottom: 0; }
.teacher-transfer-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.teacher-transfer-form select { max-width: 220px; min-height: 40px; }
.teacher-workspace-banner { width: 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding: 14px 16px; color: #3A2E5C; background: #FFF6D7; border: 1px solid #D4AF37; border-radius: 14px; box-shadow: 0 8px 20px rgba(58,46,92,.07); }
.teacher-workspace-banner > div { display: grid; gap: 3px; }
.teacher-workspace-banner strong { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.teacher-workspace-banner span { font-size: 1.05rem; font-weight: 800; }
html[dir="rtl"] .teacher-workspace-banner strong { letter-spacing: 0; }
.fee-ledger-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin: 16px 0; }
.fee-ledger-summary article { padding: 14px; border: 1px solid #DDD4EC; border-radius: 14px; background: #FBF8F2; }
.fee-ledger-summary span, .fee-ledger-summary strong { display: block; }
.fee-ledger-summary span { color: #6B5F8A; font-size: .78rem; }
.fee-ledger-summary strong { margin-top: 5px; color: #4B3B7A; font-size: 1.08rem; }
.fee-detail-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; align-items: start; margin-top: 16px; }
.fee-detail-grid .fee-detail-card { width: 100%; max-width: none; min-width: 0; margin: 0; padding: 18px; }
.fee-detail-card h2 { margin: 0 0 12px; color: #4B3B7A; }
.fee-inline-form, .fee-inline-actions, .fee-inline-actions form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.fee-month-form label { flex: 1 1 180px; min-width: 0; }
.fee-month-form input { width: 100%; }
.fee-period-row, .fee-payment-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 0; border-bottom: 1px solid #EEE8F5; }
.fee-period-row:last-child, .fee-payment-row:last-child { border-bottom: 0; }
.fee-period-row small, .fee-payment-row small { display: block; margin-top: 3px; color: #6B5F8A; }
.fee-payment-edit { display: grid; gap: 8px; margin: 10px 0; }
.admin-customer-table td { color: #3A2E5C; }
.admin-customer-table td strong { font-weight: 800; color: #4B3B7A; }
.admin-empty { text-align: center !important; color: #6B5F8A !important; }
.admin-status-pill { display: inline-block; padding: 5px 9px; color: #4B3B7A; background: #EEEAF7; border-radius: 99px; white-space: nowrap; font-size: .75rem; font-weight: 700; }
.admin-status-pill.status-active_paid { color: #276749; background: #EBF8F1; }
.admin-status-pill.status-limited { color: #A83B48; background: #FFF0F1; }
.admin-pages { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: #6B5F8A; }
html[dir="rtl"] .settings-panel h2,
html[dir="rtl"] .settings-panel h3,
html[dir="rtl"] .invite-academy { line-height: 1.9; }
html[dir="rtl"] .setting-switch,
html[dir="rtl"] .settings-action,
html[dir="rtl"] .settings-legal-actions .legal-link { line-height: 1.85; }
@media (min-width: 760px) {
    .settings-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .settings-grid > .settings-panel:nth-child(3) { grid-column: 1 / -1; }
    .admin-customer-filters { grid-template-columns: minmax(0,2fr) minmax(145px,1fr) minmax(145px,1fr) auto; }
    .fee-detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
}
@media (max-width: 700px) {
    .admin-customer-table { min-width: 0; display: block; }
    .admin-customer-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .admin-customer-table tbody { display: grid; gap: 10px; padding: 10px; }
    .admin-customer-table tr { display: block; padding: 7px 12px; border: 1px solid #DDD4EC; border-radius: 12px; background: #FFFFFF; }
    .admin-customer-table td { display: flex; align-items: start; justify-content: space-between; gap: 12px; min-width: 0; padding: 9px 0; border-bottom: 1px solid #EEE8F5; overflow-wrap: anywhere; }
    .admin-customer-table td:last-child { border-bottom: 0; }
    .admin-customer-table td[data-label]::before { content: attr(data-label); flex: 0 0 42%; color: #6B5F8A; font-size: .78rem; font-weight: 700; }
    .admin-customer-table td.admin-empty { display: block; text-align: center; }
    .admin-customer-table td.admin-empty::before { content: none; }
}
@media (max-width: 390px) {
    .settings-panel { padding: 16px; }
    .settings-panel h2 { font-size: 1.06rem; }
    .invite-academy strong { font-size: 1.15rem; }
    .fee-inline-actions,.fee-inline-actions form { width: 100%; }
    .fee-inline-actions form .button { flex: 1 1 auto; }
    .fee-period-row,.fee-payment-row { align-items: stretch; }
}
