<% const commandAdminBase = typeof adminBaseUrl !== 'undefined' ? adminBaseUrl : '/admin'; %>
<% const commandCompany = typeof currentCompany !== 'undefined' && currentCompany ? currentCompany : null; %>
<% const commandCompanyName = commandCompany?.name || 'Lustra'; %>
<% const commandUser = typeof currentUser !== 'undefined' ? currentUser : null; %>
<% const commandPath = typeof currentPath !== 'undefined' ? currentPath : ''; %>
<div class="admin-command-shell" data-admin-command-shell data-admin-base="<%= commandAdminBase %>" data-current-title="<%= title || 'Tableau de bord' %>" data-current-path="<%= commandPath %>">
  <div class="admin-command-bar">
    <div class="admin-command-context">
      <span class="tenant-pill"><%- ui.navIcon('dashboard') %><strong><%= commandCompanyName %></strong></span>
      <% if (commandUser?.is_demo) { %><span class="demo-pill"><%- ui.navIcon('lock') %> Démo protégée</span><% } %>
    </div>
    <button class="command-search-button" type="button" data-command-palette-open>
      <span><%- ui.navIcon('search') %></span>
      <strong>Rechercher, créer, ouvrir...</strong>
      <kbd>Cmd K</kbd>
    </button>
    <div class="admin-shortcuts">
      <button class="admin-pin-button" type="button" data-pin-current aria-label="Épingler la page"><%- ui.navIcon('star') %></button>
      <details class="admin-recent-menu">
        <summary>Raccourcis</summary>
        <div>
          <strong>Épinglés</strong>
          <div data-pinned-pages class="shortcut-list"></div>
          <strong>Récents</strong>
          <div data-recent-pages class="shortcut-list"></div>
        </div>
      </details>
    </div>
  </div>

  <div class="command-palette" data-command-palette hidden>
    <div class="command-palette-backdrop" data-command-palette-close></div>
    <section class="command-palette-panel" role="dialog" aria-modal="true" aria-label="Palette de commande">
      <div class="command-input-row">
        <span><%- ui.navIcon('search') %></span>
        <input data-command-input placeholder="Rechercher client, facture, devis, employé, intervention..." autocomplete="off">
        <button type="button" class="secondary small" data-command-palette-close>Fermer</button>
      </div>
      <div class="command-quick-actions">
        <a href="<%= commandAdminBase %>/clients"><%- ui.navIcon('users') %><span>Nouveau client</span></a>
        <a href="<%= commandAdminBase %>/demandes"><%- ui.navIcon('inbox') %><span>Demandes</span></a>
        <a href="<%= commandAdminBase %>/devis/nouveau"><%- ui.navIcon('document') %><span>Créer devis</span></a>
        <a href="<%= commandAdminBase %>/factures/nouvelle"><%- ui.navIcon('receipt') %><span>Créer facture</span></a>
        <a href="<%= commandAdminBase %>/interventions"><%- ui.navIcon('agenda') %><span>Intervention</span></a>
        <a href="<%= commandAdminBase %>/rh"><%- ui.navIcon('team') %><span>Absence RH</span></a>
        <a href="<%= commandAdminBase %>/studio"><%- ui.navIcon('edit') %><span>Studio</span></a>
        <a href="<%= commandAdminBase %>/parametres"><%- ui.navIcon('settings') %><span>Réglages</span></a>
      </div>
      <div class="command-results" data-command-results>
        <div class="empty-state slim"><strong>Commencez à taper</strong><span>La recherche ouvre clients, factures, devis, employés, interventions et paiements.</span></div>
      </div>
    </section>
  </div>
</div>
