/* Final shared-shell layer. It is intentionally loaded after page styles. */
:root {
  --zheli-sidebar-width: 210px;
  --zheli-sidebar-collapsed-width: 64px;
  --zheli-shell-height: 88px;
  --zheli-shell-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html:root body.app-shell::before {
  position: fixed;
  z-index: 6000;
  top: 0;
  right: 0;
  left: var(--zheli-sidebar-width);
  height: 2px;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  background: #1677ff;
  box-shadow: 0 0 8px rgba(22, 119, 255, .34);
  content: "";
  opacity: 0;
}

html:root body.sidebar-collapsed.app-shell::before { left: var(--zheli-sidebar-collapsed-width); }
html:root body.app-shell.app-navigation-started::before {
  opacity: 1;
  animation: zheli-navigation-progress 1.8s cubic-bezier(.2, .75, .25, 1) both;
}
html:root body.app-shell.app-navigation-waiting::before { box-shadow: 0 0 11px rgba(22, 119, 255, .5); }

@keyframes zheli-navigation-progress {
  0% { transform: scaleX(.035); }
  35% { transform: scaleX(.48); }
  100% { transform: scaleX(.82); }
}

html:root body.app-shell #mainSidebar,
html:root body.app-shell #mainSidebar a,
html:root body.app-shell #mainSidebar button,
html:root body.app-shell #mainSidebar .sidebar-brand span,
html:root body.app-shell > .app-header {
  font-family: var(--zheli-shell-font) !important;
}

html:root body.app-shell #mainSidebar {
  background: var(--app-panel-bg, #fff) !important;
  color: var(--app-content-text, #263442) !important;
  border-color: var(--app-content-border, #d9e1e8) !important;
  box-shadow: none !important;
}

html:root body.app-shell #mainSidebar .sidebar-brand {
  color: var(--app-content-text, #263442) !important;
  background: var(--app-panel-bg, #fff) !important;
}
html:root body.app-shell #mainSidebar .sidebar-brand .brand-logo {
  box-sizing: border-box !important;
  width: 31px !important;
  height: 31px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  object-fit: contain !important;
}
html:root body.app-shell #mainSidebar .sidebar-brand span {
  color: var(--app-content-text, #263442) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  line-height: 1.25 !important;
}

html:root body.app-shell > .app-header .zheli-page-heading { display: none; }

@media (min-width: 701px) {
  html:root body.app-shell.layout-style-integrated > .layout {
    display: grid !important;
    width: 100% !important;
    height: 100vh !important;
    min-height: 0 !important;
    grid-template-columns: var(--zheli-sidebar-width) minmax(0, 1fr) !important;
    overflow: hidden !important;
    background: var(--app-content-bg, #f3f6f9) !important;
  }

  html:root body.app-shell.layout-style-integrated > .app-header {
    position: fixed !important;
    z-index: 2050 !important;
    top: 0 !important;
    right: 0 !important;
    left: var(--zheli-sidebar-width) !important;
    display: grid !important;
    width: auto !important;
    height: var(--zheli-shell-height) !important;
    min-height: var(--zheli-shell-height) !important;
    padding: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 50px 38px !important;
    align-items: stretch !important;
    overflow: visible !important;
    border: 0 !important;
    border-bottom: 1px solid var(--app-content-border, #d9e1e8) !important;
    border-radius: 0 !important;
    background: var(--app-panel-bg, #fff) !important;
    color: var(--app-content-text, #263442) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  html:root body.app-shell.layout-style-integrated > .app-header .header-brand,
  html:root body.app-shell.layout-style-integrated > .app-header > .user { display: none !important; }
  html:root body.app-shell.layout-style-integrated > .app-header .integrated-page-title {
    display: flex !important;
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 18px !important;
    grid-row: 1 !important;
    align-items: center !important;
    border: 0 !important;
    border-bottom: 1px solid var(--app-content-border, #d9e1e8) !important;
    background: var(--app-panel-bg, #fff) !important;
    color: var(--app-content-text, #263442) !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .integrated-action-bar {
    display: flex !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    grid-row: 2 !important;
    align-items: center !important;
    border: 0 !important;
    border-bottom: 1px solid var(--app-content-border, #d9e1e8) !important;
    background: var(--app-panel-bg, #fff) !important;
    color: var(--app-content-text, #263442) !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-page-actions {
    display: flex !important;
    min-width: 0 !important;
    height: 34px !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 1 auto !important;
    overflow: hidden !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-page-actions[hidden] {
    display: none !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-page-actions > * {
    max-height: 34px !important;
    margin: 0 !important;
  }

  html:root body.app-shell.layout-style-integrated #mainSidebar {
    position: relative !important;
    z-index: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: flex !important;
    width: var(--zheli-sidebar-width) !important;
    height: 100vh !important;
    min-height: 0 !important;
    padding: 0 10px 10px !important;
    flex-direction: column !important;
    transform: none !important;
    overflow: hidden !important;
    border-right: 1px solid var(--app-content-border, #d9e1e8) !important;
  }
  html:root body.app-shell.layout-style-integrated #mainSidebar .sidebar-brand {
    display: flex !important;
    height: 50px !important;
    min-height: 50px !important;
    margin: 0 -10px 6px !important;
    padding: 0 14px !important;
    align-items: center !important;
    gap: 9px !important;
    flex: 0 0 50px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--app-content-border, #d9e1e8) !important;
  }
  html:root body.app-shell.layout-style-integrated #mainSidebar .menu-main {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  html:root body.app-shell.layout-style-integrated #mainSidebar .menu-main::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  html:root body.app-shell.layout-style-integrated #mainSidebar a,
  html:root body.app-shell.layout-style-integrated #mainSidebar .sidebar-nav-parent-row > a {
    display: grid !important;
    min-height: 40px !important;
    margin: 2px 0 !important;
    padding: 8px 10px !important;
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 9px !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: var(--app-content-text, #263442) !important;
    box-shadow: none !important;
    font-size: var(--app-nav-size, 14px) !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
  }
  html:root body.app-shell.layout-style-integrated #mainSidebar a:hover {
    border-color: transparent !important;
    background: #f3f7fb !important;
    color: #176fd0 !important;
  }
  html:root body.app-shell.layout-style-integrated #mainSidebar a.active,
  html:root body.app-shell.layout-style-integrated #mainSidebar .sidebar-nav-children > a.active {
    border-color: transparent !important;
    background: #e8f2ff !important;
    color: #1677ff !important;
    box-shadow: none !important;
    font-weight: 500 !important;
  }
  html:root body.app-shell.layout-style-integrated #mainSidebar a.active::after { content: none !important; }

  html:root body.app-shell.layout-style-integrated > .layout > main {
    width: 100% !important;
    height: calc(100vh - var(--zheli-shell-height)) !important;
    min-height: 0 !important;
    margin: var(--zheli-shell-height) 0 0 !important;
    padding: 16px 24px 20px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--app-content-bg, #f3f6f9) !important;
    color: var(--app-content-text, #263442) !important;
    box-shadow: none !important;
    font-family: var(--zheli-shell-font) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
  }
  html:root body.app-shell.layout-style-integrated .inventory-page > .inventory-module-menu {
    top: var(--zheli-shell-height) !important;
    height: calc(100vh - var(--zheli-shell-height)) !important;
  }

  html:root body.sidebar-collapsed.app-shell.layout-style-integrated > .layout {
    grid-template-columns: var(--zheli-sidebar-collapsed-width) minmax(0, 1fr) !important;
  }
  html:root body.sidebar-collapsed.app-shell.layout-style-integrated > .app-header {
    left: var(--zheli-sidebar-collapsed-width) !important;
  }
  html:root body.sidebar-collapsed.app-shell.layout-style-integrated #mainSidebar {
    width: var(--zheli-sidebar-collapsed-width) !important;
    padding-right: 7px !important;
    padding-left: 7px !important;
  }
  html:root body.sidebar-collapsed.app-shell.layout-style-integrated #mainSidebar .sidebar-brand {
    margin-right: -7px !important;
    margin-left: -7px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  html:root body.sidebar-collapsed.app-shell.layout-style-integrated #mainSidebar .sidebar-brand .brand-logo {
    width: 31px !important;
    height: 31px !important;
  }
}

@media (min-width: 701px) {
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-current-page {
    gap: 9px !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-current-page svg {
    width: 17px !important;
    height: 17px !important;
    flex-basis: 17px !important;
    stroke-width: 1.8 !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-current-page strong {
    font-size: 14px !important;
    font-weight: 600 !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-actions {
    gap: 3px !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-account > summary img,
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-account > summary > span {
    width: 26px !important;
    height: 26px !important;
    flex-basis: 26px !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .topbar-account > summary strong {
    font-size: 13px !important;
    font-weight: 500 !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .zheli-page-heading {
    display: none !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .zheli-page-heading-copy {
    min-width: 0 !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .zheli-page-heading h1 {
    margin: 0 !important;
    color: var(--app-content-text, #263442) !important;
    font-family: var(--zheli-shell-font) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 1.45 !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .zheli-page-heading p {
    margin: 3px 0 0 !important;
    overflow: hidden !important;
    color: var(--app-content-muted, #71808d) !important;
    font-family: var(--zheli-shell-font) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.45 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .zheli-page-heading-actions {
    display: flex !important;
    min-width: 0 !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
  }
  html:root body.app-shell.layout-style-integrated > .app-header .zheli-page-heading-actions[hidden] {
    display: none !important;
  }
  html:root body.app-shell.layout-style-integrated [data-zheli-heading-source-hidden="1"] {
    display: none !important;
  }
}

@media (max-width: 700px) {
  html:root body.app-shell > .app-header .zheli-page-heading { display: none !important; }
}

@media (max-width: 700px) {
  html:root body.app-shell #mainSidebar .menu-bottom .workbench-nav-link {
    display: flex !important;
  }
}

html:root body.app-shell.zheli-route-transitioning > .layout { overflow: hidden !important; }

html:root body.app-shell.layout-style-integrated > .layout > main.zheli-route-layer {
  position: fixed !important;
  z-index: 1 !important;
  top: var(--zheli-route-top) !important;
  left: var(--zheli-route-left) !important;
  width: var(--zheli-route-width) !important;
  height: var(--zheli-route-height) !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: var(--app-content-bg, #f3f6f9) !important;
  color: var(--app-content-text, #263442) !important;
  isolation: isolate;
  contain: paint;
  backface-visibility: hidden;
}

html:root body.app-shell .zheli-fade-slide-leave-active,
html:root body.app-shell .zheli-fade-slide-enter-active {
  transition: opacity .3s, transform .3s;
  will-change: opacity, transform;
}

html:root body.app-shell .zheli-fade-slide-enter-from {
  opacity: 0;
  transform: translateX(-30px);
}

html:root body.app-shell .zheli-fade-slide-leave-to {
  opacity: 0;
  transform: translateX(30px);
}

@media (prefers-reduced-motion: reduce) {
  html:root body.app-shell .zheli-fade-slide-leave-active,
  html:root body.app-shell .zheli-fade-slide-enter-active {
    transition: opacity .1s linear;
    transform: none !important;
  }
  html:root body.app-shell .zheli-fade-slide-enter-from,
  html:root body.app-shell .zheli-fade-slide-leave-to { transform: none !important; }
  html:root body.app-shell.app-navigation-started::before { animation-duration: .1s; }
}
