diff --git a/expenses_manager/expenses/static/expenses/css/base.css b/expenses_manager/expenses/static/expenses/css/base.css
index 533ca0a..a1ee0ca 100644
--- a/expenses_manager/expenses/static/expenses/css/base.css
+++ b/expenses_manager/expenses/static/expenses/css/base.css
@@ -65,9 +65,22 @@ a.danger {
padding: 24px;
}
+.dashboard-context {
+ margin-bottom: 1rem;
+}
+
+.dashboard-context h2 {
+ margin: 0;
+}
+
+.muted {
+ color: #6b7280;
+ font-size: 0.85rem;
+}
+
.dashboard-grid {
display: grid;
- grid-template-columns: repeat(auto-fit, minmax(300px, 500px));
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 20px
}
@@ -79,7 +92,7 @@ a.danger {
}
.card-chart {
- max-width: 500px;
+ max-width: 300px;
}
.card-chart canvas {
@@ -87,6 +100,11 @@ a.danger {
height: 220px !important;
}
+.chart-box {
+ height: 300px;
+ margin-bottom: 2rem;
+}
+
.tag{
display: inline-block;
padding: 2px 6px;
@@ -104,7 +122,7 @@ a.danger {
.kpi-grid {
display: grid;
- grid-template-columns: repeat(auto-file, minmax(180px, 1fr));
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1rem;
margin: 1.5rem 0;
}
@@ -128,6 +146,18 @@ a.danger {
margin-top: 0.25rem;
}
+/* .comparison strong {
+ color:#b91c1c;
+} */
+
+.comparison strong.positive {
+ color: #166534;
+}
+
+.comparison strong.negative {
+ color:#b91c1c;
+}
+
table {
width: 100%;
border-collapse: collapse;
@@ -205,4 +235,52 @@ tbody tr:hover {
.message.warning {
background: #fef3c7;
color: #92400e;
+}
+
+.dashboard-filters {
+ margin: 1rem 0 1.5rem;
+ padding: 1rem;
+ background: #f9fafb;
+ border-radius: 8px;
+}
+
+.dashboard-filters form {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ align-items: center;
+}
+
+.dashboard-filters select,
+.dashboard-filters button {
+ padding: 0.4rem 0.6rem;
+}
+
+.dashboard-filters .checkbox {
+ display: flex;
+ gap: 0.3rem;
+ align-items: center;
+}
+
+.dashboard-presets {
+ display: flex;
+ gap: 0.5rem;
+}
+
+.preset {
+ padding: 0.35rem 0.6rem;
+ border-radius: 6px;
+ background: #e5e7eb;
+ text-decoration: none;
+ color: #111827;
+ font-size: 0.85rem;
+}
+
+.preset:hover {
+ background: #d1d5db;
+}
+
+.preset.active {
+ background: #2563eb;
+ color: white;
}
\ No newline at end of file
diff --git a/expenses_manager/expenses/templates/expenses/dashboard.html b/expenses_manager/expenses/templates/expenses/dashboard.html
index aeebbf4..f08cfd5 100644
--- a/expenses_manager/expenses/templates/expenses/dashboard.html
+++ b/expenses_manager/expenses/templates/expenses/dashboard.html
@@ -3,45 +3,70 @@
{% block title %}Dashboard{% endblock %}
{% block content %}
-
+
+
+ {% if selected_month %}
+ {{ selected_month }}/{{ selected_year}}
+ {% else %}
+ Año {{ selected_year }}
+ {% endif %}
+
+ {% if selected_account_obj %}
+ {{ selected_account_obj.name }}
+ {% else %}
+ Todas las cuentas
+ {% endif %}
+
-
- Dashboard
- {% if selected_account_obj %}
- — {{ selected_account_obj.name }}
- {% endif %}
-
+
- Mostrando: - {{ selected_year }} - {% if selected_month %}/{{ selected_month }}{% endif %} -
-Comparado con el periodo inmediatamente anterior
+ -No hay datos en el periodo anterior
- {% else %} -- Total anterior: {{ kpi_previous_total|floatformat:2 }} -
- {% endif %} - -- Variación: - {% if kpi_percentage is not None %} - {{ kpi_percentage|floatformat:2 }}% - {% else %} - Variación: N/D - {% endif %} -
-No hay gastos para este periodo.
- {% else %} -| Categoría | -Total | -
|---|---|
| {{ row.category__name }} | -{{ row.total }} | -
| Sin datos | -|
| Categoría | -Actual | -Anterior | -Diferencia | -
|---|---|---|---|
| {{ row.category }} | -{{ row.current|floatformat:2 }}€ | -{{ row.previous }} | -- {% if row.difference > 0 %} - ▲ {{ row.difference|floatformat:2 }}€ - {% elif row.difference < 0 %} - ▼ {{ row.difference_abs|floatformat:2 }}€ - {% else %} - = - {% endif %} - | -
+ Diferencia: + + {% if kpi_trend == "up" %}+{% endif %} + {{ kpi_difference_abs|floatformat:2 }} € + + {% if kpi_percentage %} + ({{ kpi_percentage|floatformat:1 }}%) + {% endif %} +
+| Categoría | +Total | +
|---|---|
| {{ row.category__name }} | +{{ row.total|floatformat:2 }} € | +