<?php $__env->startSection('title', 'Dashboard'); ?>

<?php $__env->startSection('content'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Dashboard - IGF System</title>

  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet">

  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Poppins', sans-serif;
    }

    :root {
      --black: #111111;
      --white: #ffffff;
      --gray-100: #f7f7f7;
      --gray-200: #efefef;
      --gray-300: #e0e0e0;
      --gray-500: #9e9e9e;
      --gray-700: #555555;
      --accent: #F7D40B;
      --page-bg: #f9f9f9;
      --green-bg: #f0faf4;
      --green-text: #1a6e3f;
      --green-border: #bbf7d0;
      --amber-bg: #fffbeb;
      --amber-text: #92400e;
      --amber-border: #fde68a;
      --red-bg: #fff0f0;
      --red-text: #991b1b;
      --red-border: #fecaca;
    }

    body {
      background: var(--page-bg);
      min-height: 100vh;
      color: var(--black);
    }

    /* ── TOPBAR ── */
    .topbar {
      width: 100%;
      background: var(--white);
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 18px 44px;
      border-bottom: 1px solid var(--gray-300);
      position: sticky;
      top: 0;
      z-index: 100;
      animation: slideDown 0.45s ease both;
    }

    @keyframes slideDown {
      from { transform: translateY(-100%); opacity: 0; }
      to   { transform: translateY(0);     opacity: 1; }
    }

    .topbar-left {
      display: flex;
      align-items: center;
      gap: 24px;
    }

    .logo-area {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .logo-box {
      width: 36px;
      height: 36px;
      background: var(--black);
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .logo-box i {
      color: var(--accent);
      font-size: 15px;
    }

    .brand-name {
      font-size: 17px;
      font-weight: 700;
      color: var(--black);
      letter-spacing: -0.4px;
    }

    .search-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--gray-100);
      border: 1px solid var(--gray-200);
      border-radius: 10px;
      padding: 10px 16px;
      min-width: 320px;
      transition: all 0.25s ease;
    }

    .search-bar:focus-within {
      background: var(--white);
      border-color: var(--black);
      box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
    }

    .search-bar i {
      color: var(--gray-500);
      font-size: 13px;
    }

    .search-bar input {
      border: none;
      background: transparent;
      outline: none;
      font-size: 13px;
      font-family: 'Poppins', sans-serif;
      width: 100%;
      color: var(--black);
    }

    .search-bar input::placeholder {
      color: var(--gray-500);
    }

    .topbar-right {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .date-selector {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--gray-100);
      border: 1px solid var(--gray-200);
      padding: 9px 14px;
      border-radius: 9px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 500;
      color: var(--black);
      font-family: 'Poppins', sans-serif;
      transition: all 0.2s ease;
    }

    .date-selector:hover {
      background: var(--white);
      border-color: var(--gray-300);
    }

    .date-selector i {
      color: var(--gray-500);
      font-size: 12px;
    }

    .notification-btn {
      position: relative;
      background: var(--gray-100);
      border: 1px solid var(--gray-200);
      width: 40px;
      height: 40px;
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.25s ease;
    }

    .notification-btn:hover {
      background: var(--white);
      border-color: var(--gray-300);
      transform: translateY(-1px);
    }

    .notification-btn i {
      color: var(--black);
      font-size: 15px;
    }

    .notif-dot {
      position: absolute;
      top: 7px;
      right: 8px;
      width: 7px;
      height: 7px;
      background: #ef4444;
      border-radius: 50%;
      border: 1.5px solid var(--white);
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      padding: 5px 12px 5px 5px;
      border-radius: 24px;
      border: 1px solid var(--gray-200);
      background: var(--white);
      transition: all 0.2s ease;
    }

    .user-profile:hover {
      border-color: var(--gray-300);
      background: var(--gray-100);
    }

    .user-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--black);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      font-weight: 700;
      font-size: 13px;
    }

    .user-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--black);
    }

    .user-profile .fa-chevron-down {
      color: var(--gray-500);
      font-size: 9px;
    }

    .logout-btn {
      background: var(--black);
      color: var(--white);
      border: none;
      padding: 9px 20px;
      border-radius: 9px;
      font-weight: 600;
      font-size: 12px;
      font-family: 'Poppins', sans-serif;
      cursor: pointer;
      transition: all 0.25s ease;
      letter-spacing: 0.3px;
    }

    .logout-btn:hover {
      background: #000;
      transform: translateY(-1px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    }

    /* ── DASHBOARD ── */
    .dashboard {
      max-width: 1500px;
      margin: 0 auto;
      padding: 36px 44px;
    }

    /* ── SECTION HEADER ── */
    .summary-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 24px;
      animation: fadeUp 0.5s 0.1s ease both;
    }

    @keyframes fadeUp {
      from { transform: translateY(16px); opacity: 0; }
      to   { transform: translateY(0);    opacity: 1; }
    }

    .section-icon {
      width: 44px;
      height: 44px;
      border-radius: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--black);
    }

    .section-icon i {
      color: var(--accent);
      font-size: 18px;
    }

    .section-title {
      font-size: 20px;
      font-weight: 700;
      color: var(--black);
      letter-spacing: -0.4px;
    }

    /* ── CARDS ── */
    .cards {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 20px;
      margin-bottom: 36px;
    }

    .card {
      background: var(--white);
      border: 1px solid var(--gray-200);
      border-radius: 16px;
      padding: 28px;
      transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
      animation: fadeUp 0.5s ease both;
    }

    .card:nth-child(1) { animation-delay: 0.15s; }
    .card:nth-child(2) { animation-delay: 0.22s; }
    .card:nth-child(3) { animation-delay: 0.29s; }
    .card:nth-child(4) { animation-delay: 0.36s; }

    .card::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--black);
      transform: scaleX(0);
      transform-origin: left;
      transition: transform 0.35s ease;
    }

    .card:hover {
      transform: translateY(-5px);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
      border-color: var(--gray-300);
    }

    .card:hover::after {
      transform: scaleX(1);
    }

    .card-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 20px;
    }

    .card h3 {
      font-size: 11px;
      font-weight: 600;
      color: var(--gray-500);
      text-transform: uppercase;
      letter-spacing: 1px;
      margin: 0;
      padding-top: 2px;
    }

    .card-icon-wrapper {
      width: 44px;
      height: 44px;
      border-radius: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--gray-100);
      border: 1px solid var(--gray-200);
      transition: all 0.35s ease;
      flex-shrink: 0;
    }

    .card:hover .card-icon-wrapper {
      background: var(--black);
      border-color: var(--black);
      transform: scale(1.06);
    }

    .card-icon-wrapper i {
      font-size: 18px;
      color: var(--black);
      transition: all 0.35s ease;
    }

    .card:hover .card-icon-wrapper i {
      color: var(--accent);
    }

    .card p {
      font-size: 38px;
      font-weight: 700;
      color: var(--black);
      letter-spacing: -2px;
      line-height: 1;
      margin-bottom: 10px;
    }

    .card-trend {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--gray-500);
      font-weight: 500;
    }

    .card-trend i { font-size: 10px; }
    .trend-up   { color: #16a34a; }
    .trend-down { color: #dc2626; }

    /* ── TABLE SECTION ── */
    .table-section {
      background: var(--white);
      border: 1px solid var(--gray-200);
      border-radius: 16px;
      padding: 28px;
      animation: fadeUp 0.5s 0.42s ease both;
    }

    .table-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 24px;
    }

    .table-header-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .table-icon {
      width: 44px;
      height: 44px;
      border-radius: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--black);
    }

    .table-icon i {
      color: var(--accent);
      font-size: 18px;
    }

    .table-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--black);
      letter-spacing: -0.3px;
    }

    .table-actions {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .filter-btn,
    .export-btn {
      display: flex;
      align-items: center;
      gap: 7px;
      background: var(--gray-100);
      border: 1px solid var(--gray-200);
      padding: 9px 16px;
      border-radius: 9px;
      font-size: 12px;
      font-weight: 600;
      color: var(--black);
      font-family: 'Poppins', sans-serif;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .filter-btn:hover,
    .export-btn:hover {
      background: var(--white);
      border-color: var(--gray-300);
    }

    table {
      width: 100%;
      border-collapse: collapse;
    }

    thead {
      background: var(--gray-100);
    }

    th {
      padding: 13px 16px;
      text-align: left;
      font-size: 11px;
      font-weight: 600;
      color: var(--gray-700);
      text-transform: uppercase;
      letter-spacing: 0.9px;
      border-bottom: 1px solid var(--gray-200);
    }

    th:first-child { border-radius: 9px 0 0 9px; }
    th:last-child  { border-radius: 0 9px 9px 0; }

    td {
      padding: 16px;
      font-size: 13px;
      color: var(--black);
      border-bottom: 1px solid #f5f5f5;
    }

    tbody tr {
      transition: background 0.15s ease;
    }

    tbody tr:hover {
      background: #fafafa;
    }

    tbody tr:last-child td {
      border-bottom: none;
    }

    .id-cell {
      font-weight: 700;
      color: var(--gray-700);
      font-size: 12px;
    }

    .name-cell {
      font-weight: 600;
    }

    .pkg-pill {
      display: inline-block;
      padding: 4px 10px;
      background: var(--gray-100);
      border: 1px solid var(--gray-200);
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      color: var(--gray-700);
    }

    .date-cell {
      font-size: 12px;
      color: var(--gray-500);
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.2px;
    }

    .status-approved {
      background: var(--green-bg);
      color: var(--green-text);
      border: 1px solid var(--green-border);
    }

    .status-pending {
      background: var(--amber-bg);
      color: var(--amber-text);
      border: 1px solid var(--amber-border);
    }

    .status-rejected {
      background: var(--red-bg);
      color: var(--red-text);
      border: 1px solid var(--red-border);
    }

    .view-btn {
      background: var(--black);
      color: var(--white);
      border: none;
      padding: 7px 16px;
      border-radius: 7px;
      cursor: pointer;
      font-weight: 600;
      font-size: 11px;
      font-family: 'Poppins', sans-serif;
      transition: all 0.25s ease;
      text-decoration: none;
      display: inline-block;
      letter-spacing: 0.3px;
    }

    .view-btn:hover {
      background: #000;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    }

    /* ── EMPTY STATE ── */
    .empty-state {
      text-align: center;
      padding: 60px 20px;
    }

    .empty-state i {
      font-size: 44px;
      color: #d4d4d4;
      margin-bottom: 14px;
      display: block;
    }

    .empty-state .empty-title {
      font-size: 14px;
      font-weight: 500;
      color: var(--gray-500);
    }

    .empty-state .empty-sub {
      font-size: 12px;
      color: #bbb;
      margin-top: 6px;
    }

    /* ── RESPONSIVE ── */
    @media (max-width: 1400px) {
      .cards { grid-template-columns: repeat(2, 1fr); }
    }

    @media (max-width: 1024px) {
      .topbar-left { flex-direction: column; align-items: flex-start; gap: 14px; }
      .search-bar  { width: 100%; min-width: unset; }
    }

    @media (max-width: 768px) {
      .topbar {
        flex-direction: column;
        gap: 14px;
        padding: 14px 20px;
      }

      .topbar-left,
      .topbar-right {
        width: 100%;
      }

      .topbar-right {
        justify-content: space-between;
        flex-wrap: wrap;
      }

      .dashboard { padding: 24px 20px; }
      .cards     { grid-template-columns: 1fr; }

      .table-section  { overflow-x: auto; }
      .table-header   { flex-direction: column; align-items: flex-start; gap: 14px; }
      .table-actions  { width: 100%; }

      table           { min-width: 580px; }
      .user-name      { display: none; }
    }
  </style>
</head>
<body>

  <!-- Top Bar -->
  <div class="topbar">
    <div class="topbar-left">
      <div class="logo-area">
        <div class="logo-box"><i class="fas fa-layer-group"></i></div>
        <span class="brand-name">IGF System</span>
      </div>
      <div class="search-bar">
        <i class="fas fa-search"></i>
        <input type="text" placeholder="Search members, packages...">
      </div>
    </div>

    <div class="topbar-right">
      <div class="date-selector">
        <i class="fas fa-calendar-alt"></i>
        <span><?php echo e(date('F j, Y')); ?></span>
        <i class="fas fa-chevron-down" style="font-size: 9px;"></i>
      </div>

      <div class="notification-btn">
        <i class="fas fa-bell"></i>
        <span class="notif-dot"></span>
      </div>

      <div class="user-profile">
        <div class="user-avatar">
          <?php echo e(strtoupper(substr(Auth::user()->name ?? 'A', 0, 1))); ?>

        </div>
        <span class="user-name"><?php echo e(Auth::user()->name ?? 'Admin'); ?></span>
        <i class="fas fa-chevron-down"></i>
      </div>

      <form id="logout-form" action="<?php echo e(route('logout')); ?>" method="POST" style="display: inline;">
        <?php echo csrf_field(); ?>
        <button type="submit" class="logout-btn">Logout</button>
      </form>
    </div>
  </div>

  <!-- Dashboard -->
  <div class="dashboard">

    <!-- Summary Header -->
    <div class="summary-header">
      <div class="section-icon">
        <i class="fas fa-chart-line"></i>
      </div>
      <h2 class="section-title">Summary Overview</h2>
    </div>

    <!-- Stats Cards -->
    <div class="cards">

      <div class="card">
        <div class="card-top">
          <h3>Total Members</h3>
          <div class="card-icon-wrapper">
            <i class="fas fa-users"></i>
          </div>
        </div>
        <p><?php echo e(number_format($totalMembers ?? 0)); ?></p>
        <div class="card-trend trend-up">
          <i class="fas fa-arrow-up"></i>
          <span>Active Members</span>
        </div>
      </div>

      <div class="card">
        <div class="card-top">
          <h3>Total Payments</h3>
          <div class="card-icon-wrapper">
            <i class="fas fa-hand-holding-usd"></i>
          </div>
        </div>
        <p><?php echo e(number_format($payments ?? 0)); ?></p>
        <div class="card-trend">
          <i class="fas fa-check-circle"></i>
          <span>Collected</span>
        </div>
      </div>

      <div class="card">
        <div class="card-top">
          <h3>Approved Members</h3>
          <div class="card-icon-wrapper">
            <i class="fas fa-user-check"></i>
          </div>
        </div>
        <p><?php echo e(number_format($approvedMembers ?? 0)); ?></p>
        <div class="card-trend trend-up">
          <i class="fas fa-check"></i>
          <span>Total Approved</span>
        </div>
      </div>

      <div class="card">
        <div class="card-top">
          <h3>New Submissions</h3>
          <div class="card-icon-wrapper">
            <i class="fas fa-file-upload"></i>
          </div>
        </div>
        <p><?php echo e(number_format($newSubmissions ?? 0)); ?></p>
        <div class="card-trend">
          <i class="fas fa-clock"></i>
          <span>Pending Review</span>
        </div>
      </div>

    </div>

    <!-- Table Section -->
    <div class="table-section">
      <div class="table-header">
        <div class="table-header-left">
          <div class="table-icon">
            <i class="fas fa-clipboard-list"></i>
          </div>
          <h2 class="table-title">Recent Submissions</h2>
        </div>
        <div class="table-actions">
          <button class="filter-btn">
            <i class="fas fa-filter"></i>
            Filter
          </button>
          <button class="export-btn">
            <i class="fas fa-download"></i>
            Export
          </button>
        </div>
      </div>

      <table>
        <thead>
          <tr>
            <th>ID</th>
            <th>Member Name</th>
            <th>Package</th>
            <th>Submission Date</th>
            <th>Status</th>
            <th>Action</th>
          </tr>
        </thead>
        <tbody>
          <?php $__empty_1 = true; $__currentLoopData = $recentSubmissions ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $submission): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
          <tr>
            <td><span class="id-cell">#<?php echo e(str_pad($submission->id, 4, '0', STR_PAD_LEFT)); ?></span></td>
            <td><span class="name-cell"><?php echo e($submission->first_name); ?> <?php echo e($submission->surname); ?></span></td>
            <td><span class="pkg-pill"><?php echo e($submission->package ?? 'N/A'); ?></span></td>
            <td><span class="date-cell"><?php echo e($submission->created_at->format('M d, Y • h:i A')); ?></span></td>
            <td>
              <?php if($submission->status == 'approved'): ?>
                <span class="status-badge status-approved">
                  <i class="fas fa-check-circle"></i> Approved
                </span>
              <?php elseif($submission->status == 'rejected'): ?>
                <span class="status-badge status-rejected">
                  <i class="fas fa-times-circle"></i> Rejected
                </span>
              <?php else: ?>
                <span class="status-badge status-pending">
                  <i class="fas fa-clock"></i> Pending
                </span>
              <?php endif; ?>
            </td>
            <td>
              <a href="<?php echo e(route('submissions.show', $submission->id)); ?>" class="view-btn">View Details</a>
            </td>
          </tr>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
          <tr>
            <td colspan="6">
              <div class="empty-state">
                <i class="fas fa-inbox"></i>
                <div class="empty-title">No recent submissions found</div>
                <div class="empty-sub">Check back later for new submissions</div>
              </div>
            </td>
          </tr>
          <?php endif; ?>
        </tbody>
      </table>
    </div>

  </div>

</body>
</html>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Iron Ground Fitness Docs\Digital Gym Management System\gymerpsystem\resources\views/dashboard/index.blade.php ENDPATH**/ ?>