html[dir="rtl"] .page-content {
    margin-left: 0;
    margin-right: var(--size-side-left, 250px);
}

html[dir="rtl"] .sidebar-container.collapsed~.page-content {
    margin-right: var(--scaled-80, 80px);
}


html[dir="rtl"] .text-left {
    text-align: right !important;
}

html[dir="rtl"] .text-right {
    text-align: left !important;
}

html[dir="rtl"] .border-l-2 {
    border-left-width: 0 !important;
    border-right-width: 2px !important;
}

html[dir="rtl"] .border-l {
    border-left-width: 0 !important;
    border-right-width: 1px !important;
}

html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] * {
    font-family: 'Cairo', sans-serif;
}


/* Ensure Material Symbols icons always use the correct font, even in RTL */

html[dir="rtl"] .material-symbols-outlined,
html[dir="rtl"] .material-symbols-outlined *,
html[dir="rtl"] i.material-symbols-outlined,
html[dir="rtl"] span.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    direction: ltr !important;
    font-feature-settings: 'liga' !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}
/* Prevent ONLY check_circle from mirroring in RTL */
html[dir="rtl"] .material-symbols-outlined.check-circle-icon {
    direction: ltr !important;
    unicode-bidi: bidi-override !important;
    transform: none !important;
    scale: 1 !important;
}

/* Ensure FontAwesome icons always use the correct font, even in RTL */

html[dir="rtl"] .fa,
html[dir="rtl"] .fas,
html[dir="rtl"] .fa-solid,
html[dir="rtl"] i[class*="fa-"],
html[dir="rtl"] i[class^="fas"],
html[dir="rtl"] i[class^="fa-"]:not([class*="fa-brands"]):not([class*="fa-regular"]) {
    font-family: "Font Awesome 6 Free" !important;
    direction: ltr !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: auto !important;
    font-style: normal !important;
    font-variant: normal !important;
    line-height: 1 !important;
}

html[dir="rtl"] .far,
html[dir="rtl"] .fa-regular,
html[dir="rtl"] i[class^="far"] {
    font-family: "Font Awesome 6 Free" !important;
    direction: ltr !important;
    font-weight: 400 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: auto !important;
    font-style: normal !important;
    font-variant: normal !important;
    line-height: 1 !important;
}

html[dir="rtl"] .fab,
html[dir="rtl"] .fa-brands,
html[dir="rtl"] i[class^="fab"],
html[dir="rtl"] i[class*="fa-brands"] {
    font-family: "Font Awesome 6 Brands" !important;
    direction: ltr !important;
    font-weight: 400 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: auto !important;
    font-style: normal !important;
    font-variant: normal !important;
    line-height: 1 !important;
}

/* Tailwind "space-x-*" sets --tw-space-x-reverse on the *children*.
   Flip it in RTL so existing templates keep correct icon/text spacing. */
html[dir="rtl"] .space-x-1 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-3 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-5 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-6 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-8 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-10 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-12 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1 !important;
}

/* Common inline icon spacing helpers (FontAwesome in templates often uses mr-*). */
html[dir="rtl"] i.mr-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
html[dir="rtl"] i.mr-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
html[dir="rtl"] i.mr-3 { margin-right: 0 !important; margin-left: 0.75rem !important; }
html[dir="rtl"] i.mr-4 { margin-right: 0 !important; margin-left: 1rem !important; }