/* V59 — Professional collapsible navigation drawer */
:root{--v59-sidebar-w:260px}

/* Retire the ambiguous legacy three-dot menu; V59 has a dedicated Menu control. */
.v38-sidebar-menu-wrap,.topbar>.icon.mobile{display:none!important}

/* Always keep the real navigation internally scrollable so every option is reachable. */
.sidebar{
  width:var(--v59-sidebar-w)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  padding-bottom:92px!important;
  transition:transform .22s ease,box-shadow .22s ease!important;
}
#nav{min-height:max-content!important}
.sidefoot{margin-bottom:10px!important}

/* Clear, persistent show/hide control in the app header. */
.v59-sidebar-toggle{
  display:inline-flex!important;align-items:center;justify-content:center;gap:8px;
  flex:0 0 auto;min-height:40px!important;padding:8px 11px!important;
  border:1px solid #d8e4e9!important;border-radius:11px!important;
  background:#fff!important;color:#173e56!important;
  box-shadow:0 3px 12px rgba(18,55,78,.06)!important;
  font-size:11px!important;font-weight:850!important;line-height:1!important;
  white-space:nowrap;cursor:pointer;z-index:30
}
.v59-sidebar-toggle:hover{background:#f7fafb!important;border-color:#c8d8df!important}
.v59-sidebar-toggle .v59-menu-icon{font-size:17px;line-height:1;display:inline-flex;align-items:center}
.v59-sidebar-toggle .v59-menu-text{font-size:10.5px;font-weight:850}

/* Desktop: fully collapse the blue rail and let the workspace use the whole screen. */
@media(min-width:781px){
  body.lang-ar.v59-sidebar-collapsed .sidebar{transform:translateX(105%)!important;box-shadow:none!important}
  body.lang-en.v59-sidebar-collapsed .sidebar{transform:translateX(-105%)!important;box-shadow:none!important}
  body.v59-sidebar-collapsed .main,
  body.lang-ar.v59-sidebar-collapsed .main,
  body.lang-en.v59-sidebar-collapsed .main{
    margin-left:0!important;margin-right:0!important;width:100%!important;max-width:100%!important
  }
  body.lang-ar:not(.v59-sidebar-collapsed) .main{margin-right:var(--v59-sidebar-w)!important;margin-left:0!important;width:calc(100% - var(--v59-sidebar-w))!important;max-width:calc(100% - var(--v59-sidebar-w))!important}
  body.lang-en:not(.v59-sidebar-collapsed) .main{margin-left:var(--v59-sidebar-w)!important;margin-right:0!important;width:calc(100% - var(--v59-sidebar-w))!important;max-width:calc(100% - var(--v59-sidebar-w))!important}
}

/* Mobile/tablet: use the same button as a drawer control. */
@media(max-width:780px){
  .sidebar{width:min(88vw,310px)!important;padding-bottom:96px!important}
  body.lang-ar .sidebar{right:0!important;left:auto!important;transform:translateX(105%)!important}
  body.lang-en .sidebar{left:0!important;right:auto!important;transform:translateX(-105%)!important}
  .sidebar.open{transform:none!important;box-shadow:0 18px 55px rgba(7,34,53,.28)!important}
  .v59-sidebar-toggle{min-height:38px!important;padding:7px 9px!important}
  .v59-sidebar-toggle .v59-menu-text{display:none}
  .v59-sidebar-toggle .v59-menu-icon{font-size:19px}
  #mobileSidebarBackdrop:not([hidden]){display:block!important;position:fixed!important;inset:0!important;z-index:35!important;background:rgba(8,30,45,.35)!important;backdrop-filter:blur(2px)!important}
}

@media(max-width:1100px) and (min-width:781px){:root{--v59-sidebar-w:244px}}

@media print{.v59-sidebar-toggle{display:none!important}}
