{% extends "base.html" %} {% block title %}Dashboard - FINA{% endblock %} {% block content %}
{% if categories and categories|length > 0 %}

📈 {{ _('dashboard.metrics') }}

{{ _('dashboard.expenses_by_category') }}

{{ _('dashboard.monthly_expenses') }}

{{ _('dashboard.total_spent') }}

{{ total_spent|currency }}

{{ _('dashboard.categories_section') }}

{{ (categories|default([]))|length }}

{{ _('dashboard.total_expenses') }}

{{ total_expenses }}

📁 {{ _('dashboard.categories_section') }}

{% for category in categories %}

{{ category.name }}

{% if category.description %}

{{ category.description }}

{% endif %}
{{ category.get_total_spent()|currency }}
{{ category.expenses|length }} {{ _('category.expenses') | lower }}
{% endfor %}
{% else %}

{{ _('dashboard.total_spent') }}

{{ total_spent|currency }}

{{ _('category.expenses') }}

{{ (categories|default([]))|length }}

{{ _('dashboard.total_expenses') }}

{{ total_expenses }}

{{ _('empty.welcome_title') }}

{{ _('empty.welcome_message') }}

{{ _('empty.create_category') }}
{% endif %} {% if upcoming_subscriptions or suggestions_count > 0 %}

🔄 {{ _('subscription.title') }}

{{ _('dashboard.view_all') }}
{% if suggestions_count > 0 %}
💡 {{ suggestions_count }} {{ _('subscription.suggestions') | lower }} - {{ _('common.view') }}
{% endif %} {% if upcoming_subscriptions %}
{% for sub in upcoming_subscriptions %}
{{ sub.name }}
{{ sub.amount|currency }} - {% if sub.next_due_date %} {% set days_until = (sub.next_due_date - today).days %} {% if days_until == 0 %} {{ _('subscription.today') }} {% elif days_until == 1 %} {{ _('subscription.tomorrow') }} {% elif days_until < 7 %} in {{ days_until }} {{ _('subscription.days') }} {% else %} {{ sub.next_due_date.strftime('%b %d') }} {% endif %} {% endif %}
{{ sub.amount|currency }}
{% endfor %}
{% else %}

{{ _('subscription.no_upcoming') }}

{% endif %}
{% endif %}
{% endblock %}