body {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.text-end { text-align: left !important; }
.text-start { text-align: right !important; }
.me-1, .me-2, .me-3 { margin-left: 0.25rem !important; margin-right: 0 !important; }
.ms-1, .ms-2, .ms-3 { margin-right: 0.25rem !important; margin-left: 0 !important; }

/* Alignement du header en RTL */
.main-header .container .row {
    direction: rtl !important;
    display: flex !important;
    flex-direction: row-reverse !important; /* Inverse l'ordre visuel des colonnes */
}

/* Logo section à droite (physiquement) en RTL */
.main-header .row > .col-md-3:nth-child(1) {
    /* Logo à droite de l'écran */
    order: 3 !important;
    text-align: right !important;
}

/* Navigation au centre */
.main-header .row > .col-md-6:nth-child(2) {
    order: 2 !important;
}

/* Zone utilisateur à gauche de l'écran */
.main-header .row > .col-md-3:nth-child(3) {
    order: 1 !important;
    text-align: left !important;
}

/* Contenu du logo */
.logo-section {
    direction: ltr !important; /* Garde le logo et texte dans le bon sens */
    display: flex !important;
    justify-content: flex-end !important; /* Aligne à droite */
}

.logo-section a {
    flex-direction: row-reverse !important; /* Texte à gauche, image à droite */
    justify-content: flex-start !important;
}

.header-logo {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

/* Navigation centrée */
.main-nav {
    display: flex !important;
    justify-content: center !important;
}

/* Navigation au centre - RTL */
.main-nav {
    direction: rtl;
}

/*.main-nav .nav {
    flex-direction: row-reverse;
}*/

/* Zone utilisateur à gauche en RTL */
.user-section {
    text-align: left !important;
}

.user-section .d-flex {
    justify-content: flex-start !important;
    flex-direction: row-reverse;
}

/* Dropdown menu RTL */
.dropdown-menu {
    text-align: right;
    left: 0 !important;
    right: auto !important;
}

.dropdown-menu-end {
    left: 0 !important;
    right: auto !important;
}

/* Icônes à droite dans le dropdown */
.dropdown-item i {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

/* Boutons RTL */
.btn i {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

/* Footer RTL */
.modern-footer .row {
    direction: rtl;
}