/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

body.menu-open {
    overflow: hidden;
}

/* Pages d'authentification */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Nouveau dégradé de bleu pour un look moderne */
    background: linear-gradient(135deg, #4c8bf5 0%, var(--primary-color) 100%);
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    /* Modernisation */
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.auth-box h1 {
    font-size: 32px; /* Plus grand */
    font-weight: 800; /* Plus gras */
    color: var(--primary-color); /* Couleur primaire (bleu) */
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px; /* Plus lisible */
}

.auth-footer {
    margin-top: 30px; /* Plus d'espace */
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700; /* Plus d'emphase */
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-toggle {
	    display: none;
	    flex-direction: column;
	    background: none;
	    border: none;
	    cursor: pointer;
	    padding: 8px;
	    justify-content: space-around;
	    height: 20px;
	}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .nav-toggle {
        /* Rendre le bouton plus visible */
        background-color: var(--primary-color); /* Fond bleu */
        border-radius: 6px;
        padding: 10px;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        box-shadow: var(--shadow-md);
    }

    .nav-toggle span {
        background: white; /* Barres blanches pour contraste */
    }
}

.nav-menu {
	    display: flex;
	    align-items: center;
	    gap: 8px;
	}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

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

.nav-link.active {
    color: var(--primary-color);
    background: #eff6ff;
}

.nav-logout {
    color: var(--danger-color);
}

.nav-logout:hover {
    background: #fef2f2;
}

/* Conteneur principal */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.content-wrapper {
    width: 100%;
}

/* En-tête de page */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Cartes */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Formulaires */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled {
    background: var(--light-bg);
    cursor: not-allowed;
}

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

small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Messages */
.message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Tableaux */
.table-responsive {
    overflow-x: auto;
    margin-top: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--light-bg);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.status-display {
    text-align: center;
    padding: 20px;
}

.status-badge {
    display: inline-block;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 12px;
}

.status-présent {
    background: #d1fae5;
    color: #065f46;
}

.status-en-pause {
    background: #fef3c7;
    color: #92400e;
}

.status-sorti {
    background: #fee2e2;
    color: #991b1b;
}

.status-absent {
    background: #f1f5f9;
    color: #475569;
}

.status-time {
    color: var(--text-secondary);
    font-size: 14px;
}

.conges-display {
    text-align: center;
    padding: 20px;
}

.conges-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
}

.conges-badge {
    display: inline-block;
    padding: 8px 16px;
    background: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 8px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Filtres */
.filters {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-form .form-group {
    margin-bottom: 0;
}

/* Pointage */
.pointage-info {
    background: var(--light-bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pointage-info p {
    margin: 8px 0;
    font-size: 14px;
}

/* Congés */
.conges-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.conges-info-box p {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

/* Utilitaires */
.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    /* --- Navigation --- */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 16px 30px 16px;
        box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
        display: none;
        z-index: 1000;
        max-height: 100vh;
        overflow-y: auto;
        gap: 12px;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(10px);
    }

    .nav-menu.active {
        display: flex;
        transform: translateX(0);
    }

    .nav-link {
        padding: 14px 18px;
        text-align: center;
        width: 100%;
        display: block;
        border-radius: 12px;
        font-weight: 600;
        font-size: 16px;
        color: white;
        background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
        border: none;
    }

    .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.2);
        transition: left 0.3s ease;
        z-index: 1;
    }

    .nav-link:hover {
        background: linear-gradient(135deg, var(--primary-hover) 0%, #1e3a8a 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
        color: white;
    }

    .nav-link:hover::before {
        left: 100%;
    }

    .nav-link.active {
        background: linear-gradient(135deg, var(--primary-hover) 0%, #1e3a8a 100%);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
        position: relative;
        color: white;
    }

    .nav-link.active::after {
        content: '✓';
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        font-weight: bold;
        font-size: 18px;
        z-index: 2;
    }

    .nav-link.nav-logout {
        background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
        margin-top: 16px;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
    }

    .nav-link.nav-logout:hover {
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
    }

    /* Le bouton de rafraîchissement est masqué sur mobile */
    .btn-refresh {
        display: none;
    }
    
    /* --- Conteneurs et mise en page --- */
    .main-container {
        padding: 20px 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 24px;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px; /* Réduire l'espace entre les boutons */
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr; /* Une seule colonne pour le dashboard */
    }
    
    .form-row {
        grid-template-columns: 1fr; /* Une seule colonne pour les formulaires */
    }
    
    .filter-form {
        grid-template-columns: 1fr; /* Une seule colonne pour les filtres */
    }
    
    /* --- Tableaux (Correction) --- */
    .table-responsive {
        width: 100%;
        overflow-x: auto; /* Permet le défilement horizontal */
    }

    .table {
        min-width: 600px; /* Largeur minimale pour éviter la compression excessive */
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
    
    /* --- Calendrier (Correction) --- */
    .calendar-grid {
        /* Garder le grid 7 colonnes mais réduire la taille */
        font-size: 12px;
    }
    
    .calendar-header {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .calendar-day {
        min-height: 70px; /* Hauteur minimale plus raisonnable */
        padding: 5px;
    }
    
    .leave-list li {
        font-size: 10px;
    }
    
    .calendar-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-controls a {
        width: 100%;
        text-align: center;
    }
    
    .calendar-selectors {
        width: 100%;
        flex-direction: column;
        gap: 5px;
    }
    
    .calendar-selectors select {
        max-width: 100%;
        width: 100%;
    }
    
    /* --- Autres éléments --- */
    .auth-box {
        padding: 30px 20px;
    }
    
    .btn {
        /* Assurer que les couleurs des boutons sont conservées */
        /* Pas de modification de couleur ici, juste de la mise en page si nécessaire */
    }
}
    




@media (max-width: 480px) {
    .main-container {
        padding: 15px 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .nav-brand h2 {
        font-size: 18px;
    }
    
    .auth-box {
        padding: 25px 15px;
    }
    
    .auth-box h1 {
        font-size: 26px;
    }
    
    /* --- Tableaux --- */
    .table {
        min-width: 500px; /* Réduire un peu plus la largeur minimale */
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    /* --- Calendrier --- */
    .calendar-grid {
        font-size: 10px;
    }
    
    .calendar-header {
        padding: 6px 3px;
        font-size: 10px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 3px;
    }
    
    .leave-list li {
        font-size: 8px;
    }
    
    /* --- Formulaires --- */
    .form-control {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
        padding: 10px 12px;
    }
    
    /* --- Boutons --- */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* --- Dashboard --- */
    .conges-number {
        font-size: 32px;
    }
    
    .status-badge {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* Styles pour le calendrier des congés */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
}

.calendar-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 5px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.calendar-day {
    background-color: white;
    min-height: 100px;
    padding: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.calendar-day.empty {
    background-color: var(--light-bg);
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
}

.calendar-day.has-leave {
    background-color: #f0f9ff; /* Light blue background */
}

.leave-list {
    list-style: none;
    padding: 0;
    margin-top: 5px;
}

.leave-list li {
    font-size: 12px;
    padding: 2px 5px;
    margin-bottom: 2px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leave-annuel {
    background-color: #d1fae5; /* Green for annuel */
    color: #065f46;
}

.leave-special {
    background-color: #dbeafe; /* Blue for special */
    color: #1e40af;
}

.leave-holiday {
    background-color: #fee2e2; /* Red for holidays */
    color: #991b1b;
    font-weight: 600;
}

/* Styles pour les commentaires */
.comment-display {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--light-bg);
    margin-bottom: 20px;
}

.comment-display p {
    margin-bottom: 5px;
}

.comment-content {
    font-size: 16px;
    font-style: italic;
    color: var(--text-primary);
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

.comment-date {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

/* Styles pour le temps de travail coloré */
.work-time-highlight {
    /* Nouveau dégradé de bleu pour un look moderne */
    background: linear-gradient(135deg, #4c8bf5 0%, var(--primary-color) 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.work-time-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.work-time-summary p {
    margin: 0;
    font-size: 16px;
}

/* Styles pour le bouton actualiser */
.btn-refresh {
    /* Nouveau dégradé de bleu pour un look moderne */
    background: linear-gradient(135deg, #4c8bf5 0%, var(--primary-color) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

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

.btn-refresh svg {
    width: 18px;
    height: 18px;
}

/* Styles pour la navigation du calendrier */
.calendar-navigation {
    margin-bottom: 20px;
}

.calendar-controls {
	    display: flex;
	    justify-content: space-between;
	    align-items: center;
	    gap: 15px;
	    flex-wrap: wrap;
	}

	.calendar-nav-form {
	    width: 100%;
	}

.calendar-selectors {
	    display: flex;
	    gap: 10px;
	    flex: 1;
	    justify-content: center;
	}

	.calendar-controls a {
	    white-space: nowrap;
	}

.calendar-selectors select {
    max-width: 150px;
}

/* Styles pour les commentaires multiples */
.comment-display {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.comment-display:last-child {
    margin-bottom: 0;
}

.comment-content {
    margin: 10px 0;
    line-height: 1.6;
}

.comment-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Bouton warning pour demandes non traitées */
.btn-warning {
    background: var(--warning-color);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}


