The present numerical study builds on Ekman (1905)'s work in surface boundary layer and extends the boundary value problem to overcome some of its limitations. Previous studies addressed model's limitations by assuming that deviations from observations are usually ascribed to different eddy viscosity shapes, but seldom to the presence of baroclinic pressure gradients and shallow seas, which are the mainstays of this work. Improved solutions in the ocean boundary layer are obtained considering both depth-dependent wind-induced eddy viscosity and horizontal density gradients, ranging from well-mixed to highly-stratified conditions in a finite-depth ocean. High-order numerical solutions extend those in previous analytical and numerical works in the literature and widens the parameter space analyzed. Remarkably, the current profiles are obtained without ambiguity as a truly superposition of a geostrophic and a ageostrophic terms. Results indicate that, for a vertically-uniform eddy viscosity without density gradients and in shallow waters, currents are practically aligned with wind. As depth increases, misalignment between currents and wind increases and the complexity of the vertical structure increases. At large depths, Ekman's values are attained, i.e., deflection angles relative to wind direction, θ W , are θ S − θ W = − 4 5 ∘ at the surface, where the current is maximum, and θ T − θ W = − 90 ° for the depth-integrated transport (negative for deflections to the right in the Northern Hemisphere). These features remain regardless of the magnitude of the eddy-viscosity. For non-uniform eddy viscosity, θ S − θ W decreases from − 4 5 ∘ up to − 9 0 ∘ from low to high stratification level, respectively, whereas θ T − θ W is rather insensitive ( θ T − θ W ≈ − 9 0 ∘ ). Contrary to wind effects, the presence of the only vertically-uniform density gradient forcing, with constant eddy viscosity, deflects the surface angle θ S − θ D = + 4 5 ∘ relative to the density-gradient direction, θ D , in deep waters. Maximum currents no longer occur at the surface in this case. For non-uniform density-gradient profiles, current magnitude decreases overall while θ S − θ D ≈ + 4 5 ∘ as long as the gradient affects the entire surface boundary layer. The deflection angle θ T − θ D ∼ + 9 5 ∘ remains less sensitive to changes in density-gradient profile. • Improved Ekman solutions: variable eddy viscosity and baroclinicity in finite-depths. • Numerical solutions extend previous ones and widens the parameter space explored. • Currents are truly decoupled into geostrophic and ageostrophic terms. • Baroclinicity deflects 45 ∘ to the left from the density-gradient direction. • As stratification increases, surface current deflects 45 ∘ –90 ∘ to the right of wind. [ABSTRACT FROM AUTHOR]