/* ===================================
   1. RÉINITIALISATION & STYLES GLOBAUX
   =================================== */

:root {
    --color-primary: #007bff;
    --color-primary-dark: #0056b3;
    --color-success: #27ae60;
    --color-success-dark: #229954;
    --color-danger: #e74c3c;
    --color-danger-dark: #c0392b;
    --color-warning: #ffc107;
    --color-warning-dark: #e0a800;
    --color-secondary: #7f8c8d;
    --color-secondary-dark: #6c7a89;
    --color-dark: #2c3e50;
    --color-dark-light: #34495e;
    --color-light-gray: #f4f7f6;
    --color-border: #ddd;
    --color-text: #333;
    --color-text-light: #555;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.3;
    background-color: var(--color-light-gray);
    color: var(--color-text);
    min-height: 100vh;
    padding-bottom: 70px; 
}

/* ===================================
   2. LAYOUT CENTRÉ (Connexion)
   =================================== */

body.body-centered {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-form-container {
    background-color: #ffffff;
    padding: 2.5rem 2.5rem 5rem 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 450px;
    text-align: center;
}

.auth-form-container h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--color-dark);
    font-size: 2rem;
}

.auth-form-container .form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.auth-form-container .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.auth-form-container button[type="submit"] {
    width: 100%;
    background-color: #009EE0; /* Couleur spécifique au projet */
    color: white;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
}

.auth-form-container button[type="submit"]:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* ===================================
   3. LAYOUT ADMIN (Header Amélioré)
   =================================== */

#main-header {
    background-color: #fff;
    border-bottom: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* --- Partie Haute (Brand + User) --- */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: #ffffff;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-brand img {
    height: 50px;
    width: auto;
}

.header-titles h1 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-titles .subtitle {
    font-size: 0.9rem;
    color: var(--color-secondary);
    font-weight: normal;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
}

.header-user .user-greeting strong {
    color: var(--color-primary);
}

.btn-logout {
    background-color: #ffebee;
    color: var(--color-danger);
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid #ffcdd2;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* --- Partie Basse (Menu Navigation) --- */
.header-nav {
    background-color: var(--color-dark);
    padding: 0 25px;
}

.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.header-nav li {
    margin: 0;
}

.header-nav a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.header-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.header-nav a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-bottom-color: var(--color-primary);
}

/* ===================================
   4. NORMALISATION DES FORMULAIRES
   =================================== */

/* Style général pour tous les champs de saisie */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea,
.auth-form-container .form-group input {
    width: 100%;
    padding: 10px 12px;
    margin: 5px 0;
    display: inline-block;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    background-color: #fff;
    color: var(--color-text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Effet Focus */
input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

/* Zone de texte */
textarea {
    resize: vertical;
    min-height: 40px;
}

/* Listes déroulantes (Select) */
select {
    height: 40px; /* Hauteur fixe pour alignement */
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat, repeat;
    background-position: right .7em top 50%, 0 0;
    background-size: .65em auto, 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
}

/* Checkbox et Radio */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 5px;
    cursor: pointer;
    transform: scale(1.1);
}

/* Labels */
label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    color: var(--color-dark);
    margin-top: 10px;
}

/* ===================================
   5. NAVIGATION & ONGLETS
   =================================== */

/* Navigation par Onglets */
.admin-container nav {
    background: none;
    border-bottom: 2px solid var(--color-primary); 
    padding: 0 10px;
    margin-bottom: 20px;
    border-radius: 0px;
}
.admin-container nav a {
    display: inline-block;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    border-radius: 6px 6px 0 0;
    margin-right: 5px;
    transition: all 0.2s ease;
    color: var(--color-text-light);
    background-color: #f0f0f0;
    border: 1px solid var(--color-border);
    border-bottom: none;
}
.admin-container nav a.active {
    background-color: #ffffff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-bottom: 2px solid #ffffff; 
    margin-bottom: -2px; 
}
.admin-container nav a:not(.active):hover {
    background-color: #e9e9e9;
    color: var(--color-text);
}

/* ===================================
   6. BOUTONS (Système unifié)
   =================================== */

.bouton,
button,
input[type="submit"] {
    display: inline-block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: background-color 0.2s ease, transform 0.1s ease;
    background-color: var(--color-primary);
    text-align: center;
}

.bouton:active,
button:active,
input[type="submit"]:active {
    transform: scale(0.98);
}

.bouton:hover,
button:hover,
input[type="submit"]:hover {
    color: white;
    background-color: var(--color-primary-dark);
}

/* Modificateurs de couleur */
.bouton.btn-success { background-color: var(--color-success); }
.bouton.btn-success:hover { background-color: var(--color-success-dark); }

.bouton.btn-danger { background-color: var(--color-danger); }
.bouton.btn-danger:hover { background-color: var(--color-danger-dark); }

.bouton.btn-edit { background-color: var(--color-warning); color: var(--color-text); }
.bouton.btn-edit:hover { background-color: var(--color-warning-dark); color: var(--color-text); }

.bouton.btn-cancel { background-color: var(--color-secondary); }
.bouton.btn-cancel:hover { background-color: var(--color-secondary-dark); }

.bouton.button-new {
    background-color: var(--color-success);
    float: right;
    margin-bottom: 15px;
}
.bouton.button-new:hover {
    background-color: var(--color-success-dark);
}

/* ===================================
   7. MESSAGES DE FEEDBACK
   =================================== */

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin-bottom: 1rem;
    text-align: left;
}
.error-message p { margin: 0; }

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    margin-bottom: 1rem;
    text-align: left;
}

/* ===================================
   8. TABLEAUX ADMIN (.table-list)
   =================================== */

.table-block { 
    margin-bottom: 40px; 
    padding: 15px; 
    border: 1px solid var(--color-border); 
    border-radius: 5px; 
}

.table-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.table-list th,
.table-list td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.table-list th {
    background-color: #f2f2f2;
    text-transform: uppercase;
    font-size: 0.85em;
    color: var(--color-text-light);
}

.table-list tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table-list tbody tr:hover {
    background-color: #f0f0f0;
}

.table-list td:last-child {
    text-align: right;
}

/* Drapeaux et Clés */
.table-list .table-flag {
    width: 20px;
    height: auto;
    border: 1px solid #eee;
    margin-right: 8px;
    vertical-align: middle;
    position: relative; 
    top: -1px;
}

.icon-key-pk { color: #ffc107; margin-right: 5px; }
.icon-key-fk { color: #6c757d; margin-right: 5px; }
.highlight-pk td { background-color: #fffacd; }
.highlight-fk td { background-color: #e0f7fa; }

/* Espacement dans les formulaires d'ajout */
.add-element table td {
    padding: 5px;
    vertical-align: top;
}

/* ===================================
   9. CONTAINERS SPÉCIFIQUES
   =================================== */

.admin-container {
    max-width: 1200px; 
    margin: 20px auto;
    background-color: #ffffff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.rbac-form {
    background: #fdfdfd;
    padding: 25px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: 20px;
}

.selector-box { 
    margin-bottom: 20px; 
    padding: 10px; 
    border: 1px solid var(--color-border); 
    border-radius: 4px; 
    background-color: #f9f9f9; 
}

.form-grid {
    display: grid;
    gap: 15px 20px;
}
.form-grid .grid-span-1 { grid-column: span 1; }
.form-grid .grid-span-2 { grid-column: span 2; }
.form-grid .grid-span-3 { grid-column: span 3; }
.form-grid .grid-span-full { grid-column: 1 / -1; }

.form-grid .form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-grid .form-group-checkbox label {
     margin-bottom: 0;
     margin-top: 0;
     font-weight: normal;
}
.form-grid .form-group-checkbox input {
     width: auto;
     height: auto;
}

.capacity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 10px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #eee;
}
.capacity-grid label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
}
.capacity-grid input[type="checkbox"] {
    width: auto;
    height: auto;
}

/* ===================================
   10. WIDGETS
   =================================== */

.club-filters {
    display: flex;
    gap: 10px;
    padding: 15px;
    background-color: var(--color-light-gray);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    align-items: center;
}
.club-filters input[type="text"] { flex: 2; }
.club-filters select { flex: 1; }

.blason-preview, .drapeau-preview {
    width: 100px;
    height: 100px;
    border: 1px dashed var(--color-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    overflow: hidden;
    position: relative;
}
.drapeau-preview { height: 60px; }

.blason-preview img, .drapeau-preview img { 
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
}
.blason-preview span, .drapeau-preview span { 
    color: #999;
    font-size: 0.9em;
    text-align: center;
    padding: 5px; 
}

#delete-blason {
    display: none; 
    position: absolute;
    top: 5px;
    right: 5px; 
    left: auto; 
    background: var(--color-danger-dark);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
#delete-blason:hover {
    background: #a00;
}

/* Autocomplétion */
#suggestions-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#suggestions-list .suggestion-item {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.9em;
}
#suggestions-list .suggestion-item:hover {
    background-color: #f0f0f0;
}
#suggestions-list .suggestion-none {
    padding: 8px 10px;
    font-style: italic;
    color: #888;
}

/* Flèches de tri */
.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    margin-right: 10px;
    vertical-align: middle;
}
.sort-arrow {
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    color: #999;
    user-select: none;
}
.sort-arrow:hover { color: var(--color-text); }
.sort-up::before { content: '▲'; }
.sort-down::before { content: '▼'; }
tbody tr:first-child .sort-up { visibility: hidden; }
tbody tr:last-child .sort-down { visibility: hidden; }

/* ===================================
   11. RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .header-nav ul {
        justify-content: center;
    }
    .header-nav a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    .table-list thead {
        display: none;
    }
    .table-list tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--color-border);
    }
    .table-list td {
        display: block;
        text-align: right;
        border-bottom: 1px dotted #ccc;
    }
    .table-list td:last-child {
        text-align: right;
        border-bottom: none;
    }
    .table-list td[data-label]::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.9em;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .form-grid .grid-span-1,
    .form-grid .grid-span-2,
    .form-grid .grid-span-3,
    .form-grid .grid-span-full {
        grid-column: 1 / -1;
    }
    .club-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===================================
   12. CORRECTIF DATETIME FLATPICKR
   =================================== */

/* 1. Force le conteneur de l'input à prendre la bonne largeur */
.input-icon-wrapper {
    display: block;        /* Change le span en bloc pour qu'il accepte la largeur */
    position: relative;    /* Permet de positionner l'icône par dessus */
    width: 100%;           /* Prend toute la largeur de la cellule (td) */
    box-sizing: border-box;
}

/* 2. Style spécifique pour l'input Flatpickr */
.input-icon-wrapper input.flatpickr-input,
.input-icon-wrapper input.form-control {
    width: 100%;           /* S'assure que l'input ne dépasse pas du wrapper */
    padding-right: 40px;   /* Laisse de la place à droite pour l'icône calendrier */
    box-sizing: border-box;/* Inclut les bordures dans le calcul de la largeur */
    display: block;
    height: 40px;          /* Hauteur fixe pour l'harmonie */
    margin: 0;             /* Enlève les marges parasites */
}

/* 3. Positionnement de l'icône calendrier */
.input-icon-wrapper .icon-inside {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%); /* Centre verticalement */
    pointer-events: none;        /* Le clic passe au travers pour activer le calendrier */
    color: #7f8c8d;              /* Gris discret */
    font-size: 20px;
    z-index: 10;                 /* S'assure que l'icône est au-dessus */
}

/* ===================================
   13. PAGE SQL INFO (Visualisation BDD)
   =================================== */

/* Layout principal (Sidebar + Contenu) */
.db-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Menu latéral (Liste des tables) */
.db-sidebar {
    flex: 0 0 330px; /* Largeur fixe */
    position: sticky;
    top: 20px;
    max-height: 80vh;
    overflow-y: auto;
    background: #f9f9f9;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 15px;
}

.db-sidebar h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--color-dark);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.db-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.db-sidebar li a {
    display: block;
    padding: 6px 10px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.db-sidebar li a:hover {
    background-color: #e9ecef;
    color: var(--color-primary);
}

/* Contenu principal (Cartes des tables) */
.db-content {
    flex: 1;
    min-width: 0; /* Empêche le débordement flex */
}

.db-table-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    overflow: hidden;
}

.db-table-card h3 {
    margin: 0;
    padding: 12px 20px;
    font-size: 1.1rem;
    color: #fff;
    background-color: var(--color-dark-light);
    border-bottom: 1px solid var(--color-dark);
}

/* Info supplémentaire sur les clés étrangères */
.fk-link-info {
    font-size: 0.85em;
    color: var(--color-secondary);
    font-style: italic;
    margin-left: 5px;
}

/* --- BLOCS CODE SQL (Procédures & Triggers) --- */
.sql-code-container {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 20px;
    background: #2d2d2d; /* Fond sombre pour le code */
    color: #f8f8f2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.sql-code-container h3 {
    margin: 0;
    padding: 12px 20px;
    font-size: 1.1rem;
    color: #fff;
    background-color: var(--color-dark);
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sql-code-container h3 .sql-meta {
    font-size: 0.8em;
    font-weight: normal;
    color: #bbb;
}

pre.sql-code {
    padding: 20px;
    margin: 0;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap; /* Retour à la ligne automatique */
}

/* Coloration syntaxique SQL */
.sql-keyword { color: #ff79c6; font-weight: bold; } /* Rose */
.sql-function { color: #8be9fd; } /* Cyan */
.sql-datatype { color: #bd93f9; } /* Violet */
.sql-comment { color: #6272a4; font-style: italic; } /* Gris bleu */
.sql-string { color: #f1fa8c; } /* Jaune */

/* Styles spécifiques pour masquer/afficher les champs conditionnels */
        .conditional-field {
            display: none; /* Caché par défaut */
        }

.admin-container nav a { text-decoration: none; }
            .dashboard-wrapper h3 { margin-top: 0; }



/* ==========================================================================
   HEADER ADMIN RESPONSIVE (V3 - ALIGNEMENT & SUBTITLE)
   ========================================================================== */

#main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'Open Sans', sans-serif;
    width: 100%;
}

/* --- CONTENEUR PRINCIPAL --- */
.header-top {
    display: flex;
    justify-content: space-between; /* Écarte Gauche / Droite au max */
    align-items: center; /* Centre verticalement le bloc gauche et le bloc droit */
    padding: 0 30px;
    height: 80px; /* Hauteur desktop */
    background: #fff;
        flex-direction: row;
}

/* --- ZONE GAUCHE (Logo + Titres) --- */
.header-left {
    display: flex;
    align-items: center; /* Centre verticalement image et textes */
    gap: 15px;
    height: 100%;
}

.header-logo-link {
    display: flex; /* Important pour centrer l'image dans le lien */
    align-items: center;
    height: 100%;
}

.header-logo-link img {
    height: 45px;
    width: auto;
    display: block;
}

.header-titles {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centre le bloc texte verticalement */
    line-height: 1.2;
}

.header-titles h1 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--color-dark);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15em; 
}

.header-titles .subtitle {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 600;
    display: block; /* Toujours visible par défaut */
}

/* --- ZONE DROITE (User + Logout + Burger) --- */
.header-right {
    display: flex;
    align-items: center; /* Centre verticalement tous les éléments de droite */
    gap: 20px;
    height: 100%;
}

.user-info {
    font-size: 0.9rem;
    color: #666;
}

/* Bouton Déconnexion */
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-danger);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border: 1px solid var(--color-danger);
    border-radius: 30px;
    transition: all 0.2s;
    white-space: nowrap;
    height: 36px; /* Hauteur explicite pour alignement */
}

.btn-logout:hover {
    background-color: var(--color-danger);
    color: #fff;
}

.btn-logout .material-icons {
    font-size: 18px;
}

/* Bouton Burger (Caché sur desktop) */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-dark);
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
}

.mobile-toggle .material-icons {
    font-size: 28px;
}

/* --- NAVIGATION (Desktop) --- */
.header-nav {
    background-color: var(--color-dark);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
}

.header-nav a {
    display: block;
    padding: 14px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: 0.2s;
    border-bottom: 3px solid transparent;
}

.header-nav a:hover, .header-nav a.active {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
    border-bottom-color: var(--color-primary);
}

/* ==========================================================================
   MEDIA QUERIES (MOBILE < 992px)
   ========================================================================== */

@media (max-width: 992px) {

    .header-top {
        padding: 0 15px;
        height: 60px; /* Header plus compact sur mobile */
    }

    /* Ajustement Logo & Titres */
    .header-logo-link img { height: 32px; }
    
    .header-titles h1 { font-size: 0.9rem; }
    
    /* RESTAURATION ET GESTION DU SOUS-TITRE MOBILE */
    .header-titles .subtitle { 
        font-size: 0.75rem; 
        max-width: 140px; /* Limite la largeur */
        white-space: nowrap; /* Empêche le retour à la ligne */
        overflow: hidden; /* Cache ce qui dépasse */
        text-overflow: ellipsis; /* Ajoute "..." */
    }

    /* Simplification Droite */
    .user-info { display: none; } /* On cache le "Bonjour..." */
    .logout-text { display: none; } /* On cache le texte "Déconnexion" */
    
    .btn-logout { 
        border: none; 
        padding: 0; 
        background-color: #f1f3f5; 
        border-radius: 50%; 
        width: 36px; height: 36px; /* Bouton rond */
        min-width: 36px; /* Empêche l'écrasement */
    }
    
    .btn-logout .material-icons { font-size: 20px; }

    .header-right { gap: 10px; } /* Rapproche les icônes */

    .mobile-toggle { 
        display: flex; /* Affiche le burger */
    }

    /* Menu Mobile Déroulant */
    .header-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .header-nav.open {
        display: block;
    }

    .header-nav ul {
        flex-direction: column;
        background-color: var(--color-dark);
    }
    
    .header-nav a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        width: 100%;
        text-align: left;
    }
    
    .header-nav a:hover, .header-nav a.active {
        border-left: 5px solid var(--color-primary);
        border-bottom-color: rgba(255,255,255,0.05);
    }
}