/* [GROWCRM] RTL Support */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* Global Direction */
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif !important;
}

/* Sidebar Positioning */
html[dir="rtl"] .left-sidebar {
    right: 0;
    left: auto;
    border-right: none;
    border-left: 1px solid #eae7e7;
}

/* Main Wrapper Margins */
/* Default desktop behavior */
@media (min-width: 768px) {
    html[dir="rtl"] .page-wrapper {
        margin-left: 0 !important;
        margin-right: 230px !important;
        transition: 0.2s ease-in;
    }

    html[dir="rtl"] .footer {
        left: 0 !important;
        right: 230px !important;
        transition: 0.2s ease-in;
    }

    /* Fixed Sidebar */
    html[dir="rtl"] body.mini-sidebar .page-wrapper {
        margin-right: 75px !important;
        margin-left: 0 !important;
        width: auto !important;
    }

    /* Broader fix for potential wrapper class usage */
    html[dir="rtl"] .mini-sidebar .page-wrapper,
    html[dir="rtl"] #main-wrapper.mini-sidebar .page-wrapper {
        margin-right: 75px !important;
        margin-left: 0 !important;
        width: calc(100% - 75px) !important;
        flex: 0 0 calc(100% - 75px);
        max-width: calc(100% - 75px);
    }

    html[dir="rtl"] body.mini-sidebar .footer {
        right: 75px !important;
    }
}

/* Fix Header Logo Area */
html[dir="rtl"] .topbar .top-navbar .navbar-header {
    float: right;
}

html[dir="rtl"] .topbar .top-navbar .navbar-nav {
    float: left;
    flex-direction: row-reverse;
    /* Bootstrap 4 nav fix */
}

/* Fix for Main Nav (Toggle & Search) in RTL */
html[dir="rtl"] .topbar .top-navbar .navbar-nav.mr-auto {
    float: right !important;
    flex-direction: row !important;
    /* Keep Toggle then Search */
    margin-right: 0 !important;
}

/* Fix Dropdowns */
html[dir="rtl"] .dropdown-menu {
    text-align: right;
    right: 0 !important;
    left: auto !important;
}

/* Sidebar Menu Items */
html[dir="rtl"] .sidebar-nav>ul>li>a i {
    margin-left: 10px;
    margin-right: 0;
}

html[dir="rtl"] .sidebar-nav>ul>li>a {
    padding: 8px 10px 8px 35px;
    /* Adjust padding for RTL arrow */
}

html[dir="rtl"] .sidebar-nav>ul>li>a::after {
    margin-right: auto;
    margin-left: 0;
    right: auto;
    left: 15px;
    transform: rotate(180deg);
}