/* ========================================
   ADMIN-STYLES.CSS - Système de gestion unifié
   Version: 2.1 (Header, Footer, Nav corrigé)
   ======================================== */

/* ========================================
   1. VARIABLES & RESET
   ======================================== */
:root {
    /* Couleurs principales */
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #81C784;
    --primary-bg: #E8F5E9;

    --secondary-color: #2196F3;
    --secondary-dark: #1976D2;
    --secondary-light: #64B5F6;
    --secondary-bg: #E3F2FD;

    --danger-color: #f44336;
    --danger-dark: #d32f2f;
    --danger-light: #EF9A9A;
    --danger-bg: #FFEBEE;

    --warning-color: #ff9800;
    --warning-dark: #f57c00;
    --warning-light: #FFB74D;
    --warning-bg: #FFF3E0;

    --success-color: #4CAF50;
    --success-dark: #388E3C;
    --success-light: #81C784;
    --success-bg: #E8F5E9;

    --info-color: #17a2b8;
    --info-dark: #0f7c8e;
    --info-light: #6BC8D6;
    --info-bg: #E1F5FE;

    /* Couleurs neutres */
    --border-color: #ddd;
    --border-light: #e8e8e8;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg-color: #f4f7fc;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-hover: #f0f0f0;
    --bg-dark: #1a2a3a;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 30px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 15px rgba(0,0,0,0.15);

    /* Espacements */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;

    /* Bordures */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.2s;
    --transition: 0.3s;
    --transition-slow: 0.5s;

    /* Typographie */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ========================================
   2. HEADER (principal) - CORRIGÉ
   ======================================== */
.app-header {
    background: var(--bg-dark);
    color: #fff;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1c40f;
    flex-shrink: 0;
}

.logo i {
    font-size: 1.8rem;
}

.header-nav {
    display: flex;
    align-items: center;
}

.header-nav ul {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.header-nav ul li a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.header-nav ul li a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.header-nav ul li a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #f1c40f;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.3rem 1rem 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-profile i {
    font-size: 1.6rem;
    color: #bdc3c7;
}

/* ========================================
   3. SECONDARY NAV - CORRIGÉ
   ======================================== */
.secondary-nav {
    background: var(--bg-white);
    border-bottom: 1px solid #e0e6ed;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 70px;
    z-index: 999;
    flex-shrink: 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.nav-container > ul {
    display: flex;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-container > ul li {
    display: inline-block;
}

.nav-container > ul li a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #5a6c7d;
    transition: all 0.2s;
}

.nav-container > ul li a:hover {
    background: #eef2f7;
    color: #1a2a3a;
}

.nav-container > ul li a.active {
    background: #1a2a3a;
    color: #fff;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.nav-actions .badge {
    background: #e74c3c;
    color: #fff;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ========================================
   4. FOOTER - CORRIGÉ
   ======================================== */
.app-footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 1.2rem 2rem;
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.footer-left {
    font-size: 0.85rem;
}

.footer-center ul {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-center ul li a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}

.footer-center ul li a:hover {
    color: #fff;
}

.footer-right {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-right .fa-heart {
    color: #e74c3c;
}

/* ========================================
   5. MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1 0 auto;
    padding: 2rem 2rem 3rem;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* ========================================
   6. LAYOUT & CONTAINERS
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* Page Header interne */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a2a3a;
}

.page-header p {
    color: #5a6c7d;
    font-size: 1rem;
    margin-top: 0.2rem;
}

/* Header legacy (pour compatibilité) */
.header {
    background: var(--bg-white);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid var(--primary-color);
}

.header h1 {
    color: var(--primary-color);
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-xs);
}

.header p {
    color: var(--text-light);
    font-size: var(--font-size-md);
}

/* ========================================
   7. SEARCH SECTION
   ======================================== */
.search-section {
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
}


.search-form {
    display: block !important;
}

.search-form .filter-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    align-items: end !important;
    width: 100% !important;
}

.search-form .filter-row .form-group {
    width: 100% !important;
    min-width: 0 !important;
}

.search-form .filter-row .search-actions {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
}

/* tablette */
@media (max-width: 992px) {
    .search-form .filter-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* téléphone */
@media (max-width: 576px) {
    .search-form .filter-row {
        grid-template-columns: 1fr !important;
    }
}
/* ========================================
   8. FORM ELEMENTS
   ======================================== */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-light);
}

.form-group label .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--bg-white);
    color: var(--text-color);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group .help-text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

/* ========================================
   9. BUTTONS
   ======================================== */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Button variants */
.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: var(--warning-dark);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: var(--info-dark);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

.btn-icon {
    padding: var(--spacing-sm);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    justify-content: center;
}

/* ========================================
   10. TABLES
   ======================================== */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-md);
}

thead {
    background: var(--primary-color);
    color: white;
}

thead th {
    padding: var(--spacing-md) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

thead th.sortable {
    cursor: pointer;
    user-select: none;
}

thead th.sortable:hover {
    background: var(--primary-dark);
}

thead th .sort-icon {
    margin-left: var(--spacing-xs);
    opacity: 0.5;
}

tbody td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tbody tr:hover td {
    background: var(--bg-light);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr.selected {
    background: var(--primary-bg);
}

/* Table empty state */
.table-empty {
    text-align: center;
    padding: var(--spacing-xl) !important;
    color: var(--text-muted);
}

.table-empty .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: var(--spacing-md);
}

/* ========================================
   11. BADGES & STATUS
   ======================================== */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-xl);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Badge colors */
.badge-primary {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.badge-secondary {
    background: var(--secondary-bg);
    color: var(--secondary-dark);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-dark);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-dark);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-dark);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-dark);
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Concours status badges */
.badge-ouvert {
    background: #d4edda;
    color: #155724;
}

.badge-ferme {
    background: #f8d7da;
    color: #721c24;
}

.badge-en-cours {
    background: #fff3cd;
    color: #856404;
}

.badge-termine {
    background: #cce5ff;
    color: #004085;
}

/* ========================================
   12. PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.pagination-info {
    font-size: var(--font-size-md);
    color: var(--text-light);
}

.pagination-buttons {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.pagination-buttons button {
    padding: var(--spacing-xs) var(--spacing-md);
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: var(--font-size-sm);
    color: var(--text-color);
    min-width: 36px;
    text-align: center;
}

.pagination-buttons button:hover:not(:disabled):not(.active) {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.pagination-buttons button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-buttons button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   13. MODAL
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    padding: var(--spacing-lg);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-large {
    max-width: 800px;
}

.modal-xl {
    max-width: 1100px;
}

.modal-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: var(--font-size-xl);
    color: var(--text-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--danger-color);
    background: var(--danger-bg);
}

.modal-body {
    padding: var(--spacing-xl);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--spacing-md) var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    flex-shrink: 0;
}

/* ========================================
   14. TABS
   ======================================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--spacing-lg);
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ========================================
   15. MEMBERS MANAGEMENT
   ======================================== */
.members-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    background: var(--bg-light);
}

.members-list {
    min-height: 50px;
    margin-bottom: var(--spacing-sm);
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    animation: slideIn 0.3s ease;
}

.member-item .member-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.member-item .member-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 20px;
    padding: 0 var(--spacing-xs);
    transition: var(--transition-fast);
    line-height: 1;
}

.member-item .member-remove:hover {
    transform: scale(1.3);
}

.member-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--secondary-bg);
    color: var(--secondary-dark);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.member-badge.chef {
    background: var(--warning-bg);
    color: var(--warning-dark);
}

.add-member {
    display: flex;
    gap: var(--spacing-sm);
}

.add-member select {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
}

.add-member select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ========================================
   16. DETAIL VIEW
   ======================================== */
.detail-section {
    margin-bottom: var(--spacing-xl);
}

.detail-section h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-light);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.detail-item .label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: var(--font-size-lg);
    font-weight: 500;
    margin-top: var(--spacing-xs);
    word-break: break-word;
}

.detail-item .value.full-width {
    grid-column: 1 / -1;
}

.members-list-detail {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

/* ========================================
   17. LOADING STATES
   ======================================== */
.loading {
    display: none;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-light);
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-light) 25%, var(--border-light) 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
    height: 20px;
    margin: var(--spacing-xs) 0;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   18. TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 400px;
    width: 100%;
}

.toast {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--danger-color);
}

.toast-warning {
    background: var(--warning-color);
}

.toast-info {
    background: var(--info-color);
}

.toast .toast-icon {
    font-size: var(--font-size-xl);
}

.toast .toast-message {
    flex: 1;
}

.toast .toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: var(--font-size-xl);
    opacity: 0.7;
    transition: var(--transition-fast);
    padding: 0 var(--spacing-xs);
}

.toast .toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   19. DETAILS (Types de Diplômes)
   ======================================== */
.details-header {
    margin-bottom: var(--spacing-lg);
}

.details-header h3 {
    font-size: var(--font-size-lg);
    color: var(--text-color);
    margin-bottom: var(--spacing-xs);
}

.details-header p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.details-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

.details-list {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    min-height: 80px;
}

.detail-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
}

.detail-item-row .detail-info {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.detail-item-row .detail-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition-fast);
}

.detail-item-row .detail-remove:hover {
    transform: scale(1.2);
}

.add-detail {
    background: var(--bg-white);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
}

.add-detail .form-row {
    grid-template-columns: 1fr 1fr;
}

/* ========================================
   20. RESPONSIVE DESIGN
   ======================================== */
/* Tablets & small screens */
@media (max-width: 992px) {
    .search-form {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .modal-xl {
        max-width: 95%;
    }

    .header-nav ul {
        gap: 0.3rem;
    }

    .header-nav ul li a {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
        height: 60px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo i {
        font-size: 1.3rem;
    }

    .header-nav ul {
        gap: 0.2rem;
    }

    .header-nav ul li a {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .header-nav ul li a span {
        display: none;
    }

    .user-profile span {
        display: none;
    }

    .secondary-nav {
        padding: 0 1rem;
        height: 48px;
        top: 60px;
    }

    .nav-container > ul li a {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }

    .nav-container > ul li a span {
        display: none;
    }

    .main-content {
        padding: 1rem 1rem 2rem;
    }

    .container {
        padding: 0;
        margin: 0;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .search-form {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .search-form .search-actions {
        grid-column: 1 / -1;
        flex-wrap: wrap;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

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

    .modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        height: 100vh;
        width: 100%;
    }

    .modal-header {
        border-radius: 0;
        padding: var(--spacing-md);
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .modal-footer {
        border-radius: 0;
        padding: var(--spacing-md);
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .pagination {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-btn {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .members-container {
        padding: var(--spacing-sm);
    }

    .add-member {
        flex-direction: column;
    }

    .toast-container {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        max-width: 100%;
    }

    .table-wrapper table {
        font-size: var(--font-size-sm);
    }

    thead th,
    tbody td {
        padding: var(--spacing-sm);
    }

    .btn {
        font-size: var(--font-size-sm);
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .footer-center ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .modal-body {
        padding: var(--spacing-sm);
    }

    .detail-item {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .detail-item .value {
        font-size: var(--font-size-md);
    }

    .member-item {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .app-header {
        padding: 0 0.5rem;
        height: 54px;
    }

    .logo {
        font-size: 0.9rem;
    }

    .logo i {
        font-size: 1.1rem;
    }

    .header-nav ul li a {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .secondary-nav {
        padding: 0 0.5rem;
        height: 40px;
        top: 54px;
    }

    .nav-container > ul li a {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .main-content {
        padding: 0.5rem 0.5rem 1.5rem;
    }

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

    .add-detail .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   21. UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-info { color: var(--info-color); }
.text-muted { color: var(--text-muted); }

.bg-primary { background: var(--primary-bg); }
.bg-success { background: var(--success-bg); }
.bg-danger { background: var(--danger-bg); }
.bg-warning { background: var(--warning-bg); }
.bg-info { background: var(--info-bg); }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.ml-1 { margin-left: var(--spacing-xs); }
.ml-2 { margin-left: var(--spacing-sm); }

.mr-1 { margin-right: var(--spacing-xs); }
.mr-2 { margin-right: var(--spacing-sm); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-xs); }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-md); }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.hidden { display: none !important; }
.visible { display: block !important; }

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ========================================
   22. STATS CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

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

.stat-card .stat-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    border-radius: 50%;
}

.stat-card .stat-info {
    flex: 1;
}

.stat-card .stat-label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .stat-value {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-color);
    margin-top: var(--spacing-xs);
}

/* Different colors for stats */
.stat-card:nth-child(1) { border-left-color: var(--primary-color); }
.stat-card:nth-child(1) .stat-icon { background: var(--primary-bg); color: var(--primary-dark); }

.stat-card:nth-child(2) { border-left-color: var(--success-color); }
.stat-card:nth-child(2) .stat-icon { background: var(--success-bg); color: var(--success-dark); }

.stat-card:nth-child(3) { border-left-color: var(--warning-color); }
.stat-card:nth-child(3) .stat-icon { background: var(--warning-bg); color: var(--warning-dark); }

.stat-card:nth-child(4) { border-left-color: var(--info-color); }
.stat-card:nth-child(4) .stat-icon { background: var(--info-bg); color: var(--info-dark); }

/* ========================================
   23. FILE INPUTS
   ======================================== */
input[type="file"] {
    padding: var(--spacing-sm);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    cursor: pointer;
    width: 100%;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: var(--primary-bg);
}

input[type="file"]::-webkit-file-upload-button {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    margin-right: var(--spacing-sm);
    transition: var(--transition-fast);
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--primary-dark);
}

input[type="file"]::file-selector-button {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    margin-right: var(--spacing-sm);
    transition: var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}

/* ========================================
   24. GROUPEMENT (pour compatibilité)
   ======================================== */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.group-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: var(--transition);
    cursor: pointer;
}

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

.group-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.group-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.group-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    flex-shrink: 0;
}

.group-title h4 {
    margin: 0;
    font-size: var(--font-size-md);
    color: var(--text-color);
}

.group-title .badge {
    font-size: var(--font-size-xs);
}

.group-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.group-stat {
    text-align: center;
    padding: var(--spacing-xs);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.group-stat .stat-number {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-color);
}

.group-stat .stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.group-progress {
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    margin-bottom: var(--spacing-xs);
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.group-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-light);
}

/* ========================================
   25. ADMIN NAVIGATION (legacy)
   ======================================== */
.admin-nav {
    background: var(--bg-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 var(--spacing-lg);
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-color);
}

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-brand-text {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-link i {
    width: 18px;
    text-align: center;
    font-size: var(--font-size-md);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-name {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-color);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.user-name i {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--danger-bg);
    color: var(--danger-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
}

.btn-logout i {
    font-size: var(--font-size-md);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--text-color);
    cursor: pointer;
    padding: var(--spacing-xs);
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: var(--radius-xl);
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Responsive nav */
@media (max-width: 992px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow);
        gap: 2px;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-link {
        padding: var(--spacing-md);
        width: 100%;
    }

    .nav-user .user-name span {
        display: none;
    }

    .btn-logout span {
        display: none;
    }

    .nav-brand-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .admin-nav {
        padding: 0 var(--spacing-sm);
    }

    .nav-container {
        height: 60px;
    }

    .nav-logo {
        height: 32px;
    }

    .nav-link {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm);
    }

    .nav-user {
        gap: var(--spacing-sm);
    }

    .user-name {
        font-size: var(--font-size-xs);
    }
}

