Drag the spend sliders (normalised to the budget), then press "Set to optimum" to compare against the KKT solution.
The science
Each employee group has preferences w_i over four pay elements. Value of spending x_i on element i is diminishing: u = sum w_i ln(1 + m_i x_i / k_i), where m_i is a tax-efficiency multiplier (net salary 0.7, health 1.3, retirement match 1.25, training 1.1) and k_i a saturation scale. Your sliders are normalised to the budget. Maximising u under sum x_i = B gives the Lagrange condition w_i m_i / (k_i + m_i x_i) = lambda, i.e. x_i = w_i/lambda - k_i/m_i for every funded element (water-filling), solved by bisection on lambda.
Simplifications: made-up illustrative parameters, three stylised groups, no labour-market, legal or fairness constraints. A teaching model of trade-offs, not HR advice.