:root {
    color-scheme: light;
    --navy: #6d0826;
    --navy-2: #8f294b;
    --brand: #6d0826;
    --gold: #d8a94d;
    --cyan: #d8a94d;
    --cyan-2: #f4d783;
    --blue: #8f294b;
    --ink: #2a131b;
    --muted: #76545f;
    --line: rgba(109, 8, 38, .14);
    --surface: rgba(255, 252, 244, .86);
    --surface-strong: #fffdf7;
    --surface-border: rgba(255, 255, 255, .86);
    --header-bg: rgba(255, 252, 244, .82);
    --card-bg: rgba(255, 252, 244, .78);
    --soft-bg: rgba(244, 215, 131, .18);
    --table-bg: rgba(255, 252, 244, .78);
    --table-head: rgba(244, 215, 131, .3);
    --input-bg: rgba(255, 253, 248, .9);
    --danger: #c8405d;
    --success: #127760;
    --warning: #b67b27;
    --on-primary: #fff9ea;
    --on-brand: #fff9ea;
    --shadow: 0 24px 70px rgba(109, 8, 38, .13);
    --primary-gradient: linear-gradient(135deg, #f4d783, #d8a94d 48%, #a96828);
    --brand-gradient: linear-gradient(135deg, #5b061f, #8f294b 54%, #f4d783);
    --hero-gradient: linear-gradient(145deg, rgba(91, 6, 31, .98), rgba(143, 41, 75, .9) 58%, rgba(216, 169, 77, .78));
    --footer-gradient: linear-gradient(135deg, #5b061f, #8f294b 58%, #3b0618);
    --placeholder-gradient:
        linear-gradient(135deg, rgba(91, 6, 31, .82), rgba(143, 41, 75, .62)),
        linear-gradient(45deg, #5b061f, #f4d783);
    --body-bg:
        linear-gradient(135deg, rgba(109, 8, 38, .055) 0 1px, transparent 1px 22px),
        linear-gradient(180deg, #fffaf0 0%, #f4ead9 48%, #fffdf8 100%);
}

.course-command {
    display: grid;
    gap: 22px;
}

.course-current-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    color: #fff;
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(73, 36, 62, .96), rgba(112, 66, 100, .86) 58%, rgba(187, 132, 147, .78)),
        var(--primary-gradient);
    box-shadow: 0 28px 76px rgba(73, 36, 62, .24);
}

.course-current-card::after {
    content: "";
    position: absolute;
    inset: auto -8% -44% auto;
    width: 280px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 42px solid rgba(255, 255, 255, .12);
}

.course-current-main,
.course-progress-shell,
.course-picker-footer,
.toggle-line {
    display: flex;
    align-items: center;
    gap: 14px;
}

.course-current-main,
.course-progress-shell {
    position: relative;
    z-index: 1;
}

.course-current-card h2 {
    margin: 10px 0 6px;
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 3rem);
}

.course-current-card p,
.course-progress-shell small,
.course-progress-shell .meta {
    color: rgba(255, 255, 255, .78);
}

.course-icon-orbit {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 24px;
    color: #49243E;
    background: linear-gradient(135deg, #fff, var(--cyan-2));
    box-shadow: 0 18px 44px rgba(0, 0, 0, .22);
}

.course-icon-orbit svg,
.course-student-option svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.course-progress-ring {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    flex: 0 0 104px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(73, 36, 62, .96) 56%, transparent 57%),
        conic-gradient(var(--cyan) var(--progress, 0%), rgba(255, 255, 255, .2) 0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 18px 42px rgba(0, 0, 0, .18);
}

.course-progress-ring strong {
    color: #fff;
    font-size: 1.25rem;
}

.course-progress-shell b {
    display: block;
    color: #fff;
    font-size: 1.35rem;
}

.course-admin-grid {
    align-items: start;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
}

.course-form-panel {
    position: relative;
    overflow: hidden;
}

.toggle-line {
    min-height: 44px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--soft-bg);
    color: var(--navy);
    font-weight: 800;
}

.course-form-grid .toggle-line.full {
    width: fit-content;
    min-width: min(100%, 220px);
    justify-self: center;
    justify-content: center;
}

.course-form-grid .toggle-line span {
    white-space: nowrap;
}

.course-student-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 12px;
    max-height: none;
    overflow: visible;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--soft-bg);
}

.course-student-option {
    display: grid;
    grid-template-columns: auto 52px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    background: var(--surface);
}

.course-student-option:has(input:checked) {
    border-color: rgba(15, 148, 109, .42);
    background: rgba(15, 148, 109, .11);
}

.course-student-avatar {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 15px;
    object-fit: cover;
    color: #fff;
    font-weight: 900;
    background: var(--brand-gradient);
}

.course-student-option b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.course-student-label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.course-student-label small {
    color: var(--muted);
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.course-student-option.is-hidden {
    display: none;
}

.course-student-mini-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.course-student-mini-pager[hidden] {
    display: none !important;
}

.course-student-mini-pager .btn {
    min-width: 110px;
}

.course-picker-footer {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
}

.course-picker-footer .badge {
    justify-self: end;
}

.course-picker-footer .btn {
    justify-self: center;
}

.course-select-all-line {
    justify-content: flex-start;
    width: 100%;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--soft-bg);
}

.course-archive-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.course-archive-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--soft-bg);
}

.course-archive-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 188px;
}

.course-archive-actions form,
.course-archive-actions .btn {
    width: auto;
}

.course-archive-card.is-active {
    border-color: rgba(15, 148, 109, .38);
    background: rgba(15, 148, 109, .1);
}

.course-archive-card > a {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.course-archive-card > a > .badge {
    display: inline-flex;
    justify-content: center;
    width: 100%;
}

.course-archive-card strong {
    color: var(--navy);
}

.course-archive-card > a small,
.course-archive-card > a span:not(.badge) {
    color: var(--muted);
}

.table-course-summary th a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.course-summary-panel .course-stat-grid {
    gap: 18px;
    margin-bottom: 18px;
}

.table-course-summary {
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
}

.course-summary-filter {
    flex: 1 1 760px;
    justify-content: flex-start;
    align-items: center;
    width: min(1120px, 100%);
}

.course-summary-filter input,
.course-summary-filter select {
    min-width: 0;
    width: 100%;
}

.table-course-summary tr[data-course-summary-row][hidden],
.table-course-summary tr[data-course-summary-empty][hidden],
.table-course-summary tr.is-filtered-out {
    display: none !important;
}

.table-course-summary th,
.table-course-summary td {
    padding-block: 15px;
}

.course-scope-panel {
    margin-top: 20px;
    margin-bottom: 20px;
}

.course-scope-filter {
    width: min(560px, 100%);
}

.course-scope-filter select {
    min-width: min(100%, 360px);
}

.course-archive-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.course-archive-metrics b {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--navy);
    font-size: .82rem;
    background: rgba(219, 175, 160, .12);
}

.course-page-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
    text-align: center;
}

.course-create-action {
    margin-top: 28px;
}

.points-bulk-action {
    margin-top: -26px;
    margin-bottom: 30px;
}

.course-create-action .btn,
.course-page-actions .btn {
    min-width: min(100%, 240px);
}

.course-standalone-form-panel {
    max-width: none;
}

.student-record-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-record-grid .panel {
    min-width: 0;
    overflow: hidden;
}

.student-record-grid .table-wrap,
.student-ledger-wrap {
    width: 100%;
    max-width: 100%;
}

.table-student-attendance,
.table-student-points,
.table-student-donations {
    min-width: 0;
    table-layout: auto;
}

@media (prefers-reduced-motion: no-preference) {
    .course-current-card,
    .course-student-option,
    .course-archive-card {
        animation: himma-rise .3s ease both;
        transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
    }

    .course-student-option:hover,
    .course-archive-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 34px rgba(101, 18, 38, .1);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .finance-workbench > * {
        animation: himma-rise .42s cubic-bezier(.2, .8, .2, 1) both;
    }

    .finance-workbench > :nth-child(2) {
        animation-delay: .06s;
    }

    .finance-workbench > :nth-child(3) {
        animation-delay: .12s;
    }

    .finance-balance-card,
    .finance-action-panel,
    .finance-balance-icon,
    .finance-action-icon {
        transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    }

    .finance-balance-card:hover,
    .finance-action-panel:hover {
        transform: translateY(-3px);
        border-color: color-mix(in srgb, currentColor 32%, var(--line));
        box-shadow: 0 30px 68px rgba(101, 18, 38, .16);
    }

    .finance-balance-card:hover .finance-balance-icon,
    .finance-action-panel:hover .finance-action-icon {
        transform: scale(1.04) rotate(-2deg);
    }
}

@media (max-width: 980px) {
    .course-current-card,
    .course-progress-shell {
        align-items: flex-start;
        flex-direction: column;
    }

    .course-admin-grid,
    .student-record-grid {
        grid-template-columns: 1fr;
    }

    .finance-archive-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .course-current-card {
        padding: 18px;
        border-radius: 22px;
    }

    .course-icon-orbit {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 19px;
    }

    .course-progress-ring {
        width: 86px;
        height: 86px;
        flex-basis: 86px;
    }

    .course-student-picker {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .finance-archive-summary {
        grid-template-columns: 1fr;
    }

    .course-archive-list {
        grid-template-columns: 1fr;
    }

    .course-picker-footer,
    .course-archive-card {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .course-archive-actions {
        justify-content: flex-start;
        min-width: 0;
    }

    .course-picker-footer {
        flex-direction: column;
    }

    .table-course-summary td:nth-child(1)::before { content: "الطالب"; }
    .table-course-summary td:nth-child(2)::before { content: "الصفحات"; }
    .table-course-summary td:nth-child(3)::before { content: "نقاط القرآن"; }
    .table-course-summary td:nth-child(4)::before { content: "النقاط الكلية"; }
    .table-course-summary td:nth-child(5)::before { content: "نقاط الدورة"; }
    .table-course-summary td:nth-child(6)::before { content: "السبر"; }
    .table-course-summary td:nth-child(7)::before { content: "التبرعات"; }
    .table-course-summary td:nth-child(8)::before { content: "الدوام"; }
    .table-course-summary td:nth-child(9)::before { content: "الحضور"; }
    .table-course-summary td:nth-child(10)::before { content: "التأخر"; }
    .table-course-summary td:nth-child(11)::before { content: "الغياب"; }

    .table-student-attendance td:nth-child(1)::before { content: "التاريخ"; }
    .table-student-attendance td:nth-child(2)::before { content: "الحالة"; }
}

@media (max-width: 980px) {
    .quran-exam-type-grid {
        grid-template-columns: 1fr;
    }

    .quran-exam-live-summary,
    .quran-exam-filter-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .quran-exam-live-summary p {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .quran-exam-panel-head,
    .quran-exam-archive-head {
        align-items: stretch;
    }

    .quran-exam-filter-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .quran-exam-filter-button {
        width: 100%;
    }

    .table-auth-logs td:nth-child(1)::before { content: "الحالة"; }
    .table-auth-logs td:nth-child(2)::before { content: "الحساب"; }
    .table-auth-logs td:nth-child(3)::before { content: "الجهاز والنظام"; }
    .table-auth-logs td:nth-child(4)::before { content: "المتصفح"; }
    .table-auth-logs td:nth-child(5)::before { content: "IP"; }
    .table-auth-logs td:nth-child(6)::before { content: "التاريخ والوقت"; }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --navy: #f4d783;
    --navy-2: #d8a94d;
    --brand: #8f294b;
    --gold: #f4d783;
    --cyan: #f4d783;
    --cyan-2: #ffe9a6;
    --blue: #e6be66;
    --ink: #fff6df;
    --muted: #d8c8ad;
    --line: rgba(244, 215, 131, .14);
    --surface: rgba(16, 8, 11, .88);
    --surface-strong: #0b0508;
    --surface-border: rgba(244, 215, 131, .14);
    --header-bg: rgba(7, 3, 5, .9);
    --card-bg: rgba(18, 8, 12, .86);
    --soft-bg: rgba(244, 215, 131, .09);
    --table-bg: rgba(14, 7, 10, .82);
    --table-head: rgba(109, 8, 38, .4);
    --input-bg: rgba(8, 4, 6, .94);
    --danger: #ff7891;
    --success: #5ed9b6;
    --warning: #ffd180;
    --on-primary: #1d090f;
    --on-brand: #fff9ea;
    --shadow: 0 24px 78px rgba(0, 0, 0, .58);
    --primary-gradient: linear-gradient(135deg, #f4d783, #d8a94d 58%, #9f6c20);
    --brand-gradient: linear-gradient(135deg, #090406, #4b061b 54%, #8f294b);
    --hero-gradient: linear-gradient(145deg, rgba(7, 3, 5, .98), rgba(58, 5, 20, .9) 58%, rgba(143, 41, 75, .78));
    --footer-gradient: linear-gradient(135deg, #070305, #360515 58%, #0c0507);
    --placeholder-gradient:
        linear-gradient(135deg, rgba(7, 3, 5, .92), rgba(109, 8, 38, .6)),
        linear-gradient(45deg, #070305, #6d0826);
    --body-bg:
        linear-gradient(135deg, rgba(244, 215, 131, .028) 0 1px, transparent 1px 24px),
        linear-gradient(180deg, #060304 0%, #0b0508 46%, #050203 100%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tajawal, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--body-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    min-height: 100%;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
video {
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

.page-shell {
    width: min(1280px, calc(100% - 56px));
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.site-header {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0 18px;
    padding: 10px 12px;
    background: var(--header-bg);
    border: 1px solid var(--surface-border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

@media (min-width: 721px) {
    .page-shell {
        padding-top: 92px;
    }

    .site-header {
        position: fixed;
        top: 14px;
        left: 50%;
        width: min(1280px, calc(100% - 56px));
        margin: 0;
        transform: translateX(-50%);
    }
}

.brand,
.mobile-brand,
.header-actions,
.main-nav,
.dashboard-nav,
.row-actions,
.filter-tabs,
.quick-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--navy);
    background: color-mix(in srgb, var(--soft-bg) 76%, transparent);
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}

.action-icon:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--blue) 46%, var(--line));
    background: color-mix(in srgb, var(--soft-bg) 88%, var(--blue));
}

.action-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-icon-lg {
    width: 44px;
    height: 44px;
    border-radius: 13px;
}

.action-icon-delete {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
    background: color-mix(in srgb, var(--danger) 11%, transparent);
}

.action-icon-delete:hover {
    color: #fff;
    border-color: var(--danger);
    background: var(--danger);
}

.action-icon-save {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 38%, var(--line));
    background: color-mix(in srgb, var(--success) 10%, transparent);
}

.action-icon-save:hover {
    color: #fff;
    border-color: var(--success);
    background: var(--success);
}

.action-icon-approve {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 44%, var(--line));
    background: color-mix(in srgb, var(--success) 12%, transparent);
}

.action-icon-approve:hover:not(:disabled) {
    color: #fff;
    border-color: var(--success);
    background: var(--success);
}

.action-icon:disabled {
    opacity: .46;
    cursor: not-allowed;
    transform: none;
}

.action-icon-undo {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 44%, var(--line));
    background: color-mix(in srgb, var(--warning) 11%, transparent);
}

.action-icon-undo:hover {
    color: #fff;
    border-color: var(--warning);
    background: var(--warning);
}

.action-icon-restore {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 42%, var(--line));
    background: color-mix(in srgb, var(--success) 12%, transparent);
}

.action-icon-restore:hover {
    color: #fff;
    border-color: var(--success);
    background: var(--success);
}

.action-icon-muted {
    cursor: not-allowed;
    color: var(--muted);
    opacity: .58;
    background: color-mix(in srgb, var(--soft-bg) 62%, transparent);
}

.row-actions .action-icon,
.course-archive-actions .action-icon {
    flex: 0 0 auto;
}

.header-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.mobile-topbar {
    display: none;
}

.mobile-bottom-tabs {
    display: none;
}

.brand,
.mobile-brand {
    flex: 0 0 auto;
    min-width: max-content;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    color: #fff;
    font-weight: 900;
    font-size: 1.25rem;
    background: var(--brand-gradient);
    box-shadow: 0 0 0 6px rgba(187, 132, 147, .14), 0 16px 32px rgba(73, 36, 62, .22);
}

.brand-mark img {
    width: 76%;
    height: 76%;
    display: block;
    object-fit: contain;
}

.main-nav a,
.dashboard-nav a,
.btn {
    white-space: nowrap;
}

.main-nav a,
.dashboard-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.main-nav a span,
.dashboard-nav a span {
    white-space: nowrap;
}

.main-nav svg,
.dashboard-nav svg,
.btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-menu-toggle {
    display: none;
}

.brand strong,
.brand small,
.mobile-brand strong,
.mobile-brand small {
    display: block;
}

.brand small,
.mobile-brand small {
    color: var(--muted);
    margin-top: 2px;
}

.main-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
}

.main-nav a,
.dashboard-nav a,
.filter-tabs a {
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--navy-2);
    font-weight: 700;
}

.main-nav a:hover,
.dashboard-nav a:hover,
.filter-tabs a:hover,
.filter-tabs .is-active {
    background: var(--soft-bg);
    color: var(--blue);
}

.main-nav a.is-active,
.filter-tabs .is-active {
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 12px 26px rgba(112, 66, 100, .22);
}

.dashboard-nav a.is-active {
    color: #fff7f4;
    background: rgba(219, 175, 160, .24);
    box-shadow: inset 0 0 0 1px rgba(219, 175, 160, .22), 0 10px 24px rgba(0, 0, 0, .16);
}

.dashboard-nav {
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(38, 19, 35, .96), rgba(31, 17, 29, .96));
    color: #fff7f4;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.dashboard-nav a {
    position: relative;
    color: #fff7f4;
}

.nav-notification-count {
    position: absolute;
    inset-block-start: -7px;
    inset-inline-start: -7px;
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border: 2px solid var(--surface-strong);
    border-radius: 999px;
    color: #fff;
    background: var(--danger);
    box-shadow: 0 10px 24px rgba(217, 71, 99, .28);
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
    z-index: 2;
}

.dashboard-nav a:hover {
    background: rgba(219, 175, 160, .18);
    color: #fff;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    font-weight: 800;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 14px;
    background: var(--soft-bg);
}

.user-chip-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    color: #fff;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1;
    object-fit: cover;
    background: var(--brand-gradient);
}

.mobile-user-chip {
    display: none;
}

.btn,
.icon-btn {
    border: 0;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 14px;
}

.btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
}

form.is-submitting button[type="submit"],
form.is-submitting button:not([type]),
form.is-submitting input[type="submit"],
button.is-loading,
input[type="submit"].is-loading {
    cursor: wait;
    opacity: .72;
    pointer-events: none;
}

.btn.is-loading,
.icon-btn.is-loading,
button.is-loading {
    position: relative;
}

.btn.is-loading::after,
.icon-btn.is-loading::after,
button.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid currentColor;
    border-inline-start-color: transparent;
    border-radius: 999px;
    animation: himma-spin .72s linear infinite;
}

@media (prefers-reduced-motion: no-preference) {
    .panel,
    .album-card,
    .student-card,
    .stat-card,
    .lesson-preview,
    .alert,
    .media-tile {
        animation: himma-rise .28s ease both;
    }

    .main-nav a,
    .dashboard-nav a,
    .filter-tabs a,
    .mobile-tab,
    .upload-mode-tabs button,
    .album-card,
    .student-card,
    .stat-card,
    .lesson-preview,
    .media-tile,
    .table-wrap tbody tr,
    .hero-feature-card,
    .hero-feature-icon,
    input,
    textarea,
    select {
        transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
    }

    .album-card:hover,
    .student-card:hover,
    .stat-card:hover,
    .lesson-preview:hover,
    .media-tile:hover {
        transform: translateY(-3px);
    }

    .hero-feature-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 22px 48px rgba(73, 36, 62, .16);
    }

    .hero-feature-card:hover .hero-feature-icon {
        transform: rotate(-3deg) scale(1.04);
    }

    .table-wrap tbody tr:hover {
        background: rgba(219, 175, 160, .07);
    }

    .hero-copy > .eyebrow,
    .hero-identity-title,
    .hero-copy > p,
    .hero-feature-card,
    .hero-visual {
        animation: himma-rise .42s ease both;
    }

    .hero-identity-title { animation-delay: .04s; }
    .hero-copy > p { animation-delay: .08s; }
    .hero-feature-card:nth-child(1) { animation-delay: .12s; }
    .hero-feature-card:nth-child(2) { animation-delay: .18s; }
    .hero-feature-card:nth-child(3) { animation-delay: .24s; }
    .hero-visual { animation-delay: .16s; }
}

@keyframes himma-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes himma-spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary {
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 16px 34px rgba(112, 66, 100, .25);
}

.btn-cyan {
    color: var(--navy);
    background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
}

html[data-theme="dark"] .btn-cyan {
    color: #49243E;
}

.btn-ghost {
    color: var(--navy);
    background: var(--soft-bg);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    color: var(--navy);
    font-weight: 900;
    background: var(--soft-bg);
    transition: transform .18s ease, background .18s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-toggle-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.theme-icon {
    position: absolute;
    inset: 0;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity .16s ease, transform .16s ease;
}

.theme-icon-sun {
    opacity: 0;
    transform: rotate(-20deg) scale(.82);
}

.theme-icon-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 0;
    transform: rotate(18deg) scale(.82);
}

.theme-toggle [data-theme-toggle-label] {
    display: none;
}

.logout-button {
    width: 42px;
    min-width: 42px;
    padding-inline: 0;
}

.logout-button svg {
    color: var(--danger);
}

.logout-label {
    display: none;
}

.btn-danger {
    color: #fff;
    background: var(--danger);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .84fr) minmax(420px, 1.16fr);
    gap: 24px;
    align-items: stretch;
    min-height: 560px;
    padding: 34px 0 22px;
}

.hero-copy {
    align-self: center;
    padding: 34px 0;
}

.eyebrow {
    display: inline-flex;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(219, 175, 160, .18);
    color: var(--blue);
    font-weight: 900;
}

.hero h1,
.page-title h1 {
    margin: 18px 0 12px;
    color: var(--navy);
    font-size: clamp(1.95rem, 4vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.hero p,
.page-title p {
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.9;
    max-width: 640px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 26px;
}

.hero-feature-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(219, 175, 160, .12));
    box-shadow: 0 18px 40px rgba(101, 18, 38, .1);
    backdrop-filter: blur(14px);
}

html[data-theme="dark"] .hero-feature-card {
    background: linear-gradient(145deg, rgba(31, 17, 29, .82), rgba(187, 132, 147, .09));
}

.hero-feature-card::after {
    content: "";
    position: absolute;
    inset: auto -22px -26px auto;
    width: 74px;
    height: 74px;
    border-radius: 999px;
    background: rgba(187, 132, 147, .12);
}

.hero-feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 14px 28px rgba(112, 66, 100, .2);
}

.hero-feature-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-feature-card strong,
.hero-feature-card small {
    position: relative;
    z-index: 1;
}

.hero-feature-card strong {
    color: var(--navy);
}

.hero-feature-card small {
    color: var(--muted);
    line-height: 1.6;
}

.about-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(360px, .8fr);
    gap: clamp(20px, 4vw, 52px);
    align-items: center;
    min-height: 560px;
    padding: clamp(24px, 5vw, 58px) 0 32px;
}

.about-hero::before {
    content: "";
    position: absolute;
    inset: 8% auto auto 4%;
    z-index: -1;
    width: min(36vw, 420px);
    aspect-ratio: 1;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(219, 175, 160, .32), transparent 68%);
    filter: blur(4px);
}

.about-hero-copy h1 {
    margin: 18px 0 14px;
    color: var(--navy);
    font-size: clamp(2.4rem, 6vw, 5.6rem);
    line-height: 1.02;
}

.about-hero-copy p,
.about-story p {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 2;
}

.about-hero-actions,
.account-submit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.about-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 470px;
    border-radius: 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at 28% 22%, rgba(219, 175, 160, .34), transparent 18rem),
        var(--hero-gradient);
    box-shadow: 0 34px 90px rgba(73, 36, 62, .24);
}

.about-visual::before,
.about-visual::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.about-visual::before {
    inset: -82px auto auto -74px;
    width: 210px;
    aspect-ratio: 1;
    border: 38px solid rgba(255, 255, 255, .1);
}

.about-visual::after {
    inset: auto -70px -86px auto;
    width: 250px;
    aspect-ratio: 1;
    border: 42px solid rgba(219, 175, 160, .18);
}

.about-visual-mark {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: min(62%, 280px);
    aspect-ratio: 1;
    border-radius: 34px;
    background: rgba(255, 247, 244, .1);
    border: 1px solid rgba(219, 175, 160, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 28px 80px rgba(0, 0, 0, .24);
    backdrop-filter: blur(14px);
}

.about-visual-mark img {
    width: 82%;
    height: 82%;
    object-fit: contain;
}

.about-orbit {
    position: absolute;
    border: 1px solid rgba(219, 175, 160, .24);
    border-radius: 999px;
    animation: himma-float 5.8s ease-in-out infinite;
}

.about-orbit-one {
    width: 78%;
    aspect-ratio: 1;
}

.about-orbit-two {
    width: 48%;
    aspect-ratio: 1;
    animation-delay: -2.4s;
}

.about-visual-card {
    position: absolute;
    z-index: 3;
    width: min(260px, 64%);
    padding: 16px;
    border: 1px solid rgba(219, 175, 160, .24);
    border-radius: 18px;
    color: #fff7f4;
    background: rgba(38, 19, 35, .74);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
    backdrop-filter: blur(16px);
}

.about-visual-card strong,
.about-visual-card span {
    display: block;
}

.about-visual-card span {
    margin-top: 4px;
    color: rgba(255, 247, 244, .72);
    line-height: 1.7;
}

.about-visual-card-main {
    inset: 28px 28px auto auto;
}

.about-visual-card-side {
    inset: auto auto 28px 28px;
}

.about-stat-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.about-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 22px;
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.about-stat-card::after {
    content: "";
    position: absolute;
    inset: auto -38px -42px auto;
    width: 130px;
    aspect-ratio: 1;
    border-radius: 999px;
    background: rgba(187, 132, 147, .14);
}

.about-stat-card strong {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--navy);
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 1;
}

.about-stat-card span {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-weight: 900;
}

.about-story {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(360px, 1fr);
    gap: 24px;
    align-items: start;
}

.about-story h2 {
    margin: 16px 0 10px;
    color: var(--navy);
    font-size: clamp(1.9rem, 4vw, 3.4rem);
    line-height: 1.12;
}

.about-story-grid {
    display: grid;
    gap: 12px;
}

.about-story-grid article,
.about-feature-band article {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.about-story-grid article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 16px;
    padding: 18px;
    border-radius: 22px;
}

.about-story-grid article span {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: var(--on-primary);
    font-weight: 900;
    background: var(--primary-gradient);
}

.about-story-grid article strong {
    color: var(--navy);
    font-size: 1.15rem;
}

.about-story-grid article p {
    margin: 0;
    font-size: .98rem;
}

.about-feature-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.about-feature-band article {
    display: grid;
    gap: 10px;
    min-height: 188px;
    padding: 20px;
    border-radius: 24px;
}

.about-feature-band svg {
    width: 36px;
    height: 36px;
    color: var(--blue);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.about-feature-band strong {
    color: var(--navy);
    font-size: 1.08rem;
}

.about-feature-band span {
    color: var(--muted);
    line-height: 1.7;
}

@keyframes himma-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.mobile-hero-links {
    display: none;
}

.hero-visual {
    position: relative;
    overflow: hidden;
    min-height: 480px;
    border-radius: 30px;
    background: var(--hero-gradient);
    box-shadow: 0 34px 80px rgba(73, 36, 62, .2);
}

.hero-slider-frame {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .7s ease;
}

.slide.is-active {
    opacity: 1;
}

.slide img,
.slide-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-placeholder,
.media-placeholder,
.cover-placeholder,
.avatar-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--placeholder-gradient);
}

.hero-glass {
    position: absolute;
    inset-inline: 20px;
    bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.hero-stat {
    padding: 10px 12px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 16px;
    backdrop-filter: blur(12px);
}

.hero-stat strong {
    display: block;
    font-size: 1.25rem;
}

.section {
    margin: 54px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.section-head > * {
    min-width: 0;
}

.section-head h2,
.panel h2,
.panel h3 {
    margin: 0;
    color: var(--navy);
}

.section-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.title-with-filter {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.lesson-series-filter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    padding: 8px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
}

.lesson-series-filter > input[type="hidden"] {
    display: none;
}

.lesson-series-filter label {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    white-space: nowrap;
    line-height: 1;
}

.lesson-series-filter input,
.lesson-series-filter select {
    min-height: 48px;
}

.lesson-series-filter select {
    min-width: 210px;
}

.lesson-series-filter .filter-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    flex: 0 1 238px;
    min-width: min(100%, 190px);
    max-width: 100%;
}

.lesson-series-filter .filter-control.is-search {
    flex: 1 1 380px;
    min-width: min(100%, 300px);
}

.lesson-series-filter .filter-control.is-sort {
    flex: 0 1 360px;
}

.lesson-series-filter .filter-control.is-compact {
    flex-basis: 200px;
}

.lesson-series-filter .filter-control.is-button {
    display: flex;
    flex: 0 0 auto;
    min-width: auto;
}

.lesson-series-filter .filter-control label {
    min-height: auto;
    margin: 0;
    color: var(--navy);
    font-size: .92rem;
    font-weight: 900;
    line-height: 1.2;
}

.lesson-series-filter .filter-control input,
.lesson-series-filter .filter-control select,
.lesson-series-filter .filter-control .btn {
    width: 100%;
    min-width: 0;
}

.lesson-series-filter .filter-inline-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, .72fr);
    gap: 8px;
    min-width: 0;
}

.course-summary-panel .section-head,
.quran-summary-panel .section-head {
    align-items: flex-start;
}

.quran-summary-panel .lesson-series-filter,
.quran-exam-archive .quran-archive-filter {
    width: min(960px, 100%);
}

.grid {
    display: grid;
    gap: 22px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quran-student-grid {
    grid-template-columns: minmax(300px, .78fr) minmax(680px, 1.22fr);
    align-items: start;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.album-card,
.student-card,
.stat-card,
.lesson-preview {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.panel {
    padding: 22px;
}

.album-card {
    overflow: hidden;
}

.album-cover,
.media-tile {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--soft-bg);
}

.media-open {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: transparent;
    color: inherit;
}

.album-cover img,
.media-tile img,
.media-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 10px;
    color: #fff;
    background: var(--placeholder-gradient);
}

.play-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    padding-inline-start: 4px;
    border-radius: 999px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 900;
    background: rgba(38, 19, 35, .78);
    box-shadow: 0 0 0 8px rgba(187, 132, 147, .16), 0 18px 40px rgba(73, 36, 62, .24);
}

.media-open > .play-mark {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
}

.gallery-locked-panel {
    display: grid;
    place-items: center;
    max-width: 720px;
    margin-inline: auto;
    text-align: center;
}

.gallery-locked-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 12px;
    border-radius: 24px;
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 20px 42px rgba(112, 66, 100, .24);
}

.gallery-locked-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-locked-panel h2 {
    margin: 0;
    color: var(--navy);
}

.gallery-locked-panel p {
    max-width: 520px;
    margin: 8px 0 18px;
    color: var(--muted);
    line-height: 1.8;
}

.album-body,
.student-card,
.stat-card,
.lesson-preview {
    padding: 18px;
}

.meta {
    color: var(--muted);
    font-size: .94rem;
}

.student-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.student-table-person {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
}

.student-mini-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 18px;
    object-fit: cover;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    background: var(--brand-gradient);
}

.stars-block {
    margin-bottom: 28px;
}

.weekly-stars {
    direction: rtl;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}

.star-card {
    direction: rtl;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow);
}

.star-rank-1 {
    grid-column: auto;
    transform: none;
}

.star-rank-2 {
    grid-column: auto;
}

.star-rank-3 {
    grid-column: auto;
    opacity: 1;
}

.rank-badge {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--on-primary);
    font-weight: 900;
    background: var(--primary-gradient);
}

.star-avatar {
    width: 136px;
    height: 136px;
    margin: 0 auto 14px;
    border-radius: 32px;
    overflow: hidden;
    background: var(--soft-bg);
    box-shadow: 0 18px 38px rgba(73, 36, 62, .18);
}

.star-rank-1 .star-avatar {
    width: 136px;
    height: 136px;
    border-radius: 32px;
}

.star-rank-3 .star-avatar {
    width: 136px;
    height: 136px;
}

.star-avatar img,
.star-avatar .avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    font-size: 2rem;
}

.star-card h3 {
    margin: 0 0 6px;
    color: var(--navy);
}

.latest-lesson-row {
    max-width: none;
    margin: 0;
}

.home-lessons-section {
    margin-top: 34px;
}

.home-section-title {
    position: relative;
    display: grid;
    place-items: center;
    gap: 8px;
    margin-bottom: 18px;
    text-align: center;
}

.home-section-title h2 {
    margin: 0;
    color: var(--navy);
}

.home-section-title p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.home-section-title .btn {
    margin-top: 4px;
}

.identity-inline-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hero-identity-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: fit-content;
    margin-top: 14px;
}

.identity-mask-logo,
.identity-logo {
    display: inline-block;
    width: calc(1em * var(--logo-ratio, 1));
    height: 1em;
    flex: 0 0 auto;
}

.identity-mask-logo {
    background: currentColor;
    -webkit-mask: var(--logo-url) center / contain no-repeat;
    mask: var(--logo-url) center / contain no-repeat;
}

.identity-logo {
    object-fit: contain;
}

.identity-mask-logo-sm,
.identity-logo-sm {
    width: calc(.95em * var(--logo-ratio, 1));
    height: .95em;
}

.loop-logo-frame {
    display: inline-grid;
    place-items: center;
    width: max(1.2em, calc((.86em * var(--logo-ratio, 1)) + .32em));
    height: 1.2em;
    flex: 0 0 auto;
    border: .08em solid currentColor;
    border-radius: .18em;
}

.loop-logo-frame .identity-mask-logo,
.loop-logo-frame .identity-logo {
    width: calc(.86em * var(--logo-ratio, 1));
    max-width: calc(100% - .24em);
    height: .86em;
}

.home-section-title--with-action {
    padding-inline: 150px;
}

.home-section-title--with-action .btn {
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: 0;
    transform: translateY(-50%);
}

.latest-lessons-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.home-lesson-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-lesson-card h3 {
    margin: 0;
    color: var(--navy);
    font-size: 1.2rem;
}

.home-lesson-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.lesson-read-more {
    align-self: flex-start;
    margin-top: 12px;
}

.home-lesson-card .lesson-read-more {
    margin-top: auto;
}

.lesson-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.lesson-meta-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--blue);
    font-size: .9rem;
    font-weight: 900;
    background: rgba(219, 175, 160, .14);
}

.avatar,
.avatar-fallback {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: 18px;
    object-fit: cover;
}

.avatar-lg {
    width: 104px;
    height: 104px;
    border-radius: 28px;
}

.student-profile-title .profile-head {
    align-items: center;
}

.student-profile-title .profile-id {
    gap: 28px;
}

.student-profile-title .avatar-lg,
.student-profile-title .avatar-fallback.avatar-lg {
    flex: 0 0 auto;
}

.student-delete-section {
    display: flex;
    justify-content: center;
    margin-top: 34px;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    color: var(--navy);
    font-size: 2rem;
    line-height: 1.1;
}

.stat-card strong small {
    font-size: 1rem;
}

.progress-panel {
    margin-top: 18px;
}

.quran-progress {
    overflow: hidden;
    height: 18px;
    border-radius: 999px;
    background: var(--soft-bg);
    box-shadow: inset 0 1px 4px rgba(73, 36, 62, .12);
}

.quran-progress span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 24px rgba(219, 175, 160, .32);
}

.quran-juz-list {
    display: grid;
    gap: 14px;
}

.quran-juz-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--panel-bg) 84%, var(--soft-bg));
    box-shadow: 0 16px 34px rgba(73, 36, 62, .08);
}

.quran-juz-card > summary {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}

.quran-juz-card > summary::-webkit-details-marker {
    display: none;
}

.quran-juz-arrow {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 12px 24px rgba(47, 128, 255, .24);
    transition: transform .2s ease;
}

.quran-juz-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quran-juz-card[open] .quran-juz-arrow {
    transform: rotate(90deg);
}

.quran-juz-title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.quran-juz-title strong {
    color: var(--navy);
    font-size: 1.08rem;
    font-weight: 900;
}

.quran-juz-title small {
    color: var(--muted);
    font-weight: 800;
}

.quran-juz-count,
.quran-juz-percent {
    white-space: nowrap;
}

.quran-juz-bar {
    grid-column: 2 / -1;
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--soft-bg) 72%, transparent);
    box-shadow: inset 0 1px 4px rgba(73, 36, 62, .16);
}

.quran-juz-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 18px rgba(219, 175, 160, .34);
}

.quran-juz-detail {
    padding: 0 16px 18px;
}

.quran-juz-detail .table-wrap {
    border-radius: 14px;
    overflow-x: hidden;
}

.table-quran-juz-details {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.table-quran-juz-details th,
.table-quran-juz-details td {
    padding: 12px 14px;
    vertical-align: middle;
}

.table-quran-juz-details th:first-child,
.table-quran-juz-details td:first-child {
    width: 44%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.7;
}

.table-quran-juz-details th:nth-child(2),
.table-quran-juz-details td:nth-child(2) {
    width: 23%;
    text-align: center;
    white-space: nowrap;
}

.table-quran-juz-details th:nth-child(3),
.table-quran-juz-details td:nth-child(3) {
    width: 19%;
    text-align: center;
    white-space: nowrap;
}

.table-quran-juz-details.has-actions th:nth-child(4),
.table-quran-juz-details.has-actions td:nth-child(4) {
    width: 14%;
    min-width: 76px;
    text-align: center;
}

.quran-juz-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quran-juz-actions form {
    display: contents;
}

.quran-juz-action {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--navy);
    background: color-mix(in srgb, var(--soft-bg) 72%, transparent);
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}

.quran-juz-action:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--blue) 48%, var(--line));
    background: color-mix(in srgb, var(--soft-bg) 88%, var(--blue));
}

.quran-juz-action svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quran-juz-action-delete {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
    background: color-mix(in srgb, var(--danger) 11%, transparent);
}

.quran-juz-action-delete:hover {
    color: #fff;
    border-color: var(--danger);
    background: var(--danger);
}

.quran-juz-empty {
    margin: 0;
}

.finance-workbench {
    align-items: stretch;
}

.finance-workbench > * {
    min-width: 0;
}

.finance-balance-card,
.finance-action-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-color: color-mix(in srgb, var(--blue) 20%, var(--line));
    box-shadow: 0 24px 54px rgba(101, 18, 38, .12);
}

.finance-balance-card::before,
.finance-action-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 12%, rgba(219, 175, 160, .18), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, .06), transparent 42%);
    opacity: .9;
}

.finance-balance-card::after,
.finance-action-panel::after {
    content: "";
    position: absolute;
    inset-inline-end: -54px;
    inset-block-end: -58px;
    z-index: -1;
    width: 156px;
    height: 156px;
    border-radius: 999px;
    border: 34px solid currentColor;
    opacity: .08;
}

.finance-balance-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    place-items: center;
    align-content: center;
    gap: 18px;
    min-height: 100%;
    text-align: start;
    color: var(--blue);
}

.finance-balance-card strong {
    margin: 6px 0 4px;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.finance-balance-card small,
.finance-balance-card span {
    color: var(--muted);
    font-weight: 900;
}

.finance-balance-icon,
.finance-action-icon {
    display: grid;
    place-items: center;
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 18px 36px rgba(112, 66, 100, .24);
}

.finance-balance-icon {
    width: 74px;
    height: 74px;
    border-radius: 24px;
}

.finance-balance-icon svg,
.finance-action-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.finance-action-panel {
    display: flex;
    flex-direction: column;
    padding: 22px;
}

.finance-action-panel.is-deposit {
    color: var(--success);
}

.finance-action-panel.is-withdraw {
    color: var(--danger);
}

.finance-action-panel.is-deposit .finance-action-icon {
    background: linear-gradient(135deg, #0f946d, #BB8493);
}

.finance-action-panel.is-withdraw .finance-action-icon {
    background: linear-gradient(135deg, #d94763, #ff7b9a);
}

.finance-action-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.finance-action-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 18px;
}

.finance-action-icon svg {
    width: 27px;
    height: 27px;
}

.finance-action-head h2 {
    margin: 0;
}

.finance-action-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .94rem;
    font-weight: 800;
    line-height: 1.55;
}

.finance-action-panel form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.finance-action-panel .field {
    margin-bottom: 14px;
}

.finance-action-panel .field.full {
    margin-top: auto;
    margin-bottom: 0;
}

.finance-action-panel input,
.finance-action-panel select {
    min-height: 48px;
    border-color: color-mix(in srgb, currentColor 18%, var(--line));
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.finance-action-panel input:focus,
.finance-action-panel select:focus {
    border-color: color-mix(in srgb, currentColor 48%, var(--line));
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
    transform: translateY(-1px);
}

.finance-action-panel .btn {
    width: 100%;
    min-height: 48px;
}

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.finance-summary-total {
    grid-column: 1 / -1;
}

.finance-archive-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 4px 0 22px;
}

.finance-archive-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 108px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card-bg) 86%, transparent);
    box-shadow: 0 16px 36px rgba(101, 18, 38, .08);
}

.finance-archive-card::after {
    content: "";
    position: absolute;
    inset-inline-end: -34px;
    inset-block-start: -34px;
    width: 94px;
    height: 94px;
    border-radius: 999px;
    background: currentColor;
    opacity: .08;
}

.finance-archive-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 12px 28px rgba(112, 66, 100, .22);
}

.finance-archive-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.finance-archive-card small,
.finance-archive-card strong {
    position: relative;
    z-index: 1;
    display: block;
}

.finance-archive-card small {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.55;
}

.finance-archive-card strong {
    margin-top: 8px;
    color: var(--navy);
    font-size: 1.35rem;
    line-height: 1.1;
}

.finance-archive-card strong span {
    font-size: .86rem;
}

.finance-archive-card.is-withdraw {
    color: var(--danger);
}

.finance-archive-card.is-withdraw .finance-archive-icon {
    background: linear-gradient(135deg, #d94763, #ff7b9a);
}

.finance-archive-card.is-deposit {
    color: var(--success);
}

.finance-archive-card.is-deposit .finance-archive-icon {
    background: linear-gradient(135deg, #0f946d, #BB8493);
}

@media (max-width: 980px) {
    .finance-archive-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .finance-balance-card {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .finance-action-head {
        align-items: flex-start;
    }

    .finance-archive-summary {
        grid-template-columns: 1fr;
    }
}

.quran-exam-layout {
    align-items: stretch;
}

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

.quran-exam-title {
    padding-bottom: 8px;
}

.quran-exam-panel {
    position: relative;
    overflow: hidden;
}

.quran-exam-panel::after {
    content: "";
    position: absolute;
    inset: auto -34px -36px auto;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: rgba(219, 175, 160, .09);
    pointer-events: none;
}

.quran-exam-panel-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.quran-exam-panel-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.quran-exam-live-badge {
    min-width: 92px;
    align-self: start;
}

.quran-exam-form {
    position: relative;
    z-index: 1;
}

.quran-exam-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.quran-exam-type-option,
.quran-exam-filter-button {
    border: 1px solid var(--line);
    background: var(--card-bg);
    color: var(--ink);
}

.quran-exam-type-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 82px;
    padding: 14px;
    text-align: start;
    border-radius: 18px;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(101, 18, 38, .07);
}

.quran-exam-type-option.is-active {
    color: var(--on-primary);
    border-color: transparent;
    background: var(--primary-gradient);
    box-shadow: 0 18px 36px rgba(112, 66, 100, .22);
}

.quran-exam-type-icon,
.quran-exam-field-icon,
.quran-exam-rule-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.quran-exam-type-icon,
.quran-exam-rule-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
    color: var(--blue);
}

.quran-exam-type-option.is-active .quran-exam-type-icon {
    color: #fff;
    background: rgba(255, 255, 255, .18);
}

.quran-exam-type-icon svg,
.quran-exam-field-icon svg,
.quran-exam-rule-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quran-exam-type-copy {
    display: grid;
    gap: 4px;
}

.quran-exam-type-copy strong,
.quran-exam-type-copy small {
    display: block;
}

.quran-exam-type-copy small,
.quran-exam-live-summary p,
.quran-exam-rule-card p,
.quran-exam-filter-summary .meta {
    color: var(--muted);
}

.quran-exam-type-option.is-active .quran-exam-type-copy small {
    color: rgba(255, 255, 255, .82);
}

.quran-exam-live-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(187, 132, 147, .13), rgba(73, 36, 62, .06));
}

.quran-exam-live-summary strong,
.quran-exam-rule-card strong {
    color: var(--navy);
}

.quran-exam-live-summary p {
    max-width: 420px;
    margin: 0;
    line-height: 1.8;
}

.quran-exam-conditional.is-hidden {
    display: none;
}

.quran-exam-field-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--soft-bg);
}

.quran-exam-field-card > :last-child {
    flex: 1;
}

.quran-exam-field-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--blue);
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.quran-exam-help {
    gap: 12px;
}

.quran-exam-filter {
    min-width: min(280px, 100%);
}

.quran-exam-rule-grid {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
}

.quran-exam-rule-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: 0 14px 34px rgba(101, 18, 38, .07);
}

.quran-exam-rule-card b {
    color: var(--success);
}

.quran-exam-archive-head {
    align-items: center;
}

.quran-exam-archive {
    grid-column: 1 / -1;
}

.quran-exam-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quran-exam-filter-button {
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.quran-exam-filter-button.is-active {
    color: var(--on-primary);
    border-color: transparent;
    background: var(--primary-gradient);
    box-shadow: 0 16px 32px rgba(112, 66, 100, .2);
}

.quran-exam-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.rank-fraction {
    display: flex !important;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    margin-bottom: 6px;
    direction: rtl;
    text-align: right;
    white-space: nowrap;
}

.rank-number {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    text-align: right;
}

.rank-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.rank-metric-card {
    box-shadow: none;
}

.student-portal-rank-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-sort-filter {
    margin-top: 12px;
}

.student-search-filter {
    display: grid;
    grid-template-columns: auto minmax(320px, 1.35fr) auto minmax(240px, .95fr) auto;
    align-items: center;
    width: min(980px, 100%);
}

.student-search-filter input,
.student-search-filter select {
    min-width: 0;
    width: 100%;
}

.sort-direction-button {
    min-height: 48px;
    white-space: nowrap;
}

.table-students-summary tr[data-student-row][hidden],
.table-students-summary tr[data-student-empty-row][hidden],
.table-students-summary tr.is-filtered-out {
    display: none !important;
}

.student-table-actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.setting-checkbox-card {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--soft-bg);
}

.lesson-preview {
    min-height: 100%;
}

.page-title {
    padding: 38px 0 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

.form-grid > .full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.is-hidden {
    display: none !important;
}

.upload-mode-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    margin: 14px 0 18px;
    border-radius: 16px;
    background: var(--soft-bg);
}

.upload-mode-tabs button {
    border: 0;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--navy);
    font-weight: 900;
    background: transparent;
}

.upload-mode-tabs button.is-active {
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 12px 26px rgba(112, 66, 100, .22);
}

label {
    color: var(--navy);
    font-weight: 800;
}

label.is-required::after {
    content: "*";
    color: var(--danger);
    font-size: .85em;
    margin-inline-start: 4px;
}

input,
textarea,
select,
.rich-editor {
    width: 100%;
    border: 1px solid var(--line);
    outline: none;
    border-radius: 15px;
    background: var(--input-bg);
    color: var(--ink);
    padding: 12px 14px;
}

select {
    appearance: none;
    padding-inline-start: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2310233f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 16px 16px;
    background-position: left 16px center;
}

html[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e9f6ff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

textarea,
.rich-editor {
    min-height: 150px;
    resize: vertical;
    line-height: 1.8;
}

input:focus,
textarea:focus,
select:focus,
.rich-editor:focus {
    border-color: rgba(219, 175, 160, .88);
    box-shadow: 0 0 0 4px rgba(219, 175, 160, .15);
}

.rich-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--navy);
    background: var(--soft-bg);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--table-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: var(--table-bg);
}

table.compact-table {
    min-width: 0;
}

.table-quran-students,
.table-lessons,
.table-quran-pages,
.table-student-quran,
.table-quran-exams,
.table-student-exams,
.table-student-points,
.table-student-donations,
.table-points-standings,
.table-auth-logs,
.table-activity-logs,
.table-presence {
    min-width: 0;
}

.table-quran-pages {
    table-layout: fixed;
}

.table-quran-pages th:first-child,
.table-quran-pages td:first-child {
    width: 50%;
    min-width: 300px;
    white-space: nowrap;
}

.table-quran-pages th:nth-child(2),
.table-quran-pages td:nth-child(2) {
    width: 18%;
}

.table-quran-pages th:nth-child(3),
.table-quran-pages td:nth-child(3) {
    width: 22%;
    white-space: nowrap;
}

.table-quran-pages th:nth-child(4),
.table-quran-pages td:nth-child(4) {
    width: 10%;
}

.table-activity-logs th:first-child,
.table-activity-logs td:first-child {
    width: 68px;
}

.table-student-quran th:first-child,
.table-student-quran td:first-child {
    width: 46%;
    white-space: nowrap;
}

.compact-table th {
    width: 42%;
}

th,
td {
    padding: 14px;
    text-align: right;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--navy);
    background: var(--table-head);
    font-weight: 900;
}

tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 800;
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
    color: var(--blue);
}

.badge.success {
    color: var(--success);
    background: rgba(15, 148, 109, .12);
}

.badge.danger {
    color: var(--danger);
    background: rgba(217, 71, 99, .12);
}

.badge.warning {
    color: var(--warning);
    background: rgba(199, 123, 22, .13);
}

.logs-title {
    padding-bottom: 4px;
}

.logs-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 12px 0 22px;
}

.logs-stats .stat-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 10px;
    min-height: 138px;
}

.logs-stats .stat-card::after {
    content: "";
    position: absolute;
    inset: auto -28px -36px auto;
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background: rgba(219, 175, 160, .13);
}

.stat-icon,
.log-mark svg {
    display: inline-grid;
    place-items: center;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--blue);
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.stat-icon svg,
.log-mark svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-icon.success,
.log-mark.success {
    color: var(--success);
    background: rgba(15, 148, 109, .12);
}

.stat-icon.danger,
.log-mark.danger {
    color: var(--danger);
    background: rgba(217, 71, 99, .12);
}

.stat-icon.warning,
.log-mark.warning {
    color: var(--warning);
    background: rgba(199, 123, 22, .13);
}

.logs-panel + .logs-panel {
    margin-top: 22px;
}

.panel-heading,
.logs-filter-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.logs-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(320px, 100%);
    padding: 8px;
    border-radius: 16px;
    background: var(--soft-bg);
}

.logs-filter label {
    white-space: nowrap;
}

.log-mark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--blue);
    font-weight: 900;
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.table-auth-logs td strong,
.table-auth-logs td small,
.table-activity-logs td strong,
.table-activity-logs td small {
    display: block;
}

.table-auth-logs td small,
.table-activity-logs td small {
    margin-top: 2px;
    color: var(--muted);
    font-weight: 700;
}

.log-reversal-state {
    display: block;
    width: fit-content;
    margin-top: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--warning);
    background: rgba(199, 123, 22, .12);
}

.table-activity-logs tr.is-reversed-log {
    background: color-mix(in srgb, var(--warning) 8%, transparent);
}

.presence-launch-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 24px;
}

.presence-launch-button {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: min(820px, 100%);
    min-height: 92px;
    padding: 16px 20px;
    border: 1px solid rgba(219, 175, 160, .42);
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(circle at 14% 24%, rgba(219, 175, 160, .34), transparent 18rem),
        linear-gradient(135deg, #261323, #49243E 54%, #BB8493);
    box-shadow: 0 28px 74px rgba(73, 36, 62, .2);
}

.presence-launch-button::before,
.presence-launch-button::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.presence-launch-button::before {
    inset: 0;
    background: linear-gradient(100deg, transparent 0 28%, rgba(255, 255, 255, .24) 45%, transparent 62% 100%);
    transform: translateX(115%);
}

.presence-launch-button::after {
    inset: auto -44px -56px auto;
    width: 170px;
    aspect-ratio: 1;
    border: 28px solid rgba(255, 255, 255, .13);
    border-radius: 999px;
}

.presence-launch-icon,
.presence-hero-icon,
.presence-stat-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.presence-launch-icon {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    color: #49243E;
    background: linear-gradient(135deg, #fff, #DBAFA0);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .2);
}

.presence-launch-icon svg,
.presence-launch-arrow svg,
.presence-hero-icon svg,
.presence-stat-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.presence-launch-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
    text-align: start;
}

.presence-launch-copy strong {
    font-size: clamp(1.1rem, 2.4vw, 1.65rem);
    line-height: 1.35;
}

.presence-launch-copy small {
    color: rgba(255, 255, 255, .78);
    font-weight: 800;
}

.presence-launch-arrow {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .13);
}

.presence-command {
    display: grid;
    gap: 18px;
}

.presence-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    color: #fff;
    border-color: rgba(219, 175, 160, .26);
    background:
        radial-gradient(circle at 12% 20%, rgba(219, 175, 160, .28), transparent 20rem),
        linear-gradient(135deg, rgba(38, 19, 35, .98), rgba(112, 66, 100, .82) 58%, rgba(187, 132, 147, .68));
}

.presence-hero::after {
    content: "";
    position: absolute;
    inset: auto -70px -88px auto;
    width: 230px;
    aspect-ratio: 1;
    border: 36px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
}

.presence-hero-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.presence-hero-icon {
    width: 76px;
    height: 76px;
    border-radius: 26px;
    color: #49243E;
    background: linear-gradient(135deg, #fff, #BB8493);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .22);
}

.presence-hero h2 {
    margin: 8px 0 6px;
    color: #fff;
    font-size: clamp(1.65rem, 3vw, 3rem);
}

.presence-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .78);
}

.presence-live-badge {
    gap: 7px;
    color: #6fffd8;
    background: rgba(15, 148, 109, .22);
}

.presence-live-badge i {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 7px rgba(111, 255, 216, .12);
}

.presence-updated {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
    min-width: 150px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    text-align: center;
    background: rgba(255, 255, 255, .1);
}

.presence-updated span {
    color: rgba(255, 255, 255, .72);
    font-weight: 800;
}

.presence-updated strong {
    direction: ltr;
    color: #fff;
    font-size: 1.45rem;
}

.presence-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.presence-stat-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 9px;
    min-height: 128px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 18px 44px rgba(101, 18, 38, .08);
}

.presence-stat-card::after {
    content: "";
    position: absolute;
    inset: auto -28px -34px auto;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: rgba(219, 175, 160, .12);
}

.presence-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--blue);
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.presence-stat-icon.online {
    color: var(--success);
    background: rgba(15, 148, 109, .12);
}

.presence-stat-icon.student {
    color: var(--cyan);
    background: rgba(219, 175, 160, .12);
}

.presence-stat-icon.admin {
    color: var(--warning);
    background: rgba(199, 123, 22, .13);
}

.presence-stat-card > span:not(.presence-stat-icon) {
    color: var(--muted);
    font-weight: 800;
}

.presence-stat-card strong {
    position: relative;
    z-index: 1;
    color: var(--navy);
    font-size: 2rem;
    line-height: 1;
}

.presence-filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--soft-bg);
}

.presence-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    color: var(--navy);
    font-weight: 900;
    background: var(--surface);
}

.presence-filter-pill b {
    min-width: 34px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--blue);
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.presence-filter-pill.is-active {
    color: #fff;
    border-color: rgba(219, 175, 160, .34);
    background: var(--brand-gradient);
    box-shadow: 0 18px 38px rgba(73, 36, 62, .2);
}

.presence-filter-pill.is-active b {
    color: #49243E;
    background: rgba(255, 255, 255, .82);
}

.presence-table-panel {
    overflow: hidden;
}

.presence-mobile-list {
    display: none;
}

.presence-table-panel .table-wrap {
    overflow-x: auto;
}

.table-presence {
    table-layout: fixed;
}

.table-presence th,
.table-presence td {
    padding: 13px 10px;
    vertical-align: middle;
}

.table-presence th:first-child,
.table-presence td:first-child {
    width: 24%;
}

.table-presence th:nth-child(2),
.table-presence td:nth-child(2),
.table-presence th:nth-child(3),
.table-presence td:nth-child(3),
.table-presence th:nth-child(4),
.table-presence td:nth-child(4) {
    width: 12%;
}

.presence-person {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
}

.presence-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 15px;
    object-fit: cover;
    color: #fff;
    font-weight: 900;
    background: var(--brand-gradient);
}

.presence-avatar-fallback {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.presence-person strong,
.presence-person small,
.table-presence td:nth-child(4) strong,
.table-presence td:nth-child(4) small {
    display: block;
}

.presence-person strong,
.presence-person small {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presence-person small,
.table-presence td:nth-child(4) small {
    margin-top: 2px;
    color: var(--muted);
    font-weight: 800;
}

.presence-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    white-space: nowrap;
}

.presence-state > span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
}

.presence-state.is-online {
    color: var(--success);
    background: rgba(15, 148, 109, .12);
}

.presence-state.is-online > span {
    box-shadow: 0 0 0 7px rgba(15, 148, 109, .12);
}

.presence-state.is-offline {
    color: var(--muted);
    background: var(--soft-bg);
}

.presence-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 34px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--blue);
    font-weight: 900;
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.presence-count.success {
    color: var(--success);
    background: rgba(15, 148, 109, .12);
}

.presence-count.danger {
    color: var(--danger);
    background: rgba(217, 71, 99, .12);
}

.presence-count.warning {
    color: var(--warning);
    background: rgba(199, 123, 22, .13);
}

.table-presence tr.is-online {
    background: color-mix(in srgb, var(--success) 8%, transparent);
}

.presence-command.is-refreshing .presence-table-panel {
    box-shadow: 0 0 0 1px rgba(219, 175, 160, .2), 0 24px 70px rgba(101, 18, 38, .12);
}

@media (prefers-reduced-motion: no-preference) {
    .presence-launch-button::before {
        animation: presence-shine 3.8s ease-in-out infinite;
    }

    .presence-launch-button,
    .presence-hero,
    .presence-stat-card,
    .presence-filter-pill,
    .table-presence tr {
        transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
    }

    .presence-launch-button:hover,
    .presence-stat-card:hover,
    .presence-filter-pill:hover {
        transform: translateY(-2px);
        box-shadow: 0 26px 58px rgba(101, 18, 38, .16);
    }

    .presence-live-badge i,
    .presence-state.is-online > span {
        animation: presence-pulse 1.7s ease-in-out infinite;
    }

    .presence-hero,
    .presence-stats-grid,
    .presence-filter-bar,
    .presence-table-panel {
        animation: himma-rise .34s ease both;
    }

    .presence-stats-grid {
        animation-delay: .04s;
    }

    .presence-filter-bar {
        animation-delay: .08s;
    }

    .presence-table-panel {
        animation-delay: .12s;
    }
}

@keyframes presence-shine {
    0%, 48% {
        transform: translateX(115%);
    }
    72%, 100% {
        transform: translateX(-115%);
    }
}

@keyframes presence-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.22);
        opacity: .66;
    }
}

@media (max-width: 980px) {
    .presence-hero,
    .presence-hero-main,
    .presence-launch-button {
        align-items: flex-start;
        flex-direction: column;
    }

    .presence-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .presence-updated,
    .presence-launch-button {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .presence-launch-button {
        min-height: 0;
        padding: 15px;
        border-radius: 22px;
    }

    .presence-launch-icon,
    .presence-hero-icon {
        width: 58px;
        height: 58px;
        border-radius: 19px;
    }

    .presence-launch-arrow {
        align-self: flex-end;
    }

    .presence-stats-grid,
    .presence-filter-bar {
        grid-template-columns: 1fr;
    }

    .presence-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .presence-table-panel .table-wrap {
        overflow-x: visible;
    }

    .table-presence td:nth-child(1)::before { content: "الحساب"; }
    .table-presence td:nth-child(2)::before { content: "النوع"; }
    .table-presence td:nth-child(3)::before { content: "الحالة"; }
    .table-presence td:nth-child(4)::before { content: "آخر ظهور"; }
    .table-presence td:nth-child(5)::before { content: "دخول ناجح"; }
    .table-presence td:nth-child(6)::before { content: "دخول فاشل"; }
    .table-presence td:nth-child(7)::before { content: "خروج"; }
    .table-presence td:nth-child(8)::before { content: "تعديلات"; }

    .table-presence td:first-child {
        grid-template-columns: 1fr;
    }

    .table-presence td:first-child::before {
        display: none;
    }

    .presence-person {
        justify-self: stretch;
        width: 100%;
    }
}

.device-details {
    line-height: 1.5;
}

code {
    direction: ltr;
    display: inline-block;
    padding: 4px 7px;
    border-radius: 8px;
    color: var(--navy);
    background: var(--soft-bg);
}

.plain-name {
    display: inline;
    color: var(--ink);
    font-weight: 700;
}

.plain-name + .plain-name::before {
    content: "، ";
    color: var(--muted);
}

.alert {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
}

.alert-success {
    color: var(--success);
    background: rgba(15, 148, 109, .12);
}

.alert-danger {
    color: var(--danger);
    background: rgba(217, 71, 99, .12);
}

.alert-info {
    color: var(--navy-2);
    background: rgba(219, 175, 160, .14);
}

.notification-center {
    position: relative;
    z-index: 40;
}

.notification-trigger {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
    border-radius: 16px;
    color: #4b1025;
    background: linear-gradient(135deg, #fff2b3, #d9a532);
    box-shadow: 0 16px 34px rgba(217, 165, 50, .28);
    cursor: pointer;
}

.notification-trigger svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-trigger b {
    position: absolute;
    inset-block-start: -7px;
    inset-inline-end: -7px;
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 2px solid var(--surface);
    border-radius: 999px;
    color: #fff;
    background: var(--danger);
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
}

.notification-popover {
    position: absolute;
    inset-block-start: calc(100% + 12px);
    inset-inline-end: 0;
    width: min(360px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 26px 70px rgba(0, 0, 0, .22);
    backdrop-filter: blur(18px);
}

.notification-popover[hidden] {
    display: none;
}

.notification-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 4px 10px;
}

.notification-popover-head strong {
    color: var(--navy);
}

.notification-popover-head a {
    color: var(--brand);
    font-weight: 900;
}

.notification-popover-list,
.notification-history-list,
.notification-inbox-list {
    display: grid;
    gap: 12px;
}

.notification-mini-card,
.notification-history-card,
.notification-inbox-card {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-bg);
}

.notification-mini-card {
    cursor: pointer;
}

.notification-mini-card.is-unread,
.notification-inbox-card.is-unread {
    border-color: color-mix(in srgb, var(--gold) 52%, var(--line));
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--gold) 80%, var(--brand));
}

.notification-mini-card strong,
.notification-history-card strong,
.notification-inbox-card strong {
    color: var(--navy);
}

.notification-mini-card span,
.notification-history-card p,
.notification-inbox-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.notification-mini-card small,
.notification-history-card small,
.notification-inbox-card small {
    color: var(--muted);
    font-weight: 800;
}

.push-permission-prompt {
    position: fixed;
    inset-inline: auto 22px;
    inset-block-end: 22px;
    z-index: 120;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: min(560px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
    border-radius: 22px;
    background:
        radial-gradient(circle at 8% 0, color-mix(in srgb, var(--gold) 22%, transparent), transparent 14rem),
        color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 28px 78px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(18px) scale(.98);
    transition: opacity .24s ease, transform .24s ease;
}

.push-permission-prompt.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.push-permission-prompt strong,
.push-permission-prompt span {
    display: block;
}

.push-permission-prompt strong {
    color: var(--navy);
}

.push-permission-prompt span {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.6;
}

.notification-page-title {
    position: relative;
}

.notification-page-title::after {
    content: "";
    position: absolute;
    inset-inline-end: 4%;
    inset-block-start: 10%;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 20%, transparent);
    filter: blur(2px);
    opacity: .45;
    pointer-events: none;
}

.notification-studio {
    margin-top: 34px;
}

.notification-composer {
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
    gap: 22px;
    align-items: start;
}

.notification-message-panel,
.notification-audience-panel,
.notification-history-panel {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at 10% 0, color-mix(in srgb, var(--gold) 13%, transparent), transparent 18rem),
        var(--surface);
    box-shadow: var(--shadow);
}

.notification-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.notification-panel-head h2 {
    margin: 0;
    color: var(--navy);
}

.notification-spark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    color: #4b1025;
    background: linear-gradient(135deg, #fff1af, #d69f27);
    box-shadow: 0 16px 34px rgba(217, 165, 50, .22);
}

.notification-spark.is-soft {
    color: var(--brand);
    background: color-mix(in srgb, var(--gold) 16%, var(--surface));
    box-shadow: none;
}

.notification-spark svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-phone-preview {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--gold) 32%, var(--line));
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.notification-phone-dot {
    width: 10px;
    height: 10px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--gold) 16%, transparent);
}

.notification-phone-preview small,
.notification-phone-preview p {
    color: var(--muted);
}

.notification-phone-preview strong {
    display: block;
    color: var(--navy);
    font-size: 1.05rem;
}

.notification-phone-preview p {
    margin: 5px 0 0;
    line-height: 1.7;
}

.audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.audience-card {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 112px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card-bg);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.audience-card:hover {
    transform: translateY(-2px);
}

.audience-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.audience-card:has(input:checked) {
    border-color: color-mix(in srgb, var(--gold) 62%, var(--line));
    box-shadow: 0 18px 42px rgba(217, 165, 50, .16);
}

.audience-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    color: var(--brand);
    background: color-mix(in srgb, var(--gold) 15%, var(--surface));
}

.audience-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.audience-card b,
.audience-card small {
    display: block;
}

.audience-card b {
    color: var(--navy);
}

.audience-card small {
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.55;
}

.audience-extra {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed color-mix(in srgb, var(--gold) 40%, var(--line));
    border-radius: 20px;
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.audience-extra[hidden] {
    display: none;
}

.selected-users-panel input[type="search"] {
    width: 100%;
}

.user-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow: auto;
    padding-inline-end: 4px;
}

.user-pick-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.user-pick-card b,
.user-pick-card small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pick-card small {
    color: var(--muted);
}

.notification-submit-panel {
    margin-top: 16px;
}

.notification-submit-panel .btn {
    width: 100%;
    justify-content: center;
    min-height: 54px;
}

.notification-history-card,
.notification-inbox-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
}

.gallery-approval-panel {
    border-color: rgba(219, 175, 160, .28);
    background:
        radial-gradient(circle at 8% 0, rgba(219, 175, 160, .12), transparent 22rem),
        var(--surface);
}

.approval-split {
    display: grid;
    gap: 24px;
}

.approval-album-grid {
    align-items: stretch;
}

.approval-album-card {
    border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
}

.approval-album-card .album-body {
    display: grid;
    gap: 10px;
}

.approval-album-card h3,
.album-body h3,
.album-body .meta {
    min-width: 0;
    overflow-wrap: anywhere;
}

.approval-album-card .album-body > .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.approval-album-card .album-body > .row-actions > .btn {
    grid-column: 1 / -1;
}

.approval-album-card .album-body > .row-actions form .btn,
.approval-album-card .album-body > .row-actions > .btn {
    width: 100%;
}

.approval-card-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
}

.approval-action-form {
    display: grid;
    min-width: 0;
}

.approval-wide-action {
    width: 100%;
    justify-content: center;
}

.gallery-hero-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    align-items: stretch;
    width: min(720px, 100%);
}

.gallery-hero-actions > form,
.gallery-hero-actions > .btn,
.gallery-hero-actions > form > .btn {
    display: inline-flex;
    width: 100%;
    min-width: 0;
}

.gallery-hero-actions .btn {
    justify-content: center;
    min-height: 52px;
    white-space: normal;
}

.gallery-rejected-panel {
    border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
    background:
        radial-gradient(circle at 92% 0, color-mix(in srgb, var(--danger) 10%, transparent), transparent 18rem),
        var(--surface);
}

.gallery-rejected-panel .compact-section-head {
    margin-top: 18px;
}

.gallery-rejected-panel .compact-section-head:first-of-type {
    margin-top: 0;
}

.rejected-gallery-grid + .compact-section-head {
    margin-top: 26px;
}

.rejected-gallery-card {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.rejected-gallery-card .album-body {
    display: grid;
    gap: 10px;
}

.rejected-media-cover video,
.rejected-media-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-pending-pill {
    position: absolute;
    inset-inline: 12px auto;
    bottom: 12px;
    z-index: 2;
    padding: 7px 10px;
    border-radius: 999px;
    color: #fff;
    background: color-mix(in srgb, var(--warning) 86%, #4b1025);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    font-size: .8rem;
    font-weight: 900;
}

.compact-section-head {
    margin-bottom: 14px;
}

.compact-section-head h3 {
    margin: 0;
    color: var(--navy);
    font-size: 1.05rem;
}

.media-approval-body {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.media-approval-body strong {
    color: var(--navy);
}

.media-approval-body small {
    color: var(--muted);
}

.auth-wrap {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 150px);
}

.auth-card {
    width: min(460px, 100%);
}

.drop-zone {
    display: grid;
    place-items: center;
    gap: 16px;
    min-height: 170px;
    padding: 22px;
    border: 2px dashed rgba(187, 132, 147, .34);
    border-radius: 22px;
    background: var(--soft-bg);
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.drop-zone.has-preview {
    min-height: 224px;
    align-content: center;
    border-color: color-mix(in srgb, var(--cyan) 55%, var(--line));
    background:
        radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--cyan-2) 20%, transparent), transparent 15rem),
        var(--soft-bg);
}

.drop-zone.is-dragging {
    border-color: var(--cyan);
    background: rgba(219, 175, 160, .18);
    transform: translateY(-1px);
}

.drop-zone input {
    display: none;
}

.drop-zone > span {
    display: grid;
    gap: 6px;
}

.drop-zone-previews {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    padding: 4px 4px 12px;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
    scrollbar-color: color-mix(in srgb, var(--cyan) 72%, var(--brand)) color-mix(in srgb, var(--surface) 78%, transparent);
    scrollbar-width: thin;
}

.drop-zone-previews::-webkit-scrollbar {
    height: 8px;
}

.drop-zone-previews::-webkit-scrollbar-track {
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.drop-zone-previews::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--cyan));
}

.drop-zone-previews[hidden] {
    display: none;
}

.drop-zone-preview {
    position: relative;
    display: grid;
    grid-template-rows: 84px auto auto;
    gap: 6px;
    flex: 0 0 104px;
    width: 104px;
    min-width: 104px;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--cyan) 26%, var(--line));
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
    animation: uploadPreviewIn .34s cubic-bezier(.2, .9, .2, 1.1) both;
    animation-delay: calc(var(--preview-index, 0) * 40ms);
}

.drop-zone-preview img,
.drop-zone-video-thumb,
.drop-zone-file-thumb {
    display: grid;
    place-items: center;
    width: 100%;
    height: 84px;
    border-radius: 12px;
    object-fit: cover;
    overflow: hidden;
    background: var(--brand-gradient);
}

.drop-zone-remove {
    position: absolute;
    inset-block-start: 3px;
    inset-inline-start: 3px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--surface) 72%, transparent);
    border-radius: 999px;
    color: #fff;
    background: color-mix(in srgb, var(--danger) 88%, #2a0612);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .24);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-2px) scale(.92);
    opacity: .92;
    transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}

.drop-zone-remove:hover,
.drop-zone-remove:focus-visible {
    opacity: 1;
    transform: translateY(-3px) scale(1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .3);
}

.drop-zone-video-thumb,
.drop-zone-file-thumb {
    color: var(--on-brand);
    background-size: cover;
    background-position: center;
}

.drop-zone-video-thumb svg,
.drop-zone-file-thumb svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .28));
}

.drop-zone-preview b,
.drop-zone-preview small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drop-zone-preview b {
    color: var(--navy);
    font-size: .82rem;
}

.drop-zone-preview small {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
}

@keyframes uploadPreviewIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.upload-progress {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 9px;
    margin-top: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 62%, transparent);
}

.upload-progress span {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 38%;
    border-radius: inherit;
    background: var(--primary-gradient);
    animation: uploadProgress 1.1s ease-in-out infinite;
}

.upload-progress[hidden] {
    display: none;
}

@keyframes uploadProgress {
    0% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(285%);
    }
}

.attendance-options {
    direction: rtl;
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 8px;
}

.attendance-options label {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    gap: 6px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--soft-bg);
    overflow-wrap: normal;
    white-space: nowrap;
}

.attendance-options input {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
}

.attendance-options input[value="present"] {
    accent-color: var(--success);
}

.attendance-options input[value="late"] {
    accent-color: var(--warning);
}

.attendance-options input[value="absent"] {
    accent-color: var(--danger);
}

.attendance-save-actions {
    margin-top: 16px;
}

.archive-day {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card-bg);
}

.archive-day + .archive-day {
    margin-top: 12px;
}

.archive-day-head,
.archive-chips,
.quran-page-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.archive-chips {
    justify-content: flex-start;
    margin-top: 12px;
}

.quran-pages-grid {
    display: grid;
    gap: 10px;
}

.assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.assignment-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-bg);
}

.assignment-card strong {
    color: var(--navy);
}

.quran-page-card {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-bg);
}

.student-ledger-wrap {
    overflow-x: visible;
}

.table-student-points th,
.table-student-points td,
.table-student-donations th,
.table-student-donations td {
    padding: 9px 12px;
}

.table-student-points .badge {
    min-height: 24px;
    padding: 3px 9px;
}

.quran-page-card strong,
.quran-page-card span {
    display: block;
}

.series-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.series-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-bg);
}

.checkbox-field {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    gap: 8px;
}

.checkbox-field input {
    width: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.profile-id {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-personal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 18px;
    align-items: stretch;
}

.profile-self-card,
.account-command-card,
.account-studio,
.account-card {
    position: relative;
    overflow: hidden;
}

.profile-card-head,
.account-card-top,
.account-directory-head,
.permission-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.profile-card-head {
    margin-bottom: 18px;
}

.profile-id small,
.account-card small {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.profile-id strong {
    display: block;
    color: var(--navy);
    font-size: 1.08rem;
}

.account-command-card {
    display: grid;
    align-content: center;
    gap: 14px;
    min-height: 100%;
    color: #fff7f4;
    background:
        radial-gradient(circle at 20% 18%, rgba(219, 175, 160, .28), transparent 18rem),
        var(--hero-gradient);
}

.account-command-card .eyebrow {
    width: fit-content;
    color: #fff7f4;
    background: rgba(255, 255, 255, .12);
}

.account-command-card h2,
.account-command-card p {
    margin: 0;
}

.account-command-card p {
    color: rgba(255, 247, 244, .74);
    line-height: 1.9;
}

.account-command-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.account-command-metrics span {
    display: grid;
    gap: 4px;
    min-height: 74px;
    padding: 12px;
    border-radius: 16px;
    color: rgba(255, 247, 244, .78);
    background: rgba(255, 255, 255, .1);
}

.account-command-metrics b {
    color: #fff7f4;
    font-size: 1.45rem;
}

.account-studio > form {
    display: grid;
    gap: 18px;
}

.account-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.account-type-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink);
    background: var(--card-bg);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.account-type-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--cyan) 46%, var(--line));
}

.account-type-card:has(input:checked) {
    color: #fff7f4;
    border-color: transparent;
    background: var(--primary-gradient);
    box-shadow: 0 18px 44px rgba(73, 36, 62, .24);
}

.account-type-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.account-type-card b,
.account-type-card small {
    display: block;
}

.account-type-card small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.55;
}

.account-type-card:has(input:checked) small {
    color: rgba(255, 247, 244, .76);
}

.account-type-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    color: var(--blue);
    background: var(--soft-bg);
}

.account-type-card:has(input:checked) .account-type-icon {
    color: #49243E;
    background: rgba(255, 247, 244, .86);
}

.account-type-icon svg,
.account-card svg,
.about-hero-actions svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-editor-grid {
    display: grid;
    grid-template-columns: minmax(300px, .62fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.account-main-fields,
.permission-board,
.account-card,
.account-empty-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--card-bg) 90%, var(--soft-bg));
}

.account-main-fields,
.permission-board,
.account-card {
    padding: 16px;
}

.account-auto-note {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 16px;
    color: var(--navy);
    background: var(--soft-bg);
}

.account-auto-note span {
    color: var(--muted);
    line-height: 1.7;
}

.permission-board-head {
    margin-bottom: 14px;
}

.permission-board-head h3,
.permission-board-head p,
.account-directory-head h3 {
    margin: 0;
}

.permission-board-head p {
    color: var(--muted);
    line-height: 1.7;
}

.permission-table {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
}

.permission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, .34fr);
    gap: 12px;
    align-items: center;
    padding: 13px;
    background: var(--table-bg);
}

.permission-row + .permission-row {
    border-top: 1px solid var(--line);
}

.permission-row strong,
.visitor-permission-card strong {
    display: block;
    color: var(--navy);
}

.permission-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.55;
}

.visitor-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.visitor-permission-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--table-bg);
}

.segmented-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border-radius: 14px;
    background: var(--soft-bg);
}

.segmented-choice label {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 38px;
    border-radius: 11px;
    cursor: pointer;
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
}

.segmented-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-choice label:has(input:checked) {
    color: var(--on-primary);
    background: var(--primary-gradient);
}

.accounts-directory {
    display: grid;
    gap: 18px;
}

.account-directory-group {
    display: grid;
    gap: 12px;
}

.account-directory-head {
    padding-inline: 4px;
}

.account-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.account-card {
    display: grid;
    gap: 14px;
    box-shadow: var(--shadow);
}

.account-card::after {
    content: "";
    position: absolute;
    inset: auto -34px -40px auto;
    width: 120px;
    aspect-ratio: 1;
    border-radius: 999px;
    background: rgba(187, 132, 147, .12);
    pointer-events: none;
}

.account-card > * {
    position: relative;
    z-index: 1;
}

.credential-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.credential-grid span {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border-radius: 14px;
    background: var(--soft-bg);
}

.credential-grid b {
    min-width: 0;
    color: var(--navy);
    overflow-wrap: anywhere;
}

.account-permission-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.account-permission-chips span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--blue);
    font-size: .86rem;
    font-weight: 900;
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.account-card .row-actions {
    justify-content: space-between;
    align-items: center;
}

.account-empty-card {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: var(--muted);
    font-weight: 900;
    box-shadow: none;
}

.media-actions {
    position: absolute;
    inset-inline: 10px;
    bottom: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    backdrop-filter: blur(10px);
}

.restore-media-form {
    flex: 1 1 100%;
    width: 100%;
}

.restore-media-button {
    width: 100%;
    justify-content: center;
    min-height: 42px;
}

.media-lightbox[hidden],
.lesson-modal[hidden] {
    display: none;
}

.media-lightbox,
.lesson-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(4, 18, 39, .86);
    backdrop-filter: blur(12px);
}

.media-lightbox {
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.lesson-modal-card {
    position: relative;
    width: min(760px, calc(100vw - 38px));
    max-height: min(78vh, 680px);
    overflow: auto;
    padding: 28px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

.lesson-modal-card .lesson-meta-row {
    padding-inline-end: 96px;
    margin-bottom: 18px;
}

.lesson-modal-card h2 {
    margin: 0 0 14px;
    color: var(--navy);
}

.lesson-modal-card p {
    margin: 0;
    color: var(--ink);
    line-height: 2;
    white-space: pre-line;
}

.lesson-modal-close {
    color: var(--navy);
    background: var(--soft-bg);
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-stage {
    display: grid;
    place-items: center;
    width: min(1040px, calc(100vw - 110px));
    height: min(76vh, 720px);
    min-height: 220px;
    margin: auto;
}

.lightbox-stage img,
.lightbox-stage video,
.lightbox-stage iframe {
    max-width: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 22px;
    background: #000;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

.lightbox-stage img {
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-stage video {
    width: min(100%, 980px);
}

.lightbox-stage iframe {
    width: min(100%, 980px);
    height: min(100%, 552px);
}

.lightbox-thumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: min(720px, calc(100vw - 42px));
    max-width: 100%;
    padding: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 22px;
    background: rgba(3, 13, 29, .72);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.lightbox-thumbs[hidden] {
    display: none;
}

.lightbox-thumb {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    opacity: .74;
    transition: border-color .18s ease, opacity .18s ease, transform .18s ease;
}

.lightbox-thumb img,
.lightbox-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-thumb span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 1.15rem;
    font-weight: 900;
    background: var(--placeholder-gradient);
}

.lightbox-thumb.is-active {
    border-color: var(--cyan);
    opacity: 1;
    transform: translateY(-2px);
}

.lightbox-close,
.lightbox-arrow {
    position: absolute;
    border: 0;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(10px);
}

.lightbox-close {
    top: 20px;
    inset-inline-end: 20px;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 900;
}

.lightbox-arrow {
    top: 50%;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    font-size: 2.4rem;
    line-height: 1;
    transform: translateY(-50%);
}

.lightbox-next {
    inset-inline-end: 20px;
}

.lightbox-prev {
    inset-inline-start: 20px;
}

.lesson-modal-card .lesson-modal-close {
    color: var(--navy);
    background: var(--soft-bg);
}

.pagination {
    margin-top: 18px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pager-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--navy);
    font-weight: 900;
    background: var(--soft-bg);
}

.pager-link.is-active {
    color: var(--on-primary);
    background: var(--primary-gradient);
    box-shadow: 0 12px 26px rgba(112, 66, 100, .22);
}

.pager-link.is-disabled {
    color: var(--muted);
    opacity: .52;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 48px 0 0;
    padding: 22px;
    color: #fff7f4;
    background: var(--footer-gradient);
    border-radius: 22px 22px 0 0;
}

.site-footer span {
    color: rgba(232, 248, 255, .82);
}

@media (max-width: 900px) {
    .notification-composer,
    .audience-grid {
        grid-template-columns: 1fr;
    }

    .notification-history-card,
    .notification-inbox-card {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .notification-inbox-card form {
        grid-column: 1 / -1;
    }

    .push-permission-prompt {
        inset-inline: 16px;
        inset-block-end: 82px;
        grid-template-columns: 1fr;
    }

    .notification-popover {
        position: fixed;
        inset-inline: 16px;
        inset-block: 84px auto;
        width: auto;
    }

    .site-header,
    .hero,
    .section-head,
    .profile-head {
        display: block;
    }

    .main-nav,
    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-top: 12px;
    }

    .hero {
        min-height: auto;
    }

    .hero-visual {
        min-height: 360px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .rank-metrics-grid,
    .form-grid,
    .about-hero,
    .about-story,
    .about-feature-band,
    .profile-personal-grid,
    .account-editor-grid,
    .account-card-grid {
        grid-template-columns: 1fr;
    }

    .about-visual {
        min-height: 420px;
    }

    .account-type-grid,
    .about-stat-strip {
        grid-template-columns: 1fr;
    }

    .visitor-permission-grid,
    .credential-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 721px) and (max-width: 1040px) {
    .page-shell {
        width: min(100% - 36px, 1180px);
        padding-top: 154px;
    }

    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand actions"
            "nav nav";
        align-items: center;
        row-gap: 10px;
        width: min(1180px, calc(100% - 36px));
        padding: 10px 12px 12px;
    }

    .site-header > .brand {
        grid-area: brand;
        min-width: 0;
    }

    .site-header > .brand > span:not(.brand-mark) {
        min-width: 0;
    }

    .site-header > .brand strong,
    .site-header > .brand small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .main-nav {
        grid-area: nav;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        margin-top: 0;
    }

    .main-nav a {
        padding: 8px 10px;
        font-size: .94rem;
    }

    .header-actions {
        grid-area: actions;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 7px;
        min-width: 0;
        margin-top: 0;
    }

    .header-actions .theme-toggle,
    .header-actions .logout-button {
        min-height: 38px;
        padding: 8px 10px;
    }

    .header-actions .user-chip {
        max-width: 176px;
        min-width: 0;
    }

    .header-actions .user-chip > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-actions .logout-label {
        display: none;
    }
}

@media (max-width: 560px) {
    .page-shell {
        width: min(100% - 30px, 1180px);
    }

    .hero h1,
    .page-title h1 {
        font-size: 1.9rem;
    }

    .attendance-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .attendance-options label {
        padding-inline: 8px;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 32px, 1180px);
        padding-top: 82px;
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    main > .section:last-of-type {
        margin-bottom: 22px;
    }

    .hero {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .hero-copy {
        padding: 0;
        display: contents;
    }

    .hero-copy > .hero-feature-grid {
        order: 4;
        margin-top: 0;
    }

    .hero p,
    .page-title p {
        font-size: 1rem;
    }

    .hero-feature-grid {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 18px;
    }

    .hero-feature-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        column-gap: 12px;
        padding: 12px;
    }

    .hero-feature-card small {
        grid-column: 2;
    }

    .about-hero {
        min-height: auto;
        padding-top: 8px;
    }

    .about-hero-copy h1 {
        font-size: 2.45rem;
    }

    .about-hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .about-visual {
        min-height: 360px;
        border-radius: 24px;
    }

    .about-visual-card {
        width: calc(100% - 34px);
        padding: 13px;
    }

    .about-visual-card-main {
        inset: 16px 16px auto auto;
    }

    .about-visual-card-side {
        inset: auto auto 16px 16px;
    }

    .about-stat-card,
    .about-feature-band article,
    .about-story-grid article {
        border-radius: 18px;
    }

    .about-story-grid article {
        grid-template-columns: 1fr;
    }

    .about-story-grid article span {
        grid-row: auto;
        width: 46px;
        height: 46px;
    }

    .account-command-metrics,
    .visitor-permission-grid,
    .credential-grid {
        grid-template-columns: 1fr;
    }

    .account-type-card {
        min-height: 96px;
    }

    .permission-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
        border-radius: 0;
    }

    .permission-row select {
        min-height: 44px;
    }

    .permission-board-head,
    .profile-card-head,
    .account-card-top,
    .account-directory-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-card .row-actions {
        align-items: stretch;
    }

    .mobile-hero-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mobile-hero-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        padding: 9px 10px;
        border-radius: 14px;
        color: var(--navy);
        font-weight: 900;
        background: var(--surface);
        border: 1px solid var(--surface-border);
        box-shadow: 0 10px 24px rgba(101, 18, 38, .08);
    }

    .mobile-hero-links svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .hero-visual {
        display: grid;
        gap: 10px;
        min-height: 0;
        overflow: visible;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .hero-slider-frame {
        position: relative;
        inset: auto;
        aspect-ratio: 16 / 9;
        min-height: 0;
        border-radius: 22px;
        background: var(--hero-gradient);
        box-shadow: 0 22px 48px rgba(73, 36, 62, .18);
    }

    .hero-glass {
        position: static;
        inset: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-stat {
        color: var(--ink);
        background: var(--surface);
        border-color: var(--surface-border);
        box-shadow: 0 10px 24px rgba(101, 18, 38, .08);
    }

    .hero-stat strong {
        color: var(--navy);
    }

    .quran-exam-studio {
        order: 1;
    }

    .quran-exam-archive {
        order: 2;
    }

    .quran-exam-overview {
        order: 3;
    }

    .quran-exam-type-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .quran-exam-type-option {
        min-height: 68px;
        padding: 12px 14px;
    }

    .quran-exam-type-copy {
        min-width: 0;
    }

    .quran-exam-type-copy strong {
        line-height: 1.35;
        white-space: normal;
    }

    .quran-exam-type-copy small {
        white-space: nowrap;
    }

    .weekly-stars {
        grid-template-columns: 1fr;
        direction: rtl;
        gap: 16px;
    }

    .star-rank-1,
    .star-rank-2,
    .star-rank-3 {
        grid-column: auto;
        transform: none;
    }

    .star-rank-1 {
        order: 1;
    }

    .star-rank-2 {
        order: 2;
    }

    .star-rank-3 {
        order: 3;
    }

    .star-card {
        width: 100%;
        padding: 18px;
        border-radius: 20px;
    }

    .rank-badge {
        margin-bottom: 12px;
        padding: 7px 12px;
        font-size: .92rem;
    }

    .star-avatar,
    .star-rank-1 .star-avatar,
    .star-rank-3 .star-avatar {
        width: 112px;
        height: 112px;
        margin-bottom: 12px;
        border-radius: 28px;
    }

    .star-card h3 {
        font-size: 1.15rem;
    }

    .star-card .meta {
        font-size: .92rem;
    }

    .latest-lessons-grid {
        grid-template-columns: 1fr;
    }

    .home-lessons-section {
        margin-top: 26px;
    }

    .section {
        margin: 58px 0;
    }

    .home-section-title {
        padding-inline: 0;
    }

    .home-section-title--with-action .btn {
        position: static;
        transform: none;
    }

    .lesson-modal-card {
        width: calc(100vw - 32px);
        max-height: calc(100dvh - 132px);
        padding: 22px;
        margin: auto;
    }

    .lesson-modal-card .lesson-meta-row {
        padding-inline-end: 0;
        padding-top: 46px;
    }

    .table-wrap {
        overflow-x: visible;
        border: 0;
        border-radius: 0;
    }

    table.responsive-table {
        display: block;
        min-width: 0;
        background: transparent;
    }

    table.responsive-table thead {
        display: none;
    }

    table.responsive-table tbody,
    table.responsive-table tr {
        display: block;
        width: 100%;
    }

    table.responsive-table tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--card-bg);
        box-shadow: 0 12px 32px rgba(101, 18, 38, .08);
    }

    table.responsive-table td {
        display: grid;
        grid-template-columns: minmax(108px, .86fr) minmax(0, 1.14fr);
        align-items: center;
        column-gap: 12px;
        min-width: 0;
        padding: 9px 0;
        border-bottom: 1px solid var(--line);
        text-align: start;
        overflow-wrap: anywhere;
    }

    table.responsive-table td > * {
        min-width: 0;
        max-width: 100%;
        justify-self: start;
    }

    table.responsive-table td > :where(.row-actions, form, .btn, button) {
        justify-self: stretch;
    }

    .table-attendance-form td:nth-child(2) {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    .table-attendance-form td:nth-child(2) > .attendance-options {
        width: 100%;
        justify-self: stretch;
    }

    .table-attendance-form .attendance-options {
        grid-template-columns: repeat(3, minmax(76px, 1fr));
    }

    .table-attendance-form .attendance-options label {
        justify-content: center;
        min-height: 46px;
        padding-inline: 9px;
    }

    table.responsive-table td:last-child {
        border-bottom: 0;
    }

    .table-quran-pages td:first-child {
        min-width: 0;
        width: 100%;
        white-space: normal;
    }

    .table-student-quran td:first-child {
        width: 100%;
        white-space: normal;
    }

    .quran-juz-card > summary {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .quran-juz-count,
    .quran-juz-percent {
        justify-self: start;
    }

    .quran-juz-bar {
        grid-column: 1 / -1;
    }

    .table-quran-pages td:nth-child(3) {
        white-space: normal;
    }

    table.responsive-table td::before {
        display: block;
        margin: 0;
        color: var(--navy);
        font-weight: 900;
        line-height: 1.45;
        text-align: start;
    }

    .table-transactions td:nth-child(1)::before { content: "النوع"; }
    .table-transactions td:nth-child(2)::before { content: "المبلغ"; }
    .table-transactions td:nth-child(3)::before { content: "المصدر/السبب"; }
    .table-transactions td:nth-child(4)::before { content: "المشرف"; }
    .table-transactions td:nth-child(5)::before { content: "التاريخ"; }
    .table-transactions td:nth-child(6)::before { content: "إجراءات"; }

    .table-points td:nth-child(1)::before { content: "الطالب"; }
    .table-points td:nth-child(2)::before { content: "القيمة"; }
    .table-points td:nth-child(3)::before { content: "المشرف"; }
    .table-points td:nth-child(4)::before { content: "التاريخ"; }
    .table-points td:nth-child(5)::before { content: "إجراءات"; }

    .table-points-standings td:nth-child(1)::before { content: "الطالب"; }
    .table-points-standings td:nth-child(2)::before { content: "النقاط الكلية"; }
    .table-points-standings td:nth-child(3)::before { content: "نقاط الدورة"; }

    .table-lessons td:nth-child(1)::before { content: "العنوان"; }
    .table-lessons td:nth-child(2)::before { content: "السلسلة"; }
    .table-lessons td:nth-child(3)::before { content: "التاريخ"; }
    .table-lessons td:nth-child(4)::before { content: "إجراءات"; }

    .table-quran-students td:nth-child(1)::before { content: "الطالب"; }
    .table-quran-students td:nth-child(2)::before { content: "كل المحفوظات"; }
    .table-quran-students td:nth-child(3)::before { content: "محفوظات النطاق"; }
    .table-quran-students td:nth-child(4)::before { content: "السبر"; }
    .table-quran-students td:nth-child(5)::before { content: "النقاط"; }
    .table-quran-students td:nth-child(6)::before { content: "الحلقة"; }
    .table-quran-students td:nth-child(7)::before { content: "الأستاذ"; }
    .table-quran-students td:nth-child(8)::before { content: "عرض"; }

    .table-quran-pages td:nth-child(1)::before { content: "رقم الصفحات"; }
    .table-quran-pages td:nth-child(2)::before { content: "تاريخ التسميع"; }
    .table-quran-pages td:nth-child(3)::before { content: "نقاط التسميع"; }
    .table-quran-pages td:nth-child(4)::before { content: "إجراءات"; }

    .table-student-quran td:nth-child(1)::before { content: "رقم الصفحات"; }
    .table-student-quran td:nth-child(2)::before { content: "تاريخ التسميع"; }
    .table-student-quran td:nth-child(3)::before { content: "نقاط التسميع"; }

    .table-quran-juz-details td:nth-child(1)::before { content: "رقم الصفحات"; }
    .table-quran-juz-details td:nth-child(2)::before { content: "تاريخ التسميع"; }
    .table-quran-juz-details td:nth-child(3)::before { content: "نقاط التسميع"; }
    .table-quran-juz-details.has-actions td:nth-child(4)::before { content: "إجراءات"; }

    .table-quran-exams td:nth-child(1)::before { content: "الطالب"; }
    .table-quran-exams td:nth-child(2)::before { content: "نوع السبر"; }
    .table-quran-exams td:nth-child(3)::before { content: "الجزء"; }
    .table-quran-exams td:nth-child(4)::before { content: "الربع"; }
    .table-quran-exams td:nth-child(5)::before { content: "العلامة"; }
    .table-quran-exams td:nth-child(6)::before { content: "التاريخ"; }
    .table-quran-exams td:nth-child(7)::before { content: "النقاط"; }
    .table-quran-exams td:nth-child(8)::before { content: "المشرف"; }
    .table-quran-exams td:nth-child(9)::before { content: "إجراءات"; }

    .table-student-exams td:nth-child(1)::before { content: "نوع السبر"; }
    .table-student-exams td:nth-child(2)::before { content: "الجزء"; }
    .table-student-exams td:nth-child(3)::before { content: "الربع"; }
    .table-student-exams td:nth-child(4)::before { content: "العلامة"; }
    .table-student-exams td:nth-child(5)::before { content: "التاريخ"; }
    .table-student-exams td:nth-child(6)::before { content: "النقاط"; }
    .table-student-exams td:nth-child(7)::before { content: "المشرف"; }

    .table-attendance-form td:nth-child(1)::before { content: "الطالب"; }
    .table-attendance-form td:nth-child(2)::before { content: "الحالة"; }

    .table-attendance-archive td:nth-child(1)::before { content: "التاريخ"; }
    .table-attendance-archive td:nth-child(2)::before { content: "الحضور"; }
    .table-attendance-archive td:nth-child(3)::before { content: "التأخر"; }
    .table-attendance-archive td:nth-child(4)::before { content: "الغياب"; }
    .table-attendance-archive td:nth-child(5)::before { content: "تعديل"; }
    .table-attendance-archive td:nth-child(6)::before { content: "حذف"; }

    .table-students-summary td:nth-child(1)::before { content: ""; }
    .table-students-summary td:nth-child(2)::before { content: "الحفظ"; }
    .table-students-summary td:nth-child(3)::before { content: "الدوام"; }
    .table-students-summary td:nth-child(4)::before { content: "الحضور"; }
    .table-students-summary td:nth-child(5)::before { content: "التأخر"; }
    .table-students-summary td:nth-child(6)::before { content: "الغياب"; }
    .table-students-summary td:nth-child(7)::before { content: "التبرع"; }
    .table-students-summary td:nth-child(8)::before { content: "النقاط الكلية"; }
    .table-students-summary td:nth-child(9)::before { content: "نقاط الدورة"; }
    .table-students-summary td:nth-child(10)::before { content: "تفاصيل"; }

    .table-students-summary td:first-child {
        grid-template-columns: 1fr;
        padding-top: 4px;
        padding-bottom: 12px;
    }

    .table-students-summary td:first-child::before {
        display: none;
    }

    .table-students-summary .student-table-person {
        justify-content: center;
        justify-self: center;
        text-align: center;
    }

    .table-student-points td:nth-child(1)::before { content: "التاريخ"; }
    .table-student-points td:nth-child(2)::before { content: "القيمة"; }

    .table-student-donations td:nth-child(1)::before { content: "التاريخ"; }
    .table-student-donations td:nth-child(2)::before { content: "المبلغ"; }

    .table-created-admins td:nth-child(1)::before { content: "الحساب"; }
    .table-created-admins td:nth-child(2)::before { content: "اسم المستخدم"; }
    .table-created-admins td:nth-child(3)::before { content: "النوع"; }
    .table-created-admins td:nth-child(4)::before { content: "الحلقة"; }
    .table-created-admins td:nth-child(5)::before { content: "الصلاحيات"; }
    .table-created-admins td:nth-child(6)::before { content: "إجراءات"; }

    .table-auth-logs td:nth-child(1)::before { content: "الحالة"; }
    .table-auth-logs td:nth-child(2)::before { content: "الحساب"; }
    .table-auth-logs td:nth-child(3)::before { content: "الجهاز والنظام"; }
    .table-auth-logs td:nth-child(4)::before { content: "المتصفح"; }
    .table-auth-logs td:nth-child(5)::before { content: "IP"; }
    .table-auth-logs td:nth-child(6)::before { content: "التاريخ والوقت"; }

    .table-activity-logs td:nth-child(1)::before { content: "تراجع"; }
    .table-activity-logs td:nth-child(2)::before { content: "النوع"; }
    .table-activity-logs td:nth-child(3)::before { content: "العملية"; }
    .table-activity-logs td:nth-child(4)::before { content: "الوصف"; }
    .table-activity-logs td:nth-child(5)::before { content: "المنفذ"; }
    .table-activity-logs td:nth-child(6)::before { content: "IP"; }
    .table-activity-logs td:nth-child(7)::before { content: "التاريخ والوقت"; }

    .row-actions {
        align-items: stretch;
        flex-direction: column;
        justify-self: stretch;
        min-width: 0;
    }

    .row-actions .btn,
    .row-actions form,
    .row-actions button {
        width: 100%;
        white-space: normal;
    }

    .row-actions .action-icon,
    .row-actions button.action-icon,
    .course-archive-actions .action-icon,
    .course-archive-actions button.action-icon,
    table.responsive-table td > .action-icon,
    table.responsive-table td > form > .action-icon {
        width: 36px;
        height: 36px;
        justify-self: start;
        white-space: normal;
    }

    .row-actions form:has(.action-icon),
    .course-archive-actions form:has(.action-icon) {
        width: auto;
    }

    .title-with-filter,
    .lesson-series-filter {
        align-items: stretch;
        width: 100%;
    }

    .lesson-series-filter,
    .series-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .student-search-filter,
    .course-summary-filter {
        grid-template-columns: 1fr;
    }

    .student-search-filter input,
    .course-summary-filter input {
        min-width: 0;
        width: 100%;
    }

    .lesson-series-filter {
        gap: 9px;
        justify-items: stretch;
    }

    .lesson-series-filter .filter-control,
    .lesson-series-filter .filter-control.is-search,
    .lesson-series-filter .filter-control.is-sort,
    .lesson-series-filter .filter-control.is-compact,
    .lesson-series-filter .filter-control.is-button {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        min-width: 0;
        flex-basis: auto;
    }

    .lesson-series-filter .filter-inline-group {
        grid-template-columns: 1fr;
    }

    .lesson-series-filter label {
        justify-self: start;
        margin-inline-start: 4px;
    }

    .lesson-series-filter select,
    .course-scope-filter select,
    .series-row .btn {
        width: 100%;
    }

    .site-footer {
        display: none;
    }

    .upload-mode-tabs {
        display: grid;
        width: 100%;
    }

    .logs-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logs-filter {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .logs-filter label {
        align-self: flex-start;
        margin-inline-start: 4px;
    }

    .media-lightbox {
        grid-template-rows: minmax(0, 1fr) auto;
        align-items: center;
        justify-items: center;
        gap: 12px;
        padding: 64px 12px calc(14px + env(safe-area-inset-bottom));
    }

    .lesson-modal {
        align-items: center;
        justify-items: center;
        padding: 74px 14px calc(92px + env(safe-area-inset-bottom));
    }

    .lightbox-stage {
        width: calc(100vw - 34px);
        height: calc(100dvh - 176px - env(safe-area-inset-bottom));
        min-height: 260px;
    }

    .lightbox-stage img,
    .lightbox-stage video,
    .lightbox-stage iframe {
        border-radius: 18px;
    }

    .lightbox-stage iframe {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .lightbox-thumbs {
        justify-content: flex-start;
        width: calc(100vw - 24px);
        padding: 7px;
        border-radius: 18px;
        scroll-padding-inline: 8px;
    }

    .lightbox-thumb {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .lightbox-arrow {
        width: 44px;
        height: 44px;
        font-size: 2rem;
    }

    .lightbox-next {
        inset-inline-end: 8px;
    }

    .lightbox-prev {
        inset-inline-start: 8px;
    }

    .lightbox-close {
        top: 10px;
        inset-inline-end: 10px;
    }
}

@media (max-width: 720px) {
    .mobile-topbar {
        position: fixed;
        top: 12px;
        inset-inline: 16px;
        z-index: 80;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 58px;
        padding: 8px 10px;
        border: 1px solid var(--surface-border);
        border-radius: 20px;
        background: var(--header-bg);
        box-shadow: var(--shadow);
        backdrop-filter: blur(18px);
    }

    .mobile-bottom-tabs {
        position: fixed;
        right: 12px;
        left: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 70;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        padding: 8px;
        border: 1px solid rgba(219, 175, 160, .16);
        border-radius: 22px;
        color: #DBAFA0;
        background: linear-gradient(135deg, rgba(31, 17, 29, .96), rgba(38, 19, 35, .94));
        box-shadow: 0 20px 46px rgba(0, 0, 0, .34);
        backdrop-filter: blur(18px);
    }

    .mobile-tab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
        min-height: 54px;
        padding: 7px 3px 6px;
        border-radius: 16px;
        color: inherit;
        font-size: .68rem;
        line-height: 1.05;
        font-weight: 900;
        text-align: center;
        white-space: nowrap;
        transition: background .18s ease, color .18s ease, transform .18s ease;
    }

    .mobile-tab svg {
        width: 21px;
        height: 21px;
        flex: 0 0 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-tab span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-tab.is-active {
        color: #fff;
        background: rgba(187, 132, 147, .24);
        box-shadow: inset 0 0 0 1px rgba(219, 175, 160, .22);
    }

    .mobile-tab:active {
        transform: translateY(1px);
    }

    .mobile-brand {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .mobile-notification-center {
        margin-inline-start: auto;
    }

    .mobile-notification-center .notification-trigger {
        width: 44px;
        height: 44px;
        border-radius: 15px;
    }

    .mobile-brand .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .mobile-brand strong {
        color: var(--navy);
        line-height: 1.1;
    }

    .mobile-brand small {
        font-size: .86rem;
    }

    .mobile-menu-toggle {
        position: static;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        width: 48px;
        height: 48px;
        border: 0;
        border-radius: 16px;
        background: var(--primary-gradient);
        box-shadow: 0 14px 34px rgba(112, 66, 100, .24);
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition: opacity .2s ease, transform .2s ease;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        border-radius: 999px;
        background: var(--on-primary);
        transform-origin: center;
    }

    .site-header {
        position: fixed;
        top: 82px;
        inset-inline: 16px;
        z-index: 79;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "user user"
            "nav nav"
            "theme logout";
        align-items: stretch;
        gap: 8px;
        direction: ltr;
        overflow: hidden;
        transition:
            max-height .32s ease,
            padding .32s ease,
            border-color .32s ease,
            opacity .2s ease,
            transform .32s ease;
    }

    .site-header {
        max-height: 0;
        margin: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-color: transparent;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-16px);
    }

    .site-header > .brand {
        display: none;
    }

    .site-header > *,
    .header-actions > * {
        direction: rtl;
    }

    .site-header .mobile-user-chip {
        grid-area: user;
        display: inline-flex;
        width: 100%;
        min-height: 54px;
        justify-content: flex-start;
        padding: 9px 12px;
        border-radius: 16px;
        font-size: 1.05rem;
    }

    .site-header .mobile-user-chip .user-chip-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 10px;
    }

    .main-nav {
        grid-area: nav;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        margin-top: 0;
    }

    .header-actions {
        display: contents;
        margin-top: 0;
        margin-bottom: 0;
    }

    .header-actions .user-chip {
        display: none;
    }

    .header-actions .theme-toggle {
        grid-area: theme;
        align-self: start;
        justify-self: stretch;
        width: 100%;
        height: 46px;
        min-width: 0;
        min-height: 46px;
    }

    .site-header.is-guest .header-actions .theme-toggle {
        grid-area: auto;
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
    }

    .header-actions .logout-form {
        grid-area: logout;
        align-self: stretch;
        justify-self: stretch;
    }

    .header-actions .logout-button {
        width: 100%;
        height: 46px;
        min-width: 0;
        min-height: 46px;
        padding: 0;
        border-radius: 16px;
    }

    .header-actions .login-button {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        min-height: 54px;
        justify-self: stretch;
        border-radius: 16px;
    }

    .main-nav a {
        justify-content: flex-start;
        min-width: 0;
        min-height: 46px;
        padding: 10px 11px;
        text-align: start;
        font-size: .9rem;
        gap: 6px;
        white-space: normal;
    }

    .main-nav a span {
        white-space: normal;
        line-height: 1.15;
    }

    .main-nav svg {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    .dashboard-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        position: static;
        margin: 0 0 18px;
        padding: 12px;
        border-radius: 18px;
    }

    .dashboard-nav a {
        justify-content: flex-start;
        min-height: 44px;
        padding: 10px 8px;
        text-align: start;
        font-size: .96rem;
        white-space: normal;
    }

    .dashboard-nav a span {
        white-space: normal;
        line-height: 1.2;
    }

    body.mobile-menu-open .site-header {
        max-height: calc(100dvh - 104px);
        margin: 0;
        padding: 12px;
        border-color: var(--surface-border);
        opacity: 1;
        pointer-events: auto;
        overflow-y: auto;
        transform: translateY(0);
    }

    .site-footer {
        display: none;
    }
}

.mobile-only-action-label {
    display: none;
}

@media (max-width: 720px) {
    .presence-command {
        gap: 10px;
    }

    .presence-hero {
        display: grid;
        gap: 10px;
        padding: 13px;
        border-radius: 18px;
    }

    .presence-hero-main {
        align-items: center;
        flex-direction: row;
        gap: 10px;
    }

    .presence-hero-icon {
        width: 46px;
        height: 46px;
        border-radius: 16px;
    }

    .presence-hero-icon svg,
    .presence-stat-icon svg {
        width: 22px;
        height: 22px;
    }

    .presence-hero h2 {
        margin: 4px 0 0;
        font-size: 1.35rem;
    }

    .presence-hero p {
        display: none;
    }

    .presence-live-badge {
        min-height: 24px;
        padding: 4px 8px;
        font-size: .76rem;
    }

    .presence-updated {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        border-radius: 14px;
        grid-template-columns: 1fr auto;
        align-items: center;
        text-align: start;
    }

    .presence-updated strong {
        font-size: 1rem;
    }

    .presence-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .presence-stat-card {
        min-height: 88px;
        padding: 11px;
        border-radius: 16px;
        gap: 6px;
    }

    .presence-stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .presence-stat-card > span:not(.presence-stat-icon) {
        font-size: .82rem;
        line-height: 1.25;
    }

    .presence-stat-card strong {
        font-size: 1.45rem;
    }

    .presence-filter-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 6px;
        border-radius: 16px;
    }

    .presence-filter-pill {
        min-height: 42px;
        padding: 7px 6px;
        gap: 5px;
        border-radius: 13px;
        font-size: .84rem;
    }

    .presence-filter-pill b {
        min-width: 26px;
        padding: 3px 7px;
        font-size: .78rem;
    }

    .presence-table-panel {
        padding: 12px;
        border-radius: 18px;
    }

    .presence-table-panel .panel-heading {
        margin-bottom: 10px;
    }

    .presence-table-panel .panel-heading h2 {
        font-size: 1.05rem;
    }

    .presence-table-panel .panel-heading p {
        display: none;
    }

    .table-presence tbody {
        display: grid;
        gap: 9px;
    }

    table.responsive-table.table-presence tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 0;
        padding: 9px;
        border-radius: 16px;
    }

    table.responsive-table.table-presence td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        min-height: 32px;
        padding: 6px 8px;
        border: 0;
        border-radius: 12px;
        background: var(--soft-bg);
        overflow-wrap: normal;
    }

    table.responsive-table.table-presence td > * {
        min-width: 0;
        justify-self: auto;
    }

    table.responsive-table.table-presence td::before {
        margin: 0;
        color: var(--muted);
        font-size: .73rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    table.responsive-table.table-presence td:first-child {
        grid-column: 1 / -1;
        justify-content: flex-start;
        min-height: 48px;
        padding: 0 0 8px;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        background: transparent;
    }

    table.responsive-table.table-presence td:first-child::before {
        display: none;
    }

    .presence-person {
        gap: 8px;
        width: 100%;
    }

    .presence-avatar {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 13px;
    }

    .presence-person strong,
    .presence-person small {
        max-width: 190px;
        white-space: nowrap;
    }

    .presence-person strong {
        font-size: .92rem;
    }

    .presence-person small {
        font-size: .75rem;
    }

    .presence-state {
        min-height: 28px;
        padding: 4px 7px;
        gap: 5px;
        font-size: .78rem;
    }

    .presence-state > span {
        width: 7px;
        height: 7px;
    }

    .presence-count,
    .table-presence .badge {
        min-width: 30px;
        min-height: 26px;
        padding: 3px 8px;
        font-size: .78rem;
    }

    .table-presence td:nth-child(4) strong,
    .table-presence td:nth-child(4) small {
        font-size: .73rem;
        white-space: nowrap;
    }

    .student-profile-title .profile-head {
        display: block;
        margin-top: 8px;
    }

    .student-profile-title .profile-id {
        align-items: center;
        flex-direction: column;
        gap: 14px;
        padding-top: 10px;
        text-align: center;
    }

    .student-profile-title .avatar-lg,
    .student-profile-title .avatar-fallback.avatar-lg {
        width: 96px;
        height: 96px;
        margin-top: 8px;
        border-radius: 26px;
    }

    .album-delete-form {
        width: 100% !important;
    }

    .album-delete-button.action-icon {
        display: inline-flex;
        width: 100% !important;
        min-height: 44px;
        gap: 8px;
        border-radius: 14px;
        font-weight: 900;
        white-space: nowrap;
    }

    .album-delete-button .mobile-only-action-label {
        display: inline;
    }
}

@media (max-width: 720px) {
    .presence-title {
        margin-bottom: 10px;
    }

    .presence-command {
        gap: 9px;
    }

    .presence-hero {
        overflow: hidden;
    }

    .presence-hero::after {
        width: 92px;
        border-width: 15px;
        inset: auto -32px -42px auto;
        opacity: .65;
    }

    .presence-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
    }

    .presence-stat-card {
        min-height: 82px;
        padding: 10px;
        border-radius: 15px;
    }

    .presence-stat-card::after {
        width: 54px;
        height: 54px;
        inset: auto -14px -16px auto;
        opacity: .72;
    }

    .presence-stat-icon {
        width: 31px;
        height: 31px;
        border-radius: 10px;
    }

    .presence-stat-card strong {
        z-index: 1;
        font-size: 1.32rem;
    }

    .presence-filter-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .presence-filter-pill {
        min-width: 0;
        overflow: hidden;
    }

    .presence-filter-pill span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .presence-table-panel {
        padding: 10px;
    }

    .table-presence tbody {
        gap: 8px;
    }

    table.responsive-table.table-presence tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 9px;
        overflow: hidden;
    }

    table.responsive-table.table-presence td {
        position: relative;
        min-width: 0;
        min-height: 34px;
        padding: 6px 7px;
        overflow: hidden;
        isolation: isolate;
    }

    table.responsive-table.table-presence td::before {
        flex: 0 0 auto;
        max-width: 58%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    table.responsive-table.table-presence td:first-child {
        min-height: 46px;
        padding-bottom: 7px;
    }

    table.responsive-table.table-presence td:nth-child(4) {
        grid-column: 1 / -1;
    }

    .table-presence td:nth-child(5)::before { content: "ناجح"; }
    .table-presence td:nth-child(6)::before { content: "فاشل"; }
    .table-presence td:nth-child(7)::before { content: "خروج"; }
    .table-presence td:nth-child(8)::before { content: "تعديلات"; }

    .presence-person {
        min-width: 0;
    }

    .presence-person > span:last-child {
        min-width: 0;
        max-width: calc(100% - 50px);
    }

    .presence-person strong,
    .presence-person small {
        max-width: 100%;
    }

    .presence-state,
    .presence-count,
    .table-presence .badge {
        flex: 0 0 auto;
        max-width: 100%;
        white-space: nowrap;
    }

    .presence-state {
        font-size: .74rem;
    }

    .presence-count,
    .table-presence .badge {
        min-width: 28px;
        min-height: 24px;
        padding: 3px 7px;
        font-size: .74rem;
    }

    .table-presence td:nth-child(4) strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .presence-desktop-table {
        display: none !important;
    }

    .presence-mobile-list {
        display: grid;
        gap: 8px;
    }

    .presence-mobile-card {
        position: relative;
        overflow: hidden;
        display: grid;
        gap: 8px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background:
            linear-gradient(135deg, color-mix(in srgb, var(--soft-bg) 88%, transparent), transparent),
            var(--card-bg);
        box-shadow: 0 12px 26px rgba(101, 18, 38, .08);
    }

    .presence-mobile-card::after {
        content: "";
        position: absolute;
        inset: auto -20px -26px auto;
        width: 66px;
        height: 66px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--cyan) 14%, transparent);
        pointer-events: none;
    }

    .presence-mobile-card.is-online {
        border-color: color-mix(in srgb, var(--success) 32%, var(--line));
        background:
            linear-gradient(135deg, color-mix(in srgb, var(--success) 11%, transparent), transparent 52%),
            var(--card-bg);
    }

    .presence-mobile-card.is-offline {
        opacity: .94;
    }

    .presence-mobile-main {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        align-items: center;
        gap: 9px;
    }

    .presence-mobile-avatar {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        overflow: hidden;
        border-radius: 13px;
        color: #fff;
        font-weight: 900;
        background: var(--brand-gradient);
    }

    .presence-mobile-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .presence-mobile-name {
        display: grid;
        gap: 1px;
        min-width: 0;
    }

    .presence-mobile-name strong,
    .presence-mobile-name small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .presence-mobile-name strong {
        color: var(--navy);
        font-size: .92rem;
        line-height: 1.25;
    }

    .presence-mobile-name small {
        color: var(--muted);
        font-size: .72rem;
        font-weight: 800;
    }

    .presence-mobile-state {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 28px;
        padding: 4px 8px;
        border-radius: 999px;
        color: var(--muted);
        font-size: .72rem;
        font-weight: 900;
        white-space: nowrap;
        background: var(--soft-bg);
    }

    .presence-mobile-state i {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: currentColor;
    }

    .presence-mobile-card.is-online .presence-mobile-state {
        color: var(--success);
        background: color-mix(in srgb, var(--success) 13%, transparent);
    }

    .presence-mobile-meta {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 6px;
        align-items: center;
        color: var(--muted);
        font-size: .72rem;
        font-weight: 800;
    }

    .presence-mobile-meta span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .presence-mobile-meta span:first-child {
        justify-self: start;
        padding: 3px 8px;
        border-radius: 999px;
        color: var(--blue);
        background: color-mix(in srgb, var(--cyan) 12%, transparent);
    }

    .presence-mobile-metrics {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
    }

    .presence-mobile-metrics span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        min-height: 28px;
        padding: 4px 5px;
        border-radius: 10px;
        background: color-mix(in srgb, var(--blue) 13%, transparent);
    }

    .presence-mobile-metrics b {
        color: var(--blue);
        font-size: .82rem;
        line-height: 1;
    }

    .presence-mobile-metrics small {
        min-width: 0;
        overflow: hidden;
        color: var(--navy);
        font-size: .66rem;
        font-weight: 900;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .presence-mobile-metrics span:nth-child(1) b {
        color: var(--success);
    }

    .presence-mobile-metrics span:nth-child(2) b {
        color: var(--danger);
    }

    .presence-mobile-metrics span:nth-child(3) b {
        color: var(--warning);
    }

    .presence-mobile-empty {
        padding: 18px;
        border: 1px dashed var(--line);
        border-radius: 16px;
        color: var(--muted);
        text-align: center;
        font-weight: 900;
        background: var(--soft-bg);
    }
}

.student-dashboard-hero,
.students-command-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 18px 0 24px;
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid rgba(219, 175, 160, .28);
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 16% 18%, rgba(219, 175, 160, .24), transparent 18rem),
        linear-gradient(135deg, rgba(38, 19, 35, .98), rgba(112, 66, 100, .78) 58%, rgba(187, 132, 147, .56));
    box-shadow: 0 30px 84px rgba(73, 36, 62, .22);
}

.student-dashboard-hero::after,
.students-command-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto -76px -94px auto;
    width: 250px;
    aspect-ratio: 1;
    border: 38px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
}

.student-hero-main {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.student-hero-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(96px, 12vw, 132px);
    height: clamp(96px, 12vw, 132px);
    flex: 0 0 auto;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .42);
    border-radius: 32px;
    color: #fff;
    font-size: 2.8rem;
    font-weight: 900;
    background: var(--brand-gradient);
    box-shadow: 0 24px 58px rgba(0, 0, 0, .28);
}

.student-hero-avatar::after {
    content: "";
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(219, 175, 160, .42);
    border-radius: 38px;
    pointer-events: none;
}

.student-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-hero-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.student-hero-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    color: #DBAFA0;
    font-weight: 900;
    background: rgba(255, 255, 255, .12);
}

.student-hero-copy h1,
.students-command-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 4.7rem);
    line-height: 1.05;
}

.student-hero-copy p,
.students-command-hero p {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-weight: 800;
    line-height: 1.8;
}

.student-hero-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.student-hero-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 999px;
    color: rgba(255, 255, 255, .86);
    font-weight: 900;
    background: rgba(255, 255, 255, .12);
}

.student-hero-chips b {
    color: #fff;
}

.student-hero-orbit,
.students-command-orbit {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    border-radius: 30px;
    color: #49243E;
    background: linear-gradient(135deg, #fff, #DBAFA0);
    box-shadow: 0 24px 58px rgba(0, 0, 0, .24);
}

.student-hero-orbit svg,
.students-command-orbit svg,
.student-kpi-icon svg,
.students-mobile-open svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.student-scope-panel {
    overflow: hidden;
    border-radius: 24px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--soft-bg) 78%, transparent), transparent),
        var(--surface);
}

.student-scope-panel .section-head {
    margin-bottom: 0;
}

.student-dashboard-kpi-grid {
    gap: 14px;
}

.student-kpi-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 8px;
    min-height: 142px;
    border-radius: 22px;
}

.student-kpi-card::after {
    content: "";
    position: absolute;
    inset: auto -28px -34px auto;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.student-kpi-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--blue);
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
}

.student-kpi-icon.success {
    color: var(--success);
    background: rgba(15, 148, 109, .12);
}

.student-kpi-icon.warning {
    color: var(--warning);
    background: rgba(199, 123, 22, .13);
}

.student-kpi-icon.danger {
    color: var(--danger);
    background: rgba(217, 71, 99, .12);
}

.student-kpi-card strong,
.student-kpi-card span:not(.student-kpi-icon) {
    position: relative;
    z-index: 1;
}

.student-dashboard-panel,
.student-editor-panel,
.student-info-panel,
.students-command-panel {
    border-radius: 24px;
}

.student-rank-panel {
    background:
        radial-gradient(circle at 10% 18%, rgba(219, 175, 160, .12), transparent 18rem),
        var(--surface);
}

.student-rank-panel .rank-metric-card {
    border: 1px solid var(--line);
    background: var(--soft-bg);
}

.student-progress-showcase .quran-progress {
    height: 22px;
}

.student-admin-bottom-grid {
    align-items: start;
}

.students-command-hero {
    align-items: center;
}

.students-command-hero > div:first-child {
    display: grid;
    gap: 8px;
}

.students-command-panel {
    position: relative;
    overflow: hidden;
}

.students-command-panel::after {
    content: "";
    position: absolute;
    inset: -80px auto auto -80px;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cyan) 10%, transparent);
    pointer-events: none;
}

.students-command-panel > * {
    position: relative;
    z-index: 1;
}

.students-command-panel .section-head {
    align-items: flex-start;
}

.students-command-panel .student-search-filter {
    margin-top: 14px;
}

.students-desktop-table .table-students-summary {
    table-layout: auto;
}

.students-mobile-list {
    display: none;
}

.students-mobile-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--card-bg);
    box-shadow: 0 12px 28px rgba(101, 18, 38, .08);
}

.students-mobile-card::after {
    content: "";
    position: absolute;
    inset: auto -20px -26px auto;
    width: 66px;
    height: 66px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cyan) 13%, transparent);
    pointer-events: none;
}

.students-mobile-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 9px;
}

.students-mobile-avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    object-fit: cover;
    background: var(--brand-gradient);
}

.students-mobile-main strong,
.students-mobile-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.students-mobile-main strong {
    color: var(--navy);
    font-size: .96rem;
}

.students-mobile-main small {
    color: var(--muted);
    font-weight: 800;
}

.students-mobile-open {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: var(--on-primary);
    background: var(--primary-gradient);
}

.students-mobile-open svg {
    width: 20px;
    height: 20px;
}

.students-mobile-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.students-mobile-metrics span {
    display: grid;
    gap: 2px;
    min-width: 0;
    min-height: 42px;
    padding: 5px 6px;
    border-radius: 12px;
    background: var(--soft-bg);
}

.students-mobile-metrics b,
.students-mobile-metrics small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.students-mobile-metrics b {
    color: var(--blue);
    font-size: .88rem;
    line-height: 1;
}

.students-mobile-metrics small {
    color: var(--muted);
    font-size: .62rem;
    font-weight: 900;
}

.students-mobile-metrics span:nth-child(2) b,
.students-mobile-metrics span:nth-child(3) b,
.students-mobile-metrics span:nth-child(6) b,
.students-mobile-metrics span:nth-child(8) b {
    color: var(--success);
}

.students-mobile-metrics span:nth-child(4) b {
    color: var(--warning);
}

.students-mobile-metrics span:nth-child(5) b {
    color: var(--danger);
}

.students-mobile-empty {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
    font-weight: 900;
    background: var(--soft-bg);
}

@media (prefers-reduced-motion: no-preference) {
    .student-dashboard-hero,
    .students-command-hero,
    .student-kpi-card,
    .student-dashboard-panel,
    .students-command-panel,
    .students-mobile-card {
        animation: himma-rise .38s cubic-bezier(.2, .8, .2, 1) both;
    }

    .student-hero-avatar,
    .student-hero-orbit,
    .students-command-orbit,
    .student-kpi-card,
    .students-mobile-card {
        transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    }

    .student-dashboard-hero:hover .student-hero-avatar,
    .students-command-hero:hover .students-command-orbit,
    .student-kpi-card:hover,
    .students-mobile-card:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 980px) {
    .student-dashboard-hero,
    .students-command-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .student-hero-orbit,
    .students-command-orbit {
        display: none;
    }

    .student-dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .student-dashboard-hero,
    .students-command-hero {
        gap: 12px;
        margin: 6px 0 16px;
        padding: 14px;
        border-radius: 20px;
    }

    .student-dashboard-hero::after,
    .students-command-hero::after {
        width: 92px;
        border-width: 15px;
        inset: auto -34px -42px auto;
    }

    .student-hero-main {
        align-items: center;
        gap: 11px;
        width: 100%;
    }

    .student-hero-avatar {
        width: 68px;
        height: 68px;
        border-radius: 20px;
        font-size: 1.8rem;
    }

    .student-hero-avatar::after {
        inset: -5px;
        border-radius: 25px;
    }

    .student-hero-copy {
        gap: 5px;
    }

    .student-hero-badge {
        min-height: 24px;
        padding: 4px 8px;
        font-size: .76rem;
    }

    .student-hero-copy h1,
    .students-command-hero h1 {
        font-size: 1.75rem;
    }

    .student-hero-copy p,
    .students-command-hero p {
        display: none;
    }

    .student-hero-chips {
        gap: 5px;
    }

    .student-hero-chips span {
        min-height: 27px;
        padding: 4px 8px;
        font-size: .73rem;
    }

    .student-scope-panel {
        padding: 13px;
        border-radius: 18px;
    }

    .student-scope-panel .section-head {
        gap: 10px;
    }

    .student-scope-panel .section-head p {
        display: none;
    }

    .student-dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
    }

    .student-kpi-card {
        min-height: 98px;
        padding: 11px;
        border-radius: 16px;
    }

    .student-kpi-card::after {
        width: 54px;
        height: 54px;
        inset: auto -16px -18px auto;
    }

    .student-kpi-icon {
        width: 32px;
        height: 32px;
        border-radius: 11px;
    }

    .student-kpi-icon svg {
        width: 19px;
        height: 19px;
    }

    .student-kpi-card strong {
        font-size: 1.35rem;
    }

    .student-kpi-card span:not(.student-kpi-icon) {
        font-size: .78rem;
        line-height: 1.25;
    }

    .student-dashboard-panel,
    .student-editor-panel,
    .student-info-panel,
    .students-command-panel {
        padding: 13px;
        border-radius: 18px;
    }

    .student-rank-panel .rank-metrics-grid,
    .student-portal-rank-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .student-dashboard-record-grid {
        gap: 12px;
    }

    .students-command-panel .section-head {
        gap: 10px;
    }

    .students-command-panel .student-search-filter {
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .students-desktop-table {
        display: none !important;
    }

    .students-mobile-list {
        display: grid;
        gap: 8px;
    }

    .student-table-actions {
        margin-top: 12px;
    }
}
