It's frequently an exercise to derive the Lorentz force law for a particle with charge $q$ in an external electromagnetic field given by the following Lagrangian:
$$L = -mc^2\sqrt{1-\frac{\dot{r}^2}{c^2}} - q \phi + q \mathbf{\dot{r}} \cdot \mathbf{A}$$
Which leads to the relativistic Lorentz force law:
$$\mathbf{F} = \frac{d}{dt} \Bigg(\frac{m \mathbf{\dot{r}}}{\sqrt{1-\frac{\dot{r}^2}{c^2}}} \Bigg) = q(\mathbf{E} + \mathbf{\dot{r}} \times \mathbf{B})$$
For continuous distributions, we have:
$$\mathbf{f} = \rho \mathbf{E} + \mathbf{J} \times \mathbf{B}$$
I'm trying to find the corresponding Lagrangian density which results in this force. I know if the charge distribution is treated as the source you can use the standard Lagrangian Density for electromagnetism but doing so will not give you the Lorentz Force Equation. However in my specific case I'm ignoring the self-field of the charge distribution, the fields are purely external, I don't need the electromagnetism Lagrangian density for my problem. Naively one might replace all instances of $m$ with a mass density term, $\rho_m$, and all instances of $q$ with a charge density term, $\rho_q$, where $\mathbf{J} = \rho_q \mathbf{\dot{r}}$.
$$\mathcal{L} = -\rho_mc^2\sqrt{1-\frac{v(\mathbf{r},t)^2}{c^2}} - \rho_q \phi + \rho_q \mathbf{v}(\mathbf{r},t) \cdot \mathbf{A} = -\rho_mc^2\sqrt{1-\frac{v(\mathbf{r},t)^2}{c^2}} - \rho_q \phi + \mathbf{J} \cdot \mathbf{A}$$
However the densities are also a function of the coordinates and moreover the mass densities and charge densities are related to each other in some unknown way. If we assume all of our particles are electrons then we can scale the densities by the electron mass and charge. If we take the variation of this Lagrangian density with respect to the charge density then we get the following:
$$\frac{d}{dt}\frac{\partial \mathcal{L}}{\partial \dot{\rho}} + \frac{d}{dx}\frac{\partial \mathcal{L}}{\partial \rho_x} + \frac{d}{dy}\frac{\partial \mathcal{L}}{\partial \rho_y} + \frac{d}{dz}\frac{\partial \mathcal{L}}{\partial \rho_z}= \frac{\partial \mathcal{L}}{\partial \rho}$$
The LHS is clearly zero since we have no dependence on derivatives of the density in our Lagrangian density. The RHS just gives us:
$$0 = -\frac{mc^2}{e}\sqrt{1-\frac{\dot{r}^2}{c^2}} - \phi + \mathbf{v}(\mathbf{r},t) \cdot \mathbf{A}$$
So clearly this Lagrangian density is not correct or we should not be varying with respect to the density. Similarly one can take the variation with respect to the velocity field but this also does not result in the correct equation. I feel like I'm having a fundamental misunderstanding here but I can't find any reference that works through this. What is the correct Lagrangian Density? What is the correct quantity to vary the action?