/* Urdu (right-to-left) layer — loaded only when Urdu is selected, after Bootstrap RTL and app.css. */
:root {
  --ur-font: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Alvi Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", Tahoma, serif;
  --ur-num-font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --bs-body-font-family: var(--ur-font);
  --bs-body-line-height: 2;
}
html[dir="rtl"] body { font-family: var(--ur-font); line-height: 2; word-spacing: .05em; }
/* Nastaliq has tall ascenders/descenders: give controls room so letters are not clipped. */
html[dir="rtl"] .form-control, html[dir="rtl"] .form-select, html[dir="rtl"] .btn, html[dir="rtl"] .dropdown-item,
html[dir="rtl"] .nav-link, html[dir="rtl"] .badge, html[dir="rtl"] .alert, html[dir="rtl"] .form-check-label { line-height: 1.95; }
html[dir="rtl"] .form-control, html[dir="rtl"] .form-select { padding-top: .3rem; padding-bottom: .3rem; }
html[dir="rtl"] .badge { padding-top: .2em; padding-bottom: .35em; font-weight: 600; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] .page-title { line-height: 1.9; font-weight: 700; }
html[dir="rtl"] .table > :not(caption) > * > * { padding-top: .45rem; padding-bottom: .45rem; }
/* Uppercase and letter-spacing break joined Urdu letters. */
html[dir="rtl"] .nav-group, html[dir="rtl"] .table > thead th, html[dir="rtl"] .kpi .label, html[dir="rtl"] .section-title,
html[dir="rtl"] .lh-doc, html[dir="rtl"] th { text-transform: none !important; letter-spacing: 0 !important; }
html[dir="rtl"] .nav-group { font-size: .78rem; }
html[dir="rtl"] .table > thead th { font-size: .8rem; }

/* Numbers, amounts, codes, phone numbers stay left-to-right and in a clear numeric face. */
html[dir="rtl"] .num, html[dir="rtl"] .kpi .value, html[dir="rtl"] input[type="number"], html[dir="rtl"] input[inputmode="decimal"],
html[dir="rtl"] input[inputmode="numeric"], html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="date"], html[dir="rtl"] input[type="month"],
html[dir="rtl"] .ltr, html[dir="rtl"] .pos-tile .t-price, html[dir="rtl"] code { font-family: var(--ur-num-font); }
html[dir="rtl"] .num, html[dir="rtl"] td.num, html[dir="rtl"] th.num { text-align: left; direction: ltr; unicode-bidi: plaintext; }
html[dir="rtl"] th.num { direction: rtl; }
html[dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }

/* Layout pieces written for left-to-right in app.css */
@media (min-width: 992px) { html[dir="rtl"] .app { background: linear-gradient(to left, var(--rms-side) 236px, transparent 236px); } }
@media (max-width: 991.98px) {
  html[dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
  html[dir="rtl"] body.nav-open .sidebar { transform: none; }
}
html[dir="rtl"] .pos-tile { text-align: right; }
html[dir="rtl"] .bi { display: inline-block; }
html[dir="rtl"] .bi-arrow-left::before, html[dir="rtl"] .bi-chevron-left::before, html[dir="rtl"] .bi-arrow-right::before, html[dir="rtl"] .bi-chevron-right::before,
html[dir="rtl"] .bi-box-arrow-right::before, html[dir="rtl"] .bi-send-fill::before, html[dir="rtl"] .bi-send::before, html[dir="rtl"] .bi-reply::before { transform: scaleX(-1); }
html[dir="rtl"] .toast-container.end-0 { right: auto !important; left: 0 !important; }
html[dir="rtl"] .ur-word, .ur-word { font-family: var(--ur-font); }

/* Printed documents (A4 and thermal) */
html[dir="rtl"] body[class^="paper-"], html[dir="rtl"] body[class*=" paper-"] { font-family: var(--ur-font); line-height: 1.85; }
html[dir="rtl"] body[class*="paper-"] th, html[dir="rtl"] body[class*="paper-"] td { text-align: right; }
html[dir="rtl"] body[class*="paper-"] .num { text-align: left; }
html[dir="rtl"] body[class*="paper-"] .center { text-align: center; }
html[dir="rtl"] .totals { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .lh-docsub { text-align: left; }
html[dir="rtl"] .qr-a4 { float: left; margin: 0 12px 8px 0; }
html[dir="rtl"] .rpt-section h3 { border-left: 0; border-right: 3px solid #111; }
html[dir="rtl"] .tb-switch { margin-left: 0; margin-right: 14px; }
html[dir="rtl"] .meta div span { min-width: 120px; }
html[dir="rtl"] .paper-thermal .sheet { font-size: 12.5px; }
html[dir="rtl"] .paper-thermal.w58 .sheet { font-size: 11px; }

/* Public pages (ordering, menu, tracking, chat) share these */
html[dir="rtl"] .pub { font-family: var(--ur-font); line-height: 1.9; }
