:root {
    --navy: #0d2368;
    --navy-950: #071235;
    --sky: #78bedc;
    --green: #2d806f;
    --gold: #f2c77f;
    --ink: #172033;
    --muted: #687289;
    --line: rgba(16, 35, 104, 0.13);
    --surface: #ffffff;
    --page: #f7f8fb;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --shadow: 0 24px 70px rgba(7, 18, 53, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        linear-gradient(135deg, rgba(13, 35, 104, 0.06), transparent 34%),
        linear-gradient(315deg, rgba(45, 128, 111, 0.08), transparent 42%),
        var(--page);
    color: var(--ink);
    font-family: "Tajawal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(380px, 560px);
    overflow: hidden;
}

.brand-panel {
    position: relative;
    padding: clamp(34px, 7vw, 92px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 38px;
    color: white;
    background:
        linear-gradient(145deg, rgba(7, 18, 53, 0.98), rgba(13, 35, 104, 0.96) 58%, rgba(18, 53, 95, 0.98)),
        var(--navy-950);
    isolation: isolate;
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    inset: auto;
    z-index: -1;
    pointer-events: none;
}

.brand-panel::before {
    width: 58%;
    height: 58%;
    left: -18%;
    top: -12%;
    background: radial-gradient(circle, rgba(120, 190, 220, 0.42), transparent 65%);
}

.brand-panel::after {
    width: 70%;
    height: 70%;
    right: -26%;
    bottom: -18%;
    background: radial-gradient(circle, rgba(242, 199, 127, 0.30), transparent 64%);
}

.brand-glow {
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    pointer-events: none;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 26px;
}

.brand-logo {
    width: clamp(132px, 16vw, 210px);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 26px;
    background: white;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
}

.brand-lockup h1,
.brand-copy h2,
.dashboard-header h1 {
    margin: 0;
    letter-spacing: 0;
}

.brand-lockup h1 {
    font-size: clamp(42px, 6vw, 82px);
    line-height: 1;
    color: white;
}

.brand-copy {
    max-width: 620px;
}

.brand-copy h2 {
    max-width: 620px;
    font-size: clamp(34px, 4.4vw, 62px);
    line-height: 1.12;
    color: white;
}

.brand-copy p,
.panel-heading p,
.dashboard-card p,
.dashboard-header p {
    color: var(--muted);
    line-height: 1.8;
}

.brand-copy p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 18px;
}

.brand-strip {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 1.45fr;
    gap: 10px;
    width: min(420px, 100%);
}

.brand-strip span {
    height: 8px;
    border-radius: 999px;
}

.brand-strip span:nth-child(1) {
    background: var(--gold);
}

.brand-strip span:nth-child(2) {
    background: var(--sky);
}

.brand-strip span:nth-child(3) {
    background: var(--green);
}

.brand-strip span:nth-child(4) {
    background: white;
    opacity: 0.88;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-weight: 800;
}

.brand-panel .eyebrow {
    color: var(--gold);
}

.login-panel {
    padding: clamp(24px, 5vw, 64px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: min(100%, 480px);
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.portal-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 7px;
    margin-bottom: 30px;
    background: rgba(13, 35, 104, 0.07);
    border: 1px solid rgba(13, 35, 104, 0.08);
    border-radius: 14px;
}

.portal-tabs a {
    min-height: 46px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 800;
}

.portal-tabs a.active {
    background: var(--surface);
    color: var(--navy);
    box-shadow: 0 10px 28px rgba(16, 38, 111, 0.14);
}

.panel-heading h2 {
    margin: 0;
    color: var(--navy-950);
    font-size: 34px;
    letter-spacing: 0;
}

.alert {
    padding: 14px 16px;
    border: 1px solid #ffccc7;
    border-radius: 12px;
    color: var(--danger);
    background: var(--danger-bg);
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

.login-form label {
    display: grid;
    gap: 9px;
    color: var(--navy-950);
    font-weight: 800;
}

.login-form input,
.login-form select,
.country-form input,
.country-edit-form input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    font: inherit;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-form select {
    cursor: pointer;
}

.login-form input:focus,
.login-form select:focus,
.country-form input:focus,
.country-edit-form input:focus {
    outline: 4px solid rgba(120, 190, 220, 0.27);
    border-color: var(--sky);
}

.login-form button,
.logout-link,
.country-form button,
.inline-actions button,
.country-list button,
.country-edit-form button,
.country-name-form button,
.country-actions button {
    min-height: 56px;
    border: 0;
    border-radius: 14px;
    padding: 0 22px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 18px 38px rgba(13, 35, 104, 0.24);
}

.login-form button:hover,
.logout-link:hover,
.country-form button:hover,
.inline-actions button:hover,
.country-list button:hover,
.country-edit-form button:hover,
.country-name-form button:hover,
.country-actions button:hover {
    transform: translateY(-1px);
}

.secondary-button,
.login-form .secondary-button,
.country-list .secondary-button,
.country-edit-form .secondary-button,
.country-actions .secondary-button {
    background: linear-gradient(135deg, var(--gold), #d9a755);
    color: var(--navy-950);
}

.danger-button,
.inline-actions .danger-button,
.country-actions .danger-button {
    background: linear-gradient(135deg, #c0392b, #8f1e17);
}

.muted-button,
.country-actions .muted-button {
    background: rgba(13, 35, 104, 0.08);
    color: var(--navy);
    border: 1px solid rgba(13, 35, 104, 0.12);
}

.alert.success {
    border-color: rgba(45, 128, 111, 0.24);
    color: var(--green);
    background: rgba(45, 128, 111, 0.10);
}

.student-register {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.signup-prompt {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.signup-prompt button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--navy);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    place-items: center;
    padding: 22px;
    background: rgba(7, 18, 53, 0.62);
    backdrop-filter: blur(10px);
}

.modal-backdrop.is-open {
    display: grid;
}

.register-modal {
    position: relative;
    width: min(100%, 520px);
    max-height: min(90vh, 760px);
    overflow: auto;
    padding: clamp(24px, 4vw, 34px);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.30);
}

.modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: white;
    color: var(--navy-950);
    font: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.panel-heading.compact h2 {
    font-size: 26px;
}

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    background:
        linear-gradient(135deg, rgba(120, 190, 220, 0.12), transparent 35%),
        linear-gradient(315deg, rgba(242, 199, 127, 0.18), transparent 38%),
        var(--page);
}

.sidebar {
    margin: 18px;
    padding: 28px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(7, 18, 53, 0.98), rgba(13, 35, 104, 0.97)),
        var(--navy-950);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 22px 60px rgba(7, 18, 53, 0.20);
}

.sidebar-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.sidebar-logo {
    width: 66px;
    height: 66px;
    border-radius: 16px;
    object-fit: cover;
    background: white;
}

.sidebar strong,
.sidebar span {
    display: block;
}

.sidebar strong {
    font-size: 26px;
}

.sidebar span {
    color: var(--gold);
    margin-top: 4px;
}

.sidebar-nav {
    width: 100%;
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-nav a {
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(242, 199, 127, 0.42);
}

.portal-admin .sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.portal-admin .sidebar-nav a {
    width: 100%;
    min-height: 52px;
    justify-content: flex-start;
    font-size: 16px;
}

.dashboard-main {
    padding: clamp(24px, 5vw, 58px);
    min-width: 0;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    color: var(--navy);
    font-size: clamp(34px, 4vw, 56px);
    line-height: 1.08;
}

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

.dashboard-card {
    min-height: 205px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 46px rgba(7, 18, 53, 0.10);
}

.dashboard-card span {
    width: 48px;
    height: 9px;
    display: block;
    border-radius: 999px;
    background: var(--gold);
}

.dashboard-card:nth-child(2) span {
    background: var(--sky);
}

.dashboard-card:nth-child(3) span {
    background: var(--green);
}

.dashboard-card h2 {
    margin: 30px 0 8px;
    color: var(--navy);
    font-size: 26px;
    letter-spacing: 0;
}

.admin-section {
    margin-top: 28px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 46px rgba(7, 18, 53, 0.09);
    overflow: hidden;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    color: var(--navy);
    font-size: 28px;
}

.status-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(242, 199, 127, 0.28);
    color: var(--navy-950);
    font-weight: 800;
    white-space: nowrap;
}

.empty-state {
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    background: rgba(247, 248, 251, 0.72);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

th {
    color: var(--navy);
    font-weight: 800;
    background: rgba(13, 35, 104, 0.04);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-actions button,
.country-list button {
    min-height: 40px;
    padding: 0 14px;
    box-shadow: none;
}

.country-form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.country-form label {
    display: grid;
    gap: 9px;
    color: var(--navy-950);
    font-weight: 800;
}

.countries-toolbar {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(247, 248, 251, 0.72);
    margin: 22px 0 18px;
}

.country-status {
    width: fit-content;
    min-width: 82px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 800;
    text-align: center;
}

.country-status.active {
    color: var(--green);
    background: rgba(45, 128, 111, 0.12);
}

.country-status.inactive {
    color: #8f1e17;
    background: rgba(192, 57, 43, 0.10);
}

.students-wrap {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(7, 18, 53, 0.06);
}

.admin-create-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 12px;
    margin: 22px 0 18px;
    padding: 18px;
    border: 1px solid rgba(13, 35, 104, 0.12);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(247, 248, 251, 0.78));
    box-shadow: 0 14px 34px rgba(7, 18, 53, 0.07);
}

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

.subject-create-form {
    grid-template-columns: minmax(260px, 1fr) 220px;
    align-items: end;
}

.admin-create-form label {
    display: grid;
    gap: 8px;
    color: var(--navy-950);
    font-weight: 800;
}

.admin-create-form input,
.admin-create-form select {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.admin-create-form button {
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(13, 35, 104, 0.20);
    white-space: nowrap;
}

.admin-data-table {
    width: 100%;
    min-width: 860px;
}

.admin-data-table th {
    padding: 16px 18px;
    color: var(--navy);
    background: rgba(13, 35, 104, 0.055);
    font-size: 15px;
}

.admin-data-table td {
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.62);
}

.admin-data-table tr:hover td {
    background: rgba(120, 190, 220, 0.08);
}

.student-status {
    display: inline-grid;
    min-width: 110px;
    padding: 8px 12px;
    border-radius: 999px;
    place-items: center;
    font-weight: 800;
}

.student-status.approved {
    color: var(--green);
    background: rgba(45, 128, 111, 0.12);
}

.student-status.pending {
    color: #8a5a00;
    background: rgba(242, 199, 127, 0.26);
}

.student-status.rejected {
    color: #8f1e17;
    background: rgba(192, 57, 43, 0.10);
}

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

[hidden] {
    display: none !important;
}

.students-admin-table {
    width: 100%;
    min-width: 920px;
    table-layout: fixed;
}

.teachers-admin-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
}

.students-admin-table th,
.teachers-admin-table th {
    padding: 18px;
    color: var(--navy);
    background: rgba(13, 35, 104, 0.055);
    font-size: 15px;
}

.students-admin-table td,
.teachers-admin-table td {
    padding: 18px;
    background: rgba(255, 255, 255, 0.68);
}

.student-display-row:hover td,
.teachers-admin-table tr:hover td {
    background: rgba(120, 190, 220, 0.08);
}

.students-admin-table th:nth-child(1),
.students-admin-table td:nth-child(1) {
    width: 31%;
}

.students-admin-table th:nth-child(2),
.students-admin-table td:nth-child(2) {
    width: 16%;
}

.students-admin-table th:nth-child(3),
.students-admin-table td:nth-child(3) {
    width: 15%;
}

.students-admin-table th:nth-child(4),
.students-admin-table td:nth-child(4) {
    width: 14%;
}

.students-admin-table th:nth-child(5),
.students-admin-table td:nth-child(5) {
    width: 24%;
}

.teachers-admin-table th:nth-child(1),
.teachers-admin-table td:nth-child(1) {
    width: 31%;
}

.teachers-admin-table th:nth-child(2),
.teachers-admin-table td:nth-child(2) {
    width: 16%;
}

.teachers-admin-table th:nth-child(3),
.teachers-admin-table td:nth-child(3) {
    width: 13%;
}

.teachers-admin-table th:nth-child(4),
.teachers-admin-table td:nth-child(4) {
    width: 18%;
}

.teachers-admin-table th:nth-child(5),
.teachers-admin-table td:nth-child(5) {
    width: 22%;
}

.teacher-management-row td {
    padding: 0 18px 18px;
    background: rgba(255, 255, 255, 0.68);
}

.teacher-management {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(247, 250, 252, 0.74));
}

.teacher-management-card {
    min-width: 0;
}

.teacher-management-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.teacher-management-head h3 {
    margin: 0;
    color: var(--navy);
    font-size: 18px;
}

.teacher-management-head span,
.teacher-assignment-empty {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.teacher-assign-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.teacher-assign-form input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(13, 35, 104, 0.14);
    border-radius: 12px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--navy);
    font: inherit;
    font-weight: 800;
}

.teacher-assign-form button,
.assignment-chips button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.teacher-assign-form button {
    min-height: 44px;
    border-radius: 12px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(13, 35, 104, 0.16);
    white-space: nowrap;
}

.teacher-checklist-form {
    display: grid;
    gap: 12px;
}

.teacher-checklist-form button {
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(13, 35, 104, 0.16);
}

.teacher-list-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(13, 35, 104, 0.14);
    border-radius: 12px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--navy);
    font: inherit;
    font-weight: 800;
}

.teacher-checkbox-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.teacher-checkbox-list.compact {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    max-height: none;
}

.teacher-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border: 1px solid rgba(13, 35, 104, 0.08);
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.80);
    color: var(--navy);
    font-weight: 900;
}

.teacher-checkbox-list.students label {
    align-items: flex-start;
}

.teacher-checkbox-list input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--green);
}

.teacher-checkbox-list span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.teacher-checkbox-list small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.teacher-checkbox-list em {
    margin-inline-start: auto;
    color: var(--green);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.assignment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.assignment-chips form {
    margin: 0;
}

.assignment-chips button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid rgba(13, 35, 104, 0.12);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(13, 35, 104, 0.07);
    color: var(--navy);
}

.assignment-chips button small {
    color: var(--green);
    font-size: 11px;
}

.assignment-chips button span {
    color: #8f1e17;
    font-size: 11px;
}

.assignment-chips.readonly span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid rgba(13, 35, 104, 0.12);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(13, 35, 104, 0.07);
    color: var(--navy);
    font-weight: 900;
}

.assignment-chips.readonly small {
    color: var(--green);
    font-size: 11px;
}

.teacher-assignment-empty {
    margin: 12px 0 0;
}

.admin-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.admin-subject-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 104px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 18px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 252, 0.78));
    box-shadow: 0 14px 34px rgba(7, 18, 53, 0.06);
}

.admin-subject-card div {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.admin-subject-card strong {
    color: var(--navy);
    font-size: 23px;
    line-height: 1.2;
}

.admin-subject-card span {
    width: fit-content;
    border-radius: 999px;
    padding: 5px 11px;
    background: rgba(45, 128, 111, 0.12);
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
}

.admin-subject-card form {
    margin: 0;
    flex: 0 0 auto;
}

.admin-subject-card button {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    background: linear-gradient(135deg, #c0392b, #8f1e17);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.lecture-create-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    margin: 22px 0 18px;
    padding: 18px;
    border: 1px solid rgba(13, 35, 104, 0.12);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.90), rgba(247, 248, 251, 0.82));
    box-shadow: 0 14px 34px rgba(7, 18, 53, 0.07);
}

.lecture-create-form label {
    display: grid;
    gap: 8px;
    color: var(--navy-950);
    font-weight: 800;
}

.schedule-notice {
    margin: 18px 0 0;
    border-radius: 14px;
    padding: 13px 16px;
    font-weight: 900;
    line-height: 1.7;
}

.schedule-notice.success {
    border: 1px solid rgba(45, 128, 111, 0.18);
    background: rgba(45, 128, 111, 0.11);
    color: var(--green);
}

.schedule-notice.error {
    border: 1px solid rgba(192, 57, 43, 0.18);
    background: rgba(192, 57, 43, 0.10);
    color: #8f1e17;
}

.lecture-create-form input,
.lecture-create-form select {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.lecture-students-field {
    grid-column: span 3;
    display: grid;
    gap: 12px;
    align-self: stretch;
    padding: 14px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
}

.teacher-recording-form .recording-url-field {
    grid-column: span 2;
}

.student-picker-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.student-picker-head label {
    margin: 0;
}

.student-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 8px;
}

.student-search-row button,
.lecture-create-form button {
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(13, 35, 104, 0.20);
    white-space: nowrap;
}

.student-picker-count {
    min-height: 46px;
    display: inline-grid;
    place-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(242, 199, 127, 0.28);
    color: var(--navy-950);
    font-weight: 800;
    white-space: nowrap;
}

.student-picker-hint {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.selected-students {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(45, 128, 111, 0.18);
    border-radius: 14px;
    background: rgba(45, 128, 111, 0.08);
}

.selected-students[hidden] {
    display: none;
}

.selected-students strong {
    color: var(--navy);
}

.selected-students [data-selected-list] {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-student-chip {
    min-height: 34px;
    border: 1px solid rgba(45, 128, 111, 0.22);
    border-radius: 999px;
    padding: 0 12px;
    background: white;
    color: var(--green);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.student-picker-list {
    max-height: 240px;
    display: grid;
    gap: 8px;
    padding-inline-end: 4px;
    overflow: auto;
}

.student-picker-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 14px;
    background: rgba(247, 248, 251, 0.78);
    cursor: pointer;
}

.student-picker-item:hover {
    border-color: rgba(45, 128, 111, 0.26);
    background: rgba(120, 190, 220, 0.10);
}

.student-picker-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.student-picker-item span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.student-picker-item strong {
    color: var(--navy);
    overflow-wrap: anywhere;
}

.student-picker-item small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.student-picker-item em {
    color: var(--green);
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.student-picker-empty {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    background: rgba(247, 248, 251, 0.78);
    text-align: center;
    font-weight: 800;
}

.lecture-create-form button {
    align-self: end;
}

.lectures-admin-table {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
}

.lectures-admin-table th,
.lectures-admin-table td {
    padding: 18px;
    background: rgba(255, 255, 255, 0.68);
}

.lectures-admin-table th {
    color: var(--navy);
    background: rgba(13, 35, 104, 0.055);
    font-size: 15px;
}

.lectures-admin-table tr:hover td {
    background: rgba(120, 190, 220, 0.08);
}

.lectures-admin-table form {
    margin: 0;
}

.lecture-cards {
    display: grid;
    gap: 14px;
}

.lecture-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 12px 30px rgba(7, 18, 53, 0.07);
}

.lecture-card h3 {
    margin: 0;
    color: var(--navy);
    font-size: 24px;
}

.lecture-card p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.lecture-recording-inline {
    width: min(460px, 100%);
    aspect-ratio: 16 / 9;
    margin-top: 14px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--navy-950);
}

.lecture-recording-inline iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.room-shell {
    min-height: 100vh;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(13, 35, 104, 0.08), transparent 42%),
        var(--page);
}

.room-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 34px rgba(7, 18, 53, 0.08);
}

.room-topbar h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(28px, 4vw, 46px);
}

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

.video-room {
    height: calc(100vh - 170px);
    min-height: 520px;
    border: 1px solid rgba(13, 35, 104, 0.16);
    border-radius: 20px;
    overflow: hidden;
    background: var(--navy-950);
    box-shadow: 0 24px 70px rgba(7, 18, 53, 0.20);
}

.video-room iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.internal-video-room {
    display: grid;
    grid-template-rows: auto minmax(280px, 1fr) auto auto;
    gap: 16px;
    min-height: 540px;
    padding: 18px;
    border: 1px solid rgba(13, 35, 104, 0.12);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(9, 25, 76, 0.97), rgba(20, 56, 82, 0.96));
    box-shadow: 0 22px 54px rgba(7, 18, 53, 0.18);
}

.video-room-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    color: #fff;
}

.video-room-head h2 {
    margin: 0;
    color: #fff;
    font-size: 25px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    align-content: center;
    min-height: 0;
}

.video-tile {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: #06153d;
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-tile strong {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(2, 10, 32, 0.72);
    color: #fff;
    font-size: 13px;
}

.video-tile.is-audio-only::before {
    content: "مشاهد بدون كاميرا";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 900;
}

.video-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(2, 10, 32, 0.32);
    backdrop-filter: blur(12px);
}

.video-controls .student-action-button {
    min-height: 44px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, var(--navy), var(--green));
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.video-controls .student-action-button.gold,
.video-controls .student-action-button.muted,
.video-controls [data-toggle-fullscreen] {
    color: var(--navy-950);
    background: linear-gradient(135deg, var(--gold), #f6d99c);
    border-color: rgba(255, 255, 255, 0.22);
}

.video-controls .student-action-button:disabled {
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
    cursor: not-allowed;
}

.video-room-note {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.8;
}

.room-denied {
    max-width: 760px;
    margin: 15vh auto 0;
}

.recording-panel,
.recording-viewer {
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 34px rgba(7, 18, 53, 0.08);
}

.recording-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
    gap: 18px;
    align-items: end;
}

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

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

.recording-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1fr) auto;
    gap: 10px;
}

.browser-recorder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(45, 128, 111, 0.18);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(45, 128, 111, 0.10), rgba(242, 199, 127, 0.16));
}

.in-room-recorder {
    margin: 0;
    border-color: rgba(255, 255, 255, 0.13);
    background: rgba(2, 10, 32, 0.34);
    color: #fff;
}

.in-room-recorder strong,
.in-room-recorder .saved-recordings h3 {
    color: #fff;
}

.in-room-recorder span,
.in-room-recorder .saved-recording-row small {
    color: rgba(255, 255, 255, 0.72);
}

.in-room-recorder .saved-recordings {
    border-color: rgba(255, 255, 255, 0.12);
}

.in-room-recorder .saved-recording-row {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
}

.in-room-recorder .saved-recording-row strong {
    color: #fff;
}

.record-button {
    background: linear-gradient(135deg, #b42318, #e45a3c);
}

.internal-video-room:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    padding: 18px;
    border: 0;
    border-radius: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    background: #06153d;
}

.internal-video-room:fullscreen .video-grid {
    min-height: 0;
}

.internal-video-room:fullscreen .video-tile {
    aspect-ratio: auto;
    min-height: 220px;
}

.internal-video-room:fullscreen .video-controls,
.internal-video-room:fullscreen .in-room-recorder {
    position: relative;
    z-index: 3;
}

.browser-recorder strong {
    display: block;
    color: var(--navy);
    font-size: 17px;
    margin-bottom: 4px;
}

.browser-recorder span {
    display: block;
    color: #65738d;
    line-height: 1.7;
}

.recorder-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recorder-download[hidden] {
    display: none;
}

.saved-recordings {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(13, 35, 104, 0.10);
}

.saved-recordings h3 {
    margin: 0;
    color: var(--navy);
    font-size: 18px;
}

.saved-recordings [data-saved-recordings-list] {
    display: grid;
    gap: 8px;
}

.saved-recording-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}

.saved-recording-row strong,
.saved-recording-row small {
    display: block;
}

.saved-recording-row strong {
    color: var(--navy);
}

.saved-recording-row small {
    color: #6f7d95;
    font-weight: 700;
}

.recording-admin-note {
    justify-self: end;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(242, 199, 127, 0.16);
    color: var(--gold);
    font-weight: 900;
    white-space: nowrap;
}

.browser-recorder button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.recording-form input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: white;
    font: inherit;
}

.recording-frame {
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: var(--navy-950);
}

.recording-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.subject-card {
    min-height: 170px;
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 34px rgba(7, 18, 53, 0.08);
    text-decoration: none;
}

.subject-card span {
    width: 52px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--navy), var(--green));
}

.subject-card h3 {
    margin: 0;
    color: var(--navy);
    font-size: 28px;
}

.subject-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.recording-library {
    display: grid;
    gap: 18px;
}

.recording-card {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 34px rgba(7, 18, 53, 0.08);
}

.recording-card h3 {
    margin: 0;
    color: var(--navy);
    font-size: 24px;
}

.recording-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.student-identity {
    display: grid;
    gap: 6px;
}

.student-identity strong {
    color: var(--navy);
    font-size: 18px;
}

.student-identity span {
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.student-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.student-row-actions form {
    margin: 0;
}

.student-action-button {
    min-height: 38px;
    border: 0;
    border-radius: 11px;
    padding: 0 14px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(13, 35, 104, 0.16);
    white-space: nowrap;
}

.student-action-button.gold {
    background: linear-gradient(135deg, var(--gold), #d9a755);
    color: var(--navy-950);
}

.student-action-button.danger {
    background: linear-gradient(135deg, #c0392b, #8f1e17);
}

.student-action-button.muted {
    color: var(--navy);
    background: rgba(13, 35, 104, 0.08);
    border: 1px solid rgba(13, 35, 104, 0.12);
    box-shadow: none;
}

.student-editor-row td {
    padding: 0 18px 18px;
    background: rgba(255, 255, 255, 0.68);
}

.student-editor-row td::before {
    display: none !important;
}

.student-edit-form,
.student-password-form {
    display: grid;
    gap: 12px;
    align-items: end;
    padding: 16px;
    border: 1px solid rgba(13, 35, 104, 0.12);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(13, 35, 104, 0.035), rgba(45, 128, 111, 0.04));
}

.student-edit-form {
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

.student-password-form {
    grid-template-columns: minmax(240px, 380px) auto;
}

.student-edit-form label,
.student-password-form label {
    display: grid;
    gap: 8px;
    color: var(--navy-950);
    font-weight: 800;
}

.student-edit-form input,
.student-edit-form select,
.student-password-form input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    color: var(--ink);
    background: white;
}

.student-form-actions {
    display: flex;
    align-items: end;
    gap: 8px;
}

.countries-wrap {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(7, 18, 53, 0.06);
}

.countries-admin-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.countries-admin-table th:nth-child(1),
.countries-admin-table td:nth-child(1) {
    width: 56%;
}

.countries-admin-table th:nth-child(2),
.countries-admin-table td:nth-child(2) {
    width: 14%;
}

.countries-admin-table th:nth-child(3),
.countries-admin-table td:nth-child(3) {
    width: 30%;
}

.countries-admin-table th {
    padding: 16px 18px;
    color: var(--navy);
    background: rgba(13, 35, 104, 0.055);
    font-size: 15px;
}

.countries-admin-table td {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.62);
}

.countries-admin-table tr:hover td {
    background: rgba(120, 190, 220, 0.08);
}

.country-name-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 74px;
    gap: 10px;
    align-items: center;
}

.country-name-form input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    color: var(--ink);
    background: white;
}

.country-name-form button,
.country-actions button {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    box-shadow: none;
}

.country-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

@media (max-width: 920px) {
    .login-shell,
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: 48vh;
        text-align: center;
        align-items: center;
    }

    .brand-lockup {
        flex-direction: column;
    }

    .dashboard-header,
    .sidebar {
        align-items: flex-start;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-main {
        padding: 22px;
        min-width: 0;
    }

    .countries-admin-table th:nth-child(1),
    .countries-admin-table td:nth-child(1),
    .countries-admin-table th:nth-child(2),
    .countries-admin-table td:nth-child(2),
    .countries-admin-table th:nth-child(3),
    .countries-admin-table td:nth-child(3) {
        width: auto;
    }

    .admin-create-form,
    .teacher-create-form,
    .subject-create-form,
    .lecture-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lecture-students-field,
    .teacher-recording-form .recording-url-field,
    .admin-create-form button,
    .lecture-create-form button {
        grid-column: 1 / -1;
    }

    .sidebar {
        margin: 14px;
        padding: 18px;
    }

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

    .sidebar-nav a {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .brand-panel,
    .login-panel,
    .dashboard-main {
        padding: 22px;
    }

    .brand-glow {
        inset: 12px;
        border-radius: 20px;
    }

    .login-card,
    .dashboard-card,
    .sidebar {
        border-radius: 18px;
    }

    .portal-tabs {
        grid-template-columns: 1fr;
    }

    .section-heading,
    .country-form,
    .admin-create-form,
    .teacher-create-form,
    .subject-create-form,
    .lecture-create-form,
    .lecture-card,
    .room-topbar,
    .recording-panel,
    .recording-form,
    .browser-recorder,
    .recording-card,
    .student-picker-head,
    .student-search-row {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .recorder-actions {
        display: grid;
    }

    .saved-recording-row {
        grid-template-columns: 1fr;
    }

    .country-form button,
    .admin-create-form button,
    .lecture-create-form button,
    .student-search-row button {
        width: 100%;
    }

    .admin-subjects-grid {
        grid-template-columns: 1fr;
    }

    .admin-subject-card {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-subject-card button {
        width: 100%;
    }

    .student-picker-count {
        width: 100%;
    }

    .student-picker-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .student-picker-item em {
        grid-column: 2;
        white-space: normal;
    }

    .countries-wrap {
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .countries-admin-table,
    .countries-admin-table thead,
    .countries-admin-table tbody,
    .countries-admin-table tr,
    .countries-admin-table th,
    .countries-admin-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .countries-admin-table thead {
        display: none;
    }

    .countries-admin-table tr {
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.84);
        box-shadow: 0 10px 28px rgba(7, 18, 53, 0.06);
    }

    .countries-admin-table td {
        padding: 0;
        border-bottom: 0;
        background: transparent;
    }

    .countries-admin-table td + td {
        margin-top: 12px;
    }

    .countries-admin-table td::before {
        display: block;
        margin-bottom: 7px;
        color: var(--muted);
        font-size: 13px;
        font-weight: 800;
    }

    .countries-admin-table td:nth-child(1)::before {
        content: "الدولة";
    }

    .countries-admin-table td:nth-child(2)::before {
        content: "الحالة";
    }

    .countries-admin-table td:nth-child(3)::before {
        content: "الإجراءات";
    }

    .students-wrap {
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .students-admin-table,
    .students-admin-table thead,
    .students-admin-table tbody,
    .students-admin-table tr,
    .students-admin-table th,
    .students-admin-table td,
    .teachers-admin-table,
    .teachers-admin-table thead,
    .teachers-admin-table tbody,
    .teachers-admin-table tr,
    .teachers-admin-table th,
    .teachers-admin-table td,
    .lectures-admin-table,
    .lectures-admin-table thead,
    .lectures-admin-table tbody,
    .lectures-admin-table tr,
    .lectures-admin-table th,
    .lectures-admin-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .students-admin-table thead,
    .teachers-admin-table thead,
    .lectures-admin-table thead {
        display: none;
    }

    .students-admin-table tr,
    .teachers-admin-table tr,
    .lectures-admin-table tr {
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.84);
        box-shadow: 0 10px 28px rgba(7, 18, 53, 0.06);
    }

    .students-admin-table td,
    .teachers-admin-table td,
    .lectures-admin-table td {
        padding: 0;
        border-bottom: 0;
        background: transparent;
        overflow-wrap: anywhere;
    }

    .students-admin-table td + td,
    .teachers-admin-table td + td,
    .lectures-admin-table td + td {
        margin-top: 12px;
    }

    .students-admin-table td::before,
    .teachers-admin-table td::before,
    .lectures-admin-table td::before {
        display: block;
        margin-bottom: 7px;
        color: var(--muted);
        font-size: 13px;
        font-weight: 800;
    }

    .students-admin-table td:nth-child(1)::before {
        content: "الطالب";
    }

    .students-admin-table td:nth-child(2)::before {
        content: "رقم الهاتف";
    }

    .students-admin-table td:nth-child(3)::before {
        content: "الدولة";
    }

    .students-admin-table td:nth-child(4)::before {
        content: "الحالة";
    }

    .students-admin-table td:nth-child(5)::before {
        content: "الإجراءات";
    }

    .teachers-admin-table td:nth-child(1)::before {
        content: "المعلم";
    }

    .teachers-admin-table td:nth-child(2)::before {
        content: "رقم الهاتف";
    }

    .teachers-admin-table td:nth-child(3)::before {
        content: "الحالة";
    }

    .teachers-admin-table td:nth-child(4)::before {
        content: "تاريخ الإضافة";
    }

    .teachers-admin-table td:nth-child(5)::before {
        content: "الإجراءات";
    }

    .teachers-admin-table .teacher-management-row {
        margin-top: -8px;
        padding: 0;
        border-color: rgba(13, 35, 104, 0.08);
        background: transparent;
        box-shadow: none;
    }

    .teachers-admin-table .teacher-management-row td {
        padding: 0;
    }

    .teachers-admin-table .teacher-management-row td::before {
        content: "";
        display: none;
    }

    .teacher-management {
        grid-template-columns: 1fr;
        padding: 12px;
        border-radius: 16px;
    }

    .teacher-assign-form {
        grid-template-columns: 1fr;
    }

    .teacher-assign-form button,
    .assignment-chips button {
        width: 100%;
        justify-content: center;
    }

    .lectures-admin-table td:nth-child(1)::before {
        content: "المحاضرة";
    }

    .lectures-admin-table td:nth-child(2)::before {
        content: "المعلم";
    }

    .lectures-admin-table td:nth-child(3)::before {
        content: "الموعد";
    }

    .lectures-admin-table td:nth-child(4)::before {
        content: "الطلاب";
    }

    .lectures-admin-table td:nth-child(5)::before {
        content: "الغرفة";
    }

    .lectures-admin-table td:nth-child(6)::before {
        content: "الإجراء";
    }

    .students-admin-table .student-editor-row {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .students-admin-table .student-editor-row td {
        padding: 0 0 12px;
    }

    .student-status {
        min-width: 100%;
    }

    .student-edit-form,
    .student-form-actions,
    .student-password-form {
        grid-template-columns: 1fr;
    }

    .student-row-actions,
    .student-form-actions {
        display: grid;
    }

    .student-row-actions form {
        width: 100%;
    }

    .student-action-button {
        width: 100%;
    }

    .country-name-form {
        grid-template-columns: 1fr;
    }

    .country-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .country-actions form,
    .country-actions button {
        width: 100%;
    }

    .country-status {
        min-width: 100%;
    }

    .lecture-card .student-action-button,
    .room-topbar .student-action-button,
    .recording-form .student-action-button {
        width: 100%;
    }

    .room-shell {
        padding: 14px;
    }

    .video-room {
        min-height: 420px;
        height: 68vh;
        border-radius: 16px;
    }
}

.admin-form-grid,
.settings-form {
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 252, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea,
.settings-form input,
.settings-form select,
.settings-form textarea,
.submission-row input,
.submission-row textarea,
.entity-card textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
    padding: 11px 15px;
    border: 1px solid #d7deeb;
    border-radius: 13px;
    background: #fff;
    color: var(--navy-950);
    font: inherit;
    font-weight: 700;
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-form-grid textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus,
.submission-row input:focus,
.submission-row textarea:focus,
.entity-card textarea:focus {
    border-color: rgba(45, 128, 111, 0.58);
    box-shadow: 0 0 0 4px rgba(45, 128, 111, 0.10);
}

.admin-form-grid textarea,
.settings-form textarea,
.submission-row textarea,
.entity-card textarea {
    min-height: 112px;
    resize: vertical;
}

.admin-form-grid .selection-list,
.admin-form-grid textarea,
.admin-form-grid .primary-button {
    grid-column: 1 / -1;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    padding: 0 20px;
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 14px 28px rgba(13, 35, 104, 0.18);
    transition: transform .18s ease, box-shadow .18s ease;
}

.primary-button,
.secondary-button {
    background: linear-gradient(135deg, var(--navy), var(--green));
}

.secondary-button {
    background: linear-gradient(135deg, var(--gold), #d9a755);
    color: var(--navy-950);
}

.danger-button {
    background: linear-gradient(135deg, #c0392b, #8f1e17);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(13, 35, 104, 0.22);
}

.toolbar-form {
    margin-bottom: 18px;
}

.selection-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #d7deeb;
    border-radius: 16px;
    background: #fff;
}

.selection-list label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--navy);
    font-weight: 800;
}

.selection-list label:hover {
    border-color: rgba(45, 128, 111, 0.20);
    background: rgba(45, 128, 111, 0.06);
}

.selection-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: auto;
    accent-color: var(--green);
}

.selection-list small {
    color: #71809b;
    direction: ltr;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.entity-card,
.attendance-card,
.submission-row {
    padding: 20px;
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(18, 39, 85, 0.07);
}

.entity-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.entity-card h3 {
    margin: 0 0 8px;
    color: var(--navy);
    font-size: 22px;
}

.entity-card p,
.entity-card span,
.entity-card small {
    display: block;
    margin: 6px 0;
    color: #697791;
    line-height: 1.75;
}

.entity-card form {
    display: grid;
    gap: 10px;
    min-width: 160px;
}

.entity-card form:not(:only-child) textarea {
    margin-top: 8px;
}

.activity-list,
.backup-list,
.submission-list {
    display: grid;
    gap: 10px;
}

.activity-row,
.backup-list > div {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .8fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid rgba(13, 35, 104, 0.08);
    border-radius: 14px;
    background: #fff;
}

.activity-row strong,
.backup-list strong {
    color: var(--navy);
    font-size: 16px;
}

.activity-row span,
.activity-row small,
.backup-list span {
    color: #6f7d95;
    font-weight: 700;
}

.activity-row p {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid #edf1f6;
    color: #66748f;
}

.settings-form {
    max-width: 760px;
}

.settings-form label {
    display: grid;
    gap: 8px;
    color: var(--navy);
    font-weight: 900;
}

.attendance-card {
    margin-bottom: 16px;
}

.attendance-card h3 {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 14px;
    color: var(--navy);
}

.attendance-card h3 small {
    color: #6c7890;
    font-weight: 700;
}

.attendance-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #edf0f4;
}

.attendance-row span {
    color: var(--navy-950);
    font-weight: 800;
}

.attendance-row select {
    min-height: 42px;
    border: 1px solid #d6ddea;
    border-radius: 11px;
    padding: 6px 10px;
    background: #fff;
    font: inherit;
    font-weight: 800;
}

.submission-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
}

.submission-row strong {
    color: var(--navy);
}

.submission-row span {
    color: #6f7d95;
    font-weight: 800;
}

.submission-row p {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f7f9fc;
    color: #44516a;
}

.success-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 13px;
    background: rgba(45, 128, 111, 0.10);
    color: var(--green);
    font-weight: 900;
}

.subsection-title {
    margin: 30px 0 14px;
    color: var(--navy);
}

@media (max-width: 900px) {
    .admin-form-grid,
    .entity-grid,
    .submission-row {
        grid-template-columns: 1fr;
    }

    .activity-row,
    .backup-list > div {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .entity-card {
        align-items: stretch;
        flex-direction: column;
    }

    .entity-card form,
    .entity-card button,
    .primary-button,
    .secondary-button,
    .danger-button {
        width: 100%;
    }

    .attendance-card h3 {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .attendance-row {
        grid-template-columns: 1fr;
    }

    .selection-list label {
        grid-template-columns: auto 1fr;
    }

    .selection-list small {
        grid-column: 2;
    }
}

@media (max-width: 720px) {
    .internal-video-room {
        min-height: 420px;
        padding: 14px;
        border-radius: 16px;
    }

    .video-room-head,
    .video-controls {
        flex-direction: column;
    }

    .video-controls .student-action-button {
        width: 100%;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .brand-lockup h1,
    .brand-copy h2,
    .dashboard-header h1 {
        font-size: 34px;
    }

    .sidebar-brand {
        width: 100%;
        align-items: center;
    }

    .sidebar-logo {
        width: 54px;
        height: 54px;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .admin-section {
        padding: 16px;
    }

    .section-heading {
        gap: 10px;
    }

    .section-heading h2 {
        font-size: 24px;
    }
}

.students-admin-table .student-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.students-admin-table .student-row-actions form {
    display: inline-flex;
    margin: 0;
}

.students-admin-table button.student-action-button,
.student-edit-form button.student-action-button,
.student-password-form button.student-action-button {
    appearance: none;
    -webkit-appearance: none;
    min-width: 74px;
    min-height: 40px;
    border: 0;
    border-radius: 12px;
    padding: 0 15px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(13, 35, 104, 0.18);
    white-space: nowrap;
}

.students-admin-table button.student-action-button.gold {
    background: linear-gradient(135deg, var(--gold), #d9a755);
    color: var(--navy-950);
}

.students-admin-table button.student-action-button.danger {
    background: linear-gradient(135deg, #c0392b, #8f1e17);
    color: #ffffff;
}

.student-edit-form button.student-action-button.muted,
.student-password-form button.student-action-button.muted {
    border: 1px solid rgba(13, 35, 104, 0.14);
    background: rgba(13, 35, 104, 0.08);
    color: var(--navy);
    box-shadow: none;
}

@media (max-width: 520px) {
    .students-admin-table .student-row-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .students-admin-table .student-row-actions form,
    .students-admin-table button.student-action-button,
    .student-edit-form button.student-action-button,
    .student-password-form button.student-action-button {
        width: 100%;
    }
}

.floating-contact {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 80;
    width: 58px;
    height: 58px;
}

.floating-contact a {
    text-decoration: none;
}

.floating-whatsapp {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #25d366;
    box-shadow: 0 18px 38px rgba(18, 140, 126, 0.28);
    overflow: hidden;
}

.floating-whatsapp img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    transform: scale(1.55);
}

.floating-contact a:hover {
    transform: translateY(-2px);
}

.site-footer {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 24px 18px 28px;
    background: rgba(255, 255, 255, 0.72);
    color: #5f6e86;
    text-align: center;
    font-weight: 700;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--navy);
    font-weight: 900;
    text-decoration: none;
}

.footer-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 6px;
}

.footer-social-country {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.footer-social-country strong {
    color: var(--navy);
    font-weight: 900;
}

.footer-social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer-social-links a {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 24px rgba(7, 18, 53, 0.12);
}

.footer-social-links img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 640px) {
    .floating-contact {
        left: 14px;
        bottom: 14px;
        width: 52px;
        height: 52px;
    }

    .floating-whatsapp {
        width: 52px;
        height: 52px;
    }

    .floating-whatsapp img {
        width: 44px;
        height: 44px;
    }
}

/* Zoom-safe admin tables: keep action buttons reachable when the browser is zoomed in. */
.dashboard-main,
.admin-section {
    min-width: 0;
}

.students-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.students-admin-table {
    min-width: 1080px;
}

.students-admin-table th:nth-child(5),
.students-admin-table td:nth-child(5) {
    width: 280px;
    min-width: 280px;
}

.students-admin-table .student-row-actions {
    justify-content: flex-start;
    align-items: stretch;
    min-width: 240px;
}

.students-admin-table .student-row-actions form {
    flex: 0 0 auto;
}

.students-admin-table button.student-action-button {
    min-width: 112px;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
}

.students-admin-table button.student-action-button.gold {
    min-width: 154px;
}

/* Keep the teacher camera visible while screen sharing. */
.video-tile.is-sharing-screen video[data-local-video] {
    object-fit: contain;
    background: #020a20;
}

.local-camera-preview {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: min(28%, 190px);
    min-width: 120px;
    aspect-ratio: 16 / 10;
    height: auto !important;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 14px;
    object-fit: cover !important;
    background: #06153d;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.local-camera-preview[hidden] {
    display: none !important;
}

.video-tile.is-screen-share video {
    object-fit: contain;
    background: #020a20;
}

/* Fullscreen room focus: keep the camera/screen visible, not the recordings archive. */
.internal-video-room:fullscreen {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    overflow: hidden;
}

.internal-video-room:fullscreen .video-grid {
    align-content: stretch;
    min-height: 0;
    height: 100%;
}

.internal-video-room:fullscreen .video-tile {
    min-height: 0;
    height: 100%;
}

.internal-video-room:fullscreen .video-tile video {
    height: 100%;
}

.internal-video-room:fullscreen .saved-recordings,
.internal-video-room:fullscreen [data-saved-recordings] {
    display: none !important;
}

.internal-video-room:fullscreen .in-room-recorder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
}

.internal-video-room:fullscreen .in-room-recorder > div:first-child {
    min-width: 0;
}

.internal-video-room:fullscreen .in-room-recorder span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.internal-video-room:fullscreen .recorder-actions {
    flex: 0 0 auto;
}

.internal-video-room:fullscreen .video-controls {
    padding: 10px;
}

.in-room-recorder .saved-recordings [data-saved-recordings-list] {
    max-height: 280px;
    overflow-y: auto;
    padding-inline-end: 4px;
}

/* Screen share layout: screen is the main video, teacher camera is a small bottom overlay. */
.video-tile.is-sharing-screen {
    isolation: isolate;
}

.video-tile.is-sharing-screen > video[data-local-video] {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    background: #020a20;
}

.video-tile.is-sharing-screen > .local-camera-preview {
    top: auto !important;
    right: 16px !important;
    bottom: 16px !important;
    z-index: 8;
    width: clamp(112px, 16vw, 180px) !important;
    min-width: 0 !important;
    max-height: 24vh;
    object-fit: cover !important;
    pointer-events: none;
}

.internal-video-room:fullscreen .video-tile.is-sharing-screen > .local-camera-preview {
    right: 18px !important;
    bottom: 18px !important;
    width: clamp(120px, 14vw, 190px) !important;
    max-height: 22vh;
}

/* Remote screen share layout: screen stays large, camera becomes a small bottom tile. */
.video-grid.has-screen-share {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.video-grid.has-screen-share .video-tile.is-screen-share {
    grid-column: 1 / -1;
    min-height: min(62vh, 620px);
    height: 100%;
    z-index: 1;
}

.video-grid.has-screen-share .video-tile.is-screen-share video {
    object-fit: contain !important;
    background: #020a20;
}

.video-grid.has-screen-share .video-tile[data-camera-pip="1"] {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 9;
    width: clamp(112px, 16vw, 180px);
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 10;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.video-grid.has-screen-share .video-tile[data-camera-pip="1"] video {
    object-fit: cover !important;
}

.internal-video-room:fullscreen .video-grid.has-screen-share .video-tile[data-camera-pip="1"] {
    right: 18px;
    bottom: 18px;
    width: clamp(120px, 14vw, 190px);
}

/* Public subject landing page. */
.public-home-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #f7f8fb 0%, #eef3fb 52%, #e9eff8 100%);
    color: var(--navy-950);
}

.public-hero {
    padding: 28px clamp(18px, 5vw, 72px) 76px;
    min-height: 760px;
    background:
        radial-gradient(circle at 18% 18%, rgba(120, 190, 220, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(7, 18, 53, 0.98), rgba(13, 35, 104, 0.96) 58%, rgba(18, 53, 95, 0.98));
    color: #fff;
}

.public-nav,
.public-hero-grid,
.public-content {
    max-width: 1180px;
    margin: 0 auto;
}

.public-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 44px;
}

.public-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    font-weight: 900;
    color: #fff;
}

.public-brand div {
    display: grid;
    gap: 4px;
    text-align: start;
}

.public-brand span {
    color: var(--gold);
    font-size: 15px;
    font-weight: 900;
}

.public-brand strong {
    color: #fff;
    font-size: 34px;
    line-height: 1;
}

.public-brand img {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    object-fit: cover;
}

.public-login-link,
.public-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    color: var(--navy-950);
    background: linear-gradient(135deg, var(--gold), #f7dca4);
    text-decoration: none;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.public-nav .public-login-link {
    position: static;
    transform: none;
}

.public-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 420px);
    gap: clamp(22px, 5vw, 70px);
    align-items: center;
}

.public-hero-copy h1 {
    margin: 8px 0 14px;
    max-width: 820px;
    color: #fff;
    font-size: clamp(48px, 6.8vw, 92px);
    line-height: 1.12;
}

.public-reviews-section {
    display: grid;
    gap: 18px;
    margin-top: 34px;
}

.public-review-success {
    width: fit-content;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(45, 128, 111, 0.18);
    color: #fff;
    font-weight: 900;
}

.public-review-slider {
    width: min(900px, 100%);
    overflow: hidden;
    padding: 4px 0;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.public-review-track {
    display: flex;
    width: max-content;
    gap: 14px;
    animation: reviewMarquee 34s linear infinite;
}

.public-review-card {
    width: 310px;
    min-height: 164px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.public-review-card p {
    margin: 8px 0 12px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 15px;
    line-height: 1.7;
}

.public-review-card strong,
.review-stars {
    color: var(--gold);
    font-weight: 900;
}

.public-review-form {
    width: min(900px, 100%);
    display: grid;
    grid-template-columns: minmax(150px, .8fr) 130px minmax(220px, 1.3fr) auto;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
}

.public-review-form input,
.public-review-form select,
.public-review-form textarea {
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 13px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--navy-950);
    font: inherit;
    font-weight: 800;
}

.public-review-form textarea {
    padding-top: 12px;
    resize: vertical;
}

.public-review-form button {
    min-height: 46px;
    border: 0;
    border-radius: 13px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--gold), #f7dca4);
    color: var(--navy-950);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

@keyframes reviewMarquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(50%);
    }
}

.reviews-admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

.review-admin-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.review-admin-card p {
    margin: 12px 0;
    color: var(--ink);
    line-height: 1.8;
}

.review-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.review-admin-actions form {
    margin: 0;
}

.public-hero-copy p {
    max-width: 660px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 19px;
    line-height: 1.9;
}

.public-feature-panel {
    min-height: 280px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px);
}

.public-feature-panel span {
    display: inline-grid;
    width: 76px;
    height: 76px;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 900;
    font-size: 30px;
}

.public-feature-panel h2 {
    margin: 22px 0 10px;
    color: #fff;
    font-size: 32px;
}

.public-feature-panel p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.8;
}

.public-content {
    padding: 42px clamp(18px, 5vw, 72px);
}

.public-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.public-section-heading h2 {
    margin: 0;
    color: var(--navy);
    font-size: 34px;
}

.public-subject-grid,
.public-teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.public-subject-card,
.public-teacher-card,
.public-empty-state {
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 38px rgba(7, 18, 53, 0.08);
}

.public-subject-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 14px;
    min-height: 235px;
    padding: 26px 20px 22px;
    color: inherit;
    text-decoration: none;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.public-subject-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -64px auto;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(247, 202, 125, 0.20), transparent 70%);
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
    z-index: -1;
}

.public-subject-card:hover,
.public-subject-card.active {
    transform: translateY(-6px);
    border-color: rgba(45, 128, 111, 0.36);
    box-shadow: 0 24px 54px rgba(45, 128, 111, 0.18);
}

.public-subject-card:hover::after,
.public-subject-card.active::after {
    opacity: 1;
    transform: scale(1.08);
}

.public-subject-card span,
.teacher-avatar {
    display: inline-grid;
    width: 92px;
    height: 92px;
    place-items: center;
    border-radius: 26px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, rgba(247, 202, 125, 0.84), rgba(109, 187, 219, 0.62), rgba(45, 128, 111, 0.60)) border-box;
    border: 1px solid transparent;
    color: var(--navy);
    box-shadow: 0 18px 38px rgba(13, 35, 104, 0.12);
}

.public-subject-card span img,
.public-subject-card span svg,
.public-modal-head span img,
.public-modal-head span svg {
    display: block;
    width: 78px;
    height: 78px;
    object-fit: contain;
}

.public-modal-head span img,
.public-modal-head span svg {
    width: 42px;
    height: 42px;
}

.public-subject-card span {
    animation: subjectIconFloat 3.8s ease-in-out infinite;
}

.public-subject-card:nth-child(2n) span {
    animation-delay: .35s;
}

.public-subject-card:nth-child(3n) span {
    animation-delay: .7s;
}

.public-subject-card:hover span,
.public-subject-card.active span {
    animation-duration: 1.6s;
    box-shadow: 0 26px 48px rgba(45, 128, 111, 0.24);
}

.public-subject-card h3,
.public-teacher-card h3 {
    margin: 0;
    color: var(--navy);
    font-size: 25px;
}

.public-subject-card p,
.public-teacher-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-weight: 700;
}

.public-subject-card p {
    max-width: 220px;
}

.public-more-subjects {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 30px;
    padding: 26px clamp(18px, 4vw, 34px);
    border: 1px solid rgba(13, 35, 104, 0.10);
    border-radius: 22px;
    background:
        radial-gradient(circle at 12% 24%, rgba(247, 202, 125, 0.20), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.84));
    box-shadow: 0 18px 44px rgba(7, 18, 53, 0.08);
}

.public-more-subjects h2 {
    margin: 4px 0 0;
    color: var(--navy);
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.4;
}

.teachers-public-section {
    padding-top: 10px;
    padding-bottom: 70px;
}

.public-teacher-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.public-empty-state {
    padding: 24px;
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 760px) {
    .public-nav,
    .public-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .public-hero-grid {
        grid-template-columns: 1fr;
    }

    .public-hero {
        min-height: auto;
        padding-bottom: 46px;
    }

    .public-hero-copy h1 {
        font-size: clamp(42px, 13vw, 62px);
    }

    .public-review-form {
        grid-template-columns: 1fr;
    }

    .public-review-form button {
        width: 100%;
    }

    .public-login-link,
    .public-primary-action {
        width: 100%;
    }

    .public-nav .public-login-link {
        position: static;
        transform: none;
    }

    .public-more-subjects {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }
}

body.modal-open {
    overflow: hidden;
}

.public-home-animated .public-hero,
.public-home-animated .public-content {
    animation: publicFadeUp .75s ease both;
}

.public-home-animated .public-content {
    animation-delay: .12s;
}

.public-floating-panel {
    animation: publicFloat 4.8s ease-in-out infinite;
}

.public-subject-flip {
    position: relative;
    border: 1px solid rgba(13, 35, 104, 0.10);
    cursor: pointer;
    text-align: start;
    transform-style: preserve-3d;
    overflow: hidden;
}

.public-subject-flip::before {
    content: "";
    position: absolute;
    inset: -60% auto auto -30%;
    width: 92px;
    height: 220%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .70), transparent);
    transform: rotate(22deg) translateX(-150%);
    transition: transform .7s ease;
}

.public-subject-flip:hover,
.public-subject-flip:focus-visible {
    transform: translateY(-8px) rotateX(5deg) rotateY(-5deg);
    outline: none;
}

.public-subject-flip:hover::before,
.public-subject-flip:focus-visible::before {
    transform: rotate(22deg) translateX(420%);
}

.public-subject-flip span,
.public-subject-flip h3,
.public-subject-flip p {
    position: relative;
    z-index: 1;
}

.public-teacher-modal[hidden] {
    display: none !important;
}

.public-teacher-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.public-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 15, 45, .58);
    backdrop-filter: blur(7px);
    opacity: 0;
    transition: opacity .24s ease;
}

.public-modal-card {
    position: relative;
    width: min(720px, 100%);
    max-height: min(78vh, 720px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(244,248,255,.96));
    box-shadow: 0 30px 90px rgba(7, 18, 53, .32);
    opacity: 0;
    transform: translateY(20px) scale(.94) rotateX(8deg);
    transition: opacity .24s ease, transform .28s ease;
}

.public-teacher-modal.is-open .public-modal-backdrop,
.public-teacher-modal.is-open .public-modal-card {
    opacity: 1;
}

.public-teacher-modal.is-open .public-modal-card {
    transform: translateY(0) scale(1) rotateX(0);
}

.public-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(13, 35, 104, .10);
    color: var(--navy);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.public-modal-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-inline-start: 42px;
    margin-bottom: 18px;
}

.public-modal-head > span {
    display: inline-grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 18px;
    background: rgba(45, 128, 111, .12);
    color: var(--green);
    font-weight: 900;
}

.public-modal-head h2 {
    margin: 4px 0 0;
    color: var(--navy);
}

.public-modal-head em {
    margin-inline-start: auto;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--navy);
    font-style: normal;
    font-weight: 900;
}

.public-modal-teachers {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

@keyframes publicFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(-1deg);
    }
}

@keyframes subjectIconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-6px) rotate(-1deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .public-home-animated .public-hero,
    .public-home-animated .public-content,
    .public-floating-panel,
    .public-review-track,
    .public-subject-card span {
        animation: none;
    }

    .public-subject-flip,
    .public-modal-card,
    .public-modal-backdrop {
        transition: none;
    }
}

.secure-video-frame {
    position: relative;
    overflow: hidden;
    background: #050f2d;
    user-select: none;
    -webkit-user-select: none;
}

.secure-video-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.secure-video-frame::after {
    content: "تشغيل داخل المنصة";
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(5, 15, 45, .78);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    pointer-events: none;
}

.video-watermark {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    overflow: hidden;
    color: rgba(255, 255, 255, .42);
    font-size: clamp(14px, 2.2vw, 24px);
    font-weight: 900;
    line-height: 2.1;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
    transform: rotate(-18deg);
    animation: watermarkDrift 9s ease-in-out infinite alternate;
}

.video-watermark::before,
.video-watermark::after {
    content: attr(aria-hidden);
    display: none;
}

@keyframes watermarkDrift {
    from {
        transform: translate(-6%, -4%) rotate(-18deg);
    }
    to {
        transform: translate(6%, 5%) rotate(-18deg);
    }
}

.secure-fullscreen-button {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 8;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(13, 35, 104, .88);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .24);
}

.secure-video-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.secure-video-frame:fullscreen iframe {
    height: 100vh;
}

body.policy-modal-open {
    overflow: hidden;
}

.student-policy-modal[hidden] {
    display: none !important;
}

.student-policy-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(4, 13, 42, .68);
    backdrop-filter: blur(8px);
}

.student-policy-card {
    width: min(680px, 100%);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .42);
    background: linear-gradient(135deg, #ffffff, #f6f8ff);
    box-shadow: 0 32px 90px rgba(7, 18, 53, .32);
    animation: policyModalIn .28s ease both;
}

.student-policy-card h2 {
    margin: 6px 0 14px;
    color: var(--navy);
    font-size: clamp(26px, 4vw, 38px);
}

.student-policy-text {
    display: grid;
    gap: 12px;
    margin: 0 0 18px;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.9;
}

.student-policy-text p {
    margin: 0;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(13, 35, 104, .10);
    background: rgba(255, 255, 255, .76);
}

.student-policy-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--navy);
    font-weight: 900;
    cursor: pointer;
}

.student-policy-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--green);
}

.student-policy-accept {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(13, 35, 104, .22);
}

.student-policy-accept:disabled {
    cursor: not-allowed;
    opacity: .48;
    filter: grayscale(.3);
    box-shadow: none;
}

@keyframes policyModalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.admin-recordings-library {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(13, 35, 104, .10);
}

.recording-filter-form,
.admin-recording-edit-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin: 16px 0;
}

.recording-filter-form label,
.admin-recording-edit-form label {
    display: grid;
    gap: 8px;
    color: var(--navy-950);
    font-weight: 800;
}

.recording-filter-form input,
.recording-filter-form select,
.admin-recording-edit-form input,
.admin-recording-edit-form select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.recording-filter-form button,
.admin-recording-edit-form button {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--navy), var(--green));
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.admin-recording-list {
    display: grid;
    gap: 14px;
}

.admin-recording-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(13, 35, 104, .10);
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
}

.admin-recording-summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.admin-recording-summary h3 {
    margin: 4px 0 8px;
    color: var(--navy);
}

.admin-recording-summary p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 900px) {
    .recording-filter-form,
    .admin-recording-edit-form {
        grid-template-columns: 1fr;
    }

    .admin-recording-summary {
        flex-direction: column;
    }
}
