  /* RTL support for Django Unfold - Target the actual result list table */
  [dir="rtl"] table#result_list {
    direction: rtl;
    text-align: right;
    width: 100%;
  }

  [dir="rtl"] table#result_list th {
    text-align: right;
    padding: 8px 10px;
  }

  [dir="rtl"] table#result_list td {
    text-align: right;
    padding: 8px 10px;
  }

  [dir="rtl"] table#result_list th.action-checkbox-column,
  [dir="rtl"] table#result_list td.action-checkbox {
    text-align: center !important;
    width: 30px;
  }

  /* Fix specific column alignments */
  [dir="rtl"] table#result_list td.field-id,
  [dir="rtl"] table#result_list td.field-number,
  [dir="rtl"] table#result_list td.field-price,
  [dir="rtl"] table#result_list td.field-amount {
    text-align: left !important;
    /* Keep numbers left-aligned in RTL */
  }

  /* Fix the table header and body alignment */
  [dir="rtl"] table#result_list thead th,
  [dir="rtl"] table#result_list tbody td {
    text-align: right;
    direction: rtl;
  }

  /* Fix action dropdown alignment */
  [dir="rtl"] .dropdown-menu {
    right: auto !important;
    left: 0 !important;
    text-align: right;
  }

  /*
    Unfold changelist bulk actions bar (fixed at bottom) uses LTR sidebar offsets:
    - wrapper toggles `xl:ml-72` when sidebar is open.
    In RTL, sidebar is on the right, so we must offset with margin-right instead,
    otherwise the actions bar ends up hidden under the right sidebar.
  */
  [dir="rtl"] #changelist-actions-wrapper.xl\:ml-72 {
    margin-left: 0 !important;
    margin-right: 18rem !important; /* 72 * 0.25rem */
  }

  [dir="rtl"] #changelist-actions-wrapper.xl\:ml-0 {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Fix pagination alignment */
  [dir="rtl"] .pagination {
    direction: ltr;
    /* Keep pagination controls LTR */
    text-align: left;
  }
  /* Add this CSS to your project's stylesheet */
  [dir="rtl"] .absolute.-right-2 {
    right: auto !important;
    left: 0.5rem !important;
  }

  [dir="rtl"] .absolute.bg-white {
    right: auto !important;
    left: 0 !important;
    transform: translateX(0) !important;
  }

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

  /* Additional specific fixes if needed */
  [dir="rtl"] .top-7 {
    top: 1.75rem;
  }

  [dir="rtl"] .w-52 {
    width: 13rem;
  }
