<section class="section">
  <p class="eyebrow">Organizator</p>
  <h1>Dashboard organizator</h1>
  <p>Evenimentele si modulele disponibile pentru organizatia ta.</p>

  <div class="cards-grid">
    <article class="card"><h3>Evenimente</h3><p><%= stats.events_count || 0 %></p></article>
    <article class="card"><h3>Bilete vandute</h3><p><%= stats.tickets_sold || 0 %></p></article>
    <article class="card"><h3>Vanzari brute</h3><p><%= Number(stats.gross_sales || 0).toFixed(2) %> RON</p></article>
  </div>
</section>

<section class="section">
  <h2>Evenimentele mele</h2>
  <% if (!events.length) { %>
    <p class="notice">Contul tau nu este legat la nicio organizatie sau nu exista evenimente pentru organizatie.</p>
  <% } else { %>
    <div class="table-wrap">
      <table>
        <thead>
          <tr>
            <th>Eveniment</th>
            <th>Organizatie</th>
            <th>Oras</th>
            <th>Status</th>
            <th>Vanzari</th>
            <th>Module</th>
          </tr>
        </thead>
        <tbody>
          <% events.forEach((event) => { %>
            <tr>
              <td><strong><%= event.title %></strong><br><small><%= event.start_at || '-' %></small></td>
              <td><%= event.organization_name || '-' %></td>
              <td><%= event.city_name || '-' %></td>
              <td><%- include('../partials/status-badge', { status: event.status }) %></td>
              <td><%= Number(event.gross_sales || 0).toFixed(2) %> RON</td>
              <td class="actions-cell">
                <a class="button ghost" href="/organizer/events/<%= event.id %>/festival">Festival</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/live-stats">Live stats</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/scanner">Scanner</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/cashless">Cashless</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/wristbands">Bratari</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/checkins">Check-in</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/invitations">Invitatii</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/local-gateways">Gateway</a>
                <a class="button ghost" href="/organizer/events/<%= event.id %>/nfc-writer">NFC writer</a>
              </td>
            </tr>
          <% }) %>
        </tbody>
      </table>
    </div>
  <% } %>
</section>
