Fundamental measure theory for the electric double layer: implications for blue-energy harvesting and water desalination