<!DOCTYPE html><html lang="nl"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Opstellen — Mek-Tech</title><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&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"><style>
body{background:var(--bg);font-family:'Inter',-apple-system,sans-serif;min-height:100vh}
.em-wrap{max-width:720px;margin:0 auto;padding:1rem 1.5rem 3rem}
.em-wrap h1{font-size:1.2rem;font-weight:800;color:var(--text);margin-bottom:1rem;display:flex;align-items:center;gap:.4rem}
.em-wrap h1 svg{color:var(--accent)}
.cmp-card{background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:1.2rem}
.cmp-field{margin-bottom:.85rem}
.cmp-field label{display:block;font-size:.65rem;font-weight:600;color:var(--text-muted);margin-bottom:.2rem;text-transform:uppercase;letter-spacing:.3px}
.cmp-field input,.cmp-field textarea{width:100%;padding:.45rem .6rem;background:var(--bg);border:1px solid var(--border);border-radius:7px;color:var(--text);font-size:.8rem;font-family:inherit;line-height:1.5}
.cmp-field textarea{resize:vertical;min-height:140px}
.cmp-field input:focus,.cmp-field textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px rgba(88,166,255,.08)}
.cmp-actions{display:flex;gap:.4rem}
.alert{padding:.4rem .7rem;border-radius:7px;font-size:.72rem;margin-bottom:.75rem;font-weight:500}
.alert-error{background:var(--red-bg);color:var(--red);border:1px solid var(--red)}
.alert-success{background:var(--green-bg);color:var(--green);border:1px solid var(--green)}
.btn{display:inline-flex;align-items:center;gap:.3rem;padding:.38rem .75rem;border-radius:7px;font-size:.7rem;font-weight:500;cursor:pointer;border:none;font-family:inherit;text-decoration:none;transition:all .15s}
.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover{background:var(--accent-hover)}
.btn-secondary{background:var(--border-light);color:var(--text-muted)}.btn-secondary:hover{color:var(--text)}
</style></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="em-wrap">
<a href="/email" class="back-link">← Terug naar inbox</a>
<h1><i data-lucide="pen-line" style="width:18px;height:18px"></i> Nieuw bericht</h1>
<% if (sent) { %><div class="alert alert-success">Bericht verzonden!</div><% } %>
<% if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
<% if (!account) { %>
<div class="cmp-card" style="text-align:center"><p style="color:var(--text-muted);font-size:.85rem">Geen email account geconfigureerd.</p><a href="/email/settings" class="btn btn-primary" style="margin-top:.75rem">Account toevoegen</a></div>
<% } else { %>
<div class="cmp-card">
<form method="POST" action="/email/compose">
<div class="cmp-field"><label>Van</label><input type="text" value="<%= account.email %>" disabled></div>
<div class="cmp-field"><label>Aan</label><input type="email" name="to" value="<%= to %>" required placeholder="ontvanger@bedrijf.nl"></div>
<div class="cmp-field"><label>CC</label><input type="text" name="cc" placeholder="cc@bedrijf.nl"></div>
<div class="cmp-field"><label>Onderwerp</label><input type="text" name="subject" value="<%= subject %>" required placeholder="Onderwerp van het bericht"></div>
<div class="cmp-field"><label>Bericht</label><textarea name="text" placeholder="Typ uw bericht hier..."></textarea></div>
<div class="cmp-actions"><button class="btn btn-primary">Versturen</button><a href="/email" class="btn btn-secondary">Annuleren</a></div>
</form></div>
<% } %></div>
<script src="/js/theme.js"></script></body></html>