/* Calendrier chauffeur : plein écran, filtres, récapitulatif. Lecture seule. */

#modalCalendrierSemainesDispoChauffeur.modal {
    padding: 0 !important;
    overflow: hidden;
    width: 100vw;
    max-width: 100vw;
}

#modalCalendrierSemainesDispoChauffeur .modal-dialog.modal-calendrier-chauffeur {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
}

#modalCalendrierSemainesDispoChauffeur .modal-content {
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    max-width: 100%;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: #f4f7fb;
    overflow: hidden;
}

#modalCalendrierSemainesDispoChauffeur .modal-header {
    display: flex;
    justify-content: space-between;
    flex: 0 0 auto;
    background: #3287dc;
    color: #fff;
    border: 0;
    padding: 12px 16px;
    align-items: center;
}

#modalCalendrierSemainesDispoChauffeur .modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
}

#modalCalendrierSemainesDispoChauffeur .modal-header .close {
    color: #fff;
    text-shadow: none;
    opacity: 1;
    font-size: 2rem;
    line-height: 1;
    padding: 0 0 0 12px;
    margin: 0;
}

#modalCalendrierSemainesDispoChauffeur .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

#contenu-calendrier-semaines-dispo-chauffeur {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding: 0;
}

#modalCalendrierSemainesDispoChauffeur [hidden] {
    display: none !important;
}

.cal-chauffeur {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cal-barre,
.cal-legende,
.detail-jour {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
}

.cal-barre {
    position: relative;
    z-index: 5;
}

.cal-ligne {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cal-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    margin-left: auto;
}

.cal-icone {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #3287dc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: inset 0 0 0 1px #d5deea;
    font-size: 0.75rem;
}

.cal-icone.est-actif,
#btn-ouvrir-filtres.est-actif {
    background: #3287dc;
    color: #fff;
    box-shadow: none;
}

.cal-popover {
    position: absolute;
    z-index: 6;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 40, 70, 0.18);
    padding: 10px;
}

.cal-popover-champs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cal-popover-champs .cal-champ {
    flex: 1 1 140px;
}

.cal-aide-periode {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.75rem;
    color: #5b6b7d;
}

.cal-aide-periode.est-erreur {
    color: #c62828;
    font-weight: 600;
}

.cal-presets-ligne {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-presets {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    background: #e7eef6;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.cal-valider {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    font-size: 0.9rem;
    padding: 0;
}

.cal-preset {
    flex: 1 1 0;
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 8px 4px;
    font-weight: 700;
    color: #3287dc;
    font-size: 0.82rem;
    line-height: 1.1;
}

.cal-preset.est-actif {
    background: #3287dc;
    color: #fff;
}

.cal-navigation {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.cal-fleche {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 8px;
    background: #3287dc;
    color: #fff;
    font-size: 0.65rem;
    padding: 0;
}

.cal-fleche:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cal-champ {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #3287dc;
    letter-spacing: 0.02em;
}

.cal-champ select,
.cal-champ input {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d5deea;
    padding: 0 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #1c2834;
    background: #fff;
    min-width: 0;
}

.cal-libelle {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: #1c2834;
    font-size: 0.82rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    list-style: none;
    margin: 12px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    color: #334155;
}

.cal-legende li {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.pastille {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
    display: inline-block;
}

.pastille-dispo {
    width: 14px;
    height: 10px;
    border-radius: 3px;
    background: #15803d;
}

.pastille-aujourdhui {
    background: #F50BCB;
}

.pastille-demande {
    background-color: #3287dc;
    background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.72) 0 3px, transparent 3px 6px);
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-colore,
#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-colore .fc-daygrid-day-frame {
    background-color: var(--jour-fond) !important;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-demande,
#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-demande .fc-daygrid-day-frame {
    background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.62) 0 4px, transparent 4px 8px);
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-refuse .fc-daygrid-day-frame,
#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-samedi .fc-daygrid-day-frame {
    position: relative;
    min-height: 44px;
}

#modalCalendrierSemainesDispoChauffeur .badge-refus-demande,
#modalCalendrierSemainesDispoChauffeur .badge-samedi-demande {
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 2px;
    z-index: 3;
    background: #b91c1c;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    border-radius: 999px;
    padding: 1px 3px;
    pointer-events: none;
}

#modalCalendrierSemainesDispoChauffeur .badge-samedi-demande .fa-check {
    margin-right: 2px;
}

.detail-jour {
    margin: 0;
    min-height: 1.35em;
    font-size: 0.92rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 4px solid #d5deea;
    padding-left: 8px;
}

.cal-zone {
    flex: 1 1 auto;
    min-height: 180px;
    min-width: 0;
    max-width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #3287dc;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 40, 70, 0.08);
}

.cal-chauffeur.recap-ouvert .cal-legende,
.cal-chauffeur.recap-ouvert .detail-jour {
    display: none;
}

.cal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}

#modalCalendrierSemainesDispoChauffeur .fc {
    max-width: 100%;
}

#modalCalendrierSemainesDispoChauffeur .fc .fc-multimonth {
    border: 0;
}

#modalCalendrierSemainesDispoChauffeur .fc-multimonth-month {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 12px;
}

#modalCalendrierSemainesDispoChauffeur .fc-multimonth-header {
    margin-bottom: 0 !important;
}

#modalCalendrierSemainesDispoChauffeur .fc-multimonth-daygrid {
    margin-top: 0 !important;
}

#modalCalendrierSemainesDispoChauffeur .fc-multimonth-title {
    display: block;
    background: #3287dc;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 8px;
    text-align: center;
    text-transform: capitalize;
}

#modalCalendrierSemainesDispoChauffeur .fc-col-header-cell-cushion,
#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day-number {
    text-decoration: none;
}

#modalCalendrierSemainesDispoChauffeur .fc-col-header-cell-cushion {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: capitalize;
    padding: 4px 0;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day {
    cursor: pointer;
}

#modalCalendrierSemainesDispoChauffeur .fc-multimonth .fc-daygrid-day-frame {
    min-height: 28px;
}

#modalCalendrierSemainesDispoChauffeur .fc-dayGridMonth-view .fc-daygrid-day-frame,
#modalCalendrierSemainesDispoChauffeur .est-vue-mois .fc-daygrid-day-frame {
    min-height: 52px;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day-number {
    font-size: 0.78rem;
    padding: 2px 4px;
    color: #1c2834;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-colore .fc-daygrid-day-number {
    color: inherit !important;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-dimanche {
    background: #e5e7eb;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-dimanche .fc-daygrid-day-number {
    color: #64748b !important;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-week-number {
    background: #fff;
    color: #111827 !important;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0 3px;
}

#modalCalendrierSemainesDispoChauffeur tr.semaine-dispo .fc-daygrid-week-number {
    background: #15803d;
    color: #fff !important;
}

#modalCalendrierSemainesDispoChauffeur tr.semaine-dispo > td:first-child {
    box-shadow: inset 3px 0 0 #15803d;
}

#modalCalendrierSemainesDispoChauffeur .fc-day-today {
    background: transparent;
}

#modalCalendrierSemainesDispoChauffeur .fc-day-today .fc-daygrid-day-number {
    background: #F50BCB;
    color: #fff !important;
    border-radius: 999px;
    min-width: 1.45em;
    text-align: center;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.hors-periode {
    opacity: 0.38;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-passe {
    opacity: 0.42;
}

#modalCalendrierSemainesDispoChauffeur .fc-day-other {
    opacity: 0.55;
}

#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-colore.jour-passe,
#modalCalendrierSemainesDispoChauffeur .fc-daygrid-day.jour-colore.fc-day-other {
    opacity: 1;
}

#modalCalendrierSemainesDispoChauffeur .fc td,
#modalCalendrierSemainesDispoChauffeur .fc th {
    border-color: #e2e8f0;
}

.panneau-compteurs {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: auto;
    background: #f4f7fb;
    border-radius: 16px;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.compteurs-entete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.compteurs-surtitre {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c2410c;
}

.compteurs-entete h2 {
    margin: 2px 0 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: #3287dc;
}

.compteurs-periode {
    margin: 4px 0 0;
    color: #475569;
    font-size: 0.95rem;
}

.btn-fermer-compteurs {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #3287dc;
    box-shadow: 0 1px 2px rgba(15, 40, 70, 0.08);
    flex: 0 0 auto;
}

.compteurs-cartes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.compteurs-carte {
    background: #fff;
    border-radius: 12px;
    padding: 6px 8px;
    box-shadow: 0 6px 16px rgba(15, 40, 70, 0.06);
    min-width: 0;
}

.compteurs-carte-absence {
    background: #3287dc;
    color: #fff;
}

.compteurs-carte-absence .compteurs-carte-label,
.compteurs-carte-absence small {
    color: rgba(255, 255, 255, 0.8);
}

.compteurs-carte-label {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.compteurs-carte-cols {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.compteurs-carte-cols strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.compteurs-carte-cols small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.compteurs-table-wrap {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 40, 70, 0.06);
}

.compteurs-table {
    width: 100%;
    border-collapse: collapse;
}

.compteurs-table th {
    text-align: left;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    padding: 6px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.compteurs-table th:nth-child(2),
.compteurs-table th:nth-child(3),
.compteurs-table td:nth-child(2),
.compteurs-table td:nth-child(3) {
    width: 4.8rem;
    text-align: center;
}

.compteurs-table td {
    padding: 4px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1c2834;
    vertical-align: middle;
}

.compteurs-table tbody tr:last-child td {
    border-bottom: 0;
}

.compteurs-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.situation-nom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.compteurs-table .nombre {
    font-size: 1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #3287dc;
}

.compteurs-table td:nth-child(2).nombre {
    color: #475569;
}

.compteurs-table .nombre.est-zero {
    color: #cbd5e1;
    font-weight: 600;
}

.compteurs-carte strong.est-zero {
    opacity: 0.45;
}

.compteurs-vide {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 0.92rem;
}

.compteurs-note {
    margin: 12px 2px 0;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .cal-preset {
        font-size: 0.75rem;
        padding: 8px 2px;
    }

    #modalCalendrierSemainesDispoChauffeur .modal-body {
        padding: 10px;
    }

    #modalCalendrierSemainesDispoChauffeur .fc .fc-scrollgrid,
    #modalCalendrierSemainesDispoChauffeur .fc .fc-scrollgrid table {
        width: 100% !important;
    }

    .cal-scroll {
        padding: 4px;
    }
}

@media (min-width: 992px) {
    #modalCalendrierSemainesDispoChauffeur .fc-multimonth .fc-daygrid-day-frame {
        min-height: 34px;
    }
}
