Western states reach water deal