{# 分析報表第二層分頁：保留頁面內容與圖表邏輯，只提供一致的報表切換入口。 #}
{% set _analysis_active = active_page|default('') %}
<nav class="analysis-report-tabs" aria-label="分析報表分頁">
    <a class="analysis-report-tab {% if _analysis_active == 'sales' %}is-active{% endif %}"
       {% if _analysis_active == 'sales' %}aria-current="page"{% endif %}
       href="/sales_analysis">
        <i class="fas fa-chart-bar"></i>業績分析
    </a>
    <a class="analysis-report-tab {% if _analysis_active == 'daily_sales' %}is-active{% endif %}"
       {% if _analysis_active == 'daily_sales' %}aria-current="page"{% endif %}
       href="/daily_sales">
        <i class="fas fa-calendar-day"></i>當日業績
    </a>
    <a class="analysis-report-tab {% if _analysis_active == 'growth' %}is-active{% endif %}"
       {% if _analysis_active == 'growth' %}aria-current="page"{% endif %}
       href="/growth_analysis">
        <i class="fas fa-chart-line"></i>成長分析
    </a>
    <a class="analysis-report-tab {% if _analysis_active == 'monthly' %}is-active{% endif %}"
       {% if _analysis_active == 'monthly' %}aria-current="page"{% endif %}
       href="/monthly_summary_analysis">
        <i class="fas fa-table"></i>月份總表
    </a>
    {% if metabase_url or grist_url %}
    <span class="analysis-report-tabs-spacer" aria-hidden="true"></span>
    {% endif %}
    {% if metabase_url %}
    <a class="analysis-report-tab is-external {% if _analysis_active == 'metabase' %}is-active{% endif %}" href="{{ metabase_url }}">
        <i class="fas fa-chart-pie"></i>自訂圖表
    </a>
    {% endif %}
    {% if grist_url %}
    <a class="analysis-report-tab is-external {% if _analysis_active == 'grist' %}is-active{% endif %}" href="{{ grist_url }}">
        <i class="fas fa-table-cells"></i>資料協作
    </a>
    {% endif %}
</nav>
