﻿/* Loaded after theme/form styles. RTL only; keep dimensions and fonts from the original theme. */
html[dir="rtl"] body { direction:rtl; text-align:right; }
html[dir="rtl"] :is(.app-main__inner,.card-body,.modal-body,.modal-footer,.swal-modal,.dropdown-menu,#RightClickDiv) { direction:rtl; }
html[dir="rtl"] :is(.ui-code-ltr,.ui-value-ltr,input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"],input[type="number"],input[type="email"],input[type="url"],input[type="tel"]) { direction:ltr!important;unicode-bidi:isolate; }
html[dir="rtl"] :is(.ui-code-ltr,.ui-value-ltr) { text-align:right; }
html[dir="rtl"] .sticky-left { left:auto!important;right:var(--uts-sticky-offset,-1px)!important; }
html[dir="rtl"] .left-border-info { border-left-width:0!important;border-right-width:3px!important;border-right-color:#84a8e9;border-top-right-radius:0;border-bottom-right-radius:0; }
html[dir="rtl"] :is(.ButtonBorderSuccess,.ButtonBorderAlternate,.ButtonBorderWarning,.ButtonBorderDanger) { border-left-width:5px!important;border-right-width:0!important; }
html[dir="rtl"] .ButtonBorderSuccess { border-left-color:lightseagreen!important; }
html[dir="rtl"] .ButtonBorderAlternate { border-left-color:mediumpurple!important; }
html[dir="rtl"] :is(.muh-right,.eg-actions,.bd-actions) { margin-left:0;margin-right:auto; }
html[dir="rtl"] .modal-header .close { margin-left:-1rem;margin-right:auto; }
html[dir="rtl"] :is(.swal-title,.swal-text) { direction:rtl; }
html[dir="rtl"] :is(#RightClickDiv,.swal-text) { text-align:right; }
html[dir="rtl"] #RightClickDiv { right:auto; }
html[dir="rtl"] #RightClickDiv :is(.mr-1,.mr-2,.mr-3) { flex-shrink:0; }
html[dir="rtl"] #utsReportFlyout { direction:rtl;text-align:right; }
html[dir="rtl"] :is(.form-control-label,.muh-field>span,.eg-field>span,.bd-field>span) { text-align:start; }
html[dir="rtl"] :is(.muh-root,.muh-modal,.uts-form-surface) input[type="checkbox"],
html[dir="rtl"] :is(.muh-root,.muh-modal,.uts-form-surface) input[type="radio"] { margin-left:5px;margin-right:0; }
html[dir="rtl"] :is(.muh-table,.muh-lines) :is(td,th) { text-align:inherit; }
html[dir="rtl"] :is(.muh-table,.muh-lines) :is(td,th)[dir="ltr"] { direction:ltr;unicode-bidi:isolate;text-align:right; }
html[dir="rtl"] .muh-num { direction:ltr;unicode-bidi:isolate;text-align:right; }
html[dir="rtl"] :is(#muhPage,#gPage,#tcPage) { direction:ltr;unicode-bidi:isolate; }
html[dir="rtl"] :is(.fa-arrow-left,.fa-arrow-right,.fa-chevron-left,.fa-chevron-right,.fa-angle-left,.fa-angle-right,.fa-sign-in-alt,.fa-sign-out-alt) { transform:scaleX(-1); }
html[dir="rtl"] :is(.ui-code-ltr,.ui-value-ltr) :is(.fa-arrow-left,.fa-arrow-right) { transform:none; }
/* Calendar contents and numeric input spinners keep the existing Gregorian/date presentation. */
html[dir="rtl"] :is(.ui-datepicker,.flatpickr-calendar,.datepicker) { direction:ltr; }
@media print {
 html[dir="rtl"] .app-main__outer { padding-left:0!important;padding-right:0!important; }
}

/* Inline styles of the compact shared date selector need the same directional edges. */
html[dir="rtl"] .ui-directional-icon { transform:scaleX(-1); }
html[dir="rtl"] .uts-date-modern input[type="date"] { border-radius:0 5px 5px 0; }
html[dir="rtl"] .uts-date-modern input[type="date"] + .input-group-prepend > .input-group-text { border-left:1px solid #cbd9e9;border-right:0;border-radius:5px 0 0 5px; }
html[dir="rtl"] .uts-date-modern-row > .input-group > label { margin-right:0!important;margin-left:5px!important; }
html[dir="rtl"] .uts-date-modern-row > .input-group > button { margin-right:0!important;margin-left:3px!important; }
html[dir="rtl"] .uts-date-modern .uts-date-modern-custom input[type="checkbox"]::before { left:auto;right:2px; }
html[dir="rtl"] .uts-date-modern .uts-date-modern-custom input[type="checkbox"]:checked::before { transform:translateX(-12px); }

/* Keep the arrow separate from right-aligned text, including AJAX/modal selects.
   Theme background-position uses calc(100% - 12px), which RTL generation cannot flip. */
html[dir="rtl"] select:not([multiple]):not([size]),
html[dir="rtl"] select:not([multiple])[size="1"] {
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath fill='%23777' d='M0 1h8L4 5z'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-size:8px 6px;
    background-position:left 8px center!important;
    padding-left:24px!important;
    padding-right:8px!important;
    text-align:right;
}
html[dir="rtl"] select[multiple],
html[dir="rtl"] select[size]:not([size="1"]) { background-image:none; }
html[dir="rtl"] .ms-choice { direction:rtl;text-align:right; }
html[dir="rtl"] .ms-choice > span { left:20px;right:0;padding-left:0;padding-right:8px; }
html[dir="rtl"] .ms-choice > div.icon-caret { left:8px;right:auto; }
html[dir="rtl"] .ms-choice > div.icon-close { left:16px;right:auto; }
html[dir="rtl"] .ms-choice:has(> .icon-close) > span { left:36px; }
html[dir="rtl"] .ms-drop { direction:rtl;text-align:right; }
html[dir="rtl"] .ms-drop ul > li label { padding-left:0;padding-right:1.25rem; }
html[dir="rtl"] .ms-drop ul > li.hide-radio label { padding:5px 8px; }
html[dir="rtl"] .ms-drop ul > li.option-level-1 label { padding-left:0;padding-right:28px; }
html[dir="rtl"] .ms-drop input[type="radio"],
html[dir="rtl"] .ms-drop input[type="checkbox"] { margin-left:0;margin-right:-1.25rem; }
html[dir="rtl"] .ms-drop ul > li.multiple { float:right; }
html[dir="rtl"] .select2-container .select2-selection--single .select2-selection__rendered { padding-left:28px;padding-right:8px;text-align:right; }
html[dir="rtl"] .select2-container .select2-selection--single .select2-selection__arrow { left:1px;right:auto; }
html[dir="rtl"] .select2-container .select2-selection--single .select2-selection__clear { float:left; }

/* User menu: RTL places the dropdown chevron to the left of the avatar. */
html[dir="rtl"] .app-header .uts-user-menu-toggle {
    display:inline-flex;
    align-items:center;
    flex-direction:row;
    direction:rtl;
    vertical-align:middle;
}
html[dir="rtl"] .app-header .uts-user-menu-toggle > img { flex-shrink:0; }
html[dir="rtl"] .app-header .uts-user-menu-toggle > .fa-angle-down {
    margin:0 8px 0 0!important;
    flex-shrink:0;
}

/* User preference for personnel report filters: selection arrows stay on the right. */
html[dir="rtl"] :is(#utsPersonnelFilter,#utsPersonnelFilterCoklu) :is(select:not([multiple]):not([size]),select[size="1"],.uts-multi > summary) {
    background-position:right 10px center!important;
    padding-right:30px!important;padding-left:10px!important;
}
