Spectral optical monitoring of nitrate in inland and seawater with miniaturized optical components.