Court filings shed light on the retailer’s deal with Amazon, which owns store nameplates and the company’s massive inventory shortfall.