/* Shared language control. Arabic defaults are preserved. */
.alocate-language{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid var(--line,#dce4ec);border-radius:10px;background:var(--surface,#fff);color:var(--text,#25364a);font-size:12px;white-space:nowrap}
.alocate-language select{width:auto!important;max-width:98px!important;margin:0!important;padding:4px 5px!important;border:0!important;background:transparent!important;color:inherit!important;min-height:28px;cursor:pointer;font-size:13px}
.alocate-language select option{color:#172b46;background:#fff}
.alocate-language:focus-within{outline:2px solid #91a7bd;outline-offset:1px}
html[dir="ltr"] .sidebar{left:0;right:auto;border-left:0;border-right:1px solid #2a4568;box-shadow:9px 0 32px rgba(15,23,42,.11)}
html[dir="ltr"] .nav-item.active{box-shadow:inset 3px 0 #647e98}
html[dir="ltr"] .topbar,html[dir="ltr"] .content,html[dir="ltr"] .main-area{direction:ltr}
html[dir="ltr"] .topbar-search input,html[dir="ltr"] input:not([type="tel"]),html[dir="ltr"] textarea{direction:ltr;text-align:left}
html[dir="ltr"] input[type="tel"],html[dir="ltr"] input[name*="phone"]{direction:ltr}
html[dir="ltr"] .data-table,html[dir="ltr"] .form-grid,html[dir="ltr"] .page-head{direction:ltr}
html[dir="ltr"] .topbar-actions{direction:ltr}
@media(max-width:1024px){html[dir="ltr"] .sidebar{left:0;right:auto}html[dir="ltr"] .mobile-backdrop{inset:0}}
@media(max-width:650px){.alocate-language{padding:2px 3px}.alocate-language select{max-width:75px!important;font-size:12px}}
/* Flip the structural offsets instead of only changing text alignment. */
@media(min-width:1025px){
 html[dir="ltr"] .main-area{margin-right:0;margin-left:var(--sidebar)}
 html[dir="ltr"] body.sidebar-collapsed .main-area{margin-right:0;margin-left:76px}
}
html[dir="ltr"] .side-collapse{margin-right:0;margin-left:auto}
html[dir="ltr"] .online-dot{margin-right:0;margin-left:auto}
html[dir="ltr"] .top-user{margin-right:0;padding-right:0;border-right:0;margin-left:4px;padding-left:9px;border-left:1px solid var(--line)}
html[dir="ltr"] .stat-card:before{right:auto;left:0}
html[dir="ltr"] .timeline{border-right:0;border-left:2px solid var(--line)}
html[dir="ltr"] .timeline li{padding:0 0 18px 22px;margin-right:0;margin-left:6px}
html[dir="ltr"] .timeline li:before{right:auto;left:-7px}
@media(max-width:1024px){
 html[dir="ltr"] .sidebar{transform:translateX(-105%)}
 html[dir="ltr"] .sidebar.open{transform:translateX(0)}
 html[dir="ltr"] .main-area,html[dir="ltr"] body.sidebar-collapsed .main-area{margin:0}
}

/* English customer tables: preserve natural reading order even when a legacy RTL rule is more specific. */
html[lang="en"] .table-wrap, html[lang="en"] .table-wrap table, html[lang="en"] .table-wrap thead, html[lang="en"] .table-wrap tbody, html[lang="en"] .table-wrap tr {direction:ltr}
html[lang="en"] .table-wrap th,html[lang="en"] .table-wrap td {text-align:left}
html[lang="en"] .field label,html[lang="en"] .card,html[lang="en"] .page-head {text-align:left}
html[lang="en"] .topbar-search input {text-align:left;direction:ltr}
html[lang="en"] .data-table .btn {white-space:nowrap}

/* Language-wide bidi layout: numeric and transaction identifiers stay readable. */
html[lang="en"] main,html[lang="en"] .content-inner,html[lang="en"] .card,html[lang="en"] .form-grid,html[lang="en"] .filters,html[lang="en"] .table-wrap{direction:ltr}
html[lang="en"] :is(th,td,label,legend,.form-label,.stat-card,.card-title,.page-title){text-align:left}
html[lang="en"] :is(input,select,textarea){direction:ltr}
html[lang="en"] :is([dir="rtl"] .table-wrap,[dir="rtl"] .form-grid){direction:ltr}
