Quantifying Losses and Thermodynamic Limits in Nanophotonic Solar Cells