/* =====================================================================
 * LOCALISATION DU MATÉRIEL — js/localisation-materiel.js (SIBGRO-081)
 * La puce, son panneau de choix, les machines sous chaque adresse et la
 * liste du client. Jetons --mm-* (classe .mm-jetons, css/modal-machine.css),
 * donc clair / sombre et couleur du thème sans rien de plus.
 * ===================================================================== */
.lm-puce {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px 10px;
    border: 1px solid color-mix(in srgb, var(--mm-accent) 22%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--mm-accent) 8%, transparent);
    color: var(--mm-texte);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.lm-puce > .ti { flex: none; font-size: 14px; color: var(--mm-accent); }
.lm-puce .lm-txt { min-width: 0; overflow-wrap: anywhere; }
.lm-puce small { margin-left: 2px; font-size: 11px; font-weight: 500; color: var(--mm-texte-3); }
.lm-puce:hover,
.lm-puce:focus-visible {
    border-color: color-mix(in srgb, var(--mm-accent) 55%, transparent);
    background: color-mix(in srgb, var(--mm-accent) 14%, transparent);
    outline: none;
}
/* Pas encore renseignée : discrète, en pointillé */
.lm-puce.is-vide {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--mm-texte-3) 45%, transparent);
    background: none;
    color: var(--mm-texte-3);
    font-weight: 500;
}
.lm-puce.is-vide > .ti { color: var(--mm-texte-3); }
.lm-puce.is-vide:hover,
.lm-puce.is-vide:focus-visible { border-color: var(--mm-accent); color: var(--mm-accent); }
.lm-puce.is-fige { cursor: default; }
.lm-puce.is-fige:hover { border-color: color-mix(in srgb, var(--mm-accent) 22%, transparent); background: color-mix(in srgb, var(--mm-accent) 8%, transparent); }

/* ── Le panneau ── */
.lm-panneau {
    position: fixed;
    z-index: 10080;
    width: 270px;
    max-width: calc(100vw - 16px);
    padding: 8px;
    border: 1px solid var(--mm-trait);
    border-radius: 12px;
    background: var(--mm-fond);
    box-shadow: 0 12px 32px rgba(19, 26, 46, .22);
    color: var(--mm-texte);
    text-align: left;
}
.lm-saisie {
    width: 100%;
    height: 34px;
    padding: 4px 10px;
    border: 1px solid var(--mm-trait);
    border-radius: 8px;
    background: transparent;
    color: var(--mm-texte);
    font-size: 13px;
    box-sizing: border-box;
}
.lm-saisie:focus { border-color: var(--mm-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mm-accent) 16%, transparent); }
.lm-choix { max-height: 240px; margin-top: 6px; overflow-y: auto; }
.lm-item {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--mm-texte);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.lm-item > span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.lm-item > .ti { flex: none; color: var(--mm-accent); }
.lm-item:hover,
.lm-item.is-actif { background: color-mix(in srgb, var(--mm-accent) 11%, transparent); }
.lm-item.is-choisi { font-weight: 600; }
.lm-item.lm-neuf { color: var(--mm-accent); font-weight: 600; }
.lm-item.lm-retirer { margin-top: 4px; border-top: 1px solid var(--mm-trait); border-radius: 0 0 7px 7px; color: var(--mm-texte-3); font-size: 12.5px; }
.lm-item.lm-retirer > .ti { color: inherit; }
.lm-titre { margin: 4px 10px 2px; font-size: 11px; font-weight: 600; color: var(--mm-texte-3); }
.lm-note { margin: 6px 10px; font-size: 12.5px; color: var(--mm-texte-3); }

/* ── Section « Adresses d'installation » : les machines sous leur adresse ── */
#tbl-projaddr > tbody > tr.lm-rang > td { padding-top: 0; border-top: 0; }
#tbl-projaddr > tbody > tr.lm-rang:hover > td { background: none; }
#tbl-projaddr .lm-titre { margin: 4px 0 2px; }
/* Fiche étroite : la ligne passe en grille (fiche-verre.css), sans trait entre l'adresse et ses machines */
.page-contact #tbl-projaddr > tbody > tr.lm-rang { border-top: 0; padding-top: 0; }
.lm-machines { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lm-machines > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.lm-machines .lm-machine { flex: 1 1 220px; min-width: 0; font-size: 12.5px; overflow-wrap: anywhere; }
.lm-machines .lm-machine > .ti { opacity: .45; }
.lm-machines .lm-machine small { opacity: .7; }
.lm-machines .lm-nom { padding: 0; border: 0; background: none; color: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.lm-machines .lm-nom:hover,
.lm-machines .lm-nom:focus-visible { text-decoration: underline; outline: none; }

.lm-liste { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.lm-liste-titre { margin-right: 2px; font-size: 12px; color: var(--mm-texte-3); }
.lm-liste .lm-saisie-liste { width: 170px; height: 28px; border-radius: 999px; }

/* ── Ailleurs ── */
#modal-recap-client .rcl-emplacement .lm-puce { margin-top: 4px; }
.lm-champ { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; }
@media (pointer: coarse) { .lm-puce { padding: 6px 12px; } .lm-item { padding: 10px; } .lm-saisie { font-size: 16px; } }
