* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #66ee66 0%, #77aa77 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #66ee66;
}

.logo i {
    margin-right: 10px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 10px;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

nav a:hover, nav a.active {
    background: #66ee66;
    color: white;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #66ee66;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #66ee66 0%, #66aa66 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card.danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card h3 {
    font-size: 36px;
    margin: 10px 0;
}

.stat-card p {
    opacity: 0.9;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th {
    background: #66ee66;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: #f5f5f5;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #66ee66;
    color: white;
}

.btn-success {
    background: #4facfe;
    color: white;
}

.btn-warning {
    background: #fa709a;
    color: white;
}

.btn-danger {
    background: #f5576c;
    color: white;
}

.btn-info {
    background: #43e97b;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #66ee66;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #66ee66;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #333;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* Pagination */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 40px;
    text-align: center;
}

.pagination .btn.active {
    background: #66ee66;
    color: white;
    cursor: default;
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination {
        gap: 5px;
    }
    
    .pagination .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .pagination .btn-sm i {
        display: none; /* Cache les icônes sur mobile */
    }
}
/* HEADER BASE */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { font-size: 22px; font-weight: bold; color: #66ee66; text-decoration: none; display:flex; align-items:center; gap:10px; }
.logo:hover { color: #66dd66; }

/* DESKTOP NAV */
.main-nav { display:flex; align-items:center; gap:20px; }
.nav-list { display:flex; list-style:none; margin:0; padding:0; gap:5px; }
.nav-list a {
    display:flex; align-items:center; gap:8px;
    padding:10px 15px; color:#555; text-decoration:none;
    border-radius:8px; transition:all 0.2s; font-weight:500;
}
.nav-list a:hover, .nav-list a.active {
    background: linear-gradient(135deg, #66ee66, #66aa66);
    color:white; transform:translateY(-1px);
}
.nav-footer { display:flex; align-items:center; gap:15px; margin-left:20px; }
.user-info { display:flex; align-items:center; gap:8px; font-size:14px; color:#555; }
.btn-logout { color:#66ff66; text-decoration:none; font-size:14px; display:flex; align-items:center; gap:6px; }

/* BOUTON HAMBURGER */
.nav-toggle { display:none; background:none; border:none; cursor:pointer; padding:8px; flex-direction:column; gap:5px; }
.bar { display:block; width:24px; height:3px; background:#66ee66; border-radius:2px; transition:0.3s; }
.nav-toggle.active .bar:nth-child(1) { transform:rotate(45deg) translate(5px,6px); }
.nav-toggle.active .bar:nth-child(2) { opacity:0; }
.nav-toggle.active .bar:nth-child(3) { transform:rotate(-45deg) translate(5px,-6px); }

/* OVERLAY */
.nav-overlay {
    position:fixed; top:0; left:0; width:100%; height:100%;
    background:rgba(0,0,0,0.5); z-index:999;
    opacity:0; visibility:hidden; transition:0.3s;
}
.nav-overlay.show { opacity:1; visibility:visible; }

/* ========== MOBILE & TABLETTE (CORRECTION DÉBORDEMENT) ========== */
@media (max-width: 992px) {
    .nav-toggle { display:flex; }
    .main-nav {
        position: fixed;
        top: 0; right: -100%;
        width: 280px;
        height: 100vh; /* ✅ Hauteur fixe */
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding: 80px 15px 20px;
        gap: 0;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto; /* ✅ Scroll interne si trop long */
        overscroll-behavior: contain;
    }
    .main-nav.open { right: 0; } /* ✅ Déroulement activé */
    
    .nav-list { flex-direction:column; width:100%; gap:5px; }
    .nav-list a { padding:12px 15px; width:100%; border-radius:6px; }
    
    .nav-footer { flex-direction:column; width:100%; margin:20px 0 0 0; padding-top:15px; border-top:1px solid #eee; }
    .btn-logout { justify-content:center; width:100%; padding:10px; background:#fff5f5; border-radius:6px; }
    
    /* Scrollbar fine pour mobile */
    .main-nav::-webkit-scrollbar { width:6px; }
    .main-nav::-webkit-scrollbar-thumb { background:#ccc; border-radius:3px; }
}

@media (max-width: 480px) {
    .header-container { padding:0 15px; height:60px; }
    .logo span { display:none; }
    .main-nav { width:100%; max-width:300px; }
}