/* الألوان الأساسية */
:root {
    --bg-main: #141414;
    --sidebar-bg: #1c1c1c;
    --card-bg: #1e1e1e;
    --accent-orange: #ff8c32;
    /* لون برتقالي أكثر وضوحاً */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    /* لون رمادي فاتح للنصوص الفرعية */
    --accent-color: #9d4edd;
    /* اللون المميز الرئيسي - يتم تغييره من صفحة المظهر */
}

html,
body {
    overflow-x: clip;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: Tajawal !important;
}

/* القائمة الجانبية - الافتراضي للشاشات الكبيرة */
.sidebar {
    width: 80px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-left: 1px solid #333;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
}

.content-area {
    margin-right: 80px;
    /* ترك مساحة للسايدبار في الديسكتوب */
    padding: 40px 60px;
    min-height: 100vh;
}

/* ============================================================
   التجاوب - Tablet (768px - 991px)
   ============================================================ */
@media (min-width: 769px) and (max-width: 991px) {
    .sidebar {
        display: flex !important;
        width: 70px !important;
    }

    .content-area {
        margin-right: 70px !important;
        padding: 25px 30px !important;
    }

    .mobile-top-bar {
        display: none !important;
    }
}

/* ============================================================
   التجاوب - Mobile (max 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* إخفاء السايدبار الجانبي كلياً في الموبايل */
    .sidebar {
        display: none !important;
    }

    /* المحتوى يأخذ العرض الكامل */
    .content-area {
        margin-right: 0 !important;
        padding: 15px 15px 90px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* إظهار هيدر الموبايل */
    .mobile-top-bar {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 1040;
        width: 100%;
        background-color: rgba(20, 20, 20, 0.97);
        backdrop-filter: blur(10px);
    }

    /* إخفاء عنوان الهيدر الديسكتوب في الموبايل */
    .responsive-header h4.d-md-none {
        display: block !important;
    }

    .responsive-header h4.d-none.d-md-block,
    .responsive-header span.d-none.d-md-block {
        display: none !important;
    }

    /* حقل البحث */
    .search-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 52px !important;
    }

    .search-input {
        padding-right: 55px !important;
        padding-left: 45px !important;
        font-size: .875rem !important;
        height: 52px !important;
    }

    .db-icon-right {
        right: 5px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
    }

    .search-icon-left {
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 1rem !important;
    }

    /* أزرار الفلترة - تمرير أفقي */
    .filter-scroll-container .d-flex {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        padding: 8px 5px !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    /* القائمة المنسدلة الرئيسية في الموبايل */
    .main-custom-menu {
        position: fixed !important;
        right: 15px !important;
        left: 15px !important;
        top: 65px !important;
        width: calc(100% - 30px) !important;
    }
}

/* القائمة المنسدلة للديسكتوب (حتى تبقى ثابتة عند التمرير) */
@media (min-width: 769px) {
    .main-custom-menu {
        position: fixed !important;
        top: 25px !important;
        right: 100px !important;
        /* عرض السايدبار + مسافة */
        width: 250px;
    }
}

/* العناوين والنصوص */
@media (max-width: 768px) {
    header h4 {
        font-size: 1rem !important;
    }

    .placeholder-title {
        font-size: 20px;
    }

    .placeholder-subtitle {
        font-size: 14px;
    }

    .search-icon-box {
        width: 70px;
        height: 70px;
    }

    /* البطاقات */
    .knowledge-update-card,
    .knowledge-card {
        margin-bottom: 10px;
    }
}

/* أيقونات الجنب */
.side-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: 0.3s;
}

.side-icon.active {
    background-color: var(--accent-orange);
    color: white;
    box-shadow: 0 0 20px rgba(255, 140, 50, 0.4);
}

/* صندوق البحث */
.search-container {
    max-width: 850px;
    background: #252525;
    border: 1px solid #444;
    border-radius: 15px;
    height: 60px;
    display: flex;
    align-items: center;
}

.search-input {
    background: transparent !important;
    border: none !important;
    color: white !important;
    width: 100%;
    padding: 0 70px 0 50px;
    font-size: 1.1rem;
}

.search-input::placeholder {
    color: #666;
}

.db-icon-right {
    position: absolute;
    right: 10px;
    background: var(--accent-orange);
    padding: 10px 15px;
    border-radius: 10px;
    color: white;
}

.search-icon-left {
    position: absolute;
    left: 20px;
    color: #888;
    font-size: 1.2rem;
}

/* الأزرار */
.filter-btn {
    background: #2a2a2a;
    color: var(--text-secondary);
    border: 1px solid #444;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: .875rem !important;
}

.filter-btn:hover {
    color: white;
    border-color: var(--accent-orange);
}

.filter-btn.active {
    background: var(--accent-orange);
    color: white;
    border: none;
}

/* البطاقات */
.update-card {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.badge-custom {
    padding: 5px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: white;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* زر المساعدة */
.help-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* تنسيق الزر عند الفتح */
.custom-dropdown-btn.show {
    background: var(--accent-orange) !important;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(255, 140, 50, 0.5);
}

/* القائمة المنسدلة */
.custom-dropdown-menu {
    background: rgba(30, 30, 30, 0.95);
    /* لون داكن شفاف */
    backdrop-filter: blur(10px);
    /* تأثير زجاجي */
    border: 1px solid #444;
    border-radius: 15px;
    padding: 10px;
    min-width: 220px;
    margin-top: 10px !important;
    text-align: right;
}

/* عناصر القائمة */
.custom-dropdown-menu .dropdown-item {
    color: #b0b0b0;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: .875rem !important;
    transition: 0.3s;
}

/*.custom-dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}*/

/* العنصر النشط داخل القائمة (كل الأحكام) */
.active-item {
    color: var(--accent-color) !important;
    /* اللون المميز النصي */
    background: transparent !important;
}

.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
}

/* أيقونات ملونة */
.text-purple {
    color: var(--accent-color);
}

/* إزالة سهم البوتستراب الافتراضي */
.dropdown-toggle::after {
    display: none;
}

/* تأثير التوهج للزر النشط */
.filter-btn.active {
    background: var(--accent-orange);
    color: white;
}

/* تنسيق العناصر داخل القائمة */
.custom-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    flex-direction: row;
    /* يضمن الترتيب من اليمين لليسار لأننا في وضع RTL */
    padding: 10px 15px;
    color: #b0b0b0;
    text-align: right;
    border-radius: 10px;
}

/* جعل النص يأخذ المساحة المتاحة في الوسط */
.flex-grow-1 {
    flex-grow: 1;
}

/* النقطة البنفسجية في اليسار */
.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: #a885f7;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(168, 133, 247, 0.6);
}

/* مساحة فارغة للعناصر غير النشطة لضمان توازي النصوص */
.dot-placeholder {
    width: 8px;
    height: 8px;
    display: inline-block;
}

/* تعديل لون النص للعنصر النشط */
.active-item {
    color: #a885f7 !important;
}

/* أيقونة المطرقة في العنصر النشط */
.active-item i {
    color: #a885f7;
}

.text-end {
    text-align: right !important;
}

/* الحالة الافتراضية للسهم (يشير للأسفل) */
.arrow-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    /* سرعة ونعومة الحركة */
    margin-right: 10px;
    /* مسافة بسيطة من النص */
    font-size: 0.8rem;
}

/* عندما تفتح القائمة (Bootstrap يضيف كلاس show للزر) */
.custom-dropdown-btn.show .arrow-icon {
    transform: rotate(180deg);
    /* قلب السهم للأعلى */
}

/* الحالة العادية للزر */
.filter-btn {
    background: #2a2a2a;
    color: #b0b0b0;
    border: 1px solid #444;
    transition: all 0.3s ease;
}

/* الحالة عند الضغط والبقاء عليه (بدون جافا سكربت) */
.filter-btn:focus {
    background: var(--accent-orange) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(255, 140, 50, 0.5);
    outline: none;
    /* لإخفاء إطار التركيز الافتراضي للمتصفح */
}

/* لجعل اللون يظهر أيضاً في اللحظة التي تضغط فيها بالفأرة */
.filter-btn:active {
    transform: scale(0.98);
    /* تأثير ضغطة بسيطة */
}

.filter-btn {
    /* التأكد من ثبات الحجم */
    box-sizing: border-box;
    border: 1px solid #444 !important;
    transition: none !important;
    /* إلغاء أي انيميشن ناعم قد يسبب اهتزاز */
}

.filter-btn:focus,
.filter-btn:active {
    /* منع المتصفح من تحريك الصفحة للتركيز على الزر */
    outline: none !important;
    box-shadow: none !important;
    /* إلغاء الظل إذا كان يسبب حركة بصرية */

    /* المحافظة على نفس حدود الزر لكي لا يتحرك */
    border: 1px solid transparent !important;

    /* تغيير اللون فقط */
    background: var(--accent-orange) !important;
    /* استخدم لون سادة بدل التدرج إذا استمرت الحركة */
}

.icon-container {
    width: 45px;
    height: 45px;
    background-color: var(--accent-orange);
    /* اللون البرتقالي الأساسي */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    /* حواف دائرية ناعمة */
    color: white;
    /* لون أيقونة الميزان */
    box-shadow: 0 4px 12px rgba(255, 140, 50, 0.3);
    /* توهج بسيط */
}

.icon-container svg {
    width: 28px;
    /* حجم الأيقونة داخل المربع */
    height: 28px;
}

/* الخلفية العامة للموقع (إذا لم تكن موجودة) */
body {
    background-color: #1a1a1a;
}

/* تنسيق البطاقة */
.knowledge-card {
    background-color: #2a2a2a;
    border-radius: 15px;
    border: 1px solid #333;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.knowledge-card:hover {
    border-color: #a885f7;
    /* توهج بسيط عند التحويم */
    transform: translateY(-5px);
}

/* اللون المميز للأيقونات */
.text-purple {
    color: var(--accent-color) !important;
}

/* شارة "جديد" الخضراء */
.badge-new {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* خطوط الفصل والوثائق */
.border-secondary {
    border-color: #444 !important;
}

.text-purple {
    color: var(--accent-color) !important;
}

.knowledge-card {
    background-color: #2a2a2a;
    border-radius: 15px;
    border: 1px solid #383838;
}

.me-3 {
    margin-right: 1rem !important;
}

/* تأكد من أن الحاوية الرئيسية لا تحصر العرض */
.main-wrapper {
    width: 100%;
    max-width: none !important;
}

/* لجعل حقل البحث يأخذ مساحة أكبر كما في الفيجما */
.search-container {
    width: 100%;
    max-width: 1200px;
    /* يمكنك تكبير هذه القيمة أو جعلها 100% */
}

/* تحسين شكل السكرول بار للأزرار */
.filter-scroll-container .d-flex::-webkit-scrollbar {
    display: none;
}

/* تحسين شكل السكرول بار للأزرار المنزلقة على الموبايل */
.search-section .d-flex::-webkit-scrollbar {
    display: none;
}







/* ===== إصلاح القوائم المنسدلة ===== */

/* السماح للدروب داون بالظهور خارج حاوية السكرول */
.filter-scroll-container {
    overflow: visible !important;
}

.custom-scrollbar-hide {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: visible !important;
}

/* ضمان أن القائمة تظهر فوق العناصر الأخرى */
.dropdown-menu {
    z-index: 9999 !important;
    /* لا تضع position هنا - Popper يحتاج يتحكم فيها */
}

.dropdown {
    position: relative !important;
}

/* شريط السكرول الأفقي */
.mobile-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    padding-top: 10px;
    padding-bottom: 20px;
}

.mobile-scroll::-webkit-scrollbar {
    height: 0px;
    display: none;
}

/* القائمة المنسدلة - تنسيق فقط، بدون تدخل في التموضع */
.custom-dropdown-menu {
    /* لا تضع position أو transform هنا - Popper يتحكم فيها */
    min-width: 220px !important;
    z-index: 9999 !important;
    background-color: #1e1e1e !important;
    border: 1px solid #333 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
    border-radius: 12px !important;
    padding: 8px !important;
}

/* تصميم القائمة المنسدلة الرئيسي */


/* حجم الخطوط الصغير */
.smaller {
    font-size: 11px;
    color: #888;
}

/* تنسيق العناصر عند التمرير */
.main-custom-menu .dropdown-item {
    transition: 0.3s;
    font-size: 14px;
    color: #bbb !important;
}

.main-custom-menu .dropdown-item:hover {
    background-color: #333;
    color: #fff !important;
}

/* العنصر النشط (بنفسجي من الصورة) */
.active-link {
    background-color: #9d7dfa !important;
    /* اللون البنفسجي */
    color: white !important;
}

.active-link .dot-indicator {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

/* إيقونة العناصر */
.main-custom-menu i {
    font-size: 1.1rem;
    color: inherit;
}

/* محاذاة القائمة لليسار قليلاً بالنسبة للسايدبار */
.dropdown-menu[aria-labelledby="mainMenu"] {
    left: 70px !important;
    right: auto !important;
}

/* تأثير الظل */
.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

.main-custom-menu {
    display: none;
    /* بوتستراب سيغيرها إلى block عند الضغط */
    position: absolute !important;
    z-index: 9999 !important;
    /* لضمان ظهورها فوق كل شيء */
}

.main-custom-menu.show {
    display: block !important;
}

.main-custom-menu {
    display: none;
    position: absolute !important;
    transform: translate3d(70px, 0px, 0px) !important;
    /* تحريكها بجانب السايدبار */
    z-index: 99999 !important;
}

/* الكلاس الذي سيتحكم فيه الجافا سكريبت */
.main-custom-menu.show {
    display: block !important;
}

.main-custom-menu {
    display: none;
    position: absolute !important;
    /* ضبط التموضع ليظهر بجانب الشريط الجانبي الأيمن */
    top: 0 !important;
    right: 150px !important;
    /* هذه المسافة تبعدها عن الشريط الجانبي الأيمن */
    left: auto !important;

    /* ضبط الاتجاه ليكون من اليمين لليسار */
    direction: rtl !important;
    text-align: right !important;

    background-color: #262626 !important;
    border: 1px solid #333 !important;
    border-radius: 15px !important;
    width: 260px;
    padding: 0;
    z-index: 99999 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

@media (max-width: 767px) {
    .main-custom-menu {
        /* تظهر فقط عند إضافة كلاس الفتح بالجافا سكريبت، وإذا كنت تريدها تظهر مباشرة غيرها لـ block */
        display: none;

        position: absolute !important;
        /* ضبط التموضع ليظهر بجانب الشريط الجانبي الأيمن */
        top: 0 !important;
        right: 70px !important;
        /* هذه المسافة تبعدها عن الشريط الجانبي الأيمن */
        left: auto !important;

        /* ضبط الاتجاه ليكون من اليمين لليسار */
        direction: rtl !important;
        text-align: right !important;

        background-color: #262626 !important;
        border: 1px solid #333 !important;
        border-radius: 15px !important;
        width: 260px;
        padding: 0;
        z-index: 99999 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    }
}


/* التأكد من محاذاة العناصر داخل القائمة */
.main-custom-menu .dropdown-item {
    display: flex !important;
    flex-direction: row-reverse !important;
    /* لضمان الأيقونة على اليسار والنص يمين */
    justify-content: flex-end !important;
    align-items: center;
    padding: 10px 15px !important;
    color: #bbb !important;
    font-size: 14px;
}

.main-custom-menu .dropdown-item i {
    margin-right: 10px;
    /* مسافة بين النص والأيقونة */
    margin-left: 0;
}

/* تنسيق العنصر النشط */
.active-link {
    background-color: #9d7dfa !important;
    color: white !important;
    flex-direction: row !important;
    /* لإظهار النقطة البيضاء على اليمين */
    justify-content: space-between !important;
}

.me-2 {
    margin-right: .5rem !important;
}

/* تنسيق العنصر النشط مع نقل النقطة لأقصى اليسار */
.active-link {
    background-color: #9d7dfa !important;
    /* اللون البنفسجي */
    color: white !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    /* عكس الاتجاه لنقل النقطة لليسار */
    justify-content: space-between !important;
    /* توزيع المحتوى بين الطرفين */
    align-items: center !important;
    padding: 10px 15px !important;
}

/* حاوية النص والأيقونة لضمان بقائهما سوياً على اليمين */
.menu-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    /* المسافة بين النص والأيقونة */
}

/* تنسيق النقطة البيضاء */
.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    flex-shrink: 0;
    /* منع انكماش النقطة */
}

.active-link {
    background-color: #9d7dfa !important;
    /* اللون البنفسجي */
    color: white !important;
    direction: rtl !important;
    /* لضمان أن الترتيب يبدأ من اليمين */
    border-radius: 0 !important;
    /* إذا كنت تريدها مستطيلة كما في الصورة */
}

/* الأيقونة جهة اليمين */
.active-link i {
    order: 1;
    /* يضمن ظهورها أولاً جهة اليمين */
}

/* النص بجانب الأيقونة */
.active-link span:not(.dot-indicator) {
    order: 2;
    font-size: 14px;
    font-weight: 500;
}

/* النقطة أقصى اليسار */
.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    order: 3;
    /* تظهر في الأخير (جهة اليسار في RTL) */
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    /* وهج خفيف مثل الصورة */
}

.search-placeholder-section {
    padding: 100px 20px;
    text-align: center;
    background-color: transparent;
    /* لكي يأخذ خلفية الموقع الداكنة */
}

/* تنسيق حاوية الأيقونة (المربع البنفسجي الداكن) */
.search-icon-box {
    width: 85px;
    height: 85px;
    background-color: #2d283e;
    /* لون بنفسجي غامق جداً متناسق مع الصورة */
    border: 1.5px solid #4a3f6b;
    /* إطار خفيف */
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9d7dfa;
    /* لون الأيقونة البنفسجي الفاتح */
    box-shadow: 0 0 30px rgba(157, 125, 250, 0.1);
    /* توهج خفيف جداً */
    transition: transform 0.3s ease;
}

.search-icon-box:hover {
    transform: translateY(-5px);
}

/* تنسيق العناوين */
.placeholder-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.placeholder-subtitle {
    color: #888888;
    /* لون رمادي للنص الفرعي */
    font-size: 16px;
    max-width: 500px;
    line-height: 1.6;
}

/* تعديل للموبايل */
@media (max-width: 768px) {
    .placeholder-title {
        font-size: 20px;
    }

    .placeholder-subtitle {
        font-size: 14px;
    }

    .search-icon-box {
        width: 70px;
        height: 70px;
    }
}

/* ========================================================================= */
/* CSS لصفحة نتائج البحث (search.html) */
/* ========================================================================= */

.search-results-section {
    padding: 20px 0;
}

/* الأزرار العلوية */
.btn-dark-custom {
    background-color: #2a2a2a;
    border: 1px solid #444 !important;
    color: #fff;
    border-radius: 10px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-dark-custom:hover {
    background-color: #3a3a3a;
    border-color: #555;
    color: #fff;
}

/* أيقونة قاعدة البيانات بجانب عدد النتائج */
.results-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(168, 133, 247, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(168, 133, 247, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* بطاقة نتيجة البحث */




/* مربع الصلة (Relevance) */
.relevance-badge {
    width: 65px;
    height: 75px;
    background-color: transparent;
    border: 1px solid color-mix(in srgb, var(--accent-color) 40%, transparent);
    border-radius: 12px;
}

.text-purple {
    color: var(--accent-color) !important;
}

/* شارة الحالة (ساري) */
.badge-active {
    background-color: var(--accent-orange);
    color: white;
    border-radius: 8px;
    font-weight: 500;
}

/* ========================================================================= */
/* CSS للقائمة الجانبية (البحث المتقدم - Offcanvas) */
/* ========================================================================= */



.custom-offcanvas .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.5;
}

.custom-offcanvas .btn-close-white:hover {
    opacity: 1;
}

/* القائمة الجانبية للفلاتر (الخط العمودي) */
.custom-checkbox-list {
    border-right: 2px solid #333;
    /* الخط العمودي على اليمين في اللغة العربية */
}

/* تخصيص الـ Checkbox */
.custom-checkbox {
    background-color: transparent !important;
    border: 2px solid #555 !important;
    border-radius: 4px !important;
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background-color: var(--accent-orange) !important;
    border-color: var(--accent-orange) !important;
}

.custom-checkbox:focus {
    box-shadow: 0 0 0 0.25rem rgba(168, 133, 247, 0.25) !important;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.95rem;
}

/* تخصيص حقل التاريخ */
.custom-date-input {
    background-color: #242424 !important;
    border: 1px solid #444 !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 10px 15px !important;
    font-size: 0.95rem;
    color-scheme: dark;
    /* يضمن أن أيقونة التقويم الافتراضية تظهر بلون مناسب للخلفية الداكنة */
    transition: all 0.3s ease;
}

.custom-date-input:focus {
    border-color: #a885f7 !important;
    box-shadow: 0 0 0 0.25rem rgba(168, 133, 247, 0.25) !important;
    outline: none;
}

.custom-date-input::placeholder {
    color: #888;
}

.ms-3 {
    margin-left: 1rem !important;
}

.ms-2 {
    margin-left: .5rem !important;
}

/* جعل القوائم المنسدلة قابلة للتمرير */
.custom-dropdown-menu {
    max-height: 50vh;
    overflow-y: auto;
    /* إخفاء شريط التمرير إذا لم يكن ضرورياً */
    scrollbar-width: thin;
    scrollbar-color: #555 #1e1e1e;
}

.custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 10px;
}

/* تخصيص ألوان شريط التمرير للمظهرين الفاتح والسيبيا */
body.light-theme .custom-dropdown-menu {
    scrollbar-color: #ced4da transparent !important;
}

body.light-theme .custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent !important;
}

body.light-theme .custom-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #ced4da !important;
}

body.light-theme .custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd !important;
}

body.sepia-theme .custom-dropdown-menu {
    scrollbar-color: #c9b097 transparent !important;
}

body.sepia-theme .custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent !important;
}

body.sepia-theme .custom-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #c9b097 !important;
}

body.sepia-theme .custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: #bfa68f !important;
}


/* =========================================
   تنسيقات صفحة الوثيقة (document.html)
   ========================================= */

.sticky-top-custom {
    position: sticky;
    top: 30px;
    height: auto;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding-top:20px !important;
}

/* تخصيص السكرول بار للأعمدة الثابتة */
.sticky-top-custom::-webkit-scrollbar {
    width: 4px;
}

.sticky-top-custom::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.bg-card-dark {
    background-color: #1e1e1e !important;
}

.bg-darker {
    background-color: #161616 !important;
}

/* التبويبات */
.custom-doc-tabs .nav-link {
    color: #b0b0b0;
    background: #2a2a2a;
    border: none;
    border-radius: 4px 4px 0 0;
    margin-left: 2px;
    padding: 12px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-doc-tabs .nav-link.active {
    background-color: var(--accent-orange) !important;
    color: #ffffff !important;
    border: none !important;
}

.custom-doc-tabs .nav-link:hover:not(.active) {
    color: #fff;
    background-color: #333;
}

/* تكبير الخط */
.document-content-area {
    transition: font-size 0.2s ease;
}

/* أيقونات الإجراءات */
.action-icons i {
    cursor: pointer;
    transition: color 0.3s;
    font-size: 1.1rem;
}

.action-icons i:hover {
    color: #fff;
}

.link-icon-wrapper {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #2a2a2a;
}

.link-icon-wrapper.active {
    background-color: var(--accent-orange);
    color: white;
}

/* قائمة الشجرة (الارتباطات) */
.tree-list li {
    margin-bottom: 12px;
}

.tree-list li a {
    font-size: 14px;
    color: #e0e0e0;
    transition: color 0.3s;
}

.tree-list li a:hover {
    color: var(--accent-orange);
}

/* الفهرس */
.index-item {
    transition: all 0.3s;
    border-right: 4px solid transparent;
}

.index-item.active {
    background-color: #252525;
    border-right-color: var(--accent-orange);
}

.index-item:hover:not(.active) {
    background-color: #2a2a2a;
}

.index-sub-items {
    background-color: #1a1a1a;
}

.index-sub-item {
    padding: 10px 45px 10px 15px;
    font-size: 0.85rem;
    color: #b0b0b0;
    cursor: pointer;
    transition: color 0.3s;
}

.index-sub-item:hover {
  /*  color: var(--accent-orange);*/
}

.accordion-button:not(.collapsed) {
    color: #fff;
    background-color: rgba(157, 78, 221, 0.1);
    box-shadow: none;
}

.accordion-button::after {
    filter: invert(1);
}

.accordion-button:focus {
    box-shadow: none;
}

/* أدوات التكبير */
.zoom-icons i {
    cursor: pointer;
}

.icon-box-dark {
    background: #252525;
    padding: 2px 8px;
    border-radius: 6px;
    color: #fff;
}

/* البحث المحلي */
.custom-dark-input {
    background-color: #1e1e1e !important;
    border: 1px solid #333 !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 12px 45px 12px 15px !important;
}

.custom-dark-input::placeholder {
    color: #666;
}

.hover-white:hover {
    color: white !important;
}

/* أنيميشن الطي */
.transition-width {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden-panel {
    width: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* تبويبات الأيقونات الجانبية */
.icon-tabs .nav-link {
    background: none;
    border: none;
    color: #888;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    padding: 0;
    font-size: 1.2rem;
}

.icon-tabs .nav-link.active {
    background-color: var(--accent-orange) !important;
    color: #fff !important;
}

.icon-tabs .nav-link:hover:not(.active) {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* التايم لاين (سجل التعديلات) */
.timeline-container {
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    margin-top: 20px;
}

.timeline-item {
    position: relative;
    padding-bottom: 40px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* تحسين السايدبار في الموبايل */
@media (max-width: 991.98px) {
    #rightColumn {
        padding: 15px !important;
    }

    .sidebar-header-wrapper {
        flex-direction: row !important;
        /* ترتيب طبيعي: إكس على اليمين والأيقونات بجانبه */
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        gap: 10px !important;
    }

    .icon-tabs {
        width: auto;
        justify-content: flex-end !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        overflow-x: visible !important;
        /* منع القطع */
    }

    .icon-tabs .nav-link {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }

    #hideRightPanelBtn {
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        order: 2;
        /* إبقاء الإكس في أقصى اليسار في RTL */
    }

    #hideRightPanelBtn i {
        margin: 0 !important;
        font-size: 1.2rem !important;
    }
}

/* تحسين السكرول بار (Scrollbar) في القوائم الجانبية */
#rightColumn,
#leftColumn,
.accordion-body {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-orange) transparent;
}

#rightColumn::-webkit-scrollbar,
#leftColumn::-webkit-scrollbar,
.accordion-body::-webkit-scrollbar {
    width: 6px;
}

#rightColumn::-webkit-scrollbar-track,
#leftColumn::-webkit-scrollbar-track,
.accordion-body::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

#rightColumn::-webkit-scrollbar-thumb,
#leftColumn::-webkit-scrollbar-thumb,
.accordion-body::-webkit-scrollbar-thumb {
    background-color: rgba(157, 78, 237, 0.4);
    border-radius: 20px;
    border: 2px solid transparent;
}

#rightColumn::-webkit-scrollbar-thumb:hover,
#leftColumn::-webkit-scrollbar-thumb:hover {
    background-color: rgba(157, 78, 237, 0.8);
}

/* إضافة مسافة جانبية لمنع السكرول من ملامسة المحتوى */
@media (max-width: 991.98px) {

    #rightColumn,
    #leftColumn {
        padding-left: 10px !important;
        /* مسافة إضافية لجهة السكرول */
        overflow-y: auto;
    }
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -21px;
    top: 5px;
    width: 10px;
    height: 10px;
    background-color: var(--accent-orange);
    border-radius: 50%;
    z-index: 1;
}

.timeline-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-edit {
    background: rgba(255, 140, 50, 0.2);
    color: var(--accent-orange);
}

.badge-add {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.badge-delete {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.timeline-date {
    color: var(--accent-orange);
    font-size: 0.8rem;
    margin-left: 10px;
}

.timeline-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin: 12px 0 8px 0;
}

.timeline-meta {
    color: #888;
    font-size: 0.75rem;
}

.timeline-desc {
    color: #b0b0b0;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 10px;
}

.timeline-icon {
    font-size: 1.1rem;
    color: #888;
    margin-left: 10px;
}

/* تم دمج التجاوب في بداية الملف لضمان الأولوية */

@media (max-width: 991.98px) {

    #rightColumn,
    #leftColumn {
        position: fixed !important;
        top: 0;
        bottom: 0;
        z-index: 1050;
        background: #121212;
        width: 300px !important;
        max-width: 85vw;
        padding: 20px !important;
        transition: transform 0.3s ease-in-out;
    }

    #rightColumn {
        right: 0;
        transform: translateX(100%);
    }

    #leftColumn {
        left: 0;
        transform: translateX(-100%);
    }

    #rightColumn.show-mobile {
        transform: translateX(0);
    }

    #leftColumn.show-mobile {
        transform: translateX(0);
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1040;
        display: none;
    }

    .mobile-overlay.show {
        display: block;
    }

    .zoom-icons,
    .custom-doc-tabs {
        font-size: 0.8rem;
    }

    .custom-doc-tabs .nav-link {
        padding: 8px 10px;
    }
}

@media (max-width: 576px) {
    .custom-doc-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        flex-wrap: nowrap;
    }

    .custom-doc-tabs .nav-item {
        flex: 0 0 auto;
    }

    .document-content-area {
        padding: 15px !important;
    }

    .card.bg-card-dark {
        padding: 15px !important;
    }
}

/* الأحكام المرتبطة */
.article-header {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    margin: 25px 0 15px 0;
}

.article-header::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--accent-orange);
    border-radius: 50%;
    margin-left: 10px;
}

.judgment-card {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.judgment-card:hover {
    background-color: var(--accent-orange);
    border-color: rgba(157, 78, 221, 0.3);
}

.judgment-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.judgment-meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

.judgment-meta b {
    color: #666;
    font-weight: 500;
}

/* القوالب */
.template-card {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.template-card:hover {
    background-color: #222;
    border-color: rgba(157, 78, 221, 0.3);
}

.template-info {
    flex-grow: 1;
    text-align: right;
    padding-right: 15px;
}

.template-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.template-title-row span {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-right: 10px;
}

.template-meta-row {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.template-meta-row b {
    color: #666;
    font-weight: 500;
}

.download-icon {
    color: #888;
    font-size: 17px !important;
    cursor: pointer;
    transition: color 0.2s;
}

.download-icon:hover {
    color: #fff;
}

/* واجهة الدردشة الذكية */
.chat-assistant-container {
    padding: 10px 0;
}

.assistant-status-card {
    background-color: #1a1a1a;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    margin-left: 8px;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.chat-bubble-ai {
    background-color: #252525;
    border-radius: 18px 4px 18px 18px;
    padding: 15px;
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    margin-right: 45px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.ai-avatar-wrapper {
    position: absolute;
    right: -55px;
    top: 0;
    width: 35px;
    height: 35px;
    background-color: var(--accent-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.chat-timestamp {
    font-size: 0.75rem;
    color: #666;
    margin-top: 10px;
    text-align: left;
}

.text-end {
    text-align: right !important;
}



.updates-main-icon-box {
    width: 42px;
    height: 42px;
    background-color: rgba(157, 78, 237, 0.1);
    border: 1px solid rgba(157, 78, 237, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-orange);
    font-size: 1.4rem;
}

.count-badge-light {
    background-color: rgba(255, 255, 255, 0.9);
    color: #1c1c1c;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pulse-dot-green {
    width: 10px;
    height: 10px;
    background-color: #2ec4b6;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(46, 196, 182, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(46, 196, 182, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0);
    }
}

.knowledge-update-card {
    background-color: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    height: 100%;
}

.bg-dark-soft {
    background-color: rgba(255, 255, 255, 0.03);
}

.mobile-menu-toggle {
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}



.knowledge-update-card:hover {
    transform: translateY(-5px);
    border-color: rgba(157, 78, 237, 0.3);
    background-color: #222;
}

.card-badge-new {
    background-color: rgba(46, 196, 182, 0.1);
    color: #2ec4b6;
    border: 1px solid rgba(46, 196, 182, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.card-info-item i {
    font-size: 1.1rem;
    color: #555;
}

.card-doc-id {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.main-custom-menu {
    background-color: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0;
    min-width: 260px;
    z-index: 2000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: fixed;
    right: 90px;
    /* مسافة عن الشريط الجانبي */
    top: 20px;
}

.main-custom-menu.show {
    display: block !important;
}

.menu-header {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-title {
    font-weight: bold;
    font-size: 0.95rem;
    color: #ffffff !important;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #b0b0b0 !important;
    margin-top: 2px;
}

.menu-toggle-icon-btn {
    color: #ffffff !important;
    cursor: pointer;
    font-size: 1.2rem;
}

.dropdown-item {
    transition: all 0.2s ease;
    color: #b0b0b0 !important;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff !important;
}

.active-link {
    background-color: rgba(157, 78, 237, 0.1) !important;
    color: var(--accent-orange) !important;
}

/* إلغاء الإطار الأزرق عند الضغط (Focus) على حقل الإدخال */
.search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    /* إذا كنت تستخدم Bootstrap وتريد إبقاء حدود بلون هادئ بدلاً من الأزرق يمكنك تفعيل السطر التالي: */
    /* border-color: #ccc; */
}

/* تنسيق حاوية البحث لتحديد المواقع بدقة */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* حقل الإدخال: إضافة مسافات من اليمين واليسار حتى لا يتداخل النص مع الأيقونات */
.search-input {
    width: 100%;
    padding-right: 45px;
    /* مسافة للعدسة على اليمين */
    padding-left: 55px;
    /* مسافة لأيقونة قاعدة البيانات على اليسار */
    text-align: right;
    /* محاذاة النص للغة العربية */
}

/* أيقونة العدسة على اليمين */
.search-icon-right {
    position: absolute;
    right: 15px;
    color: #6c757d;
    /* لون رمادي للأيقونة */
    z-index: 5;
    pointer-events: none;
    /* تجعل الضغط يمر مباشرة للحقل */
}

/* أيقونة قاعدة البيانات باللون البرتقالي على اليسار */
.db-icon-left {
    position: absolute;
    left: 5px;
    background-color: var(--accent-orange);
    /* اللون البرتقالي */
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    justify-content: center;
}

/* ============================================================
   المظهر الفاتح (Light Theme)
   ============================================================ */
body.light-theme {
    --bg-main: #f8f9fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
}

body.light-theme .text-white {
    color: #212529 !important;
}

body.light-theme .text-secondary {
    color: #6c757d !important;
}

body.light-theme .bg-dark-soft {
    background-color: #e9ecef !important;
}

body.light-theme .border-secondary {
    border-color: #dee2e6 !important;
}

body.light-theme .knowledge-card,
body.light-theme .knowledge-update-card,
body.light-theme .settings-card,
body.light-theme .pricing-card,
body.light-theme .profile-card,
body.light-theme .stats-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
}

body.light-theme .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .dropdown-item {
    color: #212529 !important;
}

body.light-theme .dropdown-item:hover {
    background-color: #f8f9fa !important;
}

body.light-theme .search-container {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .search-input {
    color: #212529 !important;
}

body.light-theme .filter-btn {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #495057 !important;
}

body.light-theme .theme-card {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

body.light-theme .theme-card.active {
    background-color: rgba(157, 78, 237, 0.1) !important;
    border-color: var(--accent-orange) !important;
    color: var(--accent-orange) !important;
}

body.light-theme .side-icon {
    color: #495057 !important;
}

body.light-theme .side-icon:hover {
    background-color: #e9ecef !important;
}

body.light-theme .menu-header .text-white {
    color: #212529 !important;
}

body.light-theme .pricing-header h1,
body.light-theme .pricing-header h4,
body.light-theme .pricing-header h5,
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
    color: #212529 !important;
}

body.light-theme .table-dark {
    background-color: #ffffff !important;
    color: #212529 !important;
}

body.light-theme .form-control,
body.light-theme .form-select {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.light-theme .table td,
body.light-theme .table th {
    border-color: #dee2e6 !important;
}

body.light-theme .nav-tabs .nav-link {
    color: #6c757d !important;
}

body.light-theme .nav-tabs .nav-link.active {
    color: #212529 !important;
    border-bottom-color: var(--accent-orange) !important;
}

body.light-theme hr {
    border-color: #dee2e6 !important;
}

body.light-theme .btn-primary,
body.light-theme .btn-secondary {
    color: #ffffff !important;
}

/* ============================================================
   السمة الانسيابية (Sepia Theme)
   ============================================================ */
body.sepia-theme {
    --bg-main: #fcf8e3;
    --sidebar-bg: #fdf8e3;
    --card-bg: #fdf8e3;
    --text-primary: #5c4b37;
    --text-secondary: #8c7b67;
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
}

body.sepia-theme .text-white {
    color: #4a3f35 !important;
}

body.sepia-theme .text-secondary {
    color: #8c7b67 !important;
}

body.sepia-theme .bg-dark-soft {
    background-color: #f5eed6 !important;
}

body.sepia-theme .border-secondary {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .knowledge-card,
body.sepia-theme .knowledge-update-card,
body.sepia-theme .settings-card,
body.sepia-theme .pricing-card,
body.sepia-theme .profile-card,
body.sepia-theme .stats-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    box-shadow: none !important;
}

body.sepia-theme .dropdown-menu {
    background-color: #fcf8e3 !important;
    border: 1px solid #e8dfc5 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

body.sepia-theme .dropdown-item {
    color: #5c4b37 !important;
}

body.sepia-theme .dropdown-item:hover {
    background-color: #f5eed6 !important;
}

body.sepia-theme .search-container {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .search-input {
    color: #4a3f35 !important;
}

body.sepia-theme .filter-btn {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #5c4b37 !important;
}

body.sepia-theme .theme-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #5c4b37 !important;
}

body.sepia-theme .theme-card.active {
    background-color: #f5eed6 !important;
    border-color: #4a3f35 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .side-icon {
    color: #5c4b37 !important;
}

body.sepia-theme .side-icon:hover {
    background-color: #f5eed6 !important;
}

body.sepia-theme .menu-header .text-white {
    color: #4a3f35 !important;
}

body.sepia-theme .pricing-header h1,
body.sepia-theme .pricing-header h4,
body.sepia-theme .pricing-header h5,
body.sepia-theme h1,
body.sepia-theme h2,
body.sepia-theme h3,
body.sepia-theme h4,
body.sepia-theme h5,
body.sepia-theme h6 {
    color: #4a3f35 !important;
}

body.sepia-theme .table-dark {
    background-color: #fcf8e3 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .form-control,
body.sepia-theme .form-select {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .table td,
body.sepia-theme .table th {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .nav-tabs .nav-link {
    color: #8c7b67 !important;
}

body.sepia-theme .nav-tabs .nav-link.active {
    color: #4a3f35 !important;
    border-bottom-color: var(--accent-orange) !important;
}

body.sepia-theme hr {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-primary,
body.sepia-theme .btn-secondary {
    color: #ffffff !important;
}

/* ============================================================
   تنسيقات صفحة الوثيقة (document.html) للمظهر الفاتح والسبيا
   ============================================================ */

/* Light Theme - Document */
body.light-theme .bg-card-dark,
body.light-theme .bg-darker {
    background-color: #ffffff !important;
}

body.light-theme .custom-doc-tabs .nav-link {
    background-color: #f8f9fa;
    color: #495057;
}

body.light-theme .custom-doc-tabs .nav-link.active {
    background-color: var(--accent-orange) !important;
    color: #ffffff !important;
}

body.light-theme .custom-doc-tabs .nav-link:hover:not(.active) {
    background-color: #e9ecef;
    color: #212529;
}

body.light-theme .index-item {
    background-color: #ffffff;
}

body.light-theme .index-item.active {
    background-color: #f8f9fa;
}

body.light-theme .index-item:hover:not(.active) {
    background-color: #e9ecef;
}

body.light-theme .index-sub-items {
    background-color: #f8f9fa;
}

body.light-theme .index-sub-item {
    color: #495057;
}

body.light-theme .index-sub-item:hover {
    color: var(--accent-orange);
}

body.light-theme .accordion-button {
    background-color: transparent !important;
    color: #212529 !important;
}

body.light-theme .accordion-button:not(.collapsed) {
    color: var(--accent-orange) !important;
    background-color: rgba(157, 78, 221, 0.1) !important;
}
@media (min-width: 1200px) {
    .fs-4 {
        font-size: 1rem !important;
    }
}
body.light-theme .accordion-button::after {
    filter: none;
}

body.light-theme .custom-dark-input {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.light-theme .icon-box-dark,
body.light-theme .link-icon-wrapper {
    background-color: #f8f9fa;
    color: #495057;
}

body.light-theme .link-icon-wrapper.active {
    background-color: var(--accent-orange);
    color: white;
}

body.light-theme .tree-list li a {
    color: #495057;
}

body.light-theme .tree-list li a:hover {
    color: var(--accent-orange);
}

body.light-theme .icon-tabs .nav-link {
    color: #6c757d;
}

body.light-theme .icon-tabs .nav-link:hover:not(.active) {
    background-color: #e9ecef;
    color: #212529;
}

body.light-theme .action-icons i {
    color: #6c757d;
}

body.light-theme .action-icons i:hover {
    color: #212529;
}

/* Sepia Theme - Document */
body.sepia-theme .bg-card-dark,
body.sepia-theme .bg-darker {
    background-color: #fcf8e3 !important;
}

body.sepia-theme .custom-doc-tabs .nav-link {
    background-color: #f5eed6;
    color: #5c4b37;
}

body.sepia-theme .custom-doc-tabs .nav-link.active {
    background-color: #8c7b67 !important;
    color: #ffffff !important;
}

body.sepia-theme .custom-doc-tabs .nav-link:hover:not(.active) {
    background-color: #e8dfc5;
    color: #4a3f35;
}

body.sepia-theme .index-item {
    background-color: #fcf8e3;
}

body.sepia-theme .index-item.active {
    background-color: #f5eed6;
    border-right-color: #8c7b67;
}

body.sepia-theme .index-item:hover:not(.active) {
    background-color: #e8dfc5;
}

body.sepia-theme .index-sub-items {
    background-color: #f5eed6;
}

body.sepia-theme .index-sub-item {
    color: #5c4b37;
}

body.sepia-theme .index-sub-item:hover {
    color: #4a3f35;
}

body.sepia-theme .accordion-button {
    background-color: transparent !important;
    color: #4a3f35 !important;
}

body.sepia-theme .accordion-button:not(.collapsed) {
    color: #4a3f35 !important;
    background-color: rgba(140, 123, 103, 0.1) !important;
}

body.sepia-theme .accordion-button::after {
    filter: none;
}
.accordion-button{ font-size: 16px !important;}
@media (min-width: 1200px) {
    .h2, h2 {
        font-size: 1.6rem !important;
    }
}
body.sepia-theme .custom-dark-input {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .icon-box-dark,
body.sepia-theme .link-icon-wrapper {
    background-color: #f5eed6;
    color: #5c4b37;
}

body.sepia-theme .link-icon-wrapper.active {
    background-color: #8c7b67;
    color: white;
}

body.sepia-theme .tree-list li a {
    color: #5c4b37;
}

body.sepia-theme .tree-list li a:hover {
    color: #4a3f35;
}

body.sepia-theme .icon-tabs .nav-link {
    color: #8c7b67;
}

body.sepia-theme .icon-tabs .nav-link:hover:not(.active) {
    background-color: #e8dfc5;
    color: #4a3f35;
}

body.sepia-theme .action-icons i {
    color: #8c7b67;
}

body.sepia-theme .action-icons i:hover {
    color: #4a3f35;
}

/* ============================================================
   تكملة لتنسيقات صفحة الوثيقة للمظهر الفاتح
   ============================================================ */
body.light-theme .article-header {
    color: #212529 !important;
}

body.light-theme .judgment-card,
body.light-theme .template-card,
body.light-theme .assistant-status-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .judgment-card:hover,
body.light-theme .template-card:hover {
    background-color: #f8f9fa !important;
    border-color: rgba(157, 78, 221, 0.5) !important;
}

body.light-theme .judgment-title,
body.light-theme .template-title-row span,
body.light-theme .timeline-title {
    color: #212529 !important;
}

body.light-theme .judgment-meta,
body.light-theme .template-meta-row,
body.light-theme .timeline-meta,
body.light-theme .timeline-desc {
    color: #6c757d !important;
}

body.light-theme .judgment-meta b,
body.light-theme .template-meta-row b {
    color: #495057 !important;
}

body.light-theme .download-icon,
body.light-theme .timeline-icon {
    color: #6c757d !important;
}

body.light-theme .download-icon:hover {
    color: #212529 !important;
}

/* ============================================================
   تكملة لتنسيقات صفحة الوثيقة للمظهر السيبيا
   ============================================================ */
body.sepia-theme .article-header {
    color: #4a3f35 !important;
}

body.sepia-theme .judgment-card,
body.sepia-theme .template-card,
body.sepia-theme .assistant-status-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .judgment-card:hover,
body.sepia-theme .template-card:hover {
    background-color: #f5eed6 !important;
    border-color: rgba(140, 123, 103, 0.5) !important;
}

body.sepia-theme .judgment-title,
body.sepia-theme .template-title-row span,
body.sepia-theme .timeline-title {
    color: #4a3f35 !important;
}

body.sepia-theme .judgment-meta,
body.sepia-theme .template-meta-row,
body.sepia-theme .timeline-meta,
body.sepia-theme .timeline-desc {
    color: #8c7b67 !important;
}

body.sepia-theme .judgment-meta b,
body.sepia-theme .template-meta-row b {
    color: #5c4b37 !important;
}

body.sepia-theme .download-icon,
body.sepia-theme .timeline-icon {
    color: #8c7b67 !important;
}

body.sepia-theme .download-icon:hover {
    color: #4a3f35 !important;
}

/* ============================================================
   تنسيقات فقاعة المحادثة للذكاء الاصطناعي للمظهرين الفاتح والسيبيا
   ============================================================ */
body.light-theme .chat-bubble-ai {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.sepia-theme .chat-bubble-ai {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

/* ============================================================
   تنسيقات صفحة الملف الشخصي (profile.html) للمظهرين الفاتح والسيبيا
   ============================================================ */

/* Light Theme - Profile */
body.light-theme .profile-header-card,
body.light-theme .profile-form-card,
body.light-theme .notification-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .form-group-custom label,
body.light-theme .notification-info h6,
body.light-theme .profile-header-card h4 {
    color: #212529 !important;
}

body.light-theme .input-with-icon input {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
    color: #212529 !important;
}

body.light-theme .input-with-icon i {
    color: #8c98a5 !important;
}

body.light-theme .btn-cancel-profile {
    color: #495057 !important;
    border-color: #ced4da !important;
}

body.light-theme .btn-cancel-profile:hover {
    background-color: #f8f9fa !important;
}

/* Sepia Theme - Profile */
body.sepia-theme .profile-header-card,
body.sepia-theme .profile-form-card,
body.sepia-theme .notification-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .form-group-custom label,
body.sepia-theme .notification-info h6,
body.sepia-theme .profile-header-card h4 {
    color: #4a3f35 !important;
}

body.sepia-theme .input-with-icon input {
    background-color: #f5eed6 !important;
    border-color: #e8dfc5 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .input-with-icon i {
    color: #8c7b67 !important;
}

body.sepia-theme .btn-cancel-profile {
    color: #5c4b37 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-cancel-profile:hover {
    background-color: #f5eed6 !important;
}

/* ============================================================
   تنسيقات صفحة الإعدادات (settings.html) للمظهرين الفاتح والسيبيا
   ============================================================ */

/* Light Theme - Settings */
body.light-theme .settings-sidebar {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .settings-nav-section-title {
    color: #8c98a5 !important;
}

body.light-theme .settings-nav-link {
    color: #495057 !important;
}

body.light-theme .settings-nav-link:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

body.light-theme .settings-nav-link.active {
    background-color: rgba(157, 78, 237, 0.1) !important;
    color: var(--accent-orange) !important;
    border-color: rgba(157, 78, 237, 0.2) !important;
}

body.light-theme .settings-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .settings-card-title,
body.light-theme .info-label h6,
body.light-theme .settings-content-header h2,
body.light-theme .settings-nav-header h5 {
    color: #212529 !important;
}

body.light-theme .info-row {
    border-bottom-color: #ced4da !important;
}

body.light-theme .info-label p {
    color: #6c757d !important;
}

body.light-theme .language-select-card {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
}

body.light-theme .language-select-card.active {
    border-color: rgba(157, 78, 237, 0.3) !important;
    background-color: rgba(157, 78, 237, 0.05) !important;
}

body.light-theme .form-check-input {
    border-color: #ced4da !important;
}

body.light-theme .btn-reset {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border-color: #ced4da !important;
}

body.light-theme .btn-reset:hover {
    background-color: #e9ecef !important;
}

/* Sepia Theme - Settings */
body.sepia-theme .settings-sidebar {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .settings-nav-section-title {
    color: #8c7b67 !important;
}

body.sepia-theme .settings-nav-link {
    color: #5c4b37 !important;
}

body.sepia-theme .settings-nav-link:hover {
    background-color: #f5eed6 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .settings-nav-link.active {
    background-color: rgba(140, 123, 103, 0.1) !important;
    color: #8c7b67 !important;
    border-color: rgba(140, 123, 103, 0.2) !important;
}

body.sepia-theme .settings-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .settings-card-title,
body.sepia-theme .info-label h6,
body.sepia-theme .settings-content-header h2,
body.sepia-theme .settings-nav-header h5 {
    color: #4a3f35 !important;
}

body.sepia-theme .info-row {
    border-bottom-color: #e8dfc5 !important;
}

body.sepia-theme .info-label p {
    color: #8c7b67 !important;
}

body.sepia-theme .language-select-card {
    background-color: #f5eed6 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .language-select-card.active {
    border-color: rgba(140, 123, 103, 0.3) !important;
    background-color: rgba(140, 123, 103, 0.05) !important;
}

body.sepia-theme .form-check-input {
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-reset {
    background-color: #f5eed6 !important;
    color: #5c4b37 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .btn-reset:hover {
    background-color: #e8dfc5 !important;
}

/* ============================================================
   تنسيقات صفحة من نحن (about.html) للمظهرين الفاتح والسيبيا
   ============================================================ */

/* Light Theme - About */
body.light-theme .about-hero {
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.9)), url('about_hero_image_1778059600190.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border-color: #ced4da !important;
}

body.light-theme .about-hero h1 {
    color: #212529 !important;
}

body.light-theme .about-card {
    background-color: #ffffff !important;
    border-color: #ced4da !important;
}

body.light-theme .about-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(157, 78, 221, 0.4) !important;
}

body.light-theme .gradient-border>div {
    background: #ffffff !important;
}

body.light-theme .about-card h3,
body.light-theme .about-card h5,
body.light-theme .gradient-border h3,
body.light-theme .about-card .text-white {
    color: #212529 !important;
}

body.light-theme .vision-text {
    color: #495057 !important;
}

/* Sepia Theme - About */
body.sepia-theme .about-hero {
    background: linear-gradient(rgba(253, 248, 227, 0.85), rgba(253, 248, 227, 0.9)), url('about_hero_image_1778059600190.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .about-hero h1 {
    color: #4a3f35 !important;
}

body.sepia-theme .about-card {
    background-color: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
}

body.sepia-theme .about-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(140, 123, 103, 0.4) !important;
}

body.sepia-theme .gradient-border>div {
    background: #fcf8e3 !important;
}

body.sepia-theme .about-card h3,
body.sepia-theme .about-card h5,
body.sepia-theme .gradient-border h3,
body.sepia-theme .about-card .text-white {
    color: #4a3f35 !important;
}

body.sepia-theme .vision-text {
    color: #5c4b37 !important;
}

/* ============================================================
   تنسيقات القائمة الجانبية (Sidebar Menu) لجميع الثيمات
   ============================================================ */

/* إضافة دائرة الدعم والمساعدة "?" للملف الشخصي */
.sidebar a[href="profile.html"]>div {
    position: relative !important;
}


/* Light Theme - Sidebar Overrides */
body.light-theme .sidebar {
    border-left: 1px solid #dee2e6 !important;
}

body.light-theme .sidebar>div[style*="height: 1px"] {
    background-color: #dee2e6 !important;
}

body.light-theme #triggerMenu>div {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
    box-shadow: none !important;
}

body.light-theme #triggerMenu>div svg {
    color: #495057 !important;
}

body.light-theme #triggerMenu>div:hover {
    background-color: #f8f9fa !important;
}

body.light-theme .sidebar .side-icon a[href],
body.light-theme .sidebar .side-icon a[href] i {
    color: #495057 !important;
}

body.light-theme .sidebar .side-icon a[href="settings.html"]:hover i {
    color: #212529 !important;
}

body.light-theme .sidebar a[href="profile.html"]>div {
    box-shadow: none !important;
}

/* Sepia Theme - Sidebar Overrides */
body.sepia-theme .sidebar {
    border-left: 1px solid #e8dfc5 !important;
}

body.sepia-theme .sidebar>div[style*="height: 1px"] {
    background-color: #e8dfc5 !important;
}

body.sepia-theme #triggerMenu>div {
    background-color: #fcf8e3 !important;
    border: 1px solid #e8dfc5 !important;
    color: #4a3f35 !important;
    box-shadow: none !important;
}

body.sepia-theme #triggerMenu>div svg {
    color: #4a3f35 !important;
}

body.sepia-theme #triggerMenu>div:hover {
    background-color: #f5eed6 !important;
}

body.sepia-theme .sidebar .side-icon[style*="background-color: #a882f0"] {
    background-color: #c9b097 !important;
}

body.sepia-theme .sidebar .side-icon[style*="background-color: #a882f0"]:hover {
    background-color: #bfa68f !important;
}

body.sepia-theme .sidebar .side-icon a[href],
body.sepia-theme .sidebar .side-icon a[href] i {
    color: #4a3f35 !important;
}

body.sepia-theme .sidebar .side-icon a[href]:hover i {
    color: #3b322a !important;
}

body.sepia-theme .sidebar a[href="profile.html"]>div {
    background-color: #c9b097 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.sepia-theme .sidebar a[href="profile.html"]>div:hover {
    background-color: #bfa68f !important;
}

/* ============================================================
   تحسينات التباين للمظهر الفاتح والسيبيا (النقطة النشطة ورقم الأمر)
   ============================================================ */

/* استعادة اللون البنفسجي للنقطة النشطة في القوائم المنسدلة للفلترة لجميع الثيمات لزيادة التباين */
.active-item .dot-indicator {
    background-color: var(--accent-orange) !important;
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.6) !important;
}

/* تعديل لون رقم الأمر (رقم الوثيقة) في الكروت */
body.light-theme .card-doc-id {
    color: #495057 !important;
}

body.sepia-theme .card-doc-id {
    color: #5c4b37 !important;
}

/* تعديل لون خلفية وأيقونة قاعدة البيانات في شريط البحث للمظهرين الفاتح والسيبيا */
body.light-theme .db-icon-left,
body.light-theme .db-icon-right {
    background-color: #f8f9fa !important;
    border: 1.5px solid #dee2e6 !important;
    color: #495057 !important;
}

body.light-theme .db-icon-left:hover,
body.light-theme .db-icon-right:hover {
    background-color: #e9ecef !important;
}

body.sepia-theme .db-icon-left,
body.sepia-theme .db-icon-right {
    background-color: #fffdf0 !important;
    border: 1.5px solid #ffd885 !important;
    color: #4a3f35 !important;
}

body.sepia-theme .db-icon-left:hover,
body.sepia-theme .db-icon-right:hover {
    background-color: #ffeeb3 !important;
}

/* تعديل ألوان شعار وعناصر القائمة للمظهرين الفاتح والسيبيا */
body.light-theme .brand-title {
    color: #212529 !important;
}

body.light-theme .brand-subtitle {
    color: #6c757d !important;
}

body.light-theme .menu-toggle-icon-btn {
    color: #495057 !important;
}

body.sepia-theme .brand-title {
    color: #4a3f35 !important;
}

body.sepia-theme .brand-subtitle {
    color: #8c7b67 !important;
}

body.sepia-theme .menu-toggle-icon-btn {
    color: #4a3f35 !important;
}

/* تعديل لون النص والأيقونات داخل عناصر القائمة عند مرور المؤشر عليها (Hover) للمظهرين الفاتح والسيبيا لمنع تحولها للون الأبيض */
body.light-theme .dropdown-item:hover,
body.light-theme .main-custom-menu .dropdown-item:hover {
    color: #212529 !important;
}

body.sepia-theme .dropdown-item:hover,
body.sepia-theme .main-custom-menu .dropdown-item:hover {
    color: #4a3f35 !important;
}

.about-hero {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 0.9)), url('about_hero_image_1778059600190.png');
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    margin-bottom: 60px;
    overflow: hidden;
    border: 1px solid rgba(157, 78, 237, 0.2);
}

.about-card {
    background-color: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    height: 100%;
    transition: all 0.3s ease;
}

.about-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-orange);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.feature-icon-box {
    width: 40px;
    height: 40px;
    background-color: rgba(157, 78, 237, 0.1);
    border: 1px solid rgba(157, 78, 237, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-orange);
    font-size: 1.1rem;
    /*  margin-bottom: 25px;*/
}

.vision-text {
    font-size: 1.25rem;
    line-height: 2;
    color: #b0b0b0;
}

.gradient-border {
    position: relative;
    padding: 2px;
    background: linear-gradient(45deg, var(--accent-orange), transparent);
    border-radius: 22px;
}

.gradient-border>div {
    background: #121212;
    border-radius: 20px;
    padding: 40px;
}

.pricing-header {
    margin-top: 40px;
    margin-bottom: 60px;
}

.pricing-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 15px;
}

.pricing-header p {
    color: #888;
    max-width: 600px;
    margin: 0 auto;
}

.pricing-card {
    background-color: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pricing-card.popular {
    border: 2px solid var(--accent-orange);
    background-color: rgba(157, 78, 237, 0.03);
}

.popular-badge {
    position: absolute;
    top: -15px;
    right: 50%;
    transform: translateX(50%);
    background-color: var(--accent-orange);
    color: white;
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(157, 78, 237, 0.4);
}

.price-tag {
    margin: 30px 0;
}

.price-tag .amount {
    font-size: 3rem;
    font-weight: 800;
    /* color: #fff;*/
}

.price-tag .currency {
    font-size: 1.2rem;
    color: #888;
    margin-right: 8px;
}

.price-tag .period {
    font-size: 0.9rem;
    color: #666;
    display: block;
    margin-top: -5px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    color: #b0b0b0;
    font-size: 0.95rem;
}

.feature-item i.bi-check-circle-fill {
    color: #28a745;
}

.feature-item i.bi-x-circle {
    color: #444;
}

.feature-item.disabled {
    color: #555;
    text-decoration: line-through;
}

.pricing-btn {
    margin-top: auto;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-purple {
    background-color: var(--accent-orange);
    color: white;
    border: none;
}

.btn-purple:hover {
    background-color: #8a3ecd;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(157, 78, 237, 0.3);
}

.btn-outline-secondary-custom {
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    background: transparent;
}

.btn-outline-secondary-custom:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.tax-badge {
    background-color: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #28a745;
    padding: 12px 30px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 50px;
    font-weight: 600;
}

.contact-link {
    color: var(--accent-orange);
    text-decoration: none;
    margin-top: 25px;
    display: block;
    font-weight: 600;
}

.card-icon-box {
    width: 54px;
    height: 54px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 25px;
    align-self: flex-end;
}

.popular .card-icon-box {
    background-color: var(--accent-orange);
}

/* --- تجاوب الموبايل --- */
@media (max-width: 768px) {
    .pricing-header {
        margin-top: 20px;
        margin-bottom: 40px;
    }

    .pricing-header h1 {
        font-size: 1.8rem;
    }

    .pricing-header h5 {
        font-size: 1.1rem;
    }

    .pricing-header p {
        font-size: 0.9rem;
        padding: 0 15px;
    }

    .pricing-card {
        padding: 25px;
    }

    .price-tag .amount {
        font-size: 2.2rem !important;
    }

    .popular-badge {
        font-size: 0.75rem;
        padding: 5px 15px;
        top: -12px;
    }

    .tax-badge {
        padding: 10px 15px;
        font-size: 0.85rem;
        margin-top: 30px;
    }

    .feature-item {
        font-size: 0.85rem;
    }

    .card-icon-box {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
}

/* إضافات الـ CSS الجديدة لتكملة الصفحة */
.language-select-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.language-select-card.active {
    border-color: rgba(157, 78, 237, 0.3);
    background-color: rgba(157, 78, 237, 0.03);
}

.form-check-input {
    width: 22px;
    height: 22px;
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.bg-dark-soft {
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-danger-custom {
    background-color: #ff3b3b;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-danger-custom:hover {
    background-color: #e63535;
}

.btn-save {
    background-color: var(--accent-orange);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 12px;
    font-weight: 700;
}

.btn-reset {
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 35px;
    border-radius: 12px;
    font-weight: 700;
}

.rounded-sm {
    border-radius: 4px;
}

.settings-wrapper {
    display: flex;
    height: calc(100vh - 120px);
    gap: 24px;
}

/* قائمة الإعدادات الجانبية */
.settings-sidebar {
    width: 280px;
    background-color: #1a1a1a;
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-nav-header {
    margin-bottom: 30px;
}

.settings-nav-section-title {
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    margin-top: 25px;
    padding-right: 10px;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 12px;
    color: #b0b0b0;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.settings-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.settings-nav-link.active {
    background-color: rgba(157, 78, 237, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(157, 78, 237, 0.2);
}

.settings-nav-link i {
    font-size: 1.1rem;
}

/* منطقة محتوى الإعدادات */
.settings-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-left: 10px;
}

.settings-content-header {
    margin-bottom: 35px;
}

.settings-card {
    background-color: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 24px;
}

.settings-card-title {
    color: #fff;
    font-weight: 700;
    margin-bottom: 30px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    text-align: right;
}

.info-label h6 {
    color: #fff;
    margin-bottom: 4px;
    font-weight: 600;
}

.info-label p {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.info-value {
    text-align: left;
}

.info-value h6 {
    font-weight: 700;
}

.status-badge {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 5px;
}

.remaining-days {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-orange);
}

.btn-upgrade {
    background-color: var(--accent-orange);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    width: 100%;
    font-weight: 700;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.btn-upgrade:hover {
    background-color: #8a3ecd;
    box-shadow: 0 10px 20px rgba(157, 78, 237, 0.2);
}

/* استهداف عناصر النص داخل الوضع الانسيابي الفاتح */
body.sepia-theme .view-toggle-content,
body.sepia-theme .view-toggle-wrapper,
body.sepia-theme .tree-list,
body.sepia-theme details,
body.sepia-theme p,
body.sepia-theme li {
    color: #212529 !important;
    /* لون داكن مريح جداً للقراءة على الخلفية البيج */
    opacity: 1 !important;
    /* إلغاء أي شفافية باهتة متبقية من الوضع الداكن */
}

/* ضبط لون نصوص القوائم النقطية الفرعية (Nested Lists) الظاهرة في الصورة */
body.sepia-theme ul,
body.sepia-theme ol {
    color: #212529 !important;
}

/* إذا كانت النصوص مدمجة داخل روابط */
body.sepia-theme .view-toggle-content a,
body.sepia-theme .tree-list a {
    color: #212529 !important;
}

@media (max-width: 991.98px) {

    /* تحويل خلفية القائمة المنبثقة في الجوال إلى لون السيبيا الفخم */
    .sepia-theme #leftColumn,
    .sepia-theme #leftColumn .position-sticky,
    .sepia-theme #leftColumn .card {
        background-color: #f4ecd8 !important;
        /* درجة سيبيا متناسقة تماماً مع الخلفية */
        border-right: 1px solid rgba(43, 38, 31, 0.1) !important;
    }

    /* تحويل نصوص العناوين والروابط وزر العودة إلى اللون الداكن */
    .sepia-theme #leftColumn a,
    .sepia-theme #leftColumn span,
    .sepia-theme #leftColumn h6,
    .sepia-theme #leftColumn .text-white,
    .sepia-theme #leftColumn .btn-link {
        color: #2b261f !important;
    }

    /* جعل مربع البحث يظهر بلون خلفية أغمق قليلاً ونص داكن ليتضح مكانه */
    .sepia-theme #leftColumn input,
    .sepia-theme #leftColumn .search-box {
        background-color: #eae0c7 !important;
        color: #2b261f !important;
        border: 1px solid rgba(43, 38, 31, 0.2) !important;
    }

    /* ضبط لون أيقونات البحث والإغلاق (X) */
    .sepia-theme #leftColumn i,
    .sepia-theme #leftColumn .bi-search,
    .sepia-theme #leftColumn .bi-x-lg {
        color: #2b261f !important;
    }
}


/* ==========================================================================
   ضبط أزرار الجوال وأيقونات التحكم في الحجم لتتناسب مع وضع الـ Sepia
   ========================================================================== */

/* 1. استهدف أزرار الجوال (الارتباطات والفهرس) */
.sepia-theme .d-lg-none .btn-dark,
.sepia-theme #mobileRightToggle,
.sepia-theme #mobileLeftToggle {
    background-color: #eae0c7 !important;
    /* خلفية بني دافئة متناسقة مع النمط */
    color: #2b261f !important;
    /* نص وأيقونات داكنة واضحة */
    border-color: rgba(43, 38, 31, 0.2) !important;
    /* حدود ناعمة غير حادة */
    transition: all 0.2s ease-in-out;
}

/* تأثير الـ Hover والـ Focus عند الضغط على الأزرار في الجوال */
.sepia-theme .d-lg-none .btn-dark:hover,
.sepia-theme .d-lg-none .btn-dark:focus {
    background-color: #dfd4b8 !important;
    /* أغمق قليلاً لمنح شعور بالضغط */
    color: #2b261f !important;
}

/* 2. استهدف أيقونات التكبير والتصغير وإعادة الحجم الافتراضي (Zoom Icons) */
.sepia-theme .zoom-icons i,
.sepia-theme .zoom-icons .bi-zoom-in,
.sepia-theme .zoom-icons .bi-zoom-out {
    color: #2b261f !important;
    /* تحويل الأيقونات للون البني الداكن بدلاً من الرمادي الباهت */
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sepia-theme .zoom-icons i:hover {
    opacity: 1;
    /* تفاعل ناعم عند تمرير الفأرة */
}

/* 3. صندوق أيقونة إعادة التكبير الوسطى (icon-box-dark أو الـ div المحيط بها) */
.sepia-theme .zoom-icons #resetZoomBtn,
.sepia-theme .zoom-icons .icon-box-dark {
    background-color: #eae0c7 !important;
    /* نفس درجة خلفية الأزرار الدافئة */
    color: #2b261f !important;
    border: 1px solid rgba(43, 38, 31, 0.15) !important;
    padding: 4px 8px;
    border-radius: 6px;
}

@media (max-width: 991.98px) {

    /* تحويل خلفية لوحة سجل التعديلات والارتباطات الجانبية في الجوال إلى نمط السيبيا */
    .sepia-theme #rightColumn,
    .sepia-theme #rightColumn .sticky-top-custom,
    .sepia-theme #rightColumn .tab-content,
    .sepia-theme #rightColumn .tab-pane {
        background-color: #fcf8e3 !important;
        /* نفس درجة السيبيا الناعمة للموقع */
        border-left: 1px solid rgba(43, 38, 31, 0.1) !important;
    }

    /* تحويل التبويبات العلوية (الأيقونات) وعناوين السجل والتواريخ إلى لون داكن */
    .sepia-theme #rightColumn .nav-tabs .nav-link,
    .sepia-theme #rightColumn h6,
    .sepia-theme #rightColumn .timeline-title,
    .sepia-theme #rightColumn .timeline-meta,
    .sepia-theme #rightColumn .timeline-desc,
    .sepia-theme #rightColumn .timeline-date,
    .sepia-theme #rightColumn .article-header,
    .sepia-theme #rightColumn .tree-list a {
        color: #2b261f !important;
    }

    /* تحويل الأيقونات (أيقونة الساعة، المطرقة، الروبوت، إلخ) للون الداكن */
    .sepia-theme #rightColumn i,
    .sepia-theme #rightColumn .bi {
        color: #2b261f !important;
    }

    /* تفتيح كروت الجداول والأحكام المرتبطة لتبرز بشكل لطيف وسلس */
    .sepia-theme #rightColumn .timeline-item,
    .sepia-theme #rightColumn .judgment-card,
    .sepia-theme #rightColumn .template-card,
    .sepia-theme #rightColumn .assistant-status-card {
        background-color: #eae0c7 !important;
        border: 1px solid rgba(43, 38, 31, 0.15) !important;
    }
}

/* ==========================================================================
   إعادة تصميم سجل التعديلات والارتباطات في وضع السيبيا (الجوال والديسكتوب)
   ========================================================================== */
.sepia-theme #rightColumn,
.sepia-theme #rightColumn .sticky-top-custom {
    background-color: #efe6cf !important;
    /* خلفية اللوحة الأساسية: درجة سيبيا دافئة وعميقة */
}

/* إعادة بناء كروت الأحداث (Timeline Items) والارتباطات */
.sepia-theme #rightColumn .timeline-item,
.sepia-theme #rightColumn .judgment-card,
.sepia-theme #rightColumn .template-card {
    background-color: #fbf7ed !important;
    /* لون الكرت الداخلي: فاتح ومريح ليعطي تبايناً ممتازاً */
    border: 1px solid rgba(43, 38, 31, 0.08) !important;
    border-radius: 12px !important;
    /* زوايا منحنية ناعمة واحترافية */
    padding: 16px !important;
    /* مساحة تنفس مريحة للنصوص بالداخل */
    box-shadow: 0 4px 12px rgba(43, 38, 31, 0.04) !important;
    /* ظلال ناعمة جداً لمنح عمق وثلاثية أبعاد */
    margin-bottom: 14px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* تأثير خفيف ومميز عند تمرير الفأرة فوق الكروت */
.sepia-theme #rightColumn .timeline-item:hover,
.sepia-theme #rightColumn .judgment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(43, 38, 31, 0.08) !important;
}

/* تحسين نصوص الميتا والتواريخ داخل السجل */
.sepia-theme #rightColumn .timeline-date,
.sepia-theme #rightColumn .timeline-meta {
    color: #7c6e59 !important;
    /* لون بني متوسط أنيق للبيانات الثانوية */
    font-size: 0.85rem !important;
}

.sepia-theme #rightColumn .timeline-title {
    color: #2b261f !important;
    font-weight: 700 !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
}

/* ==========================================================================
   تحسينات مظهرية فخمة للوضع الداكن (Dark Mode)
   ========================================================================== */

/* 1. ضبط التبويبات النشطة لتبدو مريحة وبدون ألوان فاقعة */
.custom-doc-tabs .nav-link.active {
    background-color: rgba(232, 216, 196, 0.15) !important;
    /* استخدام لون براندك الدافئ بشفافية ناعمة */
    color: #E8D8C4 !important;
    /* لون براندك الأساسي المعتمد */
    border: 1px solid rgba(232, 216, 196, 0.25) !important;
    border-bottom: transparent !important;
    font-weight: 600 !important;
}

/* 2. تحسين كرت معلومات الوثيقة لترتيب البيانات */
.bg-card-dark {
    background-color: #16161a !important;
    /* لون خلفية داكن عميق ومريح */
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* تنسيق العناوين الجانبية الصغيرة داخل جدول المعلومات */
.bg-card-dark .text-secondary {
    color: #a0aec0 !important;
    /* رمادي فاتح ناصع لسهولة القراءة */
    font-size: 0.85rem !important;
    letter-spacing: 0.5px;
    margin-bottom: 4px !important;
}

/* تنسيق القيم والنصوص المقابلة لها */
.bg-card-dark .text-white {
    color: #ffffff !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
}

/* تجميل الفواصل الداخلية للجدول */
.bg-card-dark border-end {
    border-color: rgba(255, 255, 255, 0.08) !important;
}


/* ==========================================================================
   1. حل مشكلة الأيقونة الدائرية المأكولة وتنظيف التبويبات العلوية
   ========================================================================== */
#rightColumn .icon-tabs {
    border: none !important;
    /* إزالة أي خطوط متضاربة من البوتستراب */
    padding: 0 !important;
    margin: 0 !important;
}

#rightColumn .icon-tabs .nav-link {
    border: none !important;
    background: transparent !important;
    width: 42px !important;
    /* تحديد عرض ثابت ومتساوي للأيقونة */
    height: 42px !important;
    /* تحديد ارتفاع ثابت ليصنع دائرة مثالية */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    /* إجبار العنصر على اتخاذ شكل دائري كامل 100% */
    transition: all 0.2s ease-in-out !important;
}

/* شكل الأيقونة النشطة في وضع السيبيا - دائرة مريحة وغير مأكولة */
.sepia-theme #rightColumn .icon-tabs .nav-link.active {
    background-color: #b5a489 !important;
    /* لون دافئ وهادئ بدلاً من البنفسجي الحاد */
    color: #fbf7ed !important;
    /* لون الأيقونة الداخلي فاتح وناصع */
}

/* شكل الأيقونة النشطة في الوضع الداكن */
.dark-theme #rightColumn .icon-tabs .nav-link.active,
body:not(.sepia-theme) #rightColumn .icon-tabs .nav-link.active {
    background-color: rgba(232, 216, 196, 0.2) !important;
    /* لون براندك الداكن المعتمد */
    color: #E8D8C4 !important;
}


/* ==========================================================================
   2. حل مشكلة النص المأكول في أسفل الكروت (إضافة مساحة تنفس للتمرير)
   ========================================================================== */
@media (min-width: 992px) {
    #rightColumn .sticky-top-custom {
        max-height: calc(100vh - 80px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;

        /* السحر هنا: إضافة بادينغ سفلي كبير لكي لا يختنق الكرت الأخير عند نهاية السكرول */
        padding-bottom: 60px !important;
    }
}

/* تحسين مساحة التنفس في الجوال أيضاً */
@media (max-width: 991.98px) {
    #rightColumn .tab-content {
        padding-bottom: 80px !important;
    }
}

/* ==========================================================================
   إعادة توزيع الألوان: خلفية بني للسايدبار وكروت داخلية بلون السيبيا الفاتح
   ========================================================================= */

/* 1. جعل خلفية السايدبار الكاملة باللون البني الداكن */
.sepia-theme #rightColumn,
.sepia-theme #rightColumn .sticky-top-custom,
.sepia-theme #rightColumn .tab-content,
.sepia-theme #rightColumn .tab-pane {
    background-color: #fcf8e3 !important;
    /* اللون البني الفخم كخلفية عامة للحاوية */
}

/* 2. تحويل الكروت الداخلية بالكامل إلى لون السيبيا الفاتح الذي اخترته */
.sepia-theme #rightColumn .timeline-item,
.sepia-theme #rightColumn .judgment-card,
.sepia-theme #rightColumn .template-card {
    background-color: rgb(244, 236, 216) !important;
    /* لون السيبيا الفاتح والمريح للكروت */
    border: 1px solid rgba(43, 38, 31, 0.08) !important;
    /* حدود ناعمة متناسقة */
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    /* ظلال تمنح الكرت عمقاً بارزاً */
    margin-bottom: 14px !important;
}

/* 3. ضبط ألوان النصوص داخل الكروت لتكون داكنة وواضحة جداً للقراءة */
.sepia-theme #rightColumn .timeline-item .timeline-title,
.sepia-theme #rightColumn .timeline-item h6 {
    color: #2b261f !important;
    /* نص العنوان الرئيسي باللون البني الداكن الصريح */
    font-weight: 700 !important;
}

.sepia-theme #rightColumn .timeline-item .timeline-desc,
.sepia-theme #rightColumn .timeline-item p,
.sepia-theme #rightColumn .timeline-item span {
    color: #4a3f31 !important;
    /* النصوص الفرعية بلون بني متوسط مريح للعين */
}

.sepia-theme #rightColumn .timeline-item .timeline-date,
.sepia-theme #rightColumn .timeline-item .timeline-meta,
.sepia-theme #rightColumn .timeline-item .text-muted {
    color: #7c6e59 !important;
    /* التواريخ والبيانات الثانوية بلون هادئ وواضح */
}

/* 4. ضبط التفاعل عند تمرير الفأرة فوق الكروت الفاتحة */
.sepia-theme #rightColumn .timeline-item:hover,
.sepia-theme #rightColumn .judgment-card:hover {
    background-color: #eae0c7 !important;
    /* تعميق لون الكرت قليلاً عند التمرير لمنح شعور بالضغط */
    transform: translateY(-2px);
    transition: all 0.2s ease-in-out;
}

/****************************************/

.collapse-arrow {
    font-size: 1.1rem;
    display: inline-block;
    transform: rotate(0deg);
    transition: transform 0.25s ease-in-out !important;
}

.collapse-arrow.rotated-left {
    transform: rotate(-90deg) !important;
}

.template-card {
    display: grid !important;
    grid-template-columns: 50px 1fr !important;
    /* عمود للأيقونة، وعمود للمحتوى */
    align-items: center !important;
    padding: 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    background-color: #fcf9f2 !important;
    direction: rtl !important;
    /* لإجبار كل شيء على اتباع اتجاه اليمين-يسار العربي */
}

.download-icon {
    font-size: 17px !important;
    color: #6c757d !important;
    justify-self: center;
    /* توسيط الأيقونة في عمودها */
}

.template-info {
    text-align: right !important;
    /* النص محاذي لليمين */
}

.template-title-row {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    font-weight: bold;
}

.template-meta-row {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 15px !important;
    font-size: 0.85rem !important;
    color: #6c757d !important;
}

.template-card {
    position: relative !important;
    /* هذا مهم جداً لكي لا تخرج الأيقونة من الكرت */
    padding: 15px 50px 15px 15px !important;
    /* مسافة على اليمين لتترك مكاناً للأيقونة */
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    background-color: #fcf9f2 !important;
    text-align: right !important;
    /* محاذاة النص لليمين */
}

/* وضع الأيقونة في اليسار بالقوة المطلقة */
.download-icon {
    position: absolute !important;
    left: 15px !important;
    /* تثبيت الأيقونة في جهة اليسار */
    top: 50% !important;
    transform: translateY(-50%) !important;
    /* توسيط عمودي مثالي */
    font-size: 17px !important;
    color: #6c757d !important;
}

.template-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.template-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.template-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    /* النص يمين، الأيقونة يسار */
    padding: 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    background-color: #fcf9f2 !important;
    flex-direction: row-reverse !important;
    /* هذا السطر يقلب الترتيب ليصبح الأيقونة يسار */
}

.template-content {
    text-align: right !important;
    /* النص محاذي لليمين */
    flex-grow: 1;
}

.download-icon {
    font-size: 17px !important;
    color: #6c757d !important;
    margin-right: 15px;
    /* مسافة بين الأيقونة والنص */
}

/* حاوية العنوان لضمان ترتيب الأيقونة والنص جنباً إلى جنب */
.template-title {
    display: flex !important;
    align-items: center !important;
    text-align: right !important;
    font-weight: bold;
}

/* لضبط المسافة بين الأيقونة والنص */
.template-title i {
    margin-right: 8px;
    /* مسافة بسيطة بين الأيقونة والكلمة */
}

.my-3 {
    margin-top: .5rem !important;
    margin-bottom: .5rem !important;
}

/* رابط الإعلان في القالب الداكن والفاتح */
.link-primary {
    color: var(--accent-orange) !important;
    /* لون ثابت يظهر جيداً على الخلفيتين */
}

/* تنسيق الـ hr ليناسب الثيمين */
hr {
    opacity: 0.2;
}

/* الألوان الأساسية للقالب الفاتح */
.text-custom-article {
    color: #333333;
    /* لون نص داكن للقالب الفاتح */
}

/* الألوان الخاصة عند تفعيل القالب الداكن */
body.dark .text-custom-article,
.dark .text-custom-article {
    color: #e0e0e0;
    /* لون نص فاتح (مريح للعين) للقالب الداكن */
}

/* تنسيق العناوين في القالبين */
.article-title {
    color: #000;
}

body.dark .article-title,
.dark .article-title {
    color: #ffffff;
}

body.light-theme .article-list-wrapper li,
.view-toggle-content li {
    color: #212529 !important
}

/* الألوان الافتراضية للقالب الساطع */


/* الشعار الافتراضي (الأسود) */
.site-logo {}

/* عند تفعيل الوضع الداكن */
body.dark .site-logo,
[data-bs-theme="dark"] .site-logo {
    content: url('../img/smartkai-19-02.png');
}

#selected-filters .badge {
    transition: all 0.3s ease;
    cursor: default;
    background: linear-gradient(45deg, var(--accent-orange), #563d7c) !important;
}

#selected-filters .badge:hover {
    transform: scale(1.05);
}

.search-input {
    border-radius: 15px !important;
    padding: 15px 40px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* خلفية داكنة مخصصة للمستطيل الأسفل */
.metadata-section {
    background-color: #1a1a1a;
    /* لون أسود داكن جداً أو قريب من لون القالب */
    border: 1px solid #333;
    /* إطار خفيف ليعطي تباين */
    margin-top: 15px;
}

/* تنسيق عام للبطاقة إذا كنت تستخدمها */


/* تعريف المتغيرات لكل ثيم */
body.dark-theme {
    --metadata-bg: #1a1a1a;
    --metadata-text: #ffffff;
    --metadata-label: #aaaaaa;
}

body.light-theme {
    --metadata-bg: #f8f9fa;
    /* لون فاتح جداً للثيم الساطع */
    --metadata-text: #212529;
    /* نص غامق */
    --metadata-label: #6c757d;
    /* عنوان رمادي */
}

body.sepia-theme {
    --metadata-bg: #e6dcc5;
    /* لون ورق قديم للانسيابي */
    --metadata-text: #5b4636;
    /* لون بني للنصوص */
    --metadata-label: #8b7355;
    /* عنوان بلون بني غامق */
}

/* تطبيق المتغيرات على المستطيل */
.metadata-section {
    background-color: var(--metadata-bg);
    color: var(--metadata-text);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    /* إطار خفيف */
    transition: all 0.3s ease;
    /* لنقل الألوان بنعومة عند التبديل */
}

.metadata-section span.label {
    color: var(--metadata-label);
}



/* تنسيق النصوص داخل المستطيل */
.metadata-section .label {
    opacity: 0.7;
}

/* تعيين متغيرات الألوان بناءً على الثيم النشط */
:root {
    --meta-bg: #f8f9fa;
    /* الساطع */
    --meta-text: #212529;
}

body.dark-theme {
    --meta-bg: #1a1a1a;
    /* الداكن */
    --meta-text: #ffffff;
}

body.sepia-theme {
    --meta-bg: #e6dcc5;
    /* الانسيابي */
    --meta-text: #5b4636;
}

/* تطبيق المتغيرات على القسم */
.metadata-section {
    background-color: var(--meta-bg);
    color: var(--meta-text);
    transition: background-color 0.3s, color 0.3s;
}

/* ضمان ظهور النصوص بشكل صحيح */
.metadata-section .label {
    opacity: 0.7;
    color: var(--meta-text);
}

/* هذا الكود يجعل النصوص تأخذ لون "النص الافتراضي" للقالب النشط */
.search-result-card,
.metadata-section {
    color: inherit;
    /* يرث اللون من القالب */
}

/* اجعل العناوين الفرعية (labels) بلون باهت قليلاً لتعطي تباين */
.label,
.text-secondary,
small {
    opacity: 0.8;
}

/* في حال كان القالب يغير الخلفيات، اجعل المستطيل يغير خلفيته أيضاً */
.metadata-section {
    background-color: rgba(0, 0, 0, 0.05);
    /* شفافية بسيطة تظهر لون خلفية القالب خلفها */
}

/* تنسيق القسم الرئيسي */
.search-result-card {
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 10px;
}

/* المستطيل الداخلي: يأخذ خلفية شفافة تعتمد على لون القالب */
.metadata-section {
    background-color: rgba(128, 128, 128, 0.1);
    /* شفافة تتكيف مع أي خلفية */
    border: 1px solid rgba(128, 128, 128, 0.2);
}

/* استخدام currentColor يضمن أن النص دائماً يتبع لون الثيم */
.text-custom-muted {
    color: currentColor;
    opacity: 0.65;
    /* يعطي تأثير الـ muted دون تغيير اللون الفعلي للثيم */
}

/* الزر الأساسي (تعريف عام) */
.btn-dark-custom {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid #444 !important;
    transition: all 0.3s ease;
}

/* 1. الثيم الساطع */
body.light-theme {
    --btn-bg: #f8f9fa;
    --btn-text: #212529;
    --btn-border: #dee2e6;
}

/* 2. الثيم الداكن */
body.dark-theme {
    --btn-bg: #333;
    --btn-text: #ffffff;
    --btn-border: #444;
}

/* 3. الثيم الانسيابي (اللون الذي طلبته) */
body.sepia-theme {
    --btn-bg: #e6dcc5;
    /* لون خلفية الزر */
    --btn-text: #5b4636;
    /* لون النص البني */
    --btn-border: #c8b99c;
    /* لون الإطار البني */
}

/* تأثير عند المرور بالماوس (Hover) */
.btn-dark-custom:hover {
    filter: brightness(90%);
    cursor: pointer;
}

/* الألوان الأساسية للعناوين والنصوص داخل الـ Offcanvas */


/* 1. الساطع */
body.light-theme .custom-offcanvas {
    background-color: #ffffff;
    --canvas-text: #212529;
}

/* 2. الداكن */
body.dark-theme .custom-offcanvas {
    background-color: #1a1a1a !important;
    --canvas-text: #ffffff;
}

/* 3. الانسيابي (Sepia) - لون الورق القديم */
body.sepia-theme .custom-offcanvas {
    background-color: #f4ecd8;
    --canvas-text: #5b4636;
}

/* توحيد لون الأيقونات والنصوص الثانوية */
.custom-offcanvas .text-purple {
    color: var(--accent-orange) !important;
}

.custom-offcanvas .text-secondary {
    color: var(--canvas-text);
    opacity: 0.7;
}

.custom-offcanvas .text-white {
    color: var(--canvas-text) !important;
}

/* في القالب الداكن: اجعل الخلفية رمادية غامقة وليست شفافة */
body.dark-theme .metadata-section {
    background-color: #2b2b2b !important;
    /* لون رمادي غامق صلب */
    border: 1px solid #444 !important;
}

/* في القالب الانسيابي (Sepia): اجعل الخلفية لون الورق */
body.sepia-theme .metadata-section {
    background-color: #F2ECD9 !important;
    /* اللون الرملي */
    border: 1px solid #d4c4a8 !important;
}

/* في القالب الساطع (Light): خلفية فاتحة */
body.light-theme .metadata-section {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
}


/* ربط لون النص بخلفية الـ offcanvas */
.custom-offcanvas {
    background-color: var(--canvas-bg) !important;
    color: var(--canvas-text) !important;
}

/* 1. الساطع */
body.light-theme .custom-offcanvas {
    --canvas-bg: #ffffff;
    --canvas-text: #212529;
}

/* 2. الداكن */
body.dark-theme .custom-offcanvas {
    --canvas-bg: #1a1a1a;
    --canvas-text: #ffffff;
}

/* 3. الانسيابي */
body.sepia-theme .custom-offcanvas {
    --canvas-bg: #f4ecd8;
    --canvas-text: #5b4636;
}

.custom-offcanvas,
.custom-offcanvas .offcanvas-header,
.custom-offcanvas .offcanvas-body {
    background-color: var(--canvas-bg) !important;
    color: var(--canvas-text) !important;
}

.custom-offcanvas {
    background-color: #1a1a1a !important;
    /* لون صلب للثيم الداكن */
    opacity: 1 !important;
    /* التأكد من أن الشفافية كاملة */
}

/* فرض الترتيب في الـ offcanvas header */
.offcanvas-header {
    display: flex !important;
    flex-direction: row-reverse !important;
    /* هذا سيقلب الترتيب في الـ RTL ليصبح الإكس يساراً والعنوان يميناً */
}

/* تعديل المسافات */
.offcanvas-header .btn-close {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.profile-trigger {
    width: 45px;
    height: 45px;
    background-color: #F3703B;
    /* لون أيقونة الحساب البرتقالي */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
}

/* محتوى الباقات الرئيسي */
.plans-container {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* شارة الاشتراك العلوي */
.top-badge {
    background: rgba(193, 177, 149, 0.1);
    border: 1px solid rgba(193, 177, 149, 0.2);
    color: #C1B195;
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* شريط التبديل العلوي الفريد للخطط */
.plans-nav-tabs {
    background-color: #252421;
    padding: 6px;
    border-radius: 14px;
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.plans-nav-tabs .nav-link {
    border: none !important;
    color: #A09786 !important;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 10px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.plans-nav-tabs .nav-link.active {
    background-color: #312F2B !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* شارة الأكثر طلباً العلوية للشركات */
.most-requested-badge {
    position: absolute;
    top: -24px;
    right: 37%;
    background-color: var(--accent-orange);
    color: #FFFFFF;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: bold;
}

/* كروت تفاصيل الميزات والأسعار */
.features-card {
    background-color: #21201E;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 2.5rem;
    height: 100%;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* تبدأ العناصر بالتراص من اليمين */
    gap: 12px;
    /* المسافة بين علامة الصح والنص */
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    color: #E2E0D9;
    direction: rtl;
    /* إجبار العنصر على الترتيب من اليمين لليسار */
    text-align: right;
    /* محاذاة النص لليمين */
}

.feature-item i {
    color: #3B9DF3;
    /* لون علامة الصح الزرقاء بالمستند */
    font-size: 1.2rem;
}

/* كرت السعر الرئيسي */
.pricing-main-card {
    background-color: #21201E;
    border: 2px solid #3B9DF3;
    /* إطار تمييز الباقة النشطة */
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.plan-icon-box {
    width: 55px;
    height: 55px;
    background-color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    margin: 0 auto 1.5rem auto;
}

.price-huge {
    font-size: 3rem;
    font-weight: 700;
    color: #3B9DF3;
    line-height: 1;
}

.monthly-calc-box {
    background: rgba(59, 157, 243, 0.08);
    border-radius: 10px;
    padding: 10px;
    color: #3B9DF3;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    font-weight: 600;
}

.btn-subscribe {
    background-color: #3B9DF3;
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    margin-top: 1.5rem;
    transition: background 0.3s;
}

.btn-subscribe:hover {
    background-color: #2782D2;
}

/* أيقونة الدعم العائمة المخصصة للمنصة */
.floating-help-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background-color: #21201E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A09786;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

tr {
    text-align: right
}

.accordion-body {
    text-align: right !important;
}

[type=email],
[type=number],
[type=tel],
[type=url] {
    direction: rtl !important;
}

/* القاعدة العامة للصندوق (تتناسب مع الوضع الداكن تلقائياً) */
.custom-alert-box {
    margin: 40px auto;
    padding: 35px 25px;
    border-radius: 16px;
    max-width: 750px;
    background: rgba(220, 53, 69, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(220, 53, 69, 0.25);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.alert-icon-wrapper {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 15px;
}

/* لون العناوين في الوضع الداكن */
.alert-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: #ff4d5e;
}

/* لون النص الوصفي في الوضع الداكن */
.alert-message {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 25px;
    /*  color: rgba(255, 255, 255, 0.9);*/
}

.btn-renew-alert {
    display: inline-block;
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: #fff !important;
    font-weight: 600;
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
}

/* ======================================================= */
/* 🛠️ الحل السحري للنمط الساطع (Light Mode) 🛠️            */
/* ======================================================= */

/* إذا كانت لوحتك تضيف كلاس .light أو data-theme="light" على جسم الصفحة <body> */
body.light .custom-alert-box,
[data-theme="light"] .custom-alert-box,
.light-mode .custom-alert-box {
    background: #fff5f5;
    /* خلفية وردية مريحة جداً ونظيفة للعين */
    border: 1px solid #feb2b2;
    /* حدود واضحة تمنع تشتت الصندوق */
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.05);
}

body.light .alert-title,
[data-theme="light"] .alert-title,
.light-mode .alert-title {
    color: #9b1c1c;
    /* أحمر داكن جداً ومقروء بامتياز */
}

body.light .alert-message,
[data-theme="light"] .alert-message,
.light-mode .alert-message {
    color: #7f1d1d;
    /* لون نص بني/أحمر غامق يحقق أعلى درجات التباين للعين */
    font-weight: 500;
}

<style>
/* ==========================================================================
        ⚙️ ضبط تنسيقات القائمة اليسرى للنمط الساطع فقط (بدون تخريب الداكن والسيبيا)
        ========================================================================== */

/* 1. حقل البحث والمستندات في النمط الساطع */
body.light-theme .custom-dark-input {
    background-color: #f8fafc !important;
    /* خلفية رمادية فاتحة ناعمة */
    border: 1px solid #cbd5e0 !important;
    /* حدود رمادية محددة */
    color: #1a365d !important;
    /* لون نص كحلي داكن مريح للقراءة */
}

body.light-theme .custom-dark-input::placeholder {
    color: #718096 !important;
    /* لون نص تلميحي واضح */
}

body.light-theme .search-local-container i.bi-search {
    color: #4a5568 !important;
    /* لون أيقونة البحث */
}

/* 2. زر العودة للنتائج */
body.light-theme #leftColumn .text-secondary {
    color: #4a5568 !important;
}

body.light-theme #leftColumn .text-secondary:hover {
    color: #1a365d !important;
    /* غمقان أكثر عند تمرير الماوس */
}

/* 3. كارت الفهرس الرئيسي */
body.light-theme .bg-card-dark {
    background-color: #ffffff !important;
    /* خلفية بيضاء صريحة وفخمة */
    border: 1px solid #e2e8f0 !important;
    /* حدود خفيفة جداً حول الكارت */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

/* 4. رأس الفهرس (Header) */
body.light-theme .bg-darker {
    background-color: #f8fafc !important;
    /* خلفية هيدر مميزة خفيفة */
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .bg-darker span {
    color: #1a365d !important;
    /* عنوان الفهرس باللون الكحلي */
}

body.light-theme .bg-darker .bi-x-lg {
    color: #718096 !important;
    /* أيقونة الإغلاق */
}

body.light-theme .bg-darker .bi-x-lg:hover {
    color: #ef4444 !important;
    /* تتحول للأحمر عند الحوم فوقها كإشارة إغلاق بديهية */
}

/* 5. نصوص روابط شجرة الفهرس (Auto TOC) */
body.light-theme #auto-toc a,
body.light-theme #auto-toc span,
body.light-theme #auto-toc li {
    color: #2d3748 !important;
    /* لون النصوص الداخلية رمادي داكن واضح */
}

body.light-theme #auto-toc a:hover {
    color: #805ad5 !important;
    /* يتحول للبنفسجي المعتمد عندك عند الإشارة */
}

/* ==========================================
        🎨 التنسيق الافتراضي للروابط والعناوين داخل الجانب الأيمن
        ========================================== */
.sidebar-dynamic-title {
    color: #ffffff;
    /* أبيض صريح في الوضع الداكن الافتراضي */
    font-weight: 700;
}

.timeline-dynamic-link {
    color: #ffffff !important;
    font-weight: 700;
    transition: color 0.2s ease;
}

.timeline-dynamic-link:hover {
    color: #a855f7 !important;
    /* لون بنفسجي تفاعلي ناعم */
}


body.light-theme #rightColumn {
    background-color: #ffffff !important;
    /* إجبار الشريط على خلفية بيضاء نقية تناسب المود الساطع */
    /* border-right: 1px solid #e2e8f0 !important;*/
}

/* عناوين التبويبات الفردية داخل النمط الساطع */
body.light-theme .sidebar-dynamic-title {
    color: #1a365d !important;
    /* كحلي داكن فاخر بدلاً من الأبيض المختفي */
}

/* عناوين التعديلات والارتباطات داخل النمط الساطع */
body.light-theme .timeline-dynamic-link {
    color: #2d3748 !important;
    /* لون رمادي فحمي غامق بارز ومقروء */
}

body.light-theme .timeline-dynamic-link:hover {
    color: #805ad5 !important;
    /* البنفسجي المعتمد في الهوية البصرية */
}

/* تنسيق أزرار التبويبات العلوية (Tabs Icons) لتتناسب مع التفتيح */
body.light-theme .icon-tabs .nav-link {
    color: #718096 !important;
}

body.light-theme .icon-tabs .nav-link.active {
    background-color: #f7fafc !important;
    color: #805ad5 !important;
    border-color: #e2e8f0 !important;
}

/* كارت الأحكام والقوالب في النمط الساطع ليكون بارزاً */
body.light-theme .judgment-card,
body.light-theme .template-card {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .judgment-title span,
body.light-theme .template-title span {
    color: #1a365d !important;
}

body.light-theme .article-header {
 /*   background-color: #edf2f7 !important;*/
    color: #2b6cb0 !important;
}

/* ==========================================================================
        ⚙️ التنسيق الافتراضي للقائمة اليسرى (الوضع الداكن ووضع سيبيا)
        ========================================================================== */
.sidebar-left-card {
    background-color: #1a202c;
    /* أو لون الكارت الداكن المعتمد لديك مسبقاً */
}

.sidebar-left-header {
    background-color: #111827;
}

.index-title-text {
    color: #ffffff;
}

/* ==========================================================================
   ☀️ ضبط وتصحيح الألوان للنمط الساطع فقط (Light Mode)
   ========================================================================== */

/* 1. تفتيح خلفية كارت الفهرس الرئيسي */
body.light-theme .sidebar-left-card {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

/* 2. تفتيح رأس الفهرس (Header) وتغيير لون النص للكحلي الداكن */
body.light-theme .sidebar-left-header {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #edf2f7 !important;
}

body.light-theme .index-title-text {
    color: #1a365d !important;
    /* لون داكن مريح جداً للعين */
}

body.light-theme .close-icon-left {
    color: #718096 !important;
}

body.light-theme .close-icon-left:hover {
    color: #ef4444 !important;
    /* أحمر ذكي عند الإشارة للإغلاق */
}

/* 3. تعديل حقل البحث والمستندات ليناسب الخلفية البيضاء */
body.light-theme .custom-dark-input {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e0 !important;
    color: #1a365d !important;
}

body.light-theme .custom-dark-input::placeholder {
    color: #a0aec0 !important;
}

body.light-theme .search-icon-left {
    color: #718096 !important;
}

/* 4. زر العودة للنتائج */
body.light-theme .dynamic-back-btn {
    color: #4a5568 !important;
}

body.light-theme .dynamic-back-btn:hover {
    color: #1a365d !important;
}

/* 5. روابط شجرة الفهرس الداخلي (Auto TOC) */
body.light-theme #auto-toc a,
body.light-theme #auto-toc span,
body.light-theme #auto-toc li {
    color: #2d3748 !important;
}

body.light-theme #auto-toc a:hover {
    color: #805ad5 !important;
    /* تلوين تفاعلي بالبنفسجي عند الحوم */
}

body.light-theme #leftColumn {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.sepia-theme .sidebar-left-header {
    background-color: rgb(244, 236, 216) !important;
}

body:not(.sepia-theme) .timeline-dynamic-link {
    color: #000 !important;
}

/* ==========================================================================
        ☕ ضبط وتصحيح ألوان الفهرس لنمط السيبيا فقط (Sepia Mode)
        ========================================================================== */

/* 1. ضبط خلفية الكارت الرئيسي للفهرس ليتكامل مع لون السيبيا */
body.sepia-theme .sidebar-left-card {
    background-color: #f4ecd8 !important;
    /* لون كريمي متناسق مع السيبيا */
    border: 1px solid #e4d6b6 !important;
    box-shadow: 0 4px 12px rgba(43, 34, 18, 0.08) !important;
}

/* 2. ضبط رأس الفهرس (Header) */
body.sepia-theme .sidebar-left-header {
    background-color: #ebdcb9 !important;
    /* أغمق قليلاً للتميز */
    border-bottom: 1px solid #d9c79d !important;
}

/* 3. تلوين نصوص العناوين الرئيسية وأيقونة الإغلاق */
body.sepia-theme .index-title-text {
    color: #433422 !important;
    /* بني داكن مريح جداً للقراءة في السيبيا */
}

body.sepia-theme .close-icon-left {
    color: #8c7653 !important;
}

body.sepia-theme .close-icon-left:hover {
    color: #a63a2b !important;
    /* لون أحمر طوبي متناسق عند الرغبة بالإغلاق */
}

/* 4. تصحيح تداخل ألوان شجرة الفهرس الداخلي (Auto TOC) والأكورديون */
body.sepia-theme #auto-toc,
body.sepia-theme #auto-toc .accordion-item,
body.sepia-theme #auto-toc .accordion-button {
    background-color: transparent !important;
    /* إزالة أي خلفيات رمادية أو داكنة قديمة */
    color: #433422 !important;
    /* توحيد النص باللون البني الداكن */
}

/* 5. ضبط العناوين المفتوحة والنشطة والروابط عند الحوم (Hover) */
body.sepia-theme #auto-toc a,
body.sepia-theme #auto-toc span,
body.sepia-theme #auto-toc li {
    color: #5c4933 !important;
}

body.sepia-theme #auto-toc a:hover,
body.sepia-theme #auto-toc .accordion-button:not(.collapsed) {
    color: #b25e00 !important;
    /* لون بني محروق/نحاسي دافئ عند التنشيط أو الإشارة */
    background-color: #ebdcb9 !important;
    /* خلفية ناعمة للعنصر النشط */
}

/* ضبط السهم الصغير الخاص بالأكورديون في السيبيا ليكون واضحاً */
body.sepia-theme #auto-toc .accordion-button::after {
    filter: sepia(1) saturate(5) hue-rotate(10deg) brightness(0.4);
}

.status-badge-red {
    background-color: #fef2f2;
    color: #dc2626;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 5px;
}

.main-custom-menu {
    position: fixed !important;
    /* تثبيت المنيو بالنسبة للشاشة وليس الصفحة */
    top: 70px !important;
    /* المسافة من أعلى الشاشة - اضبطها لتناسب محاذاة زر القائمة */
    left: auto !important;
    right: 70px !important;
    /* المسافة من اليمين ليظهر بجانب شريط الأدوات */
    transform: none !important;
    /* إلغاء أي حسابات تلقائية من البوتستراب قد تحرك القائمة لأعلى */
    z-index: 1050 !important;
    /* لضمان ظهور القائمة فوق كل عناصر الصفحة الأخرى */
    max-height: calc(100vh - 90px);
    /* منع القائمة من الخروج عن الشاشة إذا كانت العناصر كثيرة */
    overflow-y: auto;
    /* إضافة سكرول داخلي للمنيو فقط إذا تطلب الأمر */
}

/* تأثيرات مخصصة للموبايل فقط دون التأثير على الكمبيوتر */
@media (max-width: 767.98px) {

    /* جعل المنيو تأخذ وضعية شبه كاملة وثابتة في الشاشة لجعلها متناسقة */
    ul.dropdown-menu.main-custom-menu#myCustomDropdown {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        z-index: 9999 !important;
        overflow-y: auto;
        padding-top: env(safe-area-inset-top, 20px);

    }

    /* توحيد محاذاة عناصر المنيو لتصبح كلها من اليمين إلى اليسار بشكل متناسق */
    ul.dropdown-menu.main-custom-menu#myCustomDropdown .dropdown-item {
        flex-direction: row-reverse !important;
        /* يعكس الترتيب لضمان أن الأيقونة على اليسار والنص على اليمين */
        justify-content: flex-end !important;
        /* دفع العناصر لتبدأ من اليمين */
        gap: 12px !important;
        /* مسافة ثابتة وممتازة بين الأيقونة والنص */
        padding: 15px 20px !important;
        /* تكبير منطقة الضغط لتناسب أصابع اليد على الموبايل */
        font-size: 1.05rem !important;
    }

    /* ضبط محاذاة الهيدر العلوي للمنيو */
    ul.dropdown-menu.main-custom-menu#myCustomDropdown .custom-sidebar-header .d-flex {
        flex-direction: row-reverse !important;
        /* يعكس اتجاه زر الإغلاق ليصبح متناسقاً */
    }

    /* إخفاء النقطة المؤشرة dot-indicator على الموبايل لتجنب تداخلها مع الأيقونات */
    ul.dropdown-menu.main-custom-menu#myCustomDropdown .dot-indicator {
        display: none !important;
    }
}

/* تنسيقات خاصة بالجوال فقط لصفحة المظهر والإعدادات */
@media (max-width: 767.98px) {

    /* 1. تحويل الحاوية الرئيسية إلى ترتيب عمودي */
    .settings-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        padding: 10px !important;
    }

    /* 2. تحويل السايدبار الجانبي إلى شريط تصفح علوي أفقي مرن */
    aside.settings-sidebar {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding: 10px !important;
        gap: 8px !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.05);
        /* يعطي تأثير خلفية ناعم متناسق */
        scrollbar-width: none;
        /* إخفاء شريط التمرير الافتراضي لجمالية التصميم */
    }

    aside.settings-sidebar::-webkit-scrollbar {
        display: none;
        /* إخفاء سكرولبار الكروم وسفاري */
    }

    /* إخفاء العناوين الفرعية غير الضرورية في الشريط العلوي لتوفير مساحة */
    aside.settings-sidebar .settings-nav-header,
    aside.settings-sidebar .settings-nav-section-title {
        display: none !important;
    }

    /* تحويل روابط الإعدادات إلى أزرار/تبويبات أنيقة بجانب بعضها */
    aside.settings-sidebar .settings-nav-link {
        display: inline-flex !important;
        flex-direction: row-reverse !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 16px !important;
        border-radius: 30px !important;
        /* تحويلها لستايل كبسولات Pill tabs */
        background-color: transparent;
        border: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.9rem !important;
    }

    /* 3. ضبط قسم المحتوى التخصيصي ليأخذ المساحة الكاملة */
    section.settings-content {
        width: 100% !important;
    }

    /* ضبط كروت الألوان والثيمات لتصبح مستجيبة ومريحة للعين */
    .theme-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        /* توزيع متساوي للثلاث خيارات */
        gap: 10px !important;
    }

    .theme-card {
        padding: 15px 10px !important;
        font-size: 0.85rem !important;
    }

    /* منع التفاف صف الألوان وجعله منسقاً */
    .color-picker-row {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
}

@media (max-width: 767.98px) {

    /* توسيع وتعريض البوكس الرئيسي المحيط بالأزرار */
    aside.settings-sidebar {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;

        /* زيادة الحشو الداخلي لجعل البوكس واسعاً ومريحاً */
        padding: 16px 14px !important;
        gap: 12px !important;
        /* مسافة مريحة بين الأزرار */

        border-radius: 16px !important;
        /* زوايا أنعم تليق بالتصميم الواسع */
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        /* إطار خفيف يحدد البوكس */

        scrollbar-width: none;
    }

    aside.settings-sidebar::-webkit-scrollbar {
        display: none;
    }

    /* توسيع الأزرار الداخلية (الكبسولات) لتتناسب مع وسع البوكس */
    aside.settings-sidebar .settings-nav-link {
        display: inline-flex !important;
        flex-direction: row-reverse !important;
        align-items: center !important;
        gap: 10px !important;

        /* زيادة مساحة الضغط الداخلية للأزرار */
        padding: 10px 20px !important;
        border-radius: 30px !important;
        font-size: 0.95rem !important;
        /* تكبير الخط قليلاً */
        font-weight: 500 !important;
    }
}

/* تنسيق حالة عدم وجود اشتراك */
.no-subscription-wrapper {
    padding: 2rem 1rem;
}

.subscription-icon-box i {
    color: #6f42c1;
    /* لون موف/بنفسجي عصري */
    opacity: 0.8;
    filter: drop-shadow(0 0 10px rgba(111, 66, 193, 0.3));
}

.text-muted-custom {
    color: #a0aec0 !important;
}

/* زر الاشتراك الجديد العصري */
.btn-subscribe-now {
    background: linear-gradient(135deg, #6f42c1 0%, #4e2295 100%);
    color: #ffffff;
    border: none;
    padding: 12px 35px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    /* زوايا دائرية بالكامل ناعمة */
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-subscribe-now:hover {
    background: linear-gradient(135deg, #8250df 0%, #5b2aa9 100%);
    color: #ffffff;
    transform: translateY(-2px);
    /* تأثير ارتفاع خفيف عند الحوم */
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.6);
}

.btn-subscribe-now:active {
    transform: translateY(1px);
}


/* الأنماط العامة (تشتغل بشكل ممتاز على النمط الفاتح) */
.no-subscription-wrapper {
    padding: 2rem 1rem;
}

.subscription-icon {
    color: #6f42c1;
    /* اللون الموف الافتراضي */
    filter: drop-shadow(0 4px 10px rgba(111, 66, 193, 0.2));
}

.btn-subscribe-now {
    background: linear-gradient(135deg, #6f42c1 0%, #4e2295 100%);
    color: #ffffff !important;
    /* لضمان بقاء لون النص أبيض داخل الزر */
    border: none;
    padding: 12px 35px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-subscribe-now:hover {
    background: linear-gradient(135deg, #8250df 0%, #5b2aa9 100%);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.5);
}

/* ================= لدعم النمط الداكن ومنع اختفاء العناصر ================= */
/* إذا كان موقعك يستخدم كلاس dark على الـ body أو كلاسات bootstrap 5 للمود الداكن */
[data-bs-theme="dark"] .subscription-icon,
.dark-mode .subscription-icon {
    color: #a370f7;
    /* درجة موف فاتحة ومضيئة لتناسب الخلفية الغامقة */
    filter: drop-shadow(0 4px 12px rgba(163, 112, 247, 0.4));
}

[data-bs-theme="dark"] .btn-subscribe-now,
.dark-mode .btn-subscribe-now {
    background: linear-gradient(135deg, #a370f7 0%, #6f42c1 100%);
    box-shadow: 0 4px 15px rgba(163, 112, 247, 0.25);
}

/* تحسين مظهر القائمة المنسدلة المخصصة */
select.form-control-custom {
    appearance: none;
    /* إخفاء سهم المتصفح الافتراضي */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-left: 35px;
    /* مساحة إضافية لمنع تداخل السهم المخصص مع النص */
}

/* لضمان وضوح خيارات القائمة المنسدلة ولونها في النمط الداكن والفاتح */
select.form-control-custom option {
    background-color: var(--bs-body-bg, #ffffff);
    /* تتكيف مع خلفية الموقع */
    color: var(--bs-body-color, #212529);
    /* تتكيف مع لون الخط العام */
    padding: 10px;
}

/* إجبار الخيارات على أخذ خلفية داكنة صريحة في حال وجود كلاس النمط الداكن */
[data-bs-theme="dark"] select.form-control-custom option,
.dark-mode select.form-control-custom option {
    background-color: #1e1e1e;
    /* أو نفس درجة لون الكرت الداكن لديك */
    color: #ffffff;
}
.chat-assistant-container{
    max-width:420px;
    margin:0 auto;
    background:var(--card-bg);
    border-radius:18px;
    padding:18px;
    border:1px solid var(--border-soft);
}

.sidebar-dynamic-title{
    font-weight:800;
    font-size:14px;
    color:var(--text-main);
}
.header-icon{
    width:30px;height:30px;
    border-radius:9px;
    background:var(--panel-bg);
    display:flex;align-items:center;justify-content:center;
    color:var(--text-mute);
    font-size:14px;
}

.assistant-status-card{
    background:var(--panel-bg);
    border-radius:12px;
    padding:10px 14px;
    margin-bottom:6px;
}
.status-dot{
    width:8px;height:8px;border-radius:50%;
    background:var(--green);
    display:inline-block;
    margin-left:8px;
    box-shadow:0 0 0 4px rgba(62,207,142,0.15);
}

.chat-scroll-area{
    max-height:430px;
    overflow-y:auto;
    padding:14px 2px 4px;
    margin-top:6px;
    scrollbar-width:thin;
}
.chat-scroll-area::-webkit-scrollbar{width:5px;}
.chat-scroll-area::-webkit-scrollbar-thumb{background:#2b2f3d;border-radius:10px;}

.msg-row{
    display:flex;
    justify-content:flex-end;
    margin-bottom:14px;
    animation:msgIn .25s ease;
}
@keyframes msgIn{
    from{opacity:0; transform:translateY(6px);}
    to{opacity:1; transform:translateY(0);}
}

.bubble{
    max-width:88%;
    padding:12px 16px;
    border-radius:14px;
    font-size:13.5px;
    line-height:1.85;
    text-align:right;
}

.bubble-ai{
    background:var(--ai-bubble);
    color:var(--text-main);
    border-radius:4px 14px 14px 14px;
    margin-right:0;
}

.bubble-user{
    background:linear-gradient(135deg, var(--accent-orange) , var(--accent-orange) );
    color:#f2eeff;
    border-radius:14px 4px 14px 14px;
    border:1px solid rgba(147,112,245,0.35);
}

.msg-time{
    font-size:11px;
    color:var(--text-mute);
    margin-top:7px;
    text-align:right;
}
.bubble-user .msg-time{
    color:rgba(242,238,255,0.55);
}

.loader-row{
    display:flex;
    justify-content:flex-end;
    margin-bottom:14px;
}
.loader-bubble{
    background:var(--ai-bubble);
    border-radius:4px 14px 14px 14px;
    padding:13px 18px;
    display:flex;
    align-items:center;
    gap:10px;
}
.loader-text{
    font-size:13px;
    color:var(--text-mute);
}
.pulse-loader{
    display:flex;
    gap:5px;
}
.pulse-loader span{
    width:7px;height:7px;
    border-radius:50%;
    background:var(--accent);
    box-shadow:0 0 6px var(--accent);
    animation:pulseWave 1s infinite ease-in-out;
}
.pulse-loader span:nth-child(2){animation-delay:0.15s;}
.pulse-loader span:nth-child(3){animation-delay:0.3s;}
@keyframes pulseWave{
    0%,80%,100%{transform:scale(0.6); opacity:0.4;}
    40%{transform:scale(1); opacity:1;}
}

.chat-input-row{
    display:flex;
    align-items:flex-end;
    gap:8px;
    margin-top:12px;
    border-top:1px solid var(--border-soft);
    padding-top:14px;
}
.chat-input-row textarea{
    flex:1;
    background:var(--panel-bg);
    border:1px solid var(--border-soft);
    color:var(--text-main);
    border-radius:20px;
    padding:14px 18px;
    font-size:14.5px;
    line-height:1.6;
    font-family:'Tajawal', sans-serif;
    outline:none;
    text-align:right;
    resize:none;
    overflow-y:auto;
    min-height:52px;
    max-height:160px;
    transition:border-color .15s, height .1s;
}
.chat-input-row textarea::placeholder{color:var(--text-mute);}
.chat-input-row textarea:focus{border-color:var(--accent);}

.chat-send-btn{
    width:46px;height:46px;
    min-width:46px;
    border-radius:50%;
    background:var(--accent);
    color:#fff;
    border:none;
    display:flex;align-items:center;justify-content:center;
    font-size:17px;
    cursor:pointer;
    transition:transform .1s, background .15s;
}
.chat-send-btn:hover{background:var(--accent-orange);}
.chat-send-btn:active{transform:scale(0.92);}
.chat-send-btn:disabled{opacity:0.45;cursor:not-allowed;}

.error-bubble{
    background:#3a2126;
    color:#ff9d9d;
    border:1px solid #5c2a2f;
    border-radius:4px 14px 14px 14px;
    padding:11px 16px;
    font-size:13.5px;
}

/* ======================================================== */
/* 1. نظام متغيرات الأنماط الموحد لمشروعك (Theme Control)    */
/* ======================================================== */

/* أ) النمط الداكن (Dark) */
body.dark-theme {
    --bg-forms: #1A1917;
    --bg-brand: #25221E;
    --text-main: #FFFFFF;
    --text-muted: #8C816E;
    --input-bg: #252421;
    --input-border: rgba(255, 255, 255, 0.05);
    --accent-color: #C1B195;
    --card-active-bg: #2B2925;
    --toggle-bg: #21201D;
    --toggle-active-bg: #2A2925;
    --toggle-active-text: #FFFFFF;
}

/* ب) النمط الفاتح (Light) - باللون البنفسجي */
body.light-theme {
    --bg-forms: #FFFDF0;
    --bg-brand: #141312;
    --text-main: #2D2D2D;
    --text-muted: #A39B8E;
    --input-bg: #FFFFFF;
    --input-border: #E8E2CD;
    --accent-color: #8439DF; /* اللون البنفسجي الجذاب للمشروع */
    --card-active-bg: rgba(132, 57, 223, 0.08);
    --toggle-bg: #FAF6E3;
    --toggle-active-bg: #8439DF;
    --toggle-active-text: #FFFFFF;
}

/* ج) النمط الانسيابي الدافئ (Sepia) - باللون الترابي/الذهبي */
body.sepia-theme {
    --bg-forms: #FFFDF0;
    --bg-brand: #FAF6E3;
    --text-main: #2D2D2D;
    --text-muted: #8C816E;
    --input-bg: #FFFFFF;
    --input-border: #E8E2CD;
    --accent-color: #A8997F; /* اللون الترابي/الذهبي الفاتح الأصلي */
    --card-active-bg: #F6F1E0;
    --toggle-bg: #FAF6E3;
    --toggle-active-bg: #FFFFFF;
    --toggle-active-text: #2D2D2D;
}

/* التحكم في ألوان نصوص جهة البراند بناءً على خلفيتها */
body.dark-theme .info-side,
body.light-theme .info-side {
    color: #FFFFFF !important;
}
body.dark-theme .info-side .feature-text {
    color: #E2DCD0 !important;
}

body.sepia-theme .info-side {
    color: #2D2D2D !important;
}
body.sepia-theme .info-side .feature-text {
    color: #555045 !important;
}

.bubble-user{
    background: var(--accent-orange)  !important;      /* خلفية بنفسجية معبأة، ثابتة بكل الأنماط الثلاثة */
    color: #ffffff !important;           /* نص أبيض، يبقى واضحاً فوق الخلفية البنفسجية دائماً */
    border-radius: 14px 4px 14px 14px !important;
    padding: 12px 16px !important;
    max-width: 88% !important;
    text-align: right !important;
    line-height: 1.85 !important;
    font-size: 14.5px !important;
    display: inline-block !important;
}

.bubble-user .msg-time,
.msg-row .bubble-user + .msg-time{
    color: rgba(255,255,255,0.7) !important;
}
.custom-tooltip {
    position: fixed;
    z-index: 3000;
    background: #1f2937;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(6px) scale(0.95);
    transition: opacity .15s ease, transform .15s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.custom-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
/* تثبيت قسم البحث والفلاتر بأعلى الصفحة عند التمرير لتحت */
.search-section {
    position: sticky;
    top: 0; /* لو عندك هيدر ثابت فوقه بارتفاع معروف، بدّل القيمة لارتفاع الهيدر بالبكسل بدل 0 */
    z-index: 1030;
    background-color: #14141f; /* لازم يكون نفس لون خلفية الصفحة، وإلا المحتوى اللي بينزل رح يظهر شفاف من ورا القسم */
    padding-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* الخط تحت التصنيفات */
}


/* الهيدر وقسم البحث - النمط الداكن (Dark Theme) */
body.dark-theme .responsive-header,
body.dark-theme .responsive-header-mobile,
body.dark-theme .search-section {
    background-color: #1a1a1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* الهيدر وقسم البحث - النمط الفاتح (Light Theme) */
body.light-theme .responsive-header,
body.light-theme .responsive-header-mobile,
body.light-theme .search-section {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* الهيدر وقسم البحث - نمط السيبيا (Sepia Theme) */
body.sepia-theme .responsive-header,
body.sepia-theme .responsive-header-mobile,
body.sepia-theme .search-section {
    background-color: #fcf8e3; /* لون دافئ مريح للعين */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* الخصائص المشتركة الثابتة */
.responsive-header,
.responsive-header-mobile {
    position: sticky;
    top: 0;
    z-index: 1040;
    padding-top: 16px;
    padding-bottom: 16px;
}

.search-section {
    position: sticky;
    z-index: 1030;
    padding-top: 16px;
    padding-bottom: 16px;
    /* top يتم ضبطه ديناميكياً بالجافاسكريبت حسب ارتفاع الهيدر الفعلي */
}
/* تنسيق إضافي للعناصر الفرعية داخل الأكورديون */
.index-sub-items {
    padding: 5px 20px 15px 20px;
}

.index-sub-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #b3b3b3;
    border-right: 2px solid transparent;
    transition: all 0.2s ease;
}

.index-sub-item:hover {
    color: var(--accent-orange);
    background-color: rgba(255, 140, 50, 0.05);
}

/* العنصر النشط الملوّن أثناء تمرير وقراءة الصفحة */
.index-sub-item.active-text {
    color: #ff8c32 !important;
    border-right-color: #ff8c32;
    font-weight: bold;
}

/* إزالة سهم البوتستراب الافتراضي الأبيض عند الرغبة أو تنسيقه */
.accordion-button::after {
    filter: invert(1); /* يقلب لون السهم للأبيض ليتناسب مع الـ Dark Mode */
}

/* تثبيت القائمة الجانبية اليمنى (الفهرس) والقائمة اليسرى (سجل التعديلات) */
#sidebar-right,
#sidebar-left,
aside {
    position: -webkit-sticky; /* لدعم متصفحات Safari القديمة */
    position: sticky !important;
    top: 20px; /* المسافة المقدرة من أعلى الشاشة عند الالتصاق، يمكنك تعديلها حسب ارتفاع الهيدر لديك */

    /* تحديد الارتفاع الأقصى للقوائم لكي لا تخرج عن الشاشة إذا كانت عناصرها كثيرة */
    max-height: calc(100vh - 40px);

    /* تفعيل شريط التمرير الداخلي فقط للقائمة إذا زادت عناصرها عن حجم الشاشة */
    overflow-y: auto;

    /* إخفاء شريط التمرير الافتراضي المزعج للحفاظ على جمالية التصميم */
    scrollbar-width: none; /* لمتصفح Firefox */
}

/* إخفاء شريط التمرير لمتصفحات Chrome و Safari */
#sidebar-right::-webkit-scrollbar,
#sidebar-left::-webkit-scrollbar {
    display: none;
}
/* 1. تعريف الكلاس المخصص وإعطائه نقطة الالتصاق والارتفاع */
.sticky-top-custom {
    position: -webkit-sticky !important; /* لدعم متصفحات سفاري */
    position: sticky !important;
    top: 20px !important; /* المسافة الفاصلة من أعلى الشاشة عند النزول */

    /* تحديد أقصى ارتفاع مسموح للقوائم حتى لا تختفي أسفل الشاشة */
    max-height: calc(100vh - 40px) !important;

    /* السماح بالتمرير الداخلي المنفصل فقط إذا كانت محتويات القائمة طويلة */
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* 2. كسر تمدد أعمدة البوتستراب الجانبية لضمان عمل الـ Sticky بنجاح */
#rightColumn,
#leftColumn {
    align-self: flex-start !important; /* تجعل العمود ينتهي بانتهاء محتواه ولا يتمدد بطول الصفحة */
}

/* إخفاء العمود الأيمن بالكامل عند الطي (يمنع أي إزاحة للفهرس/العمود الأيسر) */
.hidden-panel {
    display: none !important;
}

/* تمدد سلس لعرض الأعمدة عند الإخفاء/الإظهار */
.transition-width {
    transition: all 0.3s ease;
}

/* السهم العائم الموحّد لإخفاء/إظهار العمود الأيمن - ثابت بمنتصف الشاشة دائماً (مش نص الصف اللي بيتغير طوله حسب التاب) */
.panel-toggle-handle {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1050;
    width: 26px;
    height: 56px;
    display: flex;
    background: #2a2a2a !important;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px 0 0 8px;
    color: white;
    cursor: pointer;
    transition: left 0.3s ease, background 0.2s ease, color 0.2s ease;
}

.panel-toggle-handle:hover {
    background: var(--bg-hover, #3a3a4e);
    color: #fff;
}

/* 3. لمسة جمالية: إخفاء أشرطة التمرير الافتراضية المزعجة داخل القوائم الثابتة */
.sticky-top-custom::-webkit-scrollbar {
    display: none !important;
}
.sticky-top-custom {
    scrollbar-width: none !important; /* لمتصفح فايرفوكس */
    -ms-overflow-style: none !important; /* لمتصفح إيدج */
}


body.sepia-theme .panel-toggle-handle {
    background: #fcf8e3 !important;
    border-color: #e8dfc5 !important;
    color: #5c4b37 !important;
}

body.light-theme .panel-toggle-handle {
    background: var(--accent-orange)  !important;
    border-color: #e8dfc5 !important;
    color: white !important;
}

body.dark-theme .panel-toggle-handle {
    background: #2a2a2a !important;
    border-color: #e8dfc5 !important;
    color: #5c4b37 !important;
}
@media (min-width: 1200px) {
    .h4, h4 {
        font-size: 1.125rem !important;
    }
}
.h5, h5 {
    font-size: .875rem !important;
}
.h6, h6 {
    font-size: .875rem !important;
}
.mb-4 {
    margin-bottom: 1rem !important;
}
.pt-5 {
    padding-top: 1.5rem !important;
}
.small, small {
     font-size: .75rem !important;
 }
.card-doc-id {
    color: #fff;
    font-weight: 700;
    font-size: .75rem !important;
    color:#495057 !important
}

.card-doc-id-title {
    color: #fff;
    font-size: .75rem !important;
    color:#495057 !important
}
.updates-header-badge {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.65rem !important;
}

/* تنسيق الزر الرئيسي وقائمة العرض عند اختيار عنصر منهما */
.filter-btn.active-filter {
    background-color: var(--accent-orange, #f97316) !important;
    color: #fff !important;
    border-color: var(--accent-orange, #f97316) !important;
}

/* لضمان تغير لون الأيقونات والنصوص داخل الزر الرئيسي عند التفعيل */
.filter-btn.active-filter i,
.filter-btn.active-filter svg {
    color: #fff !important;
}

/* تنسيق العناصر داخل القائمة المنسدلة عند اختيارها */
.dropdown-item.active-item {
    background-color: #f0f4ff !important;
    color: #3b4298 !important;
    font-weight: bold;
}
/* تجاوز التموضع الافتراضي لـ Bootstrap Offcanvas حتى لا يبدأ من أعلى الشاشة */
#advancedSearchOffcanvas.custom-offcanvas {
    top: 0;              /* ستُستبدل ديناميكياً بقيمة JS بالأعلى، هذا فقط قيمة ابتدائية آمنة */
    transition: top 0.2s ease, height 0.2s ease;
}

/* تأثير الإزاحة على المحتوى الرئيسي */
.content-area.pushed-left,
main.pushed-left,
body.pushed-left {
    transition: margin-right 0.3s ease;
}

/* إصلاح مشكلة الشفافية حصرياً لهذا النمط دون التأثير على البقية */
body.light-theme #addUserModal.user-custom-modal .modal-content {
    background-color: #fff !important; /* ضع هنا لون الخلفية الداكن المناسب لموقعك مثل #121212 أو #212529 */
    opacity: 1 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

body.sepia-theme #addUserModal.user-custom-modal .modal-content {
    background-color: #fff !important; /* ضع هنا لون الخلفية الداكن المناسب لموقعك مثل #121212 أو #212529 */
    opacity: 1 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

#addUserModal.user-custom-modal .modal-content {
    background-color: #1a1a1a !important; /* ضع هنا لون الخلفية الداكن المناسب لموقعك مثل #121212 أو #212529 */
    opacity: 1 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
    border: 1px solid #fff !important;
}