{% extends "core/base.html" %}
{% load static %}

{% block title %}Data Export Center - SwiftPOS{% endblock %}

{% block topbar_title %}
Data Export Center
{% endblock %}

{% block content %}
<div class="swiftpos-content container-fluid py-4">
    <div class="row mb-3">
        <div class="col-12">
            <div class="alert alert-info mb-0 small">
                Export your important data to CSV. You can open CSV files in Excel, Google Sheets or any spreadsheet app.
            </div>
        </div>
    </div>

    <div class="row g-3">
        <!-- Inventory exports -->
        <div class="col-12 col-lg-6">
            <div class="card shadow-sm sp-animate-card h-100">
                <div class="card-header border-0">
                    <h5 class="mb-0">Inventory Exports</h5>
                    <p class="text-muted small mb-0">
                        Download your product and stock data.
                    </p>
                </div>
                <div class="card-body">
                    <div class="vstack gap-2">
                        <a href="{% url 'inventory:product_bulk_export' %}" class="btn btn-outline-primary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-box me-2"></i> Export Products</span>
                            <span class="small text-muted">All products with pricing & stock</span>
                        </a>
                        <a href="{% url 'inventory:category_bulk_export' %}" class="btn btn-outline-primary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-tags me-2"></i> Export Categories</span>
                            <span class="small text-muted">All product categories</span>
                        </a>
                        <a href="{% url 'inventory:inventory_transactions_export' %}" class="btn btn-outline-primary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-arrows-rotate me-2"></i> Export Stock Movements</span>
                            <span class="small text-muted">Every stock in/out record</span>
                        </a>
                        <a href="{% url 'inventory:stock_adjustments_export' %}" class="btn btn-outline-primary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-sliders-h me-2"></i> Export Stock Adjustments</span>
                            <span class="small text-muted">Manual stock changes & reasons</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>

        <!-- Sales exports -->
        <div class="col-12 col-lg-6">
            <div class="card shadow-sm sp-animate-card h-100">
                <div class="card-header border-0">
                    <h5 class="mb-0">Sales & Payments Exports</h5>
                    <p class="text-muted small mb-0">
                        Download your sales transactions and payments.
                    </p>
                </div>
                <div class="card-body">
                    <div class="vstack gap-2">
                        <a href="{% url 'sales:export_all_orders' %}" class="btn btn-outline-primary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-file-invoice me-2"></i> Export All Orders</span>
                            <span class="small text-muted">Every order with totals</span>
                        </a>
                        <a href="{% url 'sales:export_order_items' %}" class="btn btn-outline-primary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-list-ul me-2"></i> Export Order Items</span>
                            <span class="small text-muted">Line items for each order</span>
                        </a>
                        <a href="{% url 'sales:export_payments' %}" class="btn btn-outline-primary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-wallet me-2"></i> Export Payments</span>
                            <span class="small text-muted">All payment transactions</span>
                        </a>
                        <a href="{% url 'sales:transaction_history' %}" class="btn btn-outline-secondary w-100 d-flex justify-content-between align-items-center">
                            <span><i class="fas fa-clock-rotate-left me-2"></i> Transaction History</span>
                            <span class="small text-muted">Filter by date and export</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
