<!DOCTYPE html><html lang="nl"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Facturen — Mek-Tech</title><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"><link rel="stylesheet" href="/css/style.css"><link rel="stylesheet" href="/css/dynamic.css"><link rel="icon" href="/img/favicon.svg"><script src="https://unpkg.com/lucide@latest"></script></head><body>
<nav class="navbar"><div class="nav-inner"><a href="/" class="nav-brand"><img src="/img/logo.svg" class="nav-logo" alt="Mek-Tech"></a><div style="display:flex;align-items:center;gap:.4rem"><a href="/" class="nav-icon-btn" title="Dashboard"><i data-lucide="layout-dashboard" style="width:15px;height:15px"></i> Dashboard</a><button class="theme-toggle" id="themeToggle" onclick="toggleTheme()"></button><a href="/auth/logout" class="nav-icon-btn" style="color:var(--red)"><i data-lucide="log-out" style="width:15px;height:15px"></i> Uitloggen</a></div></div></nav>
<div class="container">
<a href="javascript:history.back()" class="back-link"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"/></svg> Terug</a>
<div class="page-header"><h1>Invoices</h1><a href="/invoices/new" class="btn btn-primary">+ Nieuwe factuur</a></div>
<div class="stats-grid">
<div class="stat-card"><div class="stat-number">€<%= totalOutstanding.toFixed(2) %></div><div class="stat-label">Openstaand</div></div>
<div class="stat-card green"><div class="stat-number">€<%= totalPaid.toFixed(2) %></div><div class="stat-label">Betaald</div></div>
</div>
<table class="data-table"><thead><tr><th>Factuurnr</th><th>Cliënt</th><th>Datum</th><th>Vervaldatum</th><th>Subtotaal</th><th>Totaal</th><th>Status</th><th></th></tr></thead><tbody>
<% invoices.forEach(function(i){ %>
<tr><td><a href="/invoices/<%= i.id %>" class="link"><%= i.number %></a></td><td><%= i.client_name %></td><td><%= i.date %></td><td><%= i.due_date || '-' %></td><td>€<%= (i.subtotal || 0).toFixed(2) %></td><td><strong>€<%= (i.total || 0).toFixed(2) %></strong></td><td><span class="status-badge <%= i.status %>"><%= i.status %></span></td><td><a href="/invoices/<%= i.id %>" class="btn-small">Details</a></td></tr>
<% }) %>
</tbody></table></div>
<script>lucide.createIcons()</script><script src="/js/theme.js"></script></body></html>
