<%
  // ✅ Unterstützt:
  // flash = { type, message }
  // flash = [ { type, message }, ... ]
  let messages = [];

  if (flash) {
    messages = Array.isArray(flash) ? flash : [flash];
  }
%>

<% if (messages.length > 0) { %>
  <% messages.forEach(m => { %>
    <div
      class="alert alert-<%= m.type %> alert-dismissible fade show auto-hide-flash"
      role="alert"
    >
      <%= m.message %>
      <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
    </div>
  <% }) %>
<% } %>

