/**
 * Location in this project: horaire
*/

/* ==========================================================================
   1. Variables globales et Configuration de base
   ========================================================================== */

/**
 * :root contient toutes les variables de couleur et de police
 * pour un thème cohérent et facilement modifiable.
 */
:root {
    --bg-color: rgba(26, 26, 46, 0.7);
    --sidebar-color: rgba(20, 20, 35, 0.7);
    --card-bg-color: rgba(40, 40, 60, 1);
    --text-color: #e0e0e0;
    --primary-accent-color: #00c2cb;
    --secondary-accent-color: #8e44ad;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Couleurs pour les statuts et légendes */
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --formation-color: #d35400;
    --holiday-color: #ff9a8b;
}

/**
 * Styles de base pour réinitialiser le navigateur
 * et définir les propriétés globales du corps de la page.
 */
body, html {
    margin: 0;
    padding: 0;
    /*height: 100%;
    width: 100%;*/
    font-family: var(--font-family);
    background: var(--bg-color); /* Couleur de secours */
    color: var(--text-color);
    overflow: hidden; /* Empêche les barres de défilement sur le corps principal */
}

/* ==========================================================================
   2. Fond animé et Structure principale
   ========================================================================== */

/**
 * Conteneur pour les blobs animés.
 * Placé en arrière-plan de tout le reste.
 */
.blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden; /* Assure que les blobs ne dépassent pas de l'écran */
}

/**
 * Style de base pour un blob.
 * C'est un cercle de couleur, très flouté, avec une opacité.
 */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Le flou est la clé de l'effet */
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

/**
 * Styles pour le menu latéral (sidebar).
 * Utilise le "glassmorphism" (backdrop-filter) pour un effet de verre dépoli.
 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: var(--sidebar-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid var(--border-color);
    box-shadow: 5px 0px 15px var(--shadow-color);
    z-index: 100; /* Assure que le menu est au-dessus du contenu */
    /* AJOUT ESSENTIEL POUR LE FOOTER */
    display: flex;             /* Active Flexbox */
    flex-direction: column;    /* Empile les éléments verticalement */
    justify-content: space-between; /* Distribue l'espace (Header haut, Footer bas) */
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-accent-color);
}

.nav-links {
    list-style-type: none;
    padding: 20px 0;
    margin: 0;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.nav-links li a:hover, .nav-links li a.active {
    background-color: var(--primary-accent-color);
    color: #fff;
}

.nav-links li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

.sidebar-footer a {
    display: block;
    padding: 12px;
    background: var(--glass-bg);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-footer a:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 194, 203, 0.4);
}

/**
 * Styles pour la zone de contenu principale.
 */
#main-content {
    margin-left: 250px;
    padding: 30px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    background: transparent; /* Crucial pour voir le fond animé */
}

.page {
    display: none; /* Toutes les pages sont cachées par défaut */
}

.page.active {
    display: block; /* Seule la page active est visible */
    animation: fadeIn 0.5s ease-in-out;
}

/**
 * Le conteneur de base pour le contenu de chaque page (effet "glassmorphism").
 */
.page-content {
    background-color: var(--card-bg-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-content h1 {
    color: var(--primary-accent-color);
    border-bottom: 2px solid var(--primary-accent-color);
    padding-bottom: 10px;
    margin-top: 0;
}

/* ==========================================================================
   3. Éléments de formulaire et boutons
   ========================================================================== */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    background-color: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    box-sizing: border-box;
}

button, label.button {
    background-color: var(--primary-accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover, label.button:hover {
    background-color: #00a1a9;
}

button.secondary, label.button.secondary {
    background-color: var(--secondary-accent-color);
}

button.secondary:hover, label.button.secondary:hover {
    background-color: #7b2a9a;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   4. Page Accueil : Calendrier, Légende, Contrôles
   ========================================================================== */

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-controls #view-selector {
    flex-grow: 0; /* Empêche l'élément de grandir */
    flex-shrink: 1; /* Permet à l'élément de se réduire si nécessaire */
    width: auto; /* La largeur s'adapte au contenu */
    max-width: 150px; /* Limite la largeur maximale */
}

#nav-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-grow: 1;
    gap: 20px;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calendar-controls h2 {
    margin: 0;
    text-align: center;
    min-width: 150px;
}

#calendar-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    font-size: 0.8em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Couleurs pour les carrés de la légende */
.legend-pointage-presentiel { background-color: var(--secondary-accent-color); }
.legend-pointage-teletravail { background-color: #3498db; }
.legend-cp { background-color: var(--success-color); }
.legend-rtt { background-color: var(--warning-color); }
.legend-maladie { background-color: var(--danger-color); }
.legend-formation { background-color: var(--formation-color); }
.legend-holiday { background-color: var(--holiday-color); }

/* --- Styles pour les calendriers (mensuel et annuel) --- */

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: var(--primary-accent-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day {
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    height: 80px;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s;
    cursor: pointer;
    box-sizing: border-box;
}

.day:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.day-number {
    font-size: 0.9em;
}

.day-number.today {
    background-color: var(--primary-accent-color);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.day.holiday .day-number {
    color: var(--holiday-color);
}

/* Marqueur pour la vue mensuelle */
.marker {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    height: 4px;
    border-radius: 2px;
}

/* Couleurs pour les congés (inchangé) */
.day.cp .marker { background-color: var(--success-color); }
.day.rtt .marker { background-color: var(--warning-color); }
.day.maladie .marker { background-color: var(--danger-color); }
.day.formation .marker { background-color: var(--formation-color); }

/* Marqueurs pour pointages COMPLETS (basé sur la classe du marqueur lui-même) */
.marker-complete {
    background-color: var(--secondary-accent-color);
}

.marker-complete {
    background-color: #3498db;
}

/* Marqueur pour pointage PARTIEL (hachuré) */
.marker-partial {
    background: repeating-linear-gradient(
        45deg,
        var(--warning-color),
        var(--warning-color) 1px,
        rgba(0, 0, 0, 0.4) 2px,
        rgba(0, 0, 0, 0.4) 5px
    ) !important;
    border: none;
}

/* Marqueur pour incohérence (hachuré rouge) */
.marker-error {
    background: repeating-linear-gradient(
        45deg,
        var(--danger-color),
        var(--danger-color) 1px,
        rgba(0, 0, 0, 0.4) 2px,
        rgba(0, 0, 0, 0.4) 5px
    ) !important;
    border: none;
}

/* Styles pour la légende - pointage partiel */
.legend-partial {
    background: repeating-linear-gradient(
        45deg,
        var(--warning-color),
        var(--warning-color) 2px,
        rgba(0, 0, 0, 0.4) 2px,
        rgba(0, 0, 0, 0.4) 4px
    );
}

/* Styles pour la légende - erreur */
.legend-error {
    background: repeating-linear-gradient(
        45deg,
        var(--danger-color),
        var(--danger-color) 2px,
        rgba(0, 0, 0, 0.4) 2px,
        rgba(0, 0, 0, 0.4) 4px
    );
}

/* --- Styles spécifiques à la vue annuelle --- */

.annual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.annual-grid .month-container {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 8px;
}

.annual-grid .month-container h4 {
    text-align: center;
    margin-top: 0;
    color: var(--primary-accent-color);
}

.annual-grid .calendar-grid {
    gap: 2px;
}

.annual-grid .calendar-header {
    font-size: 0.7em;
    margin-bottom: 2px;
}

.annual-grid .day {
    height: 25px;
    font-size: 0.8em;
    padding: 2px;
    padding-left: 25%;
    padding-right: 25%;
}

.annual-grid .day .day-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.annual-grid .day:hover {
    background-color: var(--primary-accent-color);
}

/* Colore la case entière en vue annuelle */
.annual-grid .day.presentiel { background-color: rgba(142, 68, 173, 0.4); }
.annual-grid .day.teletravail { background-color: rgba(52, 152, 219, 0.4); }
.annual-grid .day.cp { background-color: rgba(46, 204, 113, 0.4); }
.annual-grid .day.rtt { background-color: rgba(241, 196, 15, 0.4); }
.annual-grid .day.maladie { background-color: rgba(231, 76, 60, 0.4); }
.annual-grid .day.formation { background-color: rgba(211, 84, 0, 0.4); }
.annual-grid .marker { display: none; } /* Cache le petit marqueur */

/* ==========================================================================
   5. Styles pour les autres pages (Pointage, Congés, Stats, Paramètres)
   ========================================================================== */

#summary, #data-management-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

#data-management-section h2, #parametres-form h2 {
    color: var(--primary-accent-color);
    margin-top: 0;
}

.conges-layout {
    display: flex;
    gap: 30px;
}

.form-section {
    flex: 1;
}

.list-section {
    flex: 2;
    background-color: rgba(0,0,0,0.1);
    padding: 20px;
    border-radius: 10px;
}

.styled-list {
    list-style-type: none;
    padding: 0;
}

.styled-list li {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-btn {
    background: none;
    border: none;
    color: #ff5c5c;
    cursor: pointer;
}

.stats-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.kpi-card h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--primary-accent-color);
}

.kpi-card p {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    padding: 20px;
    border-radius: 10px;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

label.button {
    display: inline-block;
    font-size: 0.875rem;
    line-height: 1.5;
}

#pointage-form div #date {
    flex-grow: 0; /* Empêche l'élément de grandir */
    flex-shrink: 1; /* Permet à l'élément de se réduire si nécessaire */
    width: auto; /* La largeur s'adapte au contenu */
    max-width: 150px; /* Limite la largeur maximale */
}

#pointage-form div #type-travail {
    flex-grow: 0; /* Empêche l'élément de grandir */
    flex-shrink: 1; /* Permet à l'élément de se réduire si nécessaire */
    width: auto; /* La largeur s'adapte au contenu */
    max-width: 150px; /* Limite la largeur maximale */
}

/* ==========================================================================
   6. Styles pour les Statistiques Détaillées
   ========================================================================== */

#stats-analysis-container {
    margin-top: 30px;
}

.stats-group {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-group:last-child {
    margin-bottom: 0;
}

.stats-group h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-accent-color, #00c2cb);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.stats-grid-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stats-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stats-kpi-grid .stat-item-detailed {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 15px;
}

.stats-kpi-grid .stat-item-detailed strong {
    font-size: 1.5rem;
}

.stat-item-detailed {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.stat-item-detailed:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 194, 203, 0.3);
}

.stat-item-detailed span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.stat-item-detailed strong {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-accent-color, #00c2cb);
}

/* Style pour les hints sous les statistiques */
.stat-item-detailed small.stat-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    margin-top: 4px;
    line-height: 1.2;
}

/* Styles pour les titres de section dans Analyse Détaillée */
#page-statistiques h3 {
    color: var(--primary-accent-color);
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-accent-color);
}

/* Style pour les petites annotations sous les KPI */
.kpi-card small {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Style pour les petites annotations à côté des nom de parties */
h3 small {
    margin-top: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Nouveaux styles pour l'analyse détaillée en tableau */
#detailed-analysis-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.analysis-table {
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
}

.analysis-table h3 {
    margin: 0 0 15px 0;
    color: var(--primary-accent-color);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.analysis-table table {
    width: 100%;
    border-collapse: collapse;
}

.analysis-table th, .analysis-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.analysis-table tr:last-child td {
    border-bottom: none;
}

.analysis-table td:not(:first-child) {
    font-weight: bold;
    text-align: right;
}

/* Style pour les checkboxes dans les paramètres */
.form-group-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 0;
}
.form-group-checkbox input {
    margin-right: 10px;
}

/* Style pour la nouvelle présentation en tableau de l'analyse détaillée */
#detailed-analysis-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 25px;
}
.analysis-table h3 {
    font-size: 1.1em;
    color: var(--primary-accent-color);
    margin-bottom: 10px;
}
.analysis-table table {
    width: 100%;
    border-collapse: collapse;
}
.analysis-table th, .analysis-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
}
.analysis-table th {
    font-weight: bold;
}
.analysis-table td:not(:first-child) {
    font-weight: bold;
    text-align: right;
    color: var(--text-color);
}

/* Amélioration des formulaires */
.form-layout {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-layout fieldset {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin: 0;
}

.form-layout legend {
    padding: 0 10px;
    font-weight: bold;
    color: var(--primary-accent-color);
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}
.form-group-inline label {
    flex-shrink: 0;
}

.rate-inputs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.rate-inputs-grid .form-group label {
    font-size: 0.8em;
    color: #aaa;
}

/* Styles pour les toggles modernes */
.form-group-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 23px;
    width: 23px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-accent-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- Correction et Amélioration des Paramètres --- */
.form-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-layout fieldset {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 0;
}

.form-layout legend {
    padding: 0 10px;
    font-weight: bold;
    color: var(--primary-accent-color);
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-group-inline select {
    flex-grow: 1;
}

.rate-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.rate-inputs-grid .form-group label {
    font-size: 0.9em;
    color: #bdc3c7; /* Gris clair */
    margin-bottom: 5px;
}

/* Styles pour les toggles modernes */
.form-group-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px;
    border-bottom: 1px solid var(--border-color);
}
.form-group-toggle:last-child {
    border-bottom: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #34495e; /* Fond sombre */
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-accent-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round { border-radius: 28px; }
.slider.round:before { border-radius: 50%; }

/* --- Correction Analyse Détaillée (Statistiques) --- */
#detailed-analysis-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.analysis-table h3 {
    font-size: 1.1em;
    color: var(--primary-accent-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.analysis-table table {
    width: 100%;
    border-collapse: collapse;
}
.analysis-table th, .analysis-table td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
}
.analysis-table tr:last-child td {
    border-bottom: none;
}
.analysis-table td:not(:first-child) {
    font-weight: bold;
    text-align: right;
}

/* =============================
   Infobulles pour les KPIs
   ============================= */

.kpi {
    position: relative; /* Nécessaire pour positionner l'infobulle par rapport au KPI */
    cursor: help; /* Change le curseur pour indiquer qu'une aide est disponible */
}

.kpi .tooltip {
    visibility: hidden;
    width: 280px;
    background-color: #334;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 110%; /* Positionne l'infobulle au-dessus du KPI */
    left: 50%;
    margin-left: -140px; /* Centre l'infobulle */
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-size: 0.85rem;
    line-height: 1.4;
}

.kpi .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #334 transparent transparent transparent;
}

.kpi:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip-title {
    font-weight: bold;
    color: #00BFFF; /* Cyan pour le titre */
    margin-bottom: 8px;
    display: block;
}

.tooltip-desc {
    margin-bottom: 8px;
}

.tooltip-calc {
    font-style: italic;
    color: #ccc;
    font-size: 0.8rem;
}


/* Nouvel ajout du 13/12/2025 */

/* Chercher la section des styles de pointage (vers ligne ~400) */
.pointage-presentiel {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.pointage-teletravail {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* ⭐ NOUVEAU : Style pour le type Mixte */
.pointage-mixte {
    background: linear-gradient(135deg, #e67e22, #d35400); /* Orange */
}
.legend-pointage-mixte {
    background: linear-gradient(135deg, #e67e22, #d35400); /* Orange */
}
.day.mixte {
    background: linear-gradient(135deg, #e67e22, #d35400); /* Orange */
}

/* Ajout du style pour la légende */
.legend-mixte {
    background: linear-gradient(135deg, #e67e22, #d35400);
}


/* === Styles pour les onglets de la page Congés === */

.conges-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.conges-filters label {
    font-weight: 600;
    color: var(--primary-accent-color);
}

.conges-filters select {
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    cursor: pointer;
}

.conges-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    border-bottom-color: var(--primary-accent-color);
    color: var(--primary-accent-color);
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content ul {
    list-style: none;
    padding: 0;
}

.tab-content li {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.tab-content li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.conge-info {
    flex: 1;
}

.conge-dates {
    font-weight: 600;
    color: var(--primary-accent-color);
}

.conge-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 10px;
}

.conge-type.CP { background-color: rgba(46, 204, 113, 0.3); color: #2ecc71; }
.conge-type.RTT { background-color: rgba(241, 196, 15, 0.3); color: #f1c40f; }
.conge-type.CSS { background-color: rgba(149, 165, 166, 0.3); color: #95a5a6; }
.conge-type.Maladie { background-color: rgba(231, 76, 60, 0.3); color: #e74c3c; }
.conge-type.Formation { background-color: rgba(211, 84, 0, 0.3); color: #d35400; }

.conge-motif {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* === Styles pour les pauses multiples === */

.label-hint {
    font-size: 0.85rem;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

#pauses-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.pause-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.pause-row .pause-number {
    font-weight: 600;
    color: var(--primary-accent-color);
    min-width: 70px;
}

.pause-row input[type="time"] {
    flex: 1;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
}

.pause-row .btn-remove-pause {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pause-row .btn-remove-pause:hover {
    background-color: rgba(231, 76, 60, 0.4);
}

.btn-add-pause {
    width: 100%;
    padding: 10px;
    background-color: rgba(0, 194, 203, 0.2);
    color: var(--primary-accent-color);
    border: 2px dashed var(--primary-accent-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-add-pause:hover {
    background-color: rgba(0, 194, 203, 0.3);
    border-style: solid;
}

.btn-add-pause:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-add-pause i {
    margin-right: 5px;
}

/* Conformité QA Style */
.compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.compliance-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.compliance-card.success { border-left: 5px solid #2ecc71; }
.compliance-card.warning { border-left: 5px solid #f1c40f; }
.compliance-card.danger { border-left: 5px solid #e74c3c; }

.compliance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
}

.compliance-status {
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 12px;
    color: var(--text-color);
}
.bg-success { background-color: #2ecc71; }
.bg-warning { background-color: #f1c40f; }
.bg-danger { background-color: #e74c3c; }

.violation-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9em;
}

.violation-list li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}
.violation-list li:last-child { border-bottom: none; }
.violation-val { font-weight: bold; color: var(--text-color); }

/* 2. L'apparence de la liste OUVERTE (Les options) */
/* ATTENTION : Le navigateur force souvent un fond opaque ici */
select option {
    background-color: var(--dark) !important; /* Utilise votre variable bleu foncé/gris */
    color: white !important;
    padding: 10px;
}

/* 3. Au survol ou Focus */
select:focus {
    background-color: rgba(0, 0, 0, 0.8) !important;
    border-color: var(--primary) !important;
    outline: none;
}

/* Au focus (quand on clique dedans) */
input:focus,
select:focus,
textarea:focus,
.form-control:focus {
    /* Fond un peu plus foncé */
    background-color: rgba(0, 0, 0, 0.8) !important;
    
    /* Bordure couleur primaire */
    border-color: var(--primary) !important;
    
    /* Lueur externe (Glow) */
    box-shadow: 0 0 0 3px rgba(0, 194, 203, 0.2) !important;
    outline: none;
}

/* Pour le placeholder (texte "exemple..." quand vide) */
::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-style: italic;
}

/* Spécifique aux dates : icône de calendrier blanche (Webkit seulement) */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Inverse la couleur (noir -> blanc) */
    opacity: 0.6;
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Désactivé (Disabled) */
input:disabled, select:disabled, textarea:disabled {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: not-allowed;
}


/* --- Style du Bouton Burger --- */
.mobile-menu-toggle {
    display: none !important; /* Caché sur PC */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1002;
    
    /* Design Glassmorphism */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px; /* ou var(--radius-sm) selon ta charte */
    color: white; /* Icône blanche pour le contraste */
    
    width: 45px;
    height: 45px;
    display: flex; /* Centrage parfait de l'icône */
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

/* --- RESPONSIVE DESIGN MOBILE --- */
@media (max-width: 768px) {
    /* Afficher le bouton en Flex au lieu de Block pour le centrage */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Le menu lui-même */
    .sidebar {
        width: 280px; /* Un peu plus large pour respirer */
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Animation plus douce */
        z-index: 1001; /* Au dessus de tout */
        
        /* Renforcement du glassmorphism */
        background: rgba(20, 20, 35, 0.85); /* Plus sombre pour une bonne lisibilité */
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        
        padding-top: 60px; /* Laisse la place au bouton burger en haut */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5); /* Ombre portée douce */
    }

    /* Aération des liens du menu */
    .nav-links li a {
        padding: 18px 25px; /* Plus d'espace tactile */
        font-size: 1.1rem;
        border-radius: 0 20px 20px 0; /* Arrondi d'un seul côté, très moderne */
        margin-right: 15px; /* Laisse de l'espace à droite */
    }

    /* L'Overlay sombre qui apparaît derrière le menu */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 1000; /* Juste en dessous de la sidebar (1001) */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .menu-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Ajustement de l'espace principal */
    #main-content {
        margin-left: 0;
        padding: 70px 15px 20px 15px; /* Espace en haut pour ne pas cacher le titre sous le burger */
    }

    .page-content {
        padding: 15px;
    }

    .page-content h1 {
        font-size: 1.5rem;
    }

    /* Empiler les éléments qui étaient côte à côte (Flex/Grid) */
    .form-row, 
    .conges-layout {
        flex-direction: column;
        gap: 10px;
    }

    .calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    #nav-buttons {
        justify-content: space-between;
    }

    /* Laisser le calendrier et les tableaux déborder horizontalement au lieu de les écraser */
    #calendar-container,
    .detailed-analysis-container {
        overflow-x: auto;
        padding-bottom: 10px;
    }

        /* Boutons et formulaires : Pleine largeur et empilés */
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    .form-actions button, 
    .button-group button {
        width: 100%;
        margin: 0;
        padding: 12px; /* Plus haut pour un meilleur confort tactile */
    }

    /* Formulaire des pauses multiples plus compact */
    .pause-row {
        flex-wrap: wrap; /* Laisse les champs d'heure passer à la ligne si besoin */
        justify-content: space-between;
    }
    .pause-row input[type="time"] {
        width: 45%; /* Les champs heure prennent presque la moitié de la ligne */
        flex: none;
    }

    /* Calendrier : optimisation de l'espace */
    .day {
        height: 60px; /* Réduit la hauteur sur mobile */
        padding: 2px;
    }
    .day-number {
        font-size: 0.8em; /* Chiffres plus petits */
    }
    .marker {
        height: 3px; /* Marqueurs d'absence plus fins */
    }

    /* Correction des Tooltips (Infobulles) des statistiques */
    .kpi .tooltip {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
        width: 90vw;
        max-width: 350px;
        z-index: 1000;
        box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    }
    /* Masquer la petite flèche de l'infobulle sur mobile */
    .kpi .tooltip::after {
        display: none; 
    }

        /* --- 1. OPTIMISATION GLOBALE DES CHAMPS --- */
    /* Taille 16px obligatoire pour empêcher l'iPhone de zoomer tout seul */
    input, select, textarea {
        font-size: 16px !important; 
        padding: 12px 15px; /* Zones de frappe plus grandes */
    }

    /* --- 2. GRILLES DES HORAIRES (Pointage & Congés) --- */
    /* On garde Arrivée/Départ et Début/Fin côte à côte, mais en forçant la largeur */
    .form-row {
        display: grid !important; /* On écrase le flex précédent */
        grid-template-columns: 1fr 1fr; /* 50% - 50% */
        gap: 15px;
    }

    /* --- 3. REFONTE DES PAUSES EN "MINI-CARTES" --- */
    /* Transforme la ligne de pause écrasée en une carte bien aérée */
    .pause-row {
        display: flex;
        flex-wrap: wrap;
        padding: 15px;
        margin-bottom: 15px;
        background-color: rgba(0, 0, 0, 0.2); /* Fond légèrement plus foncé */
        border-radius: 12px;
        gap: 10px;
    }
    
    /* Le titre "Pause 1" passe tout en haut de la carte */
    .pause-row .pause-number {
        width: 100%;
        margin-bottom: 5px;
        text-align: left;
        font-size: 1.1em;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 8px;
    }

    /* Les champs de saisie (Heure de début et Heure de fin) se partagent la largeur */
    .pause-row input[type="time"] {
        flex: 1; /* Prennent toute la place disponible */
        min-width: 40%;
    }

    /* Le bouton supprimer (Poubelle) passe tout en bas de la carte, en pleine largeur */
    .pause-row .btn-remove-pause {
        width: 100%;
        margin-top: 5px;
        padding: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 8px;
    }

    /* --- 4. GROS BOUTONS D'ACTION EN BAS DE PAGE --- */
    .form-actions {
        display: flex;
        flex-direction: column; /* Empile les boutons "Enregistrer" et "Supprimer" */
        gap: 12px;
        margin-top: 30px;
    }

    .form-actions button,
    .btn-add-pause {
        width: 100%;
        padding: 15px; /* Très confortable pour le pouce */
        font-size: 1.1rem;
        font-weight: bold;
    }
    
    /* Bouton ajouter une pause un peu plus discret mais tout aussi large */
    .btn-add-pause {
        margin-top: 5px;
        margin-bottom: 20px;
    }

}
