@charset "UTF-8";

/* 1. تعريف ألوان هوية سعد (Purple/Indigo) */
:root {
    --brand-primary: #5e35b1;          /* اللون البنفسجي الأساسي */
    --brand-gradient-start: #7e57c2;   /* بداية التدرج */
    --brand-gradient-end: #4527a0;     /* نهاية التدرج */
    --brand-shadow: rgba(94, 53, 177, 0.3);
    --bs-card-cap-color: ;
}


/* 2. تغيير لون الأزرار والتدرجات الأساسية */
.btn-primary, 
.bg-gradient-primary,
.card.bg-gradient-primary,
.bg-primary {
    background-image: linear-gradient(310deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%) !important;
    background-color: var(--brand-primary) !important;
    border: none !important;
}

.btn-primary:hover, .btn-primary:active {
    background-color: var(--brand-primary) !important;
    box-shadow: 0 7px 14px var(--brand-shadow), 0 3px 6px rgba(0, 0, 0, 0.08) !important;
}

/* 3. تلوين الروابط النشطة والأيقونات في القائمة الجانبية */
.nav-link.active i {
    color: var(--brand-primary) !important;
}

.nav-link.active .nav-link-text {
    color: var(--brand-primary) !important;
    font-weight: 700;
}

/* تغيير لون أيقونات القائمة الجانبية الملونة */
.icon-shape-primary {
    background-color: var(--brand-primary) !important;
}

/* 4. تلوين عناوين المجموعات (مثل Account Pages) */
.sidenav .nav-item h6 {
    color: var(--brand-primary) !important;
}

/* 5. تلوين قناع الصور في صفحة تسجيل الدخول */
.mask.bg-gradient-primary {
    background-image: linear-gradient(310deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%) !important;
}

/* 6. تغيير لون الخلفية العلوية (Header Background) */
/* نقوم بتغيير اللون الداكن الافتراضي ليتناسب مع الهوية البصرية */
.bg-dark {
    background-color: var(--brand-primary) !important;
    background-image: linear-gradient(310deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%) !important;
}

/* نضمن أن الخلفية المطلقة في أعلى لوحة التحكم تتغير أيضاً */
.min-height-300.bg-dark {
    background-color: var(--brand-primary) !important;
    background-image: linear-gradient(310deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%) !important;
}

/* SAAD Dashboard Custom Overrides - RTL Deep Fixes */

/* --- 1. إصلاح الخط العربي والاتجاه العام --- */
html[dir="rtl"], html[dir="rtl"] body {
    font-family: 'Cairo', sans-serif !important;
    direction: rtl;
}

[dir="rtl"] .form-control, [dir="rtl"] .btn {
    font-family: 'Cairo', sans-serif !important;
}

/* --- 2. إصلاح محاذاة تلميح الحقول (Placeholders) --- */
[dir="rtl"] .form-control {
    text-align: right !important;
    direction: rtl !important;
}

[dir="rtl"] .form-control::placeholder { text-align: right !important; direction: rtl !important; }

/* --- 3. إصلاح زر التبديل (Switch) و Checkbox --- */
[dir="rtl"] .form-check {
    padding-right: 1.5em;
    padding-left: 0;
    text-align: right;
}

[dir="rtl"] .form-check .form-check-input {
    float: right;
    margin-right: -1.5em;
    margin-left: 0;
}

[dir="rtl"] .form-switch {
    padding-right: 2.5em;
    padding-left: 0;
}

[dir="rtl"] .form-switch .form-check-input {
    margin-right: -2.5em;
    margin-left: 0;
    background-position: right center;
}

[dir="rtl"] .form-switch .form-check-input:checked {
    background-position: left center;
}

[dir="rtl"] .form-switch .form-check-label {
    margin-bottom: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .card .card-header {
    padding: 1.5rem;
    background-color: transparent;
}

[dir="rtl"] .input-group .form-control {
  border-right: 0 !important;
  padding-right: 0;
  border-left: 1px solid #d2d6da !important;
}

[dir="rtl"] .form-select {
  background-position: left 0.75rem center;
}

/* [dir="rtl"] .input-group .form-control:focus {
    border-left: 1px solid #5e72e4 !important;
} */

[dir="rtl"] .input-group> :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  border-left: 1px solid #d2d6da !important;
}

[dir="rtl"] .input-group .form-control:not(:first-child) {
    border-left: 0;
    padding-left: 0.5rem;
}




/* --- 4. إصلاحات هيكلية لوحة التحكم (Dashboard Layout) لـ RTL --- */

/* نقل القائمة الجانبية (Sidebar) لليمين وإلغاء قيم اليسار تماماً */
html[dir="rtl"] .sidenav.fixed-start {
    right: 0 !important;
    left: auto !important;
}

/* إصلاح الكلاس ms-4 الذي يظهر في لقطة الشاشة ويسبب إزاحة خاطئة */
html[dir="rtl"] .sidenav.ms-4 {
    margin-left: 0 !important;
    margin-right: 1.5rem !important; /* تحويل المارجن لليمين */
}

/* إزاحة أيقونة إغلاق السايدبار في الموبايل */
html[dir="rtl"] #iconSidenav {
    left: auto !important;
    right: 0 !important;
}

/* ضبط هوامش المحتوى الرئيسي (Main Content) ليتناسب مع موقع السايدبار الجديد */
@media (min-width: 1200px) {
    /* التعديل المطلوب: إصلاح المحدد المباشر الذي يسبب المشكلة في لقطة الشاشة */
    html[dir="rtl"] .sidenav.fixed-start + .main-content {
        margin-left: 0 !important;
        margin-right: 17.125rem !important;
    }

    /* ضمان التوافق مع الكلاس g-sidenav-show */
    html[dir="rtl"].g-sidenav-show .main-content {
        margin-right: 17.125rem !important;
        margin-left: 0 !important;
    }
    
    /* عند إخفاء السايدبار */
    html[dir="rtl"].g-sidenav-hidden .main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    /* إصلاح موقع النافبار العلوي الثابت */
    html[dir="rtl"].g-sidenav-show .navbar-main {
        right: 18.125rem !important; /* عرض السايدبار + هامش بسيط */
        left: 1.5rem !important;
        width: auto !important;
    }
}

/* محاذاة عناصر القائمة الجانبية */
[dir="rtl"] .sidenav .nav-link-text {
    margin-right: 10px !important;
    margin-left: 0 !important;
    text-align: right;
}

/* إصلاح عناوين المجموعات في القائمة الجانبية (مثل Account pages) */
html[dir="rtl"] .sidenav .nav-item h6 {
    padding-left: 0 !important;
    padding-right: 1.5rem !important; /* البديل العربي لـ ps-4 */
    margin-left: 0 !important;
    margin-right: 0.5rem !important; /* البديل العربي لـ ms-2 */
    text-align: right;
}

/* قلب الأيقونات والأسهم في القائمة */
[dir="rtl"] .sidenav .nav-link i {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* إصلاح Breadcrumbs */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right !important;
    padding-left: 0.5rem !important;
    padding-right: 0 !important;
}

/* محاذاة البحث والنافبار */
/* [dir="rtl"] .navbar-main .ms-md-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
} */

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}


/* --- 5. إصلاحات الجداول والعناصر الداخلية --- */
[dir="rtl"] .table thead th {
    text-align: right !important;
}

[dir="rtl"] .table tbody td {
    text-align: right !important;
}

[dir="rtl"] .avatar {
    margin-left: 0.75rem !important;
    margin-right: 0 !important;
}

/* --- 6. إصلاحات صفحة تسجيل الدخول --- */
html[dir="rtl"] .fixed-side-image {
    left: 0 !important;
    right: auto !important;
}

html[dir="rtl"] .login-form-container {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}