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

/* Arabic → sidebar on the RIGHT */
html[dir="rtl"] .nav-header,
body[direction="rtl"] .nav-header {
  left: auto !important;
  right: 0 !important;
}

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

/* Overlay: closed off-screen, open on toggle — must beat the pin above */
body[direction="rtl"][data-sidebar-style="overlay"] .deznav,
html[dir="rtl"] body[data-sidebar-style="overlay"] .deznav {
  left: auto !important;
  right: -110% !important;
}
body[direction="rtl"][data-sidebar-style="overlay"] .menu-toggle .deznav,
html[dir="rtl"] body[data-sidebar-style="overlay"] .menu-toggle .deznav {
  right: 0 !important;
}
body[direction="ltr"][data-sidebar-style="overlay"] .deznav,
html[dir="ltr"] body[data-sidebar-style="overlay"] .deznav {
  right: auto !important;
  left: -110% !important;
}
body[direction="ltr"][data-sidebar-style="overlay"] .menu-toggle .deznav,
html[dir="ltr"] body[data-sidebar-style="overlay"] .menu-toggle .deznav {
  left: 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;
  }
}

/* English → sidebar on the LEFT */
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;
  }
}

/* ——— Mobile shell: overlay drawer, header, content consistency ——— */
.cs-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: rgba(15, 23, 20, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
body[data-sidebar-style="overlay"] #main-wrapper.menu-toggle .cs-sidebar-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (max-width: 767.98px) {
  #main-wrapper.menu-toggle .cs-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}
body.cs-nav-open {
  overflow: hidden;
  touch-action: none;
}
body[data-sidebar-style="overlay"] .nav-header,
body[data-sidebar-style="overlay"] .deznav {
  z-index: 6;
}
body[data-sidebar-style="overlay"] .deznav {
  pointer-events: none;
}
body[data-sidebar-style="overlay"] #main-wrapper.menu-toggle .deznav {
  pointer-events: auto;
}
[data-theme-version="dark"] .cs-sidebar-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 767.98px) {
  /* Safety net: always treat mobile as a drawer, even before JS sets overlay */
  body[direction="rtl"] .deznav,
  html[dir="rtl"] .deznav {
    left: auto !important;
    right: -110% !important;
  }
  body[direction="rtl"] .menu-toggle .deznav,
  html[dir="rtl"] .menu-toggle .deznav {
    right: 0 !important;
  }
  body[direction="ltr"] .deznav,
  html[dir="ltr"] .deznav {
    right: auto !important;
    left: -110% !important;
  }
  body[direction="ltr"] .menu-toggle .deznav,
  html[dir="ltr"] .menu-toggle .deznav {
    left: 0 !important;
  }

  .deznav {
    width: min(17.5rem, 82vw) !important;
    max-width: 300px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
    pointer-events: none;
  }
  #main-wrapper.menu-toggle .deznav {
    pointer-events: auto;
  }
  #main-wrapper.menu-toggle .nav-header {
    width: min(17.5rem, 82vw) !important;
    max-width: 300px;
  }
  #main-wrapper.menu-toggle .nav-header .brand-logo {
    justify-content: flex-start !important;
    padding-inline: 1rem !important;
  }
  #main-wrapper.menu-toggle .nav-header .brand-title {
    display: inline-block !important;
    margin-inline-start: 0.65rem;
    font-size: 0.92rem;
    max-width: 9.5rem;
  }

  body[data-sidebar-style="overlay"] .deznav {
    width: min(17.5rem, 82vw) !important;
    max-width: 300px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
  }
  body[data-sidebar-style="overlay"] #main-wrapper.menu-toggle .nav-header {
    width: min(17.5rem, 82vw) !important;
    max-width: 300px;
  }
  body[data-sidebar-style="overlay"] #main-wrapper.menu-toggle .nav-header .brand-logo {
    justify-content: flex-start !important;
    padding-inline: 1rem !important;
  }
  body[data-sidebar-style="overlay"] #main-wrapper.menu-toggle .nav-header .brand-title {
    display: inline-block !important;
    margin-inline-start: 0.65rem;
    font-size: 0.92rem;
    max-width: 9.5rem;
  }
  /* Hamburger sits just outside the logo strip */
  body[data-sidebar-style="overlay"] .nav-control {
    right: -2.6rem !important;
    left: auto !important;
  }
  body[direction="rtl"][data-sidebar-style="overlay"] .nav-control,
  html[dir="rtl"] body[data-sidebar-style="overlay"] .nav-control {
    right: auto !important;
    left: -2.6rem !important;
  }
  body[data-sidebar-style="overlay"] .header .header-content {
    padding-inline-start: 2.75rem !important;
  }

  /* Even menu rhythm */
  body[data-sidebar-style="overlay"] .deznav .metismenu {
    padding-top: 0.5rem;
    padding-inline: 0 !important;
  }
  body[data-sidebar-style="overlay"] .deznav .metismenu > li {
    padding-inline: 0.65rem !important;
    margin-bottom: 0.15rem;
  }
  body[data-sidebar-style="overlay"] .deznav .metismenu > li > a {
    display: flex !important;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem !important;
    border-radius: 0.85rem;
    font-size: 0.92rem !important;
    font-weight: 600;
    line-height: 1.25;
  }
  body[data-sidebar-style="overlay"] .deznav .metismenu > li > a i {
    margin: 0 !important;
    padding: 0 !important;
    width: 1.35rem;
    text-align: center;
    flex-shrink: 0;
    font-size: 1.1rem !important;
  }
  body[data-sidebar-style="overlay"] .deznav .metismenu > li > a .nav-text {
    flex: 1;
    min-width: 0;
  }
  html[dir="rtl"] body[data-sidebar-style="overlay"] .deznav .metismenu .has-arrow:after,
  body[direction="rtl"][data-sidebar-style="overlay"] .deznav .metismenu .has-arrow:after {
    left: 0.9rem !important;
    right: auto !important;
  }
  html[dir="ltr"] body[data-sidebar-style="overlay"] .deznav .metismenu .has-arrow:after,
  body[direction="ltr"][data-sidebar-style="overlay"] .deznav .metismenu .has-arrow:after {
    right: 0.9rem !important;
    left: auto !important;
  }
  body[data-sidebar-style="overlay"] .deznav .metismenu ul a {
    padding-block: 0.45rem !important;
    padding-inline: 2.4rem 0.85rem !important;
    font-size: 0.86rem !important;
    border-radius: 0.55rem;
  }
  html[dir="rtl"] body[data-sidebar-style="overlay"] .deznav .metismenu ul a,
  body[direction="rtl"][data-sidebar-style="overlay"] .deznav .metismenu ul a {
    padding-inline: 0.85rem 2.4rem !important;
  }

  /* Compact inbox promo + copyright */
  .plus-box {
    margin: 0.75rem 0.85rem 0.65rem !important;
    padding: 0.85rem 1rem !important;
    border-radius: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
  }
  .plus-box:after {
    opacity: 0.35;
    height: 64px;
    width: 68px;
    background-size: contain;
  }
  .plus-box p.fs-16 {
    font-size: 0.82rem !important;
    margin-bottom: 0 !important;
    width: 100%;
  }
  .plus-box p.fs-24 {
    font-size: 1.35rem !important;
    margin: 0 !important;
    line-height: 1.1;
  }
  .plus-box > a {
    font-size: 1.25rem !important;
    line-height: 1;
  }
  .deznav .copyright {
    padding: 0 0.85rem 1.25rem !important;
    margin-bottom: 0.5rem !important;
  }
  .deznav .copyright p {
    margin-bottom: 0.25rem !important;
    font-size: 0.7rem !important;
  }

  /* Header rhythm */
  .header .header-content {
    padding-inline: 0.65rem !important;
  }
  .header-right {
    gap: 0.35rem;
    align-items: center;
  }
  .header-right > li:not(:first-child) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .header-live-clock-item {
    display: none !important;
  }
  .header-right .header-profile > a.nav-link {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  .header-right .header-profile > a.nav-link > img,
  .header-right .header-profile > a.nav-link > .header-profile-avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    min-height: 34px;
  }
  .header-right .notification_dropdown .nav-link {
    height: 34px !important;
    width: 34px !important;
  }
  .locale-switcher.nav-link {
    height: 34px !important;
    width: 34px !important;
  }

  /* Page content — reduce desktop padding / overflow */
  .content-body {
    overflow-x: hidden;
  }
  .content-body .container-fluid,
  .content-body .container-sm,
  .content-body .container-md,
  .content-body .container-lg,
  .content-body .container-xl,
  .content-body .container-xxl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-top: 1rem !important;
  }
  .card {
    border-radius: 0.85rem;
  }
  .card-header {
    padding: 0.85rem 1rem;
  }
  .card-body {
    padding: 0.95rem 1rem;
  }
  .tbl-toolbar {
    padding: 0.65rem 0.85rem;
    gap: 0.45rem;
  }
  .tbl-toolbar__search {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
  .tbl-card-head {
    gap: 0.65rem;
  }
  .form-head {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .btn {
    white-space: normal;
  }
}

@media (max-width: 575.98px) {
  body[data-sidebar-style="overlay"] .deznav,
  body[data-sidebar-style="overlay"] #main-wrapper.menu-toggle .nav-header {
    width: min(16.5rem, 86vw) !important;
  }
  .content-body .container-fluid,
  .content-body .container-sm,
  .content-body .container-md,
  .content-body .container-lg,
  .content-body .container-xl,
  .content-body .container-xxl {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }
}


/* Touch polish: OTP method pills */
@media (max-width: 575.98px) {
  .auth-method-tabs .btn,
  .otp-method-tabs .btn,
  .login-method-tabs .btn,
  .authincation .btn-group .btn {
    min-height: 44px;
  }
  .authincation .btn-primary,
  .authincation button[type="submit"] {
    min-height: 48px;
  }
}

