<?php
include 'includes/auth.php';
include 'db.php';

// ================= DASHBOARD CONFIG =================
$dashboard_title = 'Bar Dashboard';
$dashboard_icon  = 'fa-beer';
$module_cards = [
    ['link'=>'sales_pos.php',       'icon'=>'fa-cash-register', 'title'=>'POS',         'color'=>'bg-info'],
    ['link'=>'open_bar_tab.php',    'icon'=>'fa-folder-plus',   'title'=>'Open Tab',    'color'=>'bg-primary'],
    ['link'=>'bar_tab_pos.php',     'icon'=>'fa-receipt',       'title'=>'Tabs',        'color'=>'bg-warning'],
    ['link'=>'bar_sale_list.php',   'icon'=>'fa-glass-cheers',  'title'=>'Bar Sales',   'color'=>'bg-success'],
    ['link'=>'bar_requisitions.php','icon'=>'fa-clipboard-list','title'=>'Bar Requisitions','color'=>'bg-secondary'],

    // ✅ NEW BUTTONS
    ['link'=>'bar_inventory.php',   'icon'=>'fa-warehouse',     'title'=>'Bar Inventory',   'color'=>'bg-dark'],



    // ✅ NEW BUTTONS
    ['link'=>'bar_req_reports.php',   'icon'=>'fa-glass-cheers',     'title'=>'Bar Requisitions Reports',   'color'=>'bg-dark'],


    ['link'=>'bar_reports.php',     'icon'=>'fa-chart-line',    'title'=>'Bar Sale Reports',     'color'=>'bg-danger'],
];

// Include header
include 'includes/header.php';
?>

<style>
/* ================= STYLING CARDS ================= */
.card-module {
    width: 140px;
    text-align: center;
    display: inline-block;
    border-radius: 10px;
    transition: 0.2s;
    cursor: pointer;
}

.card-module:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
}

.card-module a {
    text-decoration: none;
    color: inherit;
}

.icon-box {
    font-size: 28px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 10px auto;
    color: #fff;
}

.welcome-msg {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #1b4d32;
}

.flex-center {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}
</style>

<div class="container-fluid mt-4">

    <!-- ================= WELCOME MESSAGE ================= -->
    <div class="welcome-msg">
        <i class="fa fa-user-circle"></i> Welcome, <strong><?= htmlspecialchars($_SESSION['username'] ?? 'Guest') ?></strong>!
    </div>

    <h3 class="mb-3">
        <i class="fa <?= $dashboard_icon ?> text-success"></i> <?= $dashboard_title ?>
    </h3>
    <hr>

    <!-- ================= MODULE CARDS ================= -->
    <div class="flex-center">
        <?php foreach($module_cards as $card): ?>
            <div class="card card-module shadow-sm">
                <a href="<?= $card['link'] ?>">
                    <div class="card-body p-2">
                        <div class="icon-box <?= $card['color'] ?>">
                            <i class="fa <?= $card['icon'] ?>"></i>
                        </div>
                        <h6><?= $card['title'] ?></h6>
                    </div>
                </a>
            </div>
        <?php endforeach; ?>
    </div>
<div class="tips-box" align="center">
  
</div>
</div>

<?php include 'includes/footer.php'; ?>
