/* Bootstrap 4 RTL Override */
*[dir="rtl"] {
    direction: rtl;
    unicode-bidi: embed;
}

/* Text alignment */
*[dir="rtl"] .text-left { text-align: right !important; }
*[dir="rtl"] .text-right { text-align: left !important; }

/* Floats */
*[dir="rtl"] .float-left { float: right !important; }
*[dir="rtl"] .float-right { float: left !important; }

/* Margin and padding utilities */
*[dir="rtl"] .ml-0 { margin-right: 0 !important; margin-left: inherit !important; }
*[dir="rtl"] .ml-1 { margin-right: 0.25rem !important; margin-left: inherit !important; }
*[dir="rtl"] .ml-2 { margin-right: 0.5rem !important; margin-left: inherit !important; }
*[dir="rtl"] .ml-3 { margin-right: 1rem !important; margin-left: inherit !important; }
*[dir="rtl"] .ml-4 { margin-right: 1.5rem !important; margin-left: inherit !important; }
*[dir="rtl"] .ml-5 { margin-right: 3rem !important; margin-left: inherit !important; }
*[dir="rtl"] .ml-auto { margin-right: auto !important; margin-left: inherit !important; }

*[dir="rtl"] .mr-0 { margin-left: 0 !important; margin-right: inherit !important; }
*[dir="rtl"] .mr-1 { margin-left: 0.25rem !important; margin-right: inherit !important; }
*[dir="rtl"] .mr-2 { margin-left: 0.5rem !important; margin-right: inherit !important; }
*[dir="rtl"] .mr-3 { margin-left: 1rem !important; margin-right: inherit !important; }
*[dir="rtl"] .mr-4 { margin-left: 1.5rem !important; margin-right: inherit !important; }
*[dir="rtl"] .mr-5 { margin-left: 3rem !important; margin-right: inherit !important; }
*[dir="rtl"] .mr-auto { margin-left: auto !important; margin-right: inherit !important; }

*[dir="rtl"] .pl-0 { padding-right: 0 !important; padding-left: inherit !important; }
*[dir="rtl"] .pl-1 { padding-right: 0.25rem !important; padding-left: inherit !important; }
*[dir="rtl"] .pl-2 { padding-right: 0.5rem !important; padding-left: inherit !important; }
*[dir="rtl"] .pl-3 { padding-right: 1rem !important; padding-left: inherit !important; }
*[dir="rtl"] .pl-4 { padding-right: 1.5rem !important; padding-left: inherit !important; }
*[dir="rtl"] .pl-5 { padding-right: 3rem !important; padding-left: inherit !important; }

*[dir="rtl"] .pr-0 { padding-left: 0 !important; padding-right: inherit !important; }
*[dir="rtl"] .pr-1 { padding-left: 0.25rem !important; padding-right: inherit !important; }
*[dir="rtl"] .pr-2 { padding-left: 0.5rem !important; padding-right: inherit !important; }
*[dir="rtl"] .pr-3 { padding-left: 1rem !important; padding-right: inherit !important; }
*[dir="rtl"] .pr-4 { padding-left: 1.5rem !important; padding-right: inherit !important; }
*[dir="rtl"] .pr-5 { padding-left: 3rem !important; padding-right: inherit !important; }

/* Border utilities */
*[dir="rtl"] .border-left { border-right: 1px solid #dee2e6 !important; border-left: none !important; }
*[dir="rtl"] .border-right { border-left: 1px solid #dee2e6 !important; border-right: none !important; }

/* Form controls */
*[dir="rtl"] .form-check {
    padding-right: 1.25rem;
    padding-left: 0;
}

*[dir="rtl"] .form-check-input {
    margin-right: -1.25rem;
    margin-left: 0;
}

*[dir="rtl"] .input-group-prepend {
    border-radius: 0 0.25rem 0.25rem 0;
}

*[dir="rtl"] .input-group-append {
    border-radius: 0.25rem 0 0 0.25rem;
}

*[dir="rtl"] .input-group > .form-control:not(:last-child) {
    border-radius: 0 0.25rem 0.25rem 0;
}

*[dir="rtl"] .input-group > .form-control:not(:first-child) {
    border-radius: 0.25rem 0 0 0.25rem;
}

/* Dropdown */
*[dir="rtl"] .dropdown-menu {
    text-align: right;
    right: 0;
    left: auto;
}

/* Nav */
*[dir="rtl"] .nav {
    padding-right: 0;
}

/* List */
*[dir="rtl"] ul {
    padding-right: 2rem;
}

/* Carousel */
*[dir="rtl"] .carousel-control-prev {
    right: 0;
    left: auto;
}

*[dir="rtl"] .carousel-control-next {
    left: 0;
    right: auto;
}

/* Modal */
*[dir="rtl"] .modal-header .close {
    margin: -1rem auto -1rem -1rem;
}

/* Breadcrumb */
*[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
}