<div class="d-flex justify-content-between align-items-center mb-4"><div><h1 class="h3 mb-1">Dashboard</h1><p class="text-muted mb-0">GST billing overview</p></div><a href="<%= url('/invoices/create') %>" class="btn btn-primary">Create Bill</a></div>
<div class="row g-3 mb-4">
  <div class="col-md-3"><div class="card stat-card p-3"><div class="text-muted">Total Bills</div><div class="h3 mb-0"><%= stats.summary.total_bills %></div></div></div>
  <div class="col-md-3"><div class="card stat-card p-3"><div class="text-muted">Total Amount</div><div class="h3 mb-0">₹<%= Number(stats.summary.total_amount).toFixed(2) %></div></div></div>
  <div class="col-md-3"><div class="card stat-card p-3"><div class="text-muted">GST Collected</div><div class="h3 mb-0">₹<%= Number(stats.summary.total_tax).toFixed(2) %></div></div></div>
  <div class="col-md-3"><div class="card stat-card p-3"><div class="text-muted">This Month</div><div class="h3 mb-0">₹<%= Number(stats.summary.month_amount).toFixed(2) %></div></div></div>
</div>
<div class="card p-3"><h2 class="h5 mb-3">Recent Bills</h2><div class="table-responsive"><table class="table align-middle"><thead><tr><th>Invoice</th><th>Date</th><th>Customer</th><th>Status</th><th class="text-end">Total</th><th></th></tr></thead><tbody><% stats.recent.forEach((row)=>{ %><tr><td><%= row.invoice_number %></td><td><%= formatDate(row.invoice_date) %></td><td><%= row.customer_name %></td><td><span class="badge badge-soft"><%= row.status %></span></td><td class="text-end">₹<%= Number(row.grand_total).toFixed(2) %></td><td class="text-end"><a class="btn btn-sm btn-outline-primary" href="<%= url(`/invoices/${row.id}`) %>">View</a></td></tr><% }) %></tbody></table></div></div>
