{# Analytics — category mix + top sellers (visual chart style) #}
Sales window
{% for days in analytics_ranges %} {% endfor %}
{# ── Headline metrics ──────────────────────────────────────── #}
{% for m in metrics %}
{{ m.label }}
{{ m.icon|safe }}
{{ m.value }}
{{ m.foot }}
{% endfor %}
{# ── Inventory value by category ──────────────────────────── #}

{{ icon_chart|safe }} Inventory value by category

{% if categories.total_value %} Total ₹{{ categories.total_value_fmt }} {% endif %}
{% if categories.rows %}
{% for c in categories.rows %}
{{ c.name }} {{ c.count }} item{{ '' if c.count == 1 else 's' }}
₹{{ c.value_fmt }} {{ c.share }}%
{% endfor %}
{% else %}
No data yet — add products to see your category mix.
{% endif %}
{# ── Top sellers ──────────────────────────────────────────── #}

{{ icon_trophy|safe }} Top sellers · last {{ analytics_days }} days

{% if sellers.total_revenue %} ₹{{ sellers.total_revenue_fmt }} {% endif %}
{% if sellers.rows %}
    {% for s in sellers.rows %}
  1. {% if loop.index == 1 %} {% else %} {{ loop.index }} {% endif %}
    {{ s.name }}
    {% if s.name_local %}{{ s.name_local }} · {% endif %} {{ s.sold }} {{ s.unit }} sold
    ₹{{ s.revenue_fmt }}
    {{ s.share }}% of top 10
  2. {% endfor %}
{% else %}
No sales recorded in the last 30 days.
{% endif %}