/* ========================================
   MASSROUFI - VERSION ARABE (de droite à gauche)
   Chargé uniquement quand la langue affichée s'écrit de droite à gauche (is_rtl()).
   La mise en page flex/grid s'inverse d'elle-même avec dir="rtl" ;
   ce fichier corrige les positions gauche/droite écrites en dur et applique la police Cairo.
======================================== */

/* Police : Cairo pour tout le texte (les icônes Font Awesome et Codevz gardent leur police). */
body.rtl,
.rtl :is(h1, h2, h3, h4, h5, h6, p, a, span, li, label, button, input, select, textarea, small, strong, b, em, td, th, legend, div):not([class*="fa-"]):not([class^="fa"]):not([class*="czico"]) {
    font-family: 'Cairo', system-ui, sans-serif !important;
}

.rtl .masroufi-expense-wrap,
.rtl .masroufi-history,
.rtl .masroufi-statistics,
.rtl .masroufi-budget,
.rtl .masroufi-quick-expenses,
.rtl .masroufi-guest {
    line-height: 1.7;
}

/* Montants : un signe (−, +) ou une fraction (dépensé / budget) doit rester dans l'ordre
   de lecture des chiffres, de gauche à droite, au sein du texte arabe. */
.rtl .masroufi-expense-item-amount,
.rtl .masroufi-month-comparison > strong,
.rtl .masroufi-review-comparison > strong,
.rtl .masroufi-budget-row-head strong,
.rtl .masroufi-stats-card .is-increase,
.rtl .masroufi-stats-card .is-decrease,
.rtl .masroufi-stats-card .is-stable {
    direction: ltr;
    unicode-bidi: isolate;
}
.rtl .masroufi-month-comparison > strong,
.rtl .masroufi-review-comparison > strong { text-align: right; }

/* Formulaire d'ajout */
.rtl .masroufi-amount-input input { padding-right: 14px !important; padding-left: 55px !important; }
.rtl .masroufi-amount-input > span { right: auto; left: 15px; }
.rtl .masroufi-expense-form .masroufi-field small { margin-left: 0; margin-right: 5px; }
.rtl .masroufi-submit-arrow { display: inline-block; transform: scaleX(-1); }

/* Sélecteur de catégorie */
.rtl .masroufi-category-trigger,
.rtl .masroufi-category-option { text-align: right; }
.rtl .masroufi-category-chevron { margin-left: 0; margin-right: auto; }

/* Historique */
.rtl .masroufi-expense-item-amount { text-align: left; }
.rtl .masroufi-history.masroufi-is-loading::after { content: "⟳  جارٍ تحميل المصاريف..."; }

/* Statistiques */
.rtl .masroufi-stats-necessity-meta strong { text-align: left; }
.rtl .masroufi-statistics.masroufi-stats-is-loading::after { content: 'جارٍ تحديث الإحصائيات…'; }

/* Budget : les montants restent alignés comme des nombres */
.rtl .masroufi-budget-input input { text-align: left; }

/* Raccourcis */
.rtl .masroufi-quick-delete { right: auto; left: 12px; }

/* Navigation flottante (ordinateur) */
.rtl .masroufi-floating-nav { right: auto; left: 24px; }

/* Visiteurs non connectés */
.rtl .masroufi-guest-points { text-align: right; }
.rtl .masroufi-guest-points li { padding-left: 0; padding-right: 28px; }
.rtl .masroufi-guest-points li::before { left: auto; right: 0; }

/* Installation de l'application */
.rtl .masroufi-pwa-help { text-align: right; }
.rtl .masroufi-pwa-close { right: auto; left: 14px; }

/* Mon compte (Ultimate Member) */
.rtl form .um-account-side .um-account-meta .um-account-name { text-align: right; }
.rtl form .um-account-side .um-account-meta .um-account-profile-link:before { content: 'مرحبًا بك في فضائك الشخصي'; }
