/* v5.2.5a Admin Bar Compatibility Fix
   Surgical CSS-only layer. Scope: WordPress admin bar/dropdown must always remain above
   the NormaCloud ESG application shell when an administrator is logged in.
   No Registry, workflow, data, Access Center, report or layout logic changes. */

/* The WordPress admin bar and its dropdowns are never part of the ESG app shell. */
html body.admin-bar #wpadminbar,
html body.admin-bar #wpadminbar *,
html body.admin-bar #wpadminbar .ab-sub-wrapper,
html body.admin-bar #wpadminbar .ab-submenu,
html body.admin-bar #wpadminbar .menupop,
html body.admin-bar #wpadminbar .ab-top-menu,
html body.admin-bar #wpadminbar .ab-top-secondary{
  z-index:2147483647!important;
}

html body.admin-bar #wpadminbar{
  display:block!important;
  visibility:visible!important;
  position:fixed!important;
  top:0!important;
  left:0!important;
  right:0!important;
  overflow:visible!important;
}

html body.admin-bar #wpadminbar .ab-sub-wrapper{
  position:absolute!important;
  overflow:visible!important;
}

/* Keep the ESG app below WordPress admin menus. Some legacy gold layers used very high
   z-index/fixed full-app values; this layer neutralizes them only when admin-bar is present. */
html body.admin-bar .ldg40-root,
html body.admin-bar .ldg40-root.ldg42-gold,
html body.admin-bar .ldg40-root.ldg40-embedded.ldg42-gold,
html body.admin-bar .ldg40-root.ldg430-stabilized,
html body.admin-bar .ldg31f-root{
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  z-index:0!important;
  isolation:auto!important;
}

/* Application bars may remain sticky/operational, but must not create a stacking context
   above the WordPress toolbar dropdowns. */
html body.admin-bar .ldg40-root .ldg40-top,
html body.admin-bar .ldg40-root .ldg31f-top,
html body.admin-bar .ldg40-root .ldg40-hero,
html body.admin-bar .ldg40-root .ldg40-sidebar,
html body.admin-bar .ldg40-root .ldg40-layout,
html body.admin-bar .ldg40-root .ldg40-content,
html body.admin-bar .ldg40-root .ldg40-switch{
  z-index:auto!important;
}

html body.admin-bar .ldg40-root .ldg40-top,
html body.admin-bar .ldg31f-root .ldg31f-top{
  top:32px!important;
  z-index:10!important;
}

html body.admin-bar .ldg40-root .ldg40-sidebar,
html body.admin-bar .ldg31f-root .ldg31f-sidebar{
  z-index:5!important;
}

/* WordPress dropdowns must be clickable above any ESG shell surfaces. */
html body.admin-bar #wpadminbar .ab-sub-wrapper,
html body.admin-bar #wpadminbar .ab-submenu,
html body.admin-bar #wpadminbar .ab-item,
html body.admin-bar #wpadminbar a{
  pointer-events:auto!important;
}

@media screen and (max-width:782px){
  html body.admin-bar .ldg40-root .ldg40-top,
  html body.admin-bar .ldg31f-root .ldg31f-top{
    top:46px!important;
  }
}
