/* Phase 20.5.10.3 — Admin/Vendor Sidebar Top Alignment & Global Layout Balance Fix */
:root{
  --marketak-sidebar-align-top: 18px;
  --marketak-sidebar-mobile-top: 0px;
}

/* Keep admin and vendor two-column shells aligned from the first pixel. */
.admin-shell,
.admin-shell-pro,
.admin-settings-shell,
.vendor-shell-pro,
.vendor-shell-wide-pro,
.vendor-orders-pro-page .vendor-shell-pro,
.vendor-orders-shell-wide,
.delivery-real-page .vendor-shell-pro.delivery-real-shell,
.vendor-delivery-v2-page .vendor-shell-wide-pro{
  align-items:start!important;
}

/* Old pages had large sticky offsets like 172px/185px/190px, causing a visible empty block above the side menu. */
@media (min-width:1181px){
  .admin-sidebar,
  .admin-sidebar-pro,
  .settings-sidebar,
  .vendor-sidebar-pro,
  .telegram-admin-sidebar,
  .verified-audit-sidebar-v239,
  .trust-sidebar{
    align-self:start!important;
    margin-top:0!important;
    padding-top:16px!important;
    top:var(--marketak-sidebar-align-top)!important;
    transform:none!important;
    max-height:calc(100vh - (var(--marketak-sidebar-align-top) * 2))!important;
    overflow:auto;
    scrollbar-width:thin;
  }

  .vendor-sidebar-pro{
    position:sticky!important;
  }

  .admin-sidebar,
  .admin-sidebar-pro,
  .settings-sidebar,
  .telegram-admin-sidebar,
  .verified-audit-sidebar-v239,
  .trust-sidebar{
    position:sticky!important;
  }

  .vendor-sidebar-pro > :first-child,
  .admin-sidebar-pro > :first-child,
  .settings-sidebar > :first-child,
  .admin-sidebar > :first-child{
    margin-top:0!important;
  }

  .vendor-store-card,
  .admin-profile-card,
  .admin-side-title,
  .telegram-admin-sidebar > :first-child,
  .settings-sidebar > .admin-profile-card:first-child{
    margin-top:0!important;
  }
}

/* Keep mobile/tablet natural and avoid sticky sidebars squeezing content. */
@media (max-width:1180px){
  .admin-sidebar,
  .admin-sidebar-pro,
  .settings-sidebar,
  .vendor-sidebar-pro,
  .telegram-admin-sidebar,
  .verified-audit-sidebar-v239,
  .trust-sidebar{
    position:relative!important;
    top:auto!important;
    margin-top:0!important;
    max-height:none!important;
    overflow:visible!important;
    width:100%!important;
    max-width:100%!important;
  }
}

/* If the app-shell loader is still settling, keep the sidebar in its final aligned place to prevent jumping. */
.marketak-ui-booting .admin-sidebar,
.marketak-ui-booting .admin-sidebar-pro,
.marketak-ui-booting .settings-sidebar,
.marketak-ui-booting .vendor-sidebar-pro,
.marketak-shell-enabled-v205101 .admin-sidebar,
.marketak-shell-enabled-v205101 .admin-sidebar-pro,
.marketak-shell-enabled-v205101 .settings-sidebar,
.marketak-shell-enabled-v205101 .vendor-sidebar-pro{
  margin-top:0!important;
  transform:none!important;
}
