/* CS Joele — force sidebar side by locale (theme RTL rules conflict). */

/* ——— Sidebar metismenu (hover + active) ——— */
.deznav .deznav-scroll {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
.deznav .metismenu .mm-collapse:not(.mm-show) {
  display: none;
}
.deznav .metismenu .mm-show {
  display: block;
}
[data-sidebar-style="full"][data-layout="vertical"] .deznav .metismenu > li:hover > a,
[data-sidebar-style="full"][data-layout="vertical"] .deznav .metismenu > li.mm-active > a {
  background: var(--primary) !important;
  color: #fff !important;
}
[data-sidebar-style="full"][data-layout="vertical"] .deznav .metismenu > li:hover > a i,
[data-sidebar-style="full"][data-layout="vertical"] .deznav .metismenu > li.mm-active > a i {
  color: #fff !important;
}
.deznav .metismenu ul a:hover,
.deznav .metismenu ul a.mm-active {
  color: var(--primary) !important;
}

html[dir="rtl"] .nav-header,
html.rtl .nav-header,
body[direction="rtl"] .nav-header {
  left: auto !important;
  right: 0 !important;
}

html[dir="rtl"] .deznav,
html.rtl .deznav,
body[direction="rtl"] .deznav,
html[dir="rtl"] .menu-toggle .deznav,
html[dir="rtl"] .menu-toggle .nav-header {
  left: auto !important;
  right: 0 !important;
}

html[dir="rtl"] .header,
body[direction="rtl"] .header {
  padding-left: 0 !important;
  padding-right: 18.563rem !important;
}

html[dir="rtl"] .content-body,
body[direction="rtl"] .content-body {
  margin-left: 0 !important;
  margin-right: 18.563rem !important;
}

@media only screen and (max-width: 1400px) {
  html[dir="rtl"] .header,
  body[direction="rtl"] .header {
    padding-right: 18rem !important;
  }
  html[dir="rtl"] .content-body,
  body[direction="rtl"] .content-body {
    margin-right: 18rem !important;
  }
}

@media (max-width: 767px) {
  html[dir="rtl"] .header,
  body[direction="rtl"] .header {
    padding-right: 5rem !important;
  }
  html[dir="rtl"] .content-body,
  body[direction="rtl"] .content-body {
    margin-right: 0 !important;
  }
}

html[dir="ltr"] .nav-header,
body[direction="ltr"] .nav-header {
  left: 0 !important;
  right: auto !important;
}

html[dir="ltr"] .deznav,
body[direction="ltr"] .deznav {
  left: 0 !important;
  right: auto !important;
}

html[dir="ltr"] .header,
body[direction="ltr"] .header {
  padding-right: 0 !important;
  padding-left: 18.563rem !important;
}

html[dir="ltr"] .content-body,
body[direction="ltr"] .content-body {
  margin-right: 0 !important;
  margin-left: 18.563rem !important;
}

@media only screen and (max-width: 1400px) {
  html[dir="ltr"] .header,
  body[direction="ltr"] .header {
    padding-left: 18rem !important;
  }
  html[dir="ltr"] .content-body,
  body[direction="ltr"] .content-body {
    margin-left: 18rem !important;
  }
}

@media (max-width: 767px) {
  html[dir="ltr"] .header,
  body[direction="ltr"] .header {
    padding-left: 5rem !important;
  }
  html[dir="ltr"] .content-body,
  body[direction="ltr"] .content-body {
    margin-left: 0 !important;
  }
}

html[dir="rtl"] .cs-updates-panel {
  right: auto;
  left: 0;
}

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

html[dir="rtl"] body {
  font-family: "Thmanyah Sans", "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Bootstrap LTR utilities — flip start/end in Arabic */
html[dir="rtl"] .me-auto {
  margin-right: 0 !important;
  margin-left: auto !important;
}
html[dir="rtl"] .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

html[dir="rtl"] .form-head,
html[dir="rtl"] .hrm-page-heading {
  text-align: right;
}
html[dir="ltr"] .form-head,
html[dir="ltr"] .hrm-page-heading {
  text-align: left;
}

/* Language toggle — same circular control as notifications / dark mode */
.locale-switcher.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 55px;
  width: 55px;
  padding: 0;
  color: #3e4954;
  background: transparent;
  border: 1px solid rgba(62, 73, 84, 0.1);
  border-radius: 2rem;
  text-decoration: none !important;
  line-height: 1;
}

.header-right .notification_dropdown .nav-link.locale-switcher {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

@media only screen and (max-width: 1199px) {
  .locale-switcher.nav-link {
    height: 40px;
    width: 40px;
  }
}

.locale-switcher__glyph {
  display: block;
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.locale-switcher__glyph.is-ar {
  font-family: "Thmanyah Sans", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 1.45rem;
}

.locale-switcher__glyph.is-en {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

@media only screen and (max-width: 1199px) {
  .locale-switcher__glyph.is-ar {
    font-size: 1.15rem;
  }
  .locale-switcher__glyph.is-en {
    font-size: 0.72rem;
  }
}

[data-theme-version="dark"] .locale-switcher.nav-link {
  color: var(--cs-text, #e2e8f0);
}

/* Table row actions — square icons, rectangular text (Settings → Lookups) */
.tbl-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tbl-btn-icon {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  line-height: 1;
}

.tbl-btn-icon i {
  margin: 0 !important;
  font-size: 0.82rem;
  line-height: 1;
}

.tbl-btn-text {
  min-height: 2rem;
  padding: 0.2rem 0.7rem !important;
  border-radius: 0.4rem;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.tbl-btn-text i {
  margin-inline-end: 0.35rem;
}

/* Leave Balance promo in the sidebar — whole card is the hit target (RTL-safe) */
a.plus-box.plus-box--link {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
a.plus-box.plus-box--link:hover,
a.plus-box.plus-box--link:focus {
  color: #fff;
}
.plus-box:after {
  pointer-events: none;
}
.plus-box__arrow {
  display: inline-block;
  font-size: 1.625rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}
html[dir="rtl"] .plus-box:after {
  right: auto;
  left: 0;
  transform: scaleX(-1);
}
html[dir="rtl"] .plus-box__arrow {
  transform: scaleX(-1);
}

/* Unified table toolbar — filters / search / export, separate from the card title */
.tbl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tbl-card-head .card-title {
  margin-bottom: 0;
}
.tbl-card-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.tbl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border, #eee);
  background: #f7f8fa;
}
.tbl-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.tbl-filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.tbl-filter-pills .btn {
  border-radius: 2rem;
  font-weight: 600;
  padding: 0.28rem 0.85rem;
}
.tbl-toolbar__search {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 320px;
}
.tbl-toolbar__search .tbl-search,
.tbl-toolbar__search .input-group {
  width: 100%;
}
.tbl-toolbar__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}
.tbl-pagination {
  width: 100%;
}
.tbl-pagination-summary {
  unicode-bidi: isolate;
}
.tbl-pagination-summary bdi {
  unicode-bidi: isolate;
  direction: ltr;
}
html[dir="rtl"] .tbl-pagination .pagination li:first-child .page-link,
html[dir="rtl"] .tbl-pagination .pagination li:last-child .page-link {
  transform: scaleX(-1);
}
.table-attendance-daily {
  min-width: 1400px;
}

/* Theme tables are LTR + nowrap + uppercase headers — keep them readable in Arabic */
html[dir="rtl"] .table thead th {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
html[dir="rtl"] .table th,
html[dir="rtl"] .table td {
  text-align: start;
}
html[dir="rtl"] .table .text-end {
  text-align: start !important;
}
html[dir="rtl"] .table .num,
html[dir="rtl"] .table td.num,
html[dir="rtl"] .table th.num {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
html[dir="rtl"] .cs-chart-host {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Toolbar / table dropdowns — open toward the right in Arabic */
html[dir="rtl"] .tbl-toolbar .dropdown-menu,
html[dir="rtl"] .tbl-card-head .dropdown-menu,
html[dir="rtl"] .card-body .dropdown-menu,
html[dir="rtl"] .tbl-actions .dropdown-menu {
  right: 0 !important;
  left: auto !important;
}

html[dir="rtl"] .tbl-toolbar .dropdown-menu[data-bs-popper],
html[dir="rtl"] .tbl-card-head .dropdown-menu[data-bs-popper],
html[dir="rtl"] .card-body .dropdown-menu[data-bs-popper] {
  right: 0 !important;
  left: auto !important;
  transform: none !important;
}

/* Dropdown text + caret — readable in Arabic (no LTR float overlap) */
html[dir="rtl"] .dropdown-menu {
  text-align: start;
}
html[dir="rtl"] .dropdown-item {
  text-align: start;
}
html[dir="rtl"] .dropdown-toggle::after {
  margin-left: 0;
  margin-right: 0.255em;
}

/*
 * Checkbox menus (types filter, columns, etc.):
 * Bootstrap .form-check-input floats left and overlaps Arabic labels.
 */
.cs-check-menu > label,
.dropdown-menu > label:has(> input[type="checkbox"]),
.dropdown-menu .form-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  padding-left: 0;
  padding-right: 0;
  cursor: pointer;
  white-space: nowrap;
  text-align: start;
}
.cs-check-menu > label:last-child,
.dropdown-menu > label:has(> input[type="checkbox"]):last-child,
.dropdown-menu .form-check:last-child {
  margin-bottom: 0;
}
.cs-check-menu label,
.dropdown-menu label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  text-align: start;
}
.cs-check-menu .form-check-input,
.dropdown-menu label > input[type="checkbox"].form-check-input,
.dropdown-menu .form-check .form-check-input {
  float: none !important;
  margin: 0 !important;
  position: static;
  flex: 0 0 auto;
}
html[dir="rtl"] .form-check {
  padding-left: 0;
  padding-right: 1.5em;
}
html[dir="rtl"] .form-check .form-check-input {
  float: right;
  margin-left: 0;
  margin-right: -1.5em;
}
/* Flex check rows already reset float — keep that override stronger */
html[dir="rtl"] .cs-check-menu .form-check-input,
html[dir="rtl"] .dropdown-menu label > input[type="checkbox"].form-check-input,
html[dir="rtl"] .dropdown-menu .d-flex .form-check-input {
  float: none !important;
  margin: 0 !important;
}

/* Auth login — RTL-safe card, logical corners, isolated bidi text */
.authincation {
  background:
    radial-gradient(1200px 560px at 80% -8%, rgba(61, 150, 98, 0.14), transparent 52%),
    radial-gradient(720px 380px at 8% 108%, rgba(61, 150, 98, 0.08), transparent 48%),
    #f3f6f4;
}
html[dir="rtl"] .authincation {
  background:
    radial-gradient(1200px 560px at 20% -8%, rgba(61, 150, 98, 0.14), transparent 52%),
    radial-gradient(720px 380px at 92% 108%, rgba(61, 150, 98, 0.08), transparent 48%),
    #f3f6f4;
}
.authincation-content {
  border-radius: 1.15rem;
  box-shadow: 0 18px 48px rgba(45, 80, 58, 0.09);
  overflow: visible;
}
html[dir="rtl"] .auth-form,
body[direction="rtl"] .auth-form {
  direction: rtl;
}
html[dir="rtl"] .auth-field__label,
html[dir="rtl"] .auth-field__hint,
body[direction="rtl"] .auth-field__label,
body[direction="rtl"] .auth-field__hint {
  direction: rtl;
  text-align: right !important;
}
.auth-form {
  position: relative;
}
.auth-form--login {
  padding: 50px;
}
@media (max-width: 575px) {
  .auth-form--login {
    padding: 30px;
  }
}
.auth-form__lang {
  position: absolute;
  top: 0.9rem;
  z-index: 2;
}
html[dir="rtl"] .auth-form__lang,
body[direction="rtl"] .auth-form__lang {
  left: 0.9rem;
  right: auto;
}
html[dir="ltr"] .auth-form__lang,
body[direction="ltr"] .auth-form__lang {
  right: 0.9rem;
  left: auto;
}
.auth-form__lang .locale-switcher.nav-link {
  height: 36px;
  width: 36px;
  background: #f4f6f5;
  border-color: rgba(62, 73, 84, 0.12);
}
.auth-form__lang .locale-switcher__glyph.is-ar {
  font-size: 1.15rem;
}
.auth-form__lang .locale-switcher__glyph.is-en {
  font-size: 0.72rem;
}
.auth-form__brand {
  text-align: center;
  margin-bottom: 1.35rem;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}
.auth-brand:hover {
  text-decoration: none;
}
.auth-form__title {
  margin: 0 0 1.75rem;
  text-align: center !important;
  font-size: 1.25rem;
  font-weight: 800;
  color: #2c3a33;
  line-height: 1.5;
}
.auth-field {
  margin-bottom: 1.4rem;
}
.auth-field__label {
  display: block;
  text-align: start;
  margin-bottom: 0.45rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: #3e4954;
}
.auth-field__input.form-control {
  height: 52px;
  border-radius: 0.7rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding-inline: 0.95rem;
  unicode-bidi: isolate;
}
.auth-field__input--otp {
  letter-spacing: 0.42em;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  text-align: center !important;
}
html[dir="rtl"] .auth-field__input.form-control {
  text-align: right;
}
html[dir="ltr"] .auth-field__input.form-control {
  text-align: left;
}
.auth-field__input.form-control:focus {
  border-color: #3d9662;
  box-shadow: 0 0 0 3px rgba(61, 150, 98, 0.16);
}
.auth-field__hint {
  margin: 0.7rem 0 0;
  text-align: start;
  unicode-bidi: isolate;
  line-height: 1.85;
  font-size: 0.9rem;
  color: #5f6b66;
}
html[dir="rtl"] .auth-field__hint {
  direction: rtl;
}
html[dir="ltr"] .auth-field__hint {
  direction: ltr;
}
.auth-submit {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 0.7rem;
  font-size: 1rem;
}
.auth-submit i,
.auth-submit .spinner-border {
  flex-shrink: 0;
}
.auth-meta {
  margin: 0.7rem 0 0;
  text-align: center;
  unicode-bidi: isolate;
  font-size: 0.82rem;
  color: #6a7570;
  line-height: 1.7;
}
.auth-meta bdi {
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;
  margin-inline: 0.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.auth-form__link {
  display: block;
  text-align: center;
  margin-top: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.auth-footer {
  margin: 1.15rem 0 0;
  text-align: center !important;
  unicode-bidi: isolate;
  font-size: 0.78rem;
  color: #7a8680;
  line-height: 1.7;
}
.auth-footer__year,
.auth-footer__name {
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;
}
.auth-footer__name {
  color: #3d9662;
  font-weight: 700;
  text-decoration: none;
}
.auth-footer__name:hover {
  text-decoration: underline;
}
[data-theme-version="dark"] .authincation,
[data-theme-version="dark"] html[dir="rtl"] .authincation {
  background: var(--cs-bg, #101614);
}
[data-theme-version="dark"] .auth-form__title,
[data-theme-version="dark"] .auth-field__label {
  color: var(--cs-text-strong, #e8eee9);
}
[data-theme-version="dark"] .auth-field__hint,
[data-theme-version="dark"] .auth-meta,
[data-theme-version="dark"] .auth-footer {
  color: var(--cs-muted, #9aa8a0);
}
[data-theme-version="dark"] .auth-form__lang .locale-switcher.nav-link {
  background: rgba(255, 255, 255, 0.04);
}

/* Dark mode — this file loads last, so toolbar/thead must be overridden here */
[data-theme-version="dark"] .tbl-toolbar {
  background: var(--cs-elevated, #1d2622);
  border-bottom-color: var(--cs-border, #2e3c36);
}
[data-theme-version="dark"] .table thead,
[data-theme-version="dark"] table.dataTable thead {
  background-color: var(--cs-elevated, #1d2622);
}
[data-theme-version="dark"] .table thead th,
[data-theme-version="dark"] .table thead td,
[data-theme-version="dark"] table.dataTable thead th,
[data-theme-version="dark"] table.dataTable thead td {
  color: var(--cs-muted, #96a89e) !important;
  background-color: var(--cs-elevated, #1d2622) !important;
  border-color: var(--cs-border, #2e3c36) !important;
}
[data-theme-version="dark"] .tbl-toolbar .btn-outline-secondary,
[data-theme-version="dark"] .tbl-toolbar .btn-outline-dark,
[data-theme-version="dark"] .tbl-card-head .btn-outline-secondary {
  background-color: var(--cs-elevated, #1d2622);
  border-color: var(--cs-border, #2e3c36);
  color: var(--cs-text, #dce8e1);
}
[data-theme-version="dark"] .tbl-toolbar .btn-outline-secondary:hover,
[data-theme-version="dark"] .tbl-toolbar .btn-outline-secondary:focus,
[data-theme-version="dark"] .tbl-toolbar .btn-outline-secondary.show,
[data-theme-version="dark"] .tbl-toolbar .show > .btn-outline-secondary.dropdown-toggle,
[data-theme-version="dark"] .tbl-card-head .btn-outline-secondary:hover {
  background-color: var(--cs-hover, #24302b);
  border-color: var(--cs-border-strong, #3d5248);
  color: var(--cs-text-strong, #f2f7f4);
}
[data-theme-version="dark"] .tbl-toolbar .dropdown-menu,
[data-theme-version="dark"] .tbl-card-head .dropdown-menu {
  background-color: var(--cs-elevated, #1d2622);
  border-color: var(--cs-border, #2e3c36);
  color: var(--cs-text, #dce8e1);
}
[data-theme-version="dark"] .tbl-toolbar .dropdown-item,
[data-theme-version="dark"] .tbl-card-head .dropdown-item {
  color: var(--cs-text, #dce8e1);
}
[data-theme-version="dark"] .tbl-toolbar .btn-outline-success,
[data-theme-version="dark"] .tbl-filter-pills .btn-outline-success {
  background-color: var(--cs-elevated, #1d2622);
  border-color: var(--cs-accent-strong, #3d9662);
  color: var(--cs-accent, #4caf74);
}
[data-theme-version="dark"] .tbl-toolbar .btn-outline-danger {
  background-color: var(--cs-elevated, #1d2622);
  border-color: rgba(229, 115, 115, 0.55);
  color: var(--cs-danger, #e57373);
}
[data-theme-version="dark"] .tbl-filter-pills .btn-outline-secondary {
  background-color: var(--cs-elevated, #1d2622);
  border-color: var(--cs-border, #2e3c36);
  color: var(--cs-text, #dce8e1);
}
[data-theme-version="dark"] .text-dark {
  color: var(--cs-text-strong, #f2f7f4) !important;
}


/* Team evaluation scorecard + agent breakdown (RTL) */
html[dir="rtl"] .team-eval-scorecard th,
html[dir="rtl"] .team-eval-agent,
html[dir="rtl"] .team-eval-dropdown,
html[dir="rtl"] .team-eval-formula,
html[dir="rtl"] .team-eval-dropdown__card-head,
html[dir="rtl"] .team-eval-dropdown__metric span,
html[dir="rtl"] .team-eval-dropdown__kpi span {
  text-align: start;
}
html[dir="rtl"] .team-eval-scorecard th.num,
html[dir="rtl"] .team-eval-scorecard td.num {
  text-align: end !important;
}
html[dir="rtl"] .cs-month-picker__label,
html[dir="rtl"] .cs-month-picker__option {
  text-align: start;
}
