/* ============================================================
   Pro Theme — تحسين شامل لتصميم لوحة التحكم
   يتم تحميله بعد ملفات القالب ليعيد ضبط الكثافة والمظهر
   جميع القواعد داخل @media screen حتى لا تؤثر على طباعة الفواتير
   ============================================================ */

/* الخط يُحمَّل ويُحدَّد من الترويسة حسب إعدادات الشركة (المتغيّر --app-font).
   الافتراضي Tajawal إن لم يُضبط. */

@media screen {

:root {
    /* لوحة ألوان زرقاء-تركوازية احترافية */
    --primary: #077B9B;
    --primary-dark: #056178;
    --primary-soft: #eaf5f9;
    --secondary: #008BD2;
    --secondary-dark: #0072ad;
    --secondary-soft: #e8f4fb;
    --accent: #F09B0C;
    --accent-soft: #fef4e4;
    --body-bg: #f4f7fa;
    --card-border: #e6ecf3;
    --text-dark: #212529;
    --text-muted: #7a8296;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(20, 25, 45, .06);
    --shadow-md: 0 4px 16px rgba(20, 25, 45, .08);
    --topbar-h: 60px;
    --field-bg: rgba(0, 139, 210, .03);
    --field-border: rgba(0, 139, 210, .14);
}

/* ---------- الخط ----------
   ملف القالب style.css يضع القاعدة الشاملة:
       * { font-family: "ExpoArabic", "SaudiRiyal", sans-serif; }
   والتصريح المباشر على كل عنصر يتغلّب على الوراثة من body،
   لذا لا بد من قاعدة شاملة مماثلة هنا (هذا الملف يُحمَّل بعده فيفوز).

   "SaudiRiyal" يبقى في السلسلة لأنه الخط الذي يرسم رمز الريال الجديد (U+20C1).
   الأيقونات غير متأثرة: قواعدها بمحدِّدات صنف تتغلّب على المحدِّد الشامل. */
* {
    font-family: var(--app-font, 'Tajawal'), "SaudiRiyal", 'Segoe UI', Tahoma, Arial, sans-serif;
}

body {
    background-color: var(--body-bg) !important;
    color: var(--text-dark);
    font-size: 14px;
    letter-spacing: 0;
}

h1, h2, h3, h4, h5, h6, .heading {
    color: var(--text-dark);
    font-weight: 700;
}

*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background-color: transparent; }
*::-webkit-scrollbar-thumb { background: #c5cbd8; border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

/* ---------- الشريط العلوي ---------- */
#page-topbar {
    background-color: #fff;
    box-shadow: none;
    border-bottom: 1px solid var(--card-border);
}

.navbar-header {
    height: var(--topbar-h);
    padding: 0 8px;
}

.navbar-header .header-item {
    height: var(--topbar-h);
    color: var(--text-muted);
}

.navbar-header .header-item:hover { color: var(--primary); }

.header-profile-user { border: 2px solid var(--secondary-soft); }

.navbar-brand-box { height: var(--topbar-h); display: flex; align-items: center; justify-content: center; }

.app-search .form-control {
    background-color: var(--body-bg) !important;
    border: 1px solid transparent !important;
    border-radius: 20px !important;
    height: 36px;
    transition: all .15s linear;
}

.app-search .form-control:focus {
    border-color: var(--secondary) !important;
    background-color: #fff !important;
}

/* ---------- القائمة الجانبية ---------- */
.vertical-menu {
    background: #fff;
    box-shadow: none;
    border-left: 1px solid var(--card-border);
}

#sidebar-menu { padding-top: 4px; }

#sidebar-menu .metismenu > li.text-center {
    padding: 10px 12px;
    font-size: 13.5px;
    font-weight: 900;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 8px;
    margin: 4px 10px 10px;
}

#sidebar-menu ul li a {
    padding: 10px 14px;
    font-size: 14.8px;
    font-weight: 700;
    color: #4a5065;
    border-radius: 9px;
    margin: 2px 8px;
    transition: all .12s linear;
    display: flex;
    align-items: center;
}

#sidebar-menu ul li a i {
    font-size: 20px;
    min-width: 32px;
    color: #8a90a5;
    transition: color .12s linear;
}

#sidebar-menu ul li a:hover {
    background-color: var(--secondary-soft);
    color: var(--secondary-dark);
}

#sidebar-menu ul li a:hover i { color: var(--secondary-dark); }

#sidebar-menu ul li ul.sub-menu li a {
    padding: 8px 14px 8px 8px;
    margin-right: 32px;
    font-size: 13.8px;
    font-weight: 500;
    position: relative;
}

#sidebar-menu ul li ul.sub-menu li a::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #c5cbd8;
    margin-left: 8px;
    flex-shrink: 0;
    transition: background .12s linear;
}

#sidebar-menu ul li ul.sub-menu li a:hover::before { background: var(--secondary); }

.mm-active > a, .mm-active .active {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
    font-weight: 700;
}

.mm-active > a i, .mm-active .active i { color: var(--primary) !important; }

.sidebar-menu-scroll {
    padding-bottom: 30px;
    height: calc(100% - var(--topbar-h));
    margin-top: var(--topbar-h);
}

/* سهم القوائم الفرعية — يظل ملاصقًا للحافة مع نظام flex */
#sidebar-menu .has-arrow::after {
    margin-right: auto;
    float: none;
}

/* ---------- منطقة المحتوى — تقليل المسافات ---------- */
.page-content {
    padding: calc(var(--topbar-h) + 14px) 14px 40px 14px !important;
    margin-top: 0 !important;
}

.container-fluid { padding-left: 6px; padding-right: 6px; }

.page-title-box {
    padding-bottom: 10px !important;
    margin-bottom: 6px;
}

.page-title-box h4 {
    font-size: 17px !important;
    font-weight: 800;
    color: var(--text-dark) !important;
}

/* تقليل الفراغات الرأسية المتكررة في كل الصفحات */
.page-content .mb-4 { margin-bottom: 1rem !important; }
.page-content .mt-4 { margin-top: 1rem !important; }
.page-content .row { margin-left: -8px; margin-right: -8px; }
.page-content .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }

/* ---------- الكروت ---------- */
.card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-top: 0;
    margin-bottom: 14px;
    transition: box-shadow .15s linear;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-body { padding: 16px; }

.card-title {
    color: var(--text-dark);
    font-weight: 800;
    font-size: 15px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ---------- الأزرار ---------- */
.btn {
    margin-bottom: 4px;
    margin-left: 4px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    padding: .5rem 1.1rem;
    transition: all .13s linear;
    box-shadow: none !important;
}

.btn-primary, .btn-primary:focus {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover, .btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    transform: translateY(-1px);
}

.btn-success, .btn-info, .btn-success:focus, .btn-info:focus {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #fff !important;
}

.btn-success:hover, .btn-info:hover {
    background-color: var(--secondary-dark) !important;
    border-color: var(--secondary-dark) !important;
    transform: translateY(-1px);
}

.btn-outline-primary { color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-outline-primary:hover { background: var(--primary) !important; color: #fff !important; }

.btn-sm { padding: .28rem .6rem; font-size: 12px; border-radius: 6px; }

/* أزرار تصدير الجداول DataTables */
.dt-buttons .btn {
    background-color: #fff !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--card-border) !important;
    padding: .32rem .7rem !important;
    font-size: 12.5px;
}

.dt-buttons .btn:hover {
    background-color: var(--secondary) !important;
    color: #fff !important;
    border-color: var(--secondary) !important;
}

/* ---------- النماذج ---------- */
.form-control, .custom-select, select.form-control {
    border: 1px solid var(--field-border) !important;
    border-radius: 8px !important;
    height: 42px;
    padding: .45rem .9rem !important;
    background-color: var(--field-bg) !important;
    color: var(--text-dark);
    font-size: 13.5px;
    transition: border-color .13s linear, box-shadow .13s linear, background-color .13s linear;
}

textarea.form-control { height: auto; }

.form-control:focus, .custom-select:focus {
    border-color: var(--secondary) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 139, 210, .12) !important;
}

.form-control::placeholder { color: #a8b0c0; }

.form-group { margin-bottom: .8rem; }

.form-group label, label {
    font-size: 12.5px;
    font-weight: 700;
    color: #4a5065;
    margin-bottom: .3rem;
}

.input-group-text {
    border: 1px solid #dde2ec;
    background-color: var(--body-bg);
    border-radius: 8px;
    font-size: 12.5px;
}

/* select2 لو مستخدمة */
.select2-container--default .select2-selection--single {
    border: 1px solid #dde2ec !important;
    border-radius: 8px !important;
    height: 36px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 34px !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px !important; }

/* ---------- الجداول ---------- */
.table {
    color: var(--text-dark);
    margin-bottom: .5rem;
}

.table th, .table td {
    padding: .5rem .65rem !important;
    vertical-align: middle !important;
    font-size: 12.8px;
    border-color: #eef1f6 !important;
}

.table thead th, table th {
    background-color: #f6f8fb;
    color: #3d4358 !important;
    font-weight: 800;
    font-size: 12.3px;
    white-space: nowrap;
    border-bottom: 1px solid var(--card-border) !important;
}

.table-hover tbody tr:hover, .table tbody tr:hover {
    background-color: var(--primary-soft);
}

.table-bordered { border: 1px solid var(--card-border) !important; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dde2ec !important;
    border-radius: 8px !important;
    padding: .3rem .6rem !important;
    background-color: #fff !important;
}

.dataTables_info { font-size: 12px; color: var(--text-muted); }

/* ---------- الترقيم (pagination) ---------- */
.pagination .page-link {
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    border-radius: 6px !important;
    margin: 0 2px;
    font-size: 12.5px;
    padding: .3rem .65rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff;
}

.pagination .page-link:hover { background-color: var(--primary-soft); color: var(--primary); }

/* ---------- الشارات والتنبيهات ---------- */
.badge { border-radius: 6px; font-weight: 700; padding: .32em .55em; }

.alert {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 13px;
    padding: .7rem 1rem;
}

.alert-success { background-color: #e8f7ef; color: #14794a; border-right: 4px solid #22ab68; }
.alert-danger { background-color: #fdeeee; color: #b03434; border-right: 4px solid #e05252; }
.alert-warning { background-color: #fef6e7; color: #a2740c; border-right: 4px solid #f0ad2d; }

/* تنبيهات النظام العائمة (رسائل النجاح/الخطأ بعد الحفظ) */
.flash-alerts {
    position: fixed;
    top: calc(var(--topbar-h) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    width: min(620px, 92vw);
    pointer-events: none;
}

.flash-alerts .alert {
    pointer-events: auto;
    margin-bottom: 8px;
    animation: flashSlideDown .25s ease-out;
}

@keyframes flashSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- القوائم المنسدلة والمودالات ---------- */
.dropdown-menu {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 13px;
}

.dropdown-item { padding: .45rem 1.1rem; }
.dropdown-item:hover { background-color: var(--primary-soft); color: var(--primary); }

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(20, 25, 45, .18);
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    padding: 14px 18px;
}

.modal-header .modal-title { font-weight: 800; color: var(--text-dark); }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--card-border); padding: 12px 18px; }

/* ---------- الفوتر ---------- */
.footer {
    background-color: transparent;
    box-shadow: none;
    border-top: 1px solid var(--card-border);
    height: 46px;
    padding: 12px;
    font-size: 12px;
}

/* ---------- صفحة تسجيل الدخول ---------- */
.authentication-bg {
    background: linear-gradient(135deg, #faf5fa 0%, #f0faf9 100%) !important;
}

.login .form-data {
    background-color: #fff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 34px 28px 20px;
}

.login .form-content .form-control {
    height: 46px;
    border: 1px solid #dde2ec;
    border-radius: 10px;
}

.login .custom-bnt {
    border-radius: 10px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    transition: all .15s linear;
}

.login .custom-bnt:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 167, 157, .3); }

.login .image-content {
    background-color: #fff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

/* ============================================================
   المرحلة الثانية — وضوح الخط والأيقونات وتفاصيل احترافية
   ============================================================ */

/* ---------- وضوح الخط ---------- */
body {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.65;
    color: #333849;
}

h1, h2, h3, h4, h5, h6 { font-weight: 900; line-height: 1.4; }

p, td, li, span { letter-spacing: 0; }

.text-muted { color: #8a90a5 !important; }

a { color: var(--primary); transition: color .12s linear; }
a:hover { color: var(--primary-dark); }

/* ---------- وضوح الأيقونات ---------- */
#sidebar-menu ul li a i {
    font-size: 20px;
    min-width: 32px;
    text-align: center;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar-header .noti-icon i,
.navbar-header .header-item i {
    font-size: 19px;
    vertical-align: middle;
}

.btn i { font-size: 14px; vertical-align: middle; margin-left: 4px; }
.btn-sm i { font-size: 12.5px; }

.table td i { font-size: 15px; vertical-align: middle; }

/* أيقونات الإجراءات في الجداول (تعديل / حذف / عرض) */
.table td .btn-sm { min-width: 30px; }

/* ---------- عنوان الصفحة بشرطة مميزة ---------- */
.page-title-box h4 {
    position: relative;
    padding-right: 12px;
}

.page-title-box h4::before {
    content: "";
    position: absolute;
    right: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

/* ---------- كروت الإحصائيات في الداشبورد ---------- */
.card [data-plugin="counterup"] { font-weight: 900; color: var(--text-dark); }

.card-body h4 { font-size: 18px; }

/* كروت الإحصائيات المدمجة */
.stat-mini .card-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

.stat-mini .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-mini .stat-icon i { font-size: 26px; line-height: 1; }

/* الأرقام تتبع حجم خط النظام المختار من الإعدادات */
.stat-mini .stat-data h5 {
    font-size: calc(var(--app-font-size, 14px) + 3px);
    font-weight: 900;
    margin: 0 0 2px;
    color: var(--text-dark);
    white-space: nowrap;
}

.stat-mini .stat-data p {
    font-size: calc(var(--app-font-size, 14px) - 1.5px);
    color: var(--text-muted);
    margin: 0;
}

/* بطاقات المؤشرات تتبع لوحة ألوان النظام.
   الأحمر وحده يبقى ثابتًا لأنه دلالة خسارة أو مرتجع لا لون تصميم. */
.stat-mini .bg-soft-primary   { background: var(--primary-soft); }   .stat-mini .bg-soft-primary i   { color: var(--primary); }
.stat-mini .bg-soft-secondary { background: var(--secondary-soft); } .stat-mini .bg-soft-secondary i { color: var(--secondary); }
.stat-mini .bg-soft-success   { background: var(--primary-soft); }   .stat-mini .bg-soft-success i   { color: var(--primary-dark); }
.stat-mini .bg-soft-warning   { background: var(--accent-soft); }    .stat-mini .bg-soft-warning i   { color: var(--accent); }
.stat-mini .bg-soft-danger    { background: #fdeeee; }               .stat-mini .bg-soft-danger i    { color: #e05252; }
.stat-mini .bg-soft-info      { background: var(--secondary-soft); } .stat-mini .bg-soft-info i      { color: var(--secondary-dark); }
.stat-mini .bg-soft-dark      { background: var(--primary-soft); }   .stat-mini .bg-soft-dark i      { color: var(--primary-dark); }
.stat-mini .bg-soft-purple    { background: var(--accent-soft); }    .stat-mini .bg-soft-purple i    { color: var(--accent); }

/* ---------- تحسين قراءة الجداول ---------- */
.table thead th, table th {
    font-size: 12.8px;
    letter-spacing: 0;
    padding-top: .6rem !important;
    padding-bottom: .6rem !important;
}

.table td { font-size: 13.3px; color: #3d4358; }

/* تظليل تبادلي خفيف لسهولة تتبع الصفوف */
.table tbody tr:nth-child(even) { background-color: #fbfcfe; }
.table tbody tr:nth-child(even):hover,
.table tbody tr:hover { background-color: var(--primary-soft) !important; }

/* ---------- عناصر النماذج أوضح ---------- */
.form-control, .custom-select, select.form-control { font-size: 13.5px; height: 38px; }

.form-group label, label { font-size: 13px; color: #3d4358; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 15px; height: 15px; }

::placeholder { color: #a5aabc !important; opacity: 1; }

/* ---------- تفاصيل إضافية ---------- */
.breadcrumb { background: transparent; padding: 0; font-size: 12.5px; }
.breadcrumb-item.active { color: var(--primary); font-weight: 700; }

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
}

.nav-tabs .nav-link.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.dropdown-divider { border-color: var(--card-border); }

/* حالة فارغة أوضح في الجداول */
.dataTables_empty { padding: 28px !important; color: var(--text-muted); font-size: 13.5px; }

/* ============================================================
   أزرار الإجراءات في الجداول (عرض / تعديل / حذف) — أكبر وأوضح
   ============================================================ */
.table td .btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    margin: 2px 3px !important;
    box-shadow: 0 1px 3px rgba(20, 25, 45, .12) !important;
}

.table td .btn i {
    font-size: 19px !important;
    line-height: 1;
    margin: 0 !important;
    vertical-align: middle;
}

.table td .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(20, 25, 45, .2) !important;
}

/* ألوان أوضح للإجراءات الثلاثة */
.table td .btn-success { background-color: var(--secondary) !important; border-color: var(--secondary) !important; }
.table td .btn-primary { background-color: var(--primary) !important; border-color: var(--primary) !important; }
.table td .btn-danger  { background-color: #e05252 !important; border-color: #e05252 !important; }

/* ============================================================
   تحسين منطقة الفلاتر وأزرار الإضافة أعلى الجداول
   ============================================================ */

/* أزرار الإضافة (إضافة جديد، التصنيفات...) */
.page-content .d-flex .btn.w-md {
    height: 38px;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap;
}

.page-content .d-flex .btn.w-md i { font-size: 16px; }

/* حقل البحث فوق الجدول — مجموعة موحدة أنيقة */
.page-content .input-group {
    box-shadow: var(--shadow-sm);
    border-radius: 9px;
    background: #fff;
}

.page-content .input-group .form-control {
    border: 1px solid var(--card-border) !important;
    border-left: none !important;
    border-radius: 0 9px 9px 0 !important;
    height: 40px;
    box-shadow: none !important;
}

.page-content .input-group .form-control:focus { border-color: var(--secondary) !important; }

.page-content .input-group .input-group-append .btn {
    border-radius: 9px 0 0 9px !important;
    margin: 0 !important;
    height: 40px;
    min-width: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-content .input-group .input-group-append .btn i { font-size: 15px; margin: 0; }

/* فلاتر select و date فوق الجداول */
.page-content form .form-control,
.page-content form .custom-select { background-color: #fff !important; }

/* ============================================================
   تحسين إطار الجدول داخل الكارت
   ============================================================ */
.card-body .table-responsive { border-radius: 8px; }

.table.table-bordered thead th { border-bottom: 2px solid #dfe4ee !important; }

/* شريط أدوات الجدول (نسخ/إكسل/PDF) — محاذاة ومسافة مضبوطة */
.dt-buttons { margin-bottom: 10px; }
.dt-buttons .btn { margin: 0 0 0 6px !important; height: 34px; display: inline-flex; align-items: center; }
.dt-buttons .btn i { margin-left: 4px; font-size: 13px; }

/* نص "عرض X إلى Y من Z سجل" */
.dataTables_info {
    font-size: 12.5px !important;
    color: var(--text-muted) !important;
    padding-top: 12px !important;
    font-weight: 500;
}

/* رأس الجدول قابل للفرز — مؤشر أوضح */
.table thead th.sorting, .table thead th.sorting_asc, .table thead th.sorting_desc { cursor: pointer; }
.table thead th.sorting_asc, .table thead th.sorting_desc { color: var(--primary) !important; }

/* تحديد النص بلون الهوية */
*::selection { background-color: var(--primary); color: #fff; }
*::-moz-selection { background-color: var(--primary); color: #fff; }

/* ============================================================
   المرحلة الثالثة — رمز الريال، البحث، اللوجين، ولمسات نهائية
   ============================================================ */

/* ---------- رمز الريال — أكبر وبلون مميز ---------- */
.riyal-symbol {
    font-size: 1.3em;
    font-weight: 400;
    color: var(--secondary);
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}

.stat-mini .stat-data h5 .riyal-symbol { font-size: 1.15em; }

/* ---------- شريط البحث في الهيدر ---------- */
.app-search { padding: 0 !important; display: flex; align-items: center; }

.app-search .position-relative { display: flex; align-items: center; }

.app-search .form-control {
    width: 230px;
    height: 38px !important;
    border-radius: 19px !important;
    background-color: var(--body-bg) !important;
    border: 1.5px solid transparent !important;
    padding: 0 40px 0 16px !important;
    font-size: 13px;
    transition: width .2s ease, border-color .15s linear, background-color .15s linear, box-shadow .15s linear;
}

.app-search .form-control:focus {
    width: 320px;
    background-color: #fff !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 4px rgba(0, 167, 157, .1) !important;
}

.app-search span.uil-search {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1;
    pointer-events: none;
}

.app-search .form-control:focus ~ span.uil-search,
.app-search .position-relative:focus-within span.uil-search { color: var(--secondary); }

/* ---------- شاشة اللوجين — تصميم جديد ---------- */
.authentication-bg {
    background: linear-gradient(135deg, #f7f0f7 0%, #f9f9fb 45%, #ecf8f7 100%) !important;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* دوائر زخرفية بألوان الهوية */
.authentication-bg::before,
.authentication-bg::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .16;
    pointer-events: none;
    z-index: 0;
}

.authentication-bg::before {
    width: 420px; height: 420px;
    background: var(--primary);
    top: -140px; right: -120px;
}

.authentication-bg::after {
    width: 380px; height: 380px;
    background: var(--secondary);
    bottom: -120px; left: -100px;
}

.authentication-bg .nav-content,
.authentication-bg .login { position: relative; z-index: 1; }

.authentication-bg .nav-content { padding-top: 18px; }

.login { padding-top: 20px; }

.login .form-data {
    background-color: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(233, 237, 244, .9);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(20, 25, 45, .1);
    padding: 40px 34px 24px;
}

.login .heading {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-dark) !important;
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.login .heading::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 54px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.login .form-content .form-control {
    height: 50px;
    background-color: #f6f8fb !important;
    border: 1.5px solid transparent !important;
    border-radius: 12px !important;
    font-size: 14px;
    padding: 0 18px !important;
    transition: all .15s linear;
}

.login .form-content .form-control:focus {
    background-color: #fff !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 4px rgba(0, 167, 157, .1) !important;
}

.login .custom-bnt {
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    box-shadow: 0 6px 18px rgba(0, 167, 157, .28);
    transition: all .15s linear;
}

.login .custom-bnt:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 167, 157, .38);
}

.login .custom-bnt span { font-size: 16px; font-weight: 900; }

.login .image-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.login .form-content .is-invalid { border-color: #e05252 !important; }
.login .invalid-feedback { font-size: 12px; font-weight: 700; }

/* ---------- الجداول — رأس ثابت عند التمرير وتحسينات ---------- */
.table-responsive { max-height: 72vh; }

.table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--card-border);
}

.table-responsive::-webkit-scrollbar { height: 8px; width: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #c5cbd8; border-radius: 8px; }

.table td { line-height: 1.6; }

/* أول عمود أوضح قليلًا */
.table tbody td:first-child { font-weight: 700; color: var(--text-dark); }

/* ---------- لمسات نهائية عامة ---------- */

/* شريط علوي بخط هوية متدرج */
#page-topbar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

/* حركة ناعمة للقوائم المنسدلة */
.dropdown-menu.show { animation: dropIn .16s ease-out; }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-7px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* حلقة تركيز موحدة للأزرار */
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(146, 39, 143, .18) !important; }

/* صورة المستخدم في الهيدر */
.header-profile-user {
    width: 34px;
    height: 34px;
    border: 2px solid var(--secondary-soft);
    box-shadow: 0 1px 4px rgba(20, 25, 45, .1);
}

/* عداد الإشعارات */
.noti-icon .badge {
    font-size: 10px;
    min-width: 17px;
    height: 17px;
    line-height: 13px;
    box-shadow: 0 0 0 2px #fff;
}

/* ---------- تجاوب الموبايل ---------- */
@media (max-width: 992px) {
    .vertical-menu { top: var(--topbar-h); }
    .page-content { padding: calc(var(--topbar-h) + 12px) 10px 40px 10px !important; }
    .card-body { padding: 12px; }
    body { font-size: 13.5px; }
    .login .form-data { padding: 26px 18px 16px; }
    .authentication-bg::before, .authentication-bg::after { display: none; }
}

} /* نهاية @media screen */

/* ============================================================
   قسم المحاسبة — شريط تنقّل موحّد وعناوين فرعية في القائمة
   ============================================================ */
@media screen {

/* شريط تنقّل شاشات المحاسبة — تصميم رسمي بأيقونات القالب */
.acc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.acc-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.2px;
    font-weight: 600;
    color: #5b6478;
    background: transparent;
    border: 1px solid transparent;
    transition: all .13s linear;
    white-space: nowrap;
    position: relative;
}
.acc-nav-item i {
    font-size: 16px;
    line-height: 1;
    color: #9aa4b2;
    transition: color .13s linear;
}
.acc-nav-item:hover {
    color: var(--primary);
    background: var(--primary-soft);
    text-decoration: none;
}
.acc-nav-item:hover i { color: var(--primary); }
.acc-nav-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(7, 123, 155, .28);
}
.acc-nav-item.active i { color: #fff; }
.acc-nav-item.active:hover { background: var(--primary-dark); color: #fff; }

@media (max-width: 991px) {
    .acc-nav { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
    .acc-nav::-webkit-scrollbar { height: 4px; }
    .acc-nav::-webkit-scrollbar-thumb { background: #c7cddb; border-radius: 4px; }
    .acc-nav-item { font-size: 12.4px; padding: 7px 11px; }
    .acc-nav-item i { font-size: 15px; }
}
/* عناوين فرعية داخل القائمة الجانبية لفصل مجموعات المحاسبة */
#sidebar-menu ul li.menu-sub-title {
    padding: 10px 20px 4px;
    font-size: 10.8px;
    font-weight: 800;
    color: #9aa4b2;
    letter-spacing: .3px;
    text-transform: none;
    pointer-events: none;
}
#sidebar-menu ul li.menu-sub-title:not(:first-child) {
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding-top: 10px;
}

}

/* ============================================================
   القائمة الجانبية — تصميم مطوّر
   القياسات بوحدة em لتتناسب تلقائيًا مع خط النظام المختار
   ============================================================ */
@media screen {

.vertical-menu {
    background: #fff;
    border-left: 1px solid var(--card-border);
    box-shadow: 2px 0 12px rgba(20, 25, 45, .03);
}

#sidebar-menu { padding: 6px 0 20px; }

/* اسم الشركة أعلى القائمة */
#sidebar-menu .metismenu > li.text-center {
    padding: 0.7em 0.9em;
    font-size: 0.95em;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    margin: 6px 10px 12px;
    box-shadow: 0 4px 12px rgba(7, 123, 155, .22);
    letter-spacing: .2px;
}

/* عنصر رئيسي */
#sidebar-menu ul li a {
    padding: 0.62em 0.9em;
    font-size: 1.02em;
    font-weight: 600;
    color: #4a5065;
    border-radius: 10px;
    margin: 2px 8px;
    display: flex;
    align-items: center;
    gap: 0.1em;
    position: relative;
    transition: background-color .14s ease, color .14s ease, transform .14s ease;
}

#sidebar-menu ul li a i {
    font-size: 1.28em;
    min-width: 1.75em;
    color: #98a1b3;
    transition: color .14s ease, transform .14s ease;
}

#sidebar-menu ul li a:hover {
    background-color: var(--primary-soft);
    color: var(--primary-dark);
    transform: translateX(-2px);
}
#sidebar-menu ul li a:hover i { color: var(--primary); transform: scale(1.08); }

/* العنصر النشط — شريط جانبي مميّز */
#sidebar-menu .mm-active > a,
#sidebar-menu ul li a.active {
    background: linear-gradient(90deg, var(--primary-soft), rgba(234, 245, 249, .35)) !important;
    color: var(--primary-dark) !important;
    font-weight: 800;
}
#sidebar-menu .mm-active > a::after,
#sidebar-menu ul li a.active::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 22%;
    height: 56%;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--primary);
}
#sidebar-menu .mm-active > a i,
#sidebar-menu ul li a.active i { color: var(--primary) !important; }

/* القوائم الفرعية */
#sidebar-menu ul li ul.sub-menu {
    padding: 2px 0 6px;
    margin: 0 14px 4px;
    border-right: 1.5px solid #eef1f6;
}

#sidebar-menu ul li ul.sub-menu li a {
    padding: 0.46em 0.7em 0.46em 0.5em;
    margin-right: 12px;
    margin-left: 4px;
    font-size: 0.93em;
    font-weight: 500;
    color: #626b80;
    border-radius: 8px;
}

#sidebar-menu ul li ul.sub-menu li a::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #cbd2de;
    margin-left: 9px;
    flex-shrink: 0;
    transition: background .14s ease, transform .14s ease;
}
#sidebar-menu ul li ul.sub-menu li a:hover {
    background: var(--secondary-soft);
    color: var(--secondary-dark);
    transform: none;
}
#sidebar-menu ul li ul.sub-menu li a:hover::before {
    background: var(--secondary);
    transform: scale(1.5);
}
#sidebar-menu ul li ul.sub-menu li a.active::after { display: none; }
#sidebar-menu ul li ul.sub-menu li a.active::before { background: var(--primary); transform: scale(1.5); }

/* عناوين فرعية تفصل مجموعات القسم */
#sidebar-menu ul li.menu-sub-title {
    padding: 0.75em 1.4em 0.3em;
    font-size: 0.72em;
    font-weight: 800;
    color: #a3abbb;
    letter-spacing: .4px;
    pointer-events: none;
}
#sidebar-menu ul li.menu-sub-title:not(:first-child) {
    margin-top: 4px;
    border-top: 1px solid #f0f3f7;
    padding-top: 0.75em;
}

/* سهم القوائم */
#sidebar-menu .has-arrow::after {
    margin-right: auto;
    float: none;
    font-size: .95em;
    opacity: .5;
    transition: opacity .14s ease;
}
#sidebar-menu ul li a:hover.has-arrow::after { opacity: .9; }

}

/* ============================================================
   شريط ترقيم الصفحات بالأرقام — nlayout.shared.pager
   كان هذا التنسيق داخل screen_css.blade.php وحده، وهو جزئية
   تُضمَّن في 32 شاشة فقط. وبعد أن صار القالبُ الافتراضيَّ لكل
   الشاشات (AppServiceProvider) لزم أن ينتقل إلى ملف عام،
   وإلا ظهر الشريط بلا تنسيق في الشاشات التي لا تُضمِّنها
   — ومنها القيود.
   ============================================================ */
.pgr { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.pgr-info { font-size:12.3px; color:#7b8794; }
.pgr-info b { color:#1f2733; font-variant-numeric:tabular-nums; }
.pgr .pagination { margin:0; flex-wrap:wrap; gap:4px; }
.pgr .page-item .page-link {
    min-width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center;
    border-radius:9px; border:1px solid #e2e8f1; color:#5b6472; font-size:13px; font-weight:700;
    padding:0 9px; margin:0; font-variant-numeric:tabular-nums; transition:all .13s linear;
}
.pgr .page-item .page-link:hover { background:#f3f6fa; color:var(--primary,#077B9B);
                                   border-color:var(--primary,#077B9B); text-decoration:none; }
.pgr .page-item.active .page-link { background:var(--primary,#077B9B);
                                    border-color:var(--primary,#077B9B); color:#fff; }
.pgr .page-item.disabled .page-link { color:#c2c9d4; background:#fff; border-color:#eef1f6;
                                      pointer-events:none; }
.pgr .page-item .page-link i { font-size:16px; line-height:1; }

@media (max-width: 575.98px) {
    .pgr { justify-content:center; }
    .pgr-info { width:100%; text-align:center; }
}
