/* --- Base RTL --- */
html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .content-header h1 {
  text-align: right;
}

html[dir="rtl"] .nav-sidebar .nav-link p {
  text-align: right;
}

html[dir="rtl"] .nav-sidebar .nav-link .nav-icon {
  margin-left: 0.5rem;
  margin-right: 0;
}

html[dir="rtl"] .brand-link .brand-text {
  text-align: right;
}

/* --- Login --- */
.login-box {
  width: 380px;
}

.login-logo,
.login-box-msg {
  text-align: center;
}

.login-page .input-group .form-control {
  text-align: right;
}

/* --- Cards --- */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-header .card-title {
  float: none;
  margin: 0;
  flex: 1 1 auto;
}

.card-header .card-tools {
  float: none;
  margin: 0;
  flex: 0 0 auto;
}

.card-tools .btn {
  margin-top: 0;
}

.customer-row:hover {
  background-color: rgba(0, 123, 255, 0.05) !important;
}

/* --- Forms --- */
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-control-plaintext {
  text-align: right;
}

html[dir="rtl"] .col-form-label {
  text-align: left;
}

html[dir="rtl"] .form-group label:not(.col-form-label) {
  display: block;
  text-align: right;
  width: 100%;
}

input[type="number"].no-spinner::-webkit-outer-spin-button,
input[type="number"].no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"].no-spinner {
  -moz-appearance: textfield;
}

.bo-form-actions {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
}

/* --- Modal --- */
html[dir="rtl"] .modal-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .modal-header .close {
  margin: -1rem auto -1rem -1rem;
  padding: 1rem;
}

html[dir="rtl"] .modal-footer {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

html[dir="rtl"] .modal-body .form-text {
  text-align: right;
}

/* --- DataTables (#customersTable) --- */
#customersTable_wrapper {
  direction: rtl;
}

#customersTable_wrapper .row:first-child {
  align-items: center;
}

#customersTable_wrapper .dataTables_length {
  text-align: right;
}

#customersTable_wrapper .dataTables_length label {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0;
}

#customersTable_wrapper .dataTables_filter {
  text-align: left;
}


#customersTable_wrapper .dataTables_filter input {
  margin: 0;
}

#customersTable_wrapper .dataTables_info {
  text-align: right;
  padding-top: 0.85rem;
}

#customersTable_wrapper .dataTables_paginate {
  text-align: left;
}

#customersTable_wrapper .pagination {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

#customersTable {
  width: 100% !important;
}

#customersTable th,
#customersTable td {
  text-align: right;
  vertical-align: middle;
}

#customersTable th.sorting,
#customersTable th.sorting_asc,
#customersTable th.sorting_desc {
  padding-left: 1.5rem;
  padding-right: 0.75rem;
}

/* --- Alerts --- */
html[dir="rtl"] .alert-dismissible {
  padding-left: 4rem;
  padding-right: 1.25rem;
}

html[dir="rtl"] .alert-dismissible .close {
  left: 0;
  right: auto;
}