.reply_span {
    color: #fff !important;
    background: #6ecad7 !important;
    cursor: pointer;
    width: fit-content;
}

/* ===========================
   Selection Tags (Checkbox Pills)
   =========================== */
.selection-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    /* مسافة بين العناصر */
}

/* بنخفي الشيك بوكس الأصلي */
.btn-check-custom {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

/* شكل الليبل كأنه زرار */
.btn-tag-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    /* يخليها بيضاوية */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

/* لما الماوس ييجي عليها */
.btn-tag-label:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

/* لما نختار العنصر (Checked State) */
.btn-check-custom:checked+.btn-tag-label {
    background-color: var(--primary-color, #0d6efd);
    /* يستخدم لون البراند */
    color: #fff;
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 4px 6px -1px rgba(13, 110, 253, 0.2);
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    min-height: 42px;
}

/* التاج الأزرق */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #0d6efd !important;
    border: 1px solid #0d6efd !important;
    color: #fff !important;
    border-radius: 50px !important;
    padding: 2px 8px !important;
    margin-top: 5px;
}

/* زرار الحذف (x) */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 5px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

/* رفع طبقة قائمة Select2 عشان تظهر فوق أي حاجة */
.select2-container {
    z-index: 99999 !important;
}

.select2-dropdown {
    z-index: 99999 !important;
}

/* ===========================
   Select2 Consistency Fixes
   =========================== */

/* 1. الحاوية الرئيسية: نخليها شبه الـ Input العادي بالظبط */
.select2-container--default .select2-selection--multiple {
    background-color: #fff;
    /* خلفية بيضاء */
    border: 1px solid #dee2e6;
    /* نفس لون بوردر الانبوت العادي */
    border-radius: 0.5rem;
    /* نفس التدويرة (Rounded) */
    min-height: 48px;
    /* ارتفاع ثابت يطابق باقي الحقول (مهم جداً للتناسق) */
    padding: 6px 8px;
    /* مسافة داخلية مريحة */
    display: flex;
    /* عشان العناصر تيجي في النص */
    align-items: center;
    /* توسيط عمودي */
    flex-wrap: wrap;
    /* عشان لو التاجز كترت ينزلوا سطر جديد */
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

/* 2. حالة الفوكس (لما تدوس عليه): ينور أزرق زي باقي الفورم */
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

/* 3. شكل التاجز (الكبسولات الزرقاء) */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #0d6efd !important;
    /* أزرق */
    border: none !important;
    color: #fff !important;
    border-radius: 50px !important;
    /* شكل بيضاوي كامل */
    padding: 4px 12px !important;
    /* مساحة واسعة جوه التاج */
    font-size: 0.85rem;
    font-weight: 500;
    margin: 2px 4px 2px 0 !important;
    /* مسافات بين التاجز وبعضها */
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    /* عشان علامة الاكس تيجي يمين أو شمال حسب العربي */
}

/* 4. علامة الحذف (X) جوه التاج */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-left: 8px !important;
    /* مسافة بين الاكس والكلمة */
    margin-right: 0 !important;
    border-right: none !important;
    font-size: 1rem;
    font-weight: bold;
    opacity: 0.8;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: transparent !important;
    opacity: 1;
    color: #fff !important;
}

/* 5. مكان الكتابة (مؤشر البحث) */
.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: 0 !important;
    margin-left: 5px;
    height: 24px;
    /* ارتفاع مناسب للخط */
    line-height: 24px;
    font-family: inherit;
    /* ياخد نفس فونت الموقع */
}

/* ===========================
   Force Select2 Consistency
   =========================== */

/* 1. تظبيط البوكس الخارجي (الإطار) */
/* بنستخدم html body عشان نعلي الأولوية */
html body .select2-container .select2-selection--multiple {
    min-height: 50px !important;
    /* التعديل الجديد: أقصى ارتفاع وسكرول */
    max-height: 85px !important;
    /* يا دوب سطرين، عشان مياخدش مساحة كبيرة */
    overflow-y: auto !important;
    /* يظهر سكرول جانبي لو العناصر كترت */
    /* ارتفاع ثابت وكبير زي باقي الانبوتس */
    padding: 8px 12px !important;
    /* مسافات داخلية مريحة */
    border: 1px solid #dee2e6 !important;
    /* لون البوردر */
    border-radius: 0.5rem !important;
    /* التدويرة */
    background-color: #fff !important;
    display: flex !important;
    align-items: center !important;
    /* سنترة الكلام عمودياً */
    flex-wrap: wrap !important;
}

/* 2. تظبيط حالة التركيز (Focus) */
html body .select2-container.select2-container--focus .select2-selection--multiple {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    outline: 0 !important;
}

/* 3. تظبيط التاجز (الكبسولات الزرقاء) */
html body .select2-container .select2-selection--multiple .select2-selection__choice {
    background-color: #0d6efd !important;
    border: none !important;
    color: #fff !important;
    border-radius: 50px !important;
    padding: 6px 14px !important;
    /* كبرنا التاج شوية */
    font-size: 0.85rem !important;
    margin: 4px 6px 4px 0 !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    /* عشان الاكس ييجي في المكان الصح */
    align-items: center !important;
}

/* 4. تظبيط علامة الحذف (X) */
html body .select2-container .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-left: 8px !important;
    margin-right: 0 !important;
    border: none !important;
    font-weight: bold !important;
    opacity: 0.8 !important;
}

html body .select2-container .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: transparent !important;
    opacity: 1 !important;
}

/* 5. مكان الكتابة (Search Input) */
/* ده مهم عشان المؤشر ميبقاش لازق فوق */
html body .select2-container .select2-search--inline .select2-search__field {
    margin-top: 0 !important;
    margin-left: 5px !important;
    height: 30px !important;
    /* ارتفاع مناسب للكتابة */
    line-height: 30px !important;
    font-family: inherit !important;
}

/* ===========================
   Date Input Enhancement
   =========================== */

/* Make date inputs more clickable and user-friendly */
input[type="date"] {
    cursor: pointer;
    position: relative;
    min-height: 42px;
}

/* Ensure the entire date input area is clickable */
input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    color: transparent;
    background: transparent;
    cursor: pointer;
}

/* Show pointer cursor on hover */
input[type="date"]:hover {
    cursor: pointer;
}

/* Style for focused date input */
input[type="date"]:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

