<div class="scenario-widget scenario-operating">
  <div class="scenario-widget__header">
    <span class="scenario-widget__location">{{ scenario.location }}, {{ scenario.country }}</span>
    <span class="scenario-widget__config">{{ t.scenario_revenue_opex_title }}</span>
  </div>
  <div class="scenario-widget__body">
    <h4 class="scenario-widget__section-title">{{ t.scenario_revenue_model_title }}</h4>
    <div class="scenario-widget__metrics">
      <div class="scenario-widget__metric">
        <span class="scenario-widget__metric-label">{{ t.scenario_weighted_rate_label }}</span>
        <span class="scenario-widget__metric-value">&euro;{{ "{:.0f}".format(d.weightedRate) }}/hr</span>
      </div>
      <div class="scenario-widget__metric">
        <span class="scenario-widget__metric-label">{{ t.scenario_utilization_target_label }}</span>
        <span class="scenario-widget__metric-value">{{ s.utilTarget }}%</span>
      </div>
      <div class="scenario-widget__metric">
        <span class="scenario-widget__metric-label">{{ t.scenario_booked_hours_label }}</span>
        <span class="scenario-widget__metric-value">{{ "{:,.0f}".format(d.bookedHoursMonth) }}</span>
      </div>
    </div>

    <h4 class="scenario-widget__section-title">{{ t.scenario_monthly_opex_title }}</h4>
    <div class="scenario-widget__table-wrap">
      <table class="scenario-widget__table">
        <thead>
          <tr>
            <th>{{ t.scenario_table_item_label }}</th>
            <th class="text-right">{{ t.scenario_table_monthly_label }}</th>
            <th>Detail</th>
          </tr>
        </thead>
        <tbody>
          {% for item in d.opexItems %}
          <tr>
            <td>{{ item.name }}</td>
            <td class="text-right mono">&euro;{{ "{:,.0f}".format(item.amount) }}</td>
            <td class="text-sm text-slate">{{ item.info }}</td>
          </tr>
          {% endfor %}
        </tbody>
        <tfoot>
          <tr>
            <td><strong>{{ t.scenario_total_monthly_opex_label }}</strong></td>
            <td class="text-right mono"><strong>&euro;{{ "{:,.0f}".format(d.opex) }}</strong></td>
            <td></td>
          </tr>
        </tfoot>
      </table>
    </div>

    <h4 class="scenario-widget__section-title">{{ t.scenario_monthly_summary_title }}</h4>
    <div class="scenario-widget__table-wrap">
      <table class="scenario-widget__table">
        <tbody>
          <tr>
            <td>{{ t.scenario_gross_revenue_label }}</td>
            <td class="text-right mono">&euro;{{ "{:,.0f}".format(d.grossRevMonth) }}</td>
          </tr>
          <tr>
            <td>{{ t.scenario_booking_fees_label }}</td>
            <td class="text-right mono">-&euro;{{ "{:,.0f}".format(d.feeDeduction) }}</td>
          </tr>
          <tr>
            <td>{{ t.scenario_net_revenue_label }}</td>
            <td class="text-right mono">&euro;{{ "{:,.0f}".format(d.netRevMonth) }}</td>
          </tr>
          <tr>
            <td>{{ t.scenario_operating_costs_label }}</td>
            <td class="text-right mono">-&euro;{{ "{:,.0f}".format(d.opex) }}</td>
          </tr>
          <tr>
            <td><strong>EBITDA</strong></td>
            <td class="text-right mono"><strong>&euro;{{ "{:,.0f}".format(d.ebitdaMonth) }}</strong></td>
          </tr>
          <tr>
            <td>{{ t.scenario_debt_service_label }}</td>
            <td class="text-right mono">-&euro;{{ "{:,.0f}".format(d.monthlyPayment) }}</td>
          </tr>
          <tr>
            <td><strong>{{ t.scenario_net_cashflow_label }}</strong></td>
            <td class="text-right mono"><strong>&euro;{{ "{:,.0f}".format(d.netCFMonth) }}</strong></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div class="scenario-widget__cta">
    <a href="{{ url_for('planner.index') }}">{{ t.scenario_cta_try_numbers }}</a>
  </div>
</div>
