<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{title}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        .sidebar {
            min-height: 100vh;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-stats {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
        }
        .card-stats-2 {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
        }
        .card-stats-3 {
            background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
            color: white;
        }
        .card-stats-4 {
            background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
            color: white;
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- Sidebar -->
            <nav class="col-md-3 col-lg-2 d-md-block sidebar collapse">
                <div class="position-sticky pt-3">
                    <div class="text-center mb-4">
                        <h4 class="text-white">GBCM</h4>
                        <p class="text-white-50">Global Business Consulting</p>
                    </div>
                    
                    {#if authenticated}
                    <div class="text-center mb-4">
                        <div class="bg-white rounded-circle d-inline-flex align-items-center justify-content-center" 
                             style="width: 50px; height: 50px;">
                            <i class="fas fa-user text-primary"></i>
                        </div>
                        <div class="text-white mt-2">
                            <div class="fw-bold">{user.name}</div>
                            <small class="text-white-50">{user.email}</small>
                        </div>
                    </div>
                    {/if}

                    <ul class="nav nav-pills flex-column mb-auto">
                        <li class="nav-item">
                            <a href="/gbcm/pages/dashboard" class="nav-link text-white active">
                                <i class="fas fa-chart-line me-2"></i>
                                Tableau de Bord
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/gbcm/pages/clients" class="nav-link text-white">
                                <i class="fas fa-briefcase me-2"></i>
                                Clients
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/gbcm/pages/profile" class="nav-link text-white">
                                <i class="fas fa-user me-2"></i>
                                Profil
                            </a>
                        </li>
                    </ul>
                </div>
            </nav>

            <!-- Main content -->
            <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
                <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
                    <h1 class="h2">Tableau de Bord</h1>
                    <div class="btn-toolbar mb-2 mb-md-0">
                        <div class="btn-group me-2">
                            <button type="button" class="btn btn-sm btn-outline-secondary">
                                <i class="fas fa-download me-1"></i>
                                Exporter
                            </button>
                        </div>
                    </div>
                </div>

                <!-- Statistics Cards -->
                <div class="row mb-4">
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card card-stats border-0 shadow">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col">
                                        <h5 class="card-title text-uppercase mb-0">Clients Actifs</h5>
                                        <span class="h2 font-weight-bold mb-0">156</span>
                                    </div>
                                    <div class="col-auto">
                                        <div class="icon icon-shape bg-white text-primary rounded-circle shadow">
                                            <i class="fas fa-users fa-2x"></i>
                                        </div>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-white-50 text-sm">
                                    <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 3.48%</span>
                                    <span class="text-nowrap">Depuis le mois dernier</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card card-stats-2 border-0 shadow">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col">
                                        <h5 class="card-title text-uppercase mb-0">Revenus</h5>
                                        <span class="h2 font-weight-bold mb-0">€2.4M</span>
                                    </div>
                                    <div class="col-auto">
                                        <div class="icon icon-shape bg-white text-primary rounded-circle shadow">
                                            <i class="fas fa-euro-sign fa-2x"></i>
                                        </div>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-white-50 text-sm">
                                    <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 5.4%</span>
                                    <span class="text-nowrap">Depuis le mois dernier</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card card-stats-3 border-0 shadow">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col">
                                        <h5 class="card-title text-uppercase mb-0">Projets</h5>
                                        <span class="h2 font-weight-bold mb-0">49</span>
                                    </div>
                                    <div class="col-auto">
                                        <div class="icon icon-shape bg-white text-primary rounded-circle shadow">
                                            <i class="fas fa-project-diagram fa-2x"></i>
                                        </div>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-white-50 text-sm">
                                    <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 1.10%</span>
                                    <span class="text-nowrap">Depuis le mois dernier</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card card-stats-4 border-0 shadow">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col">
                                        <h5 class="card-title text-uppercase mb-0">Satisfaction</h5>
                                        <span class="h2 font-weight-bold mb-0">94%</span>
                                    </div>
                                    <div class="col-auto">
                                        <div class="icon icon-shape bg-white text-primary rounded-circle shadow">
                                            <i class="fas fa-heart fa-2x"></i>
                                        </div>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-white-50 text-sm">
                                    <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 12%</span>
                                    <span class="text-nowrap">Depuis le mois dernier</span>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Recent Activity -->
                <div class="row">
                    <div class="col-lg-8">
                        <div class="card shadow mb-4">
                            <div class="card-header py-3">
                                <h6 class="m-0 font-weight-bold text-primary">Activité Récente</h6>
                            </div>
                            <div class="card-body">
                                <div class="timeline">
                                    <div class="timeline-item">
                                        <div class="timeline-marker bg-primary"></div>
                                        <div class="timeline-content">
                                            <h6 class="timeline-title">Nouveau client ajouté</h6>
                                            <p class="timeline-text">TechCorp Solutions a été ajouté comme nouveau client.</p>
                                            <small class="text-muted">Il y a 2 heures</small>
                                        </div>
                                    </div>
                                    <div class="timeline-item">
                                        <div class="timeline-marker bg-success"></div>
                                        <div class="timeline-content">
                                            <h6 class="timeline-title">Projet terminé</h6>
                                            <p class="timeline-text">Le projet "Migration Cloud" a été terminé avec succès.</p>
                                            <small class="text-muted">Il y a 5 heures</small>
                                        </div>
                                    </div>
                                    <div class="timeline-item">
                                        <div class="timeline-marker bg-warning"></div>
                                        <div class="timeline-content">
                                            <h6 class="timeline-title">Réunion programmée</h6>
                                            <p class="timeline-text">Réunion avec GlobalTech prévue pour demain à 14h.</p>
                                            <small class="text-muted">Il y a 1 jour</small>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="card shadow mb-4">
                            <div class="card-header py-3">
                                <h6 class="m-0 font-weight-bold text-primary">Actions Rapides</h6>
                            </div>
                            <div class="card-body">
                                <div class="d-grid gap-2">
                                    <button class="btn btn-primary" type="button">
                                        <i class="fas fa-plus me-2"></i>
                                        Nouveau Client
                                    </button>
                                    <button class="btn btn-success" type="button">
                                        <i class="fas fa-project-diagram me-2"></i>
                                        Nouveau Projet
                                    </button>
                                    <button class="btn btn-info" type="button">
                                        <i class="fas fa-calendar me-2"></i>
                                        Planifier Réunion
                                    </button>
                                    <button class="btn btn-warning" type="button">
                                        <i class="fas fa-file-alt me-2"></i>
                                        Générer Rapport
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
