/* ==========================================================================
   global.css — التنسيقات المشتركة لكل النظام (القسم 17.16 في CLAUDE.md)
   لا تُكتب ألوان أو مقاسات الأزرار والبطاقات داخل الصفحات.
   ========================================================================== */

/* ---------- الهوية ---------- */
:root {
    --dic-blue: #014CC9;
    --dic-blue-hover: #013da3;
    --dic-navy: #0B3A8C;
    --dic-navy-dark: #0A2350;
    --dic-gold: #F5A623;
    --dic-action: #1694CA;
    --dic-action-shadow: #1380ae;
    --dic-action-hover: #1482b3;
    --dic-action-hover-shadow: #116f9a;
    --dic-off: #6c757d;
    --dic-off-shadow: #545b62;

    --bs-primary: #014CC9;
    --bs-primary-rgb: 1, 76, 201;
    --bs-link-color: #014CC9;
    --bs-link-color-rgb: 1, 76, 201;
    --bs-link-hover-color: #013da3;

    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

[data-bs-theme=dark] {
    --bs-link-color: #6ea8fe;
    --bs-link-color-rgb: 110, 168, 254;
    --bs-link-hover-color: #9ec5fe;
}

/* الشريط العلوي ثابت (fixed-header في القالب): التمرير للعناصر (الحقل الخاطئ، الروابط الداخلية) يتوقف أسفله */
html { scroll-padding-top: calc(3.5rem + 1px + env(safe-area-inset-top, 0px)); }

body, button, input, select, textarea, .tooltip, .popover, .swal2-popup, #toast-container,
.select2-container, .ui-datepicker {
    font-family: 'Cairo', Tahoma, Arial, sans-serif !important;
}

body { background: var(--bs-tertiary-bg); }

.btn-primary {
    --bs-btn-bg: #014CC9;
    --bs-btn-border-color: #014CC9;
    --bs-btn-hover-bg: #013da3;
    --bs-btn-hover-border-color: #013da3;
    --bs-btn-active-bg: #01378f;
    --bs-btn-active-border-color: #01378f;
    --bs-btn-disabled-bg: #014CC9;
    --bs-btn-disabled-border-color: #014CC9;
}

.text-primary { color: var(--dic-blue) !important; }
[data-bs-theme=dark] .text-primary { color: #6ea8fe !important; }
.card-primary.card-outline { border-top-color: var(--dic-blue); }

/* ---------- الشريط الجانبي ---------- */
.app-sidebar {
    background: var(--dic-navy) !important;
    --lte-sidebar-color: rgba(255, 255, 255, .88);
    --lte-sidebar-hover-color: #fff;
    --lte-sidebar-menu-active-color: #fff;
}
[data-bs-theme=dark] .app-sidebar { background: var(--dic-navy-dark) !important; }

.app-sidebar .sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    height: auto;
    padding: clamp(.4rem, 1.1vh, .7rem) .5rem;
}
.app-sidebar .brand-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-logo-wrap {
    background: #fff;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.brand-logo-wrap img { width: 40px; height: 40px; object-fit: contain; }
.brand-text { color: #fff !important; font-weight: 700; font-size: .98rem; line-height: 1.25; }
.brand-text small {
    display: block;
    font-weight: 500;
    font-size: .7rem;
    color: rgba(255, 255, 255, .7);
    letter-spacing: .3px;
}

/* الارتفاع: الشعار ثم القائمة تملأ ما تبقى (flex)، والمسافات تتبع ارتفاع الشاشة فتتسع على الطويلة وتضيق على القصيرة */
.app-sidebar {
    --sb-pad-y: clamp(.25rem, calc(3.05vh - 17px), .75rem);       /* حشو الصف: ~5px عند 720 و ~6.5px عند 768 و ~10.5px عند 900 */
    --sb-head-pad: clamp(.3rem, calc(2vh - 8px), .85rem);         /* المسافة فوق عنوان القسم: ~6.5px عند 720 و ~10px عند 900 */
    --sb-top-font: clamp(.95rem, calc(.7rem + .55vh), 1.02rem);   /* عناصر المستوى الأول أكبر من الفرعية (.92rem) */
}
.app-sidebar { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.app-sidebar .sidebar-brand { flex: none; }
.app-sidebar .sidebar-wrapper { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding-block: .25rem; }
.app-sidebar .sidebar-wrapper > nav { flex: 1 0 auto; margin-top: .3rem !important; }

.sidebar-menu .nav-link {
    display: flex; align-items: center; gap: .55rem;
    color: rgba(255, 255, 255, .86) !important; border-radius: 8px; margin: 1px 8px; padding: var(--sb-pad-y) .7rem; font-size: .92rem;
}
.sidebar-menu .nav-link p { flex: 1; min-width: 0; margin: 0; white-space: normal; line-height: 1.32; }
.sidebar-menu > .nav-item > .nav-link { font-size: var(--sb-top-font); }
.sidebar-menu .nav-link:hover { background: rgba(255, 255, 255, .08) !important; color: #fff !important; }
.sidebar-menu .nav-link.active {
    background: rgba(255, 255, 255, .15) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset -3px 0 0 var(--dic-gold);
}
.sidebar-menu .nav-icon { color: rgba(255, 255, 255, .8); width: 1.25rem; min-width: 1.25rem; font-size: .95rem; text-align: center; margin: 0 !important; }
.sidebar-menu .nav-link.active .nav-icon { color: var(--dic-gold); }
.sidebar-menu .nav-icon.nav-icon-dot { font-size: .45rem; }
.sidebar-menu .nav-treeview { background: transparent; }
.sidebar-menu .nav-treeview .nav-link.active { background: rgba(255, 255, 255, .15) !important; color: #fff !important; }
.sidebar-menu .nav-treeview .nav-link.active .nav-icon { color: var(--dic-gold); }
.sidebar-menu .nav-arrow { font-size: .65rem; }
/* عنوان القسم: صغير وهادئ فوق عناصره، بخط فاصل قبله؛ وخطوط خفيفة بين عناصر المستوى الأول */
.sidebar-menu > .nav-header {
    color: rgba(255, 255, 255, .5) !important; font-size: .7rem; font-weight: 600; letter-spacing: .2px; line-height: 1.3;
    padding: var(--sb-head-pad) .35rem .3rem; margin: clamp(.15rem, .5vh, .4rem) .9rem 0; border-top: 1px solid rgba(255, 255, 255, .13);
}
.sidebar-menu > .nav-item + .nav-item::before { content: ""; display: block; height: 1px; margin: 0 .9rem; background: rgba(255, 255, 255, .07); }
[data-bs-theme=dark] .sidebar-menu > .nav-item + .nav-item::before { background: rgba(255, 255, 255, .06); }

/* مجموعات القائمة القابلة للطي: عنوان أصغر وأهدأ يفتح عناصره، والسهم في السطر نفسه فلا يغطي النص */
.sidebar-menu .sidebar-group > .sidebar-group-toggle { color: rgba(255, 255, 255, .82) !important; font-weight: 600; }
.sidebar-menu .sidebar-group > .sidebar-group-toggle .nav-icon { color: rgba(255, 255, 255, .72); }
.sidebar-menu .sidebar-group > .sidebar-group-toggle p { display: flex; align-items: center; gap: .4rem; }
/* السهم: مغلقة ← يشير للداخل (يساراً في RTL)، مفتوحة ← للأسفل */
.sidebar-menu .sidebar-group > .sidebar-group-toggle .nav-arrow { position: static; margin-inline-start: auto; flex-shrink: 0; transition: transform .2s; transform: rotate(180deg) !important; }
.sidebar-menu .sidebar-group.menu-open > .sidebar-group-toggle .nav-arrow { transform: rotate(90deg) !important; }
.sidebar-menu .sidebar-group.menu-open > .sidebar-group-toggle,
.sidebar-menu .sidebar-group > .sidebar-group-toggle:hover { color: #fff !important; }
.sidebar-menu .sidebar-group.has-active > .sidebar-group-toggle .nav-icon { color: var(--dic-gold); }
.sidebar-menu .sidebar-group > .nav-treeview { padding-inline-start: .55rem; }
/* المجموعة المثبتة (pinned): قائمتها ظاهرة دائماً، وعنوانها ليس زر طيّ (وضع الأيقونات المطوي يخفيها كغيرها) */
.sidebar-menu .sidebar-group-pinned > .nav-treeview { display: block !important; }
.sidebar-menu .sidebar-group-pinned > .sidebar-group-toggle { cursor: default; color: #fff !important; }

/* البحث السريع أعلى القائمة */
.sidebar-search { position: relative; padding: clamp(.35rem, 1vh, .6rem) .5rem 0; flex: none; }
.sidebar-search .form-control {
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); color: #fff;
    padding-inline-start: 2rem; border-radius: 8px; font-size: .85rem;
}
.sidebar-search .form-control::placeholder { color: rgba(255, 255, 255, .55); }
.sidebar-search .form-control:focus { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .35); box-shadow: none; color: #fff; }
.sidebar-search .form-control::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }
.sidebar-search-icon { position: absolute; inset-inline-start: 1.15rem; top: calc(clamp(.35rem, 1vh, .6rem) + .55rem); font-size: .8rem; color: rgba(255, 255, 255, .55); pointer-events: none; }
.sidebar-search-empty { color: rgba(255, 255, 255, .6); font-size: .82rem; padding: .7rem .5rem 0; }

/* وضع الأيقونات (sidebar-mini مطوي على الشاشات الكبيرة): أيقونات لوحة التحكم والمجموعات فقط، ويتمدد كاملاً بالمرور */
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .sidebar-search,
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .sidebar-menu .nav-treeview { display: none !important; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .sidebar-menu .nav-link { gap: 0; justify-content: center; padding-inline: 0; margin-inline: auto; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .sidebar-menu .nav-link p { position: absolute; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .sidebar-group.has-active > .sidebar-group-toggle { background: rgba(255, 255, 255, .15) !important; }
/* عند التمدد بالمرور: نفس تخطيط القائمة المفتوحة (النص يلتف، والسهم في طرف السطر) بدل قواعد الطي في القالب */
.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-menu .nav-link p {
    flex: 1 1 auto; width: auto; white-space: normal; padding-inline: 0 !important; margin: 0 !important;
}
.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-menu .sidebar-group > .sidebar-group-toggle p { display: flex; }
.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-menu > .nav-header { display: block; }

/* الهاتف: حقل البحث 16px حتى لا يكبّر iOS الصفحة عند التركيز */
@media (max-width: 991.98px) {
    .sidebar-search .form-control { font-size: 16px; }
}

/* شريط تمرير رفيع للقائمة */
.app-sidebar .sidebar-wrapper { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
.app-sidebar .sidebar-wrapper::-webkit-scrollbar { width: 6px; }
.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }
.app-sidebar .sidebar-wrapper::-webkit-scrollbar-track { background: transparent; }

/* ---------- الشريط العلوي ---------- */
.app-header .nav-link { color: var(--bs-body-color); }
.notif-badge { position: absolute; top: 4px; left: 2px; font-size: .6rem; padding: .2em .45em; }
.notif-menu { min-width: 300px; max-width: 360px; }
.notif-menu .dropdown-item { white-space: normal; }
.notif-unread { background: var(--bs-primary-bg-subtle); }
.notif-list { max-height: min(24rem, 60vh); overflow-y: auto; scrollbar-width: thin; }
.notif-icon { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.notif-dot { flex-shrink: 0; width: .5rem; height: .5rem; margin-top: .45rem; border-radius: 50%; background: var(--bs-primary); }
.user-menu { min-width: 260px; }
.header-term { font-size: .78rem; padding: .4em .75em; }

/* البحث العام في الشريط العلوي: حقل بجانب العنوان على الشاشات الكبيرة، وزر يفتحه تحت الشريط في الأصغر */
.header-search-box { position: relative; width: clamp(16rem, 24vw, 22rem); }
.header-search-menu { width: 100%; max-height: min(28rem, 70vh); overflow-y: auto; inset-inline-start: 0; top: calc(100% + .25rem); }
.header-search-menu .dropdown-header { font-weight: 600; color: var(--bs-secondary-color); }
.header-search-menu .dropdown-item { white-space: normal; }
@media (max-width: 991.98px) {
    .header-search-box {
        display: none; position: absolute; inset-inline: .5rem; top: calc(100% + .25rem); width: auto; z-index: 1040;
        padding: .5rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem;
    }
    .header-search.is-open .header-search-box { display: block; }
    .header-search-box .form-control { font-size: 16px; } /* لا تكبير تلقائي في iOS */
    .header-search-menu { position: static; box-shadow: none; border: 0; margin-top: .25rem; }
}

/* اختصارات الشريط العلوي: نفس أزرار الروابط السريعة بحجم أصغر */
.header-shortcuts { width: 300px; }
.quick-actions-sm { gap: .4rem; }
.quick-actions-sm .quick-action { min-height: 4.4rem; padding: .45rem .25rem; gap: .3rem; }
.quick-actions-sm .quick-action i { font-size: 1.1rem; }
.quick-actions-sm .quick-action span { font-size: .7rem; }

/* الآلة الحاسبة في الشريط العلوي: شاشة النتيجة ثم لوحة أزرار 4 × 5 (اتجاه LTR كالحاسبات المعتادة) */
.header-calc { width: 240px; }
.calc-display { text-align: end; color: var(--bs-body-color); line-height: 1.3; }
.calc-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.calc-keys .btn { padding: .4rem 0; font-size: 1rem; font-weight: 600; }
.calc-keys .calc-wide { grid-column: span 2; }
/* التقويم في الشريط العلوي: تقويم النظام مضمَّناً بعرض القائمة */
.header-calendar { width: 280px; }
.header-calendar .ui-datepicker { width: 100%; display: block; border: 0; box-shadow: none; padding: 0; }
/* في الهاتف: قوائم أدوات الشريط في منتصف الشاشة تحت الشريط (قوائم الشريط لا يُعاد تموضعها تلقائياً فتخرج عن الشاشة)،
   وحشو أقل لأيقونات الشريط فتتسع كلها في سطر واحد */
@media (max-width: 575.98px) {
    .app-header .container-fluid { padding-inline: .35rem; }
    .app-header .navbar-nav .nav-link { padding-inline: .45rem; }
    .app-header .header-tool-menu {
        position: fixed !important; top: calc(3.5rem + .25rem) !important; left: 50% !important; right: auto !important;
        transform: translateX(-50%); max-width: calc(100vw - 1rem); margin: 0 !important;
    }
}
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--dic-blue);
    color: #fff;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
img.user-avatar-img { object-fit: cover; background: var(--bs-secondary-bg); }
/* حسابي: الصورة الكبيرة في بطاقة الحساب */
.user-avatar.user-avatar-xl { width: 96px; height: 96px; font-size: 2.25rem; }

/* ---------- مسار الصفحة ---------- */
.dic-breadcrumb { --bs-breadcrumb-divider: '>'; }
.dic-breadcrumb a { text-decoration: none; }

/* ---------- صفحة الدخول ---------- */
.login-page .login-box { width: 400px; max-width: calc(100vw - 32px); }
.login-page .login-box.login-box-wide { width: 520px; }
.login-logo-wrap {
    width: 88px;
    height: 88px;
    background: #fff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.login-logo-wrap img { width: 80px; height: 80px; object-fit: contain; }

/* ==========================================================================
   جداول البيانات (القسم 6) — التخطيط: <"top"lBf><"dt-scroll"rt><"bottom"ip>
   ========================================================================== */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dt-buttons { float: none; text-align: center; margin-bottom: 10px; }
.dataTables_wrapper .dataTables_filter { margin-top: 12px; }
.dataTables_wrapper .dt-buttons { display: inline-block; margin: 0 20px; }
.dataTables_wrapper .top {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; padding-top: 15px;
}
.dataTables_wrapper .bottom {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; padding-top: 10px;
}
.dataTables_wrapper .dataTables_paginate .pagination { margin: 0; flex-wrap: wrap; }
@media (max-width: 768px) {
    .dataTables_wrapper .top, .dataTables_wrapper .bottom { flex-direction: column; align-items: center; }
    .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { text-align: center; margin-bottom: 10px; }
    .dataTables_wrapper .dt-buttons { margin: 0; }
}
div.dataTables_wrapper div.dataTables_filter input { margin-right: .5em; margin-left: 0; }
div.dataTables_wrapper div.dataTables_length select { margin: 0 .4em; }

/* الجدول وحده داخل غلاف تمرير أفقي — لا شريط تمرير عمودي */
.dt-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
/* عمود الإجراءات مثبت في طرف الجدول (يساراً في RTL) فيبقى ظاهراً دون تمرير أفقي */
.dt-scroll .dt-actions { position: sticky; inset-inline-end: 0; z-index: 2; width: 1%; min-width: max-content; padding-inline: .5rem !important; }
.dt-scroll td.dt-actions { border-inline-start: 1px solid var(--bs-border-color); }
/* شاشة الامتحانات والنتائج وحدها: خط جداول التبويبات أصغر قليلاً (14.7px بدل 16px) */
.exams-screen table.dataTable { font-size: .92rem; }
/* الجدول المضغوط (tableClass = dt-compact): خط وحشو أصغر، وأزرار الإجراءات بمقاسها الموحد */
table.dt-compact { font-size: .82rem; }
table.dt-compact > :not(caption) > * > * { padding: .3rem .4rem; }
table.dt-compact thead th { font-size: .8rem; }
table.dataTable { width: 100% !important; margin-top: 6px !important; }
table.dataTable thead th { white-space: nowrap; }
/*
 * الجدول المحكم (tbl-tight): اختياري لشاشات كثيفة البيانات (الموارد البشرية)، ولا يغيّر باقي الجداول.
 * حشو شبه معدوم وخط أصغر، والعناوين والنصوص تلتف بدل التمدد، فيتسع الجدول لعرض الشاشة بلا تمرير أفقي.
 */
table.tbl-tight { font-size: .74rem; line-height: 1.25; }
table.tbl-tight > :not(caption) > * > * { padding: .15rem .25rem; }
table.tbl-tight thead th { font-size: .72rem; white-space: normal; vertical-align: middle; }
table.tbl-tight td { overflow-wrap: anywhere; }
table.tbl-tight td.text-nowrap, table.tbl-tight th.text-nowrap { overflow-wrap: normal; }
table.tbl-tight .badge { font-size: .68rem; padding: .25em .45em; }
table.tbl-tight .small { font-size: .68rem; }
table.tbl-tight .form-control-sm, table.tbl-tight .btn-group-sm > .btn { font-size: .7rem; padding: .1rem .3rem; min-height: 0; }
.dt-scroll table.tbl-tight .dt-actions { padding-inline: .15rem !important; }
/* tbl-flush (مع tbl-tight، لجداول الطلاب): خط أكبر قليلاً للقراءة، وبلا حشو أفقي بين الأعمدة.
   رؤوس الأعمدة القابلة للترتيب تحتفظ بمساحة سهم الترتيب من DataTables. */
table.tbl-tight.tbl-flush { font-size: .85rem; }
table.tbl-tight.tbl-flush > :not(caption) > * > * { padding-inline: 0; }
table.tbl-tight.tbl-flush thead th { font-size: .8rem; }
table.tbl-tight.tbl-flush .badge { font-size: .75rem; }
table.tbl-tight.tbl-flush .small { font-size: .76rem; }
.dt-scroll table.tbl-tight.tbl-flush .dt-actions { padding-inline: 0 !important; }
/* tbl-flat (جداول الدراسات المستمرة وحدها): خط الجداول وارتفاع صفوفها العاديان، وبلا حشو أفقي بين الأعمدة.
   النص الطويل يلتف داخل خليته، والأرقام بعرض ثابت فتبقى محاذاتها، ورؤوس الأعمدة القابلة للترتيب تحتفظ بمساحة السهم. */
table.tbl-flat > :not(caption) > * > * { padding-inline: 0; }
/* الجداول ذات الحدود الرأسية (ملف الدورة): أدنى حشو يُبعد النص عن خطوط الخلايا */
table.tbl-flat.table-bordered > :not(caption) > * > * { padding-inline: .25rem; }
table.tbl-flat { font-variant-numeric: tabular-nums; }
table.tbl-flat td { overflow-wrap: break-word; }
.dt-scroll table.tbl-flat .dt-actions { padding-inline: 0 !important; }
[data-col-menu] { max-height: 60vh; overflow-y: auto; }
table.dataTable > thead > tr > th, table.dataTable > thead > tr > td { text-align: center; }
.dataTables_processing {
    background: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    z-index: 5;
}

/* أزرار التصدير (أيقونة فقط) */
.dt-export-btn {
    background: var(--dic-action) !important;
    color: #fff !important;
    box-shadow: 0 3px 0 var(--dic-action-shadow) !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    margin: 0 2px !important;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: background .2s ease;
}
.dt-export-btn:hover, .dt-export-btn:focus {
    background: var(--dic-action-hover) !important;
    box-shadow: 0 2px 0 var(--dic-action-hover-shadow) !important;
    color: #fff !important;
}

/* أزرار الإجراءات — موحدة في كل النظام: لون واحد، مربع 32×32، زوايا حادة */
.act-btn {
    color: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    background: var(--dic-action) !important;
    box-shadow: 0 3px 0 var(--dic-action-shadow) !important;
}
.act-btn i { width: 14px; text-align: center; }
.act-btn:hover, .act-btn:focus { background: var(--dic-action-hover) !important; }
.act-btn.act-off, .act-btn.act-off:hover {
    background: var(--dic-off) !important;
    box-shadow: 0 3px 0 var(--dic-off-shadow) !important;
    cursor: not-allowed;
    opacity: 1 !important;
}
.act-group { display: inline-flex; flex-wrap: nowrap; }
.act-group .dropdown-toggle::after { display: none; }
.act-group .dropdown-menu, .dropdown-menu.dic-portal { min-width: 11rem; }
/* قائمة الإجراءات المنقولة إلى body فوق كل عناصر الجدول (تحت النوافذ المنبثقة) */
body > .dropdown-menu.dic-portal { z-index: 1050; }

/* رأس بطاقة الجدول */
.dt-card > .card-header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.dt-card > .card-header::after { display: none; }
.dt-card > .card-header .card-title { margin: .5rem 0; float: none; }
.dt-card > .card-header .card-tools { margin-inline-start: auto; margin-inline-end: 0; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ==========================================================================
   لوحة الفلترة (القسم 6.1)
   ========================================================================== */
.filter-count { font-size: .65rem; }
.filter-chip {
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .6rem;
}
.filter-chip .btn-close { font-size: .55rem; }

/* ==========================================================================
   التبويبات العمودية (نمط settings.html)
   ========================================================================== */
.v-tabs .list-group-item { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.v-tabs .list-group-item i { width: 1.2rem; text-align: center; color: var(--dic-blue); }
.v-tabs .list-group-item.active { background: var(--dic-blue); border-color: var(--dic-blue); color: #fff; }
.v-tabs .list-group-item.active i { color: #fff; }
[data-bs-theme=dark] .v-tabs .list-group-item i { color: #6ea8fe; }
[data-bs-theme=dark] .v-tabs .list-group-item.active i { color: #fff; }
/* المتغير الأفقي (x-v-tabs horizontal): شريط أعلى المحتوى، والتبويبات تتقاسم العرض على الهاتف */
.v-tabs-h { gap: .25rem; }
.v-tabs-h .nav-link { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.v-tabs-h .nav-link i { color: var(--dic-blue); }
.v-tabs-h .nav-link.active { background: var(--dic-blue); color: #fff; }
.v-tabs-h .nav-link.active i { color: #fff; }
[data-bs-theme=dark] .v-tabs-h .nav-link:not(.active) i { color: #6ea8fe; }
@media (max-width: 575.98px) { .v-tabs-h .nav-link { flex: 1 1 0; padding-inline: .5rem; } }
/* x-v-tabs horizontal scroll: سطر واحد، وتمرير أفقي داخل الشريط وحده عند كثرة التبويبات */
.v-tabs-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
/* عنصر flex يتقلص دون أن يتجاوز عرضه محتواه (مثل محتوى التبويبات بجانب عمود Bootstrap vertical pills) */
.min-w-0 { min-width: 0 !important; }
/* أزرار pills بعرض متساوٍ حين تصير أفقية في الهاتف (عمودياً تتساوى تلقائياً بعرض العمود) */
@media (max-width: 767.98px) { .nav-pills-equal > .nav-link { flex: 1 1 0; } }
.v-tabs-scroll .nav-link { flex: 0 0 auto; padding: .3rem .45rem; gap: .3rem; font-size: .85rem; }

/* ==========================================================================
   النوافذ المنبثقة والنماذج
   ========================================================================== */
.modal-header { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.modal-header .modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-footer { background: var(--bs-tertiary-bg); }
.detail-list .detail-item { display: flex; align-items: center; gap: .5rem; border-bottom: 1px solid var(--bs-border-color); padding: .45rem 0; }
.detail-list .detail-item i { width: 1.1rem; text-align: center; color: var(--dic-blue); }
[data-bs-theme=dark] .detail-list .detail-item i { color: #6ea8fe; }
.detail-list .detail-label { color: var(--bs-secondary-color); white-space: nowrap; }
.detail-list .detail-value { font-weight: 600; margin-inline-start: auto; text-align: left; }

.form-label .text-danger { font-weight: 700; }
.invalid-tooltip { z-index: 6; font-size: .78rem; }

/* الحقول الرقمية: إخفاء أسهم الزيادة والنقصان في كل المتصفحات */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.number-input, .decimal-input { text-align: right; }

/* ==========================================================================
   Select2 (Bootstrap 5 theme + RTL + الوضع الليلي + التحقق)
   ========================================================================== */
.select2-container { width: 100% !important; }
.was-validated select:invalid + .select2-container--bootstrap-5 .select2-selection,
select.is-invalid + .select2-container--bootstrap-5 .select2-selection { border-color: var(--bs-form-invalid-border-color); }
.was-validated select:valid + .select2-container--bootstrap-5 .select2-selection { border-color: var(--bs-form-valid-border-color); }
.select2-container--bootstrap-5 .select2-dropdown { z-index: 1060; }
.modal .select2-container--bootstrap-5 .select2-dropdown { z-index: 1065; }

[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-dropdown,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--bs-body-color); }
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option { color: var(--bs-body-color); }
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted { background-color: #1f3b6e; color: #fff; }
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice { color: var(--bs-body-color); border-color: var(--bs-border-color); }
[data-bs-theme=dark] .select2-container--bootstrap-5.select2-container--disabled .select2-selection { background-color: var(--bs-secondary-bg); }

/* ==========================================================================
   jQuery UI Datepicker — تقويم موحد
   ========================================================================== */
.ui-datepicker {
    padding: .5rem;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: .5rem;
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    width: 18rem;
    font-size: .9rem;
}
.ui-datepicker .ui-datepicker-header {
    background: var(--dic-blue);
    border: 0;
    border-radius: .35rem;
    color: #fff;
    padding: .35rem 0;
}
.ui-datepicker .ui-datepicker-title select {
    font-size: .85rem;
    border-radius: .25rem;
    border: 0;
    padding: 1px 4px;
    margin: 0 2px;
    color: #1e293b;
}
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { top: 6px; cursor: pointer; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { filter: brightness(10); }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { background: rgba(255, 255, 255, .2); border: 0; top: 6px; }
.ui-datepicker th { color: var(--bs-secondary-color); font-weight: 600; font-size: .78rem; }
.ui-datepicker td a.ui-state-default, .ui-datepicker td span.ui-state-default {
    text-align: center;
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
    border-radius: .3rem;
    padding: .3rem 0;
}
.ui-datepicker td a.ui-state-hover { background: var(--bs-primary-bg-subtle); }
.ui-datepicker td a.ui-state-highlight { background: var(--bs-warning-bg-subtle); color: var(--bs-body-color); }
.ui-datepicker td a.ui-state-active { background: var(--dic-blue) !important; color: #fff !important; }
input.datepicker { cursor: pointer; caret-color: transparent; }

/* ==========================================================================
   toastr و SweetAlert2 والطباعة
   ========================================================================== */
#toast-container > div { opacity: .97; }
.swal2-actions { gap: .5rem; }
.swal2-popup { font-size: .95rem; }
.dic-print-frame { position: fixed; left: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }

/* AdminLTE 4 يضيف رسالة invalid-feedback تلقائياً للحقول غير الصالحة؛ النظام يعتمد invalid-tooltip فقط (القسم 17.8) */
.needs-validation .invalid-feedback[role="alert"] { display: none !important; }
/* مساحة لرسالة الخطأ أسفل الحقل حتى لا تغطي الحقل التالي */
form.was-validated .position-relative:has(:invalid),
.position-relative:has(> .is-invalid),
.position-relative:has(> .input-group > .is-invalid) { margin-bottom: 1.4rem; }

/* إعدادات الطباعة */
.stamp-preview { max-height: 140px; }
.print-preview-frame { height: 720px; max-height: 75vh; }
form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* نصوص متعددة الأسطر (ملاحظات النواقص وأسباب القرار) */
.text-pre-line { white-space: pre-line; }

/* المسار الزمني لطلب القبول */
.application-timeline li { position: relative; }
.application-timeline li:not(:last-child)::before {
    content: '';
    position: absolute;
    inset-inline-start: 16px;
    top: 36px;
    bottom: 0;
    border-inline-start: 2px solid var(--bs-border-color);
}
.timeline-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}

/* معاينة الملفات */
/* المعاينة فوق أي Modal مفتوح (Bootstrap: الـ Modal 1055 والخلفية 1050) */
#filePreviewModal { z-index: 1065; }
.modal-backdrop.modal-stacked { z-index: 1060; }
.file-preview-body { min-height: 60vh; }
.file-preview-body img { max-width: 100%; max-height: 75vh; object-fit: contain; padding: 1rem; }
.file-preview-body iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.doc-card.doc-missing { border-color: var(--bs-danger-border-subtle) !important; }
.doc-card-info { flex: 1 1 260px; min-width: 0; }
.doc-file-name { max-width: 180px; }

/* مقاعد برامج فترة القبول */
.program-num { width: 110px; min-width: 90px; }
.merit-check { width: 40px; }

/* ---------------- شعارات البنوك (بطاقات الحسابات البنكية وشاشة الدفع) ---------------- */
.bank-logo { width: 48px; height: 48px; }
.bank-logo img { max-height: 44px; }
.bank-option { cursor: pointer; }
.bank-option:has(input:checked) { border-color: var(--bs-primary) !important; box-shadow: 0 0 0 .15rem rgba(1, 76, 201, .2); }
.payment-pdf { height: 60vh; }

/* ---------------- الجدول الأسبوعي (الشعب والمحاضرات) ---------------- */
.tt-grid th, .tt-grid td { min-width: 120px; }
.tt-grid .tt-day { min-width: 70px; width: 70px; }
.tt-grid td { vertical-align: top; }

/* سطور القيد اليدوي: عرض أدنى للأعمدة فيبقى الجدول مقروءاً ويتمرر أفقياً في الهاتف */
.je-lines .je-col-account { min-width: 240px; }
.je-lines .je-col-college { min-width: 170px; }
.je-lines .je-col-text { min-width: 160px; }
.je-lines .je-col-amount { min-width: 120px; width: 130px; }
.je-lines .je-col-act { width: 46px; }
.tt-entry { background: var(--bs-primary-bg-subtle); border-inline-start: 3px solid var(--bs-primary); padding: 4px 6px; text-align: start; line-height: 1.5; }

/* حقول الوقت: الاختيار من المنتقي فقط */
.time-picker { cursor: pointer; }

/* ---------------- شريط الإحصاء الموحد (callout callout-info كما هو) — أقسام متساوية بفواصل ----------------
   يُعرض فوق التبويبات والجدول بعرضهما معاً؛ شريط التبويب ([data-stats-strip]) يظهر مع تبويبه فقط.
   كل قسم في سطر واحد: الأيقونة (يميناً) ← العنوان ← الرقم مدفوعاً إلى طرف القسم (يساراً). */
.stats-strip { display: flex; flex-wrap: wrap; margin-bottom: 1rem; } /* الارتفاع والحشو الافتراضيان للـ callout من القالب */
.stats-strip[data-stats-strip]:not(.is-active) { display: none; }
.stats-strip-item { flex: 1 1 0; min-width: 190px; display: flex; align-items: center; gap: 10px; padding: 0 16px; color: inherit; text-decoration: none; }
.stats-strip-item + .stats-strip-item { border-inline-start: 1px solid rgba(0, 0, 0, .1); }
[data-bs-theme="dark"] .stats-strip-item + .stats-strip-item { border-inline-start-color: rgba(255, 255, 255, .1); }
a.stats-strip-item:hover { background: rgba(0, 0, 0, .04); }
.stats-strip-icon { font-size: 28px; line-height: 1; width: 32px; text-align: center; opacity: .85; flex-shrink: 0; }
.stats-strip-label { font-size: 14px; line-height: 1.3; opacity: .9; min-width: 0; }
.stats-strip-value { font-size: 16px; font-weight: 600; line-height: 1.3; margin-inline-start: auto; text-align: end; white-space: nowrap; }
.stats-strip-item.is-stacked .stats-strip-text { display: flex; flex-direction: column; min-width: 0; }
.stats-strip-item.is-stacked .stats-strip-value { margin-inline-start: 0; text-align: start; }
@media (max-width: 767.98px) {
    .stats-strip-item { flex-basis: 50%; min-width: 0; padding: .35rem 10px; gap: 2px 8px; flex-wrap: wrap; }
    .stats-strip-item:nth-child(odd) { border-inline-start: 0; }
    /* الرقم لا ينقسم بين سطرين: إن لم يتسع بجانب العنوان نزل لسطر تحته في طرف القسم،
       والمبلغ الطويل في القسم stacked يلتف عند المسافة فقط */
    .stats-strip-value { flex-shrink: 0; }
    .stats-strip-item.is-stacked .stats-strip-value { white-space: normal; }
}

/* شجرة هرمية (RTL): خطوط ربط رمادية فاتحة على جهة البداية، وكل مستوى تحت أيقونة أبيه (شجرة الحسابات) */
.dic-tree, .dic-tree ul { list-style: none; margin: 0; padding: 0; }
.dic-tree ul { padding-inline-start: .6rem; }
.dic-tree li { position: relative; padding-inline-start: 1.25rem; }
.dic-tree li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-inline-start: 1px solid var(--bs-border-color); }
.dic-tree li:last-child::before { bottom: auto; height: 1.05rem; }
.dic-tree li::after { content: ""; position: absolute; inset-inline-start: 0; top: 1.05rem; width: 1rem; border-top: 1px solid var(--bs-border-color); }

/* ---------------- لوحة التحكم ----------------
   خطوط أصغر قليلاً لعناصر اللوحة (البطاقات والعناوين والتسميات والأرقام) داخل الغلاف .dash فقط. */
.dash { font-size: .93rem; }
.dash .card-title { font-size: 1rem; }
.dash .info-box .info-box-icon { font-size: 1.65rem; }
.dash h5 { font-size: 1.12rem; }

/* لوحة مضغوطة: أكبر قدر من الأقسام في الشاشة الأولى دون تمرير (1440 و 1366) — حشو وهوامش أقل فقط، بلا حذف */
.app-main:has(.dash) .app-content-header { padding-block: .45rem; }
.dash .card-header { padding-block: .45rem; }
.dash .card-body { padding: .75rem; }
.dash .card-footer { padding-block: .45rem; }
.dash .card-footer h5 { font-size: 1rem; }
.dash .card-footer .row { --bs-gutter-y: .5rem; }
.dash .table > :not(caption) > * > * { padding-block: .32rem; }
.dash .info-box { margin-bottom: .75rem !important; }
.dash .dash-side-card .card-body { padding: .5rem .75rem; }
.dash .dash-side-card .progress-group { font-size: .85rem; }
.dash .dash-side-card .card-title { font-size: .9rem; }
@media (min-width: 1200px) { .dash .dash-side, .dash .dash-side > [class*="col-"] > .dash-side-card { height: 100%; } }

/* عنوان رسم الإيرادات والمصروفات: اسما الخطين بلونيهما في الرسم (dic-charts.js AREA) بدل المفتاح */
.chart-key-revenue { color: #0f9b6e; }
.chart-key-expense { color: #0d6efd; }
[data-bs-theme=dark] .chart-key-revenue { color: #34d399; }
[data-bs-theme=dark] .chart-key-expense { color: #4D8DF5; }

/* الروابط السريعة: أيقونة واسمها العريض تحتها فقط (بلا خلفية ولا إطار)، بحجم صغير */
.quick-links-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem .35rem; }
.quick-link {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .25rem;
    padding: .35rem .15rem; text-align: center; text-decoration: none; border-radius: .375rem;
    color: var(--bs-secondary-color); font-weight: 700; line-height: 1.25;
}
.quick-link i { font-size: 1.05rem; color: var(--bs-emphasis-color); opacity: .8; }
.quick-link span { font-size: .72rem; color: var(--bs-body-color); }
.quick-link:hover span, .quick-link:focus-visible span, .quick-link:hover i, .quick-link:focus-visible i { color: var(--bs-link-color); opacity: 1; }

/* روابط سريعة: أزرار مستقلة btn-outline-secondary متباعدة (3 أعمدة)، بخلفية خاصة وارتفاع موحد، بلا حركة أو انتقال */
.quick-actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: .6rem; }
.quick-action {
    --bs-btn-bg: var(--bs-tertiary-bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
    min-height: 6.25rem; padding: .75rem .4rem; border-radius: .5rem; line-height: 1.35; transition: none;
}
.quick-action i { font-size: 1.5rem; line-height: 1; }
.quick-action span { font-size: .8rem; }
[data-bs-theme=dark] .quick-action { --bs-btn-color: #adb5bd; }

/* صناديق الإحصاء أعلى اللوحة: تدرجات قطرية غنية (لكل صندوق تدرجه من نفس الطراز)، زوايا مستديرة، نص وأيقونة بالأبيض،
   وتسلسل واضح للنص: تسمية صغيرة ← رقم كبير عريض ← سطر ثانوي صغير، والأيقونة داخل دائرة شفافة. العرض والارتفاع كما هما.
   درجات التدرجات من 600 / 700 (Tailwind) فيبقى النص الأبيض مقروءاً في الوضعين. */
.info-box-grad {
    --ib-grad: linear-gradient(135deg, #4f46e5 0%, #2563eb 50%, #0e7490 100%); /* نيلي ← أزرق ← سماوي */
    background-image: var(--ib-grad); color: #fff !important; border-radius: .9rem;
}
.info-box-tone-emerald { --ib-grad: linear-gradient(135deg, #047857 0%, #0f766e 100%); }   /* زمردي ← فيروزي */
.info-box-tone-sunset { --ib-grad: linear-gradient(135deg, #c2410c 0%, #e11d48 100%); }    /* برتقالي ← وردي */
.info-box-tone-violet { --ib-grad: linear-gradient(135deg, #7c3aed 0%, #a21caf 100%); }    /* بنفسجي ← فوشيا */
.info-box-grad .info-box-icon { background: transparent; color: #fff; }
.info-box-grad .info-box-icon i {
    display: flex; align-items: center; justify-content: center; width: 2.9rem; height: 2.9rem;
    border-radius: 50%; background: rgba(255, 255, 255, .18); font-size: 1.3rem;
}
.info-box-grad .info-box-content { justify-content: center; gap: .1rem; line-height: 1.25; text-align: start; }
.info-box-grad .info-box-text { font-size: .78rem; font-weight: 500; opacity: .88; }
.info-box-grad .info-box-number { margin-top: 0; font-size: 1.35rem; font-weight: 700; line-height: 1.15; letter-spacing: .2px; }
.info-box-grad .info-box-more { font-size: .72rem; opacity: .8; }
.info-box-grad .info-box-more i { font-size: .65rem; }
[data-bs-theme=dark] .info-box-grad { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
