<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="csrf-token" content="<%= csrfToken %>" />
  <meta name="robots" content="noindex, nofollow" />
  <title><%= title %> · Admin · <%= company.name %></title>
  <link rel="stylesheet" href="<%= asset('/css/style.css') %>" />
  <link rel="icon" type="image/svg+xml" href="<%= asset('/img/favicon.svg') %>" />
  <link rel="alternate icon" type="image/png" sizes="32x32" href="<%= asset('/img/favicon-32.png') %>" />
  <link rel="apple-touch-icon" href="<%= asset('/img/apple-touch-icon.png') %>" />
</head>
<body class="admin-body">
  <header class="admin-topbar">
    <a href="/admin" class="admin-brand"><img src="<%= asset('/img/logo.png') %>" alt="AdriSegon" class="admin-brand-logo" /> <span>Admin</span></a>
    <nav class="admin-nav" aria-label="Navigation admin">
      <a href="/admin" class="<%= currentPath === '/admin' ? 'active' : '' %>">Tableau de bord</a>
      <a href="/admin/pronostics" class="<%= currentPath.startsWith('/admin/pronostics') ? 'active' : '' %>">Pronostics</a>
      <a href="/admin/automation" class="<%= currentPath.startsWith('/admin/automation') ? 'active' : '' %>">IA auto</a>
      <a href="/admin/users" class="<%= currentPath.startsWith('/admin/users') ? 'active' : '' %>">Membres</a>
      <a href="/admin/offers" class="<%= currentPath === '/admin/offers' ? 'active' : '' %>">Offres</a>
      <a href="/admin/settings" class="<%= currentPath.startsWith('/admin/settings') ? 'active' : '' %>">Paramètres</a>
    </nav>
    <div class="admin-actions">
      <a href="/montante" class="btn btn-ghost btn-sm" target="_blank" rel="noopener">Voir le site</a>
      <form action="/logout" method="post" class="inline-form">
        <input type="hidden" name="_csrf" value="<%= csrfToken %>" />
        <button type="submit" class="btn btn-ghost btn-sm">Déconnexion</button>
      </form>
    </div>
  </header>

  <main class="admin-main">
    <%- include('../partials/flash') %>
    <%- body %>
  </main>
  <script src="<%= asset('/js/main.js') %>" defer></script>
</body>
</html>
