<?php include('layout/template-top.php'); ?>
<?php include('layout/header.php'); ?>
<!-- Main Container -->
<div class="main-container">
    <div class="md-pd-ltr-20">
        <!-- Welcome Banner -->
        <div class="card-box pd-20 height-100-p mb-30">
            <div class="row align-items-center">
                <div class="col-md-8">
                    <h4 class="font-20 weight-500 mb-10 text-capitalize md-wlc-title">
                        Welcome back, <span class="weight-600 font-30 text-blue md-wlc-user-title"><?php echo $this->session->userdata('name'); ?>!</span>
                    </h4>
                    <p class="font-18 max-width-600 mb-0 md-user-details">
                        <strong>Role:</strong> <?php echo $this->session->userdata('role'); ?>
                    </p>
                </div>
                <div class="col-md-4">
                    <img src="<?php echo base_url('assets/images/banner-img.png'); ?>" class="dashboard-image" alt="">
                </div>
            </div>
        </div>

        <!-- Super Admin Statistics -->
        <div class="row mb-30">
            <!-- Total Users -->
            <div class="col-md-3 md-mb-30">
                <div class="card-box pd-30 height-100-p" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px;">
                    <div class="d-flex justify-content-between align-items-center h-100">
                        <div class="text-white">
                            <div class="weight-700 font-30 mb-2">
                                <?php echo $total_users; ?>
                            </div>
                            <div class="font-16 weight-500">Total Users</div>
                        </div>
                        <div class="text-white" style="font-size: 50px; opacity: 0.25;">
                            <i class="fa fa-users"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Active Users -->
            <div class="col-md-3 md-mb-30">
                <div class="card-box pd-30 height-100-p" style="background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); border-radius: 12px;">
                    <div class="d-flex justify-content-between align-items-center h-100">
                        <div class="text-white">
                            <div class="weight-700 font-30 mb-2">
                                <?php echo $active_users; ?>
                            </div>
                            <div class="font-16 weight-500">Active Users</div>
                        </div>
                        <div class="text-white" style="font-size: 50px; opacity: 0.25;">
                            <i class="fa fa-user-check"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Total Branches -->
            <div class="col-md-3 md-mb-30">
                <div class="card-box pd-30 height-100-p" style="background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%); border-radius: 12px;">
                    <div class="d-flex justify-content-between align-items-center h-100">
                        <div class="text-white">
                            <div class="weight-700 font-30 mb-2">
                                <?php echo $total_branches; ?>
                            </div>
                            <div class="font-16 weight-500">Total Branches</div>
                        </div>
                        <div class="text-white" style="font-size: 50px; opacity: 0.25;">
                            <i class="fa fa-building"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Active Branches -->
            <div class="col-md-3">
                <div class="card-box pd-30 height-100-p" style="background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%); border-radius: 12px;">
                    <div class="d-flex justify-content-between align-items-center h-100">
                        <div class="text-white">
                            <div class="weight-700 font-30 mb-2">
                                <?php echo $active_branches; ?>
                            </div>
                            <div class="font-16 weight-500">Active Branches</div>
                        </div>
                        <div class="text-white" style="font-size: 50px; opacity: 0.25;">
                            <i class="fa fa-check-circle"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Quick Actions -->
        <div class="card-box mb-30">
            <div class="pd-20">
                <h2 class="h4 mb-20">Quick Actions</h2>
                <div class="row">
                    <div class="col-md-3 mb-20">
                        <a href="<?php echo base_url('users/add'); ?>" class="btn btn-primary btn-block">
                            <i class="fa fa-plus"></i> Add New User
                        </a>
                    </div>
                    <div class="col-md-3 mb-20">
                        <a href="<?php echo base_url('users'); ?>" class="btn btn-info btn-block">
                            <i class="fa fa-list"></i> View All Users
                        </a>
                    </div>
                    <div class="col-md-3 mb-20">
                        <a href="<?php echo base_url('branches/add'); ?>" class="btn btn-warning btn-block text-white">
                            <i class="fa fa-plus"></i> Add New Branch
                        </a>
                    </div>
                    <div class="col-md-3 mb-20">
                        <a href="<?php echo base_url('branches'); ?>" class="btn btn-success btn-block">
                            <i class="fa fa-list"></i> View All Branches
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <?php include('layout/footer.php'); ?>
    </div>
</div>
<?php include('layout/template-bottom.php'); ?>
