/* ------------------------------------------------------------------
   RTL (Arabic) adjustments for the app's own styles.
   Loaded only when the active language is right-to-left.
   Bootstrap / Velzon themselves are switched to their *-rtl.min.css builds.
------------------------------------------------------------------- */
html[dir="rtl"] body,
html[dir="rtl"] .navbar-menu,
html[dir="rtl"] .btn,
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

/* Custom classes from head-css.php that were written for LTR */
html[dir="rtl"] .text-right { text-align: left; }
html[dir="rtl"] span.coa_file_icons { margin-right: 0; margin-left: 10px; }
html[dir="rtl"] #back-btn { left: auto; right: 28px; }
html[dir="rtl"] .responsive_button_for_dynamic_fields { float: left; }
html[dir="rtl"] #cover-spin::after { left: auto; right: 48%; }

/* Numbers, plate numbers, VINs, phone numbers and amounts stay left-to-right */
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[name*="phone" i],
html[dir="rtl"] input[name*="mobile" i],
html[dir="rtl"] input[name*="land_line" i],
html[dir="rtl"] input[name*="email" i],
html[dir="rtl"] .ltr-text {
    direction: ltr;
    text-align: right;
}

/* DataTables controls */
html[dir="rtl"] div.dataTables_wrapper div.dataTables_filter { text-align: left; }
html[dir="rtl"] div.dataTables_wrapper div.dataTables_filter input { margin-left: 0; margin-right: .5em; }
html[dir="rtl"] div.dataTables_wrapper div.dataTables_length select { margin: 0 .25em; }
html[dir="rtl"] div.dataTables_wrapper div.dataTables_paginate { text-align: left; }

/* Select2 */
html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow { left: 1px; right: auto; }
html[dir="rtl"] .select2-container .select2-selection--single .select2-selection__rendered { padding-right: 8px; padding-left: 20px; text-align: right; }

/* Language switcher: current item */
.app-lang-switcher .dropdown-item.active { font-weight: 600; }

/* Latin-only table values (phones, amounts, codes, English names/addresses) keep their order */
html[dir="rtl"] bdi.app-ltr { direction: ltr; unicode-bidi: isolate; }
/* Active / Inactive checkboxes: gap between box and label */
html[dir="rtl"] .checkbox-custom input[type="checkbox"] { margin-left: 6px; margin-right: 0; vertical-align: middle; }
/* Login slider quote icon faces the right way */
html[dir="rtl"] .ri-double-quotes-l { display: inline-block; transform: scaleX(-1); }
