  :dir(rtl) input:required,
  :dir(rtl) select:required {
    border-right: 2px solid red !important;
  }

  /* للغة الإنجليزية (LTR) */
  :dir(ltr) input:required,
  :dir(ltr) select:required {
    border-left: 2px solid red !important;
  }

  /* للغات RTL - الحدود على اليمين */
  :dir(rtl) select[required] {
    border-right: 2px solid red !important;
    border-left: none !important;
    /* نتأكد ما يكون على اليسار */
  }

  /* للغات RTL - التعامل مع Select2 */
  :dir(rtl) select[required]+.select2-container {
    box-shadow: 2px 0 0 0 red !important;
    /* ظل على اليمين */
    border-radius: 2px !important;
    outline: none !important;
  }

  /* للغات LTR - الحدود على اليسار */
  :dir(ltr) select[required] {
    border-left: 2px solid red !important;
    border-right: none !important;
    /* نتأكد ما يكون على اليمين */
  }

  /* للغات LTR - التعامل مع Select2 */
  :dir(ltr) select[required]+.select2-container {
    box-shadow: -2px 0 0 0 red !important;
    /* ظل على اليسار */
    border-radius: 2px !important;
    outline: none !important;
  }

  /* تجاهل العناصر غير المطلوبة */
  select:not([required])+.select2-container {
    box-shadow: none !important;
    border: none !important;
  }


  .input-group {
    display: flex;
    /* force flex */
    /* align-items: center; */
    gap: 10px;
    width: 100%;
    /* تأكد من أن الحاوية تأخذ كامل العرض */
    flex-wrap: nowrap;
    /* اجعلهم في سطر واحد */
  }

  .input-group label {
    min-width: 100px;
    /* أو حسب الطول المناسب للغة */
    white-space: nowrap;
    text-align: center;
    margin-bottom: 20px;
  }

  .col-md-6 select {
    flex: 1;
    min-width: 0;
    /* مهم لمنع التمدد الزائد */
  }

  .langforms {
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;

  }

  .langforms label {
    min-width: 100px;
    /* أو حسب الطول المناسب للغة */
    white-space: nowrap;
    text-align: center;
  }

  .btn-reset-style {
    font-size: initial !important;
    padding: 5px !important;
    min-width: 30px !important;
    margin-top: initial !important;
  }

  /* لا تفعّل scroll بشكل افتراضي */
  .table-responsive {
    overflow-x: visible;
  }

  /* فقط في الشاشات الصغيرة (أقل من 768px) فعّل الـ scroll */
  @media (max-width: 767.98px) {
    .table-responsive {
      overflow-x: auto;
    }
  }

  .type-btn {
    border-radius: 50px !important;
    min-width: 80px !important;
    text-align: center !important;
    transition: 0.3s ease-in-out !important;
    margin: 0 5px !important;
    padding: 5px !important;
    font-size: 12px !important;
  }

  .type-btn.active {
    background-color: #ed1d26;
    color: white;
    border-color: #ed1d26;
  }

  .type-btn:hover {
    background-color: #ed1d26;
    color: white;
  }

  .btn-group.custom-pill-group {
    flex-wrap: wrap;
    gap: 10px;
  }

  .select2-container--default .select2-selection--single {
    height: 38px !important;
    padding: 6px 12px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
  }

  .select2-container .select2-selection--multiple {
    height: 38px !important;
    padding: 6px 12px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
  }

  .is-invalid {
    border-color: red !important;
  }

  :dir(rtl) .select2-results__options {
    text-align: right !important;
    direction: rtl !important;
  }

  :dir(ltr) .select2-results__options {
    text-align: left !important;
    direction: ltr !important;
  }

  .select2-container--default .select2-selection.is-invalid {
    border-radius: 0.25rem;
    background-color: #fff;
    box-shadow: inset 0 0 0 1px #ed1d26;
  }

  /* يجعل النص يلتف داخل الجدول */
  table.dataTable td,
  table td {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
  }

  /* تحديد عرض افتراضي للخلية لتساعد على الالتفاف */
  table.dataTable td {
    max-width: 200px;
    /* عدلها حسب الحاجة */
  }


  /*for select2*/
  /*  حل تمدد select2 في حالة multiple */
  .select2-container--default .select2-selection--multiple {
    min-height: 38px;
    height: auto !important;
    overflow: visible !important;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    padding-bottom: 4px;
  }

  /*  حتى تتوسع داخل المودال بدون قص */
  .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    max-height: none !important;
    overflow-y: visible !important;
  }

  /*  شكل التاغات مرتب */
  .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 4px;
    margin-right: 4px;
  }

  /*شكل جدول الصلاحيات*/
  html[dir="rtl"] .permission-table th,
  html[dir="rtl"] .permission-table td {
    text-align: center;
    direction: rtl;
  }

  html[dir="rtl"] .form-check-input {
    float: none;
    margin: 0;
  }

  .permission-table input[type="checkbox"] {
    transform: scale(1.2);
  }

  .permission-table th,
  .permission-table td,
  .permission-table label {
    white-space: nowrap !important;
  }

  .ms-switch-container {
    display: block;
    margin-top: 10px;
  }

  .fa-list {
    color: #676764;
  }

  .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: #ed1d26 !important;
    border-color: #ed1d26 !important;
  }
   /* تخصيص الـ radio buttons */
  /* Wrapper */
.radio-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-inline-start: 30px; /* بديل ذكي عن padding-left */
}

/* Radio item */
.custom-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 48%;
}

/* إخفاء radio الأصلي */
.custom-control-input {
  display: none;
}

/* Label */
.custom-control-label {
  font-size: 14px;
  color: #333;
  position: relative;
  cursor: pointer;
  font-weight: 500;

  padding-inline-start: 25px; /* بدل padding-left */
}

/* دائرة الـ radio */
.custom-control-label::before {
  content: '';
  position: absolute;
  inset-inline-start: 0; /* بدل left */
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #666;
  border-radius: 50%;
  background: #fff;
}

/* النقطة الداخلية */
.custom-control-input:checked + .custom-control-label::after {
  content: '';
  position: absolute;
  inset-inline-start: 4px; /* بدل left */
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #007bff;
  border-radius: 50%;
}

/* إضافة تأثير عند اختيار الـ radio button */
.custom-control-input:checked+.custom-control-label {
    color: #e53e3e;
    /* الأحمر عند الاختيار */
}

/* عندما يكون radio غير مفعل */
.custom-control-label:hover {
    color: #ed1d26;
}
/* الاتجاه العام LTR (الإنجليزية) */
[dir="ltr"] .timeline {
  list-style: none;
  padding: 0;
  position: relative;
}
/*عرض الحالات*/
[dir="ltr"] .timeline:before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

[dir="ltr"] .timeline li {
  position: relative;
  margin-bottom: 20px;
  padding-left: 50px;
}

[dir="ltr"] .timeline li:before {
  content: '';
  position: absolute;
  left: 12px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ed1d26;
}

/* الاتجاه RTL (العربية) */
[dir="rtl"] .timeline {
  list-style: none;
  padding: 0;
  position: relative;
}

[dir="rtl"] .timeline:before {
  content: '';
  position: absolute;
  right: 20px; /* بدل left */
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

[dir="rtl"] .timeline li {
  position: relative;
  margin-bottom: 20px;
  padding-right: 50px; /* بدل padding-left */
}

[dir="rtl"] .timeline li:before {
  content: '';
  position: absolute;
  right: 12px; /* بدل left */
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ed1d26;
}
/* الإنجليزية (LTR) */
[dir="ltr"] .modal-header .close {
  order: 2; /* يبقى على اليمين */
  margin-left: auto;
  margin-right: 0;
}

/* العربية (RTL) */
[dir="rtl"] .modal-header .close {
  order: 0; /* يصبح على اليسار */
  margin-right: auto;
  margin-left: 0;
}
/* الإنجليزية */
[dir="ltr"] .timeline li div {
  text-align: left;
  direction: ltr;
}

/* العربية */
[dir="rtl"] .timeline li div {
  text-align: right;
  direction: rtl;
}

