/* V44.9.16.15 — HEADER-REFERENCED NEUTRAL GLASS APPEARANCE
   Source: api (23) + patches v44.9.16.10 through v44.9.16.14.
   Audit: visually matching the computed translucent RGBA was not enough.
   The sidebar base under the footer is lighter than the base under the
   header, making the visible footer bluish. This version matches the
   NEUTRAL RENDERED color of the logo header (#0e1525 sampled from the
   user screenshot, where the header is not crossed by a blue active item).
   It retains real backdrop blur and natural menu-underlay behavior: no
   synthetic scroll-triggered blue halo. No header, JS, auth or menu edits.
*/

/* Keep the natural scroll-behind effect introduced in V44.9.16.11. */
#sidebar:not(.minimized) > ul.components {
  --kw-menu-reserved-bottom: 112px;
  bottom: 0 !important;
  padding-bottom: calc(var(--kw-menu-reserved-bottom) + 56px) !important;
  z-index: 1 !important;
}
@media (max-width: 1024px) {
  #sidebar:not(.minimized) > ul.components { --kw-menu-reserved-bottom: 105px; }
}
@media (max-width: 600px) {
  #sidebar:not(.minimized) > ul.components { --kw-menu-reserved-bottom: 100px; }
}
@media (max-height: 700px) {
  #sidebar:not(.minimized) > ul.components { --kw-menu-reserved-bottom: 91px; }
}
@media (max-height: 520px) {
  #sidebar:not(.minimized) > ul.components { --kw-menu-reserved-bottom: 80px; }
}

/* Mirror header geometry while compensating for the different underlying
   sidebar background at the bottom. Keep transparency and backdrop blur. */
#sidebar:not(.minimized) > .sidebar-user {
  position: absolute !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 112px !important;
  min-height: 112px !important;
  max-height: 112px !important;
  margin: 0 !important;
  padding: 16px 15px 14px !important;
  border: 0 !important;
  border-top: 1px solid rgba(203, 218, 239, .055) !important;
  border-radius: 0 !important;
  background: rgba(14, 21, 37, .86) !important;
  -webkit-backdrop-filter: blur(14px) saturate(135%) !important;
  backdrop-filter: blur(14px) saturate(135%) !important;
  box-shadow: 0 -10px 28px rgba(3,9,23,.23),
              inset 0 1px 0 rgba(255, 255, 255, .025) !important;
  background-clip: border-box !important;
  overflow: visible !important;
  contain: none !important;
  isolation: auto !important;
  z-index: 30 !important;
}
/* No separate white sheen: header relies only on its glass material. */
#sidebar:not(.minimized) > .sidebar-user::before,
#sidebar:not(.minimized) > .sidebar-user::after {
  content: none !important;
  display: none !important;
}
/* Keep the original footer contents' dimensions; don't re-style the header. */
#sidebar:not(.minimized) > .sidebar-user .sidebar-user-flex {
  margin-bottom: 7px !important;
  min-height: 34px !important;
  max-height: 34px !important;
}
#sidebar:not(.minimized) > .sidebar-user .btn-logout-modern {
  width: 100% !important;
  height: 35px !important;
  min-height: 35px !important;
  max-height: 35px !important;
}

/* Low-transparency preference uses a solid navy material consistently. */
@media (prefers-reduced-transparency: reduce) {
  #sidebar:not(.minimized) > .sidebar-user {
    background: #0e1525 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
/* Mobile sidebar can retain the .minimized class while expanded; mirror
   desktop full-width dock in that case, without changing desktop collapse. */
@media (max-width: 768px) {
  #sidebar.minimized > .sidebar-user {
    position: absolute !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 112px !important;
    min-height: 112px !important;
    max-height: 112px !important;
    margin: 0 !important;
    padding: 16px 15px 14px !important;
    border: 0 !important;
    border-top: 1px solid rgba(203, 218, 239, .055) !important;
    border-radius: 0 !important;
    background: rgba(14, 21, 37, .86) !important;
    -webkit-backdrop-filter: blur(14px) saturate(135%) !important;
    backdrop-filter: blur(14px) saturate(135%) !important;
    box-shadow: 0 -10px 28px rgba(3,9,23,.23), inset 0 1px 0 rgba(255, 255, 255, .025) !important;
    overflow: visible !important;
    contain: none !important;
    z-index: 30 !important;
  }
  #sidebar.minimized > .sidebar-user::before,
  #sidebar.minimized > .sidebar-user::after {
    content: none !important;
    display: none !important;
  }
  #sidebar.minimized > ul.components {
    bottom:0 !important;
    padding-bottom: 126px !important;
    z-index:1 !important;
  }
}
