/* ==========================================================================
   Market - right-to-left corrections
   The layout is written with logical properties (inset-inline, margin-inline,
   text-align: start/end) throughout, so this sheet only fixes what Bootstrap
   and a handful of unavoidably physical rules get wrong in Arabic.
   ========================================================================== */

body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Dubai", system-ui, sans-serif; }

/* Bootstrap utilities that hard-code a side. */
.dropdown-menu-end { --bs-position: start; right: auto; left: 0; }
.me-auto { margin-right: 0 !important; margin-left: auto !important; }
.ms-auto { margin-left: 0 !important; margin-right: auto !important; }
.text-end { text-align: left !important; }
.text-start { text-align: right !important; }

.input-group > :not(:first-child):not(.dropdown-menu) {
    border-top-left-radius: 12px; border-bottom-left-radius: 12px;
    border-top-right-radius: 0; border-bottom-right-radius: 0;
    margin-right: -1px; margin-left: 0;
}
.input-group > :first-child {
    border-top-right-radius: 12px; border-bottom-right-radius: 12px;
    border-top-left-radius: 0; border-bottom-left-radius: 0;
}

.form-check { padding-right: 1.5em; padding-left: 0; }
.form-check .form-check-input { float: right; margin-right: -1.5em; margin-left: 0; }

.btn-close { margin-right: auto; margin-left: 0; }

.alert { flex-direction: row; }

/* Radial accents on the stat tiles are mirrored so they bleed in from the
   trailing corner rather than across the value. */
.stat-card::after { inset-inline-end: auto; inset-inline-start: -18%; }

/* Numbers stay left-to-right even inside Arabic text, and so do the little
   quantity-plus-unit strings ("1.25 kg", "50 pcs") - left to the paragraph
   direction they read back to front. */
.num, .num-cell, .qty, .price, .total, .amount, .stat-value, .line-total,
.totals-grand .value, .tile-price, .r-price, .held-total, .value,
.tile-stock, .line-sub, .r-meta, .held-meta {
    direction: ltr;
    unicode-bidi: embed;
}

/* Those sub-labels still sit on the reading edge of their row. */
.line-sub, .held-meta { text-align: right; }
.tile-stock { text-align: right; }

/* Tables: numeric columns still hug the far edge of the row. */
.table .num { text-align: left; }

/* The sidebar slides in from the right on small screens. */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(calc(100% + 12px)); }
    .app-sidebar.open { transform: translateX(0); }
}
