<!DOCTYPE html>
<html lang="fr">

<head>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f9f9f9;
      color: #333;
      margin: 0;
      padding: 20px;
    }

    .header {
      background-color: #007b8f;
      color: white;
      padding: 20px;
      text-align: center;
      font-size: 24px;
      font-weight: bold;
    }

    .report-summary {
      display: flex;
      justify-content: space-between;
      margin-top: 20px;
      padding: 15px;
      background-color: #eef7f9;
      border-radius: 5px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .summary-item {
      font-size: 18px;
      font-weight: bold;
    }

    .bookings-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 20px;
      background-color: white;
    }

    .bookings-table th, .bookings-table td {
      border: 1px solid #ddd;
      padding: 10px;
      text-align: left;
    }

    .bookings-table th {
      background-color: #007b8f;
      color: white;
    }

    .total-row {
      font-weight: bold;
      background-color: #eef7f9;
    }
  </style>
</head>

<body>
  <div class="header">
    Rapport Mensuel - {{ .Month }} {{ .Year }}
  </div>

  <div class="report-summary">
    <div class="summary-item">Revenu total : {{ .Total }} €</div>
    <div class="summary-item">dont paiements par Carte Bancaire : {{ .CardTotal }} €</div>
    <div class="summary-item">Frais Booking.com : {{ .BookingFees }} €</div>
    <div class="summary-item">Frais NemoImmo : {{ .Fee }} €</div>
    <div class="summary-item">Bénéfice : {{ .Profit }} €</div>
  </div>

  <table class="bookings-table">
    <thead>
      <tr>
        <th>N° Facture</th>
        <th>Nom Client</th>
        <th>Du</th>
        <th>Au</th>
        <th>Revenu (€)</th>
        <th>Plateforme</th>
        <th>Frais Plateforme (€)</th>
        <th>Frais NemoImmo (€)</th>
        <th>Bénéfice (€)</th>
      </tr>
    </thead>
    <tbody>
      {{ range .Lines }}
      <tr>
        <td>{{ .InvoiceNumber }}</td>
        <td>{{ .CustomerName }}</td>
        <td>{{ .From }}</td>
        <td>{{ .To }}</td>
        <td>{{ .Total }}</td>
        <td>{{ .Platform }}</td>
        <td>{{ .PlatformFees }}</td>
        <td>{{ .Fee }}</td>
        <td>{{ .Profit }}</td>
      </tr>
      {{ end }}
    </tbody>
    <tfoot>
      <tr class="total-row">
        <td colspan="4">Totaux</td>
        <td>{{ .Total }}</td>
        <td></td>
        <td>{{ .PlatformFees }}</td>
        <td>{{ .Fee }}</td>
        <td>{{ .Profit }}</td>
      </tr>
    </tfoot>
  </table>
</body>

</html>
