<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title><%= title %></title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css">
  <style>
    .sidebar { min-height: 100vh; background: #2c3e50; }
    .sidebar .nav-link { color: #ecf0f1; padding: 12px 20px; }
    .sidebar .nav-link:hover, .sidebar .nav-link.active { background: #34495e; color: #fff; }
    .main-content { padding: 20px; background: #ecf0f1; min-height: 100vh; }
  </style>
</head>
<body>
  <div class="container-fluid">
    <div class="row">
      <nav class="col-md-2 sidebar px-0">
        <div class="p-3 text-white border-bottom">
          <h5><i class="bi bi-shop"></i> SkyArtShop</h5>
          <small>Admin Panel</small>
        </div>
        <ul class="nav flex-column pt-3">
          <li><a class="nav-link active" href="/admin/dashboard"><i class="bi bi-speedometer2"></i> Dashboard</a></li>
          <li><a class="nav-link" href="/admin/products"><i class="bi bi-box-seam"></i> Products</a></li>
          <li><a class="nav-link" href="/admin/orders"><i class="bi bi-receipt"></i> Orders</a></li>
          <li><a class="nav-link" href="/admin/users"><i class="bi bi-people"></i> Users</a></li>
          <li><a class="nav-link text-danger mt-4" href="/admin/logout"><i class="bi bi-box-arrow-right"></i> Logout</a></li>
        </ul>
        <div class="p-3 text-white-50" style="position:absolute;bottom:0;width:100%;">
          <small>Logged: <strong><%= user.name %></strong></small>
        </div>
      </nav>
      <main class="col-md-10 main-content">
        <h1 class="h2 mb-4"><i class="bi bi-speedometer2"></i> Dashboard</h1>
        <div class="row g-3 mb-4">
          <div class="col-md-3">
            <div class="card shadow-sm">
              <div class="card-body">
                <h6 class="text-muted">Products</h6>
                <h2><%= stats.products %></h2>
              </div>
            </div>
          </div>
          <div class="col-md-3">
            <div class="card shadow-sm">
              <div class="card-body">
                <h6 class="text-muted">Orders</h6>
                <h2><%= stats.orders %></h2>
              </div>
            </div>
          </div>
          <div class="col-md-3">
            <div class="card shadow-sm">
              <div class="card-body">
                <h6 class="text-muted">Users</h6>
                <h2><%= stats.users %></h2>
              </div>
            </div>
          </div>
          <div class="col-md-3">
            <div class="card shadow-sm">
              <div class="card-body">
                <h6 class="text-muted">Pages</h6>
                <h2><%= stats.pages %></h2>
              </div>
            </div>
          </div>
        </div>
        <div class="alert alert-success"><i class="bi bi-check-circle"></i> System operational</div>
      </main>
    </div>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>