<!DOCTYPE html><html lang="nl"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Zoeken — 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>Search</h1></div>
<form method="GET" action="/search" class="task-form-grid" style="margin-bottom:1.25rem;display:flex;gap:.5rem">
<input type="text" name="q" value="<%= query %>" placeholder="Zoek cliënten, engagements, taken, diagrammen, notities..." style="flex:1;padding:.5rem .75rem;font-size:.9rem" autofocus>
<button class="btn btn-primary" type="submit">Search</button>
</form>
<% if (query) { %>
<p style="font-size:.8rem;color:var(--text-muted);margin-bottom:1rem">Resultaten voor "<strong><%= query %></strong>"</p>
<% var hasResults = results.clients.length || results.engagements.length || results.tasks.length || results.diagrams.length || results.notes.length; %>
<% if (!hasResults) { %><div class="empty-state"><p>Geen resultaten gevonden.</p></div><% } %>
<% if (results.clients.length > 0) { %><div class="card" style="margin-bottom:.75rem"><div class="card-title">Cliënten (<%= results.clients.length %>)</div>
<% results.clients.forEach(function(c){ %><a href="/clients/<%= c.id %>" class="client-row"><span class="cr-name"><%= c.name %></span><span class="status-badge <%= c.status %>"><%= c.status %></span></a><% }) %></div><% } %>
<% if (results.engagements.length > 0) { %><div class="card" style="margin-bottom:.75rem"><div class="card-title">Engagements (<%= results.engagements.length %>)</div>
<% results.engagements.forEach(function(e){ %><a href="/engagements/<%= e.id %>" class="engagement-row"><span class="engagement-type <%= e.type %>"><%= e.type %></span><span class="engagement-title"><%= e.title %></span><span class="engagement-client"><%= e.client_name %></span></a><% }) %></div><% } %>
<% if (results.tasks.length > 0) { %><div class="card" style="margin-bottom:.75rem"><div class="card-title">Taken (<%= results.tasks.length %>)</div>
<% results.tasks.forEach(function(t){ %><div class="task-item"><span class="task-prio <%= t.priority %>"><%= t.priority %></span><div class="task-body"><span class="task-title"><a href="/engagements/<%= t.engagement_id %>" class="link"><%= t.title %></a></span></div><span class="status-badge <%= t.status %>"><%= t.status %></span></div><% }) %></div><% } %>
<% if (results.diagrams.length > 0) { %><div class="card" style="margin-bottom:.75rem"><div class="card-title">Diagrammen (<%= results.diagrams.length %>)</div>
<% results.diagrams.forEach(function(d){ %><a href="/architecture/<%= d.id %>" class="engagement-row"><span class="engagement-title"><%= d.name %></span><span class="engagement-client"><%= d.client_name %></span><span class="status-badge"><%= d.diagram_type %></span></a><% }) %></div><% } %>
<% if (results.notes.length > 0) { %><div class="card" style="margin-bottom:.75rem"><div class="card-title">Notities (<%= results.notes.length %>)</div>
<% results.notes.forEach(function(n){ %><a href="/clients/<%= n.client_id %>#notes" class="engagement-row"><span class="engagement-title" style="font-weight:400"><%= n.content.substring(0,120) %><% if (n.content.length > 120) { %>...<% } %></span><span class="engagement-client"><%= n.client_name %></span></a><% }) %></div><% } %>
<% } %></div>
<script>lucide.createIcons()</script><script src="/js/theme.js"></script></body></html>
