/* ProcureHub — right-to-left (Arabic) adjustments.
   Loaded after styles.css only when the language is Arabic (<html dir="rtl">).
   Grid and flex layouts flip on their own; this file fixes everything that uses left/right. */

:root { --font: "IBM Plex Sans Arabic", "Geist", Tahoma, "Segoe UI", sans-serif; }
body { font-feature-settings: normal; }

/* Arabic letters must not be squeezed together */
h1, h2, h3, .page-head h1, .card-head h2, .kpi-value, .stage .s-count, .auth-art h1, .auth-box h2,
.product .price, .score { letter-spacing: 0 !important; }
.page-head h1 { line-height: 1.25; }
.auth-art h1 { line-height: 1.2; max-width: 16ch; }

/* Numbers, codes, emails and IBANs stay left-to-right inside Arabic text */
.num, .id-link, .kpi-value, .s-count, .s-val, .price, kbd, input[type="email"], input[type="tel"],
input[type="number"], .table .r { unicode-bidi: plaintext; }

/* ---------- App shell ---------- */
.sidebar { padding: 14px 14px 14px 0; }
.nav .count, .topbar-right, .flow-demo b { margin-left: 0; margin-right: auto; }
.nav a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--accent); }
.dot-badge { right: auto; left: 9px; }
.me form[style*="margin-left:auto"], .me a[style*="margin-left:auto"] { margin-left: 0 !important; margin-right: auto; }

/* Icons that point in a direction (arrows, chevrons) are mirrored */
.crumbs svg, [dir="rtl"] .flip, .btn svg.dir, .auth-box > a.row svg { transform: scaleX(-1); }

/* ---------- Tables and lists ---------- */
.table th { text-align: right; }
.table .r { text-align: left; }
.table th:first-child, .table td:first-child { padding-left: 16px; padding-right: 20px; }
.table th:last-child, .table td:last-child { padding-right: 16px; padding-left: 20px; }
.sum { margin-left: 0; margin-right: auto; }
.q-item, .subnav button { text-align: right; }
.legend i { margin-right: 0; margin-left: 6px; }
.stage + .stage::before { left: auto; right: 0; }

/* ---------- Forms ---------- */
.select { padding-right: 12px; padding-left: 36px; background-position: left 12px center; }
.switch::after { left: auto; right: 3px; }
.switch[aria-checked="true"]::after { transform: translateX(-18px); }
.range-row input { direction: ltr; }

/* ---------- Responsive sidebar slides in from the right ---------- */
@media (max-width: 900px) {
  .sidebar { inset: 0 0 0 auto; transform: translateX(105%); }
  .app.nav-open .sidebar { transform: none; }
}

/* ---------- Chat widget and assistant ---------- */
.cb-launcher { right: auto; left: 24px; padding: 0 16px 0 20px; }
.cb-panel { right: auto; left: 24px; }
.cb-bubble { border-radius: 16px 16px 4px 16px; }
.cb-msg.me .cb-bubble { border-radius: 16px 16px 16px 4px; }
.cb-src { padding-left: 0; padding-right: 4px; }
.cb-head { padding: 14px 16px 14px 14px; }

/* ---------- Toast stays centred ---------- */
.toast { direction: rtl; }
