<?= $this->extend('layouts/main') ?>
<?= $this->section('content') ?>
<div class="page-header"><div><h1><i class="bi bi-bar-chart-line me-2"></i>Reports</h1></div></div>
<?php
$reports = [
  ['kpi',          'bi-graph-up-arrow',  'KPI Analytics',       'SLA, revenue, facility performance dashboards',        'blue'],
  ['workorders',   'bi-tools',           'Work Orders',         'Analyse WO status, priority, SLA, costs',             'primary'],
  ['finance',      'bi-receipt',         'Finance',             'Revenue, expenses, invoices, profitability',           'green'],
  ['sla',          'bi-shield-check',    'SLA Performance',     'Compliance rate, breach analysis by priority',         'blue'],
  ['assets',       'bi-cpu',             'Assets',              'Asset register, health scores, warranty status',       'teal'],
  ['occupancy',    'bi-grid',            'Occupancy',           'Unit occupancy, vacancies, expiring contracts',        'secondary'],
  ['contracts',    'bi-file-earmark-text','Contracts / Expiry', 'Active, expiring, renewed, cancelled contracts',      'orange'],
  ['technician',   'bi-person-gear',     'Technician Performance','Completion rates, resolution time, SLA breaches',  'purple'],
  ['procurement',  'bi-cart',            'Procurement',         'Purchase orders, vendor spend, request status',        'gold'],
  ['inventory',    'bi-box-seam',        'Inventory',           'Stock levels, movements, low stock alerts, valuation', 'red'],
];
?>
<div class="row g-3">
<?php foreach($reports as [$slug,$icon,$name,$desc,$color]): ?>
<div class="col-md-4">
  <a href="<?= base_url('reports/'.$slug) ?>" class="text-decoration-none">
    <div class="fm-card h-100" style="transition:.2s" onmouseover="this.style.transform='translateY(-3px)';this.style.boxShadow='0 8px 24px rgba(0,0,0,.12)'" onmouseout="this.style.transform='';this.style.boxShadow=''">
      <div class="fm-card-body">
        <div class="d-flex align-items-center gap-3 mb-2">
          <div class="kpi-icon kpi-<?= $color ?>" style="border-radius:12px"><i class="bi <?= $icon ?> fs-5"></i></div>
          <div class="fw-bold"><?= $name ?></div>
        </div>
        <p class="small text-muted mb-2"><?= $desc ?></p>
        <div class="d-flex gap-1">
          <span class="x-small text-muted"><i class="bi bi-filetype-csv me-1"></i>CSV</span>
          <span class="x-small text-muted ms-2"><i class="bi bi-file-earmark-excel me-1"></i>Excel</span>
        </div>
      </div>
    </div>
  </a>
</div>
<?php endforeach; ?>
</div>
<?= $this->endSection() ?>
