<!DOCTYPE html><html lang="nl"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Agenda — 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>Calendar</h1><button class="btn btn-primary" onclick="document.getElementById('eventForm').style.display='block'">+ Nieuw event</button></div>

<div class="form-card" id="eventForm" style="display:none;margin-bottom:1rem">
<form method="POST" action="/calendar/new">
<div class="form-grid">
<div class="field"><label>Titel</label><input type="text" name="title" required></div>
<div class="field"><label>Type</label><select name="event_type"><option value="meeting">Meeting</option><option value="call">Call</option><option value="deadline">Deadline</option><option value="workshop">Workshop</option><option value="review">Review</option><option value="other">Anders</option></select></div>
<div class="field"><label>Cliënt</label><select name="client_id"><option value="">Geen</option><% clients.forEach(function(c){ %><option value="<%= c.id %>"><%= c.name %></option><% }) %></select></div>
<div class="field"><label>Engagement</label><select name="engagement_id"><option value="">Geen</option><% engagements.forEach(function(e){ %><option value="<%= e.id %>"><%= e.title %></option><% }) %></select></div>
<div class="field"><label>Start</label><input type="datetime-local" name="start_time" required></div>
<div class="field"><label>Einde</label><input type="datetime-local" name="end_time"></div>
<div class="field"><label>Hele dag</label><input type="checkbox" name="all_day" value="1"></div>
<div class="field"><label>Kleur</label><input type="color" name="color" value="#58a6ff"></div>
<div class="field" style="grid-column:1/-1"><label>Omschrijving</label><textarea name="description" rows="2"></textarea></div>
</div>
<div class="form-actions"><button class="btn btn-primary">Opslaan</button><button type="button" class="btn btn-secondary" onclick="this.closest('.form-card').style.display='none'">Annuleren</button></div>
</form></div>

<div class="card">
<div class="card-title">Komende events</div>
<% if (events.length === 0) { %><div class="empty-state-s">Geen events</div><% } else { %>
<div class="timeline">
<% events.forEach(function(e){ %>
<div class="tl-item">
<div class="tl-dot" style="background:<%= e.color || '#58a6ff' %>"></div>
<div class="tl-body">
<div class="tl-title"><%= e.title %></div>
<div class="tl-date"><%= new Date(e.start_time).toLocaleDateString('nl-NL',{weekday:'long',year:'numeric',month:'long',day:'numeric',hour:'2-digit',minute:'2-digit'}) %><% if (e.client_name) { %> · <%= e.client_name %><% } %></div>
<% if (e.description) { %><div style="font-size:.7rem;color:var(--text-muted);margin-top:.15rem"><%= e.description %></div><% } %>
</div>
<form method="POST" action="/calendar/<%= e.id %>/delete" style="flex-shrink:0"><button class="btn-small danger">✕</button></form>
</div>
<% }) %>
</div>
<% } %>
</div>
</div>
<script>lucide.createIcons()</script><script src="/js/theme.js"></script></body></html>
