<?php
require_once __DIR__ . '/../../app/core/bootstrap.php';
require_once __DIR__ . '/../../app/core/project_permissions.php';
require_once __DIR__ . '/../../app/core/access_guards.php';
auth_require_login();
$pdo = crm_pdo();
gp_require_staff_access($pdo);
$page_title = 'Αναφορές';
include __DIR__ . '/../includes/header.php';
?>
<div class="page-header">
  <div class="page-header-title">
    <h1>📈 Αναφορές</h1>
    <span>Αναφορές εργασίας, κόστους και μισθοδοσίας</span>
  </div>
</div>

<div class="grid-2" style="gap:16px;">
  <a href="/gopools/public/reports/work_report.php" class="card" style="text-decoration:none;color:inherit;display:block;transition:box-shadow .2s,transform .15s;">
    <div style="display:flex;align-items:center;gap:14px;margin-bottom:10px;">
      <span style="font-size:2rem;">⏱️</span>
      <div>
        <div style="font-weight:800;font-size:1rem;">Αναφορά Εργασίας</div>
        <div style="font-size:.82rem;color:var(--muted);">Ώρες, υπάλληλοι, κόστος εργασίας</div>
      </div>
    </div>
    <span class="btn btn-primary btn-sm" style="margin-top:4px;">Άνοιγμα →</span>
  </a>
  <a href="/gopools/public/reports/project_cost_report.php" class="card" style="text-decoration:none;color:inherit;display:block;transition:box-shadow .2s,transform .15s;">
    <div style="display:flex;align-items:center;gap:14px;margin-bottom:10px;">
      <span style="font-size:2rem;">💼</span>
      <div>
        <div style="font-weight:800;font-size:1rem;">Κόστος Έργων</div>
        <div style="font-size:.82rem;color:var(--muted);">Προϋπολογισμός, έξοδα, πληρωμές</div>
      </div>
    </div>
    <span class="btn btn-primary btn-sm" style="margin-top:4px;">Άνοιγμα →</span>
  </a>
  <?php if (function_exists('gp_user_perm') && gp_user_perm($pdo,'perm_payroll') && file_exists(__DIR__.'/../reports/monthly_payroll.php')): ?>
  <a href="/gopools/public/reports/monthly_payroll.php" class="card" style="text-decoration:none;color:inherit;display:block;transition:box-shadow .2s,transform .15s;">
    <div style="display:flex;align-items:center;gap:14px;margin-bottom:10px;">
      <span style="font-size:2rem;">💰</span>
      <div>
        <div style="font-weight:800;font-size:1rem;">Μηνιαία Μισθοδοσία</div>
        <div style="font-size:.82rem;color:var(--muted);">Ανάλυση αποδοχών ανά μήνα</div>
      </div>
    </div>
    <span class="btn btn-primary btn-sm" style="margin-top:4px;">Άνοιγμα →</span>
  </a>
  <?php endif; ?>
</div>
<style>.card:hover{transform:translateY(-3px);box-shadow:0 16px 40px rgba(0,0,0,.1);}</style>
<?php include __DIR__ . '/../includes/footer.php'; ?>
