<?php
$title = isset($title) ? $title : 'Admin';
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= e($title) ?> | Furnify Admin</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    <link href="../assets/css/styles.css" rel="stylesheet">
    <style>
        body{background:#f6f3ec}.admin-shell{min-height:100vh}.admin-sidebar{background:#102821;color:#fff}.admin-sidebar a{color:rgba(255,255,255,.78);text-decoration:none;display:flex;gap:.6rem;align-items:center;padding:.75rem 1rem;border-radius:1rem}.admin-sidebar a:hover,.admin-sidebar a.active{background:rgba(255,255,255,.12);color:#fff}.admin-card{background:#fff;border:1px solid rgba(16,40,33,.08);border-radius:1.5rem;box-shadow:0 18px 60px rgba(16,40,33,.08)}.admin-table img{width:70px;height:52px;object-fit:cover;border-radius:.8rem}.login-panel{max-width:440px;margin:8vh auto}.form-help{font-size:.85rem;color:#6c757d}.admin-muted{color:#66736d}.badge-soft{background:#ecf4ef;color:#102821}.code-box{background:#101410;color:#e9f7ea;border-radius:1rem;padding:1rem;overflow:auto}.admin-topbar{background:#fff;border-bottom:1px solid rgba(16,40,33,.08)}
    </style>
</head>
<body>
<div class="admin-shell d-lg-flex">
    <?php if (admin_is_logged_in()): ?>
        <aside class="admin-sidebar p-3 col-lg-2">
            <div class="d-flex align-items-center gap-2 mb-4 px-2">
                <span class="brand-mark" aria-hidden="true"></span>
                <strong>Furnify Admin</strong>
            </div>
            <nav class="d-grid gap-2">
                <a href="index.php"><i class="bi bi-speedometer2"></i> Dashboard</a>
                <a href="products.php"><i class="bi bi-box-seam"></i> Products</a>
                <a href="orders.php"><i class="bi bi-receipt"></i> Orders</a>
                <a href="customers.php"><i class="bi bi-people"></i> Customers</a>
                <a href="custom-quotes.php"><i class="bi bi-pencil-square"></i> Custom Sofa</a>
                <a href="reup.php"><i class="bi bi-magic"></i> Re-Up</a>
                <a href="account.php"><i class="bi bi-person-gear"></i> Account</a>
                <a href="../index.php" target="_blank"><i class="bi bi-shop"></i> View Store</a>
                <a href="logout.php"><i class="bi bi-box-arrow-right"></i> Logout</a>
            </nav>
        </aside>
        <div class="flex-grow-1">
            <div class="admin-topbar px-4 py-3 d-flex justify-content-between align-items-center">
                <div><strong><?= e($title) ?></strong></div>
                <div class="admin-muted">Signed in as <?= e(admin_current_name()) ?></div>
            </div>
            <main class="p-3 p-lg-4">
    <?php else: ?>
        <main class="container">
    <?php endif; ?>
