Analysis and approximation of optimal control problems for first-order elliptic systems in three dimensions