/* ===========================================
   DataTables 2.x + Bootstrap 5.y
   Ustawienie ikon sortowania po PRAWEJ stronie
   =========================================== */

/* Wymuszenie kierunku flex na kolumnach */
table.dataTable thead th .dt-column-header {
  display: flex;
  flex-direction: row !important; /* klucz: nadpisuje domyślny row-reverse */
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  position: relative;
}

/* Tytuł zawsze po lewej */
table.dataTable thead th .dt-column-title {
  order: 1 !important;
}

/* Ikona sortowania zawsze po prawej */
table.dataTable thead th .dt-column-order {
  order: 2 !important;
  margin-left: 0.5rem;
  margin-right: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Opcjonalnie – dopasowanie kolorów Bootstrap 5
table.dataTable thead th .dt-column-order {
  color: var(--bs-secondary-color, #6c757d);
  opacity: 0.8;
}
table.dataTable thead th.dt-ordering-asc .dt-column-order,
table.dataTable thead th.dt-ordering-desc .dt-column-order {
  color: var(--bs-body-color);
  opacity: 1;
}
*/

/* Zapobieganie nadpisaniu przez DataTables przy kolumnach liczbowych/datowych */
table.dataTable thead th.dt-type-num .dt-column-header,
table.dataTable thead th.dt-type-date .dt-column-header {
  flex-direction: row !important;
}

/* Dla RTL */
:dir(rtl) table.dataTable thead th .dt-column-header {
  flex-direction: row-reverse !important;
}
