/* Spark Agency HR — Arabic, right to left (v50). Only applies when Arabic is chosen. */
html[dir="rtl"] body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
}
html[dir="rtl"] :is(input, select, textarea, button) {
  font-family: inherit;
}
/* Sidebar on the right */
html[dir="rtl"] body > aside {
  inset: 0 0 0 auto;
  border-left: 0;
}
html[dir="rtl"] body > main {
  margin-left: 0;
  margin-right: 235px;
  transition: margin-right 0.25s ease;
}
html[dir="rtl"] body.sidebar-collapsed > aside {
  transform: translateX(102%);
}
html[dir="rtl"] body.sidebar-collapsed > main,
html[dir="rtl"] body.auth-mode > main {
  margin-right: 0;
}
html[dir="rtl"] body.employee-mode > main {
  margin-right: auto !important;
  margin-left: auto !important;
}
html[dir="rtl"] #sidebar-toggle {
  margin-right: 0;
  margin-left: 16px;
}
html[dir="rtl"] main > header > div {
  margin-right: 0;
  margin-left: auto;
}
html[dir="rtl"] body.employee-mode main > header::before {
  margin-right: 0;
  margin-left: 14px;
}
html[dir="rtl"] .workspace-nav button,
html[dir="rtl"] aside button,
html[dir="rtl"] .quick-action-grid button {
  text-align: right;
}
html[dir="rtl"] .workspace-nav button.active {
  box-shadow: inset -3px 0 #00a6a8;
}
html[dir="rtl"] .quick-action-grid button {
  padding: 19px 17px 19px 36px;
}
html[dir="rtl"] .quick-action-grid b {
  right: auto;
  left: 15px;
  transform: scaleX(-1);
}
html[dir="rtl"] :is(td, th) {
  text-align: right;
}
html[dir="rtl"] #auth button.login-toggle {
  margin-left: 0;
  margin-right: auto;
}
html[dir="rtl"] .office-card > .toolbar > div {
  margin-right: 0;
  margin-left: auto;
}
/* Numbers, usernames, emails and phone numbers keep left-to-right order */
html[dir="rtl"] :is(input[type="email"], input[type="tel"], input[type="number"], input[name="username"], input[name="iban"], input[type="password"]) {
  direction: ltr;
  text-align: right;
}
html[dir="rtl"] small,
html[dir="rtl"] .nav-caption,
html[dir="rtl"] aside p,
html[dir="rtl"] th {
  letter-spacing: 0;
}
@media (max-width: 900px) {
  html[dir="rtl"] body > main,
  html[dir="rtl"] body.sidebar-collapsed > main {
    margin-right: 0;
  }
  html[dir="rtl"] body:not(.sidebar-collapsed) > aside {
    box-shadow: -16px 0 40px #0f2a3640;
  }
}
@media print {
  html[dir="rtl"] body > main {
    margin: 0;
  }
}

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #e3ecec;
  color: #24505a;
  border-radius: 999px;
  padding: 8px 14px 8px 11px;
  font-size: 13px;
  font-weight: 650;
  margin-inline-end: 10px;
  transition: background 0.15s, transform 0.15s;
}
.lang-switch:hover {
  background: #d4e7e6;
  transform: translateY(-1px);
}
.lang-switch svg {
  flex: none;
}
.lang-switch span {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}
#auth .lang-switch.lang-auth {
  width: auto;
  margin: 0 0 14px auto;
  padding: 7px 13px 7px 10px;
  display: flex;
  background: #eef5f5;
  color: #24505a;
}
html[dir="rtl"] #auth .lang-switch.lang-auth {
  margin: 0 auto 14px 0;
}
/* A subtitle in the other language is not needed when one language is chosen */
html[data-lang] small[lang="ar"],
html[data-lang] span[lang="ar"].dup,
html[data-lang] .bi-ar {
  display: none;
}
@media print {
  .lang-switch {
    display: none !important;
  }
}
html[data-lang] .set-ar,
html[data-lang] :is(.mr-own, .lh-report) > header p[lang="ar"] {
  display: none;
}
html[data-lang="ar"] .hol-text h2,
html[data-lang="en"] .hol-text .hol-ar,
html[data-lang="en"] .hol-name span[lang="ar"] {
  display: none;
}
html[dir="rtl"] .fun-mic {
  right: auto;
  left: 22px;
}

/* Phone header: title on the first line, buttons on the second */
@media screen and (max-width: 480px) {
  body:not(.auth-mode) > main > header {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  body:not(.auth-mode) > main > header > div:not(.me-chip) {
    flex: 1 1 calc(100% - 90px);
    order: 0;
  }
  body:not(.auth-mode) > main > header > #sidebar-toggle {
    order: -1;
  }
  body:not(.auth-mode) > main > header > :not(div:not(.me-chip)):not(#sidebar-toggle) {
    order: 1;
  }
  body > main > header .lang-switch {
    padding: 8px 10px;
    margin-inline-end: 0;
  }
  body > main > header .lang-switch span {
    display: none;
  }
  body > main > header #logout {
    margin-inline-start: auto;
  }
}
@media screen and (max-width: 700px) {
  html[dir="rtl"] .stat-icon {
    right: auto;
    left: 10px;
  }
  html[dir="rtl"] .stat-title {
    padding-right: 0;
  }
  html[dir="rtl"] .stat-text {
    padding-left: 40px;
    min-width: 0;
  }
}
html[dir="rtl"] .gl-kpi-icon {
  right: auto;
  left: 16px;
}
html[dir="rtl"] .gl-kpi-title {
  padding-right: 0;
  padding-left: 52px;
}
html[dir="rtl"] .workspace-nav button::after {
  right: auto;
  left: 12px;
}
html[dir="rtl"] #ib-toasts {
  right: auto;
  left: 18px;
}
html[dir="rtl"] .lh-tv-close {
  right: auto;
  left: 14px;
}
@media screen and (max-width: 480px) {
  body > main > header .branch-chip svg {
    display: none;
  }
  body > main > header .branch-chip {
    padding-inline: 8px;
  }
  body:not(.auth-mode) > main > header {
    column-gap: 6px;
  }
}
/* v53.1 — note for a phone that shows the desktop version */
.desktop-note { position: fixed; z-index: 9999; left: 24px; right: 24px; top: 24px; display: grid; gap: 6px; padding: 22px 60px 22px 24px; border-radius: 22px; background: #10262f; color: #fff; font-size: 30px; line-height: 1.35; box-shadow: 0 20px 60px #0007; }
.desktop-note span { color: #cfe7e6; }
.desktop-note button { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: #ffffff1f; color: #fff; font-size: 28px; box-shadow: none; }
html[dir="rtl"] .desktop-note { padding: 22px 24px 22px 60px; }
html[dir="rtl"] .desktop-note button { right: auto; left: 16px; }
@media screen and (max-width: 480px) {
  body.employee-mode > main > header #heading { white-space: normal; overflow: visible; text-overflow: clip; font-size: 26px; line-height: 1.15; }
}
/* the A4 sheet scales from its top-left corner: keep its box left-to-right (the sheet has its own direction) */
html[dir="rtl"] .sp-preview { direction: ltr; }
