<?php
/**
 * dashboard.php - Halaman Dashboard Admin
 * VERSI TERBARU - Modern, Informatif, dengan Sidebar Include
 */
include __DIR__ . '/../layouts/header.php';
$activeMenu = 'dashboard';

// ==============================================
// AMBIL DATA DARI CONTROLLER
// ==============================================
$totalKapal = $totalKapal ?? 0;
$totalPesanan = $totalPesanan ?? 0;
$totalUsers = $totalUsers ?? 0;
$totalPendapatan = $totalPendapatan ?? 0;
$pendingCount = $pendingCount ?? 0;
$completedCount = $completedCount ?? 0;
$activeUsers = $activeUsers ?? 0;
$pendingHapusCount = $pendingHapusCount ?? 0;
$pendingPayments = $pendingPayments ?? [];
$pendingClaims = $pendingClaims ?? [];
$kapal = $kapal ?? [];
$pesananTerbaru = $pesananTerbaru ?? [];

// Hitung kapal pending
$pendingKapal = 0;
if(isset($kapal)) {
    foreach($kapal as $k) {
        if($k['status_verifikasi'] == 'pending') $pendingKapal++;
    }
}

// Hitung total pendapatan bulan ini
$pendapatanBulanIni = 0;
$bulanIni = date('Y-m');
if(isset($pesananTerbaru)) {
    foreach($pesananTerbaru as $p) {
        if(substr($p['created_at'], 0, 7) == $bulanIni) {
            $pendapatanBulanIni += $p['total_harga'] ?? 0;
        }
    }
}
?>

<!-- Tambahkan Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">

<div class="dashboard-wrapper">
    <!-- SIDEBAR -->
    <?php include __DIR__ . '/includes/sidebar_admin.php'; ?>

    <!-- MAIN CONTENT -->
    <main class="main-content">
        <!-- HEADER -->
        <div class="content-header">
            <div class="header-left">
                <div class="welcome-text">
                    <h1>
                        <i class="fas fa-chart-line" style="color:var(--primary);"></i> 
                        Dashboard Admin
                    </h1>
                    <p>
                        Selamat datang, <strong><?= htmlspecialchars($_SESSION['nama'] ?? 'Admin') ?></strong>! 
                        Kelola seluruh sistem reservasi kapal wisata Danau Toba.
                    </p>
                </div>
            </div>
            <div class="header-right">
                <div class="header-stats">
                    <span class="date-badge">
                        <i class="far fa-calendar-alt"></i>
                        <?= date('d F Y') ?>
                    </span>
                    <span class="time-badge">
                        <i class="far fa-clock"></i>
                        <?= date('H:i') ?> WIB
                    </span>
                </div>
            </div>
        </div>

        <!-- ============================================ -->
        <!-- STATISTIK CARDS -->
        <!-- ============================================ -->
        <div class="stats-grid">
            <div class="stat-card blue">
                <div class="stat-icon"><i class="fas fa-ship"></i></div>
                <div>
                    <div class="stat-number"><?= $totalKapal ?></div>
                    <div class="stat-label">Total Kapal</div>
                    <div class="stat-sub">
                        <span class="stat-sub-pending"><?= $pendingKapal ?> menunggu verifikasi</span>
                    </div>
                </div>
            </div>
            <div class="stat-card yellow">
                <div class="stat-icon"><i class="fas fa-clipboard-list"></i></div>
                <div>
                    <div class="stat-number"><?= $totalPesanan ?></div>
                    <div class="stat-label">Total Pesanan</div>
                    <div class="stat-sub">
                        <span class="stat-sub-pending"><?= $pendingCount ?> pending</span>
                        <span class="stat-sub-completed"><?= $completedCount ?> selesai</span>
                    </div>
                </div>
            </div>
            <div class="stat-card green">
                <div class="stat-icon"><i class="fas fa-users"></i></div>
                <div>
                    <div class="stat-number"><?= $totalUsers ?></div>
                    <div class="stat-label">Pengguna</div>
                    <div class="stat-sub">
                        <span class="stat-sub-active"><?= $activeUsers ?> aktif</span>
                    </div>
                </div>
            </div>
            <div class="stat-card purple">
                <div class="stat-icon"><i class="fas fa-money-bill-wave"></i></div>
                <div>
                    <div class="stat-number">Rp <?= number_format($totalPendapatan, 0, ',', '.') ?></div>
                    <div class="stat-label">Total Pendapatan</div>
                    <div class="stat-sub">
                        <span class="stat-sub-monthly">Bulan ini: Rp <?= number_format($pendapatanBulanIni, 0, ',', '.') ?></span>
                    </div>
                </div>
            </div>
        </div>

        <!-- ============================================ -->
        <!-- QUICK STATS - Pembayaran & Claim -->
        <!-- ============================================ -->
        <div class="quick-stats">
            <div class="quick-stat-card">
                <div class="quick-stat-icon" style="background:#fef3c7; color:#92400e;">
                    <i class="fas fa-credit-card"></i>
                </div>
                <div>
                    <div class="quick-stat-number"><?= count($pendingPayments ?? []) ?></div>
                    <div class="quick-stat-label">Menunggu Konfirmasi Pembayaran</div>
                    <?php if(count($pendingPayments ?? []) > 0): ?>
                        <span class="quick-stat-badge">Perlu Tindakan</span>
                    <?php endif; ?>
                </div>
            </div>
            <div class="quick-stat-card">
                <div class="quick-stat-icon" style="background:#fce4ec; color:#c62828;">
                    <i class="fas fa-hand-holding-usd"></i>
                </div>
                <div>
                    <div class="quick-stat-number"><?= count($pendingClaims ?? []) ?></div>
                    <div class="quick-stat-label">Claim Pengembalian Menunggu</div>
                    <?php if(count($pendingClaims ?? []) > 0): ?>
                        <span class="quick-stat-badge danger">Perlu Tindakan</span>
                    <?php endif; ?>
                </div>
            </div>
            <div class="quick-stat-card">
                <div class="quick-stat-icon" style="background:#e3f2fd; color:#0d47a1;">
                    <i class="fas fa-trash-alt"></i>
                </div>
                <div>
                    <div class="quick-stat-number"><?= $pendingHapusCount ?></div>
                    <div class="quick-stat-label">Request Hapus Kapal</div>
                    <?php if($pendingHapusCount > 0): ?>
                        <span class="quick-stat-badge info">Perlu Tindakan</span>
                    <?php endif; ?>
                </div>
            </div>
            <div class="quick-stat-card">
                <div class="quick-stat-icon" style="background:#e8f5e9; color:#1b5e20;">
                    <i class="fas fa-check-circle"></i>
                </div>
                <div>
                    <div class="quick-stat-number"><?= $pendingCount ?></div>
                    <div class="quick-stat-label">Pesanan Pending</div>
                    <?php if($pendingCount > 0): ?>
                        <span class="quick-stat-badge success">Menunggu</span>
                    <?php endif; ?>
                </div>
            </div>
        </div>

        <!-- ============================================ -->
        <!-- MENU AKSI CEPAT -->
        <!-- ============================================ -->
        <div class="quick-actions">
            <div class="quick-actions-header">
                <h3><i class="fas fa-bolt" style="color:var(--secondary);"></i> Aksi Cepat</h3>
                <span class="quick-desc">Akses fitur utama dengan cepat</span>
            </div>
            <div class="action-grid">
                <a href="?page=admin&action=kelolaKapal" class="action-card">
                    <span class="action-icon"><i class="fas fa-ship"></i></span>
                    <span class="action-label">Kelola Kapal</span>
                    <span class="action-desc">Tambah/kelola kapal</span>
                    <?php if($pendingKapal > 0): ?>
                        <span class="action-badge"><?= $pendingKapal ?></span>
                    <?php endif; ?>
                </a>
                <a href="?page=admin&action=kelolaPesanan" class="action-card">
                    <span class="action-icon"><i class="fas fa-clipboard-list"></i></span>
                    <span class="action-label">Kelola Pesanan</span>
                    <span class="action-desc">Lihat semua pesanan</span>
                    <?php if($pendingCount > 0): ?>
                        <span class="action-badge"><?= $pendingCount ?></span>
                    <?php endif; ?>
                </a>
                <a href="?page=admin&action=kelolaSupir" class="action-card">
                    <span class="action-icon"><i class="fas fa-users"></i></span>
                    <span class="action-label">Kelola Supir</span>
                    <span class="action-desc">Kelola pemilik kapal</span>
                </a>
                <a href="?page=admin&action=konfirmasiPembayaran" class="action-card">
                    <span class="action-icon"><i class="fas fa-credit-card"></i></span>
                    <span class="action-label">Konfirmasi Bayar</span>
                    <span class="action-desc">Konfirmasi pembayaran</span>
                    <?php if(isset($pendingPayments) && count($pendingPayments) > 0): ?>
                        <span class="action-badge"><?= count($pendingPayments) ?></span>
                    <?php endif; ?>
                </a>
                <a href="?page=admin&action=claimPengembalian" class="action-card">
                    <span class="action-icon"><i class="fas fa-hand-holding-usd"></i></span>
                    <span class="action-label">Claim Pengembalian</span>
                    <span class="action-desc">Proses claim dana</span>
                    <?php if(isset($pendingClaims) && count($pendingClaims) > 0): ?>
                        <span class="action-badge"><?= count($pendingClaims) ?></span>
                    <?php endif; ?>
                </a>
                <a href="?page=admin&action=laporan" class="action-card">
                    <span class="action-icon"><i class="fas fa-file-invoice-dollar"></i></span>
                    <span class="action-label">Laporan</span>
                    <span class="action-desc">Lihat laporan pendapatan</span>
                </a>
            </div>
        </div>

        <!-- ============================================ -->
        <!-- PESANAN TERBARU & INFORMASI -->
        <!-- ============================================ -->
        <div class="info-section">
            <div class="info-card">
                <h4><i class="fas fa-clock" style="color:#f59e0b;"></i> Pesanan Terbaru</h4>
                <?php if(empty($pesananTerbaru)): ?>
                    <p style="color:var(--gray-400); text-align:center; padding:1rem 0;">Belum ada pesanan</p>
                <?php else: ?>
                    <ul>
                        <?php foreach(array_slice($pesananTerbaru, 0, 5) as $p): ?>
                            <li>
                                <span>
                                    <strong><?= htmlspecialchars($p['nama_kapal'] ?? '-') ?></strong>
                                    <br>
                                    <small style="color:var(--gray-400);">
                                        <?= date('d/m/Y', strtotime($p['tanggal_berangkat'] ?? 'now')) ?>
                                    </small>
                                </span>
                                <span style="font-weight:600; color:var(--primary);">
                                    Rp <?= number_format($p['total_harga'] ?? 0, 0, ',', '.') ?>
                                </span>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                    <?php if(count($pesananTerbaru) > 5): ?>
                        <a href="?page=admin&action=kelolaPesanan" class="view-all-link">
                            Lihat semua pesanan →
                        </a>
                    <?php endif; ?>
                <?php endif; ?>
            </div>
            <div class="info-card">
                <h4><i class="fas fa-chart-bar" style="color:var(--secondary);"></i> Statistik Singkat</h4>
                <ul>
                    <li>
                        <span><strong>Kapal Terverifikasi</strong></span>
                        <span>
                            <?php 
                            $verified = 0;
                            if(isset($kapal)) {
                                foreach($kapal as $k) {
                                    if($k['status_verifikasi'] == 'verified') $verified++;
                                }
                            }
                            echo $verified;
                            ?>
                        </span>
                    </li>
                    <li>
                        <span><strong>Pesanan Pending</strong></span>
                        <span style="color:#92400e;"><?= $pendingCount ?></span>
                    </li>
                    <li>
                        <span><strong>Pesanan Selesai</strong></span>
                        <span style="color:#065f46;"><?= $completedCount ?></span>
                    </li>
                    <li>
                        <span><strong>Pengguna Aktif</strong></span>
                        <span><?= $activeUsers ?></span>
                    </li>
                    <li>
                        <span><strong>Request Hapus Kapal</strong></span>
                        <span style="color:var(--danger);"><?= $pendingHapusCount ?></span>
                    </li>
                    <li>
                        <span><strong>Menunggu Konfirmasi Bayar</strong></span>
                        <span style="color:var(--danger);"><?= count($pendingPayments ?? []) ?></span>
                    </li>
                    <li>
                        <span><strong>Claim Pengembalian</strong></span>
                        <span style="color:var(--danger);"><?= count($pendingClaims ?? []) ?></span>
                    </li>
                </ul>
            </div>
        </div>

        <!-- ============================================ -->
        <!-- FOOTER DASHBOARD -->
        <!-- ============================================ -->
        <div class="dashboard-footer">
            <div class="footer-info">
                <span>
                    <i class="fas fa-database"></i> 
                    Database: <?= date('d/m/Y H:i') ?>
                </span>
                <span>
                    <i class="fas fa-code-branch"></i> 
                    Versi: 2.0.0
                </span>
                <span>
                    <i class="fas fa-server"></i> 
                    Sistem Reservasi Kapal Wisata
                </span>
            </div>
            <div class="footer-time">
                <i class="fas fa-sync-alt fa-spin"></i>
                Last update: <?= date('H:i:s') ?>
            </div>
        </div>
    </main>
</div>

<style>
    /* ============================================
       LAYOUT
       ============================================ */
    .dashboard-wrapper {
        display: flex;
        gap: 24px;
        max-width: 1280px;
        margin: 1.5rem auto 0;
        padding: 0 20px;
        width: 100%;
        flex: 1;
        align-items: flex-start;
    }

    .main-content {
        flex: 1;
        min-width: 0;
        background: #fff;
        border-radius: 16px;
        padding: 1.8rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
        border: 1px solid var(--gray-200);
    }

    /* ============================================
       HEADER
       ============================================ */
    .content-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-left h1 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--gray-900);
        margin-bottom: 0.2rem;
    }

    .header-left p {
        color: var(--gray-500);
        font-size: 0.95rem;
        margin: 0;
    }

    .header-left p strong {
        color: var(--gray-700);
    }

    .header-right .header-stats {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .date-badge,
    .time-badge {
        background: var(--gray-100);
        padding: 0.3rem 1rem;
        border-radius: 20px;
        font-size: 0.8rem;
        color: var(--gray-600);
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        white-space: nowrap;
    }

    /* ============================================
       STATISTIK CARDS
       ============================================ */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        background: #fff;
        padding: 1rem 1.2rem;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.04);
        display: flex;
        align-items: center;
        gap: 1rem;
        border-left: 4px solid var(--primary);
        transition: var(--transition);
        border: 1px solid var(--gray-100);
    }

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }

    .stat-card .stat-icon {
        font-size: 1.8rem;
        opacity: 0.7;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: var(--gray-50);
    }

    .stat-card .stat-icon i {
        font-size: 1.4rem;
    }

    .stat-card .stat-number {
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--gray-900);
        line-height: 1.2;
    }

    .stat-card .stat-label {
        color: var(--gray-500);
        font-size: 0.8rem;
        font-weight: 500;
    }

    .stat-card .stat-sub {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-top: 0.2rem;
    }

    .stat-sub .stat-sub-pending {
        font-size: 0.65rem;
        color: #92400e;
        background: #fef3c7;
        padding: 0.05rem 0.5rem;
        border-radius: 10px;
    }

    .stat-sub .stat-sub-completed {
        font-size: 0.65rem;
        color: #065f46;
        background: #d1fae5;
        padding: 0.05rem 0.5rem;
        border-radius: 10px;
    }

    .stat-sub .stat-sub-active {
        font-size: 0.65rem;
        color: #065f46;
        background: #d1fae5;
        padding: 0.05rem 0.5rem;
        border-radius: 10px;
    }

    .stat-sub .stat-sub-monthly {
        font-size: 0.65rem;
        color: #1e40af;
        background: #dbeafe;
        padding: 0.05rem 0.5rem;
        border-radius: 10px;
    }

    .stat-card.blue { border-left-color: var(--primary); }
    .stat-card.blue .stat-icon { background: #dbeafe; color: var(--primary); }
    .stat-card.yellow { border-left-color: var(--secondary); }
    .stat-card.yellow .stat-icon { background: #fef3c7; color: var(--secondary); }
    .stat-card.green { border-left-color: var(--success); }
    .stat-card.green .stat-icon { background: #d1fae5; color: var(--success); }
    .stat-card.purple { border-left-color: #8b5cf6; }
    .stat-card.purple .stat-icon { background: #ede9fe; color: #8b5cf6; }

    /* ============================================
       QUICK STATS
       ============================================ */
    .quick-stats {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .quick-stat-card {
        background: #fff;
        padding: 0.8rem 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.04);
        display: flex;
        align-items: center;
        gap: 0.8rem;
        border: 1px solid var(--gray-100);
        transition: var(--transition);
        position: relative;
    }

    .quick-stat-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }

    .quick-stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .quick-stat-number {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--gray-900);
        line-height: 1.2;
    }

    .quick-stat-label {
        font-size: 0.7rem;
        color: var(--gray-500);
    }

    .quick-stat-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        font-size: 0.55rem;
        font-weight: 700;
        padding: 0.1rem 0.4rem;
        border-radius: 10px;
        background: #f59e0b;
        color: #fff;
    }

    .quick-stat-badge.danger {
        background: #ef4444;
    }

    .quick-stat-badge.success {
        background: #22c55e;
    }

    .quick-stat-badge.info {
        background: #3b82f6;
    }

    /* ============================================
       QUICK ACTIONS
       ============================================ */
    .quick-actions {
        background: #fff;
        border-radius: 14px;
        padding: 1.5rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.04);
        border: 1px solid var(--gray-200);
        margin-bottom: 1.5rem;
    }

    .quick-actions-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .quick-actions h3 {
        font-size: 1rem;
        font-weight: 700;
        color: var(--gray-900);
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .quick-desc {
        font-size: 0.8rem;
        color: var(--gray-400);
    }

    .action-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
    }

    .action-card {
        background: var(--gray-50);
        border-radius: 10px;
        padding: 1rem 0.8rem;
        text-align: center;
        transition: var(--transition);
        border: 1px solid transparent;
        color: var(--gray-700);
        text-decoration: none;
        display: block;
        position: relative;
    }

    .action-card:hover {
        background: #fff;
        border-color: var(--primary);
        transform: translateY(-3px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.06);
        text-decoration: none;
        color: var(--gray-900);
    }

    .action-card .action-icon {
        font-size: 1.6rem;
        display: block;
        margin-bottom: 0.3rem;
        color: var(--primary);
    }

    .action-card .action-icon i {
        font-size: 1.6rem;
    }

    .action-card .action-label {
        font-weight: 600;
        font-size: 0.85rem;
        display: block;
    }

    .action-card .action-desc {
        font-size: 0.65rem;
        color: var(--gray-400);
        display: block;
        margin-top: 0.1rem;
    }

    .action-card .action-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ef4444;
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        padding: 0.1rem 0.4rem;
        border-radius: 50%;
        min-width: 18px;
        text-align: center;
        line-height: 1.4;
    }

    /* ============================================
       INFO SECTION
       ============================================ */
    .info-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .info-card {
        background: #fff;
        border-radius: 14px;
        padding: 1.2rem 1.5rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.04);
        border: 1px solid var(--gray-200);
    }

    .info-card h4 {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--gray-900);
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .info-card ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .info-card ul li {
        padding: 0.3rem 0;
        font-size: 0.85rem;
        color: var(--gray-600);
        border-bottom: 1px solid var(--gray-100);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .info-card ul li:last-child {
        border-bottom: none;
    }

    .info-card ul li strong {
        color: var(--gray-800);
    }

    .view-all-link {
        display: block;
        text-align: center;
        margin-top: 0.5rem;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--primary);
        text-decoration: none;
        transition: var(--transition);
    }

    .view-all-link:hover {
        color: var(--primary-light);
        text-decoration: underline;
    }

    /* ============================================
       DASHBOARD FOOTER
       ============================================ */
    .dashboard-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid var(--gray-200);
        margin-top: 0.5rem;
    }

    .footer-info {
        display: flex;
        gap: 1.5rem;
        flex-wrap: wrap;
        font-size: 0.75rem;
        color: var(--gray-400);
    }

    .footer-info i {
        margin-right: 0.2rem;
    }

    .footer-time {
        font-size: 0.75rem;
        color: var(--gray-400);
    }

    .footer-time i {
        margin-right: 0.3rem;
    }

    /* ============================================
       RESPONSIVE
       ============================================ */
    @media (max-width: 992px) {
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
        }
        .quick-stats {
            grid-template-columns: repeat(2, 1fr);
        }
        .info-section {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 768px) {
        .dashboard-wrapper {
            flex-direction: column;
            padding: 0 12px;
            margin-top: 1rem;
        }

        .main-content {
            padding: 1rem;
        }

        .content-header {
            flex-direction: column;
            align-items: flex-start;
        }

        .header-right .header-stats {
            width: 100%;
            justify-content: flex-start;
        }

        .stats-grid {
            grid-template-columns: 1fr 1fr;
            gap: 0.7rem;
        }

        .quick-stats {
            grid-template-columns: 1fr 1fr;
            gap: 0.7rem;
        }

        .action-grid {
            grid-template-columns: 1fr 1fr;
        }

        .info-section {
            grid-template-columns: 1fr;
        }

        .stat-card .stat-number {
            font-size: 1.2rem;
        }

        .stat-card .stat-icon {
            font-size: 1.2rem;
            width: 36px;
            height: 36px;
        }

        .dashboard-footer {
            flex-direction: column;
            align-items: flex-start;
        }

        .footer-info {
            gap: 0.8rem;
            flex-direction: column;
        }
    }

    @media (max-width: 480px) {
        .main-content {
            padding: 0.8rem;
        }

        .stats-grid {
            grid-template-columns: 1fr;
        }

        .quick-stats {
            grid-template-columns: 1fr;
        }

        .action-grid {
            grid-template-columns: 1fr;
        }

        .quick-actions {
            padding: 1rem;
        }

        .quick-actions-header {
            flex-direction: column;
            align-items: flex-start;
        }

        .content-header h1 {
            font-size: 1.2rem;
        }

        .stat-card .stat-number {
            font-size: 1rem;
        }

        .quick-stat-number {
            font-size: 1rem;
        }
    }
</style>

<?php include __DIR__ . '/../layouts/footer.php'; ?>