/* Styles spécifiques pour cette page */
.historique-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 20px 0;
}

.historique-section h3 {
    color: #007ca1;
    margin: 0 0 20px 0;
    font-size: 1.2em;
    text-align: center;
    font-weight: 600;
}

/* En-tête de la section statut : titre + accès à l'historique complet.
   Volontairement compact : une seule ligne discrète au-dessus des stats. */
.historique-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.historique-header h3 {
    margin: 0;
    text-align: left;
    font-size: 1em;
}

.btn-historique {
    background: #007ca1;
    color: #fff;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s;
}

.btn-historique:hover {
    background: #00688a;
    color: #fff;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 12px 0;
}

.stat-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,124,161,0.1);
}

.stat-number {
    font-size: 1.8em;
    font-weight: 600;
    color: #007ca1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
}

.historique-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin: 10px 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.historique-item:hover {
    border-color: #007ca1;
    box-shadow: 0 2px 8px rgba(0,124,161,0.1);
}

.historique-info {
    flex: 1;
}

.historique-employee {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.historique-details {
    color: #6c757d;
    font-size: 0.85em;
}

.salaries-section {
    margin: 30px 0;
}

.salaries-section h3 {
    color: #007ca1;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* En-tête de groupe (Salariés / Praticiens) : titre + pastilles Tous / Aucun */
.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 25px 0 10px;
}

.group-header h3 {
    margin-bottom: 0;
    text-align: left;
}

.group-pills {
    display: inline-flex;
    gap: 6px;
}

.group-pill {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #007ca1;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 4px 12px;
    border-radius: 999px;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.group-pill:hover {
    background: #e6f6fb;
    border-color: #007ca1;
}

.group-pill:active {
    background: #007ca1;
    color: #fff;
    border-color: #007ca1;
}

.salarie-item {
    display: flex;
    align-items: center;
    padding: 16px;
    margin: 12px 0;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.salarie-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,124,161,0.05), transparent);
    transition: left 0.5s;
}

.salarie-item:hover::before {
    left: 100%;
}

.salarie-item:hover {
    border-color: #007ca1;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,124,161,0.15);
}

.salarie-item.selected {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #007ca1;
    box-shadow: 0 4px 15px rgba(0,124,161,0.2);
}

.salarie-item.has-validation {
    border-left: 4px solid #28a745;
}

.salarie-item.has-pending {
    border-left: 4px solid #ffc107;
}

.salarie-item.has-error {
    border-left: 4px solid #dc3545;
}

.salarie-item input[type="checkbox"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    accent-color: #007ca1;
    cursor: pointer;
}

.salarie-info {
    flex: 1;
    cursor: pointer;
}

.salarie-nom {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 1em;
}

.salarie-email {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
}

.salarie-status {
    margin-top: 8px;
}

.btn-envoi {
    background: linear-gradient(135deg, #007ca1, #005f7a);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 25px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,124,161,0.3);
}

.btn-envoi:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,124,161,0.4);
}

.btn-envoi:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-envoi.loading {
    background: linear-gradient(135deg, #005f7a, #004a61);
    cursor: wait;
    transform: none;
}

.btn-envoi.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}


.debug-details {
    margin-top: 20px;
    text-align: left;
}

.debug-details summary {
    cursor: pointer;
    color: #666;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
}

.debug-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.4;
}

/* ✅ NOUVEAU : Styles pour la sélection de période */
.period-selection-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.section-title {
    color: #007ca1;
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
}

.period-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selector-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.period-selector {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    color: #2c3e50;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-selector:hover {
    border-color: #007ca1;
}

.period-selector:focus {
    outline: none;
    border-color: #007ca1;
    box-shadow: 0 0 0 3px rgba(0,124,161,0.1);
}

@media (max-width: 768px) {
    .period-selectors {
        grid-template-columns: 1fr;
    }
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .historique-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .salarie-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .salarie-item input[type="checkbox"] {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
