/* Complements Bootstrap RTL + Dreamguys theme for Arabic (Noto Kufi Arabic loaded in layout). */

html[dir="rtl"] body {
  font-family: "Noto Kufi Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html[dir="rtl"] .header .header-left {
  float: right;
}

html[dir="rtl"] .header .nav.user-menu {
  float: left;
}

html[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

html[dir="rtl"] .page-wrapper {
  margin-left: 0 !important;
  margin-right: 236px;
}

html[dir="rtl"] body.mini-sidebar .page-wrapper {
  margin-right: 80px;
}

/*
 * Theme pins .menu-arrow to physical `right`, which stacks it over the icon when the
 * sidebar is RTL (icon sits on the inline-start / visual right). Keep chevron in flow:
 * icon → label → arrow (arrow at inline-end / visual left).
 */
html[dir="rtl"] .sidebar .sidebar-menu > ul > li > a {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

html[dir="rtl"] .sidebar .sidebar-menu > ul > li > a > span:not(.menu-arrow) {
  margin-left: 0 !important;
  margin-inline-start: 10px;
  flex: 1;
  min-width: 0;
}

html[dir="rtl"] .sidebar .sidebar-menu > ul > li > a .menu-arrow {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  line-height: 1 !important;
  flex-shrink: 0;
  margin-inline-start: auto;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: none;
}

html[dir="rtl"] .sidebar .sidebar-menu > ul > li > a.subdrop .menu-arrow {
  transform: rotate(90deg);
}

html[dir="rtl"] .sidebar .sidebar-menu > ul > li > a .menu-arrow::before {
  display: inline-block;
  transform: scaleX(-1);
}

html[dir="rtl"] .dropdown-menu-end {
  left: 0 !important;
  right: auto !important;
}

html[dir="rtl"] .me-2 {
  margin-right: 0 !important;
  margin-left: 0.5rem !important;
}

html[dir="rtl"] .me-3 {
  margin-right: 0 !important;
  margin-left: 1rem !important;
}

html[dir="rtl"] .ms-0 {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[dir="rtl"] .text-start {
  text-align: right !important;
}

html[dir="rtl"] .text-end {
  text-align: left !important;
}

/* Slimscroll bar: theme uses position right */
html[dir="rtl"] .slimScrollBar {
  left: 1px !important;
  right: auto !important;
}

/* Auth (login / register): mirror icon positions + language toggle */
.auth-lang-switch .auth-lang-flag {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

html[dir="rtl"] .login-wrapper .login-content .form-login .form-addons img {
  right: auto !important;
  left: 20px;
}

html[dir="rtl"] .login-wrapper .login-content .toggle-password,
html[dir="rtl"] .login-wrapper .login-content .toggle-passwords {
  right: auto !important;
  left: 10px;
}

html[dir="rtl"] .login-wrapper .login-content .login-userheading {
  text-align: right;
}

html[dir="rtl"] .login-wrapper .login-content .form-login label {
  text-align: right;
  display: block;
}

html[dir="rtl"] .login-wrapper .login-content .form-login .alreadyuser h4 {
  text-align: right;
}

html[dir="rtl"] .login-wrapper .login-content .form-sociallink ul li a img.me-2 {
  margin-right: 0 !important;
  margin-left: 0.5rem !important;
}
