html,
body {
    direction: rtl;
}

body {
    min-width: 320px;
}

.academy-home .hero-content {
    margin-right: 8vw;
}

.hero-stats .btn.light-link {
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .08);
}

.hero-stats .btn.light-link:hover {
    background: rgba(255, 255, 255, .16);
}

.auth-shell {
    min-height: calc(100vh - 65px);
    display: grid;
    grid-template-columns: minmax(360px, .82fr) minmax(420px, 1fr);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(249, 250, 251, .96)),
        #f9fafb;
}

.auth-shell-compact {
    grid-template-columns: minmax(360px, .9fr) minmax(420px, .92fr);
}

.auth-visual {
    position: relative;
    min-height: inherit;
    overflow: hidden;
    display: flex;
    align-items: end;
    padding: clamp(28px, 5vw, 64px);
    color: #fff;
    background:
        linear-gradient(to top, rgba(8, 42, 94, .96), rgba(8, 42, 94, .74)),
        url('/images/academy-design/image-3.jpg') center/cover;
}

.auth-visual:after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .1;
    background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0);
    background-size: 28px 28px;
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: 13px;
    font-weight: 800;
}

.auth-kicker svg {
    width: 17px;
    height: 17px;
    color: #fbbf24;
}

.auth-visual h1 {
    margin: 22px 0 14px;
    max-width: 560px;
    font-size: 44px;
    line-height: 1.14;
    font-weight: 900;
}

.auth-visual p {
    margin: 0;
    max-width: 520px;
    color: rgba(255, 255, 255, .76);
    font-size: 16px;
    line-height: 1.9;
}

.auth-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.auth-stats span {
    min-width: 132px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
}

.auth-stats b,
.auth-stats small {
    display: block;
}

.auth-stats b {
    font-size: 18px;
    font-weight: 900;
    color: #fbbf24;
}

.auth-stats small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .66);
    font-size: 12px;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 56px);
}

.auth-card {
    width: min(520px, 100%);
    background: rgba(255, 255, 255, .96);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: clamp(22px, 3vw, 34px);
    box-shadow: 0 24px 70px rgba(8, 42, 94, .11);
}

.auth-card-wide {
    width: min(820px, 100%);
}

.auth-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.auth-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--green);
    background: #edf7f1;
}

.auth-icon svg {
    width: 24px;
    height: 24px;
}

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 900;
}

.auth-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    min-width: 0;
    font-weight: 800;
    color: #18251e;
}

.auth-form input:not([type="checkbox"]),
.auth-form select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px 14px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-form input:not([type="checkbox"]):focus,
.auth-form select:focus {
    border-color: rgba(8, 42, 94, .42);
    box-shadow: 0 0 0 4px rgba(8, 42, 94, .1);
}

.auth-form input::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.required-marker {
    color: #dc2626;
    font-weight: 900;
}

.auth-form .required-input.input-validation-error,
.auth-form .required-input.academy-required-missing,
.academy-required-missing:not(.select2-container) {
    border-color: #fca5a5;
    background: #fffafa;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .08);
}

.auth-form .required-input.input-validation-error:focus,
.auth-form .required-input.academy-required-missing:focus,
.academy-required-missing:not(.select2-container):focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
}

.academy-required-missing.select2-container .select2-selection--single,
.academy-required-missing.select2-container .select2-selection--multiple {
    border-color: #fca5a5 !important;
    background: #fffafa !important;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .08) !important;
}

.auth-form .latin-number-input {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
    font-family: var(--font-inter), ui-sans-serif, system-ui, sans-serif;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-form .check-row {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-weight: 700;
}

.auth-form .check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.legal-consent {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}

.legal-consent .check-row {
    align-items: flex-start;
    line-height: 1.8;
}

.legal-consent a {
    color: var(--green);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-size: 15px;
    gap: 8px;
}

.auth-submit svg {
    width: 18px;
    height: 18px;
}

.auth-form .btn.primary {
    border-color: #0B3D91;
    background: #0B3D91;
    color: #fff;
}

.auth-form .btn.ghost {
    border-color: #dbe3ea;
    background: #fff;
    color: #0B3D91;
}

.auth-form .btn:disabled {
    cursor: not-allowed;
    opacity: .68;
    transform: none;
    box-shadow: none;
}

.otp-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2px;
}

.otp-status-strip span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.35;
}

.otp-status-strip svg {
    width: 16px;
    height: 16px;
    color: #0B5ED7;
}

.otp-phone-chip {
    background: #EAF3FF !important;
    color: #0B3D91 !important;
    border-color: #BFDBFE !important;
}

.otp-code-entry {
    display: grid;
    justify-items: center;
    padding: 8px 0 2px;
}

.otp-code-label {
    width: min(420px, 100%);
}

.auth-form .otp-code-input {
    min-height: 58px;
    border-width: 2px;
    border-color: #d6e2dc;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #fbfdfc);
    font-size: 22px;
    font-weight: 850;
    text-align: center;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.otp-policy-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #7c4a03;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.7;
}

.otp-policy-note svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    color: #d97706;
}

.otp-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.otp-resend-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    border-radius: 12px;
    padding-inline: 18px 20px;
}

.otp-resend-action svg {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
}

.otp-resend-action span {
    line-height: 1.2;
}

.auth-switch {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 2px;
    color: #6b7280;
    font-weight: 700;
}

.auth-switch a {
    color: var(--green);
    font-weight: 900;
}

.auth-switch a:hover {
    color: #082A5E;
}

.validation-summary,
span.field-validation-error {
    color: #b91c1c;
    font-size: 13px;
}

.validation-summary.validation-summary-errors {
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff1f2;
    line-height: 1.7;
}

.validation-summary ul {
    margin: 0;
    padding-inline-start: 18px;
}

span.field-validation-error {
    font-weight: 700;
}

.legal-page {
    min-height: calc(100vh - 65px);
    padding: clamp(28px, 5vw, 72px) 18px;
    background: #f9fafb;
}

.legal-content {
    width: min(920px, 100%);
    margin-inline: auto;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(8, 42, 94, .08);
}

.legal-content .auth-kicker {
    color: var(--green);
    border-color: #BFDBFE;
    background: #EAF3FF;
}

.legal-content h1 {
    margin: 18px 0 14px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.2;
    font-weight: 900;
}

.legal-content h2 {
    margin: 28px 0 8px;
    font-size: 20px;
    font-weight: 900;
}

.legal-content p {
    margin: 0;
    color: #4b5563;
    line-height: 1.9;
}

.logout-form {
    margin: auto 12px 12px;
}

.logout-form .logout {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.topbar-title {
    flex: 1;
}

.record-cards article p {
    margin-bottom: 0;
}

@media (max-width: 620px) {
    .academy-home .hero-content {
        margin-inline: auto;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .auth-shell,
    .auth-shell-compact {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 300px;
        align-items: center;
    }

    .auth-visual h1 {
        font-size: 34px;
    }

    .auth-panel {
        padding: 20px;
    }
}

@media (max-width: 620px) {
    .auth-visual {
        min-height: auto;
        padding: 28px 18px;
    }

    .auth-stats span {
        min-width: 0;
        flex: 1 1 130px;
    }

    .auth-card-head {
        align-items: flex-start;
    }

    .auth-card h1 {
        font-size: 24px;
    }

    .auth-switch {
        flex-wrap: wrap;
    }

    .otp-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .otp-resend-action {
        width: 100%;
    }
}

/* Responsive portal remediation */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.dashboard,
.dashboard-main,
.main,
.content,
.card,
.panel {
    min-width: 0;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: none;
    border: 0;
    background: rgba(15, 23, 42, .42);
    cursor: pointer;
}

body.sidebar-open {
    overflow: hidden;
}

body.sidebar-open .sidebar-backdrop {
    display: block;
}

body.sidebar-open .sidebar {
    transform: translateX(0) !important;
}

.portal-sidebar-toggle {
    display: none;
}

.table-responsive,
.table-wrap,
.inst-table-wrap,
.v9-table-wrap {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.table-responsive > table,
.table-wrap > table,
.v9-table,
.inst-table {
    width: 100%;
    min-width: 680px;
}

.toolbar,
.button-row,
.inst-actions,
.v8-actions,
.v8-searchbar,
.inst-filterbar {
    min-width: 0;
}

.toolbar > *,
.button-row > *,
.inst-actions > *,
.v8-actions > *,
.v8-searchbar > *,
.inst-filterbar > * {
    max-width: 100%;
}

.toolbar input,
.toolbar select,
.toolbar textarea,
.v8-searchbar input,
.v8-searchbar select,
.inst-filterbar input,
.inst-filterbar select {
    min-width: min(12rem, 100%) !important;
}

.password-field {
    position: relative;
    display: block;
    width: 100%;
}

.password-field > input {
    width: 100%;
    padding-inline-end: 3rem !important;
}

.password-field.password-field--icon-left > input {
    padding-left: 3rem !important;
    padding-right: .75rem !important;
}

.password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: .35rem;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    transform: translateY(-50%);
    border: 0;
    border-radius: .7rem;
    display: grid;
    place-items: center;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    z-index: 2;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(13, 110, 253, .1);
    color: #0B5ED7;
}

.icon-btn-v12,
button[data-close-modal],
button[data-close-rate],
button[data-close-event],
.modal button[aria-label*="إغلاق"],
.inst-modal button[aria-label*="إغلاق"],
.clone-dialog button[aria-label*="إغلاق"],
.event-dialog button[aria-label*="إغلاق"] {
    min-width: 2.75rem !important;
    min-height: 2.75rem !important;
}

.password-toggle svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1024px) {
    .sidebar {
        z-index: 60 !important;
        max-width: min(20rem, 86vw);
        transform: translateX(100%) !important;
    }

    .body-ltr .sidebar,
    body.ltr .sidebar {
        transform: translateX(-100%) !important;
    }

    body > .portal-sidebar-toggle {
        position: fixed;
        top: max(.8rem, env(safe-area-inset-top));
        left: max(.8rem, env(safe-area-inset-left));
        right: auto;
        z-index: 120;
        width: 2.5rem;
        height: 2.5rem;
        border: 0;
        background: transparent;
        color: #000;
        box-shadow: none;
    }

    body.sidebar-open > .portal-sidebar-toggle {
        background: transparent;
        box-shadow: none;
    }

    body > .portal-sidebar-toggle svg {
        width: 1.85rem;
        height: 1.85rem;
    }

    .icon-btn,
    .portal-sidebar-toggle {
        display: inline-grid;
    }
}

@media (max-width: 420px) {
    .topbar,
    .page-header,
    .panel-head,
    .v8-card-head,
    .inst-page-head {
        align-items: stretch;
        gap: .75rem;
    }

    .toolbar,
    form.toolbar,
    .button-row,
    .v8-searchbar,
    .inst-filterbar,
    .catalog-search-row {
        align-items: stretch !important;
        flex-direction: column;
        width: 100%;
    }

    .toolbar input,
    .toolbar select,
    .toolbar textarea,
    .toolbar .btn,
    .button-row .btn,
    .v8-searchbar input,
    .v8-searchbar select,
    .v8-searchbar .btn,
    .inst-filterbar input,
    .inst-filterbar select,
    .inst-filterbar .inst-btn,
    .catalog-search-row input,
    .catalog-search-row .btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

.moyasar-checkout-page {
    min-height: calc(100vh - 4.5rem);
    padding: clamp(1.25rem, 4vw, 3rem);
    background:
        linear-gradient(135deg, rgba(var(--theme-primary-rgb), .06), transparent 34%),
        linear-gradient(315deg, rgba(var(--theme-primary-navy-rgb), .08), transparent 30%),
        #f8fafc;
}

.moyasar-shell {
    display: grid;
    grid-template-columns: minmax(17rem, .72fr) minmax(22rem, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
    width: min(74rem, 100%);
    margin: 0 auto;
    align-items: stretch;
}

.moyasar-summary,
.moyasar-panel {
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 1rem;
    box-shadow: 0 1.5rem 3.5rem rgba(15, 23, 42, .08);
}

.moyasar-summary {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    color: #f8fafc;
    background:
        linear-gradient(145deg, rgba(var(--theme-primary-navy-rgb), .96), rgba(var(--theme-primary-dark-rgb), .92)),
        url('/images/academy-design/image-3.jpg') center/cover;
}

.moyasar-summary:before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 8%, rgba(var(--theme-accent-rgb), .2), transparent 28%);
    pointer-events: none;
}

.moyasar-summary > * {
    position: relative;
    z-index: 1;
}

.moyasar-back,
.moyasar-brand,
.moyasar-details div {
    display: flex;
    align-items: center;
}

.moyasar-back {
    gap: .45rem;
    width: fit-content;
    color: var(--theme-primary-light, #EAF3FF);
    text-decoration: none;
    font-weight: 800;
}

.moyasar-back svg,
.moyasar-brand svg,
.moyasar-kicker svg,
.moyasar-method svg,
.moyasar-form-head svg {
    width: 1.15rem;
    height: 1.15rem;
}

.moyasar-brand {
    gap: .8rem;
    margin-top: auto;
}

.moyasar-brand span,
.moyasar-form-head > svg {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .85rem;
    background: rgba(255, 255, 255, .13);
    color: var(--theme-accent, #f59e0b);
}

.moyasar-brand b,
.moyasar-brand small,
.moyasar-invoice span,
.moyasar-amount span {
    display: block;
}

.moyasar-brand small,
.moyasar-invoice p,
.moyasar-amount span,
.moyasar-details dt {
    color: rgba(241, 245, 249, .72);
}

.moyasar-invoice h1 {
    margin: .35rem 0 .65rem;
    max-width: 100%;
    font-size: clamp(1.35rem, 2.3vw, 1.85rem);
    font-weight: 750;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.moyasar-invoice p {
    max-width: 30rem;
    margin: 0;
    line-height: 1.8;
}

.moyasar-amount {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .09);
}

.moyasar-amount strong {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: .35rem;
    direction: ltr;
    margin-top: .3rem;
    font-size: clamp(1.9rem, 3.3vw, 2.55rem);
    font-weight: 900;
    line-height: 1.15;
    text-align: left;
}

.moyasar-money-value {
    font-variant-numeric: tabular-nums;
}

.moyasar-riyal-icon {
    flex: 0 0 auto;
    width: 1.08em;
    height: 1.08em;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(91%) sepia(17%) saturate(469%) hue-rotate(73deg) brightness(105%) contrast(99%);
    transform: translateY(.12em);
}

.moyasar-details {
    display: grid;
    gap: .65rem;
    margin: 0;
}

.moyasar-details div {
    justify-content: space-between;
    gap: 1rem;
    padding-top: .65rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.moyasar-details dd,
.moyasar-details dt {
    margin: 0;
}

.moyasar-details dd {
    max-width: 12.5rem;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: .92rem;
    font-weight: 650;
    line-height: 1.45;
    text-align: left;
    direction: ltr;
}

.english-identifier,
.latin-identifier {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: Arial, "Segoe UI", Tahoma, sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.moyasar-method:disabled {
    cursor: wait;
    opacity: .72;
}

.moyasar-panel {
    padding: clamp(1.25rem, 3vw, 2rem);
    background: rgba(255, 255, 255, .92);
}

.moyasar-panel-head {
    margin-bottom: 1.25rem;
}

.moyasar-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 2rem;
    padding: .35rem .7rem;
    border: 1px solid rgba(var(--theme-primary-rgb), .22);
    border-radius: 999px;
    color: var(--theme-primary-dark, #0B3D91);
    background: var(--theme-primary-light, #EAF3FF);
    font-size: .82rem;
    font-weight: 900;
}

.moyasar-panel h2 {
    margin: .8rem 0 .35rem;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1.18;
    color: #0f172a;
}

.moyasar-panel p {
    margin: 0;
    color: #64748b;
    line-height: 1.8;
}

.moyasar-methods {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.moyasar-method {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 5.4rem;
    padding: .85rem;
    border: 1px solid #e2e8f0;
    border-radius: .9rem;
    background: #fff;
    color: #0f172a;
    text-align: start;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.moyasar-method:hover,
.moyasar-method:focus-visible {
    border-color: var(--theme-primary, #0D6EFD);
    box-shadow: 0 .9rem 1.8rem rgba(var(--theme-primary-rgb), .12);
    transform: translateY(-1px);
}

.moyasar-method.active {
    border-color: var(--theme-primary, #0D6EFD);
    background: linear-gradient(180deg, var(--theme-primary-light, #EAF3FF), #fff);
    box-shadow: inset 0 0 0 1px rgba(var(--theme-primary-rgb), .25), 0 .85rem 1.5rem rgba(var(--theme-primary-rgb), .12);
}

.moyasar-method > svg {
    flex: 0 0 auto;
    color: var(--theme-primary, #0D6EFD);
}

.moyasar-method b,
.moyasar-method small {
    display: block;
}

.moyasar-method small {
    margin-top: .2rem;
    color: #64748b;
    font-size: .78rem;
    line-height: 1.45;
}

.moyasar-form-card {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
}

.moyasar-form-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.moyasar-form-head b,
.moyasar-form-head span {
    display: block;
}

.moyasar-form-head b {
    color: #0f172a;
    font-size: 1rem;
}

.moyasar-form-head span {
    margin-top: .25rem;
    color: #64748b;
    font-size: .86rem;
    line-height: 1.6;
}

.moyasar-form-card .mysr-form {
    padding: 1rem;
}

.moyasar-form-card .mysr-form > form,
.moyasar-form-card .mysr-form .mysr-form {
    width: 100%;
}

.moyasar-inline-error {
    border: 1px solid #fed7aa;
    border-radius: .85rem;
    padding: .9rem 1rem;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 800;
    line-height: 1.7;
}

.moyasar-inline-loading {
    border: 1px solid rgba(var(--theme-primary-rgb), .18);
    border-radius: .85rem;
    padding: .9rem 1rem;
    background: var(--theme-primary-light, #EAF3FF);
    color: var(--theme-primary-dark, #0B3D91);
    font-weight: 800;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .moyasar-shell {
        grid-template-columns: 1fr;
    }

    .moyasar-summary {
        min-height: 19rem;
    }
}

@media (max-width: 640px) {
    .moyasar-checkout-page {
        padding: 1rem;
    }

    .moyasar-methods {
        grid-template-columns: 1fr;
    }

    .moyasar-form-head {
        align-items: flex-start;
    }
}

.brand-logos {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .6rem;
    direction: ltr;
}

.brand-logos-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    justify-content: flex-end;
}

.brand-logo {
    display: block;
    max-width: none;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.brand-logo-effat {
    width: 10rem;
    height: 3.625rem;
    padding: .12rem;
    border-radius: .65rem;
    object-fit: cover;
    object-position: center;
}

.brand-title {
    font-weight: 900;
    white-space: nowrap;
}

.public-nav {
    direction: rtl;
}

.public-nav .nav-actions,
.public-nav .brand,
.public-nav .brand-logos-link {
    direction: rtl;
}

@media (min-width: 769px) {
    .public-nav .nav-actions {
        margin-inline-start: auto;
    }

    .public-nav .brand-logos-link {
        padding-inline-start: .5rem;
    }
}

.side-brand .brand-logos {
    gap: .35rem;
}

.side-brand .brand-logo-effat {
    width: 6.5rem;
    height: 2.25rem;
}

@media (max-width: 640px) {
    .brand-logo-effat {
        width: 7.5rem;
        height: 2.875rem;
    }
}

.topnav-menu,
.public-nav-menu {
    display: contents;
}

.mobile-menu-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #0B3D91;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.mobile-menu-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.mobile-menu-toggle .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;
}

@media (max-width: 768px) {
    .public-nav {
        height: auto;
        min-height: 4.25rem;
        display: grid;
        grid-template-columns: auto 2.5rem minmax(0, 1fr);
        grid-template-areas:
            "logos toggle brand"
            "menu menu menu";
        align-items: center;
        gap: .55rem;
        padding-block: .45rem;
        direction: ltr;
    }

    .public-nav .brand {
        grid-area: brand;
        justify-self: end;
        min-width: 0;
        max-width: 100%;
        direction: rtl;
    }

    .public-nav .brand-title {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(.82rem, 3.7vw, .98rem);
        line-height: 1.4;
    }

    .public-nav .brand .brand-title {
        display: block;
    }

    .public-nav .brand span.brand-title:last-child {
        display: block;
        font-size: clamp(.76rem, 3.1vw, .88rem);
        line-height: 1.35;
    }

    .public-nav .brand-logos-link {
        grid-area: logos;
        justify-self: start;
        max-width: 100%;
        direction: ltr;
    }

    .public-nav .brand-logos {
        gap: .35rem;
    }

    .public-nav .brand-logo-effat {
        width: 5.25rem;
        height: 2.05rem;
        border-radius: .5rem;
    }

    .public-nav .mobile-menu-toggle {
        grid-area: toggle;
        display: inline-grid;
        justify-self: center;
    }

    .public-nav .public-nav-menu {
        grid-area: menu;
        display: none;
        width: 100%;
        padding: .55rem;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
        direction: rtl;
    }

    .public-nav .public-nav-menu.is-open {
        display: grid;
    }

    .public-nav .nav-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: .5rem;
    }

    .public-nav .nav-actions form,
    .public-nav .nav-actions .btn,
    .public-nav .nav-actions button,
    .public-nav .nav-actions a {
        width: 100%;
        justify-content: center;
    }

    .public-nav .public-nav-menu .nav-actions .btn,
    .public-nav .public-nav-menu .nav-actions button,
    .public-nav .public-nav-menu .nav-actions a,
    .public-nav .public-nav-menu .nav-actions .ghost {
        display: inline-flex;
    }
}

.mobile-menu-toggle {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.mobile-menu-icon {
    display: grid;
    gap: .42rem;
    width: 2.15rem;
}

.mobile-menu-icon span {
    display: block;
    width: 100%;
    height: .34rem;
    border-radius: 999px;
    background: #000;
}

.mobile-menu-toggle svg {
    width: 1.85rem;
    height: 1.85rem;
    color: #000;
    stroke-width: 2;
}

.mobile-menu-line-icon {
    fill: none;
    stroke: #000;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 768px) {
    .public-nav {
        grid-template-columns: 2.5rem auto minmax(0, 1fr);
        grid-template-areas:
            "toggle logos brand";
    }

    .public-nav .mobile-menu-toggle {
        justify-self: start;
        position: relative;
        z-index: 90;
    }

    .public-nav .brand-logos-link {
        justify-self: start;
    }

    .public-nav::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(15, 23, 42, .38);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }

    .public-nav.is-mobile-menu-open::before {
        opacity: 1;
    }

    .public-nav .public-nav-menu {
        position: fixed;
        inset-block: 0;
        right: -21rem;
        z-index: 80;
        display: grid;
        align-content: start;
        width: min(21rem, 86vw);
        height: 100dvh;
        padding: 5.5rem 1rem 1rem;
        border: 0;
        border-left: 1px solid #e5e7eb;
        border-radius: 0;
        box-shadow: -22px 0 55px rgba(15, 23, 42, .18);
        transform: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: none;
    }

    .public-nav .public-nav-menu.is-open,
    .public-nav .public-nav-menu[data-mobile-menu-open="true"] {
        display: grid;
        right: 0 !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transition: none !important;
    }
}

/* Shared small-screen containment for classic public, auth, and portal screens. */
@media (max-width: 900px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    .auth-shell,
    .auth-shell-compact,
    .moyasar-shell,
    .dashboard-grid,
    .course-detail-layout,
    .public-course-layout,
    .public-diploma-layout,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr !important;
    }

    .main,
    .content,
    .topbar,
    .toolbar,
    .card,
    .panel,
    .metric,
    .hero-banner,
    .auth-card,
    .auth-panel,
    .moyasar-card {
        min-width: 0;
    }

    .auth-shell,
    .auth-shell-compact {
        width: min(100% - 1.5rem, 72rem);
        gap: 1rem;
        padding-block: 1.25rem;
    }

    .auth-visual {
        min-height: 13rem;
    }

    .topbar {
        height: auto;
        min-height: 4rem;
        gap: .75rem;
        padding: .75rem 1rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .topbar .toolbar {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .action-row,
    .mini-item,
    .message,
    .section-head {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .table-wrap,
    .table-responsive,
    .v9-table-wrap,
    .inst-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap > table,
    .table-responsive > table,
    .v9-table,
    .inst-table,
    .content > table,
    .card > table,
    .panel > table {
        min-width: min(42rem, 100vw);
    }

    .content > table,
    .card > table,
    .panel > table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal {
        padding: .75rem;
    }

    .modal-box {
        width: min(100%, calc(100vw - 1.5rem));
        max-height: calc(100dvh - 1.5rem);
        overflow: auto;
        border-radius: 1rem;
    }

    .hero-banner {
        min-height: 12rem;
        border-radius: 1rem;
    }
}

@media (max-width: 640px) {
    body {
        min-width: 320px;
    }

    .content {
        padding: .9rem;
    }

    .grid-4,
    .grid-3,
    .grid-2,
    .auth-form-grid,
    .kanban,
    .quick-grid {
        grid-template-columns: 1fr !important;
    }

    .auth-shell,
    .auth-shell-compact {
        width: min(100% - 1rem, 72rem);
        padding-block: .75rem;
    }

    .auth-card,
    .auth-panel,
    .moyasar-card,
    .card,
    .panel {
        border-radius: .95rem;
        padding: 1rem;
    }

    .auth-visual {
        display: none;
    }

    .page-title h1,
    .auth-title,
    .hero-banner h1 {
        font-size: clamp(1.35rem, 7vw, 1.85rem);
        line-height: 1.25;
    }

    .toolbar,
    .action-row,
    .nav-actions,
    .dialog-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: .55rem;
    }

    .content .btn,
    .content button,
    .modal .btn,
    .modal button,
    .toolbar .btn,
    .toolbar button,
    .action-row .btn,
    .action-row button {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    .input,
    .select,
    textarea,
    input,
    select {
        max-width: 100%;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: .25rem;
    }

    .day {
        min-height: 2.75rem;
        padding: .35rem;
        border-radius: .55rem;
        font-size: .72rem;
    }

    .bubble {
        max-width: 92%;
    }

    .toast {
        right: .75rem;
        left: .75rem;
        bottom: .75rem;
        width: auto;
    }
}

@media (max-width: 420px) {
    .topbar,
    .content {
        padding-inline: .75rem;
    }

    .badge {
        white-space: normal;
        text-align: center;
    }
}

/* Dock portal actions into the right sidebar drawer on small screens. */
@media (max-width: 1024px) {
    .dashboard > .main > .topbar {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: flex-start;
        gap: .75rem;
        min-height: 4.4rem;
        padding: .75rem 1rem .75rem 4.5rem !important;
    }

    .body-ltr .dashboard > .main > .topbar,
    body.ltr .dashboard > .main > .topbar {
        padding: .75rem 1rem .75rem 4.5rem !important;
    }

    .dashboard > .main > .topbar .portal-sidebar-toggle {
        flex: 0 0 2.75rem;
        order: 0;
        margin-top: .05rem;
        width: 2.75rem;
        height: 2.75rem;
        border: 1px solid rgba(11, 61, 145, .16);
        background: #EAF3FF;
        color: #0B3D91;
        box-shadow: 0 8px 20px rgba(8, 42, 94, .08);
    }

    body.sidebar-open .dashboard > .main > .topbar .portal-sidebar-toggle {
        position: relative;
        z-index: 90;
        background: #fff;
        box-shadow: 0 14px 34px rgba(15, 23, 42, .2);
    }

    body.sidebar-open .dashboard > .main > .topbar {
        z-index: 95;
    }

    .dashboard > .main > .topbar .page-title,
    .dashboard > .main > .topbar .topbar-title {
        flex: 1 1 auto;
        order: 1;
        width: auto !important;
        min-width: 0;
        text-align: right;
    }

    .dashboard > .main > .topbar .page-title h1,
    .dashboard > .main > .topbar .page-title p {
        white-space: normal;
    }

    .dashboard > .sidebar .side-nav {
        padding-bottom: .75rem;
    }

    .dashboard > .sidebar .toolbar.is-in-sidebar-menu {
        flex: 0 0 auto;
        display: grid !important;
        grid-template-columns: 1fr;
        align-items: stretch;
        width: auto !important;
        margin: 0 .75rem .9rem;
        padding: .85rem 0 0;
        border-top: 1px solid #eef2f7;
        gap: .55rem;
    }

    .dashboard > .sidebar .toolbar.is-in-sidebar-menu > *,
    .dashboard > .sidebar .toolbar.is-in-sidebar-menu form,
    .dashboard > .sidebar .toolbar.is-in-sidebar-menu .btn,
    .dashboard > .sidebar .toolbar.is-in-sidebar-menu button,
    .dashboard > .sidebar .toolbar.is-in-sidebar-menu a {
        width: 100% !important;
        max-width: 100%;
        min-width: 0 !important;
    }

    .dashboard > .sidebar .toolbar.is-in-sidebar-menu .btn,
    .dashboard > .sidebar .toolbar.is-in-sidebar-menu button {
        min-height: 2.65rem;
        justify-content: center;
        box-shadow: none;
        white-space: normal;
        text-align: center;
    }

    .dashboard > .sidebar .toolbar.is-in-sidebar-menu .session-logout-portal {
        position: static;
        z-index: auto;
    }

    .dashboard > .sidebar .toolbar.is-in-sidebar-menu .session-logout-portal button {
        height: auto;
        min-height: 2.65rem;
    }
}

/* Blue theme finishing layer for legacy MVC surfaces. */
:root {
    --theme-primary: #0D6EFD;
    --theme-primary-dark: #0B3D91;
    --theme-primary-navy: #082A5E;
    --theme-primary-light: #EAF3FF;
    --theme-primary-rgb: 13, 110, 253;
    --theme-primary-dark-rgb: 11, 61, 145;
    --theme-primary-navy-rgb: 8, 42, 94;
    --theme-accent: #f59e0b;
    --theme-accent-rgb: 245, 158, 11;
    --theme-gradient: linear-gradient(135deg, #082A5E 0%, #0B3D91 55%, #0A58CA 100%);
    --theme-overlay: rgba(8, 42, 94, 0.72);
    --theme-footer-bg: #082A5E;
    --theme-button-gradient: linear-gradient(135deg, #082A5E 0%, #0B3D91 56%, #0A58CA 100%);
    --theme-button-hover: linear-gradient(135deg, #061D42 0%, #082A5E 55%, #0B3D91 100%);
    --theme-focus-ring: #0B3D91;
}

.btn.primary,
.btn-primary,
.auth-submit,
.academy-swal-confirm {
    background: var(--theme-button-gradient) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(8, 42, 94, .2);
}

.btn.primary:hover,
.btn-primary:hover,
.auth-submit:hover,
.academy-swal-confirm:hover {
    background: var(--theme-button-hover) !important;
    box-shadow: 0 18px 38px rgba(8, 42, 94, .28);
}

.btn.primary:focus-visible,
.btn-primary:focus-visible,
.auth-submit:focus-visible,
.academy-swal-confirm:focus-visible {
    outline: 3px solid var(--theme-focus-ring);
    outline-offset: 2px;
}

.footer {
    background: linear-gradient(135deg, #082A5E 0%, #0B3D91 56%, #0D6EFD 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.footer a:hover {
    color: #EAF3FF;
}

/* Shared money display: render SAR as the Saudi riyal SVG mark instead of text. */
.saudi-riyal-amount,
.saudi-riyal-currency {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: .28em;
    unicode-bidi: isolate;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.saudi-riyal-amount {
    direction: rtl; flex-wrap: nowrap;
}

.saudi-riyal-amount[dir="ltr"] { direction: ltr; }

.saudi-riyal-currency {
    direction: rtl;
}

.saudi-riyal-value {
    display: inline-block; flex: 0 0 auto; white-space: nowrap; overflow-wrap: normal;
    direction: ltr;
    unicode-bidi: isolate;
}

.saudi-riyal-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: .88em;
    height: .88em;
    background: currentColor;
    transform: translateY(.1em);
    -webkit-mask: url('/images/icons/saudi-riyal.svg') center / contain no-repeat;
    mask: url('/images/icons/saudi-riyal.svg') center / contain no-repeat;
}

.saudi-riyal-currency .saudi-riyal-icon {
    width: 1.05em;
    height: 1.05em;
}

/* Shared collapsible filter sections */
.academy-filter-collapsible {
    min-width: 0;
}

.academy-filter-shell {
    display: grid;
    gap: .75rem;
    margin-bottom: 1rem;
}

.academy-filter-shell > .catalog-filter-card,
.academy-filter-shell > .filter-card,
.academy-filter-shell > .inst-filterbar,
.academy-filter-shell > .v8-searchbar {
    margin-bottom: 0 !important;
}

.academy-filter-header {
    position: relative;
    z-index: 1;
}

.academy-filter-toggle {
    width: 100%;
    min-height: 3.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .9rem;
    border: 1px solid rgba(11, 61, 145, .15);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .94)),
        linear-gradient(90deg, rgba(11, 61, 145, .06), rgba(245, 158, 11, .06));
    color: #0f172a;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    cursor: pointer;
    text-align: right;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.academy-filter-toggle:hover,
.academy-filter-toggle:focus-visible {
    border-color: rgba(11, 61, 145, .28);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .09);
    transform: translateY(-1px);
    outline: none;
}

.academy-filter-toggle-main,
.academy-filter-toggle-action {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.academy-filter-toggle-main {
    gap: .75rem;
}

.academy-filter-icon {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #EAF3FF;
    color: #0B3D91;
}

.academy-filter-icon svg,
.academy-filter-toggle-action svg {
    width: 1.1rem;
    height: 1.1rem;
}

.academy-filter-copy {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.academy-filter-copy strong {
    color: #0f172a;
    font-size: .98rem;
    font-weight: 900;
    line-height: 1.25;
}

.academy-filter-copy small {
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.4;
}

.academy-filter-toggle-action {
    flex: 0 0 auto;
    gap: .45rem;
    padding: .45rem .7rem;
    border-radius: 999px;
    background: #fff;
    color: #0B3D91;
    border: 1px solid rgba(11, 61, 145, .12);
    font-size: .82rem;
    font-weight: 900;
}

.academy-filter-body[hidden] {
    display: none !important;
}

.academy-filter-collapsible.is-collapsed {
    margin-bottom: 1rem;
}

.academy-filter-collapsible.is-collapsed .academy-filter-toggle {
    border-style: dashed;
}

.academy-filter-collapsible.is-expanded .academy-filter-toggle {
    border-color: rgba(11, 61, 145, .25);
}

.card.academy-filter-collapsible > .academy-filter-header:first-child,
.card .academy-filter-header {
    margin-bottom: .85rem;
}

@media (max-width: 640px) {
    .academy-filter-toggle {
        align-items: stretch;
        flex-direction: column;
        padding: .85rem;
    }

    .academy-filter-toggle-action {
        width: 100%;
        justify-content: center;
    }
}

/* Preserve the complete Ibn Rushd lockup beside the Effat wordmark. */
.brand-logo-ibnrushd {
    width: 3.125rem;
    height: 3.625rem;
    padding: .12rem;
    border-radius: .5rem;
    object-fit: contain;
}

.side-brand .brand-logo-ibnrushd {
    width: 1.9375rem;
    height: 2.25rem;
}

.public-nav .brand-logo {
    border: 0;
    box-shadow: none;
    background: transparent;
}

.public-nav .brand-logo-ibnrushd {
    width: 4.5rem;
    height: 5.125rem;
}

.public-nav .brand-logo-effat {
    width: 4.5rem;
    height: 5.125rem;
}

.public-nav {
    height: auto;
    min-height: 6rem;
    padding-block: .375rem;
}

@media (max-width: 768px) {
    .brand-logo-ibnrushd {
        width: 1.8125rem;
        height: 2.05rem;
    }

    .public-nav .brand-logo-ibnrushd {
        width: 3rem;
        height: 3.5rem;
    }

    .public-nav .brand-logo-effat {
        width: 3rem;
        height: 3.5rem;
    }

    .public-nav {
        min-height: 5rem;
    }

    .public-nav .brand-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
}

/* Frame the stacked app-listing artwork without modifying its pixels. */
.brand-logo-effat {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.effat-logo-artwork {
    position: absolute;
    display: block;
    top: 50%;
    left: 50%;
    width: 200%;
    max-width: none;
    height: auto;
    transform: translate(-50%, -50%);
}

.side-brand {
    height: auto;
    min-height: 7rem;
    padding: .75rem 1rem;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}

.side-brand .brand-title {
    max-width: 100%;
    font-size: .875rem;
    line-height: 1.5;
    white-space: normal;
}

.side-brand .brand-logo-effat,
.side-brand .brand-logo-ibnrushd {
    width: 2.5rem;
    height: 2.875rem;
    border: 0;
    box-shadow: none;
}
