/* ==========================================================
   ALLIANCE CRM — MODALE D’APERÇU CLIENT
   ========================================================== */


/* ----------------------------------------------------------
   FOND DE LA MODALE
   ---------------------------------------------------------- */

.frm-modal-sc.modal {
    padding: 24px !important;
    background: rgba(16, 24, 40, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}


/* ----------------------------------------------------------
   DIMENSIONS DE LA FENÊTRE
   ---------------------------------------------------------- */

.frm-modal-sc .modal-dialog {
    width: calc(100% - 32px);
    max-width: 820px;
    margin: 24px auto;
}


/* ----------------------------------------------------------
   CONTENEUR PRINCIPAL
   ---------------------------------------------------------- */

.frm-modal-sc .modal-content {
    overflow: hidden;

    color: #1a2233;
    background: #ffffff;

    border: 1px solid #e2e6ec;
    border-radius: 12px;

    box-shadow:
        0 24px 70px rgba(16, 24, 40, 0.18),
        0 4px 12px rgba(16, 24, 40, 0.08);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* ----------------------------------------------------------
   EN-TÊTE BOOTSTRAP DE LA MODALE
   ---------------------------------------------------------- */

.frm-modal-sc .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 58px;
    padding: 14px 20px;

    background: #ffffff;
    border: 0;
    border-bottom: 1px solid #e2e6ec;
}


.frm-modal-sc .modal-title {
    margin: 0;

    color: #101828;

    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}


/* Bouton de fermeture. */
.frm-modal-sc .modal-header .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;

    color: #667085;
    background: transparent;

    border: 1px solid transparent;
    border-radius: 7px;

    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    text-decoration: none;

    cursor: pointer;

    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}


.frm-modal-sc .modal-header .close:hover,
.frm-modal-sc .modal-header .close:focus-visible {
    color: #1d2939;
    background: #f2f4f7;
    border-color: #e4e7ec;
}


/* ----------------------------------------------------------
   CORPS SCROLLABLE
   ---------------------------------------------------------- */

.frm-modal-sc .modal-body {
    max-height: calc(100vh - 130px);
    padding: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    background: #f7f8fa;
}


/* Scrollbar discrète. */
.frm-modal-sc .modal-body::-webkit-scrollbar {
    width: 7px;
}

.frm-modal-sc .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.frm-modal-sc .modal-body::-webkit-scrollbar-thumb {
    background: #cfd5de;
    border: 2px solid #f7f8fa;
    border-radius: 999px;
}


/* ----------------------------------------------------------
   FICHE CLIENT INTERNE
   ---------------------------------------------------------- */

.frm-modal-sc .crm-client-sheet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;

    width: 100%;
    padding: 18px;
}


/* ----------------------------------------------------------
   EN-TÊTE MÉTIER DE LA FICHE
   ---------------------------------------------------------- */

.frm-modal-sc .crm-client-header {
    grid-column: 1 / -1;

    padding: 18px;

    background: #ffffff;
    border: 1px solid #e2e6ec;
    border-radius: 10px;

    box-shadow: 0 1px 3px rgba(20, 30, 50, 0.04);
}


.frm-modal-sc .crm-client-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}


.frm-modal-sc .crm-client-identity {
    position: relative;

    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-areas:
        "avatar code"
        "avatar title"
        "avatar meta";
    align-items: center;
    column-gap: 13px;
}


/*
 * Avatar avec les initiales DS.
 * Le contenu est volontairement dérivé de l’exemple actuel.
 */
.frm-modal-sc .crm-client-identity::before {
    content: "DS";

    grid-area: avatar;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    color: #3d7fff;
    background: #edf3ff;

    border-radius: 50%;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}


/* Code client. */
.frm-modal-sc .crm-client-code {
    grid-area: code;

    margin-bottom: 1px;

    color: #98a2b3;

    font-size: 9px;
    font-weight: 600;
    line-height: 1.2;

    letter-spacing: 0.8px;
    text-transform: uppercase;
}


/* Raison sociale. */
.frm-modal-sc .crm-client-title {
    grid-area: title;

    margin: 0;

    color: #101828;

    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}


/* Statut et type. */
.frm-modal-sc .crm-client-header-meta {
    grid-area: meta;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;

    margin-top: 6px;
}


/* Badge statut. */
.frm-modal-sc .crm-client-status,
.frm-modal-sc .crm-client-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 24px;
    padding: 4px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}


.frm-modal-sc .crm-client-status {
    color: var(--crm-badge-text, #185fa5);
    background: var(--crm-badge-bg, #e6f1fb);
}


.frm-modal-sc .crm-client-status::before {
    content: "";

    width: 6px;
    height: 6px;

    background: var(--crm-badge-dot, #378add);
    border-radius: 50%;
}


.frm-modal-sc .crm-client-type {
    color: #475467;
    background: #f2f4f7;
    border: 1px solid #e4e7ec;
}


/* ----------------------------------------------------------
   CARDS INTERNES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-card {
    min-width: 0;

    overflow: hidden;

    background: #ffffff;
    border: 1px solid #e2e6ec;
    border-radius: 10px;

    box-shadow: 0 1px 3px rgba(20, 30, 50, 0.035);
}


/*
 * Certaines sections méritent toute la largeur.
 */
.frm-modal-sc .crm-client-finances,
.frm-modal-sc .crm-client-payments,
.frm-modal-sc .crm-client-sav,
.frm-modal-sc .crm-client-contacts,
.frm-modal-sc .crm-client-addresses,
.frm-modal-sc .crm-client-documents,
.frm-modal-sc .crm-client-notes {
    grid-column: 1 / -1;
}


/* En-tête de chaque card. */
.frm-modal-sc .crm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 43px;
    padding: 11px 14px;

    background: #ffffff;
    border-bottom: 1px solid #e2e6ec;
}


.frm-modal-sc .crm-card-title {
    margin: 0;

    color: #667085;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;

    letter-spacing: 0.75px;
    text-transform: uppercase;
}


.frm-modal-sc .crm-card-body {
    padding: 14px;
}


/* ----------------------------------------------------------
   GRILLES DE DONNÉES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 24px;

    margin: 0;
}


.frm-modal-sc .crm-data-item {
    min-width: 0;
}


.frm-modal-sc .crm-data-item dt {
    margin: 0 0 3px;

    color: #98a2b3;

    font-size: 9px;
    font-weight: 500;
    line-height: 1.25;
}


.frm-modal-sc .crm-data-item dd {
    margin: 0;

    overflow-wrap: anywhere;

    color: #1d2939;

    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}


.frm-modal-sc .crm-empty-value {
    color: #98a2b3;
    font-weight: 400;
    font-style: italic;
}


/* ----------------------------------------------------------
   INFORMATIONS FINANCIÈRES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-client-finances {
    border-color: #eadfbf;
}


.frm-modal-sc .crm-client-finances .crm-card-header {
    background: #fffcf5;
    border-bottom-color: #eadfbf;
}


.frm-modal-sc .crm-client-finances .crm-card-title {
    color: #9a6a11;
}


.frm-modal-sc .crm-client-finances .crm-card-body {
    background: #fffcf8;
}


.frm-modal-sc .crm-data-grid-financial {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}


.frm-modal-sc .crm-data-grid-financial .crm-data-item {
    padding: 11px;

    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #eee5cf;
    border-radius: 7px;
}


.frm-modal-sc .crm-data-grid-financial .crm-data-item dd {
    font-family:
        "JetBrains Mono",
        Consolas,
        monospace;

    font-size: 13px;
    font-weight: 600;
}


/* Marge du dossier mise en avant. */
.frm-modal-sc .crm-data-item-highlight {
    background: #effaf3 !important;
    border-color: #bce4ca !important;
}


.frm-modal-sc .crm-data-item-highlight dt {
    color: #43815a;
}


.frm-modal-sc .crm-data-item-highlight dd {
    color: #176b3a;
    font-size: 14px;
    font-weight: 700;
}


/* ----------------------------------------------------------
   PAIEMENTS
   ---------------------------------------------------------- */

.frm-modal-sc .crm-card-status {
    display: flex;
    align-items: center;
}


.frm-modal-sc .crm-payment {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 24px;
    padding: 4px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}


.frm-modal-sc .crm-payment-pending {
    color: #8a5a08;
    background: #fff6dc;
    border: 1px solid #f1d98e;
}


.frm-modal-sc .crm-payment img.emoji,
.frm-modal-sc .crm-check-value img.emoji {
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
}


.frm-modal-sc .crm-check-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;

    margin: 0;
    padding: 0;

    list-style: none;
}


.frm-modal-sc .crm-check-item,
.frm-modal-sc .crm-payment-maintenance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 42px;
    padding: 10px 12px;

    background: #f8fafc;
    border: 1px solid #e7ebf0;
    border-radius: 7px;
}


.frm-modal-sc .crm-payment-maintenance {
    margin-top: 8px;
}


.frm-modal-sc .crm-check-label {
    color: #667085;
    font-size: 10px;
    font-weight: 500;
}


.frm-modal-sc .crm-check-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: #344054;

    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}


/* ==========================================================
   SAV & TICKETS — APERÇU CLIENT
   ========================================================== */


/* ----------------------------------------------------------
   SECTION PRINCIPALE
   ---------------------------------------------------------- */

/*
 * La section SAV occupe toute la largeur de la grille.
 */
.frm-modal-sc .crm-client-sav {
    grid-column: 1 / -1;
}


/*
 * Le groupe titre + sous-titre de l'en-tête.
 */
.frm-modal-sc .crm-client-sav .crm-card-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;

    min-width: 0;
}


.frm-modal-sc .crm-client-sav .crm-card-subtitle {
    color: #98a2b3;

    font-size: 9px;
    font-weight: 500;
    line-height: 1.3;
}


/*
 * Légère différenciation de la section SAV.
 */
.frm-modal-sc .crm-client-sav {
    border-color: #dce3ec;
}


.frm-modal-sc .crm-client-sav .crm-card-header {
    background: #fbfcfe;
}


/* ----------------------------------------------------------
   CONTENEUR DES TICKETS
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-preview {
    display: grid;
    gap: 9px;

    min-width: 0;
}


/*
 * Si Formidable ajoute un conteneur intermédiaire,
 * celui-ci ne doit pas casser la grille.
 */
.frm-modal-sc .crm-sav-preview > div {
    min-width: 0;
}


/* ----------------------------------------------------------
   CARTE D'UN TICKET
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-ticket {
    min-width: 0;

    overflow: hidden;

    background: #f8fafc;
    border: 1px solid #e2e7ee;
    border-left: 3px solid #98a2b3;
    border-radius: 8px;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.frm-modal-sc .crm-sav-ticket:hover {
    background: #f5f8fc;
    border-color: #cfd7e2;

    box-shadow:
        0 2px 6px rgba(16, 24, 40, 0.045);
}


.frm-modal-sc .crm-sav-ticket-main {
    padding: 12px 13px;
}


/* ----------------------------------------------------------
   EN-TÊTE DU TICKET
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    min-width: 0;
}


.frm-modal-sc .crm-sav-ticket-identity {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    min-width: 0;
}


.frm-modal-sc .crm-sav-ticket-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    color: #475467;
    background: #ffffff;

    border: 1px solid #dfe4eb;
    border-radius: 7px;

    font-size: 13px;
    line-height: 1;
}


.frm-modal-sc .crm-sav-ticket-heading {
    min-width: 0;
}


.frm-modal-sc .crm-sav-ticket-title {
    margin: 0 0 2px;

    color: #1d2939;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}


.frm-modal-sc .crm-sav-ticket-code {
    display: inline-block;

    overflow: hidden;

    max-width: 100%;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.frm-modal-sc .crm-sav-ticket-date {
    display: block;

    color: #98a2b3;

    font-size: 9px;
    font-weight: 500;
    line-height: 1.3;
}


/* ----------------------------------------------------------
   PRIORITÉ
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-ticket-priority {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    flex: 0 0 auto;

    min-height: 22px;
    padding: 3px 8px;

    color: #667085;
    background: #ffffff;

    border: 1px solid #e2e6ec;
    border-radius: 999px;

    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}


.frm-modal-sc .crm-sav-priority-indicator {
    display: inline-block;

    flex: 0 0 auto;

    width: 7px;
    height: 7px;

    background: var(--crm-badge-dot, #98a2b3);
    border-radius: 50%;
}


/*
 * Les classes issues de ref_code pourront modifier
 * uniquement la couleur de la pastille.
 */
.frm-modal-sc .crm-sav-priority-indicator.crm-ref-sav_priorite_basse {
    --crm-badge-dot: #98a2b3;
}

.frm-modal-sc .crm-sav-priority-indicator.crm-ref-sav_priorite_normale {
    --crm-badge-dot: #0e8fc2;
}

.frm-modal-sc .crm-sav-priority-indicator.crm-ref-sav_priorite_haute {
    --crm-badge-dot: #f59e0b;
}

.frm-modal-sc .crm-sav-priority-indicator.crm-ref-sav_priorite_urgente {
    --crm-badge-dot: #e5485d;
}


/* ----------------------------------------------------------
   OBJET DU TICKET
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-ticket-object {
    display: grid;
    gap: 3px;

    margin-top: 11px;
    padding: 10px 11px;

    background: #ffffff;

    border: 1px solid #e4e8ee;
    border-radius: 7px;
}


.frm-modal-sc .crm-sav-ticket-object-label,
.frm-modal-sc .crm-sav-ticket-description-label,
.frm-modal-sc .crm-sav-ticket-meta-label {
    color: #98a2b3;

    font-size: 8px;
    font-weight: 600;
    line-height: 1.3;

    letter-spacing: 0.45px;
    text-transform: uppercase;
}


.frm-modal-sc .crm-sav-ticket-object-value {
    overflow-wrap: anywhere;

    color: #1d2939;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}


/* ----------------------------------------------------------
   MÉTADONNÉES DU TICKET
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-ticket-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 9px;
}


/*
 * Le CSS générique de .crm-badge existe déjà.
 * Dans la modale, on garde une taille compacte.
 */
.frm-modal-sc .crm-sav-ticket-meta .crm-badge {
    min-height: 21px;
    padding: 3px 8px;

    font-size: 8px;
    letter-spacing: 0.25px;
}


.frm-modal-sc .crm-sav-ticket-assignee {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-width: 0;
    margin-left: auto;

    color: #667085;

    font-size: 9px;
    line-height: 1.35;
}


.frm-modal-sc .crm-sav-ticket-assignee-name {
    overflow: hidden;

    max-width: 170px;

    color: #344054;

    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ----------------------------------------------------------
   DESCRIPTION / SUIVI
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-ticket-description {
    margin-top: 9px;
    padding: 10px 11px;

    background: #ffffff;

    border: 1px solid #e4e8ee;
    border-left: 2px solid #cfd6e1;
    border-radius: 7px;
}


.frm-modal-sc .crm-sav-ticket-description-content {
    margin-top: 4px;

    color: #667085;

    font-size: 10px;
    line-height: 1.55;
}


.frm-modal-sc .crm-sav-ticket-description-content p {
    margin: 0;
}


.frm-modal-sc .crm-sav-ticket-description-content p + p {
    margin-top: 6px;
}


/* ----------------------------------------------------------
   ÉTAT VIDE
   ---------------------------------------------------------- */

.frm-modal-sc .crm-sav-empty {
    display: flex;
    align-items: center;
    gap: 11px;

    min-height: 62px;
    padding: 12px 13px;

    color: #475467;
    background: #f8fafc;

    border: 1px dashed #d4dae3;
    border-radius: 8px;
}


.frm-modal-sc .crm-sav-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    color: #27814e;
    background: #eaf8ef;

    border: 1px solid #bce4ca;
    border-radius: 50%;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}


.frm-modal-sc .crm-sav-empty-content {
    display: grid;
    gap: 2px;

    min-width: 0;
}


.frm-modal-sc .crm-sav-empty-title {
    color: #344054;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}


.frm-modal-sc .crm-sav-empty-text {
    color: #7b8799;

    font-size: 9px;
    line-height: 1.45;
}


/* ----------------------------------------------------------
   COULEURS DES BADGES SAV
   ---------------------------------------------------------- */

/*
 * Catégories.
 */
.frm-modal-sc .crm-ref-sav_categorie_technique {
    --crm-badge-background: #fff0f2;
    --crm-badge-text: #b4233d;
    --crm-badge-border: #f3bac5;
    --crm-badge-dot: #e5485d;
}

.frm-modal-sc .crm-ref-sav_categorie_administratif {
    --crm-badge-background: #eaf6fc;
    --crm-badge-text: #14658c;
    --crm-badge-border: #b9deef;
    --crm-badge-dot: #0e8fc2;
}

.frm-modal-sc .crm-ref-sav_categorie_repondeur {
    --crm-badge-background: #f4edff;
    --crm-badge-text: #7444b8;
    --crm-badge-border: #dcc7f7;
    --crm-badge-dot: #9b5de5;
}

.frm-modal-sc .crm-ref-sav_categorie_autre {
    --crm-badge-background: #f2f4f7;
    --crm-badge-text: #475467;
    --crm-badge-border: #dfe3e8;
    --crm-badge-dot: #98a2b3;
}


/*
 * Statuts.
 */
.frm-modal-sc .crm-ref-sav_statut_ouvert {
    --crm-badge-background: #eaf6fc;
    --crm-badge-text: #14658c;
    --crm-badge-border: #b9deef;
    --crm-badge-dot: #0e8fc2;
}

.frm-modal-sc .crm-ref-sav_statut_en_cours {
    --crm-badge-background: #fff4e5;
    --crm-badge-text: #854f0b;
    --crm-badge-border: #f2d29b;
    --crm-badge-dot: #f59e0b;
}

.frm-modal-sc .crm-ref-sav_statut_attente_client {
    --crm-badge-background: #f4edff;
    --crm-badge-text: #7444b8;
    --crm-badge-border: #dcc7f7;
    --crm-badge-dot: #9b5de5;
}

.frm-modal-sc .crm-ref-sav_statut_resolu {
    --crm-badge-background: #eaf8ef;
    --crm-badge-text: #176b3a;
    --crm-badge-border: #bce4ca;
    --crm-badge-dot: #16a34a;
}

.frm-modal-sc .crm-ref-sav_statut_ferme {
    --crm-badge-background: #eef0f3;
    --crm-badge-text: #344054;
    --crm-badge-border: #d0d5dd;
    --crm-badge-dot: #667085;
}


/* ----------------------------------------------------------
   RESPONSIVE SAV — TABLETTE
   ---------------------------------------------------------- */

@media (max-width: 850px) {

    .frm-modal-sc .crm-client-sav {
        grid-column: 1;
    }

    .frm-modal-sc .crm-sav-ticket-assignee {
        margin-left: 0;
    }
}


/* ----------------------------------------------------------
   RESPONSIVE SAV — MOBILE
   ---------------------------------------------------------- */

@media (max-width: 560px) {

    .frm-modal-sc .crm-sav-ticket-main {
        padding: 11px;
    }

    .frm-modal-sc .crm-sav-ticket-header {
        flex-direction: column;
        gap: 9px;
    }

    .frm-modal-sc .crm-sav-ticket-priority {
        align-self: flex-start;
    }

    .frm-modal-sc .crm-sav-ticket-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .frm-modal-sc .crm-sav-ticket-assignee {
        width: 100%;
        margin-left: 0;
    }

    .frm-modal-sc .crm-sav-ticket-assignee-name {
        max-width: none;
    }

    .frm-modal-sc .crm-sav-empty {
        align-items: flex-start;
    }
}


/* ----------------------------------------------------------
   LISTES : CONTACTS, ADRESSES ET DOCUMENTS
   ---------------------------------------------------------- */

.frm-modal-sc .crm-related-list {
    display: grid;
    gap: 8px;
}


.frm-modal-sc .crm-contacts-list,
.frm-modal-sc .crm-addresses-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


.frm-modal-sc .crm-related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    min-width: 0;
    padding: 11px 12px;

    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 7px;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}


.frm-modal-sc .crm-related-item:hover {
    background: #f5f8fc;
    border-color: #cfd6e1;
}


.frm-modal-sc .crm-related-item-main {
    min-width: 0;
    flex: 1 1 auto;
}


.frm-modal-sc .crm-related-item-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;

    margin: 0 0 5px;

    color: #1d2939;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
}


.frm-modal-sc .crm-related-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;

    color: #667085;

    font-size: 10px;
    line-height: 1.45;
}


.frm-modal-sc .crm-related-item-meta span {
    position: relative;
}


.frm-modal-sc .crm-related-item-meta span:not(:last-child)::after {
    content: "•";

    position: absolute;
    right: -8px;

    color: #c0c6d0;
}


.frm-modal-sc .crm-related-item a {
    color: #3b6db3;
    text-decoration: none;
}


.frm-modal-sc .crm-related-item a:hover {
    color: #2454a1;
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* Badge Principal. */
.frm-modal-sc .crm-badge {
    display: inline-flex;
    align-items: center;

    min-height: 19px;
    padding: 3px 7px;

    border-radius: 999px;

    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.35px;
}


.frm-modal-sc .crm-badge-primary {
    color: #285ea8;
    background: #e7f0ff;
    border: 1px solid #cbdcff;
}


/* ----------------------------------------------------------
   ADRESSES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-address-content {
    margin: 0;

    color: #667085;

    font-size: 10px;
    font-style: normal;
    line-height: 1.55;
}


/* ----------------------------------------------------------
   DOCUMENTS
   ---------------------------------------------------------- */

.frm-modal-sc .crm-document-item {
    align-items: center;
}


.frm-modal-sc .crm-document-type {
    display: inline-flex;
    align-items: center;

    padding: 3px 7px;

    color: #475467;
    background: #eef1f5;

    border-radius: 999px;

    font-size: 9px;
    font-weight: 600;
}


.frm-modal-sc .crm-related-item-actions {
    flex: 0 1 42%;

    overflow: hidden;

    color: #667085;

    font-size: 9px;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/*
 * Le contenu actuel est une URL brute.
 * Cette règle empêche seulement qu’elle élargisse la modale.
 */
.frm-modal-sc .crm-related-item-actions {
    max-width: 320px;
}


/* ----------------------------------------------------------
   NOTES INTERNES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-notes-content {
    padding: 13px 14px;

    color: #475467;
    background: #f8fafc;

    border: 1px solid #e4e7ec;
    border-left: 3px solid #98a2b3;
    border-radius: 7px;

    font-size: 11px;
    line-height: 1.6;
}


.frm-modal-sc .crm-notes-content p {
    margin: 0;
}


/* ----------------------------------------------------------
   RESPONSIVE — TABLETTE
   ---------------------------------------------------------- */

@media (max-width: 850px) {

    .frm-modal-sc.modal {
        padding: 12px !important;
    }

    .frm-modal-sc .modal-dialog {
        width: 100%;
        max-width: none;
        margin: 12px auto;
    }

    .frm-modal-sc .crm-client-sheet {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
    }

    .frm-modal-sc .crm-client-general,
.frm-modal-sc .crm-client-commercial,
.frm-modal-sc .crm-client-finances,
.frm-modal-sc .crm-client-payments,
.frm-modal-sc .crm-client-installation,
.frm-modal-sc .crm-client-sav,
.frm-modal-sc .crm-client-contacts,
.frm-modal-sc .crm-client-addresses,
.frm-modal-sc .crm-client-documents,
.frm-modal-sc .crm-client-notes {
        grid-column: 1;
    }

    .frm-modal-sc .crm-data-grid-financial {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .frm-modal-sc .crm-contacts-list,
    .frm-modal-sc .crm-addresses-list {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* ----------------------------------------------------------
   RESPONSIVE — MOBILE
   ---------------------------------------------------------- */

@media (max-width: 560px) {

    .frm-modal-sc.modal {
        padding: 0 !important;
    }

    .frm-modal-sc .modal-dialog {
        width: 100%;
        min-height: 100%;
        margin: 0;
    }

    .frm-modal-sc .modal-content {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .frm-modal-sc .modal-header {
        position: sticky;
        top: 0;
        z-index: 10;

        min-height: 54px;
        padding: 11px 14px;
    }

    .frm-modal-sc .modal-body {
        max-height: calc(100vh - 54px);
    }

    .frm-modal-sc .crm-client-sheet {
        gap: 10px;
        padding: 10px;
    }

    .frm-modal-sc .crm-client-header {
        padding: 14px;
    }

    .frm-modal-sc .crm-client-identity {
        grid-template-columns: 40px minmax(0, 1fr);
        column-gap: 10px;
    }

    .frm-modal-sc .crm-client-identity::before {
        width: 40px;
        height: 40px;
    }

    .frm-modal-sc .crm-client-title {
        font-size: 16px;
    }

    .frm-modal-sc .crm-card-body {
        padding: 12px;
    }

    .frm-modal-sc .crm-data-grid,
    .frm-modal-sc .crm-data-grid-financial,
    .frm-modal-sc .crm-check-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .frm-modal-sc .crm-related-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .frm-modal-sc .crm-related-item-actions {
        flex-basis: auto;
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================
   APERÇU CLIENT — DERNIÈRE INSTALLATION
   ========================================================== */


/* La carte occupe toute la largeur de la fiche. */
.frm-modal-sc .crm-client-installation {
    grid-column: 1 / -1;
}


/* ----------------------------------------------------------
   CONTENEUR PRINCIPAL
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview {
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 9px;
}


/* ----------------------------------------------------------
   EN-TÊTE DE L’INSTALLATION
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 13px 14px;

    background: #f8fafc;
    border-bottom: 1px solid #e4e7ec;
}


.frm-modal-sc .crm-installation-preview__identity {
    min-width: 0;
}


.frm-modal-sc .crm-installation-preview__code {
    display: block;

    margin-bottom: 7px;

    color: #344054;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.2px;
}


.frm-modal-sc .crm-installation-preview__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}


.frm-modal-sc .crm-installation-preview__created {
    color: #667085;

    font-size: 10px;
    line-height: 1.3;
}


.frm-modal-sc .crm-installation-preview__responsible {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;

    min-width: 120px;

    color: #344054;

    font-size: 10px;
    line-height: 1.35;
}


.frm-modal-sc .crm-installation-preview__responsible-label {
    color: #98a2b3;

    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}


/* ----------------------------------------------------------
   PROGRESSION
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview__progress {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    align-items: center;
    gap: 15px;

    padding: 12px 14px;

    border-bottom: 1px solid #edf0f4;
}


.frm-modal-sc .crm-installation-preview__progress-title {
    color: #475467;

    font-size: 10px;
    font-weight: 600;
}


/*
 * Ajustement du shortcode de progression dans cette carte.
 */
.frm-modal-sc
.crm-installation-preview__progress
.crm-installation-progress {
    max-width: none;
}


/* ----------------------------------------------------------
   TITRE DE LA LISTE DES ÉTAPES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview__steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 11px 14px 8px;
}


.frm-modal-sc .crm-installation-preview__steps-header h4 {
    margin: 0;

    color: #344054;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;

    letter-spacing: 0.45px;
    text-transform: uppercase;
}


.frm-modal-sc .crm-installation-preview__steps-help {
    color: #98a2b3;

    font-size: 9px;
}


/* ----------------------------------------------------------
   LISTE DES ÉTAPES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview__steps {
    padding: 0 14px 4px;
}


/*
 * Chaque entrée de la View peut produire son propre wrapper.
 */
.frm-modal-sc .crm-installation-preview-steps {
    margin: 0;
}


.frm-modal-sc .crm-installation-preview-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;

    min-height: 37px;
    padding: 7px 0;

    border-bottom: 1px solid #edf0f4;
}


.frm-modal-sc
.crm-installation-preview-steps:last-child
.crm-installation-preview-step {
    border-bottom: 0;
}


.frm-modal-sc .crm-installation-preview-step__main {
    display: flex;
    flex-direction: column;
    gap: 2px;

    min-width: 0;
}


.frm-modal-sc .crm-installation-preview-step__label {
    overflow: hidden;

    color: #344054;

    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.frm-modal-sc .crm-installation-preview-step__note {
    overflow: hidden;

    color: #98a2b3;

    font-size: 9px;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.frm-modal-sc .crm-installation-preview-step__meta {
    display: grid;
    grid-template-columns: minmax(80px, auto) 72px;
    align-items: center;
    gap: 10px;
}


.frm-modal-sc .crm-installation-preview-step__date {
    color: #667085;

    font-size: 9px;
    line-height: 1.3;
    text-align: right;
    white-space: nowrap;
}


/* Badges plus compacts dans la liste. */
.frm-modal-sc
.crm-installation-preview-step
.crm-badge {
    justify-self: end;

    min-height: 20px;
    padding: 3px 7px;

    font-size: 9px;
}


/* ----------------------------------------------------------
   NOTES DE L’INSTALLATION
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview__notes {
    margin: 10px 14px 0;
    padding: 10px 11px;

    color: #667085;
    background: #f8fafc;

    border-left: 3px solid #98a2b3;
    border-radius: 6px;

    font-size: 9px;
    line-height: 1.5;
}


.frm-modal-sc .crm-installation-preview__notes strong {
    display: block;

    margin-bottom: 3px;

    color: #475467;
}


.frm-modal-sc .crm-installation-preview__notes p {
    margin: 0;
}


/* ----------------------------------------------------------
   PIED ET BOUTON
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview__footer {
    display: flex;
    justify-content: flex-end;

    padding: 12px 14px 13px;
}


.frm-modal-sc .crm-installation-preview__button,
.frm-modal-sc .crm-installation-preview-empty-state .crm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 32px;
    padding: 7px 11px;

    color: #344054;
    background: #ffffff;

    border: 1px solid #d0d5dd;
    border-radius: 7px;

    font-size: 10px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;

    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}


.frm-modal-sc .crm-installation-preview__button:hover,
.frm-modal-sc .crm-installation-preview__button:focus-visible,
.frm-modal-sc
.crm-installation-preview-empty-state
.crm-button:hover,
.frm-modal-sc
.crm-installation-preview-empty-state
.crm-button:focus-visible {
    color: #175cd3;
    background: #eff6ff;
    border-color: #84adff;
}


/* ----------------------------------------------------------
   ÉTATS VIDES
   ---------------------------------------------------------- */

.frm-modal-sc .crm-installation-preview-empty {
    padding: 15px;

    color: #98a2b3;
    background: #f8fafc;

    border: 1px dashed #d0d5dd;
    border-radius: 7px;

    font-size: 10px;
    text-align: center;
}


.frm-modal-sc .crm-installation-preview-empty-state {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px;

    background: #f8fafc;
    border: 1px dashed #d0d5dd;
    border-radius: 8px;
}


.frm-modal-sc
.crm-installation-preview-empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    background: #eef2f6;
    border-radius: 8px;

    font-size: 15px;
}


.frm-modal-sc
.crm-installation-preview-empty-state__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;

    min-width: 0;

    color: #667085;

    font-size: 10px;
}


.frm-modal-sc
.crm-installation-preview-empty-state__content strong {
    color: #344054;

    font-size: 11px;
}


/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 650px) {

    .frm-modal-sc .crm-installation-preview__header {
        flex-direction: column;
        gap: 10px;
    }

    .frm-modal-sc .crm-installation-preview__responsible {
        align-items: flex-start;
    }

    .frm-modal-sc .crm-installation-preview__progress {
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }

    .frm-modal-sc .crm-installation-preview-step {
        align-items: flex-start;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }

    .frm-modal-sc .crm-installation-preview-step__meta {
        grid-template-columns: auto 1fr;
        width: 100%;
    }

    .frm-modal-sc .crm-installation-preview-step__meta .crm-badge {
        justify-self: start;
    }

    .frm-modal-sc .crm-installation-preview-step__date {
        text-align: right;
    }

    .frm-modal-sc .crm-installation-preview-empty-state {
        align-items: flex-start;
        flex-wrap: wrap;
    }

}


/* ==========================================================
   FICHE INSTALLATION — STRUCTURE GÉNÉRALE
   ========================================================== */

.frm-modal-sc .crm-installation-sheet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;

    color: var(--crm-text, #344054);
}


/* Cartes occupant toute la largeur. */

.frm-modal-sc .crm-installation-header,
.frm-modal-sc .crm-installation-etapes {
    grid-column: 1 / -1;
}


/* ==========================================================
   EN-TÊTE INSTALLATION
   ========================================================== */

.frm-modal-sc .crm-installation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    padding: 4px 2px 18px;

    border-bottom: 1px solid var(--crm-border, #e4e7ec);
}


.frm-modal-sc .crm-installation-header__identity {
    min-width: 0;
}


.frm-modal-sc .crm-installation-header__code {
    display: block;

    margin-bottom: 4px;

    color: var(--crm-text-muted, #667085);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}


.frm-modal-sc .crm-installation-header__title {
    margin: 0 0 9px;

    color: var(--crm-text-strong, #101828);

    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}


.frm-modal-sc .crm-installation-header__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}


.frm-modal-sc .crm-installation-header__date {
    color: var(--crm-text-muted, #667085);

    font-size: 12px;
}


.frm-modal-sc .crm-installation-header__responsible {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;

    min-width: 150px;
}


.frm-modal-sc .crm-installation-header__responsible-label {
    color: var(--crm-text-muted, #667085);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}


.frm-modal-sc .crm-installation-header__responsible-name {
    color: var(--crm-text-strong, #101828);

    font-size: 13px;
}


/* ==========================================================
   NOTES GÉNÉRALES
   ========================================================== */

.frm-modal-sc .crm-installation-general__notes {
    margin-top: 16px;
    padding: 12px 14px;

    background: var(--crm-surface-muted, #f8fafc);
    border-left: 3px solid var(--crm-border-strong, #98a2b3);
    border-radius: 7px;
}


.frm-modal-sc .crm-installation-general__notes-label {
    display: block;

    margin-bottom: 5px;

    color: var(--crm-text-muted, #667085);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}


.frm-modal-sc .crm-installation-general__notes-content {
    color: var(--crm-text, #344054);

    font-size: 12px;
    line-height: 1.5;
}


.frm-modal-sc .crm-installation-general__notes-content p {
    margin: 0;
}


/* ==========================================================
   CARTE AVANCEMENT
   ========================================================== */

.frm-modal-sc .crm-installation-progress-summary {
    width: 100%;
}


.frm-modal-sc
.crm-installation-progress-summary
.crm-installation-progress {
    width: 100%;
}


/* Barre un peu plus visible dans la fiche. */

.frm-modal-sc
.crm-installation-progress-summary
.crm-installation-progress__track {
    height: 9px;
}


/* ==========================================================
   EN-TÊTE DE LA CARTE ÉTAPES
   ========================================================== */

.frm-modal-sc .crm-installation-etapes__header {
    align-items: center;
}


.frm-modal-sc .crm-installation-etapes__header .crm-card-heading {
    min-width: 0;
}


/* ==========================================================
   BOUTONS
   ========================================================== */

.frm-modal-sc .crm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 34px;
    padding: 8px 12px;

    border: 1px solid transparent;
    border-radius: 7px;

    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}


.frm-modal-sc .crm-button-primary {
    color: #ffffff;
    background: var(--crm-primary, #2563eb);
    border-color: var(--crm-primary, #2563eb);
}


.frm-modal-sc .crm-button-primary:hover,
.frm-modal-sc .crm-button-primary:focus-visible {
    background: var(--crm-primary-hover, #1d4ed8);
    border-color: var(--crm-primary-hover, #1d4ed8);
}


/* ==========================================================
   TABLEAU DES ÉTAPES
   ========================================================== */

.frm-modal-sc .crm-installation-steps-table__header,
.frm-modal-sc .crm-etape-row {
    display: grid;
    grid-template-columns:
        minmax(150px, 1.35fr)
        minmax(115px, 0.85fr)
        minmax(100px, 0.7fr)
        minmax(150px, 1.15fr)
        minmax(115px, 0.65fr);
    align-items: center;
    gap: 14px;
}


.frm-modal-sc .crm-installation-steps-table__header {
    padding: 9px 12px;

    color: var(--crm-text-muted, #667085);
    background: var(--crm-surface-muted, #f8fafc);

    border: 1px solid var(--crm-border, #e4e7ec);
    border-radius: 7px 7px 0 0;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}


.frm-modal-sc .crm-installation-etapes__list {
    border-right: 1px solid var(--crm-border, #e4e7ec);
    border-bottom: 1px solid var(--crm-border, #e4e7ec);
    border-left: 1px solid var(--crm-border, #e4e7ec);
    border-radius: 0 0 7px 7px;
}


/*
 * Les actions apparaissent techniquement avant le contenu.
 * display: contents permet néanmoins de répartir leurs
 * éléments dans la grille de la ligne.
 */

.frm-modal-sc .crm-etape-row {
    position: relative;

    min-height: 52px;
    padding: 8px 12px;

    border-bottom: 1px solid var(--crm-border, #e4e7ec);
}


.frm-modal-sc .crm-etape-row:last-child {
    border-bottom: 0;
}


/*
 * Le contenu principal rejoint la grille de la ligne.
 */

.frm-modal-sc .crm-etape-content {
    display: contents;
}


/*
 * Le conteneur des actions rejoint également la grille,
 * mais son affichage est placé en dernière colonne.
 */

.frm-modal-sc .crm-etape-actions {
    display: flex;
    grid-column: 5;
    grid-row: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}


/* Positionnement des données. */

.frm-modal-sc .crm-etape-libelle {
    grid-column: 1;
    grid-row: 1;

    min-width: 0;
}


.frm-modal-sc .crm-etape-statut {
    grid-column: 2;
    grid-row: 1;
}


.frm-modal-sc .crm-etape-date {
    grid-column: 3;
    grid-row: 1;

    color: var(--crm-text-muted, #667085);

    font-size: 11px;
}


.frm-modal-sc .crm-etape-note {
    grid-column: 4;
    grid-row: 1;

    min-width: 0;
    overflow: hidden;

    color: var(--crm-text-muted, #667085);

    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.frm-modal-sc .crm-etape-libelle strong {
    color: var(--crm-text-strong, #101828);

    font-size: 11px;
    font-weight: 700;
}


.frm-modal-sc .crm-etape-mobile-label {
    display: none;
}


/* ==========================================================
   BADGES DE STATUT D’ÉTAPE
   ========================================================== */

.frm-modal-sc .crm-step-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 26px;
    padding: 5px 9px;

    border: 1px solid transparent;
    border-radius: 6px;

    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}


/* — / statut vide */

.frm-modal-sc .crm-step-status-- {
    color: #667085;
    background: #eaecf0;
    border-color: #eaecf0;
}


/* En cours */

.frm-modal-sc .crm-step-status--en_cours {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}


/* Fait */

.frm-modal-sc .crm-step-status--fait {
    color: #027a48;
    background: #d1fadf;
    border-color: #6ce9a6;
}


/* Rejeté */

.frm-modal-sc .crm-step-status--rejete {
    color: #b42318;
    background: #fee4e2;
    border-color: #fda29b;
}


/* Bloqué */

.frm-modal-sc .crm-step-status--bloque {
    color: #ffffff;
    background: #344054;
    border-color: #344054;
}


/* Pas éligible */

.frm-modal-sc .crm-step-status--pas_eligible {
    color: #6941c6;
    background: #f4ebff;
    border-color: #d6bbfb;
}


/* CAI */

.frm-modal-sc .crm-step-status--cai {
    color: #026aa2;
    background: #e0f2fe;
    border-color: #7cd4fd;
}


/* ==========================================================
   LIENS D’ACTION
   ========================================================== */

.frm-modal-sc .crm-etape-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 28px;
    padding: 5px 8px;

    border: 1px solid var(--crm-border, #d0d5dd);
    border-radius: 6px;

    font-size: 9px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;
}


.frm-modal-sc .crm-etape-edit-link {
    color: var(--crm-primary, #2563eb);
    background: #ffffff;
}


.frm-modal-sc .crm-etape-delete-link {
    color: #b42318;
    background: #fff5f4;
    border-color: #fecdca;
}


.frm-modal-sc .crm-etape-actions a:hover,
.frm-modal-sc .crm-etape-actions a:focus-visible {
    background: var(--crm-surface-muted, #f8fafc);
}


/* ==========================================================
   ÉDITION IN-PLACE FORMIDABLE
   ========================================================== */

/*
 * Quand Formidable remplace frm_edit_etape_[id] par le
 * formulaire, la grille doit redevenir un bloc classique.
 */

.frm-modal-sc .crm-etape-row .frm_forms {
    grid-column: 1 / -1;

    width: 100%;
    padding: 12px;

    background: var(--crm-surface-muted, #f8fafc);
    border: 1px solid var(--crm-border, #e4e7ec);
    border-radius: 7px;
}


/*
 * Le lien Annuler généré par Formidable.
 */

.frm-modal-sc .frm_edit_link_container {
    display: inline-flex;
}


/* ==========================================================
   FORMULAIRE AJOUT D’ÉTAPE
   ========================================================== */

.frm-modal-sc .crm-installation-etape-editor {
    margin-top: 16px;

    overflow: hidden;

    background: #ffffff;
    border: 1px solid var(--crm-border, #d0d5dd);
    border-radius: 9px;
}


.frm-modal-sc .crm-installation-etape-editor[hidden] {
    display: none !important;
}


.frm-modal-sc .crm-installation-etape-editor__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding: 13px 15px;

    background: var(--crm-surface-muted, #f8fafc);
    border-bottom: 1px solid var(--crm-border, #e4e7ec);
}


.frm-modal-sc .crm-installation-etape-editor__header h3 {
    margin: 0 0 3px;

    color: var(--crm-text-strong, #101828);

    font-size: 13px;
}


.frm-modal-sc .crm-installation-etape-editor__header p {
    margin: 0;

    color: var(--crm-text-muted, #667085);

    font-size: 10px;
}


.frm-modal-sc .crm-etape-editor-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    padding: 0;

    color: var(--crm-text-muted, #667085);
    background: transparent;

    border: 0;
    border-radius: 6px;

    font-size: 21px;
    line-height: 1;

    cursor: pointer;
}


.frm-modal-sc .crm-etape-editor-close:hover,
.frm-modal-sc .crm-etape-editor-close:focus-visible {
    color: var(--crm-text-strong, #101828);
    background: #eaecf0;
}


.frm-modal-sc .crm-installation-etape-editor__body {
    padding: 15px;
}


/* Grille du formulaire FF d’ajout. */

.frm-modal-sc
.crm-installation-etape-editor
.frm_fields_container {
    display: grid;
    grid-template-columns:
        minmax(0, 0.45fr)
        minmax(0, 1.25fr)
        minmax(0, 0.85fr)
        minmax(0, 0.8fr);
    gap: 12px;
}


/* Installation associée : masquée, car préremplie. */

.frm-modal-sc
.crm-installation-etape-editor
#frm_field_176_container {
    display: none;
}


/* Bouton Envoyer */

.frm-modal-sc
.crm-installation-etape-editor
#frm_field_175_container {
    grid-column: 1 / -1;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 900px) {

    .frm-modal-sc .crm-installation-sheet {
        grid-template-columns: minmax(0, 1fr);
    }

    .frm-modal-sc .crm-installation-general,
    .frm-modal-sc .crm-installation-progress-card,
    .frm-modal-sc .crm-installation-etapes {
        grid-column: 1;
    }

}


@media (max-width: 760px) {

    .frm-modal-sc .crm-installation-header {
        flex-direction: column;
        gap: 12px;
    }

    .frm-modal-sc .crm-installation-header__responsible {
        align-items: flex-start;
    }

    .frm-modal-sc .crm-installation-etapes__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .frm-modal-sc .crm-installation-steps-table__header {
        display: none;
    }

    .frm-modal-sc .crm-installation-etapes__list {
        border-top: 1px solid var(--crm-border, #e4e7ec);
        border-radius: 7px;
    }

    .frm-modal-sc .crm-etape-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;

        padding: 13px;
    }

    .frm-modal-sc .crm-etape-content {
        display: contents;
    }

    .frm-modal-sc .crm-etape-libelle,
    .frm-modal-sc .crm-etape-statut,
    .frm-modal-sc .crm-etape-date,
    .frm-modal-sc .crm-etape-note,
    .frm-modal-sc .crm-etape-actions {
        grid-column: auto;
        grid-row: auto;
    }

    .frm-modal-sc .crm-etape-note {
        overflow: visible;
        white-space: normal;
    }

    .frm-modal-sc .crm-etape-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .frm-modal-sc .crm-etape-mobile-label {
        display: block;

        margin-bottom: 4px;

        color: var(--crm-text-muted, #667085);

        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.35px;
        text-transform: uppercase;
    }

    .frm-modal-sc
    .crm-installation-etape-editor
    .frm_fields_container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_177_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_178_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_180_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_181_container {
        grid-column: auto;
    }

}


@media (max-width: 520px) {

    .frm-modal-sc .crm-etape-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .frm-modal-sc .crm-step-status {
        width: auto;
        min-width: 110px;
    }

    .frm-modal-sc
    .crm-installation-etape-editor
    .frm_fields_container {
        grid-template-columns: minmax(0, 1fr);
    }

    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_177_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_178_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_180_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_181_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_182_container,
    .frm-modal-sc
    .crm-installation-etape-editor
    #frm_field_175_container {
        grid-column: 1;
    }

}

/* ==========================================================
   CORRECTIFS MODALE INSTALLATION
   ========================================================== */

/* Fond et padding comparables à la fiche Client. */
.frm-modal-sc .modal-body:has(.crm-installation-sheet) {
    padding: 18px 20px 22px !important;
    background: #f5f7fa;
}


/* En-tête natif de la modale. */
.frm-modal-sc .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    min-height: 74px;
    padding: 18px 22px;

    background: #ffffff;
    border-bottom: 1px solid var(--crm-border, #e4e7ec);
}

.frm-modal-sc .modal-header .modal-title {
    margin: 0;

    color: var(--crm-text-strong, #101828);

    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.frm-modal-sc .modal-header .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    padding: 0;

    color: var(--crm-text-muted, #667085);
    background: transparent;

    border: 0;
    border-radius: 7px;

    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.frm-modal-sc .modal-header .close:hover,
.frm-modal-sc .modal-header .close:focus-visible {
    color: var(--crm-text-strong, #101828);
    background: #f2f4f7;
}


/* Carte Avancement. */
.frm-modal-sc .crm-installation-progress-card .crm-card-body {
    display: flex;
    align-items: center;

    min-height: 108px;
}

.frm-modal-sc
.crm-installation-progress-summary
.crm-installation-progress__track {
    display: block;

    width: 100%;
    height: 9px;
    margin-top: 10px;

    overflow: hidden;

    background: #e4e7ec;
    border-radius: 999px;
}

.frm-modal-sc
.crm-installation-progress-summary
.crm-installation-progress__bar {
    display: block;
    height: 100%;

    background: var(--crm-primary, #2563eb);
    border-radius: inherit;
}

.frm-modal-sc
.crm-installation-progress-summary
.crm-progress-complete
.crm-installation-progress__bar {
    background: #12b76a;
}


/* Les actions ne doivent pas provoquer un décalage vide
   lorsqu’aucun lien n’est généré pour des raisons de droits. */
.frm-modal-sc .crm-etape-actions:empty {
    min-height: 1px;
}


/* ==========================================================
   CRM ALLIANCE — MODALE "AJOUTER UN CLIENT"
   ========================================================== */

/*
 * Le ciblage est volontairement basé sur le formulaire,
 * afin de limiter les effets de bord ailleurs dans le CRM.
 */


/* ==========================================================
   MODALE
   ========================================================== */

#frm-modal-0 .modal-dialog {
    width: min(760px, calc(100vw - 32px));
    max-width: 760px;
    margin: 28px auto;
}

#frm-modal-0 .modal-content {
    overflow: hidden;
    border: 1px solid #d9e0ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.18);
}


/* ---------- EN-TÊTE ---------- */

#frm-modal-0 .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 66px;
    padding: 0 22px;

    border-bottom: 1px solid #dfe5ee;
    background: #fff;
}

#frm-modal-0 .modal-title {
    margin: 0;

    color: #172033;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

#frm-modal-0 .modal-header .close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0;
    padding: 0;

    border: 0;
    background: transparent;

    color: #64748b;

    font-size: 24px;
    font-weight: 300;
    line-height: 1;

    text-decoration: none;
    cursor: pointer;
}

#frm-modal-0 .modal-header .close:hover {
    color: #2563eb;
}


/* ---------- CORPS ---------- */

#frm-modal-0 .modal-body {
    padding: 20px 22px 22px;
    background: #fff;
}


/* ==========================================================
   RESET FORMIDABLE DANS CETTE MODALE
   ========================================================== */

#frm-modal-0 #form_frm_clients fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

#frm-modal-0 #form_frm_clients .frm_fields_container {
    display: block;
}

#frm-modal-0 #form_frm_clients .frm_form_field {
    min-width: 0;
}


/* ==========================================================
   SECTIONS
   ========================================================== */

#frm-modal-0 #form_frm_clients .frm_section_heading {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    column-gap: 14px;
    row-gap: 14px;

    margin: 0 0 22px;
    padding: 0;

    border: 0;
    background: transparent;
}


/*
 * Titres :
 * Identification de l’entreprise
 * Suivi commercial
 */
#frm-modal-0 #form_frm_clients
.frm_section_heading > h3 {

    grid-column: 1 / -1;

    margin: 0 0 2px !important;
    padding: 0 0 10px !important;

    border-bottom: 1px solid #e3e8ef;

    color: #65728a;

    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2;

    letter-spacing: .055em;
    text-transform: uppercase;
}


/* ==========================================================
   CHAMPS TECHNIQUES LOOKUP
   ========================================================== */

/*
 * Ces champs filtrent les Lookup Statut et Opérateur.
 * Ils restent nécessaires à Formidable mais ne doivent
 * pas apparaître dans la modale.
 */

#frm-modal-0 #frm_field_21_container,
#frm-modal-0 #frm_field_25_container {
    display: none !important;
}


/* ==========================================================
   IDENTIFICATION ENTREPRISE
   ========================================================== */

/*
 * Il ne reste volontairement que Raison sociale.
 * On lui donne donc toute la largeur.
 */

#frm-modal-0 #frm_field_17_container {
    grid-column: 1 / -1;
}


/* ==========================================================
   CHAMPS VISIBLES
   ========================================================== */

#frm-modal-0 #form_frm_clients .frm_primary_label {
    display: block;

    margin: 0 0 5px;

    color: #65728a;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}


/* ---------- INPUTS / SELECTS ---------- */

#frm-modal-0 #form_frm_clients
input[type="text"],

#frm-modal-0 #form_frm_clients
input[type="email"],

#frm-modal-0 #form_frm_clients
input[type="tel"],

#frm-modal-0 #form_frm_clients
input[type="number"],

#frm-modal-0 #form_frm_clients
select {

    width: 100%;
    min-height: 39px;

    margin: 0;
    padding: 8px 11px;

    border: 1px solid #d5dde8;
    border-radius: 7px;

    background: #f6f8fb;

    box-shadow: none;

    color: #182235;

    font-size: 13px;
    line-height: 1.35;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}


/* ---------- FOCUS ---------- */

#frm-modal-0 #form_frm_clients
input[type="text"]:focus,

#frm-modal-0 #form_frm_clients
input[type="email"]:focus,

#frm-modal-0 #form_frm_clients
input[type="tel"]:focus,

#frm-modal-0 #form_frm_clients
input[type="number"]:focus,

#frm-modal-0 #form_frm_clients
select:focus {

    outline: none;

    border-color: #8bb4ff;
    background: #fff;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, .10);
}


/* ---------- PLACEHOLDERS ---------- */

#frm-modal-0 #form_frm_clients
input::placeholder {
    color: #9aa6b8;
}


/* ---------- SELECT ---------- */

#frm-modal-0 #form_frm_clients select {
    cursor: pointer;
}


/* ==========================================================
   DATE
   ========================================================== */

#frm-modal-0 #frm_field_29_container {
    position: relative;
}

#frm-modal-0 #field_cli_date_signature {
    padding-right: 36px;
}


/* ==========================================================
   CHAMP OBLIGATOIRE
   ========================================================== */

#frm-modal-0 #form_frm_clients .frm_required {
    color: #ef4444;
}


/* ==========================================================
   BOUTON SUBMIT
   ========================================================== */

#frm-modal-0 #form_frm_clients .frm_submit {
    display: flex;
    justify-content: flex-end;

    margin-top: 2px;
    padding-top: 18px;

    border-top: 1px solid #e3e8ef;
}

#frm-modal-0 #form_frm_clients
.frm_button_submit {

    min-height: 40px;

    padding: 9px 18px;

    border: 1px solid #3478f6;
    border-radius: 7px;

    background: #3b82f6;

    box-shadow: none;

    color: #fff;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        transform .1s ease;
}

#frm-modal-0 #form_frm_clients
.frm_button_submit:hover {

    border-color: #2563eb;
    background: #2563eb;
}

#frm-modal-0 #form_frm_clients
.frm_button_submit:active {
    transform: translateY(1px);
}


/* ==========================================================
   MESSAGES / ERREURS
   ========================================================== */

#frm-modal-0 #form_frm_clients .frm_error {
    margin-top: 5px;

    color: #dc2626;

    font-size: 11px;
    line-height: 1.35;
}

#frm-modal-0 #form_frm_clients
.frm_blank_field input,

#frm-modal-0 #form_frm_clients
.frm_blank_field select {

    border-color: #efaaaa;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 650px) {

    #frm-modal-0 .modal-dialog {
        width: calc(100vw - 16px);
        margin: 8px auto;
    }

    #frm-modal-0 .modal-header {
        min-height: 60px;
        padding: 0 16px;
    }

    #frm-modal-0 .modal-body {
        padding: 16px;
    }

    #frm-modal-0 #form_frm_clients
    .frm_section_heading {

        grid-template-columns: 1fr;
        row-gap: 12px;
    }

    #frm-modal-0 #frm_field_17_container {
        grid-column: auto;
    }
}

.frm_style_style-formidable.with_frm_style .frm-show-form .frm_section_heading h3[class*="frm_pos_"] {
  border-top: none !important;
}

/* ==========================================================
   CORRECTIF PRIORITAIRE — MODALE AJOUT CLIENT
   À placer APRÈS les autres règles CSS
   ========================================================== */


/* ----------------------------------------------------------
   1. SECTIONS : vraie grille 2 colonnes
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients #frm_field_14_container,
#frm-modal-0 #form_frm_clients #frm_field_19_container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    column-gap: 14px !important;
    row-gap: 14px !important;

    width: 100% !important;
    max-width: none !important;

    margin: 0 0 22px !important;
    padding: 0 !important;
}


/* ----------------------------------------------------------
   2. TITRES DES SECTIONS
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients #frm_field_14_container > h3,
#frm-modal-0 #form_frm_clients #frm_field_19_container > h3 {
    grid-column: 1 / -1 !important;

    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 0 10px !important;

    border-bottom: 1px solid #e1e6ee !important;

    color: #65728a !important;

    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;

    letter-spacing: .055em !important;
    text-transform: uppercase !important;
}


/* ----------------------------------------------------------
   3. RESET DES CHAMPS FORMIDABLE
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients
#frm_field_14_container > .frm_form_field,

#frm-modal-0 #form_frm_clients
#frm_field_19_container > .frm_form_field {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;
    clear: none !important;

    grid-column: auto !important;
}


/* ----------------------------------------------------------
   4. IDENTIFICATION
   Raison sociale sur toute la largeur
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients #frm_field_17_container {
    grid-column: 1 / -1 !important;
}


/* ----------------------------------------------------------
   5. SUIVI COMMERCIAL
   Placement explicite des 4 champs visibles
   ---------------------------------------------------------- */

/* Ligne 1 */
#frm-modal-0 #form_frm_clients #frm_field_22_container {
    grid-column: 1 !important;
    grid-row: 2 !important;
}

#frm-modal-0 #form_frm_clients #frm_field_24_container {
    grid-column: 2 !important;
    grid-row: 2 !important;
}


/* Ligne 2 */
#frm-modal-0 #form_frm_clients #frm_field_26_container {
    grid-column: 1 !important;
    grid-row: 3 !important;
}

#frm-modal-0 #form_frm_clients #frm_field_29_container {
    grid-column: 2 !important;
    grid-row: 3 !important;
}


/* ----------------------------------------------------------
   6. CHAMPS TECHNIQUES
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients #frm_field_21_container,
#frm-modal-0 #form_frm_clients #frm_field_25_container {
    display: none !important;
}


/* ----------------------------------------------------------
   7. LABELS
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients .frm_primary_label {
    display: block !important;

    margin: 0 0 5px !important;
    padding: 0 !important;

    color: #65728a !important;

    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
}


/* ----------------------------------------------------------
   8. INPUTS / SELECTS
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients
#frm_field_17_container input,

#frm-modal-0 #form_frm_clients
#frm_field_22_container select,

#frm-modal-0 #form_frm_clients
#frm_field_24_container select,

#frm-modal-0 #form_frm_clients
#frm_field_26_container select,

#frm-modal-0 #form_frm_clients
#frm_field_29_container input {
    display: block !important;

    box-sizing: border-box !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;

    min-height: 39px !important;

    margin: 0 !important;
    padding: 8px 11px !important;

    border: 1px solid #d5dde8 !important;
    border-radius: 7px !important;

    background: #f6f8fb !important;

    box-shadow: none !important;

    color: #182235;

    font-size: 13px !important;
}


/* ----------------------------------------------------------
   9. BOUTON SUBMIT
   ---------------------------------------------------------- */

#frm-modal-0 #form_frm_clients .frm_submit {
    display: flex !important;
    justify-content: flex-end !important;

    width: 100% !important;

    margin: 0 !important;
    padding: 18px 0 0 !important;

    border-top: 1px solid #e1e6ee;
}


/* ----------------------------------------------------------
   10. RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 650px) {

    #frm-modal-0 #form_frm_clients #frm_field_14_container,
    #frm-modal-0 #form_frm_clients #frm_field_19_container {
        grid-template-columns: 1fr !important;
    }

    #frm-modal-0 #form_frm_clients #frm_field_17_container,
    #frm-modal-0 #form_frm_clients #frm_field_22_container,
    #frm-modal-0 #form_frm_clients #frm_field_24_container,
    #frm-modal-0 #form_frm_clients #frm_field_26_container,
    #frm-modal-0 #form_frm_clients #frm_field_29_container {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}



/* ==========================================================
   CRM ALLIANCE — MODALE APERÇU SAV
   ========================================================== */


/* ==========================================================
   CORPS DE MODALE
   Même respiration que l'aperçu Client
   ========================================================== */

/* ==========================================================
   COORDONNÉES CLIENT
   ========================================================== */

.crm-sav-ticket-apercu .crm-sav-cilent-contact {
    margin-top: 10px;
}


/* Titre de section façon démo */
.crm-sav-ticket-apercu .crm-sav-cilent-contact-title {
    margin: 0 0 10px !important;
    padding: 0 0 8px !important;

    border-bottom: 1px solid #dfe5ed;

    color: #66728a;

    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.2;

    letter-spacing: .055em;
    text-transform: uppercase;
}


/* Résultat / liste contacts */
.crm-sav-ticket-apercu .crm-sav-cilent-contact-result {
    margin: 0;
}


/* ==========================================================
   CRM ALLIANCE — MODALE "NOUVEAU TICKET SAV"
   Ciblage sans ID de modale
   ========================================================== */


/* ==========================================================
   MODALE
   ========================================================== */

.modal-content:has(#form_frm_sav_tickets) {
    overflow: hidden;

    border: 1px solid #d9e0ea;
    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 20px 55px rgba(15, 23, 42, .18);
}


/* ---------- HEADER ---------- */

.modal-content:has(#form_frm_sav_tickets)
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 64px;

    padding: 0 22px;

    border-bottom: 1px solid #dfe5ee;

    background: #fff;
}

.modal-content:has(#form_frm_sav_tickets)
.modal-title {
    margin: 0;

    color: #172033;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.modal-content:has(#form_frm_sav_tickets)
.modal-header .close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #64748b;

    font-size: 24px;
    font-weight: 300;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;
}

.modal-content:has(#form_frm_sav_tickets)
.modal-header .close:hover {
    color: #2563eb;
}


/* ==========================================================
   CORPS
   ========================================================== */

.modal-content:has(#form_frm_sav_tickets)
.modal-body {
    padding: 20px 22px 22px;

    background: #fff;
}


/* ==========================================================
   RESET FORMIDABLE
   ========================================================== */

#form_frm_sav_tickets fieldset {
    margin: 0;
    padding: 0;

    border: 0;
}

#form_frm_sav_tickets .frm_fields_container {
    display: block;
}

#form_frm_sav_tickets .frm_form_field {
    min-width: 0;
}


/* ==========================================================
   SECTIONS
   ========================================================== */

#form_frm_sav_tickets .frm_section_heading {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    column-gap: 14px;
    row-gap: 13px;

    margin: 0 0 20px !important;
    padding: 0 !important;

    border: 0 !important;

    background: transparent !important;
}


/* Titres de section */
#form_frm_sav_tickets
.frm_section_heading > h3 {
    grid-column: 1 / -1;

    margin: 0 !important;
    padding: 0 0 9px !important;

    border-bottom: 1px solid #e1e6ee;

    color: #65728a;

    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.2;

    letter-spacing: .055em;
    text-transform: uppercase;
}


/* ==========================================================
   IDENTIFICATION TECHNIQUE
   ========================================================== */

/*
 * Client associé occupe toute la largeur.
 */
#form_frm_sav_tickets
#frm_field_139_container {
    grid-column: 1 / -1;
}


/* ==========================================================
   IDENTIFICATION DU TICKET
   ========================================================== */

/*
 * Objet sur toute la largeur.
 */
#form_frm_sav_tickets
#frm_field_143_container {
    grid-column: 1 / -1;
}


/*
 * Catégorie | Statut
 */
#form_frm_sav_tickets
#frm_field_145_container {
    grid-column: 1;
}

#form_frm_sav_tickets
#frm_field_147_container {
    grid-column: 2;
}


/*
 * Priorité | Assigné à
 */
#form_frm_sav_tickets
#frm_field_149_container {
    grid-column: 1;
}

#form_frm_sav_tickets
#frm_field_150_container {
    grid-column: 2;
}


/* ==========================================================
   DESCRIPTION
   ========================================================== */

#form_frm_sav_tickets
#frm_field_152_container {
    grid-template-columns: 1fr;
}

#form_frm_sav_tickets
#frm_field_154_container {
    grid-column: 1 / -1;
}


/* ==========================================================
   CHAMPS TECHNIQUES LOOKUP
   ========================================================== */

/*
 * Champs nécessaires au filtrage de références,
 * mais inutiles visuellement.
 */

#form_frm_sav_tickets
#frm_field_144_container,

#form_frm_sav_tickets
#frm_field_146_container,

#form_frm_sav_tickets
#frm_field_148_container {
    display: none !important;
}


/* ==========================================================
   LABELS
   ========================================================== */

#form_frm_sav_tickets
.frm_primary_label {
    display: block;

    margin: 0 0 5px !important;
    padding: 0 !important;

    color: #65728a;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}


/* Obligatoire */
#form_frm_sav_tickets
.frm_required {
    color: #ef4444;
}


/* ==========================================================
   INPUTS / SELECTS / TEXTAREA
   ========================================================== */

#form_frm_sav_tickets
input[type="text"],

#form_frm_sav_tickets
input[type="email"],

#form_frm_sav_tickets
input[type="tel"],

#form_frm_sav_tickets
input[type="number"],

#form_frm_sav_tickets
select,

#form_frm_sav_tickets
textarea {
    box-sizing: border-box;

    width: 100%;
    min-width: 0;

    margin: 0 !important;

    border: 1px solid #d5dde8;
    border-radius: 7px;

    background: #f6f8fb;

    box-shadow: none;

    color: #182235;

    font-size: 13px;
    line-height: 1.35;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}


/* Inputs / selects */
#form_frm_sav_tickets
input[type="text"],

#form_frm_sav_tickets
input[type="email"],

#form_frm_sav_tickets
input[type="tel"],

#form_frm_sav_tickets
input[type="number"],

#form_frm_sav_tickets
select {
    min-height: 39px;

    padding: 8px 11px;
}


/* Textarea */
#form_frm_sav_tickets
textarea {
    min-height: 88px;

    padding: 10px 11px;

    resize: vertical;
}


/* Focus */
#form_frm_sav_tickets
input:focus,

#form_frm_sav_tickets
select:focus,

#form_frm_sav_tickets
textarea:focus {
    outline: none;

    border-color: #8bb4ff;

    background: #fff;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, .10);
}


/* ==========================================================
   DESCRIPTION SOUS "OBJET"
   ========================================================== */

#form_frm_sav_tickets
.frm_description {
    margin-top: 4px;

    color: #8b97aa;

    font-size: 10px;
    line-height: 1.3;
}


/* ==========================================================
   BOUTON SUBMIT
   ========================================================== */

#form_frm_sav_tickets
.frm_submit {
    display: flex;
    justify-content: flex-end;

    width: 100%;

    margin: 0 !important;

    padding: 18px 0 0 !important;

    border-top: 1px solid #e1e6ee;
}

#form_frm_sav_tickets
.frm_button_submit {
    min-height: 40px;

    padding: 9px 18px;

    border: 1px solid #3478f6;
    border-radius: 7px;

    background: #3b82f6;

    box-shadow: none;

    color: #fff;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        transform .1s ease;
}

#form_frm_sav_tickets
.frm_button_submit:hover {
    border-color: #2563eb;

    background: #2563eb;
}

#form_frm_sav_tickets
.frm_button_submit:active {
    transform: translateY(1px);
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 650px) {

    .modal-content:has(#form_frm_sav_tickets)
    .modal-body {
        padding: 16px;
    }

    #form_frm_sav_tickets
    .frm_section_heading {
        grid-template-columns: 1fr;
    }

    #form_frm_sav_tickets
    #frm_field_139_container,

    #form_frm_sav_tickets
    #frm_field_143_container,

    #form_frm_sav_tickets
    #frm_field_145_container,

    #form_frm_sav_tickets
    #frm_field_147_container,

    #form_frm_sav_tickets
    #frm_field_149_container,

    #form_frm_sav_tickets
    #frm_field_150_container,

    #form_frm_sav_tickets
    #frm_field_154_container {
        grid-column: 1;
    }
}


/* ==========================================================
   CRM ALLIANCE — MODALE "NOUVELLE INSTALLATION"
   Ciblage sans ID de modale
   ========================================================== */


/* ==========================================================
   MODALE
   ========================================================== */

.modal-content:has(#form_frm_installations) {
    overflow: hidden;

    border: 1px solid #d9e0ea;
    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 20px 55px rgba(15, 23, 42, .18);
}


/* ---------- HEADER ---------- */

.modal-content:has(#form_frm_installations)
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 64px;

    padding: 0 22px;

    border-bottom: 1px solid #dfe5ee;

    background: #fff;
}

.modal-content:has(#form_frm_installations)
.modal-title {
    margin: 0;

    color: #172033;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.modal-content:has(#form_frm_installations)
.modal-header .close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #64748b;

    font-size: 24px;
    font-weight: 300;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;
}

.modal-content:has(#form_frm_installations)
.modal-header .close:hover {
    color: #2563eb;
}


/* ==========================================================
   CORPS
   ========================================================== */

.modal-content:has(#form_frm_installations)
.modal-body {
    padding: 20px 22px 22px;

    background: #fff;
}


/* ==========================================================
   RESET + LAYOUT FORMULAIRE INSTALLATION
   VERSION CORRIGÉE
   ========================================================== */

#form_frm_installations fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

#form_frm_installations .frm_form_fields {
    margin: 0;
}


/* ==========================================================
   GRILLE PRINCIPALE
   ========================================================== */

#form_frm_installations .frm_fields_container {
    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    column-gap: 14px !important;
    row-gap: 14px !important;

    width: 100% !important;
}


/*
 * IMPORTANT :
 * on force chaque champ visible à redevenir un véritable
 * bloc Grid, y compris les champs dynamiques Formidable.
 */
#form_frm_installations
#frm_field_168_container,

#form_frm_installations
#frm_field_169_container,

#form_frm_installations
#frm_field_171_container,

#form_frm_installations
#frm_field_173_container,

#form_frm_installations
#frm_field_174_container {
    display: block !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;
    clear: none !important;
}


/* ==========================================================
   PLACEMENT DES CHAMPS
   ========================================================== */

/*
 * On fixe uniquement les COLONNES.
 *
 * On ne fixe volontairement PLUS grid-row :
 * le navigateur conserve ainsi l'ordre naturel du formulaire.
 */


/* Ligne 1 */

#form_frm_installations
#frm_field_168_container {
    grid-column: 1 !important;
}

#form_frm_installations
#frm_field_169_container {
    grid-column: 2 !important;
}


/* Ligne 2 */

#form_frm_installations
#frm_field_171_container {
    grid-column: 1 !important;
}

#form_frm_installations
#frm_field_173_container {
    grid-column: 2 !important;
}


/* Ligne 3 */

#form_frm_installations
#frm_field_174_container {
    grid-column: 1 / -1 !important;
}


/* ==========================================================
   CHAMP DYNAMIQUE CLIENT
   ========================================================== */

/*
 * Formidable enveloppe le select dynamique dans
 * .frm_data_container.
 *
 * On neutralise les éventuels styles spécifiques.
 */

#form_frm_installations
#frm_field_168_container
.frm_data_container {
    display: block !important;

    width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
}

#form_frm_installations
#field_ins_client {
    width: 100% !important;
    max-width: none !important;
}


/* ==========================================================
   CHAMP TECHNIQUE
   ========================================================== */

#form_frm_installations
#frm_field_170_container {
    display: none !important;
}


/* ==========================================================
   LABELS
   ========================================================== */

#form_frm_installations
.frm_primary_label {
    display: block !important;

    margin: 0 0 5px !important;
    padding: 0 !important;

    color: #65728a;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}

#form_frm_installations
.frm_required {
    color: #ef4444;
}


/* ==========================================================
   INPUTS / SELECTS / TEXTAREA
   ========================================================== */

#form_frm_installations
input[type="text"],

#form_frm_installations
input[type="email"],

#form_frm_installations
input[type="tel"],

#form_frm_installations
input[type="number"],

#form_frm_installations
select,

#form_frm_installations
textarea {
    box-sizing: border-box !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;

    border: 1px solid #d5dde8;
    border-radius: 7px;

    background: #f6f8fb;

    box-shadow: none;

    color: #182235;

    font-size: 13px;
    line-height: 1.35;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}


#form_frm_installations
input[type="text"],

#form_frm_installations
input[type="email"],

#form_frm_installations
input[type="tel"],

#form_frm_installations
input[type="number"],

#form_frm_installations
select {
    min-height: 39px;

    padding: 8px 11px;
}


#form_frm_installations
textarea {
    min-height: 92px;

    padding: 10px 11px;

    resize: vertical;
}


/* Focus */

#form_frm_installations
input:focus,

#form_frm_installations
select:focus,

#form_frm_installations
textarea:focus {
    outline: none;

    border-color: #8bb4ff;

    background: #fff;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, .10);
}


/* ==========================================================
   DATE
   ========================================================== */

#form_frm_installations
#frm_field_173_container {
    position: relative;
}

#form_frm_installations
#field_ins_date_fin {
    padding-right: 36px;
}


/* ==========================================================
   SUBMIT
   ========================================================== */

/*
 * Le submit est directement enfant de .frm_fields_container
 * dans ton HTML actuel.
 */

#form_frm_installations
.frm_fields_container > .frm_submit {
    grid-column: 1 / -1 !important;

    display: flex !important;
    justify-content: flex-end !important;

    width: 100% !important;

    margin: 4px 0 0 !important;
    padding: 18px 0 0 !important;

    border-top: 1px solid #e1e6ee;
}


#form_frm_installations
.frm_button_submit {
    min-height: 40px;

    padding: 9px 18px;

    border: 1px solid #3478f6;
    border-radius: 7px;

    background: #3b82f6;

    box-shadow: none;

    color: #fff;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        transform .1s ease;
}

#form_frm_installations
.frm_button_submit:hover {
    border-color: #2563eb;
    background: #2563eb;
}

#form_frm_installations
.frm_button_submit:active {
    transform: translateY(1px);
}


/* ==========================================================
   ERREURS
   ========================================================== */

#form_frm_installations
.frm_error {
    margin-top: 5px;

    color: #dc2626;

    font-size: 11px;
    line-height: 1.35;
}

#form_frm_installations
.frm_blank_field input,

#form_frm_installations
.frm_blank_field select,

#form_frm_installations
.frm_blank_field textarea {
    border-color: #efaaaa;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 650px) {

    .modal-content:has(#form_frm_installations)
    .modal-body {
        padding: 16px;
    }

    #form_frm_installations
    .frm_fields_container {
        grid-template-columns: 1fr !important;
    }

    #form_frm_installations
    #frm_field_168_container,

    #form_frm_installations
    #frm_field_169_container,

    #form_frm_installations
    #frm_field_171_container,

    #form_frm_installations
    #frm_field_173_container,

    #form_frm_installations
    #frm_field_174_container,

    #form_frm_installations
    .frm_fields_container > .frm_submit {
        grid-column: 1 !important;
    }
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 650px) {

    .modal-content:has(#form_frm_installations)
    .modal-body {
        padding: 16px;
    }

    #form_frm_installations
    .frm_fields_container {
        grid-template-columns: 1fr;
    }

    #form_frm_installations
    #frm_field_168_container,

    #form_frm_installations
    #frm_field_169_container,

    #form_frm_installations
    #frm_field_171_container,

    #form_frm_installations
    #frm_field_173_container,

    #form_frm_installations
    #frm_field_174_container {
        grid-column: 1;
    }
}


/* ==========================================================
   CRM ALLIANCE — MODALE "AJOUTER UN DEVIS"
   Formulaire : frm_devis
   Ciblage sans ID de modale
   ========================================================== */


/* ==========================================================
   MODALE
   ========================================================== */

.modal-content:has(#form_frm_devis) {
    overflow: hidden;

    border: 1px solid #d9e0ea;
    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 20px 55px rgba(15, 23, 42, .18);
}


/* ---------- HEADER ---------- */

.modal-content:has(#form_frm_devis)
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 64px;

    padding: 0 22px;

    border-bottom: 1px solid #dfe5ee;

    background: #fff;
}


.modal-content:has(#form_frm_devis)
.modal-title {
    margin: 0;

    color: #172033;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}


.modal-content:has(#form_frm_devis)
.modal-header .close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #64748b;

    font-size: 24px;
    font-weight: 300;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;
}


.modal-content:has(#form_frm_devis)
.modal-header .close:hover {
    color: #2563eb;
}


/* ==========================================================
   CORPS
   ========================================================== */

.modal-content:has(#form_frm_devis)
.modal-body {
    padding: 20px 22px 22px;

    background: #fff;
}


/* ==========================================================
   RESET FORMIDABLE
   ========================================================== */

#form_frm_devis fieldset {
    margin: 0;
    padding: 0;

    border: 0;
}


#form_frm_devis .frm_form_fields {
    margin: 0;
}


#form_frm_devis .frm_form_field {
    min-width: 0;
}


/* ==========================================================
   SECTION "IDENTIFICATION DU DEVIS"
   ========================================================== */

/*
 * Le champ 239 est la section qui contient :
 *
 * 223 = Client
 * 228 = Opérateur quitté
 * 229 = Signataire
 */

#form_frm_devis
#frm_field_239_container {
    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    column-gap: 14px !important;
    row-gap: 14px !important;

    width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    background: transparent !important;
}


/* ==========================================================
   TITRE DE SECTION
   ========================================================== */

#form_frm_devis
#frm_field_239_container > h3 {
    grid-column: 1 / -1;

    margin: 0 !important;
    padding: 0 0 9px !important;

    border-bottom: 1px solid #e1e6ee;

    color: #65728a;

    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.2;

    letter-spacing: .055em;
    text-transform: uppercase;
}


/* ==========================================================
   PLACEMENT DES CHAMPS
   ========================================================== */


/* ---------- Client : pleine largeur ---------- */

#form_frm_devis
#frm_field_223_container {
    grid-column: 1 / -1 !important;

    display: block !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;
    clear: none !important;
}


/* ---------- Opérateur quitté ---------- */

#form_frm_devis
#frm_field_228_container {
    grid-column: 1 !important;

    display: block !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;
    clear: none !important;
}


/* ---------- Signataire ---------- */

#form_frm_devis
#frm_field_229_container {
    grid-column: 2 !important;

    display: block !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;
    clear: none !important;
}


/* ==========================================================
   CHAMP DYNAMIQUE CLIENT
   ========================================================== */

/*
 * dev_client est un champ dynamique Formidable.
 * On neutralise les éventuelles règles spécifiques
 * de .frm_data_container.
 */

#form_frm_devis
#frm_field_223_container
.frm_data_container {
    display: block !important;

    width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
}


#form_frm_devis
#field_dev_client {
    width: 100% !important;
    max-width: none !important;
}


/* ==========================================================
   LABELS
   ========================================================== */

#form_frm_devis
.frm_primary_label {
    display: block;

    margin: 0 0 5px !important;
    padding: 0 !important;

    color: #65728a;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}


#form_frm_devis
.frm_required {
    color: #ef4444;
}


/* ==========================================================
   INPUTS / SELECTS
   ========================================================== */

#form_frm_devis
input[type="text"],

#form_frm_devis
input[type="email"],

#form_frm_devis
input[type="tel"],

#form_frm_devis
input[type="number"],

#form_frm_devis
select,

#form_frm_devis
textarea {
    box-sizing: border-box;

    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;

    border: 1px solid #d5dde8;
    border-radius: 7px;

    background: #f6f8fb;

    box-shadow: none;

    color: #182235;

    font-size: 13px;
    line-height: 1.35;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}


#form_frm_devis
input[type="text"],

#form_frm_devis
input[type="email"],

#form_frm_devis
input[type="tel"],

#form_frm_devis
input[type="number"],

#form_frm_devis
select {
    min-height: 39px;

    padding: 8px 11px;
}


/* ---------- Focus ---------- */

#form_frm_devis
input:focus,

#form_frm_devis
select:focus,

#form_frm_devis
textarea:focus {
    outline: none;

    border-color: #8bb4ff;

    background: #fff;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, .10);
}


/* ==========================================================
   SUBMIT
   ========================================================== */

/*
 * Dans ton HTML actuel, .frm_submit est directement
 * enfant de .frm_fields_container.
 */

#form_frm_devis
.frm_fields_container > .frm_submit {
    display: flex !important;
    justify-content: flex-end !important;

    width: 100% !important;

    margin: 20px 0 0 !important;
    padding: 18px 0 0 !important;

    border-top: 1px solid #e1e6ee;
}


#form_frm_devis
.frm_button_submit {
    min-height: 40px;

    padding: 9px 18px;

    border: 1px solid #3478f6;
    border-radius: 7px;

    background: #3b82f6;

    box-shadow: none;

    color: #fff;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        transform .1s ease;
}


#form_frm_devis
.frm_button_submit:hover {
    border-color: #2563eb;

    background: #2563eb;
}


#form_frm_devis
.frm_button_submit:active {
    transform: translateY(1px);
}


/* ==========================================================
   ERREURS
   ========================================================== */

#form_frm_devis
.frm_error {
    margin-top: 5px;

    color: #dc2626;

    font-size: 11px;
    line-height: 1.35;
}


#form_frm_devis
.frm_blank_field input,

#form_frm_devis
.frm_blank_field select,

#form_frm_devis
.frm_blank_field textarea {
    border-color: #efaaaa;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 650px) {

    .modal-content:has(#form_frm_devis)
    .modal-body {
        padding: 16px;
    }


    #form_frm_devis
    #frm_field_239_container {
        grid-template-columns: 1fr !important;
    }


    #form_frm_devis
    #frm_field_223_container,

    #form_frm_devis
    #frm_field_228_container,

    #form_frm_devis
    #frm_field_229_container {
        grid-column: 1 !important;
    }
}


/* ==========================================================
   CRM ALLIANCE — MODALE "AJOUTER UN MATÉRIEL"
   Formulaire : frm_materiels
   Ciblage sans ID de modale
   ========================================================== */


/* ==========================================================
   MODALE
   ========================================================== */

.modal-content:has(#form_frm_materiels) {
    overflow: hidden;

    border: 1px solid #d9e0ea;
    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 20px 55px rgba(15, 23, 42, .18);
}


/* ---------- HEADER ---------- */

.modal-content:has(#form_frm_materiels)
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 64px;

    padding: 0 22px;

    border-bottom: 1px solid #dfe5ee;

    background: #fff;
}

.modal-content:has(#form_frm_materiels)
.modal-title {
    margin: 0;

    color: #172033;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.modal-content:has(#form_frm_materiels)
.modal-header .close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #64748b;

    font-size: 24px;
    font-weight: 300;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;
}

.modal-content:has(#form_frm_materiels)
.modal-header .close:hover {
    color: #2563eb;
}


/* ==========================================================
   CORPS
   ========================================================== */

.modal-content:has(#form_frm_materiels)
.modal-body {
    padding: 20px 22px 22px;

    background: #fff;
}


/* ==========================================================
   RESET FORMIDABLE
   ========================================================== */

#form_frm_materiels fieldset {
    margin: 0;
    padding: 0;

    border: 0;
}

#form_frm_materiels .frm_form_fields {
    margin: 0;
}

#form_frm_materiels .frm_fields_container {
    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    column-gap: 14px !important;
    row-gap: 14px !important;

    width: 100% !important;
}

#form_frm_materiels .frm_form_field {
    min-width: 0;

    margin: 0 !important;
}


/* ==========================================================
   PLACEMENT DES CHAMPS
   ========================================================== */


/* Désignation : pleine largeur */
#form_frm_materiels
#frm_field_214_container {
    grid-column: 1 / -1 !important;
}


/* Description : pleine largeur */
#form_frm_materiels
#frm_field_215_container {
    grid-column: 1 / -1 !important;
}


/* Photo : colonne gauche */
#form_frm_materiels
#frm_field_216_container {
    grid-column: 1 !important;
}


/* Type : colonne droite */
#form_frm_materiels
#frm_field_217_container {
    grid-column: 2 !important;
}


/* ==========================================================
   LABELS
   ========================================================== */

#form_frm_materiels
.frm_primary_label {
    display: block;

    margin: 0 0 5px !important;
    padding: 0 !important;

    color: #65728a;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}

#form_frm_materiels
.frm_required {
    color: #ef4444;
}


/* ==========================================================
   INPUTS / SELECTS
   ========================================================== */

#form_frm_materiels
input[type="text"],

#form_frm_materiels
input[type="email"],

#form_frm_materiels
input[type="tel"],

#form_frm_materiels
input[type="number"],

#form_frm_materiels
select,

#form_frm_materiels
textarea {
    box-sizing: border-box;

    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;

    border: 1px solid #d5dde8;
    border-radius: 7px;

    background: #f6f8fb;

    box-shadow: none;

    color: #182235;

    font-size: 13px;
    line-height: 1.35;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}


#form_frm_materiels
input[type="text"],

#form_frm_materiels
input[type="email"],

#form_frm_materiels
input[type="tel"],

#form_frm_materiels
input[type="number"],

#form_frm_materiels
select {
    min-height: 39px;

    padding: 8px 11px;
}


/* Focus */
#form_frm_materiels
input:focus,

#form_frm_materiels
select:focus,

#form_frm_materiels
textarea:focus {
    outline: none;

    border-color: #8bb4ff;

    background: #fff;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, .10);
}


/* ==========================================================
   DROPZONE PHOTO
   ========================================================== */

#form_frm_materiels
.frm_dropzone {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 118px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 1px dashed #cbd5e1 !important;
    border-radius: 8px !important;

    background: #f8fafc !important;

    box-shadow: none !important;

    transition:
        border-color .15s ease,
        background-color .15s ease;
}

#form_frm_materiels
.frm_dropzone:hover {
    border-color: #9db7dc !important;

    background: #f5f9ff !important;
}


#form_frm_materiels
.frm_dropzone .dz-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 6px;

    width: 100%;

    margin: 0 !important;
    padding: 16px !important;

    text-align: center;
}


/* Icône upload */
#form_frm_materiels
.frm_dropzone
.frm-svg-icon {
    width: 22px;
    height: 22px;

    fill: #7d8ca3;
}


/* Boutons texte upload */
#form_frm_materiels
.frm_upload_text button,

#form_frm_materiels
.frm_compact_text button {
    padding: 0;

    border: 0;

    background: transparent;

    color: #3978ed;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}


/* Taille max */
#form_frm_materiels
.frm_small_text {
    color: #98a2b3;

    font-size: 10px;
    line-height: 1.3;
}

#form_frm_materiels
.frm_small_text p {
    margin: 0 !important;
}


/* ==========================================================
   TYPE
   ========================================================== */

#form_frm_materiels
#frm_field_217_container {
    align-self: start;
}


/* ==========================================================
   SUBMIT
   ========================================================== */

#form_frm_materiels
.frm_fields_container > .frm_submit {
    grid-column: 1 / -1 !important;

    display: flex !important;
    justify-content: flex-end !important;

    width: 100% !important;

    margin: 4px 0 0 !important;
    padding: 18px 0 0 !important;

    border-top: 1px solid #e1e6ee;
}


#form_frm_materiels
.frm_button_submit {
    min-height: 40px;

    padding: 9px 18px;

    border: 1px solid #3478f6;
    border-radius: 7px;

    background: #3b82f6;

    box-shadow: none;

    color: #fff;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        transform .1s ease;
}

#form_frm_materiels
.frm_button_submit:hover {
    border-color: #2563eb;

    background: #2563eb;
}

#form_frm_materiels
.frm_button_submit:active {
    transform: translateY(1px);
}


/* ==========================================================
   ERREURS
   ========================================================== */

#form_frm_materiels
.frm_error {
    margin-top: 5px;

    color: #dc2626;

    font-size: 11px;
    line-height: 1.35;
}

#form_frm_materiels
.frm_blank_field input,

#form_frm_materiels
.frm_blank_field select {
    border-color: #efaaaa;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 650px) {

    .modal-content:has(#form_frm_materiels)
    .modal-body {
        padding: 16px;
    }


    #form_frm_materiels
    .frm_fields_container {
        grid-template-columns: 1fr !important;
    }


    #form_frm_materiels
    #frm_field_214_container,

    #form_frm_materiels
    #frm_field_215_container,

    #form_frm_materiels
    #frm_field_216_container,

    #form_frm_materiels
    #frm_field_217_container,

    #form_frm_materiels
    .frm_fields_container > .frm_submit {
        grid-column: 1 !important;
    }
}


/* ==========================================================
   MODAL CLIENT — ÉCHANGES
   ========================================================== */


/*
 * La carte Échanges occupe toute la largeur
 * de la grille principale de la fiche client.
 */
.crm-client-sheet
.crm-client-page-card--echanges {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}


/*
 * Harmonisation de la carte avec les .crm-card
 * utilisées dans la modal.
 */
.crm-client-sheet
.crm-client-page-card--echanges {
    border: 1px solid var(--crm-border-color, #d9e1ec);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}


/*
 * Header de la carte.
 */
.crm-client-sheet
.crm-client-page-card--echanges
.crm-client-page-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 14px 16px;
    border-bottom: 1px solid var(--crm-border-color, #d9e1ec);
}


/*
 * Titre + description.
 */
.crm-client-sheet
.crm-client-page-card--echanges
.crm-client-page-card-heading {
    min-width: 0;
}


.crm-client-sheet
.crm-client-page-card--echanges
.crm-client-page-card-title {
    margin: 0 0 3px;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .02em;
}


.crm-client-sheet
.crm-client-page-card--echanges
.crm-client-page-card-description {
    margin: 0;

    font-size: 12px;
    line-height: 1.35;
    color: var(--crm-text-muted, #8390a5);
}


/*
 * Bouton "Gérer les échanges".
 */

.crm-client-sheet
.crm-client-echanges-manage {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 0;
    min-height: 0;

    border: 0;
    background: transparent;

    color: #344054;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;

    text-decoration: none;
    white-space: nowrap;

    transition: color 0.15s ease;
}

.crm-client-sheet
.crm-client-echanges-manage:hover,
.crm-client-sheet
.crm-client-echanges-manage:focus {
    color: #1f5fbf;
    text-decoration: none;
}

.crm-client-sheet
.crm-client-echanges-manage-icon {
    color: #8291a6;
    font-size: 13px;
    line-height: 1;
}


/*
 * Corps de la carte.
 */
.crm-client-sheet
.crm-client-page-card--echanges
.crm-client-page-card-body {
    padding: 14px;
}


/*
 * On affiche les prochains échanges sur plusieurs colonnes
 * lorsque la largeur de la modal le permet.
 */
.crm-client-sheet
.crm-client-echanges-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}


/*
 * Chaque échange remplit sa cellule.
 */
.crm-client-sheet
.crm-client-page-echange-item {
    min-width: 0;
    height: 100%;
}


/*
 * Header interne de l'échange :
 * titre puis date/heure.
 */
.crm-client-sheet
.crm-client-page-echange-item
.crm-client-page-related-header {
    padding: 12px;
}


.crm-client-sheet
.crm-client-page-echange-item
.crm-client-page-related-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 12px;
}


/*
 * Résumé.
 */
.crm-client-sheet
.crm-client-page-echange-item
.crm-client-page-related-content {
    padding: 11px 12px;
}


/*
 * Évite les marges de paragraphe inutiles.
 */
.crm-client-sheet
.crm-client-page-related-notes p {
    margin-top: 0;
}


.crm-client-sheet
.crm-client-page-related-notes p:last-child {
    margin-bottom: 0;
}


/* ==========================================================
   ÉCHANGE DU JOUR
   ========================================================== */

.crm-client-sheet
.crm-client-page-echange-item--today {
    border-color: #b9dfc2;
    background: #f2faf4;
}


.crm-client-sheet
.crm-client-page-echange-item--today
.crm-client-page-related-header {
    background: #edf8f0;
}


.crm-client-sheet
.crm-client-page-echange-item--today
.crm-client-page-echange-date {
    color: #287a3e;
    font-weight: 700;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */


@media (max-width: 650px) {

    .crm-client-sheet
    .crm-client-page-card--echanges
    .crm-client-page-card-header {
        align-items: flex-start;
        flex-direction: column;
    }


    .crm-client-sheet
    .crm-client-echanges-list {
        grid-template-columns: 1fr;
    }


    .crm-client-sheet
    .crm-client-echanges-manage {
        width: 100%;
    }
}