{% extends 'base.html' %}
{% from 'macros.html' import render_field, render_messages, render_form_errors %}

{% block content %}
<div class="container">
    {{ render_messages() }}
    {{ render_form_errors(form) }}

    <div class="d-flex justify-content-between align-items-center mb-4">
        <h2><i class="bi bi-sliders me-2"></i>{{ _('Parámetros de Cálculo') }}</h2>
        <a href="{{ url_for('settings.index') }}" class="btn btn-outline-secondary">
            <i class="bi bi-arrow-left me-1"></i>{{ _('Volver') }}
        </a>
    </div>

    <div class="card">
        <div class="card-header">
            <h5 class="mb-0">{{ _('Liquidaciones - Cálculo de Días') }}</h5>
        </div>
        <div class="card-body">
            <p class="text-muted mb-3">
                {{ _('Defina cómo se calcula el factor de días usado para prorrateos en liquidaciones.') }}
            </p>

            <form method="POST">
                {{ form.hidden_tag() }}

                {{ render_field(form.liquidacion_modo_dias) }}
                {{ render_field(form.liquidacion_factor_calendario) }}
                {{ render_field(form.liquidacion_factor_laboral) }}

                <div class="d-flex gap-2">
                    <button type="submit" class="btn btn-primary">
                        <i class="bi bi-check-circle me-1"></i>{{ _('Guardar') }}
                    </button>
                    <a href="{{ url_for('settings.index') }}" class="btn btn-secondary">
                        <i class="bi bi-x-circle me-1"></i>{{ _('Cancelar') }}
                    </a>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
