/* =================================================================================
 * VUEXY BASE CUSTOM STYLES - UNIFIED FILE
 * جميع التصميمات المخصصة في ملف واحد
 * ================================================================================= */

/* =================================================================================
 * WALLET BUTTON - Consistent Design with Other Action Buttons
 * زر المحفظة - تصميم متسق مع باقي أزرار الإجراءات
 * ================================================================================= */

/* الحالة الافتراضية - زر المحفظة */
.table tbody tr .wallet-btn.btn-outline-info,
.table-hover tbody tr .wallet-btn.btn-outline-info {
    border-color: #0dcaf0 !important;
    color: #0dcaf0 !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

/* عند hover مباشرة على زر المحفظة - خلفية زرقاء فاتحة + نص أبيض */
.table tbody tr .wallet-btn.btn-outline-info:hover,
.table-hover tbody tr .wallet-btn.btn-outline-info:hover,
.table tbody tr:hover .wallet-btn.btn-outline-info:hover {
    border-color: #0dcaf0 !important;
    color: #ffffff !important;
    background-color: #0dcaf0 !important;
    box-shadow: 0 2px 4px rgba(13, 202, 240, 0.3) !important;
}

/* عند hover على الصف - الحفاظ على اللون الأصلي */
.table tbody tr:hover .wallet-btn.btn-outline-info,
.table-hover tbody tr:hover .wallet-btn.btn-outline-info {
    border-color: #0dcaf0 !important;
    color: #0dcaf0 !important;
    background-color: transparent !important;
}

/* Focus و Active states */
.table tbody tr .wallet-btn.btn-outline-info:focus,
.table tbody tr .wallet-btn.btn-outline-info:active,
.table tbody tr:hover .wallet-btn.btn-outline-info:focus,
.table tbody tr:hover .wallet-btn.btn-outline-info:active {
    border-color: #0dcaf0 !important;
    color: #0dcaf0 !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25) !important;
}

/* الأيقونات داخل زر المحفظة تحافظ على ألوانها */
.table tbody tr .wallet-btn i,
.table tbody tr:hover .wallet-btn i,
.table-hover tbody tr .wallet-btn i,
.table-hover tbody tr:hover .wallet-btn i {
    color: inherit !important;
    transition: color 0.2s ease !important;
}

/* عند hover على الزر - الأيقونة تتحول للون الأبيض */
.table tbody tr .wallet-btn:hover i,
.table tbody tr:hover .wallet-btn:hover i,
.table-hover tbody tr .wallet-btn:hover i,
.table-hover tbody tr:hover .wallet-btn:hover i {
    color: inherit !important;
}

/* =================================================================================
 * DATATABLE TRUNCATE TEXT STYLING
 * ================================================================================= */
table.dataTable tbody td .text-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* Tooltip styling for truncated text */
table.dataTable tbody td .text-truncate[title]:hover {
    position: relative;
}

/* Enhanced tooltip using CSS (fallback if Bootstrap tooltip not available) */
table.dataTable tbody td .text-truncate[title] {
    position: relative;
}

/* Dark mode support */
html.dark-style table.dataTable tbody td .text-truncate {
    color: #b4b7bd;
}

/* =================================================================================
 * 1. SWEETALERT2 MINIMAL STYLING
 * ================================================================================= */

/* تطبيق التصميم الأساسي فقط */
.swal2-popup {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 1.5rem !important;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.12) !important;
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Dark mode */
html.dark-style .swal2-popup {
  background: rgba(40, 48, 70, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
modal-footer {
    text-align: center !important;
}
/* العنوان */
.swal2-popup .swal2-title {
    color: #2b2c40 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

html.dark-style .swal2-popup .swal2-title {
  color: #d0d2d6 !important;
}

/* المحتوى */
.swal2-popup .swal2-html-container {
  color: #5d596c !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
}

html.dark-style .swal2-popup .swal2-html-container {
  color: #b4b7bd !important;
}

/* الأيقونة */
.swal2-popup .swal2-icon {
  width: 5rem !important;
  height: 5rem !important;
  margin: 1rem auto 1rem !important;
  border: none !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}

.swal2-popup .swal2-icon::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(115, 103, 240, 0.1), rgba(115, 103, 240, 0.2)) !important;
  z-index: -1 !important;
}

.swal2-popup .swal2-icon-content {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  z-index: 1 !important;
  position: relative !important;
}

/* ألوان الأيقونات */
.swal2-popup .swal2-icon.swal2-warning .swal2-icon-content {
  color: #ff9f43 !important;
}

.swal2-popup .swal2-icon.swal2-warning::before {
  background: linear-gradient(135deg, rgba(255, 159, 67, 0.1), rgba(255, 159, 67, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-success .swal2-icon-content {
  color: #28c76f !important;
}

.swal2-popup .swal2-icon.swal2-success::before {
  background: linear-gradient(135deg, rgba(40, 199, 111, 0.1), rgba(40, 199, 111, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-error .swal2-icon-content {
  color: #ea5455 !important;
}

.swal2-popup .swal2-icon.swal2-error::before {
  background: linear-gradient(135deg, rgba(234, 84, 85, 0.1), rgba(234, 84, 85, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-info .swal2-icon-content {
  color: #00cfe8 !important;
}

.swal2-popup .swal2-icon.swal2-info::before {
  background: linear-gradient(135deg, rgba(0, 207, 232, 0.1), rgba(0, 207, 232, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-question .swal2-icon-content {
  color: #7367f0 !important;
}

.swal2-popup .swal2-icon.swal2-question::before {
  background: linear-gradient(135deg, rgba(115, 103, 240, 0.1), rgba(115, 103, 240, 0.2)) !important;
}

/* الأزرار */
.swal2-popup .swal2-styled,
.swal2-popup button[class*="swal2-"] {
  border-radius: 1rem !important;
  padding: 1rem 2rem !important;
  font-weight: 600 !important;
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 999999 !important;
  position: relative !important;
  font-size: 1rem !important;
  letter-spacing: 0.025em !important;
  min-width: 8rem !important;
  overflow: hidden !important;
}

/* زر التأكيد */
.swal2-popup .swal2-styled.swal2-confirm {
  background: linear-gradient(135deg, #7367f0, #5a4fcf) !important;
  color: white !important;
  box-shadow: 0 4px 16px rgba(115, 103, 240, 0.4), 0 0 0 1px rgba(115, 103, 240, 0.1) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 999999 !important;
  position: relative !important;
}

/* زر التأكيد - جميع الأنواع */
.swal2-popup .swal2-styled.swal2-confirm,
.swal2-popup .swal2-styled.swal2-accept,
.swal2-popup .swal2-styled.swal2-ok,
.swal2-popup button.swal2-confirm {
  background: linear-gradient(135deg, #7367f0, #5a4fcf) !important;
  color: white !important;
  box-shadow: 0 4px 16px rgba(115, 103, 240, 0.4), 0 0 0 1px rgba(115, 103, 240, 0.1) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 999999 !important;
  position: relative !important;
}

.swal2-popup .swal2-styled.swal2-confirm::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1)) !important;
  border-radius: 1rem !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.swal2-popup .swal2-styled.swal2-confirm:hover,
.swal2-popup .swal2-styled.swal2-accept:hover,
.swal2-popup .swal2-styled.swal2-ok:hover,
.swal2-popup button.swal2-confirm:hover {
  background: linear-gradient(135deg, #685dd8, #7367f0) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 32px rgba(115, 103, 240, 0.5), 0 0 0 1px rgba(115, 103, 240, 0.2) !important;
}

.swal2-popup .swal2-styled.swal2-confirm:hover::before {
  opacity: 1 !important;
}

.swal2-popup .swal2-styled.swal2-confirm:active,
.swal2-popup .swal2-styled.swal2-accept:active,
.swal2-popup .swal2-styled.swal2-ok:active,
.swal2-popup button.swal2-confirm:active {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(115, 103, 240, 0.4) !important;
}

/* زر الإلغاء */
.swal2-popup .swal2-styled.swal2-cancel,
.swal2-popup .swal2-styled.swal2-deny,
.swal2-popup button.swal2-cancel,
.swal2-popup button.swal2-deny {
  background: rgba(255, 255, 255, 0.8) !important;
  color: #5d596c !important;
  border: 2px solid #e0e0e0 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 999999 !important;
  position: relative !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.swal2-popup .swal2-styled.swal2-cancel::before,
.swal2-popup .swal2-styled.swal2-deny::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02)) !important;
  border-radius: 1rem !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

html.dark-style .swal2-popup .swal2-styled.swal2-cancel,
html.dark-style .swal2-popup .swal2-styled.swal2-deny,
html.dark-style .swal2-popup button.swal2-cancel,
html.dark-style .swal2-popup button.swal2-deny {
  background: rgba(40, 48, 70, 0.8) !important;
  color: #b4b7bd !important;
  border: 2px solid #404656 !important;
}

html.dark-style .swal2-popup .swal2-styled.swal2-cancel::before,
html.dark-style .swal2-popup .swal2-styled.swal2-deny::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)) !important;
}

.swal2-popup .swal2-styled.swal2-cancel:hover,
.swal2-popup .swal2-styled.swal2-deny:hover,
.swal2-popup button.swal2-cancel:hover,
.swal2-popup button.swal2-deny:hover {
  background: rgba(248, 247, 250, 0.9) !important;
  color: #2b2c40 !important;
  border-color: #7367f0 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.swal2-popup .swal2-styled.swal2-cancel:hover::before,
.swal2-popup .swal2-styled.swal2-deny:hover::before {
  opacity: 1 !important;
}

html.dark-style .swal2-popup .swal2-styled.swal2-cancel:hover,
html.dark-style .swal2-popup .swal2-styled.swal2-deny:hover,
html.dark-style .swal2-popup button.swal2-cancel:hover,
html.dark-style .swal2-popup button.swal2-deny:hover {
  background: rgba(52, 61, 85, 0.9) !important;
  color: #d0d2d6 !important;
  border-color: #7367f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.swal2-popup .swal2-styled.swal2-cancel:active,
.swal2-popup .swal2-styled.swal2-deny:active,
.swal2-popup button.swal2-cancel:active,
.swal2-popup button.swal2-deny:active {
  transform: translateY(0) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

/* خلفية الحاوية */
.swal2-container {
  background-color: rgba(0, 0, 0, 0.4) !important;
}

/* إصلاح مشكلة الأزرار */
.swal2-popup .swal2-actions {
  pointer-events: auto !important;
  z-index: 999999 !important;
  position: relative !important;
  gap: 1rem !important;
  margin-top: 2rem !important;
}

.swal2-popup {
  pointer-events: auto !important;
}

/* تأثيرات إضافية للأزرار */
.swal2-popup .swal2-styled {
  text-shadow: none !important;
  outline: none !important;
}

.swal2-popup .swal2-styled:focus {
  outline: 2px solid rgba(115, 103, 240, 0.5) !important;
  outline-offset: 2px !important;
}

/* تحسين النص داخل الأزرار */
.swal2-popup .swal2-styled span {
  position: relative !important;
  z-index: 1 !important;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .swal2-popup {
    max-width: 95vw !important;
    margin: 1rem !important;
  }
  
  .swal2-popup .swal2-title {
    font-size: 1.25rem !important;
  }
  
  .swal2-popup .swal2-actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .swal2-popup .swal2-styled {
    width: 100% !important;
  }
  
  .swal2-popup .swal2-icon {
    width: 4rem !important;
    height: 4rem !important;
  }
  
  .swal2-popup .swal2-icon-content {
    font-size: 2rem !important;
  }
}

/* =================================================================================
 * 2. MODAL BUTTON POSITION FIX
 * ================================================================================= */

/* إصلاح مشكلة موضع أزرار المودال */
.modal-footer {
  position: relative !important;
  z-index: 1050 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important; /* center buttons always */
  gap: 0.75rem !important;
  padding: 1rem 1.5rem !important;
  border-top: 1px solid #e0e0e0 !important;
  background-color: #ffffff !important;
}

/* الوضع الداكن */
html.dark-style .modal-footer {
    background-color: #2f3349 !important;
    border-top: 1px solid #404656 !important;
}

/* أزرار المودال */
.modal-footer .btn {
  position: relative !important;
  z-index: 1051 !important;
  margin: 0 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* زر الحذف */
.modal-footer .btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
  color: white !important;
  border: none !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.modal-footer .btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #bd2130) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

/* زر الإلغاء */
.modal-footer .btn-secondary {
  background: #ffffff !important;
  color: #6c757d !important;
  border: 1px solid #d1d3d4 !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

html.dark-style .modal-footer .btn-secondary {
  background: #404656 !important;
  color: #b4b7bd !important;
  border: 1px solid #5d596c !important;
}

.modal-footer .btn-secondary:hover {
  background: #f8f9fa !important;
  color: #495057 !important;
  border-color: #adb5bd !important;
}

html.dark-style .modal-footer .btn-secondary:hover {
  background: #5d596c !important;
  color: #d0d2d6 !important;
}

/* التأكد من أن المودال نفسه لا يمنع النقر */
.modal-content {
  position: relative !important;
  z-index: 1050 !important;
}

.modal-dialog {
  position: relative !important;
  z-index: 1050 !important;
}

/* إصلاح مشكلة الـ backdrop */
.modal-backdrop {
  z-index: 1040 !important;
}

/* التأكد من أن الأزرار مرئية */
.modal-footer * {
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* إصلاح مشكلة مودال الصورة */
#imageModal {
  z-index: 20000 !important;
  position: fixed !important;
}

#imageModal .modal-dialog {
  z-index: 20001 !important;
}

#imageModal .modal-content {
  z-index: 20002 !important;
}

#imageModal .modal-backdrop {
  z-index: 19999 !important;
}

/* التأكد من أن مودال الصورة يظهر فوق جميع المودالات الأخرى */
.modal.show + #imageModal,
#imageModal.modal.show {
  z-index: 20000 !important;
}

/* إصلاح مشكلة الـ backdrop للمودالات المتعددة */
.modal-backdrop.show {
  z-index: 1040 !important;
}

.modal-backdrop.show + .modal-backdrop.show {
  z-index: 1041 !important;
}

/* إصلاح خاص لمودال الصورة */
body > #imageModal {
  z-index: 20000 !important;
}

body > #imageModal .modal-dialog {
  z-index: 20001 !important;
}

body > #imageModal .modal-content {
  z-index: 20002 !important;
}

/* منع التكرار في النقر على الصور */
img.clicked {
  pointer-events: none !important;
  opacity: 0.7 !important;
  transition: opacity 0.3s ease !important;
}

/* تحسين عرض الصور في المودال */
#imageModal img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* تأثيرات تفاعلية للصور */
.view-image {
  transition: all 0.3s ease !important;
}

.view-image:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* =================================================================================
 * 3. MODAL FIX SYSTEM
 * ================================================================================= */

/* إعدادات الـ z-index للمودالات */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

/* مودال الصورة - أعلى مستوى من الـ header */
#imageModal {
    z-index: 9999 !important; /* أعلى من الـ header */
}

#imageModal .modal-dialog {
    z-index: 10000 !important;
}

#imageModal .modal-content {
    z-index: 10001 !important;
}

/* التأكد من أن الـ header لا يتداخل مع المودالات */
.navbar-fixed-top {
    z-index: 1030 !important;
}

.layout-navbar-fixed .layout-navbar {
    z-index: 1030 !important;
}

/* منع التداخل في الخلفية المظلمة */
body.modal-open {

    overflow: hidden !important;
    padding-right: 0 !important;
}

/* تحسين مظهر مودال الصورة - صورة دائرية */
#imageModal .modal-body img {
    max-width: 300px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease-in-out;
    display: block;
    margin: 0 auto;
}

#imageModal .modal-body img:hover {
    transform: scale(1.02);
}

/* خلفية مودال الصورة مثل المودالات الأخرى */
#imageModal .modal-content {
    background: #ffffff !important;
    border: none !important;
}

html.dark-style #imageModal .modal-content,
html[data-theme="dark"] #imageModal .modal-content,
html[data-bs-theme="dark"] #imageModal .modal-content {
    background: #2f3349 !important;
}

/* خلفية الهيدر مثل خلفية المودال */
#imageModal .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

html.dark-style #imageModal .modal-header,
html[data-theme="dark"] #imageModal .modal-header,
html[data-bs-theme="dark"] #imageModal .modal-header {
    background: #2f3349 !important;
    border-bottom: 1px solid #404656 !important;
}

/* زر الإغلاق بخلفية مثل المودال */
#imageModal .modal-header .btn-close {
    background-color: #ffffff !important;
    opacity: 1 !important;
}

html.dark-style #imageModal .modal-header .btn-close,
html[data-theme="dark"] #imageModal .modal-header .btn-close,
html[data-bs-theme="dark"] #imageModal .modal-header .btn-close {
    background-color: #2f3349 !important;
}

/* خلفية الفوتر مثل المودال */
#imageModal .modal-footer {
    background: #ffffff !important;
    border-top: 1px solid #e0e0e0 !important;
}

html.dark-style #imageModal .modal-footer,
html[data-theme="dark"] #imageModal .modal-footer,
html[data-bs-theme="dark"] #imageModal .modal-footer {
    background: #2f3349 !important;
    border-top: 1px solid #404656 !important;
}

/* منع تكرار الصور في المودال */
#imageModal .modal-body {
    position: relative;
}

#imageModal .modal-body img:not(:first-child) {
    display: none !important;
}

/* زر الإغلاق في الـ footer */
#imageModal .modal-footer .btn {
    padding: 8px 20px;
    font-weight: 500;
    border-radius: 6px;
}

/* تم نقل الأنواع أعلاه */

/* تحسين مظهر العنوان */
#imageModal .modal-title {

    font-weight: 600;
    color: #ddd3d3;
}

/* منع الوميض أثناء الانتقالات */
.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.fade .modal-dialog {
    transition: transform 0.15s ease-out;
}

/* إصلاح مشاكل التركيز */
#imageModal:focus {
    outline: none;
}

/* دعم inert attribute لإدارة إمكانية الوصول */
[inert] {
    pointer-events: none;
    user-select: none;
}

[inert] * {
    pointer-events: none;
    user-select: none;
}

/* إدارة aria-hidden بشكل صحيح */
.modal[aria-hidden="true"] {
    pointer-events: none;
}

.modal[aria-hidden="true"] * {
    pointer-events: none;
}

.modal:not([aria-hidden="true"]) {
    pointer-events: auto;
}

.modal:not([aria-hidden="true"]) * {
    pointer-events: auto;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    #imageModal .modal-dialog {
        margin: 1rem;
    }
    
    #imageModal .modal-body img {
        max-height: 60vh;
    }
}

/* =================================================================================
 * MODAL CLOSE BUTTON - ALL MODALS
 * زر الإغلاق في جميع المودالات
 * ================================================================================= */

/* زر الإغلاق العام في جميع المودالات */
.modal .btn-close,
.modal-header .btn-close {
    opacity: 1 !important;
    transition: all 0.3s ease;
}

/* الثيم الفاتح - إزالة الـ filter */
.modal .btn-close,
.modal-header .btn-close {
    filter: none !important;
}

/* تأثير hover على زر الإغلاق */
.modal .btn-close:hover,
.modal-header .btn-close:hover {
    opacity: 0.8 !important;
}

html.dark-style .modal .btn-close:hover,
html.dark-style .modal-header .btn-close:hover,
html[data-theme="dark"] .modal .btn-close:hover,
html[data-theme="dark"] .modal-header .btn-close:hover,
html[data-bs-theme="dark"] .modal .btn-close:hover,
html[data-bs-theme="dark"] .modal-header .btn-close:hover {
    opacity: 0.9 !important;
}

/* تحسين مظهر زر الإغلاق */
.modal .btn-close:focus,
.modal-header .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(115, 103, 240, 0.25) !important;
    outline: none !important;
}

/* مودال الصورة - زر الإغلاق */
#imageModal .btn-close,
#imageModal .modal-header .btn-close {
    background-color: transparent !important;
    padding: 0.5rem !important;
    margin: 0 !important;
}

html.dark-style #imageModal .btn-close,
html.dark-style #imageModal .modal-header .btn-close,
html[data-theme="dark"] #imageModal .btn-close,
html[data-theme="dark"] #imageModal .modal-header .btn-close,
html[data-bs-theme="dark"] #imageModal .btn-close,
html[data-bs-theme="dark"] #imageModal .modal-header .btn-close {
    background-color: transparent !important;
}

/* تحسين مظهر محتوى المودالات */
.modal-content {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

html.dark-style .modal-content,
html[data-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .modal-content {
    background: #2f3349 !important;
    color: #f9fafb !important;
    border-color: #434968 !important;
}

/* تنسيق عام لـ modal-header */
.modal-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

html.dark-style .modal-header,
html[data-theme="dark"] .modal-header,
html[data-bs-theme="dark"] .modal-header {
    background: #2f3349;
    border-bottom: 1px solid #404656;
}

/* تحسين مظهر body المودال */
.modal-body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark-style .modal-body,
html[data-theme="dark"] .modal-body,
html[data-bs-theme="dark"] .modal-body {
    background: transparent !important;
    color: #f9fafb !important;
}

/* تحسين مظهر title المودال */
.modal-title {
    transition: color 0.3s ease;
}

html.dark-style .modal-title,
html[data-theme="dark"] .modal-title,
html[data-bs-theme="dark"] .modal-title {
    color: #f9fafb !important;
}

/* =================================================================================
 * 4. TABLE HEADER CUSTOM STYLES
 * ================================================================================= */

/* تصميم عام لـ header الجدول - العنوان فقط */
.table-header-custom {
    border-radius: 0.5rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(115, 103, 240, 0.2);
    position: relative;
}

/* تأثير خلفية خفيف */
.table-header-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    border-radius: 0.5rem;
    pointer-events: none;
}

/* العنوان في المنتصف */
.table-header-custom .header-title {
    color: var(--bs-primary);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* زر الإضافة - خارج الـ header */
.header-action-btn {
    background: var(--bs-primary);
    border: 1px solid var(--bs-primary);
    color: #ffffff;
    padding: 0.2rem 1rem;
    border-radius: 0.375rem;    
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.header-action-btn:hover {
    background: rgba(115, 103, 240, 0.9);
    border-color: rgba(115, 103, 240, 0.9);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.header-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(115, 103, 240, 0.25);
}

/* أيقونة الإضافة */
.header-action-btn .btn-icon {
    font-size: 1rem;
    font-weight: bold;
}

/* دعم اللغة العربية (RTL) - التخطيط الجديد */
[dir="rtl"] .table-header-custom {
    direction: rtl;
}

[dir="rtl"] .table-header-custom .header-title {
    text-align: center;
}

[dir="rtl"] .header-action-btn {
    margin: 1rem;
    margin-left: auto;
}

/* دعم اللغة الإنجليزية (LTR) - التخطيط الجديد */
[dir="ltr"] .table-header-custom {
    direction: ltr;
}

[dir="ltr"] .table-header-custom .header-title {
    text-align: center;
}

[dir="ltr"] .header-action-btn {
    margin: 1rem;
    margin-right: auto;
}

/* تصميم متجاوب - التخطيط الجديد */
@media (max-width: 768px) {
    .table-header-custom {
        padding: 1rem 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .table-header-custom .header-title {
        font-size: 1.25rem;
    }
    
    .header-action-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .table-header-custom {
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
    }
    
    .table-header-custom .header-title {
        font-size: 1.125rem;
    }
    
    .header-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* تأثيرات متوافقة مع ثيم Vuexy */
html.dark-style .table-header-custom {
    background: linear-gradient(135deg, #2f3349 0%, #2f3349 100%);
}

/* الثيم الفاتح - خلفية header الجدول */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table-header-custom {
    background: #ffffff;
}

/* الثيم الفاتح - لون العنوان */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table-header-custom .header-title {
    color: #333333 !important;
}

/* الثيم الداكن - لون العنوان */
html.dark-style .table-header-custom .header-title,
html[data-theme="dark"] .table-header-custom .header-title,
html[data-bs-theme="dark"] .table-header-custom .header-title {
    color: #f9fafb !important;
}

.header-action-btn {
    background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(115, 103, 240, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.header-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.header-action-btn:hover::before {
    left: 100%;
}

/* تأثير hover خفيف للـ header */
.table-header-custom:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* تحسينات للوصولية */
.table-header-custom .header-action-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* تأثيرات الحركة المتوافقة مع الثيم */
@media (prefers-reduced-motion: no-preference) {
    .table-header-custom {
        transition: box-shadow 0.15s ease-in-out;
    }
}

/* إخفاء الحركة للمستخدمين الذين يفضلون تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .table-header-custom {
        transition: none;
    }
    
    .table-header-custom:hover {
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
}

/* =================================================================================
 * 5. CUSTOM TOAST STYLES
 * ================================================================================= */

/* التوستر الأساسي */
.custom-toast {
    position: fixed;
    bottom: 20px;
    min-width: 300px;
    max-width: 500px;
    z-index: 9000;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: none;
    overflow: hidden;
    animation: slideInUp 0.5s ease-out;
}

/* موضع التوستر للغة الإنجليزية (LTR) - أسفل على الشمال */
.custom-toast.ltr {
    left: 20px;
    right: auto;
    animation: slideInUpLeft 0.5s ease-out;
}

/* موضع التوستر للغة العربية (RTL) - أسفل على الشمال */
.custom-toast.rtl {
    left: 20px;
    right: auto;
    animation: slideInUpRight 0.5s ease-out;
}

/* الرسوم المتحركة */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInUpLeft {
    from {
        transform: translate(100%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes slideInUpRight {
    from {
        transform: translate(-100%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* رأس التوستر */
.custom-toast-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.custom-toast-header i {
    font-size: 1.2rem;
    margin-right: 8px;
}

.custom-toast-header .toast-title {
    flex: 1;
    font-size: 0.95rem;
}

.custom-toast-header .toast-time {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 8px;
    color: white !important;
}

.custom-toast-header .btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    color: inherit;
}

.custom-toast-header .btn-close:hover {
    opacity: 1;
}

/* جسم التوستر */
.custom-toast-body {
    padding: 16px;
    font-size: 1rem;
    line-height: 1.4;
}

/* ألوان النجاح - أخضر ناعم */
.custom-toast.success {
    background: rgba(var(--bs-success-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.success .custom-toast-header {
    background: rgba(var(--bs-success-rgb), 0.95) !important;
    color: white !important;
}

.custom-toast.success .custom-toast-header .toast-title,
.custom-toast.success .custom-toast-header .toast-time,
.custom-toast.success .custom-toast-header i,
.custom-toast.success .custom-toast-header .btn-close {
    color: white !important;
}

/* ألوان الخطأ - أحمر ناعم */
.custom-toast.error {
    background: rgba(var(--bs-danger-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.error .custom-toast-header {
    background: rgba(var(--bs-danger-rgb), 0.95) !important;
    color: white;
}

.custom-toast.error .custom-toast-header .toast-title,
.custom-toast.error .custom-toast-header .toast-time,
.custom-toast.error .custom-toast-header i,
.custom-toast.error .custom-toast-header .btn-close {
    color: white !important;
}

/* ألوان التحذير - برتقالي ناعم */
.custom-toast.warning {
    background: rgba(var(--bs-warning-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.warning .custom-toast-header {
    background: rgba(var(--bs-warning-rgb), 0.95) !important;
    color: white;
}

.custom-toast.warning .custom-toast-header .toast-title,
.custom-toast.warning .custom-toast-header .toast-time,
.custom-toast.warning .custom-toast-header i,
.custom-toast.warning .custom-toast-header .btn-close {
    color: white !important;
}

/* ألوان المعلومات - أزرق ناعم */
.custom-toast.info {
    background: rgba(var(--bs-info-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.info .custom-toast-header {
    background: rgba(var(--bs-info-rgb), 0.95) !important;
    color: white;
}

.custom-toast.info .custom-toast-header .toast-title,
.custom-toast.info .custom-toast-header .toast-time,
.custom-toast.info .custom-toast-header i,
.custom-toast.info .custom-toast-header .btn-close {
    color: white !important;
}

/* تأثيرات التفاعل */
.custom-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* تأثير الإغلاق */
.custom-toast.closing.ltr {
    animation: slideOutRight 0.3s ease-in forwards;
}

.custom-toast.closing.rtl {
    animation: slideOutLeft 0.3s ease-in forwards;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    #custom-toast-container {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 40px);
        max-width: 400px;
        min-width: 280px;
    }
    
    .custom-toast {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .custom-toast.ltr,
    .custom-toast.rtl {
        left: auto !important;
        right: auto !important;
        animation: slideInUp 0.5s ease-out;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* إخفاء التوستر الافتراضي */
.toastr {
    display: none !important;
}

/* تحسينات إضافية */
.custom-toast .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: progressBar 3s linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* =================================================================================
 * 6. IMAGE UPLOAD COMPONENT STYLES
 * ================================================================================= */

/* الحاوية الرئيسية لرفع الصور */
.image-upload-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid #dbdade;
    transition: all 0.3s ease;
}

/* الثيم الداكن */
html.dark-style .image-upload-container,
html[data-theme="dark"] .image-upload-container,
html[data-bs-theme="dark"] .image-upload-container {
    background: #2f3349;
    color: #f9fafb;
    border: 1px solid #434968;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* عنوان القسم */
.image-upload-title {
    color: #10b981;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: color 0.3s ease;
}

html.dark-style .image-upload-title,
html[data-theme="dark"] .image-upload-title,
html[data-bs-theme="dark"] .image-upload-title {
    color: #10b981;
}

.image-upload-title i {
    font-size: 1.1rem;
}

/* أقسام الصور */
.image-sections {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* قسم الصورة الحالية */
.current-image-section {
    flex: 1;
    text-align: center;
}

.current-image-section h6 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

html.dark-style .current-image-section h6,
html[data-theme="dark"] .current-image-section h6,
html[data-bs-theme="dark"] .current-image-section h6 {
    color: #b6bee3;
}

.current-image-display {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #f8fafc;
    overflow: hidden;
    transition: all 0.3s ease;
}

html.dark-style .current-image-display,
html[data-theme="dark"] .current-image-display,
html[data-bs-theme="dark"] .current-image-display {
    background: #2f3349;
    border-color: #7367f0;
}

.current-image-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.current-image-placeholder {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
}

html.dark-style .current-image-placeholder,
html[data-theme="dark"] .current-image-placeholder,
html[data-bs-theme="dark"] .current-image-placeholder {
    color: #8b92a7;
}

/* قسم الصورة الجديدة */
.new-image-section {
    flex: 1;
    text-align: center;
}

.new-image-section h6 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

html.dark-style .new-image-section h6,
html[data-theme="dark"] .new-image-section h6,
html[data-bs-theme="dark"] .new-image-section h6 {
    color: #b6bee3;
}

.new-image-placeholder {
    width: 120px;
    height: 120px;
    border: 2px dashed #d1d5db;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
}

html.dark-style .new-image-placeholder,
html[data-theme="dark"] .new-image-placeholder,
html[data-bs-theme="dark"] .new-image-placeholder {
    background: #2f3349;
    border-color: #434968;
}

.new-image-placeholder:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

html.dark-style .new-image-placeholder:hover,
html[data-theme="dark"] .new-image-placeholder:hover,
html[data-bs-theme="dark"] .new-image-placeholder:hover {
    border-color: #7367f0;
    background: #3b4253;
}

.new-image-placeholder i {
    font-size: 2.5rem;
    color: #9ca3af;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    display: block;
    line-height: 1;
}

html.dark-style .new-image-placeholder i,
html[data-theme="dark"] .new-image-placeholder i,
html[data-bs-theme="dark"] .new-image-placeholder i {
    color: #7c8ebf;
}

.new-image-placeholder span {
    color: #7367f0;
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.2;
    transition: color 0.3s ease;
}

html.dark-style .new-image-placeholder span,
html[data-theme="dark"] .new-image-placeholder span,
html[data-bs-theme="dark"] .new-image-placeholder span {
    color: #7367f0;
}

/* زر رفع الصورة */
.image-upload-button {
    background: #7367f0;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
}

.image-upload-button:hover {
    background: #5a4fcf;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(115, 103, 240, 0.4);
}

.image-upload-button i {
    font-size: 1.1rem;
}

/* تنسيقات مدعومة */
.supported-formats {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.3s ease;
}

html.dark-style .supported-formats,
html[data-theme="dark"] .supported-formats,
html[data-bs-theme="dark"] .supported-formats {
    color: #8b92a7;
}

.supported-formats i {
    font-size: 0.875rem;
}

/* وضع الصورة الواحدة (Create) */
.single-image-upload {
    text-align: center;
}

.single-image-upload .image-sections {
    justify-content: center;
}

.single-image-upload .current-image-section {
    display: none;
}

/* وضع الصورتين (Edit) */
.dual-image-upload .image-sections {
    justify-content: space-between;
}

/* إخفاء input الملف */
.image-file-input {
    display: none;
}

/* معاينة الصورة الجديدة */
.new-image-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #10b981;
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #f0fdf4;
    overflow: hidden;
    transition: all 0.3s ease;
}

html.dark-style .new-image-preview,
html[data-theme="dark"] .new-image-preview,
html[data-bs-theme="dark"] .new-image-preview {
    background: #1a2528;
    border-color: #10b981;
}


.new-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: opacity 0.2s ease;
}

.new-image-preview img:hover {
    opacity: 0.9;
}

/* تأثيرات الحركة */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-preview-animation {
    animation: fadeIn 0.3s ease-out;
}

/* Image sections responsive layout */
.image-sections {
    display: block;
}

.image-sections .row {
    margin-left: 0;
    margin-right: 0;
}

/* Ensure circular images are centered in columns */
.current-image-display.mx-auto,
.new-image-placeholder.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .image-sections .row > div {
        margin-bottom: 1rem;
    }

    .current-image-display,
    .new-image-placeholder,
    .new-image-preview {
        width: 100px;
        height: 100px;
    }

    .image-upload-container {
        padding: 16px;
    }

    .image-upload-title {
        font-size: 1.1rem;
    }
}

/* دعم الوضع الداكن - تحديث للعمل مع نظام الثيم */
html.dark-style .current-image-section h6,
html.dark-style .new-image-section h6,
html[data-theme="dark"] .current-image-section h6,
html[data-theme="dark"] .new-image-section h6,
html[data-bs-theme="dark"] .current-image-section h6,
html[data-bs-theme="dark"] .new-image-section h6 {
    color: #f9fafb;
}

html.dark-style .current-image-display,
html[data-theme="dark"] .current-image-display,
html[data-bs-theme="dark"] .current-image-display {
    background: #374151;
    border-color: #60a5fa;
}

html.dark-style .new-image-placeholder,
html[data-theme="dark"] .new-image-placeholder,
html[data-bs-theme="dark"] .new-image-placeholder {
    background: #2f3349;
    border-color: #4b5563;
}

html.dark-style .new-image-placeholder:hover,
html[data-theme="dark"] .new-image-placeholder:hover,
html[data-bs-theme="dark"] .new-image-placeholder:hover {
    border-color: #60a5fa;
    background: #1e3a8a;
}

html.dark-style .supported-formats,
html[data-theme="dark"] .supported-formats,
html[data-bs-theme="dark"] .supported-formats {
    color: #9ca3af;
}

/* =================================================================================
 * 7. ENHANCED VALIDATION ERROR STYLING
 * ================================================================================= */

/* Show ALL validation messages immediately - no hiding */
.field-validation-error,
[data-valmsg-for],
.field-validation-error span,
[data-valmsg-for] span {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Modern validation error styling with FontAwesome icons - Target only inner spans */
.field-validation-error span.fv-error,
[data-valmsg-for] span.fv-error,
.fv-error {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    color: #ff6b6b !important;
    background: rgba(255, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 0, 0, 0.2) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem !important;
    margin-top: 0.35rem !important;
    animation: fadeInUp 0.18s ease-out forwards !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Hide ONLY the inner elements that don't have our class, keep container visible */
.field-validation-error,
[data-valmsg-for] {
    display: block !important;
}

/* Apply modern styling to ALL validation messages (old and new) */
.field-validation-error > :not(.fv-error),
[data-valmsg-for] > :not(.fv-error),
.field-validation-error span,
[data-valmsg-for] span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    color: #ff6b6b !important;
    background: rgba(255, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 0, 0, 0.2) !important;
    border-radius: 0.5rem !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.85rem !important;
    margin-top: 0.4rem !important;
    animation: fadeInUp 0.18s ease-out forwards !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Add FontAwesome icon to ALL validation messages */
.field-validation-error > :not(.fv-error):before,
[data-valmsg-for] > :not(.fv-error):before,
.field-validation-error span:before,
[data-valmsg-for] span:before {
    content: "\f071" !important; /* FontAwesome triangle-exclamation icon */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 0.9rem !important;
    flex-shrink: 0 !important;
    margin-right: 0.2rem !important;
}

/* Reset outer container styling */
.field-validation-error,
[data-valmsg-for] {
    display: block !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    box-shadow: none !important;
    text-decoration: none !important;
    animation: none !important;
}

/* FontAwesome icon styling - Target only inner spans */
.field-validation-error span.fv-error i,
[data-valmsg-for] span.fv-error i,
.fv-error i {
    font-size: 0.9rem !important;
    flex-shrink: 0 !important;
    margin-right: 0.2rem !important;
}

/* Animation for error appearance */
@keyframes fadeInUp {
    0% { 
        opacity: 0; 
        transform: translateY(4px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Animation for error disappearance */
@keyframes fadeOutDown {
    0% { 
        opacity: 1; 
        transform: translateY(0); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(4px); 
    }
}

/* Class for fade out animation */
.fv-error.fade-out {
    animation: fadeOutDown 0.2s ease-in forwards;
}

/* Dark mode support */
html.dark-style .fv-error,
html[data-theme="dark"] .fv-error,
html[data-bs-theme="dark"] .fv-error {
    color: #ff8a8a;
    background: rgba(255, 0, 0, 0.12);
    border-color: rgba(255, 0, 0, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fv-error {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
        gap: 0.3rem;
    }

/* =================================================================================
 * INLINE VALIDATION ICONS (INSIDE FIELDS)
 * ================================================================================= */

.form-field-wrapper {
    position: relative;
    display: block;
}

.form-field-wrapper .form-control {
    padding-left: 2.5rem !important; /* مساحة للأيقونة على اليسار */
}

.validation-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.validation-icon.show {
    opacity: 1;
}

.validation-icon.success {
    color: #10b981;
}

.validation-icon.success::before {
    content: '✓';
    font-weight: bold;
}

.validation-icon.error {
    color: #ef4444;
}

.validation-icon.error::before {
    content: '✗';
    font-weight: bold;
}

/* Validation message under field */
[data-valmsg-for] {
    display: none;
    font-size: 0.85rem;
    color: #ef4444;
    margin-top: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.375rem;
    border-left: 3px solid #ef4444;
}

[data-valmsg-for].show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

/* Success state for input */
.form-control.is-valid {
    border-color: #10b981 !important;
    background-image: none !important;
}

/* Error state for input */
.form-control.is-invalid {
    border-color: #ef4444 !important;
    background-image: none !important;
}

/* Dark mode support */
html.dark-style .validation-icon.success {
    color: #34d399;
}

html.dark-style .validation-icon.error {
    color: #f87171;
}

html.dark-style [data-valmsg-for] {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
    
    .fv-error i {
        font-size: 0.85rem;
    }
}

/* Form field validation states */
.form-control.is-invalid,
.form-select.is-invalid,
.form-check-input.is-invalid {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.25);
}

.form-control.is-valid,
.form-select.is-valid,
.form-check-input.is-valid {
    border-color: #28c76f;
    box-shadow: 0 0 0 0.2rem rgba(40, 199, 111, 0.25);
}

/* =================================================================================
 * 8. SHORTCUTS STYLES
 * ================================================================================= */

/* Shortcuts Dropdown Container */
.dropdown-shortcuts-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

/* Grid Layout - 2 columns */
.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0;
}

/* Individual Shortcut Card */
.shortcut-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.shortcut-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
}

/* Dark theme hover effect */
html.dark-style .shortcut-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Icon Circle */
.shortcut-icon-circle {
    width: 3rem;
    height: 3rem;
    background-color: var(--bs-secondary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--bs-body-color);
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.shortcut-card:hover .shortcut-icon-circle {
    background-color: var(--bs-primary);
    color: white;
    transform: scale(1.1);
}

/* Card Title */
.shortcut-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
    line-height: 1.2;
    text-align: center;
}

/* Card Description */
.shortcut-card-desc {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
    line-height: 1.3;
    text-align: center;
    opacity: 0.8;
}

/* Empty State */
.shortcuts-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--bs-secondary-color);
}

.shortcuts-empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.shortcuts-empty-state h6 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.shortcuts-empty-state p {
    font-size: 0.75rem;
    margin-bottom: 0;
    opacity: 0.7;
}

/* Loading State */
.shortcuts-loading {
    text-align: center;
    padding: 2rem 1rem;
}

.shortcuts-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--bs-primary);
}

/* Responsive Design */
@media (max-width: 576px) {
    .shortcuts-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .shortcut-card {
        min-height: 100px;
        padding: 1rem 0.75rem;
    }
    
    .shortcut-icon-circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .shortcut-card-title {
        font-size: 0.8125rem;
    }
    
    .shortcut-card-desc {
        font-size: 0.6875rem;
    }
}

/* Dark Theme Specific Styles */
html.dark-style .shortcut-card {
    background: #2f3349;
    border-color: #3b4253;
}

html.dark-style .shortcut-card:hover {
    background: #3b4253;
    border-color: var(--bs-primary);
}

html.dark-style .shortcut-icon-circle {
    background-color: #3b4253;
    color: #b6bee3;
}

html.dark-style .shortcut-card:hover .shortcut-icon-circle {
    background-color: var(--bs-primary);
    color: white;
}

html.dark-style .shortcut-card-title {
    color: #b6bee3;
}

html.dark-style .shortcut-card-desc {
    color: #8b92a7;
}

/* Animation for card appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shortcut-card {
    animation: fadeInUp 0.3s ease-out;
}

.shortcut-card:nth-child(1) { animation-delay: 0.1s; }
.shortcut-card:nth-child(2) { animation-delay: 0.2s; }
.shortcut-card:nth-child(3) { animation-delay: 0.3s; }
.shortcut-card:nth-child(4) { animation-delay: 0.4s; }
.shortcut-card:nth-child(5) { animation-delay: 0.5s; }
.shortcut-card:nth-child(6) { animation-delay: 0.6s; }

/* =================================================================================
 * SHORTCUT MANAGEMENT MODAL - Card Style (3 columns)
 * ================================================================================= */

/* Shortcut Option Card in Modal */
.shortcut-option-card {
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.shortcut-option-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
    background: rgba(115, 103, 240, 0.05);
}

.shortcut-option-card.selected {
    border-color: var(--bs-primary);
    background: rgba(115, 103, 240, 0.1);
}

.shortcut-option-card.selected:hover {
    background: rgba(115, 103, 240, 0.15);
}

/* Checkbox in card */
.shortcut-option-card .form-check-input {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
}

.shortcut-option-card .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Icon in card */
.shortcut-option-card .shortcut-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.1) 0%, rgba(115, 103, 240, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--bs-primary);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.shortcut-option-card.selected .shortcut-icon {
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.2) 0%, rgba(115, 103, 240, 0.15) 100%);
    transform: scale(1.1);
}

.shortcut-option-card:hover .shortcut-icon {
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.2) 0%, rgba(115, 103, 240, 0.15) 100%);
    transform: scale(1.1);
}

/* Content in card */
.shortcut-option-card .shortcut-content {
    flex: 1;
}

.shortcut-option-card .shortcut-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.shortcut-option-card .shortcut-desc {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    line-height: 1.4;
}

/* Dark Theme Support */
html.dark-style .shortcut-option-card {
    background: #2f3349;
    border-color: #3b4253;
}

html.dark-style .shortcut-option-card:hover {
    background: #3b4253;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

html.dark-style .shortcut-option-card.selected {
    background: rgba(115, 103, 240, 0.2);
    border-color: var(--bs-primary);
}

html.dark-style .shortcut-option-card .shortcut-icon {
    background: rgba(115, 103, 240, 0.15);
    color: #b6bee3;
}

html.dark-style .shortcut-option-card.selected .shortcut-icon {
    background: rgba(115, 103, 240, 0.25);
}

html.dark-style .shortcut-option-card .shortcut-title {
    color: #b6bee3;
}

html.dark-style .shortcut-option-card .shortcut-desc {
    color: #8b92a7;
}

/* Responsive */
@media (max-width: 768px) {
    .shortcut-option-card {
        min-height: 120px;
        padding: 1rem;
    }
    
    .shortcut-option-card .shortcut-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .shortcut-option-card .shortcut-title {
        font-size: 0.875rem;
    }
    
    .shortcut-option-card .shortcut-desc {
        font-size: 0.75rem;
    }
}

/* =================================================================================
 * 6. IMAGE UPLOAD COMPONENT STYLES (NEW VERSION)
 * ================================================================================= */

/* دعم .upload-header للثيم الفاتح والداكن */
.upload-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #7367f0;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

html.dark-style .upload-header,
html[data-theme="dark"] .upload-header,
html[data-bs-theme="dark"] .upload-header {
    color: #7367f0;
}

.upload-header i {
    font-size: 1.5rem;
}

.upload-title {
    transition: color 0.3s ease;
}

html.dark-style .upload-title,
html[data-theme="dark"] .upload-title,
html[data-bs-theme="dark"] .upload-title {
    color: #f9fafb;
}

/* دعم النصوص في .image-upload-container */
.image-upload-container .form-text.text-muted {
    color: #6b7280;
    transition: color 0.3s ease;
}

html.dark-style .image-upload-container .form-text.text-muted,
html[data-theme="dark"] .image-upload-container .form-text.text-muted,
html[data-bs-theme="dark"] .image-upload-container .form-text.text-muted {
    color: #8b92a7;
}

/* دعم العناوين في .image-upload-container */
.image-upload-container h6 {
    color: #374151;
    transition: color 0.3s ease;
}

html.dark-style .image-upload-container h6,
html[data-theme="dark"] .image-upload-container h6,
html[data-bs-theme="dark"] .image-upload-container h6 {
    color: #b6bee3;
}

/* مودال الصورة المنفصل */
#imagePreviewModal .modal-content {
    background: #ffffff;
    border: none;
}

html.dark-style #imagePreviewModal .modal-content,
html[data-theme="dark"] #imagePreviewModal .modal-content,
html[data-bs-theme="dark"] #imagePreviewModal .modal-content {
    background: #2f3349;
}

#imagePreviewModal .modal-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

html.dark-style #imagePreviewModal .modal-header,
html[data-theme="dark"] #imagePreviewModal .modal-header,
html[data-bs-theme="dark"] #imagePreviewModal .modal-header {
    background: #2f3349;
    border-bottom: 1px solid #404656;
}

#imagePreviewModal .modal-title {
    color: inherit;
}

html.dark-style #imagePreviewModal .modal-title,
html[data-theme="dark"] #imagePreviewModal .modal-title,
html[data-bs-theme="dark"] #imagePreviewModal .modal-title {
    color: #f3f4f6;
}

#imagePreviewModal .btn-close {
    filter: none;
}

html.dark-style #imagePreviewModal .btn-close,
html[data-theme="dark"] #imagePreviewModal .btn-close,
html[data-bs-theme="dark"] #imagePreviewModal .btn-close {
    filter: invert(1);
}


/* Validation Messages - Red Style */
.validation-message:not(:empty) {
    color: #ef4444 !important;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.validation-message:not(:empty)::before {
    content: '⚠';
    font-size: 1rem;
}

.validation-message:empty {
    display: none;
}

/* Dark mode support */
html.dark-style .image-upload-area {
    background: #2f3349;
    border-color: #4a5073;
}

/* =================================================================================
 * IMAGE VALIDATION MESSAGE CENTERING
 * Center validation text in image upload containers
 * ================================================================================= */
.image-upload-container [data-valmsg-for],
.image-upload-container .field-validation-error,
.image-upload-container span.text-danger.d-block {
    text-align: center !important;
}

.image-upload-container [data-valmsg-for] span,
.image-upload-container .field-validation-error span,
.image-upload-container span.text-danger.d-block span {
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.image-upload-container [data-valmsg-for] > :not(.fv-error),
.image-upload-container .field-validation-error > :not(.fv-error),
.image-upload-container [data-valmsg-for] span:not(.fv-error),
.image-upload-container .field-validation-error span:not(.fv-error) {
    justify-content: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* =================================================================================
 * 9. LAYOUT & NAVBAR STYLES
 * ================================================================================= */

/* Layout Menu Scrollbar */
.layout-menu {
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar styling */
#layout-menu::-webkit-scrollbar {
    width: 8px;
}

#layout-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

#layout-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#layout-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Dark theme scrollbar */
[data-theme="dark"] #layout-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #layout-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] #layout-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbar */
#layout-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] #layout-menu {
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Ensure menu content can scroll */
.menu-inner {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fix for app-brand taking space */
.app-brand {
    flex-shrink: 0;
}

/* Menu search container */
.menu-search-container {
    flex-shrink: 0;
}

/* Ensure navbar is visible */
.layout-navbar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1030 !important;
}

/* Ensure navbar content is visible */
.layout-navbar .navbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure navbar nav items are visible */
.layout-navbar .navbar-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure navbar nav right is visible */
.navbar-nav-right {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

[dir="ltr"] .modal-footer {
    flex-direction: row !important; /* save appears on left */
}

/* =================================================================================
 * 10. SIMPLE PAGE HEADER STYLES
 * ================================================================================= */

/* Simple Page Header */
.page-header-simple {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.page-header-simple:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.page-header-simple .card-body {
    padding: 1.5rem 2rem;
}

.page-header-simple .header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Icon Container */
.page-header-simple .header-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #7367f0 0%, #9e95f5 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.3);
}

.page-header-simple .header-icon i {
    font-size: 1.5rem;
    color: white;
}

/* Text Content */
.page-header-simple .header-text h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2b2c40;
    line-height: 1.3;
}

.page-header-simple .header-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
}

/* Dark Mode Support */
html.dark-style .page-header-simple {
    background: #2f3349;
    border-color: #3b4253;
}

html.dark-style .page-header-simple .header-text h4 {
    color: #d0d2d6;
}

html.dark-style .page-header-simple .header-text p {
    color: #a8aaae;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header-simple .card-body {
        padding: 1.25rem 1.5rem;
    }

    .page-header-simple .header-icon {
        width: 45px;
        height: 45px;
    }

    .page-header-simple .header-icon i {
        font-size: 1.25rem;
    }

    .page-header-simple .header-text h4 {
        font-size: 1.25rem;
    }

    .page-header-simple .header-text p {
        font-size: 0.8rem;
    }

    .page-header-simple .header-content {
        gap: 0.875rem;
    }
}

@media (max-width: 576px) {
    .page-header-simple .card-body {
        padding: 1rem;
    }

    .page-header-simple .header-icon {
        width: 40px;
        height: 40px;
    }

    .page-header-simple .header-icon i {
        font-size: 1.125rem;
    }

    .page-header-simple .header-text h4 {
        font-size: 1.125rem;
    }

    .page-header-simple .header-text p {
        font-size: 0.75rem;
    }
}

/*
 * CSS for Global Loading Buttons
 */

.btn {
    /* تأكد أن الزر له position: relative ليحتوي الـ spinner */
    position: relative;
}

    .btn .btn-spinner {
        /* 1. إخفاء الـ spinner في الوضع العادي */
        display: none;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        /* تصميم الـ spinner - يمكنك تغييره */
        width: 1.2rem;
        height: 1.2rem;
        border: 2px solid currentColor;
        border-bottom-color: transparent;
        border-radius: 50%;
        animation: 0.75s linear infinite spinner-border;
    }

    .btn .btn-text {
        /* 2. إظهار النص في الوضع العادي */
        display: inline-block;
        transition: opacity 0.15s ease-in-out;
        opacity: 1;
    }

    /*
 * الحالة النشطة: عند التحميل
 */

    .btn.btn-loading {
        /* تعطيل الزر ومنع أي نقرات إضافية */
        pointer-events: none;
        opacity: 0.85;
    }

        .btn.btn-loading .btn-spinner {
            /* 3. إظهار الـ spinner عند التحميل */
            display: inline-block;
        }

        .btn.btn-loading .btn-text {
            /* 4. إخفاء النص عند التحميل */
            opacity: 0;
            visibility: hidden;
        }

    /* تحسين الـ loader في المودالات - يظهر بجانب النص */
    .modal .btn.btn-loading {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .modal .btn.btn-loading .btn-text {
        opacity: 1 !important;
        visibility: visible !important;
        margin-left: 0;
    }

    .modal .btn.btn-loading .btn-spinner {
        position: static;
        display: inline-block;
        transform: none;
        margin: 0;
        order: -1;
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

/* تعريف حركة الدوران */
@keyframes spinner-border {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =================================================================================
 * 11. DATATABLE FLOATING CARDS STYLING
 * تصميم الجداول بنمط البطاقات العائمة (Floating Cards)
 * ================================================================================= */

/* ---- 1. الكود الأساسي (The Foundation) - قواعد قوية جداً ---- */
.table,
table.table,
.dataTables_wrapper .table,
.dataTables_wrapper table.table {
    /* هذه هي الأوامر السحرية */
    border-collapse: separate !important;
    border-spacing: 0 0.75rem !important; /* 0 أفقي، 0.75rem (حوالي 12px) رأسي */
    width: 100% !important;
    padding: 0 0.5rem !important; /* إضافة مسافة صغيرة يمين ويسار الجدول */
    border: none !important;
}

/* إزالة أي حدود من الجدول */
.table,
table.table,
.dataTables_wrapper .table {
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* ---- 2. رأس الجدول (The Header) - شفاف تماماً ---- */
.table thead th,
table.table thead th,
.dataTables_wrapper .table thead th {
    background-color: transparent !important; /* شفاف تماماً */
    background: transparent !important; /* للتأكد */
    border: none !important; /* بدون أي حدود */
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    padding: 0 1rem !important;
    padding-top: 0 !important;
    padding-bottom: 0.5rem !important;
    color: #8a8d93 !important; /* لون رمادي خافت جداً */
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
    vertical-align: bottom !important;
}

/* الثيم الداكن - رأس الجدول */
html.dark-style .table thead th,
html[data-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .table thead th {
    color: #8a8d93 !important;
}

/* الثيم الفاتح - رأس الجدول */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table thead th {
    color: #6c757d !important;
}

/* إزالة أي حدود من رأس الجدول */
.table thead {
    border: none !important;
}

.table thead tr {
    border: none !important;
}

/* ---- 3. الصفوف (The "Floating" Rows) - بطاقات عائمة احترافية - قطعة واحدة ---- */
/* خلفية موحدة للصف ككل - مختلفة قليلاً عن الخلفية العامة مع حدود واضحة */
.table tbody tr,
table.table tbody tr,
.dataTables_wrapper .table tbody tr {
    /* خلفية مختلفة قليلاً عن الخلفية العامة */
    background: var(--bs-card-bg, #ffffff) !important;
    background-color: var(--bs-card-bg, #ffffff) !important;
    /* حدود واضحة للصف */
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    /* ظل خفيف احترافي للصف ككل */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.table tbody td,
table.table tbody td,
.dataTables_wrapper .table tbody td {
    /* خلفية شفافة للخلايا - الخلفية من الصف الأب */
    background: transparent !important;
    background-color: transparent !important;
    padding: 1.25rem 1rem !important; /* مساحات داخلية كبيرة ومريحة */
    vertical-align: middle !important;
    color: #e0e0e0 !important;
    border: none !important; /* الأهم: إلغاء أي حدود */
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    /* انتقالات سلسة احترافية */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    /* إزالة الظل من الخلايا - الظل من الصف */
    box-shadow: none !important;
}

/* الثيم الداكن - خلفية الصفوف - مختلفة قليلاً عن الخلفية العامة مع حدود واضحة */
html.dark-style .table tbody tr,
html.dark-style table.table tbody tr,
html.dark-style .dataTables_wrapper .table tbody tr,
html[data-theme="dark"] .table tbody tr,
html[data-theme="dark"] table.table tbody tr,
html[data-theme="dark"] .dataTables_wrapper .table tbody tr,
html[data-bs-theme="dark"] .table tbody tr,
html[data-bs-theme="dark"] table.table tbody tr,
html[data-bs-theme="dark"] .dataTables_wrapper .table tbody tr {
    /* خلفية أفتح قليلاً من الخلفية العامة (#25293c) - مميزة فقط */
    background: #2d3042 !important;
    background-color: #2d3042 !important;
    /* حدود واضحة للثيم الداكن */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

html.dark-style .table tbody td,
html[data-theme="dark"] .table tbody td,
html[data-bs-theme="dark"] .table tbody td {
    background: transparent !important;
    background-color: transparent !important;
    color: #e0e0e0 !important;
    box-shadow: none !important;
}

/* الثيم الفاتح - خلفية الصفوف - مختلفة قليلاً عن الخلفية العامة مع حدود واضحة */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody tr,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.table tbody tr,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .dataTables_wrapper .table tbody tr {
    /* خلفية أغمق قليلاً من الأبيض - مميزة فقط */
    background: #f8f9fa !important;
    background-color: #f8f9fa !important;
    /* حدود واضحة للثيم الفاتح */
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td {
    background: transparent !important;
    background-color: transparent !important;
    color: #5d596c !important;
    box-shadow: none !important;
}

/* إزالة أي فواصل بين الخلايا - الصف قطعة واحدة */
.table tbody tr td {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    /* إزالة أي border-radius من الخلايا الفردية */
    border-radius: 0 !important;
}

/* إضافة مسافة بين الصفوف لظهور الحدود بشكل واضح */
.table tbody tr {
    margin-bottom: 0.5rem !important;
}

.table tbody tr + tr {
    margin-top: 0.5rem !important;
}

/* ---- 4. اللمسة الاحترافية (The Hover Effect) - التوهج الاحترافي على الصف ---- */
/* تأثير hover على الصف كامل - الصف قطعة واحدة متصلة */
.table tbody tr,
table.table tbody tr,
.dataTables_wrapper .table tbody tr {
    /* حواف دائرية للصف ككل (كقطعة واحدة) */
    border-radius: 0.6rem !important;
    overflow: hidden !important; /* لتطبيق border-radius بشكل صحيح */
    /* انتقالات سلسة */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
/*    cursor: pointer !important;*/
}

/* تطبيق border-radius على الخلية الأولى والأخيرة فقط */
.table tbody tr td:first-child,
table.table tbody tr td:first-child,
.dataTables_wrapper .table tbody tr td:first-child {
    border-top-left-radius: 0.6rem !important;
    border-bottom-left-radius: 0.6rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.table tbody tr td:last-child,
table.table tbody tr td:last-child,
.dataTables_wrapper .table tbody tr td:last-child {
    border-top-right-radius: 0.6rem !important;
    border-bottom-right-radius: 0.6rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* عند hover على الصف، نحرك الصف كامل للأعلى مع ظل احترافي */
.table tbody tr:hover {
    transform: translateY(-4px) !important;
    z-index: 10 !important;
    /* لون hover متناسق مع الثيم - أفتح قليلاً من الخلفية الأساسية */
    background: #363b52 !important;
    background-color: #363b52 !important;
    /* حدود أوضح عند hover */
    border-color: rgba(255, 255, 255, 0.15) !important;
    /* ظل احترافي قوي عند hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(105, 108, 255, 0.1) !important;
}

/* الخلايا تبقى شفافة عند hover - الخلفية من الصف */
.table tbody tr:hover td {
    /* لا نحرك الخلايا منفصلة - فقط الصف كامل */
    transform: none !important;
    position: relative !important;
    z-index: 1 !important;
    /* الخلفية شفافة - تأتي من الصف */
    background: transparent !important;
    background-color: transparent !important;
    /* إزالة الظل من الخلايا */
    box-shadow: none !important;
    /* التأكد من عدم ظهور أي حدود */
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
}

/* منع تأثير hover الصف على الأزرار داخل الخلايا - قاعدة إضافية قوية */
.table tbody tr:hover td .btn,
.table tbody tr:hover td button,
.table-hover tbody tr:hover td .btn,
.table-hover tbody tr:hover td button {
    /* إجبار الحفاظ على المظهر الأصلي - لا تغييرات نهائياً */
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

/* الثيم الفاتح - تأثير hover احترافي - متناسق مع الثيم العام */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody tr:hover {
    background: #f0f2f5 !important;
    background-color: #f0f2f5 !important;
    /* حدود أوضح عند hover */
    border-color: rgba(0, 0, 0, 0.18) !important;
    /* ظل احترافي للثيم الفاتح */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(105, 108, 255, 0.08) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody tr:hover td {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    /* التأكد من عدم ظهور أي حدود */
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
}

/* منع تغيير استايلات الأزرار عند hover على الصف */
/* الأزرار ستبقى كما هي - لا نطبق أي قواعد عليها */
/* الأزرار ستحافظ على hover effects الخاصة بها فقط عند hover مباشرة عليها */

/* ---- 5. تحسين العناصر (Badges & Placeholders) ---- */
/* الشارات الناعمة (Soft Badges) - قواعد قوية جداً */
.badge.bg-label-success,
.badge.badge-soft-success,
.table .badge.bg-label-success,
.table tbody td .badge.bg-label-success,
.dataTables_wrapper .badge.bg-label-success,
.dataTables_wrapper .table .badge.bg-label-success {
    background-color: rgba(40, 199, 111, 0.1) !important;
    background: rgba(40, 199, 111, 0.1) !important;
    color: #28c76f !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
    border-width: 0 !important;
}

html.dark-style .badge.bg-label-success,
html.dark-style .badge.badge-soft-success,
html[data-theme="dark"] .badge.bg-label-success,
html[data-theme="dark"] .badge.badge-soft-success,
html[data-bs-theme="dark"] .badge.bg-label-success,
html[data-bs-theme="dark"] .badge.badge-soft-success {
    background-color: rgba(40, 199, 111, 0.15) !important;
    color: #34d399 !important;
}

/* شارات أخرى - Danger */
.badge.bg-label-danger,
.badge.badge-soft-danger {
    background-color: rgba(234, 84, 85, 0.1) !important;
    color: #ea5455 !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
}

html.dark-style .badge.bg-label-danger,
html.dark-style .badge.badge-soft-danger,
html[data-theme="dark"] .badge.bg-label-danger,
html[data-theme="dark"] .badge.badge-soft-danger,
html[data-bs-theme="dark"] .badge.bg-label-danger,
html[data-bs-theme="dark"] .badge.badge-soft-danger {
    background-color: rgba(234, 84, 85, 0.15) !important;
    color: #f87171 !important;
}

/* شارات أخرى - Warning */
.badge.bg-label-warning,
.badge.badge-soft-warning {
    background-color: rgba(255, 159, 67, 0.1) !important;
    color: #ff9f43 !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
}

html.dark-style .badge.bg-label-warning,
html.dark-style .badge.badge-soft-warning,
html[data-theme="dark"] .badge.bg-label-warning,
html[data-theme="dark"] .badge.badge-soft-warning,
html[data-bs-theme="dark"] .badge.bg-label-warning,
html[data-bs-theme="dark"] .badge.badge-soft-warning {
    background-color: rgba(255, 159, 67, 0.15) !important;
    color: #fbbf24 !important;
}

/* شارات أخرى - Info */
.badge.bg-label-info,
.badge.badge-soft-info {
    background-color: rgba(0, 207, 232, 0.1) !important;
    color: #00cfe8 !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
}

html.dark-style .badge.bg-label-info,
html.dark-style .badge.badge-soft-info,
html[data-theme="dark"] .badge.bg-label-info,
html[data-theme="dark"] .badge.badge-soft-info,
html[data-bs-theme="dark"] .badge.bg-label-info,
html[data-bs-theme="dark"] .badge.badge-soft-info {
    background-color: rgba(0, 207, 232, 0.15) !important;
    color: #22d3ee !important;
}

/* ---- 6. الصور الاحتياطية (Image Placeholders) ---- */
/* Avatar Placeholder - دائرة رمادية مع أيقونة */
.avatar-placeholder,
.image-placeholder {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background-color: #3f4254 !important; /* لون داكن محايد */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #8a8d93 !important;
    font-size: 1.2rem !important;
    flex-shrink: 0 !important;
}

html.dark-style .avatar-placeholder,
html.dark-style .image-placeholder,
html[data-theme="dark"] .avatar-placeholder,
html[data-theme="dark"] .image-placeholder,
html[data-bs-theme="dark"] .avatar-placeholder,
html[data-bs-theme="dark"] .image-placeholder {
    background-color: #3f4254 !important;
    color: #8a8d93 !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .avatar-placeholder,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .image-placeholder {
    background-color: #e9ecef !important;
    color: #6c757d !important;
}

/* Avatar Initials - أول حرفين من الاسم */
.avatar-initials {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #7367f0 0%, #9e95f5 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    flex-shrink: 0 !important;
}

/* تحسين مظهر الصور في الجدول */
.table tbody td img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
}

html.dark-style .table tbody td img,
html[data-theme="dark"] .table tbody td img,
html[data-bs-theme="dark"] .table tbody td img {
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td img {
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
}

.table tbody td img:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* ---- 7. الأزرار - إضافة مسافات ---- */
.table td .d-flex,
.table td .action-buttons-wrapper,
.table td .btn-group,
.table tbody td .d-flex,
.table tbody td .action-buttons-wrapper,
.table tbody td .btn-group,
table.table tbody td .d-flex,
.dataTables_wrapper .table tbody td .d-flex {
    gap: 0.5rem !important; /* فجوة بين الأزرار */
    display: flex !important;
}

.table td .d-flex .btn,
.table td .action-buttons-wrapper .btn,
.table td .btn-group .btn,
.table tbody td .d-flex .btn,
.table tbody td .action-buttons-wrapper .btn,
.table tbody td .btn-group .btn {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* إذا كانت الأزرار مباشرة بدون wrapper */
.table tbody td .btn + .btn {
    margin-left: 0.5rem !important;
}

[dir="rtl"] .table tbody td .btn + .btn {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

/* ---- 8. تحسين مظهر الأيقونات ---- */
.table tbody td i {
    font-size: 1.1rem !important;
    color: inherit !important;
    transition: color 0.2s ease !important;
}

.table tbody tr:hover td i {
    color: #7367f0 !important;
}

/* ---- 9. البيانات الثانوية (النصوص الخافتة) ---- */
.table tbody td.text-muted,
.table tbody td .text-muted,
.table tbody td.secondary-data {
    color: #a0a0a0 !important; /* لون خافت للتاريخ مثلاً */
}

html.dark-style .table tbody td.text-muted,
html.dark-style .table tbody td .text-muted,
html.dark-style .table tbody td.secondary-data,
html[data-theme="dark"] .table tbody td.text-muted,
html[data-theme="dark"] .table tbody td .text-muted,
html[data-theme="dark"] .table tbody td.secondary-data,
html[data-bs-theme="dark"] .table tbody td.text-muted,
html[data-bs-theme="dark"] .table tbody td .text-muted,
html[data-bs-theme="dark"] .table tbody td.secondary-data {
    color: #a0a0a0 !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td.text-muted,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td .text-muted,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td.secondary-data {
    color: #8b92a7 !important;
}

/* ---- 10. تحسين استجابة الجدول للشاشات الصغيرة ---- */
@media (max-width: 768px) {
    .table {
        border-spacing: 0 0.5rem !important;
        padding: 0 0.25rem !important;
    }

    .table th,
    .table td {
        padding: 1rem 0.75rem !important;
        font-size: 0.875rem !important;
    }

    .table thead th {
        font-size: 0.75rem !important;
        padding: 0 0.75rem !important;
    }

    .table tbody td img,
    .avatar-placeholder,
    .avatar-initials,
    .image-placeholder {
        width: 40px !important;
        height: 40px !important;
    }

    .badge.bg-label-success,
    .badge.badge-soft-success,
    .badge.bg-label-danger,
    .badge.badge-soft-danger,
    .badge.bg-label-warning,
    .badge.badge-soft-warning,
    .badge.bg-label-info,
    .badge.badge-soft-info {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
}

/* ---- 11. DataTable specific enhancements ---- */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
}

html.dark-style .dataTables_wrapper .dataTables_filter input,
html.dark-style .dataTables_wrapper .dataTables_length select,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
html[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .dataTables_wrapper .dataTables_filter input,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .dataTables_wrapper .dataTables_length select {
    background-color: #ffffff !important;
    color: #5d596c !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none !important;
    border-color: #7367f0 !important;
    box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.25) !important;
}

/* إزالة أي حدود افتراضية من الجدول */
.table tbody tr,
table.table tbody tr,
.dataTables_wrapper .table tbody tr {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    background-color: transparent !important;
    background: transparent !important;
}

.table tbody,
table.table tbody,
.dataTables_wrapper .table tbody {
    border: none !important;
    background-color: transparent !important;
    background: transparent !important;
}

/* ملاحظة: تم تعطيل هذا القسم لأننا نريد الظلال الاحترافية */
/* لا نزال نحتفظ بالظلال المخصصة في القواعد أعلاه */

/* إزالة أي خلفية من thead */
.table thead,
table.table thead,
.dataTables_wrapper .table thead {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
}

/* إزالة أي خلفية من thead tr */
.table thead tr,
table.table thead tr,
.dataTables_wrapper .table thead tr {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
}

/* =================================
   تأكيد المسافة بين أزرار الإجراءات
   ( index.js يضيف كلاس d-flex gap-2 )
   =================================
*/
.table tbody td .d-flex.gap-2 {
    /* gap-2 في بوتستراب تعني 0.5rem (أي 8 بكسل)
      نحن نؤكد تطبيقها هنا
    */
    gap: 0.5rem !important;
}

/* =================================
   التصميم الاحترافي لأزرار الإجراءات
   =================================
*/

/* الحالة الافتراضية - بدون أي تأثيرات hover */
.table tbody .btn-edit,
.table tbody .btn-delete {
    /* إخفاء الخلفية والحدود تماماً */
    background-color: transparent !important;
    border-color: transparent !important;
    
    /* إعطاء الأيقونة لوناً خافتاً جداً (رمادي) */
    color: #6c757d !important; /* لون رمادي محايد */
}

/* ============================================
   منع تأثير hover الصف على الأزرار نهائياً
   الأزرار ستبقى كما هي تماماً عند hover على الصف
   ============================================ */

/* قاعدة عامة - منع أي تأثير من hover الصف على جميع الأزرار */
.table-hover tbody tr:hover .btn,
.table tbody tr:hover .btn,
.table-hover tbody tr:hover button,
.table tbody tr:hover button {
    /* إجبار الحفاظ على المظهر الأصلي - لا تغييرات نهائياً */
    pointer-events: auto !important;
}

/* أزرار edit - منع تأثير hover الصف تماماً */
.table-hover tbody tr:hover .btn-edit.btn-outline-primary,
.table tbody tr:hover .btn-edit.btn-outline-primary,
.table-hover tbody tr:hover .btn-edit,
.table tbody tr:hover .btn-edit {
    border-color: #696cff !important;
    color: #696cff !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
}

/* أزرار delete - منع تأثير hover الصف تماماً */
.table-hover tbody tr:hover .btn-delete.btn-outline-danger,
.table tbody tr:hover .btn-delete.btn-outline-danger,
.table-hover tbody tr:hover .btn-delete,
.table tbody tr:hover .btn-delete {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
}

/* أزرار toggle warning - منع تأثير hover الصف تماماً */
.table-hover tbody tr:hover .btn-client-toggle.btn-outline-warning,
.table tbody tr:hover .btn-client-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-provider-toggle.btn-outline-warning,
.table tbody tr:hover .btn-provider-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-city-toggle.btn-outline-warning,
.table tbody tr:hover .btn-city-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-slider-toggle.btn-outline-warning,
.table tbody tr:hover .btn-slider-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-client-toggle,
.table tbody tr:hover .btn-client-toggle,
.table-hover tbody tr:hover .btn-provider-toggle,
.table tbody tr:hover .btn-provider-toggle,
.table-hover tbody tr:hover .btn-city-toggle,
.table tbody tr:hover .btn-city-toggle,
.table-hover tbody tr:hover .btn-slider-toggle,
.table tbody tr:hover .btn-slider-toggle {
    border-color: #ff9f43 !important;
    color: #ff9f43 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
}

/* أزرار toggle success - منع تأثير hover الصف تماماً */
.table-hover tbody tr:hover .btn-client-toggle.btn-outline-success,
.table tbody tr:hover .btn-client-toggle.btn-outline-success,
.table-hover tbody tr:hover .btn-provider-toggle.btn-outline-success,
.table tbody tr:hover .btn-provider-toggle.btn-outline-success,
.table-hover tbody tr:hover .btn-city-toggle.btn-outline-success,
.table tbody tr:hover .btn-city-toggle.btn-outline-success,
.table-hover tbody tr:hover .btn-slider-toggle.btn-outline-success,
.table tbody tr:hover .btn-slider-toggle.btn-outline-success {
    border-color: #28c76f !important;
    color: #28c76f !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
}

/* الحفاظ على نفس المظهر في الحالتين (العادي و hover) - إجبار نفس التصميم */
/* أزرار edit - نفس المظهر في الحالتين */
.btn-edit.btn-outline-primary,
.btn-edit.btn-outline-primary:hover,
.btn-edit.btn-outline-primary:focus,
.table tbody tr .btn-edit.btn-outline-primary,
.table tbody tr .btn-edit.btn-outline-primary:hover,
.table-hover tbody tr .btn-edit.btn-outline-primary,
.table-hover tbody tr .btn-edit.btn-outline-primary:hover {
    border-color: #696cff !important;
    color: #696cff !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* أزرار delete - نفس المظهر في الحالتين */
.btn-delete.btn-outline-danger,
.btn-delete.btn-outline-danger:hover,
.btn-delete.btn-outline-danger:focus,
.table tbody tr .btn-delete.btn-outline-danger,
.table tbody tr .btn-delete.btn-outline-danger:hover,
.table-hover tbody tr .btn-delete.btn-outline-danger,
.table-hover tbody tr .btn-delete.btn-outline-danger:hover {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* أزرار toggle warning - نفس المظهر في الحالتين */
.btn-client-toggle.btn-outline-warning,
.btn-client-toggle.btn-outline-warning:hover,
.btn-client-toggle.btn-outline-warning:focus,
.btn-provider-toggle.btn-outline-warning,
.btn-provider-toggle.btn-outline-warning:hover,
.btn-provider-toggle.btn-outline-warning:focus,
.btn-city-toggle.btn-outline-warning,
.btn-city-toggle.btn-outline-warning:hover,
.btn-city-toggle.btn-outline-warning:focus,
.btn-slider-toggle.btn-outline-warning,
.btn-slider-toggle.btn-outline-warning:hover,
.btn-slider-toggle.btn-outline-warning:focus,
.table tbody tr .btn-client-toggle.btn-outline-warning,
.table tbody tr .btn-client-toggle.btn-outline-warning:hover,
.table tbody tr .btn-provider-toggle.btn-outline-warning,
.table tbody tr .btn-provider-toggle.btn-outline-warning:hover,
.table tbody tr .btn-city-toggle.btn-outline-warning,
.table tbody tr .btn-city-toggle.btn-outline-warning:hover,
.table tbody tr .btn-slider-toggle.btn-outline-warning,
.table tbody tr .btn-slider-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-client-toggle.btn-outline-warning,
.table-hover tbody tr .btn-client-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-provider-toggle.btn-outline-warning,
.table-hover tbody tr .btn-provider-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-city-toggle.btn-outline-warning,
.table-hover tbody tr .btn-city-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-slider-toggle.btn-outline-warning,
.table-hover tbody tr .btn-slider-toggle.btn-outline-warning:hover {
    border-color: #ff9f43 !important;
    color: #ff9f43 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* أزرار toggle success - نفس المظهر في الحالتين */
.btn-client-toggle.btn-outline-success,
.btn-client-toggle.btn-outline-success:hover,
.btn-client-toggle.btn-outline-success:focus,
.btn-provider-toggle.btn-outline-success,
.btn-provider-toggle.btn-outline-success:hover,
.btn-provider-toggle.btn-outline-success:focus,
.btn-city-toggle.btn-outline-success,
.btn-city-toggle.btn-outline-success:hover,
.btn-city-toggle.btn-outline-success:focus,
.btn-slider-toggle.btn-outline-success,
.btn-slider-toggle.btn-outline-success:hover,
.btn-slider-toggle.btn-outline-success:focus,
.table tbody tr .btn-client-toggle.btn-outline-success,
.table tbody tr .btn-client-toggle.btn-outline-success:hover,
.table tbody tr .btn-provider-toggle.btn-outline-success,
.table tbody tr .btn-provider-toggle.btn-outline-success:hover,
.table tbody tr .btn-city-toggle.btn-outline-success,
.table tbody tr .btn-city-toggle.btn-outline-success:hover,
.table tbody tr .btn-slider-toggle.btn-outline-success,
.table tbody tr .btn-slider-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-client-toggle.btn-outline-success,
.table-hover tbody tr .btn-client-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-provider-toggle.btn-outline-success,
.table-hover tbody tr .btn-provider-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-city-toggle.btn-outline-success,
.table-hover tbody tr .btn-city-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-slider-toggle.btn-outline-success,
.table-hover tbody tr .btn-slider-toggle.btn-outline-success:hover {
    border-color: #28c76f !important;
    color: #28c76f !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* =================================================================================
 * TABLE BUTTONS - COMPREHENSIVE FIX FOR HOVER STATES
 * إصلاح شامل لأزرار الجداول - الحفاظ على الألوان ثابتة عند hover الصف
 * مع إضافة hover effects صحيحة عند hover مباشرة على الزر
 * ================================================================================= */

/* ============================================
   زر التعديل (Edit) - Primary Blue/Purple
   ============================================ */

/* الحالة الافتراضية - زر التعديل */
.table tbody tr .btn-edit.btn-outline-primary,
.table-hover tbody tr .btn-edit.btn-outline-primary {
    border-color: #696cff !important;
    color: #696cff !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

/* عند hover مباشرة على زر التعديل - خلفية زرقاء + نص أبيض */
.table tbody tr .btn-edit.btn-outline-primary:hover,
.table-hover tbody tr .btn-edit.btn-outline-primary:hover,
.table tbody tr:hover .btn-edit.btn-outline-primary:hover {
    border-color: #696cff !important;
    color: #ffffff !important;
    background-color: #696cff !important;
    box-shadow: 0 2px 4px rgba(105, 108, 255, 0.3) !important;
}

/* عند hover على الصف - الحفاظ على اللون الأصلي */
.table tbody tr:hover .btn-edit.btn-outline-primary,
.table-hover tbody tr:hover .btn-edit.btn-outline-primary {
    border-color: #696cff !important;
    color: #696cff !important;
    background-color: transparent !important;
}

/* Focus و Active states */
.table tbody tr .btn-edit.btn-outline-primary:focus,
.table tbody tr .btn-edit.btn-outline-primary:active,
.table tbody tr:hover .btn-edit.btn-outline-primary:focus,
.table tbody tr:hover .btn-edit.btn-outline-primary:active {
    border-color: #696cff !important;
    color: #696cff !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25) !important;
}

/* ============================================
   زر الحذف (Delete) - Danger Red
   ============================================ */

/* الحالة الافتراضية - زر الحذف */
.table tbody tr .btn-delete.btn-outline-danger,
.table-hover tbody tr .btn-delete.btn-outline-danger {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

/* عند hover مباشرة على زر الحذف - خلفية حمراء + نص أبيض */
.table tbody tr .btn-delete.btn-outline-danger:hover,
.table-hover tbody tr .btn-delete.btn-outline-danger:hover,
.table tbody tr:hover .btn-delete.btn-outline-danger:hover {
    border-color: #dc3545 !important;
    color: #ffffff !important;
    background-color: #dc3545 !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

/* عند hover على الصف - الحفاظ على اللون الأصلي */
.table tbody tr:hover .btn-delete.btn-outline-danger,
.table-hover tbody tr:hover .btn-delete.btn-outline-danger {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    background-color: transparent !important;
}

/* Focus و Active states */
.table tbody tr .btn-delete.btn-outline-danger:focus,
.table tbody tr .btn-delete.btn-outline-danger:active,
.table tbody tr:hover .btn-delete.btn-outline-danger:focus,
.table tbody tr:hover .btn-delete.btn-outline-danger:active {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* ============================================
   أزرار Toggle - Warning (برتقالي)
   ============================================ */

/* الحالة الافتراضية - زر Toggle Warning */
.table tbody tr .btn-client-toggle.btn-outline-warning,
.table tbody tr .btn-provider-toggle.btn-outline-warning,
.table tbody tr .btn-city-toggle.btn-outline-warning,
.table tbody tr .btn-slider-toggle.btn-outline-warning,
.table-hover tbody tr .btn-client-toggle.btn-outline-warning,
.table-hover tbody tr .btn-provider-toggle.btn-outline-warning,
.table-hover tbody tr .btn-city-toggle.btn-outline-warning,
.table-hover tbody tr .btn-slider-toggle.btn-outline-warning {
    border-color: #ff9f43 !important;
    color: #ff9f43 !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

/* عند hover مباشرة على زر Toggle Warning - خلفية برتقالية + نص أبيض */
.table tbody tr .btn-client-toggle.btn-outline-warning:hover,
.table tbody tr .btn-provider-toggle.btn-outline-warning:hover,
.table tbody tr .btn-city-toggle.btn-outline-warning:hover,
.table tbody tr .btn-slider-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-client-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-provider-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-city-toggle.btn-outline-warning:hover,
.table-hover tbody tr .btn-slider-toggle.btn-outline-warning:hover,
.table tbody tr:hover .btn-client-toggle.btn-outline-warning:hover,
.table tbody tr:hover .btn-provider-toggle.btn-outline-warning:hover,
.table tbody tr:hover .btn-city-toggle.btn-outline-warning:hover,
.table tbody tr:hover .btn-slider-toggle.btn-outline-warning:hover {
    border-color: #ff9f43 !important;
    color: #ffffff !important;
    background-color: #ff9f43 !important;
    box-shadow: 0 2px 4px rgba(255, 159, 67, 0.3) !important;
}

/* عند hover على الصف - الحفاظ على اللون الأصلي */
.table tbody tr:hover .btn-client-toggle.btn-outline-warning,
.table tbody tr:hover .btn-provider-toggle.btn-outline-warning,
.table tbody tr:hover .btn-city-toggle.btn-outline-warning,
.table tbody tr:hover .btn-slider-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-client-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-provider-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-city-toggle.btn-outline-warning,
.table-hover tbody tr:hover .btn-slider-toggle.btn-outline-warning {
    border-color: #ff9f43 !important;
    color: #ff9f43 !important;
    background-color: transparent !important;
}

/* Focus و Active states */
.table tbody tr .btn-client-toggle.btn-outline-warning:focus,
.table tbody tr .btn-provider-toggle.btn-outline-warning:focus,
.table tbody tr .btn-city-toggle.btn-outline-warning:focus,
.table tbody tr .btn-slider-toggle.btn-outline-warning:focus,
.table tbody tr:hover .btn-client-toggle.btn-outline-warning:focus,
.table tbody tr:hover .btn-provider-toggle.btn-outline-warning:focus,
.table tbody tr:hover .btn-city-toggle.btn-outline-warning:focus,
.table tbody tr:hover .btn-slider-toggle.btn-outline-warning:focus {
    border-color: #ff9f43 !important;
    color: #ff9f43 !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 159, 67, 0.25) !important;
}

/* ============================================
   أزرار Toggle - Success (أخضر)
   ============================================ */

/* الحالة الافتراضية - زر Toggle Success */
.table tbody tr .btn-client-toggle.btn-outline-success,
.table tbody tr .btn-provider-toggle.btn-outline-success,
.table tbody tr .btn-city-toggle.btn-outline-success,
.table tbody tr .btn-slider-toggle.btn-outline-success,
.table-hover tbody tr .btn-client-toggle.btn-outline-success,
.table-hover tbody tr .btn-provider-toggle.btn-outline-success,
.table-hover tbody tr .btn-city-toggle.btn-outline-success,
.table-hover tbody tr .btn-slider-toggle.btn-outline-success {
    border-color: #28c76f !important;
    color: #28c76f !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

/* عند hover مباشرة على زر Toggle Success - خلفية خضراء + نص أبيض */
.table tbody tr .btn-client-toggle.btn-outline-success:hover,
.table tbody tr .btn-provider-toggle.btn-outline-success:hover,
.table tbody tr .btn-city-toggle.btn-outline-success:hover,
.table tbody tr .btn-slider-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-client-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-provider-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-city-toggle.btn-outline-success:hover,
.table-hover tbody tr .btn-slider-toggle.btn-outline-success:hover,
.table tbody tr:hover .btn-client-toggle.btn-outline-success:hover,
.table tbody tr:hover .btn-provider-toggle.btn-outline-success:hover,
.table tbody tr:hover .btn-city-toggle.btn-outline-success:hover,
.table tbody tr:hover .btn-slider-toggle.btn-outline-success:hover {
    border-color: #28c76f !important;
    color: #ffffff !important;
    background-color: #28c76f !important;
    box-shadow: 0 2px 4px rgba(40, 199, 111, 0.3) !important;
}

/* عند hover على الصف - الحفاظ على اللون الأصلي */
.table tbody tr:hover .btn-client-toggle.btn-outline-success,
.table tbody tr:hover .btn-provider-toggle.btn-outline-success,
.table tbody tr:hover .btn-city-toggle.btn-outline-success,
.table tbody tr:hover .btn-slider-toggle.btn-outline-success,
.table-hover tbody tr:hover .btn-client-toggle.btn-outline-success,
.table-hover tbody tr:hover .btn-provider-toggle.btn-outline-success,
.table-hover tbody tr:hover .btn-city-toggle.btn-outline-success,
.table-hover tbody tr:hover .btn-slider-toggle.btn-outline-success {
    border-color: #28c76f !important;
    color: #28c76f !important;
    background-color: transparent !important;
}

/* Focus و Active states */
.table tbody tr .btn-client-toggle.btn-outline-success:focus,
.table tbody tr .btn-provider-toggle.btn-outline-success:focus,
.table tbody tr .btn-city-toggle.btn-outline-success:focus,
.table tbody tr .btn-slider-toggle.btn-outline-success:focus,
.table tbody tr:hover .btn-client-toggle.btn-outline-success:focus,
.table tbody tr:hover .btn-provider-toggle.btn-outline-success:focus,
.table tbody tr:hover .btn-city-toggle.btn-outline-success:focus,
.table tbody tr:hover .btn-slider-toggle.btn-outline-success:focus {
    border-color: #28c76f !important;
    color: #28c76f !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 199, 111, 0.25) !important;
}

/* ============================================
   الحفاظ على ألوان الأيقونات داخل الأزرار
   ============================================ */

/* الأيقونات داخل الأزرار تحافظ على ألوانها */
.table tbody tr .btn i,
.table tbody tr:hover .btn i,
.table-hover tbody tr .btn i,
.table-hover tbody tr:hover .btn i {
    color: inherit !important;
    transition: color 0.2s ease !important;
}

/* عند hover على الزر - الأيقونة تتحول للون الأبيض */
.table tbody tr .btn:hover i,
.table tbody tr:hover .btn:hover i,
.table-hover tbody tr .btn:hover i,
.table-hover tbody tr:hover .btn:hover i {
    color: inherit !important;
}


/* =================================
   إزالة التحديد من خلايا الجدول
   =================================
*/
.table tbody td,
table.table tbody td,
.dataTables_wrapper .table tbody td {
    /* منع تحديد النص في خلايا الجدول */
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* إزالة التحديد من جميع العناصر داخل الخلايا */
.table tbody td *,
table.table tbody td *,
.dataTables_wrapper .table tbody td * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* ============================================
   Badge Clickable - جعل الـ badge قابل للضغط
   ============================================ */
.badge.badge-clickable {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 10 !important;
}

/* تأثير hover على badge-clickable */
.badge.badge-clickable:hover {
    transform: scale(1.05) !important;
    opacity: 0.9 !important;
}

/* منع تأثير hover الصف على badge-clickable */
.table tbody tr:hover .badge.badge-clickable,
.table-hover tbody tr:hover .badge.badge-clickable {
    transform: scale(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* التأكد من أن badge-clickable يعمل حتى عند hover على الصف */
.table tbody tr:hover .badge.badge-clickable:hover,
.table-hover tbody tr:hover .badge.badge-clickable:hover {
    transform: scale(1.05) !important;
    opacity: 0.9 !important;
    cursor: pointer !important;
}

/* منع highlight التحديد */
.table tbody td::selection,
table.table tbody td::selection,
.dataTables_wrapper .table tbody td::selection {
    background: transparent !important;
}

.table tbody td *::selection,
table.table tbody td *::selection,
.dataTables_wrapper .table tbody td *::selection {
    background: transparent !important;
}

/* =================================
   تصميم احترافي لأسهم الترتيب (Sorting Arrows)
   =================================
*/

/* تحسين مظهر رأس الجدول مع أسهم الترتيب */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc,
table.dataTable thead td.sorting,
table.dataTable thead td.sorting_asc,
table.dataTable thead td.sorting_desc {
    position: relative !important;
    cursor: pointer !important;
    padding-right: 2rem !important;
    transition: all 0.2s ease !important;
}

/* تأثير hover على رأس الجدول */
table.dataTable thead th.sorting:hover,
table.dataTable thead th.sorting_asc:hover,
table.dataTable thead th.sorting_desc:hover {
    color: #696cff !important;
    transition: color 0.2s ease !important;
}

/* تحسين أسهم الترتيب - تصميم احترافي */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after,
table.dataTable thead .sorting_asc_disabled::before,
table.dataTable thead .sorting_asc_disabled::after,
table.dataTable thead .sorting_desc_disabled::before,
table.dataTable thead .sorting_desc_disabled::after {
    /* تحسين المظهر */
    font-size: 0.7rem !important;
    opacity: 0.4 !important;
    transition: all 0.2s ease !important;
    /* استخدام أيقونات أفضل */
    font-family: "tabler-icons" !important;
    line-height: 1 !important;
    right: 0.75rem !important;
}

/* السهم العلوي (للترتيب التصاعدي) */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before {
    top: 0.25rem !important;
    bottom: auto !important;
}

/* السهم السفلي (للترتيب التنازلي) */
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    bottom: 0.25rem !important;
    top: auto !important;
}

/* عند التفعيل - السهم النشط يكون أوضح */
table.dataTable thead .sorting_asc::before {
    opacity: 1 !important;
    color: #696cff !important;
    font-size: 0.8rem !important;
}

table.dataTable thead .sorting_desc::after {
    opacity: 1 !important;
    color: #696cff !important;
    font-size: 0.8rem !important;
}

/* تأثير hover على الأسهم */
table.dataTable thead th.sorting:hover::before,
table.dataTable thead th.sorting:hover::after,
table.dataTable thead th.sorting_asc:hover::before,
table.dataTable thead th.sorting_desc:hover::after {
    opacity: 0.7 !important;
    color: #696cff !important;
}

/* للثيم الفاتح */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead .sorting_asc::before {
    color: #696cff !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead .sorting_desc::after {
    color: #696cff !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead th.sorting:hover::before,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead th.sorting:hover::after {
    color: #696cff !important;
}

#btnDeleteSelected {
    display: none ;
}

/* =================================================================================
 * PROFILE AVATAR IMAGE - Unified Design
 * تصميم موحد لصور الملف الشخصي في dropdown بغض النظر عن الحجم والأبعاد
 * ================================================================================= */

/* تطبيق الأنماط على جميع صور الملف الشخصي */
.navbar-dropdown.dropdown-user .avatar img.profile-avatar-img,
.dropdown-user .avatar img.profile-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
    display: block !important;
}

/* التأكد من أن container الصورة له أبعاد ثابتة */
.navbar-dropdown.dropdown-user .avatar,
.dropdown-user .avatar {
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* للصورة في dropdown toggle (الهيدر) */
.navbar-dropdown.dropdown-user .nav-link .avatar img.profile-avatar-img {
    min-width: 100% !important;
    min-height: 100% !important;
}

/* للصورة داخل dropdown menu */
.dropdown-user .dropdown-menu .avatar img.profile-avatar-img {
    min-width: 100% !important;
    min-height: 100% !important;
}

/* =================================================================================
 * PASSWORD TOGGLE ICON - Inside Input Field (Left Side)
 * أيقونة إظهار/إخفاء كلمة المرور داخل الحقل على اليسار
 * ================================================================================= */
.form-password-toggle {
    position: relative;
}

.form-password-toggle .password-toggle-icon {
    position: absolute !important;
    left: 0.75rem !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    color: var(--bs-body-color);
    transition: color 0.2s ease;
    pointer-events: auto !important;
    user-select: none;
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Override any conflicting styles */
.form-password-toggle .password-toggle-icon[class*="end-0"],
.form-password-toggle .password-toggle-icon[style*="right"] {
    left: 0.75rem !important;
    right: auto !important;
}

.form-password-toggle .password-toggle-icon:hover {
    color: var(--bs-primary);
}

.form-password-toggle input.ps-5,
.form-password-toggle input[class*="ps-5"] {
    padding-left: 2.75rem !important;
    padding-right: 0.75rem !important;
}

/* للثيم الداكن */
html.dark-style .form-password-toggle .password-toggle-icon,
html[data-theme="dark"] .form-password-toggle .password-toggle-icon,
html[data-bs-theme="dark"] .form-password-toggle .password-toggle-icon {
    color: var(--bs-body-color);
}

html.dark-style .form-password-toggle .password-toggle-icon:hover,
html[data-theme="dark"] .form-password-toggle .password-toggle-icon:hover,
html[data-bs-theme="dark"] .form-password-toggle .password-toggle-icon:hover {
    color: var(--bs-primary);
}
.modal-footer {
    display: flex !important;
    flex-direction: row-reverse !important;
}

/* Custom state (RTL - Arabic)
 * 1. Use natural order (row) as in HTML (Close button then Save button)
 * 2. Align to end (flex-end) which is "right" in RTL mode
 */
html[dir="rtl"] .modal-footer {
    flex-direction: row !important;
}

/* =================================================================================
 * MODERN TABS STYLING - Enhanced Tab Navigation
 * تصميم حديث للتبويبات مع تأثيرات hover و active محسنة
 * ================================================================================= */

/* Enhanced Tab Pills Container */
#policyTabs {
    background: var(--bs-body-bg) !important;
    padding: 0.5rem !important;
    border-radius: 0.75rem !important;
    gap: 0.5rem !important;
    border: 1px solid var(--bs-border-color) !important;
}

/* Individual Tab Button Styling */
#policyTabs .nav-link {
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
    padding: 0.75rem 1.25rem !important;
    font-weight: 500 !important;
    color: var(--bs-body-color) !important;
    background: transparent !important;
    border: none !important;
    position: relative !important;
}

/* Tab Button Hover State */
#policyTabs .nav-link:hover {
    background: rgba(105, 108, 255, 0.1) !important;
    color: var(--bs-primary) !important;
    transform: translateY(-2px) !important;
}

/* Tab Button Active State */
#policyTabs .nav-link.active {
    background: var(--bs-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(105, 108, 255, 0.3) !important;
    transform: translateY(-2px) !important;
}

/* Tab Button Icons */
#policyTabs .nav-link i {
    transition: transform 0.3s ease !important;
}

#policyTabs .nav-link:hover i,
#policyTabs .nav-link.active i {
    transform: scale(1.1) !important;
}

/* Dark Mode Support for Tabs */
html.dark-style #policyTabs,
html[data-theme="dark"] #policyTabs,
html[data-bs-theme="dark"] #policyTabs {
    background: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
}

html.dark-style #policyTabs .nav-link:hover,
html[data-theme="dark"] #policyTabs .nav-link:hover,
html[data-bs-theme="dark"] #policyTabs .nav-link:hover {
    background: rgba(105, 108, 255, 0.2) !important;
}

html.dark-style #policyTabs .nav-link,
html[data-theme="dark"] #policyTabs .nav-link,
html[data-bs-theme="dark"] #policyTabs .nav-link {
    color: var(--bs-body-color) !important;
}

/* =================================================================================
 * MODERN FORM INPUT GROUPS - Enhanced Input with Icons
 * تصميم حديث لحقول الإدخال مع أيقونات
 * ================================================================================= */

/* Input Group with Icon Styling */
.input-group-merge .input-group-text {
    border-radius: 0.5rem 0 0 0.5rem !important;
    border-right: none !important;
    transition: all 0.3s ease !important;
}

.input-group-merge .form-control {
    border-radius: 0 0.5rem 0.5rem 0 !important;
    border-left: none !important;
    transition: all 0.3s ease !important;
}

.input-group-merge .form-control:focus {
    border-color: var(--bs-primary) !important;
/*    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25) !important;*/
}

.input-group-merge .form-control:focus + .input-group-text,
.input-group-merge:focus-within .input-group-text {
    border-color: var(--bs-primary) !important;
}

/* Enhanced Textarea Styling */
textarea.form-control {
    border-radius: 0.5rem !important;
    border: 1px solid var(--bs-border-color) !important;
    transition: all 0.3s ease !important;
    resize: vertical !important;
}

textarea.form-control:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25) !important;
}

/* =================================================================================
 * MODERN CARD SECTIONS - Enhanced Section Cards
 * تصميم حديث للبطاقات والأقسام
 * ================================================================================= */

/* Section Card with Background */
.card[style*="var(--bs-card-bg)"] {
    background: var(--bs-card-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.card[style*="var(--bs-card-bg)"]:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px) !important;
}

/* Section Card with Gradient Background - Legacy Support */
.card[style*="linear-gradient"] {
    border: 1px solid var(--bs-border-color) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.card[style*="linear-gradient"]:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px) !important;
}

/* Section Card Header */
.card-header.bg-transparent {
    border-bottom: 1px solid var(--bs-border-color) !important;
}

/* Dark Mode Support for Cards */
html.dark-style .card[style*="var(--bs-card-bg)"],
html[data-theme="dark"] .card[style*="var(--bs-card-bg)"],
html[data-bs-theme="dark"] .card[style*="var(--bs-card-bg)"],
html.dark-style .card[style*="linear-gradient"],
html[data-theme="dark"] .card[style*="linear-gradient"],
html[data-bs-theme="dark"] .card[style*="linear-gradient"] {
    background: var(--bs-card-bg) !important;
    border-color: var(--bs-border-color) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.dark-style .card[style*="var(--bs-card-bg)"]:hover,
html[data-theme="dark"] .card[style*="var(--bs-card-bg)"]:hover,
html[data-bs-theme="dark"] .card[style*="var(--bs-card-bg)"]:hover,
html.dark-style .card[style*="linear-gradient"]:hover,
html[data-theme="dark"] .card[style*="linear-gradient"]:hover,
html[data-bs-theme="dark"] .card[style*="linear-gradient"]:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

/* =================================================================================
 * MODERN BUTTON STYLING - Enhanced Action Buttons
 * تصميم حديث للأزرار مع تأثيرات shadow محسنة
 * ================================================================================= */

/* Primary Button with Enhanced Shadow */
.btn-primary.btn-lg {
    box-shadow: 0 4px 12px rgba(105, 108, 255, 0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-primary.btn-lg:hover {
    box-shadow: 0 6px 20px rgba(105, 108, 255, 0.4) !important;
    transform: translateY(-2px) !important;
}

.btn-primary.btn-lg:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(105, 108, 255, 0.3) !important;
}

/* Secondary Button Styling */
.btn-label-secondary.btn-lg {
    transition: all 0.3s ease !important;
}

.btn-label-secondary.btn-lg:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* =================================================================================
 * MODERN PAGE HEADER - Enhanced Header Design
 * تصميم حديث لرأس الصفحة
 * ================================================================================= */

/* Page Header Icon Container */
.header-icon {
    transition: all 0.3s ease !important;
}

.page-header-simple:hover .header-icon {
    transform: scale(1.05) !important;
}

/* Dark Mode Support for Page Header */
html.dark-style .page-header-simple,
html[data-theme="dark"] .page-header-simple,
html[data-bs-theme="dark"] .page-header-simple {
    background: var(--bs-card-bg) !important;
    border-color: var(--bs-border-color) !important;
}

html.dark-style .page-header-simple[style*="var(--bs-card-bg)"],
html[data-theme="dark"] .page-header-simple[style*="var(--bs-card-bg)"],
html[data-bs-theme="dark"] .page-header-simple[style*="var(--bs-card-bg)"] {
    background: var(--bs-card-bg) !important;
}
