/*
   Phase 10 i18n LTR layer.
   This file is intentionally scoped to html[dir="ltr"] so the Arabic RTL UI
   keeps using the existing CSS unchanged.
*/

html[dir="ltr"] {
    direction: ltr;
    --system-font-family: system-ui, "Segoe UI", Tahoma, Arial, sans-serif !important;
}

html[dir="ltr"] body {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] [dir="rtl"] {
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] :where(input, textarea, select, button, table, th, td, label, a, span, p, div, strong, small, h1, h2, h3, h4, h5, h6) {
    letter-spacing: 0;
}

html[dir="ltr"] :where(input, textarea, select) {
    text-align: left;
}

html[dir="ltr"] :where(.util-display-inline-dir-ltr-00c8, .util-dir-ltr-text-left-15b6, .util-dir-ltr-text-left-51b3, .util-text-prewrap-dir-ltr-text-left-pad-6e28, .util-text-prewrap-dir-ltr-text-left-pad-9146, .util-text-prewrap-dir-ltr-pad-rounded-aa1c, .bulk-id, .audit-hash, .audit-bulk, code, pre, .checksum) {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] .util-utility-ccc8 {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .dashboard {
    padding: 0 0 0 var(--erp-shell-sidebar-width) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .dashboard {
    padding-right: 0 !important;
    padding-left: var(--erp-shell-sidebar-collapsed) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info {
    inset-inline-start: 0 !important;
    inset-inline-end: auto !important;
    left: 0 !important;
    right: auto !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .main-form {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic :where(.main-topbar, .msar-breadcrumb-bar, .module-switcher-wrap, .module-switcher, .msar-user-strip, .brand-inline, .action-bar, .actions, .table-actions, .employee-footer-bottom-nav, .bottom-nav, .employee-mobile-nav) {
    direction: ltr !important;
}

html[dir="ltr"] body.msar-shell.msar-classic :where(.section-title, .msar-section-title, .module-page-title, .msar-breadcrumb, .field label, th, td, .cell, .meta-cell, .analytics-label, .analytics-value, .analytics-sub, .task-label, .task-value, .task-sub) {
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .main-topbar {
    grid-template-columns: 56px minmax(0, 1fr) minmax(210px, 280px) !important;
    grid-template-areas: "title modules user" !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-page-title {
    justify-content: flex-start !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-page-title .admin-sidebar-toggle {
    margin-inline: 10px 0 !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-user-strip {
    justify-content: flex-end !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-switcher-wrap {
    justify-content: flex-start !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-breadcrumb-bar {
    flex-direction: row !important;
    justify-content: space-between !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-breadcrumb {
    order: 1 !important;
    justify-content: flex-start !important;
    direction: ltr !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-date {
    order: 2 !important;
    justify-content: flex-end !important;
    direction: ltr !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .main-form :where(.card, .ui-card, .app-card, .mini-card, .analytics-card, .ui-page-header) {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic :where(.section-title, .msar-section-title) {
    border-right: 0 !important;
    border-left: 4px solid var(--brand-blue, #1988d8) !important;
    padding-right: 0 !important;
    padding-left: 12px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .main-form :where(.section-title, .msar-section-title, .card > h1:first-child, .card > h2:first-child, .card > h3:first-child, .ui-card > h1:first-child, .ui-card > h2:first-child, .ui-card > h3:first-child) {
    direction: ltr !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .main-form :where(.section-title, .msar-section-title, .card > h1:first-child, .card > h2:first-child, .card > h3:first-child, .ui-card > h1:first-child, .ui-card > h2:first-child, .ui-card > h3:first-child)::before {
    right: auto !important;
    left: 0 !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .main-form :where(.section-title, .msar-section-title, .card > h1:first-child, .card > h2:first-child, .card > h3:first-child, .ui-card > h1:first-child, .ui-card > h2:first-child, .ui-card > h3:first-child)::after {
    right: 0 !important;
    left: 42px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info :where(.sidebar-nav a, .module-sidebar-group-title, .module-sidebar-nav a) {
    direction: ltr;
    text-align: left !important;
    border-right-color: transparent !important;
    border-left-color: transparent !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info :where(.sidebar-nav a.active, .sidebar-nav a:hover, .sidebar-nav a:focus-visible, .module-sidebar-group.is-open > .module-sidebar-group-title, .module-sidebar-nav a.active, .module-sidebar-nav a:hover, .module-sidebar-nav a:focus-visible) {
    border-right-color: transparent !important;
    border-left-color: var(--brand-blue, #1988d8) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info .sidebar-nav a .nav-icon {
    right: auto !important;
    left: 4px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav {
    --sidebar-dot-rail-x: 15px;
    --sidebar-dot-offset-x: -16.5px;
    --sidebar-dot-offset-x-active: -18px;
    --sidebar-icon-right: auto;
    --sidebar-item-padding-right: 0;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav::before {
    right: auto !important;
    left: var(--sidebar-dot-rail-x, 15px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a::before,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a:has(.nav-icon)::before {
    right: auto !important;
    left: var(--sidebar-dot-offset-x, -16.5px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a:hover .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a:focus-visible .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a.active .nav-icon {
    right: auto !important;
    left: var(--sidebar-dot-offset-x, -16.5px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a:hover:has(.nav-icon)::before,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a:focus-visible:has(.nav-icon)::before,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a.active:has(.nav-icon)::before,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a:hover .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a:focus-visible .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a.active .nav-icon {
    right: auto !important;
    left: var(--sidebar-dot-offset-x-active, -18px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-nav a .nav-text,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .sidebar-nav a .nav-text,
html[dir="ltr"] body.msar-shell.msar-classic .side-info .module-sidebar-group-title .msar-section-text {
    text-align: left;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-switcher {
    gap: 8px !important;
    padding-inline: 12px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-tab {
    flex: 0 0 126px !important;
    width: 126px !important;
    min-width: 126px !important;
    padding-inline: 6px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-tab .msar-module-text {
    max-width: 118px !important;
    min-height: 30px !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    text-align: center !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-sidebar-group-title {
    grid-template-columns: 34px minmax(0, 1fr) 22px !important;
    gap: 8px !important;
    min-height: 42px !important;
    padding-block: 7px !important;
    padding-inline: 10px 8px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-sidebar-group-title .msar-section-icon {
    grid-column: 1 !important;
    justify-self: center !important;
    margin: 0 !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-sidebar-group-title .msar-section-text {
    grid-column: 2 !important;
    justify-self: start !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-sidebar-group-title .msar-section-chevron {
    grid-column: 3 !important;
    justify-self: center !important;
    margin: 0 !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-sidebar-group-title .msar-section-text {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.28 !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .module-sidebar-group.is-collapsed > .module-sidebar-group-title .msar-section-chevron,
html[dir="ltr"] body.msar-shell.msar-classic .module-sidebar-group.msar-collapsed > .module-sidebar-group-title .msar-section-chevron {
    transform: rotate(-90deg) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .side-info {
    overflow: visible !important;
}

html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .side-info .msar-sidebar-scroll {
    overflow-x: hidden !important;
}

html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .module-sidebar-group-title {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    min-height: 42px !important;
    margin-inline: auto !important;
    padding: 0 !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    text-align: center !important;
}

html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .module-sidebar-group-title .msar-section-icon {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    grid-column: 1 !important;
    color: color-mix(in srgb, var(--brand-cyan, #42d9f4) 76%, var(--white, #fff) 24%) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .module-sidebar-group-title .msar-section-icon :where(i, svg, .msar-fa-svg) {
    width: 17px !important;
    min-width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    font-size: 17px !important;
    line-height: 1 !important;
}

html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .module-sidebar-group-title .msar-section-text,
html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .module-sidebar-group-title .msar-section-chevron,
html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .side-info .sidebar-nav a .nav-text,
html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .side-info .module-sidebar-nav,
html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .side-info .module-sidebar-group > .sidebar-nav {
    display: none !important;
    visibility: hidden !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-sidebar-floating-flyout {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-sidebar-flyout-list a {
    justify-content: flex-start !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-user-menu-trigger .notification-badge {
    right: auto !important;
    left: 28px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-user-menu-panel {
    left: auto !important;
    right: 0 !important;
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-user-menu-panel a {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-icon-primary {
    margin-left: 0 !important;
    margin-right: 6px !important;
}

html[dir="ltr"] .analytics-card::after {
    right: auto !important;
    left: 0 !important;
    border-radius: 12px 0 0 12px;
}

html[dir="ltr"] :where(.ats-event, .scorecard, .offer-event) {
    border-right: 0 !important;
    border-left: 3px solid var(--brand-blue, #1988d8) !important;
    padding-right: 0 !important;
    padding-left: 12px !important;
}

html[dir="ltr"] :where(.table-wrap, .bulk-table-wrap, .audit-table-wrap) {
    direction: ltr;
}

html[dir="ltr"] body.auth-page :where(.auth-shell, .auth-side-info, .auth-panel, .auth-card, .track-list, .section-head) {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] body.auth-page .brand-inline {
    justify-content: flex-start;
}

html[dir="ltr"] body.auth-page .track-list {
    padding-left: 18px;
    padding-right: 0;
}

@media (max-width: 980px) {
    html[dir="ltr"] body.msar-shell.msar-classic .dashboard,
    html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .dashboard {
        padding-right: 0 !important;
        padding-left: var(--erp-shell-sidebar-collapsed) !important;
    }

    html[dir="ltr"] body.msar-shell.msar-classic .side-info,
    html[dir="ltr"] body.msar-shell.msar-classic.admin-sidebar-collapsed .side-info {
        left: 0 !important;
        right: auto !important;
    }
}

@media print {
    html[dir="ltr"] body.msar-shell.msar-classic .dashboard {
        padding: 0 !important;
    }
}

/* Override direction: rtl !important from shell.css for elements not covered by :where() rules */
html[dir="ltr"] body.msar-shell.msar-classic .module-page-title {
    direction: ltr !important;
}

html[dir="ltr"] body.msar-shell.msar-classic .msar-user-strip .msar-user-name {
    direction: ltr !important;
}

/* Admin sidebar mirror in English: keep the bar itself on the left, but mirror
   every control inside it so icons/rails start from the left and chevrons open
   toward the right. These selectors intentionally match the stronger sidebar
   polish rules loaded before this file. */
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info > .msar-sidebar-scroll > .brand-inline {
    direction: ltr !important;
    text-align: left !important;
    justify-content: flex-start !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .brand-title,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .brand-subtitle,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .msar-sidebar-module-title,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .msar-sidebar-module-desc {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group-title {
    direction: ltr !important;
    grid-template-columns: 30px minmax(0, 1fr) 24px !important;
    padding-inline: 10px 8px !important;
    border-right: 0 !important;
    border-left: 4px solid transparent !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group.is-open > .module-sidebar-group-title,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group.has-active > .module-sidebar-group-title,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group-title:hover,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group-title:focus-visible {
    border-right: 0 !important;
    border-left-color: var(--brand-blue, #1988d8) !important;
    padding-right: 8px !important;
    padding-left: 8px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group-title .msar-section-icon {
    grid-column: 1 !important;
    justify-self: center !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group-title .msar-section-text {
    grid-column: 2 !important;
    justify-self: stretch !important;
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group-title .msar-section-chevron {
    grid-column: 3 !important;
    justify-self: center !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group.is-collapsed > .module-sidebar-group-title .msar-section-chevron,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group.msar-collapsed > .module-sidebar-group-title .msar-section-chevron {
    transform: rotate(-90deg) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group.is-open > .module-sidebar-group-title .msar-section-chevron:not(.no-rotate),
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .module-sidebar-group:not(.is-collapsed):not(.msar-collapsed) > .module-sidebar-group-title .msar-section-chevron {
    transform: rotate(0deg) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .sidebar-nav a,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a:hover,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a:focus-visible,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a.active {
    direction: ltr !important;
    text-align: left !important;
    padding: 0 8px 0 var(--sidebar-item-padding-left, 32px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .sidebar-nav a .nav-text,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a .nav-text {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav {
    --sidebar-icon-right: auto;
    --sidebar-icon-left: 4px;
    --sidebar-rail-x: 21px;
    --sidebar-item-padding-right: 0;
    --sidebar-item-padding-left: 32px;
    padding: 4px 8px 8px 8px !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav::before {
    right: auto !important;
    left: var(--sidebar-rail-x, 21px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav::after {
    right: auto !important;
    left: calc(var(--sidebar-rail-x, 21px) - 1px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a:hover .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a:focus-visible .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .module-sidebar-nav a.active .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .sidebar-nav a .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .sidebar-nav a:hover .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .sidebar-nav a:focus-visible .nav-icon,
html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell) .side-info .sidebar-nav a.active .nav-icon {
    right: auto !important;
    left: var(--sidebar-icon-left, 4px) !important;
}

html[dir="ltr"] body.msar-shell.msar-classic:not(.employee-portal-shell).admin-sidebar-collapsed .module-sidebar-group-title {
    border-left: 0 !important;
    padding: 0 !important;
}
