<!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%);
        }
        .client-card {
            transition: transform 0.2s;
        }
        .client-card:hover {
            transform: translateY(-5px);
        }
        .status-badge {
            font-size: 0.75rem;
        }
    </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">
                                <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 active">
                                <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">Gestion des Clients</h1>
                    <div class="btn-toolbar mb-2 mb-md-0">
                        <div class="btn-group me-2">
                            <button type="button" class="btn btn-primary">
                                <i class="fas fa-plus me-1"></i>
                                Nouveau Client
                            </button>
                            <button type="button" class="btn btn-outline-secondary">
                                <i class="fas fa-download me-1"></i>
                                Exporter
                            </button>
                        </div>
                    </div>
                </div>

                <!-- Search and Filters -->
                <div class="row mb-4">
                    <div class="col-md-6">
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-search"></i></span>
                            <input type="text" class="form-control" placeholder="Rechercher un client...">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <select class="form-select">
                            <option selected>Tous les statuts</option>
                            <option value="actif">Actif</option>
                            <option value="inactif">Inactif</option>
                            <option value="prospect">Prospect</option>
                        </select>
                    </div>
                    <div class="col-md-3">
                        <select class="form-select">
                            <option selected>Tous les secteurs</option>
                            <option value="tech">Technologie</option>
                            <option value="finance">Finance</option>
                            <option value="retail">Commerce</option>
                        </select>
                    </div>
                </div>

                <!-- Statistics Cards -->
                <div class="row mb-4">
                    <div class="col-md-3">
                        <div class="card text-center border-primary">
                            <div class="card-body">
                                <h5 class="card-title text-primary">156</h5>
                                <p class="card-text">Clients Actifs</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card text-center border-success">
                            <div class="card-body">
                                <h5 class="card-title text-success">23</h5>
                                <p class="card-text">Nouveaux ce mois</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card text-center border-warning">
                            <div class="card-body">
                                <h5 class="card-title text-warning">12</h5>
                                <p class="card-text">Prospects</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card text-center border-info">
                            <div class="card-body">
                                <h5 class="card-title text-info">€2.4M</h5>
                                <p class="card-text">Chiffre d'affaires</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Clients List -->
                <div class="card shadow">
                    <div class="card-header">
                        <h6 class="m-0 font-weight-bold text-primary">Liste des Clients</h6>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <!-- Client Card 1 -->
                            <div class="col-lg-4 col-md-6 mb-4">
                                <div class="card client-card h-100 shadow-sm">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between align-items-start mb-3">
                                            <div class="d-flex align-items-center">
                                                <div class="bg-primary rounded-circle d-flex align-items-center justify-content-center me-3" 
                                                     style="width: 40px; height: 40px;">
                                                    <span class="text-white fw-bold">TC</span>
                                                </div>
                                                <div>
                                                    <h6 class="mb-0">TechCorp Solutions</h6>
                                                    <small class="text-muted">Technologie</small>
                                                </div>
                                            </div>
                                            <span class="badge bg-success status-badge">Actif</span>
                                        </div>
                                        <p class="card-text text-muted small">
                                            Société de développement logiciel spécialisée dans les solutions cloud.
                                        </p>
                                        <div class="row text-center">
                                            <div class="col-4">
                                                <small class="text-muted">Projets</small>
                                                <div class="fw-bold">8</div>
                                            </div>
                                            <div class="col-4">
                                                <small class="text-muted">CA</small>
                                                <div class="fw-bold">€450K</div>
                                            </div>
                                            <div class="col-4">
                                                <small class="text-muted">Depuis</small>
                                                <div class="fw-bold">2022</div>
                                            </div>
                                        </div>
                                        <div class="mt-3">
                                            <button class="btn btn-sm btn-outline-primary me-2">
                                                <i class="fas fa-eye"></i>
                                            </button>
                                            <button class="btn btn-sm btn-outline-secondary me-2">
                                                <i class="fas fa-edit"></i>
                                            </button>
                                            <button class="btn btn-sm btn-outline-info">
                                                <i class="fas fa-envelope"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- Client Card 2 -->
                            <div class="col-lg-4 col-md-6 mb-4">
                                <div class="card client-card h-100 shadow-sm">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between align-items-start mb-3">
                                            <div class="d-flex align-items-center">
                                                <div class="bg-success rounded-circle d-flex align-items-center justify-content-center me-3" 
                                                     style="width: 40px; height: 40px;">
                                                    <span class="text-white fw-bold">GT</span>
                                                </div>
                                                <div>
                                                    <h6 class="mb-0">GlobalTech Inc.</h6>
                                                    <small class="text-muted">Finance</small>
                                                </div>
                                            </div>
                                            <span class="badge bg-success status-badge">Actif</span>
                                        </div>
                                        <p class="card-text text-muted small">
                                            Entreprise fintech proposant des solutions de paiement innovantes.
                                        </p>
                                        <div class="row text-center">
                                            <div class="col-4">
                                                <small class="text-muted">Projets</small>
                                                <div class="fw-bold">12</div>
                                            </div>
                                            <div class="col-4">
                                                <small class="text-muted">CA</small>
                                                <div class="fw-bold">€780K</div>
                                            </div>
                                            <div class="col-4">
                                                <small class="text-muted">Depuis</small>
                                                <div class="fw-bold">2021</div>
                                            </div>
                                        </div>
                                        <div class="mt-3">
                                            <button class="btn btn-sm btn-outline-primary me-2">
                                                <i class="fas fa-eye"></i>
                                            </button>
                                            <button class="btn btn-sm btn-outline-secondary me-2">
                                                <i class="fas fa-edit"></i>
                                            </button>
                                            <button class="btn btn-sm btn-outline-info">
                                                <i class="fas fa-envelope"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- Client Card 3 -->
                            <div class="col-lg-4 col-md-6 mb-4">
                                <div class="card client-card h-100 shadow-sm">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between align-items-start mb-3">
                                            <div class="d-flex align-items-center">
                                                <div class="bg-warning rounded-circle d-flex align-items-center justify-content-center me-3" 
                                                     style="width: 40px; height: 40px;">
                                                    <span class="text-white fw-bold">RS</span>
                                                </div>
                                                <div>
                                                    <h6 class="mb-0">RetailSmart</h6>
                                                    <small class="text-muted">Commerce</small>
                                                </div>
                                            </div>
                                            <span class="badge bg-warning status-badge">Prospect</span>
                                        </div>
                                        <p class="card-text text-muted small">
                                            Chaîne de magasins cherchant à digitaliser ses processus.
                                        </p>
                                        <div class="row text-center">
                                            <div class="col-4">
                                                <small class="text-muted">Projets</small>
                                                <div class="fw-bold">2</div>
                                            </div>
                                            <div class="col-4">
                                                <small class="text-muted">CA</small>
                                                <div class="fw-bold">€120K</div>
                                            </div>
                                            <div class="col-4">
                                                <small class="text-muted">Depuis</small>
                                                <div class="fw-bold">2024</div>
                                            </div>
                                        </div>
                                        <div class="mt-3">
                                            <button class="btn btn-sm btn-outline-primary me-2">
                                                <i class="fas fa-eye"></i>
                                            </button>
                                            <button class="btn btn-sm btn-outline-secondary me-2">
                                                <i class="fas fa-edit"></i>
                                            </button>
                                            <button class="btn btn-sm btn-outline-info">
                                                <i class="fas fa-envelope"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Pagination -->
                        <nav aria-label="Page navigation">
                            <ul class="pagination justify-content-center">
                                <li class="page-item disabled">
                                    <a class="page-link" href="#" tabindex="-1">Précédent</a>
                                </li>
                                <li class="page-item active"><a class="page-link" href="#">1</a></li>
                                <li class="page-item"><a class="page-link" href="#">2</a></li>
                                <li class="page-item"><a class="page-link" href="#">3</a></li>
                                <li class="page-item">
                                    <a class="page-link" href="#">Suivant</a>
                                </li>
                            </ul>
                        </nav>
                    </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>
