/* ========================================
   أنماط لوحة التحكم والواجهات الداخلية (نسخة مصححة)
   ======================================== */

/* 1) إلغاء توسيط صفحة تسجيل الدخول في الصفحات الداخلية */
.dashboard-body {
    display: block;
    align-items: normal;
    justify-content: normal;
    background-color: #f4f6f9;
    min-height: 100vh;
}

/* 2) الشريط الجانبي: مثبّت على اليمين */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e3a5f 0%, #2d5f8a 100%);
    color: #fff;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: block;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-right: 4px solid #fff;
}

.sidebar-menu i {
    margin-left: 0.5rem;
    width: 20px;
}

/* 3) المحتوى الرئيسي */
.main-content {
    margin-right: 260px;
    transition: margin-right 0.3s ease;
    min-height: 100vh;
}

.top-header {
    background: #fff;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header h4 {
    margin: 0;
    color: #1e3a5f;
}

.user-info {
    color: #6c757d;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* 4) البطاقات والتبويبات والجداول */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

.nav-tabs .nav-link {
    color: #495057;
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
}

.nav-tabs .nav-link.active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    background: transparent;
}

.table thead th {
    border-bottom: 2px solid #1e3a5f;
    font-weight: 600;
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

#sidebarToggle {
    display: none;
}

/* 5) التجاوب مع الشاشات الصغيرة */
@media (max-width: 992px) {
    .sidebar {
        right: -260px;
    }

    .sidebar.show {
        right: 0;
    }

    .main-content {
        margin-right: 0;
    }

    #sidebarToggle {
        display: block;
    }
}

/* ========================================
   سجل الطلبات v2 (مطابق للتصميم المعتمد)
   ======================================== */

.record-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.record-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.head-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #e0e7ff;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.record-head h5 {
    margin: 0;
    font-weight: 800;
    color: #0f172a;
}

.record-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .9rem 1.25rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #f1f5f9;
}

.btn-new {
    background: #4f46e5;
    border: none;
    color: #fff;
    border-radius: 10px;
    padding: .5rem 1rem;
    font-size: .85rem;
    font-weight: 700;
}

.btn-new:hover {
    background: #4338ca;
}

.tool-search {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .5rem .8rem;
    font-size: .83rem;
    min-width: 220px;
}

.tool-filter {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .5rem .6rem;
    font-size: .83rem;
    background: #fff;
}

.records-count {
    margin-inline-start: auto;
    font-size: .8rem;
    color: #475569;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.records-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    padding: .7rem 1rem;
    text-align: start;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.records-table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.records-table tr:hover td {
    background: #fafcff;
}

.sub-text {
    display: block;
    font-size: .72rem;
    color: #64748b;
}

.sub-num {
    color: #16a34a;
    font-weight: 700;
}

/* Status Badges */
.st-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .72rem;
    font-weight: 700;
}

.st-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.st-pending {
    background: #fef9c3;
    color: #a16207;
}

.st-issued {
    background: #dcfce7;
    color: #15803d;
}

.st-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.st-done {
    background: #e0e7ff;
    color: #3730a3;
}

/* Action Buttons */
.act-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 4px;
}

.act-view {
    background: #22d3ee;
    color: #083344;
}

.act-del {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-activate {
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .35rem .7rem;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.btn-activate:hover {
    background: #047857;
}

.btn-activate:disabled {
    background: #a7f3d0;
    color: #334155;
    cursor: not-allowed;
}

.modal-header.indigo {
    background: #4f46e5;
    color: #fff;
}

/* ========================================
   نافذة تسجيل طالب جديد (مطابقة للتصميم)
   ======================================== */

.reg-modal {
    border: none;
    border-radius: 16px;
}

.reg-modal-header {
    background: #fff;
    border-bottom: 1px solid #eef2f7;
}

.reg-modal-header .modal-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    color: #0f172a;
    font-size: .95rem;
}

.reg-modal-header .head-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
}

.reg-section-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-weight: 800;
    color: #1e293b;
    font-size: .85rem;
    margin: 1.2rem 0 .8rem;
}

.reg-section-title::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4f46e5;
}

.reg-modal .modal-body>form>.reg-section-title:first-child {
    margin-top: 0;
}

.req {
    color: #dc2626;
}

.reg-modal .form-label {
    font-size: .8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: .35rem;
}

.reg-modal .form-control,
.reg-modal .form-select {
    border-color: #e2e8f0;
    border-radius: 10px;
    font-size: .85rem;
    padding: .55rem .75rem;
    background: #fbfcfe;
}

.reg-modal-footer {
    background: #fff;
    border-top: 1px solid #eef2f7;
}

.foot-note {
    font-size: .75rem;
    color: #64748b;
    margin-inline-end: auto;
}

.btn-approve {
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .5rem 1.2rem;
    font-weight: 700;
    font-size: .85rem;
}

.btn-approve:hover {
    background: #4338ca;
    color: #fff;
}

/* ملاحظة أسفل عنوان القسم (تظهر عند تعطيل الحقول) */
.section-note {
    font-size: .72rem;
    color: #64748b;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: .35rem .7rem;
    margin: -.3rem 0 .8rem;
}

/* ========================================
   واجهة إضافة المنقولين
   ======================================== */

.head-sub {
    font-size: .75rem;
    color: #64748b;
}

.sub-num-blue {
    color: #2563eb;
    font-weight: 700;
}

.sub-transfer {
    color: #dc2626;
    font-weight: 600;
}

.st-regular {
    background: #e2e8f0;
    color: #334155;
}

/* ========================================
   التجاوب مع الهاتف - واجهة المنقولين
   ======================================== */

/* الخط المعتمد */
body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* بطاقات الهاتف (مخفية على الشاشات الكبيرة) */
.records-cards {
    display: none;
    padding: .9rem;
    gap: .75rem;
    flex-direction: column;
}

.m-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.m-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: .8rem .9rem .6rem;
    gap: .5rem;
}

.m-id strong {
    display: block;
    font-size: .85rem;
    font-weight: 800;
    color: #0f172a;
}

.m-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .4rem;
}

.m-index {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: .7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.m-card-school {
    margin: 0 .9rem .9rem;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    background: #f8fafc;
    padding: .6rem .8rem;
    font-size: .75rem;
    color: #334155;
}

.m-card-school .sub-transfer {
    margin-top: .25rem;
}

/* ---------- الشاشات الصغيرة (هاتف) ---------- */
@media (max-width: 767.98px) {
    .table-responsive {
        display: none;
    }

    .records-cards {
        display: flex;
    }

    .record-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-new {
        width: 100%;
    }

    .tool-search {
        min-width: 0;
        width: 100%;
    }

    .tool-filter {
        width: 100%;
    }

    .records-count {
        margin-inline-start: 0;
        text-align: center;
    }
}

/* إخفاء الترويسة العلوية في وضع الهاتف (حسب المطلوب) */
@media (max-width: 992px) {
    body.page-transferred .top-header {
        display: none;
    }
}

/* ========================================
   نافذة إضافة منقول داخلي (مطابقة للتصميم)
   ======================================== */

.tr-modal {
    border: none;
    border-radius: 16px;
}

.tr-modal-header {
    background: #eef2ff;
    border-bottom: 1px solid #e0e7ff;
}

.tr-modal-header .modal-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 1rem;
}

.tr-sub {
    display: block;
    font-size: .75rem;
    color: #4f46e5;
    margin-top: .2rem;
}

.tr-lookup-row {
    display: flex;
    gap: .5rem;
}

.tr-lookup-row .input-group {
    flex: 1;
}

.btn-verify {
    background: #e2e8f0;
    color: #334155;
    border: none;
    border-radius: 10px;
    padding: .5rem 1.1rem;
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
}

.btn-verify:hover {
    background: #cbd5e1;
}

.tr-readonly {
    background: #f1f5f9;
}

.tr-modal-footer {
    background: #fff;
}

/* ---------- الشاشات الصغيرة (هاتف) ---------- */
@media (max-width: 767.98px) {
    .table-responsive {
        display: none;
    }

    .records-cards {
        display: flex;
    }
}

/* رسالة التحقق أسفل حقل الرقم المدرسي */
.tr-lookup-row {
    flex-wrap: wrap;
}

.lookup-feedback {
    flex: 0 0 100%;
    width: 100%;
    margin-top: .45rem;
    font-size: .75rem;
    font-weight: 700;
    border-radius: 8px;
    padding: .4rem .7rem;
}

.lookup-feedback.error {
    background: #fee2e2;
    color: #b91c1c;
}

/* ========================================
   واجهة إضافة العائدين للدراسة
   ======================================== */

.head-action {
    margin-inline-start: auto;
}

.list-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    color: #0f172a;
    font-size: .9rem;
}

.list-title i {
    color: #4f46e5;
}

.count-pill {
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .72rem;
    font-weight: 700;
}

.sub-blue {
    color: #2563eb;
    font-weight: 600;
}

.act-eye {
    background: #e0e7ff;
    color: #3730a3;
}

.act-eye:hover {
    background: #c7d2fe;
}

/* حالة تجميد زر موافق (نافذة العائدين) */
.btn-approve:disabled,
.btn-approve:disabled:hover {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ========================================
   نافذة معاينة وتعديل الطالب العائد (مطابقة للتصميم)
   ======================================== */

.pv-header {
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.pv-title {
    flex: 1;
    text-align: center;
    margin: 0;
    font-weight: 800;
    color: #0f172a;
    font-size: 1rem;
}

.pv-card {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.pv-label {
    font-size: .72rem;
    color: #64748b;
}

.pv-name {
    font-weight: 800;
    color: #0f172a;
    font-size: 1rem;
    margin-top: .15rem;
}

.pv-divider {
    border-color: #e2e8f0;
    margin: .75rem 0;
}

.pv-value-blue {
    color: #2563eb;
    font-weight: 700;
    font-size: .85rem;
}

.pv-value {
    color: #1e293b;
    font-weight: 600;
    font-size: .85rem;
}

.pv-footer {
    background: #fff;
}

/* قائمة الصفوف المخصّصة داخل نافذة المعاينة (ارتفاع محدود قابل للتمرير) */
.pv-menu {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .25rem;
}

.pv-menu .dropdown-item {
    border-radius: 8px;
    font-size: .85rem;
    padding: .45rem .75rem;
}

.pv-menu .dropdown-item:active,
.pv-menu .dropdown-item.active {
    background: #e0e7ff;
    color: #3730a3;
}

#pvClassBtn {
    background: #fff;
}

/* ========================================
   نافذة تأكيد الحذف (مطابقة للتصميم)
   ======================================== */

.del-modal {
    border: none;
    border-radius: 16px;
}

.del-body {
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
}

.del-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #fef3c7;
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.del-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.05rem;
    margin-bottom: .6rem;
}

.del-message {
    color: #64748b;
    font-size: .85rem;
    line-height: 1.7;
    margin: 0 auto 1.5rem;
    max-width: 380px;
}

.del-message strong {
    color: #0f172a;
}

.del-sub {
    display: block;
    margin-top: .35rem;
    font-size: .75rem;
    color: #94a3b8;
}

.del-actions {
    display: flex;
    gap: .75rem;
}

.del-actions .btn {
    flex: 1;
    border-radius: 10px;
    padding: .6rem 1rem;
    font-weight: 700;
    font-size: .85rem;
}

.del-yes {
    background: #e11d48;
    color: #fff;
}

.del-yes:hover {
    background: #be123c;
    color: #fff;
}

.del-no {
    background: #e2e8f0;
    color: #334155;
}

.del-no:hover {
    background: #cbd5e1;
    color: #334155;
}

/* ========================================
   واجهة تجديد القيد
   ======================================== */

.btn-renew {
    background: #6d5ce7;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .55rem 1.1rem;
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
}

.btn-renew:hover {
    background: #5b4bd5;
}

.btn-renew:disabled,
.btn-renew:disabled:hover {
    background: #c9c3f6;
    color: #fff;
    cursor: not-allowed;
}

.cell-class {
    color: #7c3aed;
    font-weight: 600;
}

.row-chk,
#chkAll {
    accent-color: #6d5ce7;
    width: 17px;
    height: 17px;
}

.st-waiting {
    background: #ffedd5;
    color: #c2410c;
}

.st-renewed {
    background: #dcfce7;
    color: #15803d;
}

.st-notrenewed {
    background: #fee2e2;
    color: #b91c1c;
}

.st-plain {
    background: transparent;
    color: #1e293b;
    padding-inline: 0;
}

.st-plain::before {
    display: none;
}

.has-icon::before {
    display: none;
}

.st-badge i {
    font-size: .8rem;
}

@media (max-width: 992px) {
    body.page-renewal .top-header {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .record-toolbar .btn-renew {
        width: 100%;
    }
}

/* ========================================
   قائمة الهاتف لتجديد القيد (مطابقة للتصميم)
   ======================================== */

.rw-list {
    padding: 0 !important;
    gap: 0 !important;
    border-top: 1px solid #f1f5f9;
}

.rw-head,
.rw-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem .9rem;
    background: #fff;
}

.rw-head {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: .8rem;
    font-weight: 700;
    color: #334155;
}

.rw-row {
    border-bottom: 1px solid #f1f5f9;
}

.rw-main {
    flex: 1;
}

.rw-main strong {
    display: block;
    font-size: .85rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.6;
}

.rw-status {
    width: 40%;
}

.rw-chk {
    align-self: center;
}

.rw-head .rw-chk {
    align-self: flex-start;
}

/* ========================================
   تذييل ترقيم الصفحات
   ======================================== */

.pag-footer {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    background: #fff;
    flex-wrap: wrap;
}

.pag-info {
    font-size: .8rem;
    color: #475569;
}

.pag-info strong {
    color: #4f46e5;
    font-weight: 800;
}

.pag-pages {
    color: #94a3b8;
    font-size: .72rem;
}

.pag-btns {
    margin-inline-start: auto;
    display: flex;
    gap: .5rem;
}

.pag-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .45rem .9rem;
    font-size: .8rem;
    font-weight: 700;
    color: #334155;
}

.pag-btn:hover:not(:disabled) {
    background: #f8fafc;
}

.pag-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* قوائم مخصصة لشريط أدوات تجديد القيد (بدون خروج عن البطاقة) */
.tool-drop-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    width: 100%;
    background: #fff;
}

.tool-menu {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .25rem;
}

.tool-menu .dropdown-item {
    border-radius: 8px;
    font-size: .83rem;
    padding: .45rem .75rem;
}

.tool-menu .dropdown-item.active,
.tool-menu .dropdown-item:active {
    background: #e0e7ff;
    color: #3730a3;
}

@media (max-width: 767.98px) {
    .tool-drop {
        width: 100%;
    }
}

/* ========================================
   تجديد القيد: ألوان وأيقونات وخلفيات مطابقة للصورة
   ======================================== */

/* حالة القيد: نص ملوّن + أيقونة بدون خلفية */
body.page-renewal .st-badge {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: .8rem;
    font-weight: 800;
    gap: .3rem;
}

body.page-renewal .st-badge::before {
    display: none;
}

body.page-renewal .st-badge i {
    font-size: .95rem;
}

body.page-renewal .st-waiting {
    color: #ea580c;
}

/* في انتظار التجديد: برتقالي */
body.page-renewal .st-renewed {
    color: #16a34a;
}

/* مجدد للقيد: أخضر */
body.page-renewal .st-notrenewed {
    color: #dc2626;
}

/* غير مجدد للقيد: أحمر */
body.page-renewal .st-plain {
    color: #1e293b;
}

/* بقية الحالات: داكن بدون أيقونة */

/* مربعات التحديد: مربع بحواف دائرية كما في الصورة */
body.page-renewal .row-chk,
body.page-renewal .chk-all {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    accent-color: #6d5ce7;
}

/* خلفيات الصفوف: أبيض، والترويسة رمادية فاتحة */
body.page-renewal .rw-row {
    background: #fff;
}

body.page-renewal .rw-head {
    background: #f8fafc;
}

/* ========================================
   تجديد القيد: الألوان المعتمدة للنصوص
   ======================================== */

/* الرقم المدرسي: أزرق مميز blue-700 */
body.page-renewal .sub-num-blue {
    color: #1d4ed8;
}

/* الصف: أرجواني أكاديمي purple-800 */
body.page-renewal .cell-class {
    color: #6b21a8;
}

/* الحالة الدراسية: أزرق موحد بدون تلوين ديناميكي */
body.page-renewal .study-label {
    color: rgba(37, 99, 235, .8);
}

/* blue-600/80 */
body.page-renewal .sub-blue {
    color: #1d4ed8;
}

/* ========================================
   واجهة التنازل عن النتيجة
   ======================================== */

body.page-waiver .head-action {
    margin-inline-start: auto;
}

body.page-waiver .list-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    color: #0f172a;
    font-size: .9rem;
}

body.page-waiver .list-title i {
    color: #4f46e5;
}

body.page-waiver .count-pill {
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .72rem;
    font-weight: 700;
}

body.page-waiver .study-label {
    color: rgba(37, 99, 235, .8);
}

body.page-waiver .sub-blue {
    color: #1d4ed8;
}

body.page-waiver .sub-num-blue {
    color: #1d4ed8;
}

@media (max-width: 992px) {
    body.page-waiver .top-header {
        display: none;
    }
}

/* نافذة إضافة متنازل: مطابقة التصميم */
.tr-lookup-row>.form-control {
    flex: 1;
}

.btn-verify:disabled,
.btn-verify:disabled:hover {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ========================================
   نافذة تأكيد حذف المتنازل (مطابقة للتصميم)
   ======================================== */

.del2-body {
    padding: 1.5rem 1.5rem 1.25rem;
}

.del2-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}

.del2-icon {
    color: #e11d48;
    font-size: 1.1rem;
}

.del2-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 800;
    color: #0f172a;
}

.del2-text {
    color: #64748b;
    font-size: .8rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.del2-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
}

.del2-yes {
    background: #e11d48;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .45rem 1.1rem;
    font-size: .8rem;
    font-weight: 700;
}

.del2-yes:hover {
    background: #be123c;
    color: #fff;
}

.del2-no {
    border-radius: 10px;
    padding: .45rem .9rem;
    font-size: .8rem;
    font-weight: 700;
    color: #334155;
}

/* ========================================
   بطاقات الهاتف للتنازل عن النتيجة (مطابقة للتصميم)
   ======================================== */

.wv-card {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: .9rem 1rem;
}

.wv-top {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.wv-index {
    background: #e2e8f0;
    color: #334155;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .45rem;
}

.wv-name {
    flex: 1;
}

.wv-name strong {
    display: block;
    font-size: .85rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.6;
}

.wv-del {
    align-self: flex-start;
}

.wv-divider {
    border-color: #e2e8f0;
    margin: .6rem 0;
}

.wv-grid {
    display: flex;
    gap: .75rem;
}

.wv-col {
    flex: 1;
}

.wv-label {
    font-size: .68rem;
    color: #94a3b8;
}

.wv-value {
    font-size: .8rem;
    font-weight: 700;
    color: #1e293b;
}

.wv-value i {
    color: #475569;
    font-size: .8rem;
}

.wv-study {
    margin-top: .5rem;
    font-size: .72rem;
    color: #2563eb;
    font-weight: 600;
}

/* الهاتف: زر الإضافة بعرض كامل وإخفاء شريط البحث/العدّاد كما في التصميم */
@media (max-width: 767.98px) {
    body.page-waiver .record-head {
        flex-wrap: wrap;
    }

    body.page-waiver .record-head .btn-new {
        width: 100%;
        margin-inline-start: 0;
        margin-top: .75rem;
    }

    body.page-waiver .record-toolbar {
        display: none;
    }
}

/* ========================================
   قائمة المتنازلين - شاشة الكمبيوتر مطابقة للتصميم
   ======================================== */

.wv-list-card {
    padding: 1.25rem;
}

.wv-table {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    overflow: hidden;
}

.wv-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 700;
    color: #1e293b;
}

.wv-status i {
    color: #64748b;
    font-size: .9rem;
}

/* أيقونة الحذف حمراء بدون خلفية كما في التصميم */
body.page-waiver .act-del {
    background: transparent;
    color: #e11d48;
}

body.page-waiver .act-del:hover {
    background: #fee2e2;
}

@media (max-width: 767.98px) {
    .wv-list-card {
        padding: .9rem;
    }
}

/* ========================================
   لوحة التحكم
   ======================================== */

.dash-section-title {
    font-size: .95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 1.25rem 0 .75rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .9rem;
}

.stat-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .6rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.stat-title {
    font-size: .8rem;
    font-weight: 700;
    color: #475569;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.stt-indigo {
    background: #e0e7ff;
    color: #4338ca;
}

.stt-sky {
    background: #e0f2fe;
    color: #0369a1;
}

.stt-emerald {
    background: #d1fae5;
    color: #047857;
}

.stt-violet {
    background: #ede9fe;
    color: #6d28d9;
}

.stt-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.stt-slate {
    background: #f1f5f9;
    color: #475569;
}

.stt-red {
    background: #fee2e2;
    color: #b91c1c;
}

.stt-green {
    background: #dcfce7;
    color: #15803d;
}

.stt-orange {
    background: #ffedd5;
    color: #c2410c;
}

.stt-amber {
    background: #fef3c7;
    color: #b45309;
}

.stt-cyan {
    background: #cffafe;
    color: #0e7490;
}

.stt-rose {
    background: #ffe4e6;
    color: #be123c;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .9rem;
}

.shortcut-card {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: .8rem 1rem;
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    transition: .15s;
}

.shortcut-card:hover {
    border-color: #c7d2fe;
    background: #f8faff;
    color: #3730a3;
}

@media (max-width: 992px) {
    body.page-dashboard .top-header {
        display: none;
    }
}

/* ========================================
   لوحة التحكم: البطاقة التعريفية العلوية
   ======================================== */

.dash-hero {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.dash-eyebrow {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: #4f46e5;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.dash-eyebrow i {
    font-size: .95rem;
}

.dash-school-name {
    margin: 0 0 .35rem;
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
}

.dash-school-code {
    font-size: .78rem;
    color: #64748b;
    font-weight: 600;
}

.dash-school-code strong {
    color: #4f46e5;
    font-weight: 800;
}

.dash-year-box {
    background: #eef2ff;
    border-radius: 14px;
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .9rem;
}

.dash-year-label {
    font-size: .72rem;
    color: #64748b;
    font-weight: 600;
}

.dash-year-value {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.dash-year-icon {
    color: #4f46e5;
    font-size: 1.4rem;
}

@media (max-width: 767.98px) {
    .dash-hero {
        padding: 1.25rem;
    }

    .dash-school-name {
        font-size: 1.3rem;
    }

    .dash-year-box {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========================================
   لوحة التحكم: المقاسات المعتمدة (UX/UI)
   ======================================== */

/* 1) البطاقة التعريفية العلوية: p-6 / rounded-2xl */
.dash-hero {
    padding: 24px;
    border-radius: 16px;
}

.dash-eyebrow {
    font-size: 12px;
}

.dash-school-name {
    font-size: 24px;
}

.dash-school-code {
    font-size: 12px;
}

.dash-year-label {
    font-size: 10px;
}

.dash-year-value {
    font-size: 12px;
    font-weight: 800;
}

/* عنوان القسم بشريط بنفسجي */
.dash-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 1.5rem 0 1rem;
}

.dash-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #6d5ce7;
    border-radius: 4px;
}

/* شبكة الإحصائيات: رئيسية يمين + 6 فرعية */
.dash-stats-grid {
    display: grid;
    grid-template-columns: 1.15fr repeat(3, 1fr);
    gap: 14px;
}

/* 2) بطاقة إجمالي الطلاب بالقوة: p-5 / rounded-2xl / رقم 30px */
.dash-main-card {
    grid-column: 1;
    grid-row: span 2;
    background: #fff;
    border: 1px solid #eef2f7;
    border-inline-end: 5px solid #6d5ce7;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.dmc-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1rem;
}

.dmc-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #e0e7ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.dmc-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.dmc-value-row {
    display: flex;
    align-items: baseline;
    gap: .4rem;
}

.dmc-value {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.dmc-unit {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.dmc-divider {
    border-color: #eef2f7;
    margin: .9rem 0;
}

.dmc-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.dmc-note {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

.dmc-link {
    font-size: 11px;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.dmc-link:hover {
    color: #4338ca;
}

/* 3) البطاقات الفرعية الست: p-3.5 / rounded-xl / رقم 20px */
.sub-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 14px;
}

.sub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .8rem;
}

.sub-title {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
}

.sub-head i {
    font-size: 18px;
}

.sc-green {
    color: #16a34a;
}

.sc-violet {
    color: #7c3aed;
}

.sc-blue {
    color: #2563eb;
}

.sc-teal {
    color: #0d9488;
}

.sc-magenta {
    color: #c026d3;
}

.sc-red {
    color: #dc2626;
}

.sub-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}

.sub-value {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.sub-unit {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

/* 4) بطاقتا الحالة الدراسية العريضتان: p-4 / rounded-xl / رقم 24px */
.dash-wide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.wide-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    border-radius: 12px;
    padding: 16px;
}

.wide-emerald {
    background: #ecfdf5;
}

.wide-rose {
    background: #fdf2f8;
}

.wide-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.wide-emerald .wide-icon {
    background: #d1fae5;
    color: #047857;
}

.wide-rose .wide-icon {
    background: #fce7f3;
    color: #be185d;
}

.wide-text {
    flex: 1;
}

.wide-title {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}

.wide-desc {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
}

.wide-value {
    font-size: 24px;
    font-weight: 800;
}

.wide-emerald .wide-value {
    color: #059669;
}

.wide-rose .wide-value {
    color: #e11d48;
}

/* الاستجابة للشاشات الأصغر */
@media (max-width: 767.98px) {
    .dash-school-name {
        font-size: 20px;
    }
}

@media (max-width: 991.98px) {
    .dash-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dash-main-card {
        grid-column: span 2;
        grid-row: auto;
    }
}

@media (max-width: 767.98px) {
    .dash-stats-grid {
        grid-template-columns: 1fr;
    }

    .dash-main-card {
        grid-column: span 1;
    }

    .dash-wide-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   لوحة التحكم: بطاقات طلبات التسجيل الجديد
   ======================================== */

.req-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.req-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

/* شريط التمييز العلوي 4px */
.req-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
}

.req-amber::before {
    background: #f59e0b;
}

.req-emerald::before {
    background: #10b981;
}

.req-rose::before {
    background: #f43f5e;
}

.req-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .9rem;
}

.req-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.req-icon {
    font-size: 16px;
}

.req-amber .req-icon {
    color: #f59e0b;
}

.req-emerald .req-icon {
    color: #10b981;
}

.req-rose .req-icon {
    color: #f43f5e;
}

.req-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.req-value {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
}

.req-badge {
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 8px;
}

.req-amber .req-badge {
    background: #fffbeb;
    color: #b45309;
}

.req-emerald .req-badge {
    background: #ecfdf5;
    color: #047857;
}

.req-rose .req-badge {
    background: #fff1f2;
    color: #be123c;
}

.req-foot {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

.req-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.req-link i {
    font-size: 12px;
}

.req-link:hover {
    text-decoration: underline;
}

.req-amber .req-link {
    color: #b45309;
}

.req-emerald .req-link {
    color: #047857;
}

.req-rose .req-link {
    color: #be123c;
}

@media (max-width: 767.98px) {
    .req-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   لوحة التحكم: بطاقة القوة والبطاقات الست — المقاسات الهندسية المعتمدة
   ======================================== */

/* الغلاف: بطاقة رئيسية 320px + شبكة فرعية 3 أعمدة، فجوة 16px */
.dash-stats-wrap {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin: 16px 0;
}

.sub-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* البطاقة الرئيسية: إطار نيلي فاتح + شريط رأسي 8px يسار */
.dash-main-card {
    flex: 0 0 320px;
    grid-column: auto;
    grid-row: auto;
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.dash-main-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: #4f46e5;
}

.dmc-head {
    margin-bottom: .9rem;
}

.dmc-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 16px;
}

.dmc-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.dmc-value {
    font-size: 30px;
    font-weight: 900;
    color: #0f172a;
}

.dmc-unit {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
}

.dmc-note {
    font-size: 10px;
    font-weight: 400;
    color: #94a3b8;
}

.dmc-link {
    font-size: 10px;
    font-weight: 700;
}

/* البطاقات الفرعية: ارتفاع موحد 98px وتوزيع عمودي */
.sub-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .8);
    border-radius: 12px;
    padding: 14px;
    height: 98px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.sub-head {
    margin-bottom: 0;
}

.sub-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

.sub-value {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
}

.sub-unit {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}

/* ألوان الأيقونات حسب المواصفة */
.sc-green {
    color: #10b981;
}

.sc-violet {
    color: #4f46e5;
}

.sc-blue {
    color: #0284c7;
}

.sc-teal {
    color: #0d9488;
}

.sc-magenta {
    color: #c026d3;
}

.sc-red {
    color: #e11d48;
}

/* الاستجابة */
@media (max-width: 991.98px) {
    .dash-stats-wrap {
        flex-direction: column;
    }

    .dash-main-card {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .sub-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 479.98px) {
    .sub-grid {
        grid-template-columns: 1fr;
    }

    .sub-card {
        height: auto;
    }
}

/* ========================================
   لوحة التحكم: أبعاد شاشة الهاتف المعتمدة
   ======================================== */

/* خلفية الشاشة رمادي باهت مريح */
body.page-dashboard .content-wrapper {
    background: #f8fafc;
}

@media (max-width: 991.98px) {

    /* البطاقة الرئيسية: عرض 100%، ارتفاع ثابت 164px، هوامش 16px */
    .dash-main-card {
        flex: 1 1 auto;
        width: 100%;
        height: 164px;
        padding: 16px;
        border: 1px solid #e0e7ff;
        border-radius: 16px;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);
    }

    /* البطاقات الست: كرتان بالصف، فجوات 12px، ارتفاع 98px، هوامش 14px */
    .sub-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .sub-card {
        height: 98px;
        padding: 14px;
        border: 1px solid rgba(226, 232, 240, .8);
        border-radius: 12px;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);
    }

    /* الخطوط والألوان على الهاتف */
    .dmc-title {
        font-size: 12px;
        font-weight: 700;
        color: #64748b;
    }

    .dmc-value {
        font-size: 30px;
        font-weight: 900;
        color: #0f172a;
    }

    .dmc-unit {
        font-size: 12px;
        font-weight: 700;
        color: #94a3b8;
    }

    .dmc-note {
        font-size: 10px;
        font-weight: 400;
        color: #94a3b8;
    }

    .dmc-link {
        font-size: 10px;
        font-weight: 700;
        color: #4f46e5;
    }

    .sub-title {
        font-size: 11px;
        font-weight: 700;
        color: #64748b;
    }

    .sub-value {
        font-size: 20px;
        font-weight: 900;
        color: #0f172a;
    }

    .sub-unit {
        font-size: 10px;
        font-weight: 700;
        color: #94a3b8;
    }
}

/* الشاشات الصغيرة جداً: يبقى العمودان والارتفاع الموحد وفق المواصفة */
@media (max-width: 479.98px) {
    .sub-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sub-card {
        height: 98px;
    }
}

/* ========================================
   الاختصارات السريعة: التصميم المعتمد
   ======================================== */

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.shortcut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    height: 112px;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);
    transition: all .15s ease;
}

.qs-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.qs-label {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}

/* صبغات الأيقونات */
.qs-indigo .qs-icon {
    background: #eef2ff;
    color: #4f46e5;
}

.qs-teal .qs-icon {
    background: #f0fdfa;
    color: #0d9488;
}

.qs-sky .qs-icon {
    background: #f0f9ff;
    color: #0284c7;
}

.qs-emerald .qs-icon {
    background: #ecfdf5;
    color: #10b981;
}

.qs-fuchsia .qs-icon {
    background: #fdf4ff;
    color: #c026d3;
}

/* تحويم بلون كل اختصار */
.qs-indigo:hover {
    border-color: #c7d2fe;
    background: rgba(238, 242, 255, .4);
}

.qs-teal:hover {
    border-color: #99f6e4;
    background: rgba(240, 253, 250, .4);
}

.qs-sky:hover {
    border-color: #bae6fd;
    background: rgba(240, 249, 255, .4);
}

.qs-emerald:hover {
    border-color: #a7f3d0;
    background: rgba(236, 253, 245, .4);
}

.qs-fuchsia:hover {
    border-color: #f5d0fe;
    background: rgba(253, 244, 255, .4);
}

/* الهاتف: عمودان وامتداد كامل للخامسة */
@media (max-width: 991.98px) {
    .shortcut-grid {
        grid-template-columns: 1fr 1fr;
    }

    .qs-wide {
        grid-column: span 2;
    }
}

/* ========================================
   القائمة الجانبية: خلفية فاتحة معتمدة (#f1f5f9)
   ======================================== */

.sidebar {
    background: #f1f5f9;
    border-inline-end: 1px solid #e2e8f0;
}

.sidebar .sidebar-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar .sidebar-header h5 {
    color: #0f172a;
}

.sidebar .sidebar-header h5 i {
    color: #4f46e5;
}

.sidebar .sidebar-menu a {
    color: #334155;
    border-radius: 10px;
    margin: .15rem .75rem;
    padding: .6rem .9rem;
}

.sidebar .sidebar-menu a i {
    color: #64748b;
}

.sidebar .sidebar-menu a:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.sidebar .sidebar-menu a:hover i {
    color: #334155;
}

.sidebar .sidebar-menu a.active {
    background: #4f46e5;
    color: #fff;
}

.sidebar .sidebar-menu a.active i {
    color: #fff;
}

/* ========================================
   الترويسة المشتركة (هاتف + كمبيوتر) والقائمة المنسدلة
   ======================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #37307b;
    color: #fff;
    padding: .65rem 1rem;
    border-radius: 14px;
    margin: .75rem;
}

.hdr-menu-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    padding: .25rem .35rem;
    border-radius: 8px;
}

.hdr-menu-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.hdr-office {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.hdr-office strong {
    font-weight: 800;
    font-size: .82rem;
}

.hdr-office span {
    font-size: .72rem;
    color: rgba(255, 255, 255, .85);
}

.hdr-school {
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hdr-avatar {
    margin-inline-start: auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #6d5ce7;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex: 0 0 auto;
}

/* القائمة المنسدلة */
.hdr-menu {
    position: absolute;
    top: calc(100% + .5rem);
    inset-inline-start: .75rem;
    min-width: 240px;
    background: #2f2a63;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    padding: .4rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
    display: none;
    z-index: 1050;
}

.hdr-menu.open {
    display: block;
}

.hdr-menu a {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: rgba(255, 255, 255, .88);
    font-size: .82rem;
    font-weight: 600;
    padding: .55rem .7rem;
    border-radius: 9px;
    text-decoration: none;
}

.hdr-menu a i {
    font-size: .95rem;
    color: rgba(255, 255, 255, .75);
}

.hdr-menu a:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.hdr-menu a.active {
    background: #6d5ce7;
    color: #fff;
}

.hdr-menu a.active i {
    color: #fff;
}

.hdr-menu a.hdr-logout {
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: .3rem;
    border-radius: 0 0 9px 9px;
}

/* الكمبيوتر: شريط كامل بدون استدارة */
@media (min-width: 992px) {
    .app-header {
        margin: 0;
        border-radius: 0;
        padding: .6rem 1.25rem;
    }

    .hdr-menu {
        inset-inline-start: 1rem;
    }
}

/* ========================================
   القائمة الجانبية (Drawer) مطابقة للتصميم
   ======================================== */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    visibility: hidden;
    transition: .25s;
    z-index: 1050;
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(320px, 86vw);
    background: #fff;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -12px 0 30px rgba(15, 23, 42, .18);
}

.drawer.open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #eef2f7;
}

.drawer-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    flex: 0 0 auto;
}

.drawer-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 800;
    color: #0f172a;
}

.drawer-close {
    margin-inline-start: auto;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1rem;
    padding: .25rem;
    border-radius: 8px;
}

.drawer-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.drawer-role {
    padding: 1rem 1.1rem .25rem;
}

.drawer-label {
    font-size: .72rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: .4rem;
}

.drawer-role-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .55rem .8rem;
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
}

.drawer-role-box i {
    color: #475569;
    font-size: .8rem;
}

.drawer-section {
    padding: .9rem 1.1rem .4rem;
    font-size: .72rem;
    color: #64748b;
    font-weight: 600;
}

.drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 .8rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.drawer-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .8rem;
    border-radius: 10px;
    color: #334155;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}

.drawer-nav a i {
    font-size: 1rem;
    color: #64748b;
}

.drawer-nav a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.drawer-nav a.active {
    background: #4f46e5;
    color: #fff;
}

.drawer-nav a.active i {
    color: #fff;
}

.drawer-nav a.drawer-logout {
    border-top: 1px solid #eef2f7;
    border-radius: 0 0 10px 10px;
    margin-top: .4rem;
    color: #be123c;
}

.drawer-nav a.drawer-logout i {
    color: #be123c;
}

.drawer-foot {
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
    padding: .7rem 1rem;
    text-align: center;
    font-size: .68rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ========================================
   الترويسة والقائمة الموحّدتان (جميع الأدوار)
   ======================================== */

:root {
    --hdr-h: 60px;
    --sb-w: 260px;
}

/* الترويسة */
.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--hdr-h);
    z-index: 1060;
    background: #37307b;
    color: #fff;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1rem;
    gap: .75rem;
}

.hdr-user {
    grid-column: 1;
    justify-self: start;
    text-align: start;
    line-height: 1.3;
}

.hdr-user-name {
    display: block;
    font-size: .82rem;
    font-weight: 800;
}

.hdr-logout {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #fda4af;
    font-size: .68rem;
    font-weight: 700;
    text-decoration: none;
}

.hdr-logout:hover {
    color: #fecdd3;
    text-decoration: underline;
}

.hdr-office {
    grid-column: 2;
    justify-self: center;
    text-align: center;
    line-height: 1.3;
}

.hdr-office strong {
    display: block;
    font-size: .85rem;
    font-weight: 800;
}

.hdr-office span {
    display: block;
    font-size: .7rem;
    color: rgba(255, 255, 255, .8);
}

.hdr-menu-btn {
    grid-column: 3;
    justify-self: end;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    padding: .25rem .4rem;
    border-radius: 8px;
}

.hdr-menu-btn:hover {
    background: rgba(255, 255, 255, .12);
}

/* القائمة الجانبية: ثابتة على الكمبيوتر */
.app-sidebar {
    position: fixed;
    top: var(--hdr-h);
    bottom: 0;
    inset-inline-start: 0;
    width: var(--sb-w);
    background: #f1f5f9;
    border-inline-end: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 1050;
}

.side-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}

.side-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    flex: 0 0 auto;
}

.side-title {
    margin: 0;
    font-size: .9rem;
    font-weight: 800;
    color: #0f172a;
}

.side-close {
    margin-inline-start: auto;
    display: none;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: .95rem;
    padding: .25rem;
    border-radius: 8px;
}

.side-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.side-nav {
    flex: 1;
    overflow-y: auto;
    padding: .8rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .8rem;
    border-radius: 10px;
    color: #334155;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
}

.side-nav a i {
    font-size: 1rem;
}

.side-nav a:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.side-nav a.active {
    background: #4f46e5;
    color: #fff;
}

.side-nav a.active i {
    color: #fff !important;
}

.ic-green {
    color: #10b981;
}

.ic-teal {
    color: #0d9488;
}

.ic-violet {
    color: #7c3aed;
}

.ic-blue {
    color: #0284c7;
}

.ic-fuchsia {
    color: #c026d3;
}

.side-bottom {
    border-top: 1px solid #e2e8f0;
}

.side-logout {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: .5rem .8rem;
    padding: .55rem .8rem;
    border-radius: 10px;
    color: #e11d48;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
}

.side-logout i {
    color: #e11d48;
    font-size: .95rem;
}

.side-logout:hover {
    background: #ffe4e6;
}

.side-foot {
    background: #e8edf3;
    padding: .7rem 1rem;
    font-size: .66rem;
    color: #64748b;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
}

.side-foot span {
    display: block;
    color: #94a3b8;
    font-size: .62rem;
}

.side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    visibility: hidden;
    transition: .25s;
    z-index: 1065;
}

.side-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* محتوى الصفحة */
.main-content {
    margin-inline-start: var(--sb-w);
    padding-top: var(--hdr-h);
}

/* الهاتف: Drawer من اليمين */
@media (max-width: 767.98px) {
    .app-sidebar {
        top: 0;
        bottom: 0;
        width: min(320px, 86vw);
        transform: translateX(100%);
        transition: transform .25s ease;
        z-index: 1070;
        box-shadow: -12px 0 30px rgba(15, 23, 42, .18);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .side-close {
        display: inline-flex;
    }

    .main-content {
        margin-inline-start: 0;
    }
}

/* الكمبيوتر: بدون زر ☰ والمستخدم يسار الترويسة */
@media (min-width: 768px) {
    .hdr-menu-btn {
        display: none;
    }

    .hdr-user {
        grid-column: 3;
        justify-self: end;
        text-align: end;
    }
}

/* ========================================
   إصلاح الهيدر: التصاق كامل بالحواف + تمديد الكمبيوتر وتوسيط النص
   ======================================== */

/* ارتفاع الهيدر: 60px هاتف، 78px كمبيوتر — والمتغيرات تتابعه تلقائياً */
:root {
    --hdr-h: 60px;
}

@media (min-width: 768px) {
    :root {
        --hdr-h: 78px;
    }
}

/* 1) التصاق الهيدر بحواف الشاشة يميناً ويساراً في الشاشتين */
.app-header {
    margin: 0 !important;
    border-radius: 0 !important;
    height: var(--hdr-h);
    align-items: center;
    padding: 0 1rem;
}

/* 2) توسيط نص الجهة عمودياً وأفقياً داخل الهيدر */
.hdr-office {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.hdr-office strong {
    display: block;
    font-size: .88rem;
    font-weight: 800;
}

.hdr-office span {
    display: block;
    font-size: .72rem;
    color: rgba(255, 255, 255, .82);
}

.hdr-user {
    align-self: center;
}

.hdr-menu-btn {
    align-self: center;
}

/* تكبير طفيف للنص على الكمبيوتر ليظهر بوضوح داخل الارتفاع الممدد */
@media (min-width: 768px) {
    .hdr-office strong {
        font-size: .95rem;
    }

    .hdr-office span {
        font-size: .78rem;
    }
}

/* مزامنة القائمة الجانبية والمحتوى مع الارتفاع الجديد تلقائياً */
.app-sidebar {
    top: var(--hdr-h);
}

.main-content {
    padding-top: var(--hdr-h);
}

/* ========================================
   تثبيت عناصر الهيدر على صف واحد وتوسيطها عمودياً
   ======================================== */

.app-header {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    height: var(--hdr-h);
    overflow: hidden;
}

/* كل العناصر في الصف الأول نفسه ومتمركزة عمودياً */
.hdr-user,
.hdr-office,
.hdr-menu-btn {
    position: static !important;
    grid-row: 1;
    align-self: center;
    margin: 0;
}

/* الهاتف: المستخدم يمين، الجهة وسط، الزر يسار */
.hdr-user {
    grid-column: 1;
    justify-self: start;
    text-align: start;
}

.hdr-office {
    grid-column: 2;
    justify-self: center;
    text-align: center;
}

.hdr-menu-btn {
    grid-column: 3;
    justify-self: end;
}

/* الكمبيوتر: الزر مخفي والمستخدم ينتقل لليسار */
@media (min-width: 768px) {
    .hdr-menu-btn {
        display: none;
    }

    .hdr-user {
        grid-column: 3;
        justify-self: end;
        text-align: end;
    }
}

/* ========================================
   منع تداخل النوافذ المنبثقة مع الهيدر الثابت:
   الهيدر يبقى ثابتاً وظاهراً، والنافذة تنزل أسفله
   ======================================== */

.modal {
    padding-top: var(--hdr-h);
}

/* إبقاء طبقة التعتيم تحت الهيدر والقائمة حتى يبقيان ظاهرَين وثابتَين */
.modal-backdrop {
    z-index: 1050;
}

/* رسائل خطأ الحقول النصية */
.field-error {
    color: #dc2626;
    font-size: .7rem;
    font-weight: 700;
    margin-top: .25rem;
}

.is-invalid-text {
    border-color: #dc2626 !important;
    box-shadow: none !important;
}

/* ========================================
   توحيد شكل قوائم Select2 مع هوية النظام
   ======================================== */

.select2-container--bootstrap-5 {
    z-index: 1090;
}

.select2-container--bootstrap-5 .select2-selection {
    border-color: #e2e8f0;
    border-radius: 10px;
    font-size: .85rem;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    font-size: .85rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .15);
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
    background: #4f46e5;
    color: #fff;
}

/* ========================================
   لصق قوائم Select2 بحقولها فوق النافذة + تعطيل حقول الوثيقة
   ======================================== */

/* طبقة القوائم فوق النافذة والهيدر حتى تظهر ملتصقة بحقلها */
/* الحاويات المغلقة بلا طبقة: تبقى تحت النافذة والتعتيم */
.select2-container {
    z-index: auto;
}

/* الحاوية المفتوحة فقط تُرفع فوق المحتوى */
.select2-container--open {
    z-index: 1094 !important;
}

/* لوحة الخيارات تبقى فوق كل شيء */
.select2-dropdown {
    z-index: 1095 !important;
}

/* ========================================
   بوابة الأدوار الإدارية (RoleCode 1-3)
   ======================================== */
.role-portal-page {
    --portal-header-height: 76px;
    --portal-sidebar-width: 276px;
    --portal-indigo: #37307b;
    --portal-purple: #5146b8;
    --portal-amber: #f59e0b;
    --portal-text: #162033;
    --portal-muted: #64748b;
    min-height: 100vh;
    margin: 0;
    color: var(--portal-text);
    background: #eef2f7;
    overflow-x: hidden;
}

.portal-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1080;
    min-height: var(--portal-header-height);
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .7rem 1.4rem;
    color: #fff;
    background: var(--portal-indigo);
    box-shadow: 0 6px 20px rgba(30, 24, 80, .16);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    width: fit-content;
    color: #fff;
    text-decoration: none;
}

.portal-brand:hover { color: #fff; }
.portal-brand-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 12px;
    background: rgba(255, 255, 255, .09);
    font-size: 1.25rem;
}
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { font-size: .93rem; font-weight: 900; }
.portal-brand small { margin-top: .06rem; color: rgba(255,255,255,.7); font-size: .69rem; font-weight: 600; }

.portal-account { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.portal-account-copy { min-width: 0; text-align: end; }
.portal-account-copy > strong {
    display: block;
    max-width: 300px;
    overflow: hidden;
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portal-authority-ribbon {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-top: .22rem;
    padding: .15rem .48rem;
    border-inline-start: 3px solid var(--portal-amber);
    color: #fde7b3;
    background: rgba(15, 12, 48, .25);
    font-size: .65rem;
    font-weight: 700;
}
.portal-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #665bd2;
}

.portal-drawer-toggle, .portal-drawer-close {
    display: none;
    border: 0;
    color: inherit;
    background: transparent;
}

.portal-sidebar {
    position: fixed;
    inset: var(--portal-header-height) 0 0 auto;
    z-index: 1060;
    width: var(--portal-sidebar-width);
    display: flex;
    flex-direction: column;
    border-inline-end: 1px solid #dde4ed;
    background: #fff;
}
.portal-sidebar-head { padding: 1.35rem 1.25rem 1.05rem; border-bottom: 1px solid #edf0f5; }
.portal-sidebar-kicker { display: block; margin-bottom: .27rem; color: #8b5e05; font-size: .65rem; font-weight: 800; }
.portal-sidebar-head h2 { margin: 0; color: #243047; font-size: .82rem; font-weight: 900; line-height: 1.55; }
.portal-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; }
.portal-nav-label { display: block; margin: 0 .65rem .55rem; color: #7b8799; font-size: .67rem; font-weight: 700; }
.portal-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 44px;
    margin-bottom: .22rem;
    padding: .65rem .72rem;
    border-inline-start: 3px solid transparent;
    border-radius: 8px;
    color: #465269;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
}
.portal-nav-link > i:first-child { width: 1.2rem; flex: 0 0 auto; color: #717d91; text-align: center; }
.portal-nav-link:hover { color: #272066; background: #f3f2ff; }
.portal-nav-link.active { border-inline-start-color: var(--portal-amber); color: #fff; background: var(--portal-purple); }
.portal-nav-link.active > i { color: #fff; }
.portal-nav-current { margin-inline-start: auto; font-size: .68rem; }
.portal-sidebar-foot { padding: .8rem; border-top: 1px solid #edf0f5; background: #fafbfc; }
.portal-logout {
    width: 100%;
    min-height: 42px;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    color: #be123c;
    background: #fff;
    font-size: .76rem;
    font-weight: 800;
}
.portal-logout:hover { background: #fff1f2; }
.portal-logout:disabled { opacity: .65; cursor: wait; }
.portal-sidebar-foot small { display: block; margin-top: .6rem; color: #8994a5; font-size: .61rem; text-align: center; }

.portal-main { min-height: 100vh; padding: calc(var(--portal-header-height) + 2rem) calc(var(--portal-sidebar-width) + 2rem) 2rem 2rem; }
.portal-content { width: min(100%, 1180px); margin-inline: auto; }
.portal-alert { margin-bottom: 1rem; }
.portal-page-head { display: flex; align-items: center; gap: 1.15rem; margin-bottom: 1.35rem; }
.portal-page-icon {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid #dddaf8;
    border-radius: 14px;
    color: var(--portal-purple);
    background: #fff;
    box-shadow: 0 8px 24px rgba(55, 48, 123, .08);
    font-size: 1.45rem;
}
.portal-breadcrumb { margin: 0 0 .3rem; color: #7c8697; font-size: .68rem; font-weight: 700; }
.portal-page-head h1 { margin: 0; color: #182236; font-size: clamp(1.35rem, 2.4vw, 1.85rem); font-weight: 900; }
.portal-page-head > div > p:last-child { max-width: 720px; margin: .35rem 0 0; color: var(--portal-muted); font-size: .8rem; line-height: 1.7; }

.portal-module-shell {
    position: relative;
    min-height: min(55vh, 510px);
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dfe5ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(20, 29, 48, .06);
}
.portal-module-accent { position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--portal-purple), var(--portal-amber)); }
.portal-module-state { width: min(100% - 2rem, 520px); padding: 3rem 1rem; text-align: center; }
.portal-state-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    border-radius: 50%;
    color: var(--portal-purple);
    background: #efeffd;
    font-size: 1.35rem;
}
.portal-state-kicker { margin: 0 0 .35rem; color: #a76b00; font-size: .67rem; font-weight: 900; }
.portal-module-state h2 { margin: 0; color: #1f2b3e; font-size: 1.12rem; font-weight: 900; }
.portal-module-state > p:not(.portal-state-kicker) { margin: .65rem auto 1rem; color: #68758a; font-size: .78rem; line-height: 1.8; }
.portal-security-note {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .7rem;
    border: 1px solid #e5e7f5;
    border-radius: 8px;
    color: #514a87;
    background: #f8f8ff;
    font-size: .68rem;
    font-weight: 700;
}

.portal-brand:focus-visible, .portal-drawer-toggle:focus-visible, .portal-drawer-close:focus-visible,
.portal-nav-link:focus-visible, .portal-logout:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 3px;
}

.portal-drawer-backdrop { display: none; }

@media (max-width: 767.98px) {
    .role-portal-page { --portal-header-height: 68px; }
    .portal-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: .55rem; padding: .55rem .7rem; }
    .portal-drawer-toggle {
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border-radius: 9px;
        font-size: 1.35rem;
    }
    .portal-drawer-toggle:hover { background: rgba(255,255,255,.1); }
    .portal-brand { gap: .45rem; min-width: 0; }
    .portal-brand-mark { width: 36px; height: 36px; border-radius: 9px; font-size: 1rem; }
    .portal-brand strong { font-size: .76rem; }
    .portal-brand small { font-size: .59rem; }
    .portal-account-copy > strong { max-width: 100px; font-size: .7rem; }
    .portal-authority-ribbon { max-width: 115px; overflow: hidden; font-size: .56rem; text-overflow: ellipsis; white-space: nowrap; }
    .portal-avatar { display: none; }
    .portal-sidebar {
        inset: 0 0 0 auto;
        z-index: 1095;
        width: min(310px, 88vw);
        transform: translateX(105%);
        transition: transform .22s ease;
        box-shadow: -14px 0 34px rgba(15, 23, 42, .22);
    }
    .portal-sidebar.open { transform: translateX(0); }
    .portal-sidebar-head { display: flex; align-items: flex-start; gap: .75rem; }
    .portal-sidebar-head > div { min-width: 0; }
    .portal-drawer-close { width: 38px; height: 38px; margin-inline-start: auto; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #667085; }
    .portal-drawer-close:hover { color: #222b3b; background: #eef1f5; }
    .portal-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1090;
        display: block;
        background: rgba(15, 23, 42, .5);
    }
    .portal-drawer-backdrop[hidden] { display: none; }
    .portal-drawer-open { overflow: hidden; }
    .portal-main { padding: calc(var(--portal-header-height) + 1.3rem) 1rem 1.3rem; }
    .portal-page-head { align-items: flex-start; gap: .8rem; }
    .portal-page-icon { width: 48px; height: 48px; border-radius: 11px; font-size: 1.15rem; }
    .portal-page-head h1 { font-size: 1.2rem; line-height: 1.45; }
    .portal-page-head > div > p:last-child { font-size: .73rem; }
    .portal-module-shell { min-height: 430px; }
    .portal-module-state { padding: 2rem .6rem; }
}

@media (max-width: 374.98px) {
    .portal-brand small { display: none; }
    .portal-account-copy > strong { max-width: 76px; }
    .portal-authority-ribbon { max-width: 82px; }
    .portal-main { padding-inline: .72rem; }
    .portal-security-note { align-items: flex-start; text-align: start; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-sidebar { transition: none; }
}

/* ========================================
   واجهة المصادقة الموحدة
   ======================================== */

.auth-page {
    --auth-indigo: #3d348b;
    --auth-indigo-dark: #292268;
    --auth-accent: #f4b740;
    --auth-ink: #18162b;
    --auth-muted: #69667a;
    --auth-line: #dedcea;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--auth-ink);
    background:
        radial-gradient(circle at 12% 14%, rgba(98, 87, 190, .18), transparent 28rem),
        linear-gradient(145deg, #f5f4fb 0%, #e9edf7 100%);
}

.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .28;
    background-image: linear-gradient(rgba(61, 52, 139, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(61, 52, 139, .05) 1px, transparent 1px);
    background-size: 34px 34px;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(100% - 2rem, 470px);
    min-height: 100vh;
    min-height: 100dvh;
    margin-inline: auto;
    padding-block: clamp(1.5rem, 7vh, 4.5rem) 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(61, 52, 139, .12);
    border-radius: 18px;
    box-shadow: 0 24px 65px rgba(41, 34, 104, .16), 0 3px 12px rgba(41, 34, 104, .08);
}

.auth-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.65rem 1.75rem;
    color: #fff;
    background: var(--auth-indigo);
    border-bottom: 4px solid var(--auth-accent);
}

.auth-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 8% 12%, rgba(255, 255, 255, .15), transparent 38%);
    pointer-events: none;
}

.auth-identity {
    position: relative;
    z-index: 1;
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: #fff;
}

.auth-identity span {
    position: absolute;
    inset-inline-end: -1px;
    inset-block-end: 1px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    color: var(--auth-indigo-dark);
    background: var(--auth-accent);
    border: 2px solid var(--auth-indigo);
    border-radius: 50%;
    font-size: .82rem;
}

.auth-header>div:last-child {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.auth-eyebrow {
    margin: 0 0 .22rem;
    color: #f4d98b;
    font-size: .76rem;
    font-weight: 700;
}

.auth-header h1 {
    margin: 0;
    font-size: clamp(1.35rem, 5vw, 1.65rem);
    font-weight: 800;
}

.auth-subtitle {
    margin: .35rem 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: .8rem;
}

.auth-body { padding: 1.75rem; }

.auth-page .form-label {
    margin-bottom: .45rem;
    color: #29263d;
    font-size: .88rem;
    font-weight: 700;
}

.auth-input-group .form-control,
.auth-page .modal-body>.form-control,
.auth-page .modal-body>div>.form-control {
    min-height: 48px;
    border-color: var(--auth-line);
    box-shadow: none;
}

.auth-input-group .input-group-text {
    min-width: 46px;
    justify-content: center;
    color: var(--auth-indigo);
    background: #f5f4fb;
    border-color: var(--auth-line);
}

.auth-page .form-control:focus,
.auth-password-toggle:focus-visible {
    border-color: var(--auth-indigo);
    box-shadow: 0 0 0 .22rem rgba(61, 52, 139, .16);
}

.auth-password-toggle {
    min-width: 46px;
    color: var(--auth-indigo);
    background: #f5f4fb;
    border: 1px solid var(--auth-line);
    border-radius: 0;
}

.auth-password-toggle:hover { color: #fff; background: var(--auth-indigo); }

.auth-submit {
    min-height: 48px;
    background: var(--auth-indigo);
    border-color: var(--auth-indigo);
    font-weight: 800;
    box-shadow: 0 7px 16px rgba(61, 52, 139, .2);
}

.auth-submit:hover,
.auth-submit:focus-visible { background: var(--auth-indigo-dark); border-color: var(--auth-indigo-dark); }
.auth-submit:disabled { background: #756eae; border-color: #756eae; opacity: 1; }
.auth-submit .spinner-border { margin-inline-end: .4rem; }

.auth-security-note {
    margin: 1.15rem 0 0;
    color: var(--auth-muted);
    text-align: center;
    font-size: .78rem;
}

.auth-security-note i { margin-inline-end: .25rem; color: #31765b; }
.auth-footer { margin: 1rem 0 0; color: #625f75; text-align: center; font-size: .76rem; }

.auth-alert {
    margin-bottom: 1rem;
    padding: .75rem .9rem;
    border-radius: 9px;
    font-size: .84rem;
}

.auth-change-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(20, 18, 50, .25);
}

/* نافذة اعتماد بيانات الدخول: تصميم مستقل عن نمط بطاقة تسجيل الدخول. */
body.login-reference-page .modal-backdrop.show {
    background-color: rgba(13, 23, 60, .86) !important;
    opacity: 1 !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-reference-page .auth-modal-dialog {
    width: min(calc(100% - 2rem), 840px);
    max-width: 840px;
    margin-inline: auto;
}

.login-reference-page .auth-modal-content {
    overflow: hidden;
    border: 1px solid #e4e9f1;
    border-radius: 20px;
    box-shadow: 0 26px 72px rgba(15, 23, 42, .34);
    background: #fff;
}

.login-reference-page .auth-modal-header {
    min-height: 89px;
    align-items: center;
    gap: .8rem;
    padding: 1.15rem 1.45rem;
    color: #172033;
    background: rgba(249, 251, 254, .98);
    border: 0;
    border-bottom: 1px solid #e7ebf1;
}

.login-reference-page .auth-modal-icon {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    color: #284fbe;
    background: #e9efff;
    border-radius: 13px;
    font-size: 1.15rem;
}

.login-reference-page .auth-modal-header .modal-title {
    color: #172033;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: 1.34rem;
    font-weight: 800;
    line-height: 1.35;
}

.login-reference-page .auth-modal-header p {
    margin: .16rem 0 0;
    color: #68758a;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.5;
}

.login-reference-page .auth-modal-close {
    width: 2rem;
    height: 2rem;
    margin-inline-start: auto;
    padding: .5rem;
    opacity: .5;
    transition: opacity .15s ease, background-color .15s ease;
}

.login-reference-page .auth-modal-close:hover,
.login-reference-page .auth-modal-close:focus-visible {
    opacity: .85;
    background-color: #eef2f7;
    box-shadow: 0 0 0 .18rem rgba(40, 79, 190, .14);
}

.login-reference-page .auth-change-modal .modal-body { padding: 1.35rem 1.45rem 1.15rem; }

.login-reference-page .auth-modal-notice {
    gap: .55rem;
    margin-bottom: 1.25rem;
    padding: .72rem .85rem;
    color: #8e2930;
    background: #fff1f2;
    border: 1px solid #f1afb5;
    border-radius: 10px;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.7;
}

.login-reference-page .auth-modal-notice i { color: #c33b45; margin-top: .1rem; }

.login-reference-page .credential-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .95rem 1rem;
}

.login-reference-page .credential-fields-grid > .mb-3,
.login-reference-page .credential-fields-grid > .mb-2 { margin: 0 !important; }

.login-reference-page .auth-change-modal .form-label {
    display: block;
    margin-bottom: .38rem;
    color: #1f2937;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: .84rem;
    font-weight: 700;
}

.login-reference-page .auth-change-modal .form-control,
.login-reference-page .auth-change-modal .auth-input-group {
    min-height: 45px;
    color: #263347;
    background: #fbfcfe;
    border-color: #cbd7e6;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: .84rem;
    font-weight: 400;
}

.login-reference-page .auth-change-modal .form-control::placeholder { color: #9aa7b8; opacity: 1; }

.login-reference-page .auth-change-modal .form-control:focus,
.login-reference-page .auth-change-modal .auth-input-group:focus-within {
    position: relative;
    z-index: 1;
    border-color: #416ad1;
    box-shadow: 0 0 0 .19rem rgba(65, 106, 209, .15);
}

.login-reference-page .auth-change-modal .auth-input-group {
    overflow: hidden;
    border: 1px solid #cbd7e6;
    border-radius: .62rem;
}

.login-reference-page .auth-change-modal .credential-fields-grid > div > .form-control {
    border-radius: .62rem;
}

.login-reference-page .auth-change-modal .auth-input-group .form-control {
    min-height: 43px;
    border: 0 !important;
    box-shadow: none;
}

.login-reference-page .auth-change-modal .auth-password-toggle {
    min-width: 43px;
    color: #7c8da5;
    background: #fbfcfe;
    border: 0;
    border-radius: 0;
}

.login-reference-page .auth-change-modal .auth-password-toggle:hover { color: #284fbe; background: #eff4ff; }

.login-reference-page .auth-change-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    direction: rtl;
    flex-direction: row;
    gap: .6rem;
    padding: 1rem 1.45rem 1.15rem;
    background: #fff;
    border: 0;
    border-top: 1px solid #e8edf3;
}

.login-reference-page .auth-change-modal .auth-submit {
    width: auto;
    min-width: 214px;
    min-height: 44px;
    padding-inline: 1.25rem;
    border-radius: .62rem;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: .9rem;
    font-weight: 700;
    background: #2d5bd1;
    border-color: #2d5bd1;
    box-shadow: 0 7px 15px rgba(45, 91, 209, .2);
}

.login-reference-page .auth-change-modal .auth-submit:disabled {
    color: #fff;
    background: #aebbd0;
    border-color: #aebbd0;
    box-shadow: none;
}

.login-reference-page .auth-cancel {
    min-height: 44px;
    padding-inline: .7rem;
    color: #627087;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: .88rem;
    font-weight: 600;
    direction: rtl;
}

.login-reference-page .auth-change-modal .auth-submit { direction: rtl; }

.login-reference-page .auth-cancel:hover,
.login-reference-page .auth-cancel:focus-visible { color: #254db2; background: #eef3ff; }

.auth-modal-header {
    justify-content: flex-start;
    gap: .85rem;
    color: #fff;
    background: var(--auth-indigo);
    border: 0;
    border-bottom: 4px solid var(--auth-accent);
}

.auth-modal-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    color: var(--auth-indigo-dark);
    background: var(--auth-accent);
    border-radius: 12px;
    font-size: 1.25rem;
}

.auth-modal-header .modal-title { font-size: 1.1rem; font-weight: 800; }
.auth-modal-header p { margin: .22rem 0 0; color: rgba(255, 255, 255, .74); font-size: .76rem; }
.auth-change-modal .modal-body { padding: 1.35rem 1.5rem .75rem; }
.auth-change-modal .modal-footer { padding: .75rem 1.5rem 1.35rem; border: 0; }
.auth-modal-notice { display: flex; gap: .5rem; align-items: flex-start; font-size: .82rem; }

@media (max-width: 380px) {
    .auth-shell { width: min(100% - 1rem, 470px); padding-block: .5rem; }
    .auth-card { border-radius: 14px; }
    .auth-header { gap: .7rem; padding: 1.15rem 1rem; }
    .auth-identity { width: 52px; height: 52px; flex-basis: 52px; font-size: 2.1rem; }
    .auth-identity span { width: 23px; height: 23px; font-size: .68rem; }
    .auth-body { padding: 1.2rem 1rem; }
    .auth-change-modal .modal-body,
    .auth-change-modal .modal-footer { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *, .auth-page *::before, .auth-page *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* ========================================
   واجهة الدخول المرجعية — مكتب التربية والتعليم
   ======================================== */

.login-reference-page {
    --office-navy: #345d73;
    --office-blue: #2f64e8;
    --office-blue-dark: #244fc2;
    --office-ink: #111827;
    --office-muted: #70809a;
    --office-line: #cfd9e7;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    background: #eef3fa;
}

.login-reference-page::before { display: none; }

.login-reference-page .auth-shell {
    width: min(100% - 2rem, 1120px);
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(1.5rem, 5vh, 4rem) 0 1.35rem;
    justify-content: center;
}

.login-reference-page .auth-card {
    border: 0;
    border-radius: 24px;
    box-shadow: 0 12px 24px rgba(45, 72, 97, .12);
}

.login-reference-page .auth-header {
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 2.5rem 2rem 2.9rem;
    color: #fff;
    text-align: center;
    background: var(--office-navy);
    border: 0;
    border-radius: 24px 24px 0 0;
}

.login-reference-page .auth-header::after { display: none; }

.login-reference-page .auth-identity {
    width: 144px;
    height: 144px;
    flex: 0 0 144px;
    overflow: hidden;
    margin: 0 auto;
    padding: 0;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 5px 14px rgba(15, 38, 52, .14);
}

.login-reference-page .auth-identity img {
    display: block;
    width: 76%;
    height: 76%;
    margin: auto;
    object-fit: contain;
}

.login-reference-page .auth-header-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.login-reference-page .auth-header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.15rem, 3.25vw, 3rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
}

.login-reference-page .auth-subtitle {
    margin: .4rem 0 0;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.login-reference-page .auth-portal-badge {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    margin: 1.35rem 0 0;
    padding: .48rem 1.25rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
}

.login-reference-page .auth-portal-badge i { font-size: .82rem; }

.login-reference-page .auth-body {
    padding: 2.45rem 1.5rem 2.65rem;
    text-align: center;
}

.login-reference-page .auth-form-intro { margin-bottom: 1.45rem; }

.login-reference-page .auth-form-intro h2 {
    margin: 0;
    color: #1f49b5;
    font-size: 1.62rem;
    font-weight: 800;
    line-height: 1.2;
}

.login-reference-page .auth-form-intro p {
    margin: .55rem 0 0;
    color: #71809a;
    font-size: .82rem;
    font-weight: 400;
}

.login-reference-page #loginForm,
.login-reference-page #alertBox { width: min(100%, 480px); margin-inline: auto; text-align: right; }

.login-reference-page .form-label {
    margin-bottom: .38rem;
    color: var(--office-ink);
    font-size: .92rem;
    font-weight: 700;
}

.login-reference-page #loginForm .auth-input-group {
    overflow: hidden;
    border: 1px solid var(--office-line);
    border-radius: .8rem;
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.login-reference-page #loginForm .auth-input-group:focus-within {
    border-color: var(--office-blue);
    box-shadow: 0 0 0 .2rem rgba(47, 100, 232, .15);
}

.login-reference-page .auth-input-group .form-control {
    min-height: 45px;
    color: #25354b;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: .88rem;
    font-weight: 400;
}

.login-reference-page .auth-input-group .form-control::placeholder { color: #94a3b8; opacity: 1; }

.login-reference-page .auth-input-group .input-group-text,
.login-reference-page .auth-password-toggle {
    min-width: 45px;
    color: #90a4bf;
    background: #fff;
    border: 0 !important;
    border-radius: 0;
}

.login-reference-page .auth-password-toggle:hover { color: var(--office-blue); background: #f6f9ff; }

/* يبقى ترتيب عناصر النموذج كما هو، لكن الأيقونات تظهر يسار الحقول بصرياً في RTL. */
.login-reference-page .auth-username-field .form-control { order: 1; }
.login-reference-page .auth-username-field .input-group-text { order: 2; }
.login-reference-page .auth-password-field .input-group-text { display: none; }

.login-reference-page .form-control:focus,
.login-reference-page .auth-password-toggle:focus-visible {
    position: relative;
    z-index: 2;
    box-shadow: none;
}

.login-reference-page .auth-submit {
    min-height: 46px;
    color: #fff;
    background: var(--office-blue);
    border-color: var(--office-blue);
    border-radius: .75rem;
    box-shadow: none;
    font-size: .97rem;
    font-weight: 700;
    letter-spacing: 0;
}

.login-reference-page .auth-submit:hover,
.login-reference-page .auth-submit:focus-visible { background: var(--office-blue-dark); border-color: var(--office-blue-dark); }
.login-reference-page .auth-submit:disabled { background: #7f9be8; border-color: #7f9be8; }

.login-reference-page .auth-footer {
    margin: 1.35rem 0 0;
    color: #91a1bd;
    font-size: .76rem;
    font-weight: 400;
}

@media (max-width: 575.98px) {
    .login-reference-page .auth-shell {
        width: min(100% - 1rem, 430px);
        padding: .55rem 0 .9rem;
        justify-content: flex-start;
    }

    .login-reference-page .auth-card {
        border-radius: 20px;
        box-shadow: 0 8px 18px rgba(45, 72, 97, .13);
    }

    .login-reference-page .auth-header {
        min-height: 343px;
        gap: .9rem;
        padding: 2rem 1.1rem 2.15rem;
        border-radius: 20px 20px 0 0;
    }

    .login-reference-page .auth-identity {
        width: 106px;
        height: 106px;
        flex-basis: 106px;
        padding: 8px;
    }

    .login-reference-page .auth-header h1 {
        max-width: 285px;
        margin-inline: auto;
        font-size: 1.75rem;
        line-height: 1.12;
    }

    .login-reference-page .auth-subtitle { font-size: .76rem; font-weight: 700; }
    .login-reference-page .auth-portal-badge { margin-top: 1.15rem; padding: .42rem 1.05rem; font-size: .68rem; font-weight: 600; }
    .login-reference-page .auth-body { padding: 2rem 1rem 1.75rem; }
    .login-reference-page .auth-form-intro { margin-bottom: 1.25rem; }
    .login-reference-page .auth-form-intro h2 { font-size: 1.48rem; }
    .login-reference-page .auth-form-intro p { font-size: .75rem; font-weight: 400; }
    .login-reference-page .form-label { font-size: .82rem; font-weight: 700; }
    .login-reference-page .auth-input-group .form-control { min-height: 42px; font-size: .8rem; }
    .login-reference-page .auth-input-group .input-group-text,
    .login-reference-page .auth-password-toggle { min-width: 42px; }
    .login-reference-page .auth-submit { min-height: 42px; font-size: .9rem; font-weight: 700; }
    .login-reference-page .auth-footer { margin-top: 1rem; font-size: .67rem; }
}

@media (max-width: 575.98px) {
    .login-reference-page .auth-modal-dialog {
        width: min(calc(100% - 1rem), 520px);
        margin-inline: auto;
    }

    .login-reference-page .auth-modal-header {
        min-height: 68px;
        gap: .65rem;
        padding: .7rem 1rem;
    }

    .login-reference-page .auth-modal-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; font-size: 1rem; }
    .login-reference-page .auth-modal-header .modal-title { font-size: 1.1rem; }
    .login-reference-page .auth-modal-header p { font-size: .72rem; }
    .login-reference-page .auth-modal-close { width: 1.8rem; height: 1.8rem; }
    .login-reference-page .auth-change-modal .modal-body { padding: .78rem 1rem .7rem; }
    .login-reference-page .auth-modal-notice { margin-bottom: .7rem; padding: .5rem .7rem; font-size: .74rem; line-height: 1.55; }
    .login-reference-page .credential-fields-grid { grid-template-columns: 1fr; gap: .58rem; }
    .login-reference-page .auth-change-modal .form-label { margin-bottom: .25rem; font-size: .79rem; }
    .login-reference-page .auth-change-modal .form-control,
    .login-reference-page .auth-change-modal .auth-input-group { min-height: 41px; font-size: .79rem; }
    .login-reference-page .auth-change-modal .auth-input-group .form-control { min-height: 40px; }

    .login-reference-page .auth-change-modal .modal-footer {
        gap: .35rem;
        padding: .65rem 1rem .78rem;
    }

    .login-reference-page .auth-change-modal .auth-submit { min-width: 164px; flex: 0 1 auto; padding-inline: .7rem; font-size: .82rem; }
    .login-reference-page .auth-cancel { padding-inline: .45rem; font-size: .8rem; }
}

.role-dashboard-shell { width: min(100% - 2rem, 520px); }
.role-dashboard-card .auth-body { text-align: center; }
.role-welcome-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto .75rem;
    display: grid;
    place-items: center;
    color: var(--auth-indigo);
    background: #efedf9;
    border: 1px solid #dcd8f2;
    border-radius: 18px;
    font-size: 2rem;
}
.role-welcome-label { margin: 0 0 .2rem; color: var(--auth-muted); font-size: .83rem; }
.role-user-name { margin: 0; color: var(--auth-ink); font-size: 1.35rem; font-weight: 800; }
.role-name-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .7rem;
    padding: .4rem .7rem;
    color: var(--auth-indigo-dark);
    background: #f0eefb;
    border: 1px solid #dcd8f2;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
}
.role-dashboard-divider { margin: 1.45rem 0 1rem; border-color: var(--auth-line); opacity: 1; }
.role-dashboard-note { margin-bottom: 1rem; color: var(--auth-muted); font-size: .82rem; }
.role-logout { min-height: 46px; font-weight: 700; }
.role-logout .spinner-border { margin-inline-end: .35rem; }

/* Viewport-safe dropdowns. The native select remains the source of truth while
   the visible popup is fixed to its field so modal/table overflow cannot detach it. */
.anchored-select-native {
    display: none !important;
}

.anchored-select-trigger {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    width: 100%;
    min-width: 0;
    text-align: start;
    direction: rtl;
    background-image: none !important;
}

.anchored-select-trigger::after {
    display: none !important;
}

.anchored-select-trigger:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .2);
    outline-offset: 1px;
    border-color: #6366f1 !important;
}

.anchored-select-trigger:disabled,
.anchored-select-trigger.disabled {
    cursor: not-allowed;
    opacity: .65;
}

.anchored-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.anchored-select-chevron {
    flex: 0 0 auto;
    width: .55rem;
    height: .55rem;
    border-inline-end: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .65;
    transition: transform .16s ease;
}

.anchored-select-trigger[aria-expanded="true"] .anchored-select-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.anchored-select-popup {
    z-index: 1105;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: .3rem;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
    scrollbar-width: thin;
    direction: rtl;
    box-sizing: border-box;
}

.anchored-select-popup[hidden] {
    display: none !important;
}

.anchored-select-option {
    display: block;
    width: 100%;
    padding: .62rem .75rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #1e293b;
    font: inherit;
    line-height: 1.45;
    text-align: start;
    direction: rtl;
    cursor: pointer;
}

.anchored-select-option:hover,
.anchored-select-option.is-active {
    background: #eef2ff;
    color: #3730a3;
}

.anchored-select-option.is-selected {
    background: #4f46e5;
    color: #fff;
    font-weight: 700;
}

.anchored-select-option:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.viewport-dropdown-menu {
    z-index: 1105 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    box-sizing: border-box !important;
}

.select2-dropdown {
    max-width: calc(100vw - 16px) !important;
    overflow: hidden;
}

.select2-results__options {
    max-height: min(16rem, calc(100dvh - 140px)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

@media (max-width: 575.98px) {
    .anchored-select-popup,
    .viewport-dropdown-menu {
        max-width: calc(100vw - 16px) !important;
    }

    .anchored-select-option {
        padding-block: .7rem;
    }
}

/* حقول الوثيقة المعطّلة للصف الأول أساسي */
.doc-disabled,
.doc-disabled:disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #eef2f7 !important;
    cursor: not-allowed;
}

/* ========================================
   منتقي تاريخ الميلاد
   ======================================== */

.dp-group .dp-toggle {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #4f46e5;
    border-radius: 10px;
}

.dp-panel {
    position: absolute;
    z-index: 1096;
    width: 262px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .6rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .15);
}

.dp-head {
    display: flex;
    gap: .4rem;
    margin-bottom: .5rem;
}

.dp-head .form-select {
    font-size: .75rem;
    padding: .3rem .5rem;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.dp-wd {
    font-size: .6rem;
    color: #94a3b8;
    font-weight: 700;
    padding: .15rem 0;
}

.dp-day {
    border: none;
    background: transparent;
    font-size: .72rem;
    font-weight: 600;
    color: #334155;
    border-radius: 8px;
    padding: .3rem 0;
}

.dp-day:hover {
    background: #eef2ff;
    color: #3730a3;
}

/* ========================================
   نافذة تسجيل طالب جديد على الهاتف: شبكة عمودين كما في التصميم
   ======================================== */

@media (max-width: 767.98px) {

    /* الاسم بعرض كامل، وبقية الحقول نصفين متجاورين */
    #newRegistrationForm .col-md-8 {
        flex: 0 0 100%;
        width: 100%;
    }

    #newRegistrationForm .col-md-4,
    #newRegistrationForm .col-md-3 {
        flex: 0 0 50%;
        width: 50%;
        padding-right: 6px;
        padding-left: 6px;
    }

    /* النافذة بطاقة مستديرة داخل هوامش الشاشة */
    #newRegModal .modal-dialog {
        margin: 1rem auto;
        max-width: calc(100% - 2rem);
    }

    #newRegModal .modal-content {
        border-radius: 16px;
    }

    #newRegModal .modal-body {
        padding: 1rem;
    }

    /* أحجام مضغوطة تناسب 360px */
    #newRegModal .form-label {
        font-size: .72rem;
        margin-bottom: .25rem;
    }

    #newRegModal .form-control,
    #newRegModal .form-select {
        font-size: .8rem;
        padding: .45rem .6rem;
    }

    #newRegModal .reg-section-title {
        font-size: .8rem;
        margin: .75rem 0 .5rem;
    }

    #newRegModal .modal-footer {
        padding: .6rem .9rem;
    }
}

/* جعل جسم النافذة مرجع تموضع للوحة التقويم */
#newRegModal .modal-body {
    position: relative;
}

/* ========================================
   أزرار رؤوس التقويم وشبكتا الأشهر والسنوات
   ======================================== */

.dp-head-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .3rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 700;
    color: #334155;
    padding: .35rem .5rem;
}

.dp-head-btn i {
    font-size: .6rem;
    color: #64748b;
}

.dp-months,
.dp-years {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.dp-months button,
.dp-years button {
    border: none;
    background: transparent;
    font-size: .72rem;
    font-weight: 600;
    color: #334155;
    border-radius: 8px;
    padding: .45rem 0;
}

.dp-months button:hover,
.dp-years button:hover {
    background: #eef2ff;
    color: #3730a3;
}

.dp-months button.sel,
.dp-years button.sel {
    background: #4f46e5;
    color: #fff;
}

.dp-years-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .4rem;
}

.dp-years-range {
    font-size: .7rem;
    font-weight: 700;
    color: #475569;
}

.dp-nav-btn {
    border: none;
    background: transparent;
    color: #4f46e5;
    border-radius: 8px;
    padding: .2rem .4rem;
}

.dp-nav-btn:hover {
    background: #eef2ff;
}

/* ========================================
   واجهة التسجيل الجديد: مطابقة الشكل والخلفية والألوان للتصميم
   ======================================== */

/* خلفية الصفحة والبطاقة */
.page-registration .content-wrapper {
    background: #f1f5f9;
}

.page-registration .record-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

/* رأس البطاقة */
.page-registration .record-head {
    padding: .9rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.page-registration .record-head .head-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 10px;
}

.page-registration .record-head h5 {
    font-size: .9rem;
    font-weight: 800;
    color: #0f172a;
}

/* شريط الأدوات */
.page-registration .record-toolbar {
    padding: .8rem 1rem;
    gap: .5rem;
}

.page-registration .tool-search {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394a3b8'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/></svg>");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    background-size: .8rem;
}

.page-registration .btn-new {
    background: #4f46e5;
    border: none;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 700;
    padding: .5rem .8rem;
}

.page-registration .tool-filter {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 600;
    color: #334155;
}

.page-registration .records-count {
    font-size: .65rem;
    color: #64748b;
}

.page-registration .records-count strong {
    color: #4f46e5;
}

/* الجدول */
.page-registration .records-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: .68rem;
    font-weight: 800;
    padding: .5rem .6rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-registration .records-table tbody td {
    padding: .6rem;
    border-color: #eef2f7;
}

.page-registration .records-table .cell-name {
    font-size: .78rem;
    font-weight: 800;
    color: #0f172a;
}

.page-registration .records-table .cell-sub {
    font-size: .62rem;
    color: #94a3b8;
}

.page-registration .records-table td:nth-child(4) {
    font-size: .72rem;
    font-weight: 800;
    color: #1e293b;
}

/* أزرار الإجراءات: أيقونات مجردة ملوّنة */
.page-registration .records-table td:nth-child(6) .btn,
.page-registration .records-table td:nth-child(6) button {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.page-registration .records-table i.bi-eye,
.page-registration .records-table i.bi-eye-fill {
    color: #6366f1;
}

.page-registration .records-table i.bi-trash,
.page-registration .records-table i.bi-trash-fill {
    color: #f43f5e;
}

/* ترويسة النظام: اسم المستخدم كهرماني وأيقونة الخروج داخل مربع */
.hdr-user-name {
    color: #fbbf24;
}

.hdr-logout {
    flex-direction: row-reverse;
}

.hdr-logout i {
    background: rgba(255, 255, 255, .14);
    border-radius: 8px;
    padding: .28rem .38rem;
    font-size: .8rem;
}

/* ========================================
   جدول التسجيل الجديد على الهاتف: 4 أعمدة مرئية
   (الحالة وسبب الرفض تحت الصف) مع التفاف كامل للنصوص
   ======================================== */

@media (max-width: 767.98px) {

    .page-registration .table-responsive {
        display: block;
        overflow-x: visible;
    }

    .page-registration #recordsCards {
        display: none !important;
    }

    .page-registration .records-table {
        display: block;
        width: 100%;
    }

    .page-registration .records-table thead,
    .page-registration .records-table tbody {
        display: block;
    }

    .page-registration .records-table tr {
        display: grid;
        grid-template-columns: 32px 1fr 96px 64px;
        gap: 4px;
        align-items: start;
        padding: .4rem .3rem;
        background: #fff;
        border-bottom: 1px solid #eef2f7;
    }

    .page-registration .records-table thead tr {
        background: #f1f5f9;
        align-items: center;
        padding: .5rem .3rem;
        border-bottom: 1px solid #e2e8f0;
    }

    .page-registration .records-table thead th {
        background: #f1f5f9;
        font-size: 10px;
        font-weight: 800;
        color: #475569;
        text-align: right;
        padding: .4rem;
        border: none;
        white-space: normal;
    }

    /* إخفاء عنوان عمود الحالة (تظهر تحت الصف) */
    .page-registration .records-table th:nth-child(4) {
        display: none;
    }

    .page-registration .records-table th:nth-child(1) {
        grid-column: 1;
    }

    .page-registration .records-table th:nth-child(2) {
        grid-column: 2;
    }

    .page-registration .records-table th:nth-child(3) {
        grid-column: 3;
    }

    .page-registration .records-table th:nth-child(5) {
        grid-column: 4;
    }

    .page-registration .records-table tbody td {
        padding: 0;
        border: none;
    }

    .page-registration .records-table td.rt-idx {
        grid-column: 1;
        font-size: 9px;
        font-weight: 600;
        color: #94a3b8;
        padding-top: 2px;
    }

    .page-registration .records-table td.rt-name {
        grid-column: 2;
    }

    .page-registration .records-table td.rt-class {
        grid-column: 3;
        grid-row: 1;
    }

    .page-registration .records-table td.rt-status {
        grid-column: 3;
        grid-row: 2;
    }

    .page-registration .records-table td.rt-actions {
        grid-column: 4;
        grid-row: 1 / span 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .page-registration .records-table .cell-name {
        font-size: 11px;
        font-weight: 800;
        color: #0f172a;
        line-height: 1.3;
    }

    .page-registration .records-table .cell-sub {
        font-size: 9px;
        font-weight: 600;
        color: #64748b;
        margin-top: 2px;
    }

    .page-registration .records-table .cell-id {
        color: #4f46e5;
        font-weight: 700;
    }

    .page-registration .records-table .cell-class {
        font-size: 11px;
        font-weight: 800;
        color: #0f172a;
        line-height: 1.3;
    }

    .page-registration .records-table .cell-status {
        font-size: 9px;
        font-weight: 700;
        margin-top: 2px;
    }

    .page-registration .records-table .cell-reject-reason {
        font-size: 9px;
        font-weight: 600;
        color: #64748b;
        margin-top: 2px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .page-registration .records-table td.rt-actions .btn,
    .page-registration .records-table td.rt-actions button {
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 12px;
        border-radius: 8px;
        background: transparent;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-registration .records-table td.rt-actions .btn-activate span {
        display: none;
    }

    .page-registration .records-table td.rt-actions .btn-activate:not(:disabled) {
        background: #059669;
        color: #fff;
    }

    .page-registration .records-table td.rt-actions .btn-activate:disabled {
        color: #94a3b8;
    }

    .page-registration .pag-footer {
        display: flex;
        margin-top: .5rem;
        padding: .6rem .8rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
    }
}

/* ========================================
   جدول التسجيل الجديد على الكمبيوتر: 5 أعمدة نهائية
   حالة القيد نص ملوّن بدون خلفية + سبب الرفض مرن متعدد الأسطر
   ======================================== */

.page-registration .records-table th:nth-child(1) {
    width: 48px;
}

/* اسم الطالب والصف بنفس اللون الأساسي */
.page-registration .records-table .cell-name {
    font-size: .85rem;
    font-weight: 800;
    color: #0f172a;
}

.page-registration .records-table .cell-class {
    font-size: .85rem;
    font-weight: 800;
    color: #0f172a;
}

/* الرقم المدرسي أصغر وبلون مميز */
.page-registration .records-table .cell-sub {
    font-size: .72rem;
    color: #64748b;
    margin-top: 2px;
}

.page-registration .records-table .cell-id {
    color: #4f46e5;
    font-weight: 700;
}

/* حالة القيد: نص بدون خلفية بلون ثابت لكل حالة */
.page-registration .records-table .cell-status {
    font-size: .8rem;
    font-weight: 800;
    background: transparent !important;
}

.status-pending {
    color: #d97706;
}

.status-review {
    color: #ea580c;
}

.status-issued {
    color: #059669;
}

.status-added {
    color: #4f46e5;
}

.status-reject {
    color: #e11d48;
}

.status-default {
    color: #334155;
}

/* سبب الرفض: أصغر قليلاً، بلون مختلف، يلتف تلقائياً ويرفع ارتفاع الصف */
.page-registration .records-table .cell-reject-reason {
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 2px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.page-registration .records-table td {
    vertical-align: top;
}

/* ========================================
   قوائم شريط الأدوات (الصفوف/الحالات) بعد تحويلها إلى Select2
   ======================================== */

/* الحاوية كبند مرن داخل الشريط بدل عرض 100% من الشريط */
.page-registration .record-toolbar .select2-container {
    width: auto !important;
    flex: 1 1 120px;
    min-width: 0;
}

/* مظهر مطابق لحقول الفلترة */
.page-registration .record-toolbar .select2-selection {
    font-size: .72rem;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-height: 34px;
    padding: .3rem .6rem;
}

.page-registration .record-toolbar .select2-selection__rendered {
    font-size: .72rem;
    color: #334155;
    padding: 0;
}

.page-registration .record-toolbar .select2-selection__arrow {
    display: none;
}

.page-registration .record-toolbar .select2-selection::after {
    content: '\F282';
    /* أيقونة سهم لأسفل من Bootstrap Icons */
    font-family: 'bootstrap-icons';
    font-size: .6rem;
    color: #64748b;
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
}

.page-registration .record-toolbar .select2-selection {
    position: relative;
    padding-left: 1.6rem;
}

/* القائمة المفتوحة: عرض مناسب للهاتف داخل حدود الشاشة */
.select2-container--bootstrap-5 .select2-dropdown {
    max-width: 92vw;
}

/* ========================================
   قوائم شريط الأدوات في التسجيل الجديد بعد تحويلها إلى Select2
   (جميع الصفوف / جميع الحالات)
   ======================================== */

.page-registration .record-toolbar .select2-container {
    width: auto !important;
    flex: 1 1 120px;
    min-width: 0;
}

.page-registration .record-toolbar .select2-selection {
    position: relative;
    min-height: 34px;
    padding: .3rem .6rem .3rem 1.6rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
}

.page-registration .record-toolbar .select2-selection__rendered {
    font-size: .72rem;
    font-weight: 600;
    color: #334155;
    padding: 0 !important;
    line-height: 1.4;
}

.page-registration .record-toolbar .select2-selection__arrow {
    display: none;
}

.page-registration .record-toolbar .select2-selection::after {
    content: '\F282';
    font-family: 'bootstrap-icons';
    font-size: .6rem;
    color: #64748b;
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
}

/* القائمة المفتوحة لا تخرج عن عرض شاشة الهاتف */
.select2-container--bootstrap-5 .select2-dropdown {
    max-width: 92vw;
}

/* خيارات القائمة */
.select2-container--bootstrap-5 .select2-results__option {
    font-size: .8rem;
    padding: .45rem .7rem;
}

/* تمييز الخيار عند المرور */
.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
    background: #4f46e5;
    color: #fff;
}

/* الخيار المحدد */
.select2-container--bootstrap-5 .select2-results__option--selected {
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
}


/* ========================================
   إصلاح فجوة شريط الأدوات على الهاتف:
   «جميع الصفوف» و«جميع الحالات» على صف واحد بدون فراغات
   ======================================== */

@media (max-width: 767.98px) {

    .page-registration .record-toolbar {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem;
        padding: .8rem 1rem;
    }

    .page-registration .record-toolbar>* {
        margin: 0 !important;
    }

    /* الزر والبحث بعرض كامل كل في صفه */
    .page-registration .record-toolbar .btn-new {
        flex: 1 1 100%;
        width: 100%;
    }

    .page-registration .record-toolbar .tool-search {
        flex: 1 1 100%;
        width: 100%;
    }

    /* القائمتان جنباً إلى جنب بدون فجوة */
    .page-registration .record-toolbar .select2-container {
        flex: 1 1 calc(50% - .25rem);
        width: auto !important;
        min-width: 0;
    }

    .page-registration .record-toolbar .records-count {
        flex: 1 1 100%;
        text-align: center;
    }

    /* احتياط: إخفاء أي select أصلي بقي داخل التدفق */
    .page-registration .record-toolbar select.select2-hidden-accessible {
        display: none !important;
    }
}

/* سجل التسجيل الجديد: مطابقة البطاقة والجدول المرجعيين */
.page-registration .record-card {
    border-radius: 11px;
    box-shadow: 0 1px 3px rgb(15 23 42 / 0.05);
}

.page-registration .record-head {
    min-height: 55px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.page-registration .record-head .head-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
}

.page-registration .record-head h5 {
    font-size: 15px;
    font-weight: 800;
}

.page-registration .record-toolbar {
    min-height: 63px;
    padding: 12px;
    gap: 8px;
    flex-wrap: nowrap;
    border-bottom-color: #e2e8f0;
}

.page-registration .record-toolbar .btn-new,
.page-registration .record-toolbar .tool-search,
.page-registration .record-toolbar .tool-filter,
.page-registration .record-toolbar .select2-selection,
.page-registration .record-toolbar .btn-activate-toolbar {
    height: 37px;
    min-height: 37px;
    border-radius: 10px;
}

.page-registration .record-toolbar .btn-new {
    flex: 0 0 auto;
    padding: 0 14px;
    background: #4f3bfa;
    color: #fff;
    font-size: 13px;
}

.page-registration .record-toolbar .tool-search {
    flex: 0 1 400px;
    width: 400px;
    min-width: 170px;
    padding: 0 35px 0 12px;
    background-color: #f8fafc;
    border-color: #dbe3ee;
    font-size: 12px;
}

.page-registration .record-toolbar .select2-container {
    flex: 0 1 190px;
    min-width: 125px;
}

.page-registration .record-toolbar #statusFilter + .select2-container {
    flex-basis: 160px;
}

.page-registration .record-toolbar .select2-selection {
    padding: 0 12px 0 28px;
    border-color: #c7d2fe;
    font-size: 12px;
}

.page-registration .record-toolbar .select2-selection__rendered {
    width: 100%;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #0f172a;
}

.page-registration .record-toolbar .btn-activate-toolbar {
    flex: 0 0 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #d9e0e8;
    padding: 0 10px;
    background: #059669;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.page-registration .record-toolbar .btn-activate-toolbar:disabled {
    border-color: #e8edf3;
    background: #f8fafc;
    color: #b9c4d2;
    cursor: not-allowed;
    opacity: 1;
}

.page-registration .record-toolbar .records-count {
    margin-inline-start: auto;
    white-space: nowrap;
    font-size: 11px;
    color: #64748b;
}

.page-registration .records-table {
    table-layout: fixed;
}

.page-registration .records-table th:nth-child(1) { width: 4%; }
.page-registration .records-table th:nth-child(2) { width: 40%; }
.page-registration .records-table th:nth-child(3) { width: 23%; }
.page-registration .records-table th:nth-child(4) { width: 26.5%; }
.page-registration .records-table th:nth-child(5) { width: 6.5%; }

.page-registration .records-table thead th {
    height: 48px;
    padding: 12px 16px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
}

.page-registration .records-table tbody td {
    height: 74px;
    padding: 12px 16px;
    border-color: #e2e8f0;
    vertical-align: middle;
}

.page-registration .records-table th:nth-child(1),
.page-registration .records-table td.rt-idx,
.page-registration .records-table th:nth-child(5) {
    text-align: center;
}

.page-registration .records-table th:nth-child(3),
.page-registration .records-table th:nth-child(4),
.page-registration .records-table td.rt-class,
.page-registration .records-table td.rt-status {
    text-align: center;
}

.page-registration .records-table .cell-name {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
}

.page-registration .records-table .cell-sub {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
    color: #64748b;
}

.page-registration .records-table .cell-id.awaiting-issue {
    color: #d97706;
    font-weight: 500;
}

.page-registration .records-table .cell-class {
    font-size: 16px;
    font-weight: 800;
}

.page-registration .records-table .cell-status {
    font-size: 15px;
    font-weight: 800;
    background: transparent;
    border: 0;
}

.page-registration .records-table td.rt-actions {
    text-align: center;
    white-space: nowrap;
}

.page-registration .records-table td.rt-actions .act-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 2px;
    background: transparent;
    border: 0;
    font-size: 18px;
}

.page-registration .records-table td.rt-actions .act-del { color: #f43f5e; }
.page-registration .records-table td.rt-actions .act-edit { color: #4f46e5; }

@media (max-width: 767.98px) {
    .page-registration .record-toolbar { flex-wrap: wrap; }
    .page-registration .record-toolbar .btn-new,
    .page-registration .record-toolbar .tool-search { flex: 1 1 100%; width: 100%; }
    .page-registration .record-toolbar .select2-container { flex: 1 1 calc(50% - 4px); }
    .page-registration .record-toolbar #statusFilter + .select2-container { flex-basis: calc(50% - 4px); }
    .page-registration .record-toolbar .btn-activate-toolbar { flex: 1 1 100%; }
    .page-registration .record-toolbar .records-count { flex: 1 1 100%; text-align: left; }
    .page-registration .table-responsive { overflow-x: auto; }
    .page-registration .records-table { display: table; width: 850px; min-width: 850px; }
    .page-registration .records-table thead { display: table-header-group; }
    .page-registration .records-table tbody { display: table-row-group; }
    .page-registration .records-table tr,
    .page-registration .records-table thead tr { display: table-row; padding: 0; }
    .page-registration .records-table thead th { display: table-cell; }
    .page-registration .records-table tbody td { display: table-cell; padding: 12px 10px; }
    .page-registration .records-table td.rt-idx,
    .page-registration .records-table td.rt-name,
    .page-registration .records-table td.rt-class,
    .page-registration .records-table td.rt-status,
    .page-registration .records-table td.rt-actions { display: table-cell; }
    .page-registration .records-table td.rt-actions .act-btn { display: inline-flex; }
}
