/* Shared navigation fixes; do not change menu permissions or its open/close logic. */
html:root body #layout-menu {
  overflow: hidden !important;
  border-inline-end: 1px solid var(--ui-border);
}
html:root body #layout-menu .app-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  height: 80px;
  min-height: 80px;
  padding: 12px 16px;
  background: var(--ui-sidebar-bg) !important;
  border-bottom: 1px solid rgba(175, 194, 202, .14);
}
html:root body #layout-menu .app-brand-link { min-width: 0; flex: 1; justify-content: flex-start !important; }
html:root body #layout-menu .app-brand > .layout-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  padding: 0;
  margin: 0 !important;
  color: #dce8eb !important;
  background: rgba(175, 194, 202, .08) !important;
  border: 1px solid rgba(175, 194, 202, .2) !important;
  border-radius: 8px;
}
html:root body #layout-menu .menu-inner-shadow,
html:root body #layout-menu > .menu-divider { display: none !important; }
.istiqdam-company-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 12px;
  background: #e8f2f2;
  color: #125c60;
}
.istiqdam-company-mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.istiqdam-company-mark [hidden] { display: none !important; }
.istiqdam-company-initial { font-size: 20px; font-weight: 700; line-height: 1; }
html:root body #layout-menu .company-brand-sub { color: #afc2ca; font-size: 12px; }
html:root body #layout-menu .app-brand-text { color: #edf5f6; white-space: normal; line-height: 1.6; }
html.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-expanded) body #layout-menu .app-brand {
  padding-inline: 10px;
  justify-content: center;
}
html.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-expanded) body #layout-menu .app-brand-link { flex: 0 0 auto; }
html.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-expanded) body #layout-menu .app-brand > .layout-menu-toggle,
html.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-expanded) body #layout-menu .app-brand .company-brand-copy { display: none !important; }

/* Keep scrollbar geometry stable; only the thumb becomes visible during scrolling. */
html:root, html:root body #layout-menu .menu-inner {
  scrollbar-width: thin !important;
  scrollbar-color: transparent transparent !important;
}
html:root.is-page-scrolling { scrollbar-color: var(--ui-border-strong) transparent !important; }
html:root body #layout-menu.is-menu-scrolling .menu-inner {
  scrollbar-color: rgba(175, 194, 202, .5) transparent !important;
}
html:root body #layout-menu .menu-inner.ps { scrollbar-width: none !important; }
html:root::-webkit-scrollbar,
html:root body #layout-menu .menu-inner::-webkit-scrollbar { width: 5px !important; height: 5px !important; }
html:root::-webkit-scrollbar-track,
html:root body #layout-menu .menu-inner::-webkit-scrollbar-track { background: transparent !important; }
html:root::-webkit-scrollbar-thumb,
html:root body #layout-menu .menu-inner::-webkit-scrollbar-thumb {
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px;
}
html:root.is-page-scrolling::-webkit-scrollbar-thumb { background: var(--ui-border-strong) !important; }
html:root body #layout-menu.is-menu-scrolling .menu-inner::-webkit-scrollbar-thumb { background: rgba(175, 194, 202, .5) !important; }
html:root body #layout-menu .ps--active-y > .ps__rail-y,
html:root body #layout-menu:hover .ps--active-y > .ps__rail-y {
  width: 6px !important;
  opacity: 0 !important;
  background: transparent !important;
  pointer-events: none;
  transition: opacity 180ms ease;
}
html:root body #layout-menu.is-menu-scrolling .ps--active-y > .ps__rail-y,
html:root body #layout-menu .ps--active-y.ps--scrolling-y > .ps__rail-y {
  opacity: 1 !important;
  pointer-events: auto;
}
html:root body #layout-menu .ps--active-y > .ps__rail-y > .ps__thumb-y,
html:root body #layout-menu .ps--active-y > .ps__rail-y:is(:hover, :focus, .ps--clicking) > .ps__thumb-y {
  width: 3px !important;
  background: rgba(175, 194, 202, .5) !important;
  border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  html:root body #layout-menu .ps__rail-y { transition: none !important; }
}
