/* FENIX CRM v1.1.9.26 — global fixed-header spacing fix.
   The real header height is measured by admin-layout-fix.js so the content
   always begins below the header, including PWA/iPhone safe-area height. */

html{
  scroll-padding-top:calc(var(--fenix-admin-head-h, 88px) + 18px);
}

@media (max-width: 900px){
  /* Keep the fixed/sticky header above content without hiding page titles. */
  .admin-head{
    box-sizing:border-box;
  }

  /* All standard authenticated CRM screens use the header followed by main. */
  .admin-head ~ main,
  .admin-head ~ .admin-wrap,
  .admin-head + main,
  .admin-head + .admin-wrap{
    padding-top:calc(var(--fenix-admin-head-h, 88px) + 18px) !important;
  }

  /* Some screens wrap the content one level deeper. */
  body.fenix-admin .admin-wrap,
  body.admin-body .admin-wrap{
    padding-top:calc(var(--fenix-admin-head-h, 88px) + 18px) !important;
  }

  /* Avoid a second artificial top gap from first-page controls. */
  .admin-wrap > .home-back:first-child,
  main > .home-back:first-child{
    margin-top:0 !important;
  }

  /* In-page links and focused blocks must also stop below the fixed header. */
  .admin-wrap [id],
  main [id],
  .panel,
  .title-row{
    scroll-margin-top:calc(var(--fenix-admin-head-h, 88px) + 18px);
  }
}
