/* Surcharge des styles partagés pour la page planning-general */
html {
    overflow: hidden !important;
}

.main-content {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

.general-planning-container {
    width: 100%;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-bottom: 5px;
}

/* Styles pour les contrôles dans le top-header */
.top-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.top-header .header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.top-header .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.view-selector {
    padding: 8px 12px;
    border: 2px solid #3498db;
    background: #fff;
    color: #2c3e50;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-selector:hover {
    background: #fff;
    border-color: #2980b9;
}

.view-selector:focus {
    outline: none;
    background: #fff;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.day-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-nav-btn {
    padding: 12px 20px;
    border: 2px solid #3498db;
    background: #3498db;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.day-nav-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.day-nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.day-nav-btn.today-btn {
    padding: 12px 20px;
    font-size: 15px;
}

.date-picker-container {
    position: relative;
    display: flex;
    align-items: center;
}

.date-picker-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.date-picker-btn {
    padding: 12px 16px;
    font-size: 15px;
    min-width: 88px;
    white-space: nowrap;
}

.mode-toggle-btn {
    padding: 12px 20px;
    border: 2px solid #3498db;
    background: #3498db;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
    white-space: nowrap;
}

.mode-toggle-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.mode-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.mode-toggle-btn .mode-icon {
    font-size: 18px;
    line-height: 1;
}

.mode-toggle-btn .mode-text {
    white-space: nowrap;
}

/* Style pour le bouton de filtre dans le header-right */
.header-right .filter-btn {
    margin-right: 10px;
}

/* Style pour le bouton de filtre actif */
.filter-btn.filter-active {
    background: #f39c12;
    border-color: #e67e22;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.filter-btn.filter-active:hover {
    background: #e67e22;
    border-color: #d35400;
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.4);
}

.planning-calendar-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 5px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.planning-calendar-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.planning-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    min-width: 100%;
    table-layout: auto;
    height: 100%;
    display: table;
}

.planning-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    /* Doit rester au-dessus du curseur/ligne "heure actuelle" (z-index: 100) */
    z-index: 200;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.planning-table thead tr {
    background: #f8f9fa;
    margin: 0;
    padding: 0;
    border-spacing: 0;
}

.planning-table th {
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
    font-size: 11px;
    margin: 0;
    vertical-align: middle;
    border: none;
}

.resource-header {
    min-width: 120px;
    max-width: 120px;
    width: 120px;
    padding: 0;
    position: sticky;
    left: 0;
    /* Au-dessus des autres cellules du thead + contenu (sticky left) */
    z-index: 201;
    background: #f8f9fa !important;
    border: none !important;
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

.resource-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom left,
        transparent 0%,
        transparent calc(50% - 1px),
        #dfe6e9 calc(50% - 1px),
        #dfe6e9 calc(50% + 1px),
        transparent calc(50% + 1px),
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

.resource-header-top {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
    z-index: 2;
    line-height: 1.2;
}

.resource-header-bottom {
    position: absolute;
    bottom: 4px;
    left: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    z-index: 2;
    line-height: 1.2;
}

.hour-header {
    min-width: 60px;
    width: 60px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #2c3e50;
    background: #e8f0fe !important;
    border: none;
    padding: 4px 2px;
    margin: 0;
}

.planning-table.day-view .hour-header {
    min-width: 40px;
    width: 40px;
    font-size: 9px;
    padding: 3px 1px;
}

.day-header {
    min-width: 60px;
    width: auto;
    font-size: 10px;
    padding: 4px 2px;
    background: #f8f9fa !important;
    border: none;
    margin: 0;
}

.planning-table.day-view .day-header {
    min-width: 80px; /* 2 demi-journées * 40px */
    width: 80px;
}

.day-header .day-number {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
}

.day-header .day-name {
    font-size: 9px;
    color: #7f8c8d;
    margin-top: 2px;
}

.day-header .day-full {
    font-size: 11px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.day-header .day-full-date {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

.planning-table tbody tr {
    height: auto;
}

.planning-table tbody tr:hover {
    background: #f8f9fa;
}

.resource-cell {
    padding: 12px 10px;
    font-weight: 500;
    color: #2c3e50;
    border: 1px solid #dfe6e9;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 5;
    white-space: nowrap;
    vertical-align: middle;
    min-width: 120px;
    max-width: 120px;
    width: 120px;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-main-line {
    flex: 0 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-total {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    font-size: 11px;
    color: #000000;
    white-space: nowrap;
}

/* Style orange pour les chauffeurs en cours d'une mission (comme les filtres actifs) */
.resource-cell.mission-active {
    background: #f39c12;
    border-color: #e67e22;
    color: #fff;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

/* Style vert pour les ressources sans planification dans la vue actuelle */
.resource-cell.no-planning {
    background: #27ae60;
    border-color: #229954;
    color: #fff;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

/* Styles pour le bouton check des chauffeurs */
.driver-check-btn {
    background: transparent;
    border: 2px solid #95a5a6;
    color: #95a5a6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    line-height: 1;
}

.driver-check-btn:hover {
    border-color: #3498db;
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.driver-check-btn.checked {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

.driver-check-btn.checked:hover {
    background: #229954;
    border-color: #229954;
}

.driver-check-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.driver-ack-all-read {
    font-size: 30px;
    font-weight: 700;
    color: #27ae60;
    line-height: 1;
    margin-top: 2px;
}

/* Affiner la largeur de la colonne ressource en vue 3 jours uniquement */
.planning-table.planning-3days-view .resource-header,
.planning-table.planning-3days-view .resource-cell {
    min-width: 30px;
    max-width: 50px;
    width: 0px;
}

.day-cell {
    padding: 0;
    border: 1px solid #dfe6e9;
    vertical-align: top;
    min-width: 60px;
    width: 60px;
    position: relative;
    background: #fff;
}

.planning-table.day-view .day-cell {
    min-width: 40px;
    width: 40px;
}

.day-cell.hour-cell-content {
    height: 60px;
    min-height: 60px;
}

.day-cell:hover {
    background: #f8f9fa;
}

.day-container {
    padding: 0 !important;
    position: relative;
    min-width: 120px; /* 2 demi-journées * 60px */
    width: 120px;
}

.planning-table.day-view .day-container {
    min-width: 80px; /* 2 demi-journées * 40px */
    width: 80px;
}

.days-row-container {
    padding: 0 !important;
    position: relative;
    height: 100%;
    vertical-align: top;
    border-spacing: 0;
}

.days-row-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 60px;
    gap: 0;
    height: 100%;
}

.day-container-inline {
    position: relative;
    min-width: 120px; /* 2 demi-journées * 60px */
    flex-shrink: 0;
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.planning-table.day-view .day-container-inline {
    min-width: 960px; /* 24 heures * 40px */
    flex-grow: 0;
}

.day-hours-container {
    position: relative;
    height: 100%;
    min-height: 60px;
    display: flex;
    border: 1px solid #dfe6e9;
    background: #fff;
    overflow: visible; /* Permettre à la barre d'heure actuelle de dépasser si nécessaire */
    flex: 1;
}

.hour-cell-wrapper,
.halfday-cell-wrapper {
    flex: 1;
    min-width: 60px;
    width: 60px;
    position: relative;
    border-right: 1px solid #ecf0f1;
    background: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 100%;
}

.hour-cell-wrapper:hover,
.halfday-cell-wrapper:hover {
    background: #e8f0fe;
}

/* Aide RSE : barre rouge SOUS-JOURNÉE (échéance 144 h -> prochain repos hebdo).
   Positionnée en % de la journée dans .day-container-inline (position: relative).
   z-index ÉLEVÉ : la grille passe AU-DESSUS des missions/absences ; mais
   pointer-events:none => les clics passent au travers (missions cliquables).
   L'info au survol est gérée par une infobulle JS personnalisée. */
.weekly-rest-illegal-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 150; /* au-dessus des missions (max ~100 au survol) et rendez-vous (50) */
    pointer-events: none;
    background-color: rgba(220, 53, 69, 0.22);
    border-left: 2px solid rgba(220, 53, 69, 0.9);
    background-image: repeating-linear-gradient(
        135deg,
        rgba(220, 53, 69, 0.14) 0,
        rgba(220, 53, 69, 0.14) 6px,
        rgba(220, 53, 69, 0.30) 6px,
        rgba(220, 53, 69, 0.30) 12px
    );
}

/* Aide RSE : zone VERTE = bloc qui solde une compensation de repos réduit. */
.weekly-rest-comp-paid-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 150;
    pointer-events: none;
    background-color: rgba(40, 167, 69, 0.22);
    border-left: 2px solid rgba(33, 136, 56, 0.9);
    background-image: repeating-linear-gradient(
        45deg,
        rgba(40, 167, 69, 0.14) 0,
        rgba(40, 167, 69, 0.14) 6px,
        rgba(40, 167, 69, 0.30) 6px,
        rgba(40, 167, 69, 0.30) 12px
    );
}

/* Aide RSE : zone AMBRE = dette de compensation en attente (avant échéance). */
.weekly-rest-comp-due-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 150;
    pointer-events: none;
    background-color: rgba(245, 158, 11, 0.20);
    border-left: 2px solid rgba(217, 119, 6, 0.9);
    background-image: repeating-linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.14) 0,
        rgba(245, 158, 11, 0.14) 6px,
        rgba(245, 158, 11, 0.28) 6px,
        rgba(245, 158, 11, 0.28) 12px
    );
}

/* Dette de compensation IMPAYÉE hors délai (échéance dépassée). */
.weekly-rest-comp-due-overlay.overdue {
    background-color: rgba(234, 88, 12, 0.28);
    border-left: 2px solid rgba(194, 65, 12, 0.95);
    background-image: repeating-linear-gradient(
        135deg,
        rgba(234, 88, 12, 0.18) 0,
        rgba(234, 88, 12, 0.18) 5px,
        rgba(194, 65, 12, 0.40) 5px,
        rgba(194, 65, 12, 0.40) 10px
    );
}

/* Segment de continuation d'une zone (jour suivant) : pas de bordure gauche,
   pour éviter une barre verticale à chaque frontière de jour / à minuit. */
.weekly-rest-illegal-overlay.no-left-border,
.weekly-rest-comp-paid-overlay.no-left-border,
.weekly-rest-comp-due-overlay.no-left-border,
.weekly-rest-comp-due-overlay.overdue.no-left-border {
    border-left: none;
}

/* Infobulle explicative des zones RSE (positionnée en JS, ancrée au-dessus de la ligne). */
.weekly-rest-tooltip {
    position: fixed;
    z-index: 5000;
    max-width: 360px;
    pointer-events: none;
    background: #1f2937;
    color: #f9fafb;
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.45;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.weekly-rest-tooltip .wrt-title {
    font-weight: 700;
    color: #ffb4bb;
    margin-bottom: 2px;
}

.weekly-rest-tooltip .wrt-title-green {
    color: #86efac;
}

.weekly-rest-tooltip .wrt-title-amber {
    color: #fcd34d;
}

.weekly-rest-tooltip .wrt-title-overdue {
    color: #fdba74;
}

.weekly-rest-tooltip .wrt-driver {
    font-weight: 600;
    margin-bottom: 6px;
    color: #e5e7eb;
}

.weekly-rest-tooltip .wrt-rule {
    color: #d1d5db;
    margin-bottom: 6px;
}

.weekly-rest-tooltip .wrt-list {
    margin: 0 0 6px 16px;
    padding: 0;
}

.weekly-rest-tooltip .wrt-list li {
    margin: 0 0 3px 0;
}

.weekly-rest-tooltip .wrt-warn {
    color: #fca5a5;
}

.weekly-rest-tooltip .wrt-tip {
    color: #9ca3af;
    font-style: italic;
}

.planning-table.day-view .hour-cell-wrapper,
.planning-table.day-view .halfday-cell-wrapper {
    min-width: 40px;
    width: 40px;
}

.hour-cell-marker {
    position: absolute;
    top: 2px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    color: #7f8c8d;
    font-weight: 500;
    z-index: 1;
    pointer-events: none;
}

.planning-table.day-view .hour-cell-marker {
    font-size: 9px;
}

.mission-cell {
    position: absolute;
    left: 2px;
    right: 2px;
    margin: 0;
    padding: 4px 6px;
    color: #fff;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    z-index: 2;
    box-sizing: border-box;
    min-height: 20px;
    width: calc(100% - 4px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.mission-cell:hover {
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Barre indiquant l'heure actuelle */
.current-time-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dc3545;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.6);
}

/* Couleurs différentes par ligne pour distinguer les ressources */
.mission-cell.mission-row-0 {
    background: #3498db;
    border-left: 3px solid #2980b9;
}

.mission-cell.mission-row-1 {
    background: #27ae60;
    border-left: 3px solid #229954;
}

.mission-cell.mission-row-2 {
    background: #e74c3c;
    border-left: 3px solid #c0392b;
}

.mission-cell.mission-row-3 {
    background: #f39c12;
    border-left: 3px solid #e67e22;
}

.mission-cell.mission-block {
    /* Le bloc s'étend sur plusieurs colonnes ; z-index défini en JS (2 + index) pour superposition par durée */
    position: absolute;
    overflow: hidden;
    white-space: normal;
}

.mission-cell.appointment-block {
    /* Rendez-vous au-dessus des missions */
    z-index: 50;
}

.days-row-wrapper .mission-cell {
    /* Les missions dans le conteneur de tous les jours sont positionnées par rapport au wrapper */
    position: absolute;
    top: 0;
    height: 100%;
}

.absence-cell.absence-block {
    /* Le bloc s'étend sur plusieurs colonnes ; z-index bas pour rester sous missions et rendez-vous */
    position: absolute;
    z-index: 1;
    overflow: hidden;
    white-space: normal;
}

.days-row-wrapper .absence-cell {
    /* Les absences dans le conteneur de tous les jours sont positionnées par rapport au wrapper */
    position: absolute;
    top: 0;
    height: 100%;
}

/* Styles pour les checkboxes de filtre */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

#vehicleTypesFilter.filter-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    padding: 8px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

#vehicleTypesFilter .filter-checkbox-label {
    padding: 6px 10px;
    gap: 6px;
}

.filter-checkbox-label:hover:not([style*="opacity: 0.5"]) {
    background: #e3f2fd;
    border-color: #3498db;
}

.filter-checkbox-label[style*="opacity: 0.5"] {
    cursor: not-allowed;
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.filter-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.filter-checkbox-label span {
    font-size: 0.9rem;
    color: #2c3e50;
    user-select: none;
}

#vehicleTypesFilter .filter-checkbox-label span {
    font-size: 0.85rem;
}

/* Styles spécifiques pour la modal de filtre des types de véhicules */
#vehicleTypeFilterModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    overflow-y: hidden !important; /* Surcharger le overflow-y: auto du CSS général */
}

#vehicleTypeFilterModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#vehicleTypeFilterModal .modal-body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

#vehicleTypeFilterModal .modal-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-top: 2px solid #e1e8ed;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Styles spécifiques pour la modal de filtre des permis */
#driverLicenseFilterModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    overflow-y: hidden !important; /* Surcharger le overflow-y: auto du CSS général */
}

#driverLicenseFilterModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#driverLicenseFilterModal .modal-body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

#driverLicenseFilterModal .modal-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-top: 2px solid #e1e8ed;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Styles spécifiques pour la modal d'édition d'absence (l'ajout utilise shared-absence.css) */
#editAbsenceModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    overflow-y: hidden !important; /* Surcharger le overflow-y: auto du CSS général */
}

#editAbsenceModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#editAbsenceModal .modal-body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

#editAbsenceModal .modal-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-top: 2px solid #e1e8ed;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Styles pour les formulaires dans la modal de modification d'absence */
#editAbsenceModal .form-group {
    margin-bottom: 20px;
}

#editAbsenceModal .form-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

#editAbsenceModal .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
    color: #2c3e50;
    box-sizing: border-box;
}

#editAbsenceModal .form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#editAbsenceModal .form-control[type="date"],
#editAbsenceModal .form-control[type="time"] {
    padding: 10px 15px;
}

#editAbsenceModal .form-control[type="date"]::-webkit-calendar-picker-indicator,
#editAbsenceModal .form-control[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
}

#editAbsenceModal .form-control[type="date"]::-webkit-calendar-picker-indicator:hover,
#editAbsenceModal .form-control[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

#editAbsenceModal select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#editAbsenceModal textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

#editAbsenceModal .form-control:invalid {
    border-color: #e74c3c;
}

#editAbsenceModal .form-control:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

#editAbsenceModal .form-control:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#editAbsenceModal select.form-control:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Styles pour les listes de chauffeurs et de camions */
#driversFilter.filter-checkboxes,
#vehiclesFilter.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#driversFilter.filter-checkboxes::-webkit-scrollbar,
#vehiclesFilter.filter-checkboxes::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

/* Tooltip personnalisé pour les missions - Style compact comme month.css */
.mission-tooltip {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 300px;
    font-size: 0.85rem;
    display: none;
}

.mission-tooltip .tooltip-loading {
    padding: 4px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.8rem;
}

.mission-tooltip .tooltip-no-steps {
    padding: 4px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.8rem;
}

.mission-tooltip .tooltip-header {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
    margin-top: 6px;
    font-size: 0.85rem;
}

.mission-tooltip .tooltip-header:first-child {
    margin-top: 0;
}

.mission-tooltip .tooltip-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mission-tooltip .tooltip-step {
    font-size: 0.8rem;
    color: #334155;
    margin-bottom: 3px;
    line-height: 1.3;
    padding: 2px 4px;
    background: rgba(155, 89, 182, 0.08);
    border-radius: 3px;
    border-left: 2px solid #9b59b6;
}

.mission-tooltip .tooltip-step:last-child {
    margin-bottom: 0;
}

.mission-tooltip .tooltip-step-header {
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.3;
}

.mission-tooltip .tooltip-mission-description {
    margin-top: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Tooltip personnalisé pour les absences - Style compact comme mission-tooltip */
.absence-tooltip {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 300px;
    font-size: 0.85rem;
    display: none;
}

.absence-tooltip .tooltip-header {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 6px;
    margin-top: 0;
    font-size: 0.85rem;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.absence-tooltip .tooltip-info {
    font-size: 0.8rem;
    color: #334155;
    margin-bottom: 4px;
    line-height: 1.4;
}

.absence-tooltip .tooltip-info:last-child {
    margin-bottom: 0;
}

.absence-tooltip .tooltip-info strong {
    color: #2c3e50;
    font-weight: 600;
}

.mission-cell.mission-row-0:hover {
    background: #2980b9;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mission-cell.mission-row-1:hover {
    background: #229954;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mission-cell.mission-row-2:hover {
    background: #c0392b;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mission-cell.mission-row-3:hover {
    background: #e67e22;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Styles pour les absences */
.absence-cell {
    position: absolute;
    background: #95a5a6;
    color: #000000;
    border: 2px solid #5d6d7e;
    border-left: 4px solid #34495e;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 2;
    min-height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.absence-cell:hover {
    background: #7f8c8d;
    border-color: #34495e;
    border-left-color: #2c3e50;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.absence-cell.absence-multi-day {
    border-left-width: 5px;
    border-width: 2.5px;
}

/* ========================================
   STYLES POUR LES DISPONIBILITÉS
   (Bordure pointillée - couleurs viennent de la BDD)
   ======================================== */

.absence-cell.availability-block {
    border-style: dashed !important;
    border-width: 2px !important;
    z-index: 1;
}

.absence-cell.availability-block:hover {
    z-index: 2;
}

.absence-name {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.absence-time {
    font-size: 10px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.absence-reason {
    font-size: 9px;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.absence-status-badge {
    font-size: 9px;
    font-weight: 600;
    margin-top: 2px;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    width: fit-content;
}

/* ========================================
   BADGES DE STATUT D'ABSENCE
   ======================================== */

/* En attente - Orange */
.absence-status-badge.status-pending {
    background: #f39c12;
    color: #fff;
    border: 1px solid #d35400;
}

/* Approuvée - Vert */
.absence-status-badge.status-approved {
    background: #27ae60;
    color: #fff;
    border: 1px solid #1e8449;
}

/* Refusée - Rouge */
.absence-status-badge.status-rejected {
    background: #e74c3c;
    color: #fff;
    border: 1px solid #a93226;
}

/* Notifications discrètes */
.planning-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 10000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
    pointer-events: none;
}

.planning-notification.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.planning-notification-success {
    background: #27ae60;
}

.planning-notification-error {
    background: #e74c3c;
}

.planning-notification-info {
    background: #3498db;
}

.mission-cell.mission-multi-day {
    border-left-color: #e74c3c;
    border-left-width: 4px;
}

.mission-name {
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    line-height: 1.2;
}

.mission-time {
    font-size: 9px;
    opacity: 0.9;
    margin-top: 1px;
    line-height: 1.2;
}

.mission-other {
    font-size: 9px;
    opacity: 0.85;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid rgba(255,255,255,0.3);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mission-ack-stale {
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #b42318;
    border-radius: 3px;
    padding: 1px 4px;
    margin-top: 2px;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

.mission-cell.mission-in-driver-week::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    pointer-events: none;
    z-index: 1;
}

.mission-cell.mission-ack-unread::after {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.92) 0%, transparent 100%);
}

.no-resources {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

/* Styles pour les différents statuts de mission */
.mission-cell[data-status="in_progress"] {
    background: #f39c12;
    border-left-color: #e67e22;
}

.mission-cell[data-status="in_progress"]:hover {
    background: #e67e22;
}

.mission-cell[data-status="completed"] {
    background: #27ae60;
    border-left-color: #229954;
}

.mission-cell[data-status="completed"]:hover {
    background: #229954;
}

/* Modal "Planifier une mission" : pas d'overflow sur le content pour que les listes déroulantes ne soient pas rognées */
#planningMissionModal {
    z-index: 1500;
}
#planningMissionModal .modal-content {
    overflow: visible;
}
#planningMissionModal .modal-body {
    overflow: visible;
}
#planningMissionModal #planningMissionSearchResultsMain,
#planningMissionModal #planningMissionSearchResultsTemp {
    z-index: 1060;
    max-height: min(280px, 40vh);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 4px 4px;
}
/* Aligner le footer avec le body : annuler le padding du body pour aligner les bords, même padding horizontal (20px) */
#planningMissionModal .modal-footer {
    margin-top: 20px;
    margin-left: -20px;
    margin-right: -20px;
    padding: 20px;
}

/* Modal de conflits : styles dans styles/shared-absence.css (#sharedConflictModal) */

#conflictList .mission-details {
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Responsive */
@media (max-width: 768px) {
    #planningMissionModal .planning-mission-search-grid {
        grid-template-columns: 1fr;
    }

    .planning-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mode-toggle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .resource-header,
    .resource-cell {
        min-width: 120px;
    }
    
    .day-header,
    .day-cell {
        min-width: 80px;
    }
}

/* Styles pour le drag and drop des missions */
.day-cell-drag-over {
    background-color: rgba(40, 167, 69, 0.2) !important;
    border: 2px dashed #28a745 !important;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3) !important;
}

.mission-cell.dragging {
    opacity: 0.5;
    cursor: grabbing !important;
    z-index: 1000;
    transform: scale(0.95);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mission-cell[draggable="true"] {
    cursor: grab;
    user-select: none;
}

.mission-cell[draggable="true"]:active {
    cursor: grabbing;
}

.resource-row.drag-over {
    background-color: rgba(52, 152, 219, 0.1) !important;
    border-left: 4px solid #3498db;
    transition: background-color 0.2s ease, border-left 0.2s ease;
}

.resource-row.drag-over .resource-cell {
    font-weight: 600;
    color: #2980b9;
}

.resource-row {
    transition: background-color 0.2s ease, border-left 0.2s ease;
}

/* Mode édition du planning */
.planning-edit-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.planning-edit-btn {
    font-size: 1.1rem;
    padding: 6px 10px;
}

.planning-edit-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fff4d6;
    border: 1px solid #f0b429;
    white-space: nowrap;
}

.planning-edit-label {
    font-weight: 600;
    color: #8a5a00;
}

.planning-edit-action {
    padding: 4px 10px;
}

body.planning-locked .mission-cell,
body.planning-locked .mission-cell.appointment-block,
body.planning-locked .absence-cell:not([data-absence-state="pending"]),
body.planning-locked .hour-cell-wrapper,
body.planning-locked .halfday-cell-wrapper,
body.planning-locked #addAbsenceBtn {
    cursor: not-allowed;
}

body.planning-locked #addAbsenceBtn {
    opacity: 0.55;
}

body.planning-locked .mission-cell {
    cursor: default;
}

body.planning-edit-active .general-planning-container {
    box-shadow: inset 0 0 0 3px #f0b429;
}

