<div class="content-wrapper">
    <section class="content-header">
        <h1>
            Dashboard 
            <small>Control panel</small>
        </h1>
    </section>
    
    <section class="content">
        <div class="row">
            <div class="col-lg-3 col-xs-6">
                <div class="small-box bg-aqua">
                    <div class="inner">
                        <h3><?php echo $jumlah_artikel; ?></h3>
                        <p>Jumlah Artikel</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-android-list"></i>
                    </div>
                </div>
            </div>
            
            <div class="col-lg-3 col-xs-6">
                <div class="small-box bg-green">
                    <div class="inner">
                        <h3><?php echo $jumlah_halaman; ?></h3>
                        <p>Jumlah Halaman/Page</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-android-document"></i>
                    </div>
                </div>
            </div>
            
            <div class="col-lg-3 col-xs-6">
                <div class="small-box bg-red">
                    <div class="inner">
                        <h3><?php echo $jumlah_kategori; ?></h3>
                        <p>Jumlah Kategori</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-pie-graph"></i>
                    </div>
                </div>
            </div>
            
            <div class="col-lg-3 col-xs-6">
                <div class="small-box bg-yellow">
                    <div class="inner">
                        <h3><?php echo $jumlah_pengguna; ?></h3>
                        <p>Jumlah User</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-person-add"></i>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row">
            <div class="col-md-6">
                <!-- Chat Box -->
                <div class="box box-success">
                    <div class="box-header">
                        <i class="fa fa-comments-o"></i>
                        <h3 class="box-title">Chat</h3>
                        <div class="box-tools pull-right" data-toggle="tooltip" title="Status">
                            <div class="btn-group" data-toggle="btn-toggle">
                                <button type="button" class="btn btn-default btn-sm active"><i class="fa fa-square text-green"></i></button>
                                <button type="button" class="btn btn-default btn-sm"><i class="fa fa-square text-red"></i></button>
                            </div>
                        </div>
                    </div>
                    <div class="box-body chat" id="chat-box" style="height: 400px; overflow-y: scroll;">
                        <!-- Pesan akan dimuat secara dinamis melalui AJAX -->
                    </div>
                    <div class="box-footer">
                        <form id="chat-form">
                            <!-- Pastikan input CSRF jika protection aktif -->
                            <input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">
                            <div class="input-group">
                                <input id="message" name="message" class="form-control" placeholder="Type message..." required>
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-success">
                                        <i class="fa fa-plus"></i> Send
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>         
            </div>
            
            <div class="col-md-6">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Chart Artikel CSIRT</h3>
                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                            <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="chart">
                            <canvas id="barChart" style="height:285px"></canvas>
                        </div>
                    </div>
                </div>                
            </div>            
        </div>
    </section>
</div>
