
/* ==========================================================
   PLANIF - CALENDRIER DE PLANIFICATION
   Styles communs : Laurier / MRS / Cuisimax
   ========================================================== */

/* ---------- VARIABLES COMMUNES ---------- */

:root {
    --background: #f5f6f8;
    --surface: #ffffff;
    --surface-soft: #f5f6f8;
    --text: #253242;
    --text-muted: #697586;
    --border: #dfe3e8;
    --primary: #092439;
    --accent: #9c6d51;
    --on-primary: #ffffff;

    --success: #267d56;
    --warning: #ba771d;
    --danger: #bb4444;

    --employee-width: 175px;
    --day-width: 175px;

    --font-body: Arial, Helvetica, sans-serif;
    --font-heading: Arial, Helvetica, sans-serif;
}

/* ---------- THÈMES D'ENTREPRISE ---------- */

/* CUISINES LAURIER - Charte officielle */

.theme-laurier {
    --primary: #092439;
    --accent: #9c6d51;
    --brand-soft: #f0e9e5;
    --font-heading: "Times New Roman", Georgia, serif;
    --font-body: Arial, Helvetica, sans-serif;
}

/* CUISINES MRS - Charte officielle */

.theme-mrs {
    --primary: #383420;
    --accent: #a2795b;
    --brand-soft: #f1ebe6;
    --font-heading: "Inria Serif", Georgia, serif;
    --font-body: "Be Vietnam Pro", Arial, sans-serif;
}

/* CUISIMAX - Palette provisoire selon la charte visuelle */

.theme-cuisimax {
    --primary: #371719;
    --accent: #9d3133;
    --brand-soft: #f0e7e3;
    --font-heading: "Inria Serif", Georgia, serif;
    --font-body: "Be Vietnam Pro", Arial, sans-serif;
}

/* ---------- CONFIGURATION GÉNÉRALE ---------- */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.45;
}

button,
select,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

button:focus-visible,
select:focus-visible,
.event-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

/* ---------- EN-TÊTE ---------- */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 85px;
    padding: 16px 26px;
    color: var(--on-primary);
    background: var(--primary);
    border-bottom: 4px solid var(--accent);
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 65px;
    min-height: 45px;
}

.brand-logo img {
    display: block;
    max-width: 180px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.brand-info h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 27px;
    font-weight: bold;
    letter-spacing: 0.3px;
}

.brand-info span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.85;
}



/* ---------- CONTENU PRINCIPAL ---------- */

.app-main {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 24px;
}

/* ---------- FILTRES ---------- */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
    padding: 17px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 175px;
}

.filter-group label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: bold;
}

.filter-group select {
    min-height: 38px;
    padding: 8px 11px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.filter-group select:hover {
    border-color: var(--accent);
}

.filter-executant {
    min-width: 210px;
}

/* ---------- NAVIGATION ---------- */

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
}

.calendar-navigation,
.calendar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-toolbar button {
    min-height: 37px;
    padding: 7px 13px;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-weight: 600;
}

.calendar-toolbar button:hover {
    background: var(--brand-soft);
    border-color: var(--accent);
}

#calendar-period {
    margin: 0 0 0 15px;
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: bold;
    color: var(--primary);
}

.view-switch {
    display: flex;
    gap: 0;
}

.view-switch button {
    border-radius: 0;
}

.view-switch button + button {
    border-left: 0;
}

.view-switch button.active {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

/* ---------- CONTENEUR DU CALENDRIER ---------- */

.calendar-section {
    background: var(--surface);
    border: 1px solid var(--border);
}

.calendar-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.calendar-grid {
    width: 100%;
}

/* ---------- VUE SEMAINE ---------- */

/*
   Le JavaScript ajoutera la classe week-grid
   sur calendar-grid.
*/

.week-grid {
    display: grid;
    grid-template-columns:
        var(--employee-width)
        var(--colonne-dimanche, minmax(var(--day-width), 1fr))
        repeat(5, minmax(var(--day-width), 1fr))
        var(--colonne-samedi, minmax(var(--day-width), 1fr));

    min-width: calc(
        var(--employee-width) + var(--jours-equivalents, 7) * var(--day-width)
    );
}

/* Cellules générales */

.week-grid > * {
    min-width: 0;
    padding: 9px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* En-têtes des journées */

.week-header {
    position: relative;
    padding: 13px 8px !important;
    text-align: center;
    background: var(--brand-soft);
    color: var(--primary);
    font-weight: bold;
}

.week-header .day-name {
    display: block;
    text-transform: capitalize;
    font-size: 13px;
}

.week-header .day-number {
    display: block;
    margin-top: 4px;
    font-size: 20px;
    font-weight: bold;
}

.week-header.today,
.day-cell.today {
    background: color-mix(
        in srgb,
        var(--brand-soft) 60%,
        #ffffff
    );
}

.week-header.today {
    box-shadow: inset 0 4px 0 var(--accent);
}

/* Colonne des exécutants */

.employee-header,
.employee-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
    border-right: 2px solid var(--border) !important;
}

.employee-header {
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    font-weight: bold;
}

.employee-cell {
    display: flex;
    align-items: center;
    min-height: 105px;
    padding: 12px !important;
}

.employee-name {
    font-weight: bold;
    color: var(--primary);
    overflow-wrap: anywhere;
}

.employee-type,
.employee-hours {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.employee-hours {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.employee-hours-over {
    color: #88500f;
    font-weight: 700;
}

/* Cases du calendrier */

.day-cell {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 105px;
    background: #ffffff;
}

.day-cell.weekend {
    background: #fafafa;
}

.day-cell.empty {
    background: #fbfbfc;
}

/* ---------- TUILES DES RENDEZ-VOUS ---------- */

.event-card {
    display: block;
    width: 100%;
    padding: 10px 11px;
    color: var(--text);
    background: #edf4fa;
    border: 1px solid #c9d9e8;
    border-left: 5px solid #3575a5;
    border-radius: 3px;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
    transition: filter 0.15s ease;
}

.event-card:hover {
    filter: brightness(0.97);
}

.event-time {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #284d6d;
}

.event-client {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: bold;
}

.event-address,
.event-job,
.event-phone {
    margin-top: 3px;
    font-size: 11px;
}

.event-address {
    color: #526171;
}

.event-job {
    font-weight: 600;
}

.event-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.event-counter {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
    background: #46637d;
    border-radius: 2px;
}

.event-counter.service {
    background: #80652d;
}

button.event-counter { border: 0; cursor: pointer; line-height: 1.5; }
button.event-counter:hover { filter: brightness(.9); }
.event-ouvrir { display: block; width: 100%; border: 0; padding: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; font-weight: bold; }
.event-ouvrir:hover { text-decoration: underline; }
.month-event .event-icons { margin-top: 4px; gap: 4px; }
.month-event .event-counter { font-size: 10px; }
.elements-mli-dialog { width: min(1100px, calc(100vw - 24px)); }
.elements-mli-entete-dialogue { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
#elements-mli-fermer { border: 0; background: transparent; font-size: 28px; line-height: 1; padding: 0 6px; cursor: pointer; }
.elements-mli-defilement { overflow-x: auto; }
#elements-mli-tableau { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 12px; }
#elements-mli-tableau th, #elements-mli-tableau td { padding: 9px; border: 1px solid #cbd5e1; text-align: left; vertical-align: top; }
#elements-mli-tableau th { background: #f0f4f7; white-space: nowrap; }
#elements-mli-tableau tbody tr:nth-child(even) { background: #f8fafb; }
#elements-mli-tableau .elements-mli-texte { min-width: 160px; white-space: pre-wrap; overflow-wrap: anywhere; }
#elements-mli-message { line-height: 1.5; }

.event-note {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-style: italic;
    color: #53606b;
}

/* Rendez-vous terminé */

.event-card.completed {
    opacity: 0.7;
    border-left-color: var(--success);
}

/* ---------- INDISPONIBILITÉS ---------- */


/* ---------- INDISPONIBILITÉS ---------- */

.absence-card {
    display: block;
    width: 100%;
    padding: 10px 11px;
    background-color: #B42332;
    color: #FFFFFF;
    border: 1px solid #8F1825;
    border-left: 5px solid #781320;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}


/* ---------- VUE MOIS ---------- */

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    min-width: 770px;
}

.month-header {
    padding: 12px 6px;
    background: var(--primary);
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.month-day {
    min-width: 0;
    min-height: 125px;
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.month-day.outside-month {
    background: #f6f6f6;
}

.month-day.outside-month:not(.today) > .month-day-number { color: #586575; }

.month-day.today {
    background: var(--brand-soft);
}

.month-day-number {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 7px;
    font-weight: bold;
    color: var(--primary);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.month-day-number:hover {
    background: var(--brand-soft);
    text-decoration: underline;
}

.month-event {
    display: block;
    width: 100%;
    margin-bottom: 4px;
    padding: 5px 7px;
    border: 0;
    border-left: 4px solid var(--accent);
    border-radius: 2px;
    background: #eef1f4;
    color: var(--text);
    font-size: 11px;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
    min-height: 26px;
    font-weight: 600;
}

.month-event:hover {
    filter: brightness(0.96);
}

.month-more {
    margin-top: 6px;
    padding: 4px;
    color: var(--primary);
    background: transparent;
    border: 0;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

/* ---------- LÉGENDE ---------- */

.calendar-legend {
    padding: 13px 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: 0;
}

.legend-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-color {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 1px solid rgba(0,0,0,0.12);
}

/* ---------- BARRE D'ÉTAT ---------- */

.calendar-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 11px;
}

/* ---------- FENÊTRE DE DÉTAILS ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 20, 30, 0.65);
}

.modal-window {
    width: 100%;
    max-width: 610px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 22px;
    background: var(--primary);
    color: #ffffff;
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 21px;
}

#btn-close-modal {
    padding: 0 5px;
    color: #ffffff;
    background: transparent;
    border: 0;
    font-size: 28px;
    cursor: pointer;
}

.modal-content {
    padding: 22px;
    line-height: 1.6;
}

.modal-content h3 {
    margin: 0 0 10px;
    color: var(--primary);
}

.modal-content p {
    margin: 7px 0;
}

.modal-content hr {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

/* ---------- ADAPTATION AUX TÉLÉPHONES ---------- */

@media (max-width: 800px) {

    .app-header {
        padding: 14px 16px;
    }

    .app-main {
        padding: 12px;
    }

    .filters-bar {
        padding: 12px;
        gap: 10px;
    }

    .filter-group {
        flex: 1 1 140px;
        min-width: 0;
    }

    .calendar-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-navigation,
    .calendar-actions {
        width: 100%;
    }

    #calendar-period {
        width: 100%;
        margin: 8px 0 0;
        font-size: 20px;
    }

    .calendar-toolbar button {
        min-height: 42px;
    }

    .week-grid {
        --employee-width: 120px;
        --day-width: 160px;
    }

    .month-grid {
        min-width: 700px;
    }

    .event-card {
        padding: 8px;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-window {
        max-width: none;
        max-height: 90vh;
        width: 100%;
    }
}

@media (max-width: 480px) {

    .brand-info h1 {
        font-size: 22px;
    }

   
.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 65px;
    min-height: 48px;
    padding: 8px 12px;
    background-color: #FFFFFF;
}

.brand-logo img {
    display: block;
    max-width: 180px;
    max-height: 46px;
    width: auto;
    height: auto;
    object-fit: contain;
}


    .demo-label {
        font-size: 9px;
    }

    .calendar-navigation {
        gap: 6px;
    }

    .calendar-toolbar button {
        padding: 8px 10px;
    }

    .modal-header,
    .modal-content {
        padding: 15px;
    }
}


/* ---------- LOGOS DES ENTREPRISES ---------- */

.app-header .brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    min-height: 55px;
    padding: 8px 12px;
    background: #FFFFFF;
    flex-shrink: 0;
}

.app-header .brand-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 180px;
    max-height: 42px;
    object-fit: contain;
}



.indispo-dialog {
    width: min(440px, 92vw);
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 24px;
    color: #092439;
    background: #fff;
}

.indispo-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.indispo-dialog form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.indispo-dialog h3 {
    margin: 0 0 12px;
}

.indispo-dialog label {
    font-weight: bold;
    font-size: 13px;
}

.indispo-dialog input,
.indispo-dialog select,
.indispo-dialog textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 9px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    font: inherit;
}

.indispo-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.indispo-actions button {
    padding: 9px 16px;
    cursor: pointer;
}

#indispo-message {
    color: #ad2532;
    font-size: 13px;
}


button.absence-card {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.menu-indispo {
    position: fixed;
    z-index: 9999;
    width: 170px;
    padding: 5px;
    background: #ffffff;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
}

.menu-indispo[hidden] {
    display: none !important;
}

.menu-indispo button {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #092439;
    cursor: pointer;
}

.menu-indispo button:hover {
    background: #f0e9e5;
}

#menu-indispo-supprimer {
    color: #ad2532;
}


.menu-jour {
    position: fixed;
    z-index: 9999;
    width: 235px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
}

.menu-jour[hidden],
.menu-jour [hidden] {
    display: none !important;
}

.menu-jour-titre {
    padding: 9px 10px;
    font-weight: bold;
    font-size: 13px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 4px;
    color: #092439;
}

.menu-jour button {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #092439;
    cursor: pointer;
}

.menu-jour button:hover {
    background: #f0e9e5;
}


.mli-dialog {
    width: min(620px, 94vw);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid #d5d5d5;
    border-radius: 7px;
    padding: 24px;
    background: white;
    color: #092439;
}

.mli-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.mli-dialog h3 {
    margin-top: 0;
}

#mli-selection {
    margin-bottom: 16px;
    color: #555;
}

#mli-recherche-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

#mli-recherche-form input {
    flex: 1;
    min-width: 150px;
}

#mli-recherche-form input,
#mli-recherche-form select,
#mli-recherche-form button {
    padding: 9px;
    font: inherit;
}

#mli-message {
    color: #ad2532;
    margin: 8px 0;
}

#mli-resultat[hidden] {
    display: none !important;
}

#mli-client {
    font-weight: bold;
    margin: 16px 0;
}

.mli-piece-entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mli-piece-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 7px;
    cursor: pointer;
}

.mli-piece-item input {
    margin-top: 4px;
}

.mli-piece-jobs {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

#mli-compteur {
    margin-top: 12px;
    font-weight: bold;
}

.mli-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.mli-actions button {
    padding: 9px 16px;
    cursor: pointer;
}


/* Fenêtre MLI */
#modal-mli {
    box-sizing: border-box;
    width: min(680px, calc(100vw - 32px));
    max-width: 680px;
    max-height: 85vh;
    padding: 26px;
    overflow-y: auto;
    border: 1px solid #d3dce5;
    border-radius: 10px;
    background: #fff;
    color: #092439;
    font-family: Arial, sans-serif;
    box-shadow: 0 15px 45px rgba(0, 0, 0, .20);
}

#modal-mli::backdrop {
    background: rgba(0, 0, 0, .55);
}

#modal-mli h3 {
    margin: 0 0 12px;
    font-size: 20px;
}

#modal-mli #mli-selection {
    margin-bottom: 22px;
    padding: 11px 14px;
    background: #f0e9e5;
    border-radius: 5px;
    font-size: 13px;
}

/* Recherche */
#modal-mli #mli-recherche-form {
    display: block;
    margin-bottom: 18px;
}

#modal-mli #mli-recherche-form > label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: bold;
}

.mli-recherche-ligne {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
}

#modal-mli #mli-mode,
#modal-mli .mli-recherche-ligne input,
#modal-mli .mli-recherche-ligne > button {
    box-sizing: border-box;
    width: 100%;
    height: 39px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font: inherit;
    font-size: 13px;
}

#modal-mli .mli-recherche-ligne > button {
    width: auto;
    padding: 8px 18px;
    color: white;
    background: #092439;
    cursor: pointer;
}

#modal-mli #mli-mode { margin-bottom: 12px; }

/* Résultats de recherche de dossiers */
.mli-saisie {
    position: relative;
    min-width: 0;
}

.mli-suggestions {
    margin-top: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #f5f7fa;
}

.mli-suggestions[hidden] {
    display: none !important;
}

.mli-suggestion {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.mli-suggestion:hover,
.mli-suggestion:focus {
    background: #f0e9e5;
}

.mli-suggestion strong {
    color: #092439;
    font-size: 13px;
}

.mli-suggestion span {
    color: #64748b;
    font-size: 12px;
}

/* Dossier et pièces */
#modal-mli #mli-client {
    padding: 12px;
    background: #f5f7f9;
    border-left: 4px solid #9c6d51;
    border-radius: 4px;
    margin-bottom: 18px;
}

#modal-mli .mli-piece-entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

#modal-mli .mli-piece-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    margin-bottom: 8px;
    border: 1px solid #dce2e8;
    border-radius: 6px;
    cursor: pointer;
}

#modal-mli .mli-piece-item:hover {
    background: #faf7f5;
}

#modal-mli .mli-piece-item input {
    width: auto;
    margin-top: 3px;
}

#modal-mli .mli-piece-jobs {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
}

#modal-mli #mli-compteur {
    margin-top: 15px;
    font-weight: bold;
}

#modal-mli .mli-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

#modal-mli .mli-actions button {
    padding: 9px 18px;
    cursor: pointer;
}

@media (max-width: 580px) {
    .mli-recherche-ligne {
        grid-template-columns: 1fr;
    }

    #modal-mli .mli-recherche-ligne > button {
        width: 100%;
    }
}


/* PLANIFICATION DU RENDEZ-VOUS MLI */

.mli-planification {
    margin-bottom: 22px;
}


.mli-horaires {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}


.mli-horaires label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #092439;
}

#modal-mli .mli-horaires input {
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font: inherit;
}

.mli-exec-section {
    margin: 0;
    padding: 14px;
    border: 1px solid #dce2e8;
    border-radius: 6px;
}

.mli-exec-section legend {
    padding: 0 7px;
    font-size: 14px;
    font-weight: bold;
    color: #092439;
}

.mli-executants {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.mli-executant-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    background: #f5f7f9;
    border: 1px solid #e0e5ea;
    border-radius: 5px;
    cursor: pointer;
}

.mli-executant-item:has(input:checked) {
    background: #f0e9e5;
    border-color: #9c6d51;
}
#mli-sans-equipe-zone[hidden] { display: none; }
#mli-sans-equipe-zone:not([hidden]) {
    margin-top: 9px;
    background: #fff3df;
    border-color: #e1ae66;
    color: #654018;
}
#mli-sans-equipe-zone:has(input:checked):not([hidden]) {
    background: #ffe5bd;
    border-color: #b56e20;
}

#modal-mli .mli-executant-item input {
    width: auto;
    margin: 0;
}

#mli-executants-compteur {
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
}

.mli-erreur {
    color: #ad2532;
    font-size: 12px;
    margin-bottom: 8px;
}

@media (max-width: 580px) {
    .mli-horaires,
    .mli-executants {
        grid-template-columns: 1fr;
    }
}


.mli-note-section {
    margin-top: 16px;
    margin-bottom: 18px;
}

.mli-note-section label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: bold;
    color: #092439;
}

#modal-mli #mli-note {
    box-sizing: border-box;
    width: 100%;
    min-height: 85px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}


/* DISPONIBILITÉS MLI */

#modal-mli .mli-exec-infos {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#modal-mli .mli-exec-statut {
    font-size: 11px;
    line-height: 1.4;
    font-weight: normal;
}

/* Disponible */
#modal-mli .mli-executant-item.mli-libre {
    background: #e5f5eb;
    border-color: #58ad7b;
}

#modal-mli .mli-libre .mli-exec-statut {
    color: #247846;
}

/* Absent */
#modal-mli .mli-executant-item.mli-absent {
    background: #fde8e8;
    border-color: #d97575;
}

#modal-mli .mli-absent .mli-exec-statut {
    color: #af3030;
}

/* Rendez-vous déjà prévu */
#modal-mli .mli-executant-item.mli-occupe {
    background: #fff0d9;
    border-color: #e1a14b;
}

#modal-mli .mli-occupe .mli-exec-statut {
    color: #995d14;
}


#modal-mli .mli-actions {
    gap: 10px;
}

#modal-mli #mli-enregistrer {
    background: #092439;
    border: 1px solid #092439;
    border-radius: 5px;
    color: white;
    font-weight: bold;
}

#modal-mli #mli-enregistrer:disabled {
    opacity: 0.5;
    cursor: wait;
}


/* Statuts MLI : partagés par les vues Semaine et Mois. */
.mli-tuile-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
    margin-bottom: 6px;
}

.mli-tuile-entete .event-time { margin-bottom: 0; }

.mli-confirmation {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 3px;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
}

.mli-confirmation svg {
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mli-confirme { color: #128348; }
.mli-non-confirme { color: #b42332; }

.mli-termine {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: fit-content;
    margin: 6px 0 0 auto;
    padding: 2px 4px;
    border-radius: 3px;
    background: #fff;
    color: #128348;
    font-size: 11px;
    font-weight: 600;
}

.mli-termine-crochet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #128348;
    color: #fff;
    font-size: 14px;
}

.month-event .mli-tuile-entete { gap: 3px 6px; margin-bottom: 3px; }
.month-event .mli-confirmation,
.month-event .mli-termine { font-size: 10px; }

/* Formulaire de modification d'un seul rendez-vous MLI. */
.edition-mli-dialog {
    box-sizing: border-box;
    width: min(760px, calc(100vw - 32px));
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #092439;
    font: 13px Arial, sans-serif;
}
.edition-mli-dialog::backdrop { background: rgba(12, 20, 30, .65); }
.edition-mli-dialog h3 { margin-top: 0; font-size: 20px; }
#edition-mli-champs { border: 0; margin: 0; padding: 0; min-width: 0; }
.edition-mli-dialog .mli-exec-section { margin: 14px 0; min-width: 0; }
.edition-mli-dialog label { font-weight: 600; }
.edition-mli-dialog input:not([type="checkbox"]),
.edition-mli-dialog textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin-top: 6px;
    padding: 9px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font: inherit;
}
.edition-mli-dialog .mli-piece-jobs { display: block; font-weight: normal; }
.edition-mli-exec-infos { display: flex; flex-direction: column; gap: 4px; }
.edition-mli-exec-infos small { font-weight: normal; }
.edition-libre { background: #e5f5eb; border-color: #58ad7b; }
.edition-absent { background: #fde8e8; border-color: #d97575; }
.edition-occupe { background: #fff0d9; border-color: #e1a14b; }
.edition-mli-aide { font-size: 12px; font-weight: normal; line-height: 1.5; color: #53606b; }
.edition-mli-note { display: block; margin: 16px 0; }
.edition-mli-plan-recu:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    margin: 16px 0;
    padding: 10px 14px;
    border: 1px solid #a9bdcf;
    border-radius: 6px;
    background: #eef4fa;
    color: #163a56;
    font-size: 15px;
    cursor: pointer;
}
.edition-mli-plan-recu:has(input:checked) {
    border-color: #65a786;
    background: #e5f5eb;
    color: #245b3f;
}
.edition-mli-plan-recu:focus-within {
    outline: 2px solid #386e98;
    outline-offset: 2px;
}
.edition-mli-plan-recu input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #287447;
}
.edition-mli-statuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.edition-mli-statuts button { margin-top: 6px; padding: 5px 8px; cursor: pointer; }
#edition-mli-message { color: #b42332; line-height: 1.5; }
.edition-mli-dialog .mli-actions { gap: 10px; flex-wrap: wrap; }
.btn-modifier-mli, #edition-mli-enregistrer {
    padding: 10px 16px;
    border: 1px solid #092439;
    border-radius: 4px;
    background: #092439;
    color: #fff;
    cursor: pointer;
}
#edition-mli-enregistrer:disabled { opacity: .5; cursor: default; }
.edition-mli-visually-hidden {
    position: absolute;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Déplacement des rendez-vous, avec équipe conservée en Semaine et Mois. */
.event-card[draggable="true"], .month-event[draggable="true"] { cursor: grab; }
.event-card.mli-glissement, .month-event.mli-glissement { opacity: .45; cursor: grabbing; }
.day-cell.mli-depot, .month-day.mli-depot, .event-card.mli-depot {
    outline: 3px solid #128348;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 5px rgba(18, 131, 72, .12);
}
.mli-deplacement-en-cours { cursor: progress; }
.deplacement-mli-origine {
    display: grid;
    gap: 3px;
    margin: 12px 0;
    padding: 10px 14px;
    border: 1px solid #b8d3e2;
    border-inline-start: 4px solid #2375aa;
    border-radius: 8px;
    color: var(--primary);
    background: #edf5fa;
}
.deplacement-mli-origine > span:first-child { font-weight: 600; }
#deplacement-mli-ancien-horaire {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}
.deplacement-mli-horaires { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#deplacement-mli-champs { min-width: 0; border: 0; padding: 0; margin: 0; }
#deplacement-mli-equipe small { display: block; margin-top: 4px; font-weight: normal; line-height: 1.4; }
.deplacement-mli-table-conteneur { overflow-x: auto; }
.deplacement-mli-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.deplacement-mli-table th, .deplacement-mli-table td { padding: 8px; border: 1px solid #cbd5e1; text-align: left; vertical-align: top; }
.deplacement-mli-table th { background: #f5f7f9; }
#deplacement-mli-message { color: #b42332; line-height: 1.5; }
#deplacement-mli-statut {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #cbd5e1;
    background: #f0f7f3;
    color: #092439;
    font-size: 12px;
    font-weight: bold;
}
#deplacement-mli-statut:empty { display: none; }
.deplacement-mli-proposition { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; margin: 10px 0; border: 1px solid #cbd5e1; border-radius: 5px; }
.deplacement-mli-proposition strong, .deplacement-mli-proposition > button { grid-column: 1 / -1; }
.deplacement-mli-horaire-conserve { background: #f0f7f3; border-color: #8bb99f; }
.deplacement-mli-horaire-conserve > span { grid-column: 1 / -1; }
.deplacement-mli-horaire-conserve > span:first-of-type { color: #246642; }
.month-event { border: 1px solid rgba(9,36,57,.14); border-left-width: 4px; border-radius: 5px; margin-bottom: 7px; box-shadow: 0 1px 2px rgba(9,36,57,.06); }
.month-event-executant { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 7px -7px -5px; padding: 6px 7px; border-top: 1px solid rgba(9,36,57,.1); border-radius: 0 0 3px 0; background: var(--mli-couleur-executant); font-weight: 600; }
.mli-statuts-tuile { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.mli-plan-recu { display: inline-block; padding: 2px 6px; border-radius: 4px; background: #e5f5eb; color: #245b3f; font-size: 11px; font-weight: 700; }
.week-event-equipe {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(9,36,57,.15);
}
.week-event-executant {
    min-width: 0;
    max-width: 100%;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--mli-couleur-executant);
    color: #092439;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.month-event-executant .mli-termine { margin-top: 0; }
.month-event-executant:not(:last-child) { margin-bottom:0; border-radius:0; }
.month-event-executant + .month-event-executant { margin-top:0; }
.mli-actions-tuile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.mli-actions-tuile .event-icons { display: contents; }
.mli-actions-tuile .event-counter, .mli-actions-tuile .mli-photo-indicateur { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 5px 7px; border: 1px solid #bccddb; border-radius: 4px; background: rgba(255,255,255,.93); color: #294b66; font-size: 11px; font-weight: 600; line-height: 1.3; }
.mli-actions-tuile .event-counter.service { color: #70551f; border-color: #cbbc9a; }
.mli-actions-tuile .mli-photo-indicateur { min-width: 40px; }
.mli-actions-tuile button:hover { background: #fff; filter: brightness(.97); }
@media (pointer: coarse) {
    .mli-actions-tuile .event-counter, .mli-actions-tuile .mli-photo-indicateur { min-height: 44px; min-width: 44px; }
}
.mli-photo-indicateur { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 5px 7px; color: #23557d; background: #fff; border: 1px solid #c9d9e8; border-radius: 4px; font-size: 12px; cursor: pointer; }
.mli-photo-indicateur:hover { background: #edf4fa; }
.modal-content .mli-info-compteur { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 4px; font-size: 14px; text-align: left; }
.mli-info-compteur strong { min-width: 26px; text-align: center; }
.btn-modifier-mli { min-height: 44px; }
.mli-photos-section { margin: 20px 0; padding-top: 12px; border-top: 1px solid #cbd5e1; }
.mli-photos-section h4 { margin: 0 0 8px; font-size: 16px; }
.mli-photos-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mli-photos-actions button, .mli-photo-carte button, #mli-photo-fermer { min-height: 44px; padding: 8px 10px; cursor: pointer; }
.mli-photos-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.mli-photo-carte { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; }
.mli-photo-carte .mli-photo-voir { display: flex; align-items: center; justify-content: center; padding: 0; height: 135px; background: #f5f7f9; border: 0; }
.mli-photo-carte img { max-width: 100%; max-height: 135px; object-fit: contain; image-orientation: from-image; }
.mli-photo-carte figcaption { overflow-wrap: anywhere; font-size: 11px; }
.btn-voir-photos { margin: 8px 0 0 8px; }
.horaire-courriel-dialog { width: min(1000px, calc(100vw - 24px)); }
.horaire-selection { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.horaire-selection label { flex: 1 1 180px; }
.horaire-selection select { display: block; width: 100%; min-height: 42px; margin-top: 6px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; }
.horaire-selection button, .horaire-actions button, .horaire-actions a { min-height: 44px; padding: 10px 12px; cursor: pointer; }
.horaire-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.horaire-actions a { display: inline-flex; align-items: center; border: 1px solid #092439; border-radius: 4px; background: #092439; color: #fff; text-decoration: none; font-weight: 600; }
.horaire-actions a[aria-disabled="true"] { opacity: .45; cursor: default; }
#horaire-apercu { display: block; width: 100%; height: 58vh; min-height: 320px; border: 1px solid #dce5ed; background: #f2f5f8; }
#horaire-message { line-height: 1.5; }
#mli-photos-message, #photos-calendrier-message { line-height: 1.5; color: #53606b; }
#photos-calendrier-message { margin: 0; padding: 8px 12px; font-size: 12px; }
#photos-calendrier-message:empty { display: none; }
.mli-photo-dialog { box-sizing: border-box; width: min(1100px, 96vw); max-height: 94vh; padding: 16px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
.mli-photo-dialog::backdrop { background: rgba(12, 20, 30, .75); }
.mli-photo-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.mli-photo-entete button { min-height: 44px; padding: 8px 10px; }
.mli-photo-entete h3 { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
#mli-photo-image { display: block; max-width: 100%; max-height: 76vh; margin: 0 auto; object-fit: contain; image-orientation: from-image; }
#edition-mli-supprimer {
    margin-right: auto;
    border: 1px solid #b42332;
    border-radius: 4px;
    background: #fff;
    color: #b42332;
}
#modal-deplacement-mli button { cursor: pointer; }
#modal-deplacement-mli button:disabled { opacity: .5; cursor: default; }
#deplacement-mli-enregistrer { background: #092439; border: 1px solid #092439; color: #fff; border-radius: 4px; }
@media (max-width: 580px) {
    .deplacement-mli-horaires { grid-template-columns: 1fr; }
    .edition-mli-statuts { grid-template-columns: 1fr; }
    .edition-mli-dialog { padding: 16px; }
}

.modal-content .mli-info-coordonnee { font-size: 16px; line-height: 1.5; margin: 8px 0; overflow-wrap: anywhere; }
.modal-content .mli-info-coordonnee a { color: #164d75; text-decoration: underline; }

.auth-zone { width:calc(100% - 32px); max-width:420px; margin:40px auto; padding:24px; background:var(--surface); border:1px solid var(--border); border-radius:8px; box-shadow:0 4px 16px #09243908; }
.auth-zone h2 { margin:0 0 24px; color:var(--primary); font-family:var(--font-heading); font-size:24px; line-height:1.25; }
.auth-zone form { display:grid; gap:18px; }
.auth-zone label { display:block; margin:0; color:var(--text); font-weight:600; }
.auth-zone input:not([type="checkbox"]) { display:block; width:100%; min-height:44px; padding:10px 12px; margin-top:6px; border:1px solid var(--border); border-radius:4px; background:var(--surface); color:var(--text); font-size:16px; font-weight:400; }
.auth-zone input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.auth-zone .auth-memoriser { display:flex; align-items:flex-start; gap:10px; font-size:13px; font-weight:400; }
.auth-zone .auth-memoriser[hidden] { display:none; }
.auth-zone .auth-memoriser input { flex:none; width:18px; height:18px; margin:1px 0 0; padding:0; accent-color:var(--primary); }
.auth-zone #auth-valider { width:100%; min-height:44px; background:var(--primary); border-color:var(--primary); color:var(--on-primary); }
.auth-zone #auth-valider:hover:not(:disabled) { background:var(--primary); border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.auth-zone #auth-message { margin:18px 0 0; color:var(--text-muted); font-size:13px; overflow-wrap:anywhere; }
.auth-zone #auth-message:empty { display:none; }
#auth-avertissement { margin:12px 20px; color:#805f20; }

/* Défilement Semaine dans une zone bornée : les jours restent visibles. */
.calendar-container-semaine { max-height: calc(100vh - 24px); max-height: var(--hauteur-semaine, calc(100dvh - 24px)); overflow: auto; }
.week-grid > .week-header { position: sticky; top: 0; z-index: 4; }
.week-grid > .employee-header { top: 0; z-index: 5; }

/* En-tête compact ; conserver les cibles tactiles sur téléphone. */
.app-header { min-height:54px; padding:6px 12px; gap:12px; border-bottom-width:3px; }
.brand { gap:10px; }
.brand-info h1 { font-size:22px; }
.app-header .brand-logo { min-width:150px; min-height:38px; padding:3px 7px; }
.app-header .brand-logo img { max-width:145px; max-height:32px; }
.app-main { padding:8px 10px; }
.filters-bar { padding:6px 10px; margin-bottom:6px; gap:12px; }
.filter-group { gap:2px; }
.filter-group select { min-height:32px; padding:5px 9px; }
.calendar-toolbar { gap:8px; margin-bottom:6px; }
.calendar-toolbar button { min-height:32px; padding:5px 10px; }
#btn-guide-planif,
#guide-planif button {
    border: 1px solid #bfd9df;
    border-radius: 10px;
    background: #e6f2f4;
    color: #163f49;
    font: inherit;
    font-weight: 700;
    min-height: 36px;
    padding: 6px 12px;
    cursor: pointer;
}
#btn-guide-planif { margin-left: 8px; min-width: 36px; }
:is(#alerte-affectation, #alerte-confirmations):not([hidden]) {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 12px;
    padding: 8px 12px;
    border: 1px solid var(--rappel-bordure, #e1c98c);
    border-radius: 10px;
    background: var(--rappel-fond, #fff5dc);
    color: var(--rappel-texte, #49360e);
}
#alerte-confirmations, #confirmations-liste {
    --rappel-bordure: #afcad7;
    --rappel-fond: #e9f3f8;
    --rappel-texte: #173d53;
    --rappel-survol: #dcecf5;
}
:is(#fermer-alerte-affectation, #fermer-alerte-confirmations) {
    margin-left: auto;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    min-width: 32px;
    min-height: 32px;
    cursor: pointer;
}
:is(#alerte-affectation-texte, #alerte-confirmations-texte) {
    flex: 1;
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
:is(#alerte-affectation-texte, #alerte-confirmations-texte):hover { background: var(--rappel-survol, #ffebc2); }
:is(#affectations-liste, #confirmations-liste) { display: grid; gap: 8px; margin-bottom: 14px; }
:is(#affectations-liste, #confirmations-liste) button {
    display: grid;
    gap: 3px;
    text-align: left;
    border: 1px solid var(--rappel-bordure, #e1c98c);
    border-radius: 10px;
    padding: 9px 12px;
    background: var(--rappel-fond, #fff5dc);
    color: var(--rappel-texte, #49360e);
    font: inherit;
    cursor: pointer;
}
:is(#affectations-liste, #confirmations-liste) button:hover { background: var(--rappel-survol, #ffebc2); }
@media (max-width: 800px) {
    :is(#alerte-affectation, #alerte-confirmations):not([hidden]) { display: none; }
}
#btn-guide-planif:focus-visible,
#guide-planif :is(button, summary):focus-visible {
    outline: 2px solid #126b78;
    outline-offset: 2px;
}
#guide-planif { width: min(680px, calc(100% - 24px)); line-height: 1.5; }
.guide-planif-entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.guide-planif-entete h3 { margin: 0; }
#guide-planif details { margin: 10px 0; }
#guide-planif summary {
    padding: 9px 12px;
    border-radius: 10px;
    background: #e6f2f4;
    color: #163f49;
    font-weight: 700;
    cursor: pointer;
}
#guide-planif li { margin-block: 6px; }
#guide-planif table { width:100%; border-collapse:collapse; overflow-wrap:anywhere; }
#guide-planif th, #guide-planif td { padding:6px 8px; border:1px solid var(--border); text-align:left; vertical-align:top; }
#guide-planif thead th { background:var(--brand-soft); }
#brand-logo[role=button] { cursor:pointer; }
#brand-logo[role=button]:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.assistant-guide-paragraphe { margin:10px 0; line-height:1.55; }
.assistant-guide-role {
    margin:8px 0;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#f4f8fa;
    line-height:1.45;
    overflow-wrap:anywhere;
}
.assistant-guide-role > strong { display:block; color:var(--primary); }
.assistant-guide-role dl { display:grid; grid-template-columns:minmax(0,105px) minmax(0,1fr); gap:3px 10px; margin:6px 0 0; }
.assistant-guide-role dt { font-weight:600; }
.assistant-guide-role dd { margin:0; }
@media (min-width: 801px) {
    .calendar-toolbar .calendar-actions button,
    .calendar-toolbar .calendar-actions select {
        border-radius: 9px;
    }
    .calendar-toolbar .calendar-actions .view-switch {
        gap: 3px;
    }
    .calendar-toolbar .calendar-actions .view-switch button + button {
        margin-left: 0;
        border-left: 1px solid var(--border, #d5dfe6);
    }
}
.calendar-action-icon {
    display: inline-block;
    min-width: 1em;
    margin-inline-end: 0.2em;
    font: 1.1em/1 "Segoe UI Symbol", "Segoe UI Emoji", sans-serif;
    text-align: center;
}
#calendar-period { margin-left:8px; font-size:19px; }
#auth-avertissement:empty { display:none; }
@media (max-width:800px) {
    .app-header { padding:6px 10px; }
    .filters-bar { gap:6px 10px; }
    .calendar-navigation, .calendar-actions { gap:5px; }
    #calendar-period { font-size:18px; margin:3px 0 0; }
}
@media (pointer:coarse) {
    .filter-group select, .calendar-toolbar button { min-height:44px; }
}

/* Espacement commun aux actions du visionneur, sur une ou plusieurs lignes. */
.modal-content > .btn-modifier-mli { margin: 8px 8px 0 0; }

/* Congés et fermetures : orange, sans modifier les couleurs des rendez-vous. */
.week-header.jour-conge { background:#ffe1b0; box-shadow:inset 0 4px 0 #dc8b20; }
.day-cell.jour-conge, .month-day.jour-conge { background:#fff3e2; }
.conge-bandeau { display:block; margin:5px 0; padding:4px 6px; border-left:3px solid #dc8b20; background:#ffdfad; color:#75420b; font-size:12px; line-height:1.35; font-weight:bold; white-space:normal; overflow-wrap:anywhere; }

.recherche-calendrier-barre { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:6px 0; }
.recherche-calendrier-barre input { padding:6px 9px; min-width:220px; }
.recherche-calendrier-barre button { padding:6px 12px; }
.recherche-calendrier-resultat { display:block; width:100%; text-align:left; padding:12px; margin:6px 0; border:1px solid #dce5ed; background:#f4f8fb; color:#092439; min-height:44px; }

.filters-bar .recherche-calendrier-barre { display:grid; grid-template-columns:minmax(160px,1fr) auto; flex:1 1 290px; max-width:450px; align-items:end; gap:2px 6px; margin:0; }
.filters-bar .recherche-calendrier-barre label { grid-column:1 / -1; font-size:12px; font-weight:bold; color:var(--text-muted); }
.filters-bar .recherche-calendrier-barre input { min-width:0; width:100%; min-height:32px; border:1px solid var(--border); border-radius:3px; }
.filters-bar .recherche-calendrier-barre button { min-height:32px; }

/* Lisibilité PC ; la présentation mobile et la fiche détaillée restent indépendantes. */
@media screen and (min-width:801px) {
    .week-grid .event-card { margin-top: var(--mli-decalage, 0px); }
    .month-grid .month-event {
        position: relative;
        top: var(--mli-decalage, 0px);
        margin-bottom: calc(7px + var(--mli-decalage, 0px));
    }
}
.densite-pc { display:none; }
@media (min-width:801px) {
    .densite-pc { display:inline-flex; align-items:center; gap:6px; color:var(--text-muted); font-size:12px; }
    .densite-pc select { min-height:33px; padding:5px 8px; border:1px solid var(--border); border-radius:3px; color:var(--primary); background:white; font-size:13px; }
    .week-grid .event-card { padding:11px 12px; line-height:1.45; }
    .week-grid .event-client { font-size:15px; line-height:1.35; margin-bottom:5px; }
    .week-grid .event-time { font-size:13px; color:#183a55; font-variant-numeric:tabular-nums; }
    .week-grid .event-address { font-size:12px; color:#354759; line-height:1.5; }
    .week-grid .event-job { font-size:12px; color:#26394b; line-height:1.5; margin-top:7px; }
    .week-grid .event-note { font-size:12px; line-height:1.5; color:#425366; }
    .planif-pc-compact .week-grid .event-card .event-address,
    .planif-pc-compact .week-grid .event-card .event-note,
    .planif-pc-compact .week-grid .event-card .event-job { display:none; }
    .planif-pc-compact .week-grid .event-card { padding:9px 10px; }
}

.month-event-contact-compact { display:none; }
@media (min-width:801px) {
    .planif-pc-compact .month-grid .month-event .event-address,
    .planif-pc-compact .month-grid .month-event .mli-termine { display:none; }
    .planif-pc-compact .month-grid .month-event-contact-compact { display:block; margin:4px 0; font-size:12px; line-height:1.4; font-weight:normal; }
}

/* Bandeau Semaine PC plus bas, sans modifier le comportement fixe ni les congés. */
@media (min-width:801px) {
    .week-grid > .week-header { padding:6px 8px !important; }
    .week-grid > .employee-header { padding:6px 8px; }
    .week-header .day-name { font-size:13px; line-height:17px; }
    .week-header .day-number { margin-top:1px; font-size:18px; line-height:21px; }
}

.week-aujourdhui { display:none; }
@media (min-width:801px) {
    .month-event-client { font-size:13px; line-height:1.4; }
    .absence-card { background-color:#fce9eb; color:#66212b; border-color:#df9ca5; border-left-color:#b42332; }
    .absence-card:hover { background-color:#f8dce0; }
    .week-header .day-number { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:3px 6px; }
    .week-aujourdhui { display:inline-block; padding:1px 4px; border-radius:3px; background:var(--primary); color:white; font-size:10px; line-height:16px; font-weight:600; }
    .month-grid { grid-template-columns:var(--mois-colonne-dimanche,minmax(0,1fr)) repeat(5,minmax(0,1fr)) var(--mois-colonne-samedi,minmax(0,1fr)); }
}

@media (min-width:801px) {
    .month-event-horaire, .week-grid .mli-tuile-entete-service .event-time { margin-left:auto; white-space:nowrap; font-size:11px; font-variant-numeric:tabular-nums; }
    .week-grid .mli-tuile-entete-service { justify-content:flex-start; gap:3px 4px; }
    .week-grid .mli-tuile-entete-service .mli-service-badge,
    .week-grid .mli-tuile-entete-service .mli-confirmation { padding-inline:4px; gap:3px; }
    .planif-pc-compact .month-grid .month-event .mli-tuile-entete { display:flex; justify-content:flex-end; }
    .absence-entete { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:3px 8px; }
    .absence-horaire { margin-left:auto; white-space:nowrap; font-variant-numeric:tabular-nums; }
    .absence-executant, .absence-note { display:block; margin-top:3px; }
}

.month-aujourdhui { display:none; }
@media (min-width:801px) {
    #calendar-period { text-transform:capitalize; }
    .month-day.today > .month-day-number { background:var(--primary); color:var(--on-primary); border-radius:50%; min-width:28px; min-height:28px; padding:3px; text-align:center; }
    .month-aujourdhui { display:inline-block; margin-left:4px; color:var(--primary); font-size:11px; font-weight:600; }
    .month-event .event-address { font-size:12px; line-height:1.5; }
    .week-grid .employee-type { display:none; }
    .filters-bar .recherche-calendrier-barre button, #auth-deconnexion {
        min-height:32px; padding:5px 10px; border:1px solid var(--border); border-radius:3px;
        color:var(--primary); background:var(--surface); font-family:inherit; font-size:13px; font-weight:600; cursor:pointer;
    }
    #auth-deconnexion { margin-left:10px; }
    .filters-bar .recherche-calendrier-barre button:hover, #auth-deconnexion:hover { background:var(--brand-soft); }
    .filters-bar .recherche-calendrier-barre button:focus-visible, #auth-deconnexion:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
    .week-grid > .day-cell:not(.mli-depot):hover, .month-grid > .month-day:not(.mli-depot):hover { box-shadow:inset 0 0 0 1px var(--accent); }
}

@media (min-width:801px) {
    .absence-card-mois .absence-executant-bandeau { margin:8px -11px -10px; padding:6px 11px; border-top:1px solid rgba(9,36,57,.1); border-radius:0 0 2px 0; background:var(--mli-couleur-executant); color:var(--primary); font-size:11px; font-weight:600; }
}

/* Services externes : repère commun PC/mobile, sans modifier la palette des rendez-vous. */
.mli-service-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 5px; border:1px solid #bfd0da; border-radius:4px; background:#fff; color:#163d54; font-size:11px; font-weight:600; }
.mli-service-details { padding:10px 12px; margin:10px 0; background:#f4f7f9; border-left:3px solid #53788e; border-radius:3px; }
.mli-service-details h4 { margin:0 0 7px; }
.mli-service-details ul { margin:7px 0; padding-left:20px; }
.mli-actions-tuile .mli-rapport-service {
    display: inline-flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 5px 7px;
    border-radius: 4px;
    text-decoration: none;
}
.mli-rapport-service {
    gap: 6px;
    font-size: 11px;
}
.mli-icone-imprimante {
    position: relative;
    box-sizing: border-box;
    flex: none;
    width: 15px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}
.mli-icone-imprimante::before,
.mli-icone-imprimante::after {
    content: "";
    position: absolute;
    inset-inline: 3px;
    height: 5px;
    border: 1px solid currentColor;
    background: var(--surface, #fff);
}
.mli-icone-imprimante::before { top: -5px; }
.mli-icone-imprimante::after { bottom: -4px; }
.mli-rapport-service:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) {
    .mli-actions-tuile .mli-rapport-service { min-width: 44px; min-height: 44px; }
}
#modal-service-mli { width:min(760px,calc(100vw - 24px)); }
#service-mli-champs { min-width:0; border:0; padding:0; margin:0; }
#service-mli-champs > label { display:block; margin:10px 0; }
#service-mli-champs select, #service-mli-note { display:block; width:100%; padding:8px; font:inherit; border:1px solid var(--border); border-radius:3px; }
.service-mli-recherche { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:6px; margin:12px 0; }
.service-mli-recherche label { grid-column:1/-1; }
.service-mli-recherche input { min-width:0; padding:8px; font:inherit; border:1px solid var(--border); }
#service-mli-message { color:#8b2634; line-height:1.5; }
#service-mli-description { white-space:pre-wrap; overflow-wrap:anywhere; }
#modal-service-mli button { min-height:40px; padding:8px 12px; }
#modal-service-mli .mli-actions { display:flex; gap:10px; flex-wrap:wrap; }
@media (max-width:800px) {
    .planif-mobile #modal-service-mli { width:100%; max-width:100%; }
    .planif-mobile #modal-service-mli .mli-horaires { grid-template-columns:1fr; }
}
.service-mli-resultats { display:grid; gap:6px; margin:10px 0; }
.mli-commandes-tuile { font-size:12px; line-height:1.35; overflow-wrap:anywhere; }
.mli-commandes-adresse-compact { display:none; }
.planif-pc-compact .mli-commandes-adresse-compact { display:block; }
.service-mli-resultat { display:block; width:100%; text-align:left; color:var(--primary); background:#f4f7fa; border:1px solid var(--border); border-radius:4px; line-height:1.5; overflow-wrap:anywhere; }
.service-mli-resultat:hover { border-color:var(--accent); background:var(--brand-soft); }

/* Recherche de commandes sans lead. */
#mli-commandes .service-mli-resultat {
    min-height: 38px;
    padding: 8px 12px;
    font: inherit;
    line-height: 1.5;
}

#modal-mli #mli-commandes-selection .mli-piece-item {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: default;
}

#mli-commandes-selection .mli-piece-item > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

#mli-commandes-selection .mli-piece-item > button {
    flex: 0 1 auto;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: var(--primary);
    font: inherit;
    font-weight: 600;
    overflow-wrap: anywhere;
}

#mli-commandes-selection .mli-piece-item > button:hover {
    border-color: var(--accent);
    background: var(--brand-soft);
}

#mli-commandes label[for="mli-job-reference"] {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
}

#mli-job-reference {
    box-sizing: border-box;
    width: 100%;
    min-height: 39px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: var(--primary);
    font: inherit;
}

#mli-commandes-adresse {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
    color: var(--text-muted);
}

#mli-commandes :is(button, select):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    #modal-mli #mli-commandes-selection .mli-piece-item {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (pointer: coarse) {
    #mli-commandes :is(button, select) { min-height: 44px; }
}
#service-mli-executants .service-mli-disponibilite { display:block; margin-top:4px; font-size:12px; font-weight:normal; line-height:1.45; }
#service-mli-executants .mli-executant-item.edition-libre { background:#e5f5eb; border-color:#58ad7b; }
#service-mli-executants .mli-executant-item.edition-occupe { background:#fff0d9; border-color:#e1a14b; }
#service-mli-executants .mli-executant-item.edition-absent { background:#fde8e8; border-color:#d97575; }
.impression-choix { border:1px solid var(--border); margin:14px 0; padding:10px; }
.impression-choix label { display:flex; align-items:flex-start; gap:9px; padding:8px 4px; font-weight:normal; }
.impression-choix input { margin-top:4px; flex-shrink:0; }
#modal-impression-calendrier .mli-actions { display:flex; gap:10px; flex-wrap:wrap; }
#modal-impression-calendrier button { min-height:40px; padding:8px 12px; }

/* Gestion des exécutants : présentation cohérente avec les formulaires MLI. */
#modal-gestion-executants { width: min(820px, calc(100vw - 32px)); padding: 24px 24px 0; }
#gestion-executants-titre { margin: 0 0 20px; font-size: 20px; }
#gestion-executants-message:empty, #gestion-executants-compte:empty { display: none; }
#gestion-executants-message { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 4px; background: #f1f5f9; line-height: 1.5; }
.gestion-executants-selection { display: grid; gap: 14px; margin-bottom: 22px; }
#modal-gestion-executants label { display: block; min-width: 0; }
#modal-gestion-executants input:not([type="checkbox"]),
#modal-gestion-executants select {
    display: block; box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px;
    margin: 6px 0 0; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 4px;
    background: #fff; color: #092439; font: inherit;
}
#modal-gestion-executants input:read-only { background: #f1f5f9; color: #53606b; }
#modal-gestion-executants input:disabled { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
#modal-gestion-executants input:focus-visible,
#modal-gestion-executants select:focus-visible,
#modal-gestion-executants button:focus-visible { outline: 2px solid #386e98; outline-offset: 2px; }
#modal-gestion-executants button {
    min-height: 38px; padding: 9px 16px; border: 1px solid #bac8d5; border-radius: 4px;
    background: #fff; color: #092439; font: inherit; font-weight: 600; cursor: pointer;
}
#modal-gestion-executants button:hover { background: #f1f5f9; }
#modal-gestion-executants button:disabled { opacity: .5; cursor: default; }
#modal-gestion-executants #gestion-executants-enregistrer { background: #092439; border-color: #092439; color: #fff; }
#modal-gestion-executants #gestion-executants-enregistrer:hover { background: #173d59; }
.gestion-executants-section { min-width: 0; margin: 0 0 20px; padding: 16px; border: 1px solid #d3dce5; border-radius: 6px; }
.gestion-executants-section legend { padding: 0 6px; font-size: 15px; font-weight: 700; }
.gestion-executants-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#modal-gestion-executants .gestion-executants-etat { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: normal; }
#modal-gestion-executants input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: #092439; vertical-align: middle; }
.gestion-executants-copier { margin: 14px 0 16px; }
.gestion-executants-tableau { overflow-x: auto; border: 1px solid #d3dce5; border-radius: 5px; }
.gestion-executants-tableau table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.gestion-executants-tableau th, .gestion-executants-tableau td { padding: 8px; text-align: center; border-bottom: 1px solid #e2e8f0; }
.gestion-executants-tableau thead th { background: #edf2f6; color: #294b66; font-size: 12px; line-height: 1.4; }
.gestion-executants-tableau th:first-child { width: 17%; text-align: left; }
.gestion-executants-tableau tbody th { font-weight: 600; }
.gestion-executants-tableau tbody tr:nth-child(even) { background: #f8fafc; }
.gestion-executants-tableau tbody tr:last-child > * { border-bottom: 0; }
#modal-gestion-executants .gestion-executants-tableau input[type="time"] { margin: 0; padding: 6px; min-height: 34px; }
.gestion-executants-note { margin: 14px 0 0; }
#modal-gestion-executants .gestion-executants-actions {
    position: sticky; bottom: 0; z-index: 1; margin: 0 -24px; padding: 14px 24px;
    background: #fff; border-top: 1px solid #d3dce5; box-shadow: 0 -4px 12px rgba(9,36,57,.04);
}
@media (max-width: 580px) {
    #modal-gestion-executants { width: calc(100vw - 20px); padding: 18px 14px 0; }
    .gestion-executants-champs { grid-template-columns: 1fr; gap: 12px; }
    .gestion-executants-section { padding: 12px; }
    .gestion-executants-tableau table { min-width: 480px; }
    #modal-gestion-executants .gestion-executants-actions { margin: 0 -14px; padding: 12px 14px; }
}

/* Commandes de formulaire et guide illustré. */
.planif-button,
.mli-actions > button,
.mli-photos-actions > button,
.edition-mli-statuts button,
.horaire-selection > button,
.horaire-actions > button,
.mli-photo-entete > button,
.deplacement-mli-proposition > button,
#deplacement-mli-sans-decoupage {
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.planif-button:hover,
.mli-actions > button:hover,
.mli-photos-actions > button:hover,
.edition-mli-statuts button:hover,
.horaire-selection > button:hover,
.horaire-actions > button:hover,
.mli-photo-entete > button:hover,
.deplacement-mli-proposition > button:hover,
#deplacement-mli-sans-decoupage:hover {
    background: var(--brand-soft);
    border-color: var(--accent);
}
.planif-button:focus-visible,
.mli-actions > button:focus-visible,
.mli-photos-actions > button:focus-visible,
.edition-mli-statuts button:focus-visible,
.horaire-selection > button:focus-visible,
.horaire-actions > button:focus-visible,
.mli-photo-entete > button:focus-visible,
.deplacement-mli-proposition > button:focus-visible,
#deplacement-mli-sans-decoupage:focus-visible {
    outline: 2px solid #386e98;
    outline-offset: 2px;
}
#gestion-executants-ouvrir { min-height: 32px; padding: 6px 12px; font-size: 13px; }
#modal-proposition-mli #proposition-mli-creer { background: var(--primary); color: #fff; border-color: var(--primary); }
#modal-proposition-mli #proposition-mli-creer:hover { background: #173d59; }
.edition-mli-dialog select {
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #092439;
    font: inherit;
}
#guide-planif { width: min(800px, calc(100vw - 24px)); }
#guide-planif .guide-planif-entete {
    position: sticky;
    top: -24px;
    z-index: 2;
    margin: -24px -24px 16px;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #d3dce5;
}
#guide-planif details > div { padding: 0 4px; }
#guide-planif details[open] { margin-bottom: 20px; }
#guide-planif p { overflow-wrap: anywhere; }
.guide-planif-illustration { margin: 18px 0; }
.guide-planif-illustration a { display: block; border: 1px solid #d3dce5; border-radius: 6px; overflow: hidden; }
.guide-planif-illustration a:focus-visible { outline: 2px solid #386e98; outline-offset: 3px; }
.guide-planif-illustration img { display: block; width: 100%; height: auto; background: #edf2f6; }
.guide-planif-illustration figcaption { margin-top: 6px; color: #53606b; font-size: 12px; line-height: 1.5; }
@media (max-width: 580px) {
    .planif-button, .mli-actions > button, .mli-photos-actions > button { min-height: 40px; }
    #guide-planif { padding: 16px; }
    #guide-planif .guide-planif-entete { top: -16px; margin: -16px -16px 12px; padding: 12px 16px; }
    #guide-planif th, #guide-planif td { padding: 5px; font-size: 12px; }
}

.horaire-selection > button, .horaire-actions > button, .mli-photo-entete > button { min-height: 44px; }
.calendar-footer .planif-button { border-radius: 9px; }

/* Cibles tactiles des commandes communes. */
@media (pointer: coarse) {
    .planif-button, .mli-actions > button, .mli-photos-actions > button,
    .edition-mli-statuts button { min-height: 44px; }
}

/* Sélection d’un exécutant et ajout dans un contexte explicite. */
#modal-gestion-executants [hidden] { display: none !important; }
.gestion-executants-filtres {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}
.gestion-executants-etat-zone { margin: 0 0 18px; }
.gestion-executants-ligne-personne { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.gestion-executants-ligne-personne strong { flex: 1 1 180px; }
#modal-gestion-executants .gestion-executants-ligne-personne label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: normal; }
.gestion-executants-ajout-type { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.gestion-executants-ajout-type label { flex: 1 1 220px; }
#modal-gestion-executants .gestion-executants-etat-zone .gestion-executants-etat { margin: 0; }
@media (max-width: 580px) {
    .gestion-executants-filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gestion-executants-filtres button { grid-column: 1 / -1; }
}

/* Validation du nom au moment de la saisie. */
#gestion-executants-nom-message:empty { display: none; }
.gestion-executants-erreur { color: #b42332; line-height: 1.5; margin: 12px 0 0; }
#gestion-executants-nom[aria-invalid="true"] { border-color: #b42332; }
