{% macro render_field(field, label_class='block text-gray-700 font-medium mb-2', input_class='w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-blue-500 focus:ring focus:ring-blue-200', error_class='text-red-600 text-sm mt-1') %}
{{ field.label(class=label_class) }} {{ field(class=input_class, **kwargs) }} {% if field.errors %}
{% for error in field.errors %}

{{ error }}

{% endfor %}
{% endif %} {% if field.description %}

{{ field.description }}

{% endif %}
{% endmacro %} {% macro render_boolean_field(field, label_class='flex items-center', input_class='h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500', error_class='text-red-600 text-sm mt-1') %}
{% if field.errors %}
{% for error in field.errors %}

{{ error }}

{% endfor %}
{% endif %} {% if field.description %}

{{ field.description }}

{% endif %}
{% endmacro %} {% macro render_submit_button(text='Submit', class='px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors') %} {% endmacro %} {% macro render_cancel_button(url, text='Cancel', class='px-4 py-2 bg-gray-200 text-gray-800 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-colors') %} {{ text }} {% endmacro %}