/* =====================================================================
   Systeme de Gestion Menuiserie — Design System ATHOMES
   Navy #1a2b4a · Or #f5a500
   ===================================================================== */

:root {
    --sgm-navy: #1a2b4a;
    --sgm-navy-700: #16243f;
    --sgm-navy-900: #101a2e;
    --sgm-navy-050: #eef1f6;
    --sgm-or: #f5a500;
    --sgm-or-600: #d99200;
    --sgm-or-050: #fff6e3;
    --sgm-gris: #6b7280;
    --sgm-fond: #f4f6f9;
    --sgm-bordure: #e2e6ed;
    --sgm-rayon: .5rem;
    --sgm-barre: 252px;

    --bs-primary: #1a2b4a;
    --bs-primary-rgb: 26, 43, 74;
    --bs-link-color: #1a2b4a;
    --bs-link-hover-color: #f5a500;
    --bs-body-bg: var(--sgm-fond);
    --bs-body-color: #232a35;
    --bs-border-color: var(--sgm-bordure);
    --bs-font-sans-serif: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--sgm-fond);
    font-size: .9375rem;
}

/* ---------- Utilitaires de marque ---------- */
.text-navy { color: var(--sgm-navy) !important; }
.text-or { color: var(--sgm-or-600) !important; }
.bg-navy { background-color: var(--sgm-navy) !important; }
.bg-or { background-color: var(--sgm-or) !important; }
.bg-or-clair { background-color: var(--sgm-or-050) !important; }

.btn-navy { background-color: var(--sgm-navy); border-color: var(--sgm-navy); color: #fff; }
.btn-navy:hover, .btn-navy:focus { background-color: var(--sgm-navy-700); border-color: var(--sgm-navy-700); color: #fff; }
.btn-or { background-color: var(--sgm-or); border-color: var(--sgm-or); color: var(--sgm-navy-900); font-weight: 600; }
.btn-or:hover, .btn-or:focus { background-color: var(--sgm-or-600); border-color: var(--sgm-or-600); color: #fff; }
.btn-outline-navy { border-color: var(--sgm-navy); color: var(--sgm-navy); }
.btn-outline-navy:hover { background-color: var(--sgm-navy); color: #fff; }

/* Gamme technique (estimations d'atelier) — correctif du 14/10/2026 : la
   reponse choisie doit se voir. Bootstrap colore un bouton radio coche par ses
   variables --bs-btn-active-*, que .btn-outline-navy ne definit pas : Oui et
   Non coches restaient identiques aux boutons libres. */
.sgm-gamme-choix .btn-check:checked + .btn-outline-navy {
    background-color: var(--sgm-navy);
    border-color: var(--sgm-navy);
    color: #fff;
    font-weight: 600;
}
.sgm-gamme-choix .btn-check:focus-visible + .btn-outline-navy { box-shadow: 0 0 0 .2rem rgba(26, 43, 74, .35); }
.sgm-gamme-choix .btn-check:disabled + .btn-outline-navy { opacity: .65; }

/* ---------- Ossature ---------- */
.sgm-shell { min-height: 100vh; }

.sgm-barre {
    width: var(--sgm-barre);
    background: linear-gradient(180deg, var(--sgm-navy) 0%, var(--sgm-navy-900) 100%);
    color: #cfd6e4;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .2s ease;
}

.sgm-barre__marque {
    padding: 1.25rem 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sgm-barre__marque img { width: 148px; height: auto; display: block; }
.sgm-barre__marque span {
    display: block;
    margin-top: .55rem;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sgm-or);
    font-weight: 600;
}

.sgm-nav { padding: .85rem .7rem; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sgm-nav__titre {
    font-size: .66rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #7d8aa3;
    padding: 1rem .55rem .4rem;
    font-weight: 700;
}
.sgm-nav__lien {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem .6rem;
    border-radius: var(--sgm-rayon);
    color: #cfd6e4;
    text-decoration: none;
    font-size: .875rem;
    margin-bottom: .12rem;
    border-left: 3px solid transparent;
}
.sgm-nav__lien i { font-size: 1rem; width: 1.1rem; text-align: center; color: #8fa0bd; }
.sgm-nav__lien:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sgm-nav__lien:hover i { color: var(--sgm-or); }
.sgm-nav__lien.actif {
    background: rgba(245, 165, 0, .14);
    color: #fff;
    border-left-color: var(--sgm-or);
    font-weight: 600;
}
.sgm-nav__lien.actif i { color: var(--sgm-or); }
.sgm-nav__lien.desactive { opacity: .42; pointer-events: none; }
.sgm-nav__badge {
    margin-left: auto;
    font-size: .6rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .1);
    padding: .1rem .38rem;
    border-radius: 999px;
    color: #a9b6cc;
}

.sgm-barre__pied {
    padding: .8rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .7rem;
    color: #7d8aa3;
}

.sgm-principal { margin-left: var(--sgm-barre); min-width: 0; }

.sgm-entete {
    background: #fff;
    border-bottom: 1px solid var(--sgm-bordure);
    padding: .7rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.sgm-entete h1 { font-size: 1.12rem; font-weight: 700; color: var(--sgm-navy); margin: 0; }
.sgm-entete .sgm-fil { font-size: .76rem; color: var(--sgm-gris); }

.sgm-contenu { padding: 1.5rem; }

.sgm-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--sgm-navy);
    color: var(--sgm-or);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
}

/* ---------- Cartes ---------- */
.card { border: 1px solid var(--sgm-bordure); border-radius: var(--sgm-rayon); box-shadow: 0 1px 2px rgba(16, 26, 46, .04); }
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--sgm-bordure);
    font-weight: 600;
    color: var(--sgm-navy);
    padding: .8rem 1.1rem;
}
.card-body { padding: 1.1rem; }

.sgm-stat { border-left: 3px solid var(--sgm-or); }
.sgm-stat__valeur { font-size: 1.65rem; font-weight: 700; color: var(--sgm-navy); line-height: 1.1; }
.sgm-stat__libelle { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--sgm-gris); font-weight: 600; }

/* ---------- Tableaux ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
    background: var(--sgm-navy-050);
    color: var(--sgm-navy);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--sgm-bordure);
    white-space: nowrap;
}
.table > tbody td { vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background-color: #f8fafc; }

/* ---------- Formulaires ---------- */
.form-label { font-weight: 600; font-size: .82rem; color: #3a4353; margin-bottom: .3rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--sgm-navy);
    box-shadow: 0 0 0 .2rem rgba(26, 43, 74, .12);
}
.form-check-input:checked { background-color: var(--sgm-navy); border-color: var(--sgm-navy); }
.form-text { font-size: .78rem; }
.sgm-obligatoire::after { content: " *"; color: #c0392b; }

/* ---------- Etats de ratification ---------- */
.sgm-a-ratifier { background: var(--sgm-or-050) !important; }
.badge-ratifie { background: #e7f4ec; color: #1d6f42; font-weight: 600; }
.badge-a-ratifier { background: var(--sgm-or-050); color: #8a5b00; font-weight: 600; }

/* ---------- Divers ---------- */
.sgm-vide { text-align: center; padding: 2.5rem 1rem; color: var(--sgm-gris); }
.sgm-vide i { font-size: 2.2rem; color: #c3cbd9; display: block; margin-bottom: .6rem; }

.sgm-diff { font-family: "Cascadia Mono", Consolas, monospace; font-size: .78rem; white-space: pre-wrap; word-break: break-word; }

.page-item.active .page-link { background-color: var(--sgm-navy); border-color: var(--sgm-navy); }
.page-link { color: var(--sgm-navy); }

/* ---------- Connexion ---------- */
.sgm-connexion {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sgm-navy) 0%, var(--sgm-navy-900) 65%, #0b1220 100%);
    padding: 1.5rem;
}
.sgm-connexion__carte {
    width: 100%;
    max-width: 410px;
    background: #fff;
    border-radius: .85rem;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .35);
    overflow: hidden;
}
.sgm-connexion__entete { padding: 2rem 2rem 1.2rem; text-align: center; }
.sgm-connexion__entete img { width: 180px; height: auto; }
.sgm-connexion__entete p {
    margin: .85rem 0 0;
    font-size: .74rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--sgm-gris);
    font-weight: 600;
}
.sgm-connexion__corps { padding: 0 2rem 2rem; }
.sgm-connexion__pied {
    background: var(--sgm-navy-050);
    padding: .8rem 2rem;
    font-size: .74rem;
    color: var(--sgm-gris);
    text-align: center;
}

/* ---------- Responsive : tablette atelier ---------- */
.sgm-voile { display: none; }

@media (max-width: 991.98px) {
    .sgm-barre { transform: translateX(-100%); }
    .sgm-barre.ouverte { transform: translateX(0); }
    .sgm-principal { margin-left: 0; }
    .sgm-voile.visible {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(16, 26, 46, .45);
        z-index: 1035;
    }
    .sgm-contenu { padding: 1rem; }
}

@media (max-width: 575.98px) {
    .sgm-entete { padding: .6rem 1rem; }
}

@media print {
    .sgm-barre, .sgm-entete, .sgm-no-print { display: none !important; }
    .sgm-principal { margin-left: 0; }
    body { background: #fff; }
}

/* ---------- Alignements Bootstrap sur la marque ---------- */
.list-group {
    --bs-list-group-active-bg: var(--sgm-navy);
    --bs-list-group-active-border-color: var(--sgm-navy);
    --bs-list-group-action-hover-bg: var(--sgm-navy-050);
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--sgm-navy); }
.form-switch .form-check-input:checked { background-color: var(--sgm-navy); border-color: var(--sgm-navy); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--sgm-navy); font-size: .9rem; }
.badge.bg-navy { color: #fff; }
.alert { border-radius: var(--sgm-rayon); }


/* =====================================================================
   Graphiques de pilotage — SVG servi par l'application, sans librairie
   externe : l'application doit rester utilisable hors ligne.
   ===================================================================== */
.sgm-graphique { margin: 0; }
.sgm-graphique svg { width: 100%; height: auto; display: block; }
.sgm-graphique--anneau svg { width: 140px; flex: 0 0 auto; }

.sgm-graphique__titre {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sgm-gris);
    margin-bottom: .5rem;
}

.sgm-graphique__grille { stroke: #e7ebf1; stroke-width: 1; }
.sgm-graphique__axe { stroke: #cdd4de; stroke-width: 1; }
.sgm-graphique__graduation { font-size: 9px; fill: #8a95a5; }
.sgm-graphique__label { font-size: 9.5px; fill: #6b7280; }
.sgm-graphique__aire { opacity: .12; }
.sgm-graphique__centre { font-size: 15px; font-weight: 700; fill: var(--sgm-navy); }

.sgm-graphique__legende {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    margin-top: .5rem;
    font-size: .78rem;
    color: var(--sgm-gris);
}
.sgm-graphique__legende i,
.sgm-graphique__liste i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: .4rem;
    vertical-align: -1px;
}

.sgm-graphique__liste {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 200px;
    min-width: 180px;
    font-size: .82rem;
}
.sgm-graphique__liste li {
    display: flex;
    align-items: center;
    padding: .25rem 0;
    border-bottom: 1px solid var(--sgm-bordure);
}
.sgm-graphique__liste li:last-child { border-bottom: 0; }

/* Barre de progression compacte utilisee dans les tableaux de pilotage. */
.sgm-jauge {
    height: 6px;
    border-radius: 3px;
    background: #e7ebf1;
    overflow: hidden;
}
.sgm-jauge span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--sgm-navy);
}
.sgm-jauge--or span { background: var(--sgm-or); }
.sgm-jauge--danger span { background: #dc3545; }

/* =====================================================================
   Documents officiels A4 — maquette unique
   Devis, confirmation de commande, facture, bon de livraison,
   bon de commande fournisseur, recu, fiche de travail, bulletin.
   Toute piece imprimee du systeme passe par layouts/document.blade.php.
   ===================================================================== */

.doc-barre {
    background: var(--sgm-navy);
    padding: .6rem 1rem;
    display: flex;
    gap: .5rem;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
.doc-barre .doc-titre { color: #fff; font-weight: 600; font-size: .9rem; margin-right: auto; }

.doc-page {
    width: 210mm;
    min-height: 297mm;
    margin: 1.2rem auto;
    padding: 13mm 14mm 20mm;
    background: #fff;
    box-shadow: 0 2px 14px rgba(16, 26, 46, .14);
    color: #1f2733;
    font-size: 10pt;
    line-height: 1.45;
    position: relative;
}

/* ---------- En-tete ---------- */
.doc-entete {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10mm;
    padding-bottom: 5mm;
    border-bottom: 2.5pt solid var(--sgm-or);
}
.doc-marque { max-width: 108mm; }
.doc-marque img { width: 42mm; height: auto; display: block; }
.doc-slogan {
    margin-top: 2mm;
    font-size: 8.2pt;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sgm-or-600);
}
.doc-coordonnees { margin-top: 1.6mm; font-size: 8.2pt; color: #5b6675; line-height: 1.55; }
.doc-coordonnees .doc-legal { color: #7d8796; }

.doc-piece { text-align: right; min-width: 62mm; }
.doc-piece h1 {
    font-size: 19pt;
    font-weight: 700;
    color: var(--sgm-navy);
    margin: 0;
    letter-spacing: .04em;
    line-height: 1.1;
}
.doc-piece .doc-numero {
    font-size: 11pt;
    font-weight: 700;
    color: var(--sgm-or-600);
    letter-spacing: .02em;
    margin-top: .8mm;
}
table.doc-meta { margin-top: 3mm; margin-left: auto; border-collapse: collapse; font-size: 8.4pt; }
table.doc-meta th,
table.doc-meta td { padding: 1.1mm 2.4mm; border-bottom: 1px solid #eceff4; }
table.doc-meta th {
    text-align: left;
    font-weight: 600;
    color: #7d8796;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 7.4pt;
}
table.doc-meta td { text-align: right; font-weight: 600; color: var(--sgm-navy); white-space: nowrap; }
table.doc-meta tr:last-child th,
table.doc-meta tr:last-child td { border-bottom: 0; }

/* ---------- Parties ---------- */
.doc-parties { display: flex; gap: 6mm; margin-top: 6mm; }
.doc-partie {
    flex: 1 1 0;
    padding: 3.4mm 4mm;
    background: #f7f9fc;
    border-left: 2.5pt solid #d6dbe4;
    min-width: 0;
}
.doc-partie--client { border-left-color: var(--sgm-navy); background: #f2f5fa; }
.doc-partie h2 {
    font-size: 7.4pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7d8796;
    margin: 0 0 1.6mm;
}
.doc-partie .doc-nom { font-size: 10.5pt; font-weight: 700; color: var(--sgm-navy); line-height: 1.25; }
.doc-partie p { margin: 1.2mm 0 0; font-size: 8.6pt; color: #4c5666; line-height: 1.5; }

/* ---------- Objet ---------- */
.doc-objet {
    margin-top: 5mm;
    padding: 2.4mm 4mm;
    background: var(--sgm-or-050);
    border-left: 2.5pt solid var(--sgm-or);
    font-size: 9pt;
    color: #3b4453;
}
.doc-objet strong { color: var(--sgm-navy); }

/* ---------- Tableau des lignes ---------- */
table.doc-table { width: 100%; border-collapse: collapse; margin-top: 5mm; }
table.doc-table thead th {
    background: var(--sgm-navy);
    color: #fff;
    font-size: 7.6pt;
    text-transform: uppercase;
    letter-spacing: .09em;
    padding: 2.4mm 2.6mm;
    text-align: left;
    font-weight: 700;
}
table.doc-table tbody td {
    padding: 2.4mm 2.6mm;
    border-bottom: 1px solid #e6eaf1;
    vertical-align: top;
    font-size: 9pt;
}
table.doc-table tbody tr:nth-child(even) td { background: #fafbfd; }
table.doc-table .num { text-align: right; white-space: nowrap; }
table.doc-table .doc-sous { font-size: 8pt; color: #7d8796; display: block; margin-top: .6mm; }
table.doc-table tfoot td { padding: 2.2mm 2.6mm; font-size: 9pt; font-weight: 700; color: var(--sgm-navy); }

/* ---------- Conditions et totaux, cote a cote ---------- */
.doc-bas { display: flex; gap: 6mm; align-items: flex-start; margin-top: 6mm; }
.doc-conditions { flex: 1 1 0; min-width: 0; }
.doc-conditions h3,
.doc-mentions h3 {
    font-size: 7.4pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7d8796;
    margin: 0 0 1.8mm;
    padding-bottom: 1.2mm;
    border-bottom: 1px solid #e6eaf1;
}
.doc-conditions p { margin: 0 0 1.2mm; font-size: 8.4pt; color: #4c5666; line-height: 1.5; }
.doc-conditions p:last-child { margin-bottom: 0; }

.doc-totaux { flex: 0 0 84mm; }
.doc-totaux table { width: 100%; border-collapse: collapse; }
.doc-totaux td { padding: 1.9mm 3mm; font-size: 9.2pt; border-bottom: 1px solid #eceff4; }
.doc-totaux td.lib { color: #5b6675; }
.doc-totaux td.val { text-align: right; white-space: nowrap; font-weight: 700; color: var(--sgm-navy); }
.doc-totaux tr.doc-ttc td {
    background: var(--sgm-navy);
    color: #fff;
    font-size: 10.5pt;
    font-weight: 700;
    border-bottom: 0;
}
.doc-totaux tr.doc-ttc td.lib { color: #fff; text-transform: uppercase; letter-spacing: .06em; font-size: 8.6pt; }
.doc-totaux tr.doc-remise td { color: #b3541e; }
.doc-totaux tr.doc-echeance td { background: var(--sgm-or-050); }
.doc-totaux tr.doc-echeance td.lib { color: #6b5a2c; }

/* ---------- Mentions pleine largeur ---------- */
.doc-mentions { margin-top: 6mm; font-size: 8.4pt; color: #4c5666; }
.doc-mentions p { margin: 0 0 1.2mm; line-height: 1.5; }

/* ---------- Signatures ---------- */
.doc-signature { display: flex; gap: 6mm; margin-top: 8mm; page-break-inside: avoid; }
.doc-signature > div { flex: 1 1 0; border: 1px solid #dfe4ec; padding: 3mm 4mm; min-height: 30mm; }
.doc-signature h3 {
    font-size: 7.4pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7d8796;
    margin: 0 0 1.8mm;
}
.doc-signature .doc-instruction { font-size: 8pt; color: #7d8796; line-height: 1.45; }
.doc-signature .doc-signataire { font-size: 10pt; font-weight: 700; color: var(--sgm-navy); margin-top: 1.6mm; }
.doc-signature .doc-fonction { font-size: 8.2pt; color: #5b6675; }
.doc-signature .doc-horodatage { font-size: 7.6pt; color: #8a95a5; margin-top: 1.2mm; font-style: italic; }

/* ---------- Encarts ---------- */
.doc-alerte {
    background: var(--sgm-or-050);
    border-left: 2.5pt solid var(--sgm-or);
    padding: 2.6mm 4mm;
    font-size: 8.6pt;
    color: #5c4d24;
    margin-top: 5mm;
}
.doc-encart {
    background: #f7f9fc;
    border: 1px solid #e6eaf1;
    padding: 3mm 4mm;
    font-size: 8.6pt;
    margin-top: 5mm;
}
.doc-encart h3 {
    font-size: 7.4pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7d8796;
    margin: 0 0 1.6mm;
}

/* ---------- Pied de page ---------- */
.doc-pied {
    position: absolute;
    left: 14mm; right: 14mm; bottom: 9mm;
    border-top: 1px solid #e6eaf1;
    padding-top: 2.2mm;
    font-size: 7.4pt;
    color: #8a95a5;
    display: flex;
    justify-content: space-between;
    gap: 4mm;
}
.doc-pied .doc-pied-centre { text-align: center; flex: 1 1 auto; }
.doc-pied .doc-pied-droite { white-space: nowrap; }

/* Cadre d'impression : invisible a l'ecran. Son <tfoot> porte la bande que le
   pied de page occupe sur chaque feuille imprimee — un navigateur repete le
   pied d'un tableau sur toutes les pages, et lui garde sa place. */
/* table-layout: fixed — sans lui, la largeur de la cellule suivrait son
   contenu et un long libelle elargirait la page entiere. */
.doc-cadre { width: 100%; table-layout: fixed; border-collapse: collapse; }
.doc-cadre > tbody > tr > td,
.doc-cadre > tfoot > tr > td { padding: 0; border: 0; }
.doc-pied-reserve { height: 0; }

@media print {
    .doc-barre { display: none !important; }
    body { background: #fff !important; }

    /* Les marges appartiennent a la PAGE, pas au bloc qui s'ecoule.
       Jusqu'au 26/09/2026 la page etait sans marge et tout l'espace venait du
       padding de .doc-page. Or un padding ne s'applique qu'une fois : en haut
       de la premiere page, en bas de la derniere. La deuxieme page n'avait
       donc aucune marge haute, et la premiere rien de reserve en bas — le
       pied, fixe, passait par-dessus les totaux.
       La marge basse est plus large que les autres : elle loge le pied. */
    @page { size: A4; margin: 12mm 12mm 10mm; }

    .doc-page {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    /* Le pied doit faire deux choses a la fois : se repeter en bas de chaque
       page, et y reserver sa bande.
       Un element `position: fixed` se repete, mais ne reserve rien — le
       contenu lui passait dessous, et les totaux se retrouvaient barres.
       Un vrai <tfoot>, lui, reserve sa place sur chaque feuille : la ligne
       vide .doc-pied-reserve creuse la bande, le pied fixe vient s'y poser. */
    .doc-pied-reserve { height: 10mm; }
    .doc-pied { position: fixed; left: 0; right: 0; bottom: 0; }

    table.doc-table thead { display: table-header-group; }
    table.doc-table tr { page-break-inside: avoid; }

    /* Une rupture de page entre un total et sa derniere ligne se lit mal. */
    .doc-totaux, .doc-signatures { page-break-inside: avoid; }
}


.doc-nom-societe { font-size: 15pt; font-weight: 700; color: var(--sgm-navy); letter-spacing: .02em; }

/* Bouton « Retour » de l'en-tete : discret, mais toujours a la meme place. */
.sgm-retour { white-space: nowrap; flex-shrink: 0; }
.sgm-retour:hover { background-color: var(--sgm-navy); border-color: var(--sgm-navy); color: #fff; }

/* =====================================================================
   Sélecteur d'article à complétion
   Remplace une liste déroulante devenue illisible par une recherche.
   ===================================================================== */
.sgm-completion__zone { position: relative; display: flex; flex-direction: column; gap: .35rem; }
.sgm-completion__famille { max-width: 100%; }

/* `fixed`, et non `absolute` : la carte Bootstrap qui entoure le selecteur
   porte `overflow: clip` et coupait net la liste des propositions. Elle
   s'ouvrait, portait les bonnes references, et restait invisible.
   Les coordonnees sont posees par le script (Completion.prototype.placer). */
.sgm-completion__liste {
    position: fixed;
    z-index: 1055;
    margin: 0;
    padding: .25rem;
    list-style: none;
    max-height: 22rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--sgm-bordure);
    border-radius: var(--sgm-rayon);
    box-shadow: 0 8px 24px rgba(16, 26, 46, .16);
}

.sgm-completion__option {
    padding: .4rem .55rem;
    border-radius: calc(var(--sgm-rayon) - .2rem);
    cursor: pointer;
    line-height: 1.35;
}
.sgm-completion__option:hover,
.sgm-completion__option.actif { background: var(--sgm-navy-050); }
.sgm-completion__option.actif { box-shadow: inset 2px 0 0 var(--sgm-or); }

.sgm-completion__titre { display: flex; align-items: baseline; gap: .5rem; font-size: .875rem; }
.sgm-completion__titre code { color: var(--sgm-or-600); font-size: .78rem; flex-shrink: 0; }
.sgm-completion__titre span { color: var(--sgm-navy); font-weight: 600; }
.sgm-completion__detail { font-size: .76rem; color: var(--sgm-gris); margin-top: .1rem; }

.sgm-completion__alerte {
    display: inline-block;
    padding: 0 .35rem;
    border-radius: 2rem;
    background: var(--sgm-or-050);
    color: #8a6100;
    font-weight: 600;
}

.sgm-completion__note {
    padding: .5rem .55rem;
    font-size: .78rem;
    color: var(--sgm-gris);
}

.sgm-completion__choix {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    border: 1px solid var(--sgm-bordure);
    border-left: 3px solid var(--sgm-or);
    border-radius: var(--sgm-rayon);
    background: #fff;
}
.sgm-completion__choix-texte { flex: 1 1 auto; min-width: 0; }
.sgm-completion__choix-texte > div:first-child {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: .875rem;
}
.sgm-completion__choix-reference { color: var(--sgm-or-600); font-size: .78rem; flex-shrink: 0; }
.sgm-completion__choix-designation { color: var(--sgm-navy); }
.sgm-completion__effacer { flex-shrink: 0; font-size: .7rem; }

/* =====================================================================
   Kanban de production
   Une colonne par poste du workflow, un ordre à sa place réelle.
   ===================================================================== */
.sgm-kanban {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .75rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
.sgm-kanban::-webkit-scrollbar { height: 10px; }
.sgm-kanban::-webkit-scrollbar-thumb { background: #c8d0dc; border-radius: 6px; }
.sgm-kanban::-webkit-scrollbar-track { background: #eef1f6; border-radius: 6px; }

.sgm-colonne {
    flex: 0 0 17rem;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #f4f6f9;
    border: 1px solid var(--sgm-bordure);
    border-radius: var(--sgm-rayon);
    max-height: calc(100vh - 15rem);
}
.sgm-colonne--jalon { background: #eef1f6; }

.sgm-colonne__entete {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: .55rem .7rem;
    background: #fff;
    border-bottom: 1px solid var(--sgm-bordure);
    border-radius: var(--sgm-rayon) var(--sgm-rayon) 0 0;
}
.sgm-colonne__titre {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--sgm-navy);
}
.sgm-colonne__machine {
    font-size: .68rem;
    color: var(--sgm-gris);
    margin-top: .1rem;
    line-height: 1.3;
}
.sgm-colonne__compte {
    margin-left: auto;
    min-width: 1.4rem;
    text-align: center;
    padding: 0 .35rem;
    border-radius: 1rem;
    background: var(--sgm-navy-050);
    color: var(--sgm-navy);
    font-size: .72rem;
    font-weight: 700;
}
.sgm-colonne__compte--charge { background: var(--sgm-or); color: #101a2e; }

.sgm-colonne__corps { padding: .5rem; overflow-y: auto; flex: 1 1 auto; min-height: 7rem; }

.sgm-carte {
    display: block;
    background: #fff;
    border: 1px solid var(--sgm-bordure);
    border-left: 3px solid var(--sgm-bordure);
    border-radius: calc(var(--sgm-rayon) - .15rem);
    padding: .5rem .6rem;
    margin-bottom: .5rem;
    text-decoration: none;
    transition: box-shadow .12s ease, transform .12s ease;
}
.sgm-carte:hover { box-shadow: 0 3px 10px rgba(16, 26, 46, .12); transform: translateY(-1px); }
.sgm-carte:last-child { margin-bottom: 0; }

.sgm-carte--en_cours { border-left-color: var(--sgm-navy); }
.sgm-carte--a_faire { border-left-color: var(--sgm-or); }
.sgm-carte--bloquee { border-left-color: #dc3545; background: #fff5f5; }
.sgm-carte--soldee { border-left-color: #198754; }

.sgm-carte__numero { font-size: .82rem; font-weight: 700; color: var(--sgm-navy); }
.sgm-carte__client {
    font-size: .74rem;
    color: var(--sgm-gris);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sgm-carte__ligne {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    color: var(--sgm-gris);
    margin-top: .3rem;
}
.sgm-carte__pastille {
    display: inline-block;
    padding: 0 .35rem;
    border-radius: 1rem;
    font-size: .64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.sgm-carte__pastille--en_cours { background: var(--sgm-navy); color: #fff; }
.sgm-carte__pastille--a_faire { background: var(--sgm-or-050); color: #8a6100; }
.sgm-carte__pastille--bloquee { background: #f8d7da; color: #842029; }

.sgm-carte .progress { height: 4px; margin-top: .4rem; background: #e9edf3; }

.sgm-colonne__vide {
    border: 1px dashed #cfd6e0;
    border-radius: calc(var(--sgm-rayon) - .15rem);
    padding: 1.1rem .5rem;
    text-align: center;
    font-size: .72rem;
    color: #9aa3b1;
}

/* Bandeau de synthèse, au-dessus du tableau */
.sgm-synthese { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.sgm-synthese__item {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    padding: .35rem .7rem;
    background: #fff;
    border: 1px solid var(--sgm-bordure);
    border-radius: 2rem;
    font-size: .78rem;
    color: var(--sgm-gris);
}
.sgm-synthese__item strong { font-size: 1rem; color: var(--sgm-navy); }
.sgm-synthese__item--alerte { border-color: #f1aeb5; background: #fff5f5; }
.sgm-synthese__item--alerte strong { color: #b02a37; }
.sgm-synthese__item--charge { border-color: var(--sgm-or); background: var(--sgm-or-050); }
.sgm-synthese__item--charge strong { color: #8a6100; }

/* =====================================================================
   Parc et moyens généraux
   Fiche d'un bien, avec ses échéances en pastilles colorées.
   ===================================================================== */
.sgm-parc__carte {
    border: 1px solid var(--sgm-bordure);
    border-left: 4px solid var(--sgm-bordure);
    border-radius: var(--sgm-rayon);
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.sgm-parc__carte--danger { border-left-color: #dc3545; }
.sgm-parc__carte--warning { border-left-color: var(--sgm-or); }
.sgm-parc__carte--success { border-left-color: #198754; }

.sgm-parc__entete { padding: .85rem 1rem .4rem; }
.sgm-parc__titre { font-size: 1.15rem; color: var(--sgm-navy); line-height: 1.25; }
.sgm-parc__titre strong { font-weight: 700; }
.sgm-parc__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--sgm-gris);
}
.sgm-parc__meta span { display: inline-flex; align-items: center; gap: .3rem; }

.sgm-parc__echeances { padding: .25rem 1rem .85rem; display: flex; flex-direction: column; gap: .3rem; }
.sgm-parc__echeance {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    padding: .22rem .6rem;
    border-radius: .35rem;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
}
.sgm-parc__echeance--danger { background: #dc3545; }
.sgm-parc__echeance--warning { background: #e0a800; color: #3d2f00; }
.sgm-parc__echeance--success { background: #198754; }
.sgm-parc__echeance--secondary { background: #6c757d; }

.sgm-parc__pied {
    margin-top: auto;
    border-top: 1px solid var(--sgm-bordure);
    padding: .5rem 1rem;
    display: flex;
    gap: .4rem;
    justify-content: flex-end;
}

/* ------------------------------------------------------------------
   Cartouches du tableau de bord

   Un cartouche par metier, tous batis sur le modele du pilotage
   Direction : bandeau de chiffres, graphique, liste actionnable. Le
   titre de rubrique separe les metiers sans alourdir la page — c'est
   un intertitre, pas une carte de plus.
   ------------------------------------------------------------------ */
.sgm-cartouche { margin-bottom: 2rem; }
.sgm-cartouche:last-child { margin-bottom: .5rem; }

.sgm-cartouche__titre {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .85rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--sgm-or);
}
.sgm-cartouche__titre h2 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--sgm-navy);
    margin: 0;
    letter-spacing: .01em;
}
.sgm-cartouche__titre > i { color: var(--sgm-or); font-size: 1.1rem; }

.sgm-cartouche__lien {
    margin-left: auto;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--sgm-navy);
    white-space: nowrap;
}
.sgm-cartouche__lien:hover { color: var(--sgm-or); }

/* =====================================================================
   Production UI baseline — inherited by every Laravel/Bootstrap surface.
   The precision grid borrows from workshop plans; it stays intentionally
   quiet so dense operational information keeps the visual priority.
   ===================================================================== */
:root {
    --sgm-focus: #b97000;
    --sgm-succes: #167248;
    --sgm-danger: #b42318;
    --sgm-ombre: 0 10px 28px rgba(16, 26, 46, .08);
}
body { line-height: 1.5; }
.sgm-contenu {
    min-height: calc(100dvh - 72px);
    background-image: linear-gradient(rgba(26, 43, 74, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 43, 74, .025) 1px, transparent 1px);
    background-size: 24px 24px;
}
::selection { background: #ffe0a0; color: var(--sgm-navy-900); }
:focus-visible { outline: 3px solid rgba(185, 112, 0, .55); outline-offset: 2px; }

* { scrollbar-width: thin; scrollbar-color: #8d9ab0 #eef1f6; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: #eef1f6; }
*::-webkit-scrollbar-thumb { background: #8d9ab0; border: 3px solid #eef1f6; border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: #56647b; }
@media (forced-colors: active) { * { scrollbar-color: auto; } }

.sgm-lien-evasion {
    position: fixed; left: 1rem; top: .75rem; z-index: 1100;
    transform: translateY(-160%); background: #fff; color: var(--sgm-navy);
    border: 2px solid var(--sgm-or); border-radius: var(--sgm-rayon); padding: .45rem .7rem;
    font-weight: 700; text-decoration: none;
}
.sgm-lien-evasion:focus { transform: translateY(0); }
.btn { --bs-btn-border-radius: .42rem; font-weight: 650; min-height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; }
.btn-sm { min-height: 1.95rem; }
.sgm-nav { overflow-x: hidden; scrollbar-gutter: stable; }
.sgm-nav__lien:hover, .sgm-nav__lien:focus-visible { background: rgba(255, 255, 255, .10); color: #fff; }
.sgm-entete h1 { font-weight: 750; letter-spacing: -.015em; }
.card { overflow: clip; }
.table > tbody td { padding-top: .72rem; padding-bottom: .72rem; }
.table-responsive { scrollbar-gutter: stable; }
.form-control, .form-select { border-color: #c9d1dd; min-height: 2.45rem; }
textarea.form-control { resize: none; min-height: 5.5rem; }
.alert[role="alert"] { border-left-width: 4px; }
.modal-content { border: 0; border-radius: .75rem; box-shadow: var(--sgm-ombre); }
.modal-header { border-bottom-color: var(--sgm-bordure); padding: 1.15rem 1.25rem; }
.modal-footer { border-top-color: var(--sgm-bordure); padding: .85rem 1.25rem; }
.sgm-modal__eyebrow { color: var(--sgm-or-600); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .2rem; }
.sgm-est-occupe { pointer-events: none; }
.sgm-dashboard-intro { display: flex; gap: 1rem; align-items: center; margin: 0 0 1.5rem; padding: 1.1rem 1.25rem; background: linear-gradient(110deg, var(--sgm-navy) 0%, #23436d 100%); color: #eef3fb; border-left: 4px solid var(--sgm-or); border-radius: var(--sgm-rayon); box-shadow: var(--sgm-ombre); }
.sgm-dashboard-intro__icone { width: 2.75rem; height: 2.75rem; flex: 0 0 auto; display: grid; place-items: center; background: rgba(245, 165, 0, .16); color: var(--sgm-or); border-radius: 50%; font-size: 1.25rem; }
.sgm-dashboard-intro__titre { margin: 0; color: #fff; font-size: 1rem; font-weight: 750; }
.sgm-dashboard-intro__texte { margin: .2rem 0 0; font-size: .86rem; color: #cfd9e9; }
@media (max-width: 575.98px) { .sgm-contenu { padding: 1rem; } .sgm-dashboard-intro { align-items: flex-start; padding: 1rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }


/* ==========================================================================
   Messagerie interne — lot CHAT-03
   Deux volets (liste + conversation) ; un seul volet sous 768 px.
   Texte seul : aucune piece jointe. Couleurs et rayons du systeme existant.
   ========================================================================== */
.sgm-messagerie {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: calc(100vh - 72px - 3rem);
    height: calc(100dvh - 72px - 3rem);
    min-height: 26rem;
    background: #fff;
    border: 1px solid var(--sgm-bordure);
    border-radius: var(--sgm-rayon);
    overflow: hidden;
}
.sgm-messagerie__liste { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--sgm-bordure); }
.sgm-messagerie__outils { padding: .75rem; border-bottom: 1px solid var(--sgm-bordure); }
.sgm-messagerie__titre { margin: 0; font-size: 1rem; font-weight: 650; color: var(--sgm-navy); }
.sgm-messagerie__souple { min-width: 0; }
.sgm-messagerie__conversations { position: relative; flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; }

.sgm-msg-conv {
    display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 44px;
    padding: .7rem .85rem; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--sgm-bordure);
    background: #fff; color: inherit; text-align: left;
}
.sgm-msg-conv:hover { background: var(--sgm-fond); }
.sgm-msg-conv:focus-visible { outline: 3px solid rgba(185, 112, 0, .55); outline-offset: -3px; }
.sgm-msg-conv[aria-current="true"] { background: #eef2f8; border-left-color: var(--sgm-or); }
.sgm-msg-conv__corps { flex: 1; min-width: 0; }
.sgm-msg-conv__nom { overflow: hidden; color: var(--sgm-navy); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.sgm-msg-conv--non-lue .sgm-msg-conv__nom { font-weight: 750; }
.sgm-msg-conv__apercu { overflow: hidden; font-size: .82rem; color: var(--sgm-gris); white-space: nowrap; text-overflow: ellipsis; }
.sgm-msg-conv--non-lue .sgm-msg-conv__apercu { color: #374151; }
.sgm-msg-conv__meta { display: flex; flex-direction: column; flex-shrink: 0; align-items: flex-end; gap: .3rem; font-size: .75rem; color: var(--sgm-gris); }
.sgm-msg-point { width: .6rem; height: .6rem; border-radius: 50%; background: var(--sgm-or); }
.sgm-msg-groupe { background: #e8eef7; color: var(--sgm-navy); }

.sgm-messagerie__fil { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sgm-messagerie__accueil { margin: auto; }
.sgm-messagerie__conversation { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.sgm-messagerie__conversation[hidden] { display: none; }
.sgm-messagerie__entete { display: flex; align-items: center; gap: .65rem; padding: .7rem 1rem; border-bottom: 1px solid var(--sgm-bordure); }
.sgm-messagerie__retour { display: none; }
.sgm-messagerie__messages { position: relative; flex: 1; min-height: 0; padding: 1rem; overflow-y: auto; background: var(--sgm-fond); }

.sgm-msg { max-width: min(36rem, 85%); margin: .35rem 0; }
.sgm-msg--moi { margin-left: auto; }
.sgm-msg__auteur { margin-bottom: .15rem; font-size: .78rem; font-weight: 600; color: var(--sgm-navy); }
.sgm-msg__bulle {
    padding: .5rem .7rem; background: #fff; border: 1px solid var(--sgm-bordure); border-radius: var(--sgm-rayon);
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.sgm-msg--moi .sgm-msg__bulle { background: #e8eef7; border-color: #cfd9ea; }
.sgm-msg__heure { margin-top: .15rem; font-size: .72rem; color: var(--sgm-gris); }
.sgm-msg--moi .sgm-msg__heure { text-align: right; }
.sgm-msg-jour { margin: 1rem 0 .5rem; font-size: .75rem; color: var(--sgm-gris); text-align: center; }
.sgm-msg-nouveaux { display: flex; align-items: center; gap: .5rem; margin: .75rem 0; font-size: .75rem; font-weight: 650; color: #8a6100; }
.sgm-msg-nouveaux::before, .sgm-msg-nouveaux::after { content: ""; flex: 1; border-top: 1px solid var(--sgm-or); }

.sgm-messagerie__saisie { padding: .65rem .85rem; background: #fff; border-top: 1px solid var(--sgm-bordure); }
.sgm-messagerie__saisie[hidden] { display: none; }
.sgm-messagerie__saisie textarea.form-control { min-height: 2.6rem; max-height: 9rem; overflow-y: auto; }

.sgm-messagerie__resultats { max-height: 16rem; margin: 0; padding: 0; overflow-y: auto; }
.sgm-messagerie__resultat {
    display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 44px; padding: .45rem .6rem;
    border: 0; border-bottom: 1px solid var(--sgm-bordure); background: #fff; text-align: left;
}
.sgm-messagerie__resultat:hover { background: var(--sgm-fond); }
.sgm-messagerie__choisis { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.sgm-messagerie__choisi { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .25rem .15rem .55rem; border-radius: 99px; background: #e8eef7; color: var(--sgm-navy); font-size: .82rem; }
.sgm-messagerie__membres li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--sgm-bordure); }

@media (max-width: 991.98px) {
    .sgm-messagerie { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    .sgm-messagerie { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 72px - 2rem); height: calc(100dvh - 72px - 2rem); }
    .sgm-messagerie__fil { display: none; }
    .sgm-messagerie--conversation .sgm-messagerie__liste { display: none; }
    .sgm-messagerie--conversation .sgm-messagerie__fil { display: flex; }
    .sgm-messagerie__retour { display: inline-flex; }
    .sgm-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
    .sgm-messagerie__conversations, .sgm-messagerie__messages { scroll-behavior: auto; }
}

/* =====================================================================
   Navigation compacte de la Direction et pages espace (C7, 02/11/2026)
   ===================================================================== */
.sgm-nav__etiquette {
    font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: .12rem .4rem; border-radius: 999px;
    background: rgba(245, 165, 0, .16); color: var(--sgm-or);
}

.sgm-espace__entete {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 1.25rem 1.4rem; margin-bottom: 1.5rem;
    color: #e3e8f1; /* fond, arrondi et ombre : bloc « Harmonisation visuelle » */
}
.sgm-espace__embleme {
    flex: 0 0 auto; width: 3.4rem; height: 3.4rem; border-radius: 1rem;
    display: grid; place-items: center; font-size: 1.6rem;
    background: rgba(245, 165, 0, .16); color: var(--sgm-or);
}
.sgm-espace__accroche { font-size: 1rem; color: #fff; max-width: 60ch; }
.sgm-espace__reperes { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; font-size: .8rem; color: #b6c1d4; }
.sgm-espace__repere--alerte { color: var(--sgm-or); font-weight: 600; }

.sgm-espace__groupe { margin-bottom: 1.6rem; }
.sgm-espace__titre {
    font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--sgm-gris); margin: 0 0 .7rem; display: flex; align-items: center; gap: .6rem;
}
.sgm-espace__titre::after { content: ""; flex: 1; height: 1px; background: var(--sgm-bordure); }
.sgm-espace__grille { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }

.sgm-tuile {
    position: relative; display: flex; align-items: flex-start; gap: .85rem;
    padding: 1rem 2.2rem 1rem 1rem; min-height: 5.6rem;
    background: #fff; border: 1px solid var(--sgm-bordure); border-radius: var(--sgm-rayon-md);
    color: inherit; text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.sgm-tuile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(16, 26, 46, .10); border-color: #cfd6e2; color: inherit; }
.sgm-tuile:focus-visible { outline: 3px solid var(--sgm-or); outline-offset: 2px; }
.sgm-tuile:active { transform: translateY(0); }
.sgm-tuile__icone {
    flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: .8rem;
    display: grid; place-items: center; font-size: 1.2rem;
    background: var(--sgm-navy-050); color: var(--sgm-navy);
    transition: background-color .15s ease, color .15s ease;
}
.sgm-tuile:hover .sgm-tuile__icone { background: var(--sgm-navy); color: var(--sgm-or); }
.sgm-tuile__corps { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.sgm-tuile__libelle { font-weight: 700; color: var(--sgm-navy); }
.sgm-tuile__description { font-size: .82rem; color: var(--sgm-gris); line-height: 1.35; }
.sgm-tuile__compteur {
    position: absolute; left: 4.6rem; bottom: .55rem;
    font-size: .72rem; padding: .1rem .5rem; border-radius: 999px;
    background: var(--sgm-or-050); color: #7a5600;
}
.sgm-tuile__compteur--alerte { background: #fde8e8; color: #9b1c1c; }
.sgm-tuile--signal { padding-bottom: 2rem; }
.sgm-tuile__fleche { position: absolute; right: .9rem; top: 1.05rem; color: #b8c1cf; transition: transform .15s ease, color .15s ease; }
.sgm-tuile:hover .sgm-tuile__fleche { color: var(--sgm-or-600); transform: translateX(3px); }

/* =====================================================================
   ATHOMES INTELLIGENCE — menu Suivi (02/11/2026)
   ===================================================================== */
.sgm-suivi__bandeau {
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    padding: 1.4rem 1.6rem; margin-bottom: 1.25rem;
    color: #d7deea; /* fond, arrondi et ombre : bloc « Harmonisation visuelle » */
}
.sgm-suivi__bandeau-texte { flex: 1 1 22rem; }
.sgm-suivi__marque { font-size: .72rem; font-weight: 800; letter-spacing: .18em; color: var(--sgm-or); margin-bottom: .35rem; }
.sgm-suivi__titre { font-size: clamp(1.35rem, 1rem + 1.2vw, 1.9rem); font-weight: 800; color: #fff; margin: 0 0 .35rem; }
.sgm-suivi__demo {
    display: inline-flex; align-items: center; gap: .35rem; margin-top: .7rem;
    font-size: .74rem; padding: .2rem .65rem; border-radius: 999px;
    background: rgba(255, 255, 255, .1); color: #fff;
}
.sgm-suivi__jauge { position: relative; flex: 0 0 auto; width: 132px; height: 132px; }
.sgm-suivi__jauge-fond { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 11; }
.sgm-suivi__jauge-valeur { fill: none; stroke: var(--sgm-or); stroke-width: 11; stroke-linecap: round; }
.sgm-suivi__jauge-texte {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; line-height: 1.1;
}
.sgm-suivi__jauge-texte strong { font-size: 1.7rem; color: #fff; }
.sgm-suivi__jauge-texte span { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #aab6ca; max-width: 6rem; }

.sgm-suivi__stat--alerte { border-left-color: #dc3545; background: #fff7f7; }
.sgm-suivi__montant { font-size: 1.2rem; }
.sgm-suivi__section { font-size: 1.05rem; font-weight: 800; color: var(--sgm-navy); margin: 0; }
.sgm-suivi__legende { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 0; padding: 0; font-size: .76rem; color: var(--sgm-gris); }
.sgm-suivi__legende i { margin-right: .3rem; }

.sgm-suivi__cartes { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); }

.sgm-etat {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .72rem; font-weight: 700; padding: .16rem .55rem; border-radius: 999px;
    color: var(--etat); background: color-mix(in srgb, var(--etat) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--etat) 30%, #fff);
}
.sgm-etat--discret { font-weight: 600; }

.sgm-chantier {
    display: flex; flex-direction: column; gap: .55rem;
    padding: .95rem 1rem; background: #fff; color: inherit; text-decoration: none;
    border: 1px solid var(--sgm-bordure); border-top: 4px solid var(--etat);
    border-radius: var(--sgm-rayon-md);
    transition: transform .15s ease, box-shadow .15s ease;
}
.sgm-chantier:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(16, 26, 46, .10); color: inherit; }
.sgm-chantier:focus-visible { outline: 3px solid var(--sgm-or); outline-offset: 2px; }
.sgm-chantier--bloque { background: #fff8f8; }
.sgm-chantier__haut { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sgm-chantier__numero { font-size: .76rem; font-weight: 700; color: var(--sgm-gris); letter-spacing: .03em; }
.sgm-chantier__client { font-size: 1rem; font-weight: 800; color: var(--sgm-navy); line-height: 1.25; }
.sgm-chantier__avancement { display: flex; align-items: center; gap: .6rem; }
.sgm-chantier__avancement strong { font-size: .9rem; color: var(--sgm-navy); min-width: 2.8rem; text-align: right; }
.sgm-chantier__barre { flex: 1; height: 8px; border-radius: 999px; background: #e9edf3; overflow: hidden; display: block; }
.sgm-chantier__barre > span { display: block; height: 100%; border-radius: 999px; background: var(--etat, var(--sgm-navy)); }
.sgm-chantier__dernier { display: flex; gap: .5rem; font-size: .8rem; line-height: 1.35; padding: .55rem .6rem; background: var(--sgm-fond); border-radius: var(--sgm-rayon); }
.sgm-chantier__dernier > i { color: var(--sgm-or-600); }
.sgm-chantier__pied { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .78rem; margin-top: auto; }
.sgm-chantier__silence { color: #5b4b8a; font-weight: 600; }

.sgm-suivi__alerte {
    display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem;
    border-bottom: 1px solid var(--sgm-bordure); color: inherit; text-decoration: none;
}
.sgm-suivi__alerte:last-child { border-bottom: 0; }
.sgm-suivi__alerte:hover { background: var(--sgm-fond); color: inherit; }
.sgm-suivi__gravite {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem;
    font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px;
    color: var(--couleur); background: color-mix(in srgb, var(--couleur) 12%, #fff);
}

.sgm-point { display: flex; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--sgm-bordure); }
.sgm-point:last-child { border-bottom: 0; }
.sgm-point__type {
    flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: 50%;
    display: grid; place-items: center; background: #e7f6ee; color: #128c4a;
}
.sgm-point__corps { flex: 1; min-width: 0; }
.sgm-point__entete { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.sgm-point__chantier { font-size: .8rem; font-weight: 600; color: var(--sgm-navy); }
.sgm-point__resume { font-weight: 600; font-size: .86rem; margin-top: .15rem; }
.sgm-point__texte { font-size: .82rem; color: #4b5563; margin-top: .15rem; }
.sgm-point__pied { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }

.sgm-fiche__entete {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem;
    padding: 1.1rem 1.3rem; margin-bottom: 1.25rem; background: #fff;
    border: 1px solid var(--sgm-bordure); border-left: 6px solid var(--etat);
    border-radius: var(--sgm-rayon-md);
}
.sgm-fiche__avancement { display: flex; flex-direction: column; gap: .3rem; width: min(100%, 16rem); }
.sgm-fiche__avancement strong { font-size: 2rem; line-height: 1; color: var(--sgm-navy); }
.sgm-fiche__avancement .sgm-chantier__barre { flex: 0 0 10px; height: 10px; }
.sgm-fiche__entete .sgm-chantier__barre > span { background: var(--etat); }

@media (prefers-reduced-motion: reduce) {
    .sgm-tuile, .sgm-tuile__icone, .sgm-tuile__fleche, .sgm-chantier { transition: none; }
    .sgm-tuile:hover, .sgm-chantier:hover { transform: none; }
    .sgm-tuile:hover .sgm-tuile__fleche { transform: none; }
}

/* ---------- Suivi : onglets et ecran « A valider » (choix 1, 02/11/2026) ---------- */
.sgm-suivi__onglets {
    display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem;
    padding: .3rem; background: #fff; border: 1px solid var(--sgm-bordure); border-radius: 999px; width: fit-content;
}
.sgm-suivi__onglet {
    display: inline-flex; align-items: center; gap: .45rem; padding: .42rem 1rem; border-radius: 999px;
    font-size: .88rem; font-weight: 600; color: var(--sgm-navy); text-decoration: none;
}
.sgm-suivi__onglet:hover { background: var(--sgm-navy-050); color: var(--sgm-navy); }
.sgm-suivi__onglet:focus-visible { outline: 3px solid var(--sgm-or); outline-offset: 2px; }
.sgm-suivi__onglet.actif { background: var(--sgm-navy); color: #fff; }
.sgm-suivi__compteur {
    min-width: 1.5rem; padding: .05rem .45rem; border-radius: 999px; text-align: center;
    font-size: .75rem; font-weight: 800; background: var(--sgm-or); color: var(--sgm-navy-900);
}
.sgm-suivi__compteur--zero { background: #e2e6ed; color: var(--sgm-gris); }
.sgm-suivi__voyant {
    display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 700;
    padding: .08rem .45rem; border-radius: 999px; background: #fdecd2; color: #8a4b00;
}
.sgm-suivi__voyant--ok { background: #e3f4ea; color: #146c43; }

.sgm-suivi__stat--lien { color: inherit; text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
.sgm-suivi__stat--lien:hover { color: inherit; box-shadow: 0 8px 18px rgba(16, 26, 46, .10); transform: translateY(-2px); }
.sgm-suivi__stat--lien:focus-visible { outline: 3px solid var(--sgm-or); outline-offset: 2px; }
.sgm-suivi__stat--attente { background: var(--sgm-or-050); }

.sgm-chantier__proposition {
    display: flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 600;
    padding: .3rem .55rem; border-radius: var(--sgm-rayon); background: var(--sgm-or-050); color: #7a5600;
    border: 1px dashed #e6c068;
}

.sgm-validation__entete {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.2rem; margin-bottom: 1.25rem; background: #fff;
    border: 1px solid var(--sgm-bordure); border-radius: var(--sgm-rayon-md);
}
.sgm-validation__totaux { list-style: none; display: flex; gap: .5rem; margin: 0; padding: 0; flex-wrap: wrap; }
.sgm-validation__totaux li { padding: .3rem .75rem; border-radius: 999px; background: var(--sgm-navy-050); font-size: .82rem; color: var(--sgm-navy); }

.sgm-decision {
    display: grid; gap: 1rem; align-items: start;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(14rem, .9fr);
    padding: 1rem 1.1rem; background: #fff;
    border: 1px solid var(--sgm-bordure); border-left: 5px solid var(--etat);
    border-radius: var(--sgm-rayon-md);
}
.sgm-decision__message { min-width: 0; }
.sgm-decision__comparaison { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sgm-decision__comparaison > div { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.sgm-decision__etiquette { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sgm-gris); }
.sgm-decision__actions { display: flex; flex-direction: column; gap: .5rem; }
.sgm-decision__formulaire { display: flex; flex-direction: column; gap: .3rem; }
.sgm-decision__formulaire .btn { margin-top: .35rem; }
.sgm-decision__actions > form:not(.sgm-decision__formulaire) .btn { width: 100%; }
.sgm-decision__formulaire .btn { width: 100%; }

@media (max-width: 1199.98px) {
    .sgm-decision { grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem); }
    .sgm-decision__comparaison { grid-column: 1 / 2; }
    .sgm-decision__actions { grid-column: 2 / 3; grid-row: 1 / span 2; }
}
@media (max-width: 767.98px) {
    .sgm-decision { grid-template-columns: minmax(0, 1fr); }
    .sgm-decision__comparaison, .sgm-decision__actions { grid-column: auto; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .sgm-suivi__stat--lien { transition: none; }
    .sgm-suivi__stat--lien:hover { transform: none; }
}

/* ---------- Ecritures : ce qui bloque une imputation, en clair (03/11/2026) ---------- */
.sgm-diagnostic { display: flex; flex-direction: column; gap: .4rem; font-size: .84rem; }
.sgm-diagnostic li { padding: .45rem .65rem; background: rgba(255, 255, 255, .6); border-radius: var(--sgm-rayon-sm); border-left: 3px solid var(--sgm-or); }

/* ---------- Suivi : equipe et pieces recues (03/11/2026) ---------- */
.sgm-equipe__ligne {
    display: grid; gap: .6rem; align-items: center;
    grid-template-columns: minmax(0, 1.6fr) minmax(8rem, 1fr) minmax(9rem, 1fr) auto auto;
    padding: .7rem 1rem; border-bottom: 1px solid var(--sgm-bordure);
}
.sgm-equipe__ligne:last-child { border-bottom: 0; }
.sgm-equipe__ligne--inactif { background: var(--sgm-fond); opacity: .75; }
.sgm-equipe__identite { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
@media (max-width: 767.98px) {
    .sgm-equipe__ligne { grid-template-columns: minmax(0, 1fr) auto; }
    .sgm-equipe__identite { grid-column: 1 / -1; }
}

.sgm-pieces { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; align-items: center; }
.sgm-pieces__audio { height: 2.2rem; max-width: 100%; }
.sgm-pieces__vignette img {
    display: block; width: 120px; height: 90px; object-fit: cover;
    border-radius: var(--sgm-rayon-sm); border: 1px solid var(--sgm-bordure);
}
.sgm-pieces__vignette:focus-visible { outline: 3px solid var(--sgm-or); outline-offset: 2px; border-radius: var(--sgm-rayon-sm); }

/* =====================================================================
   Harmonisation visuelle de toute l'application (02/11/2026)

   Demande de la Direction : que les ecrans existants et ceux d'ATHOMES
   INTELLIGENCE ne fassent qu'un. Ce bloc vient en dernier ; il ne touche
   que l'apparence (arrondis, ombres, fonds, accents, survols), jamais la
   mise en page ni les dimensions, et vaut pour tous les comptes.
   ===================================================================== */
:root {
    /* Une seule echelle d'arrondis, partagee par Bootstrap et par SGM. */
    --sgm-rayon-sm: .5rem;     /* boutons, champs, badges, pastilles */
    --sgm-rayon-md: .7rem;     /* cartes, tuiles, alertes, menus */
    --sgm-rayon-lg: .9rem;     /* bandeaux d'en-tete */
    --bs-border-radius: var(--sgm-rayon-sm);
    --bs-border-radius-sm: .4rem;
    --bs-border-radius-lg: var(--sgm-rayon-md);
    --bs-border-radius-xl: var(--sgm-rayon-lg);

    --sgm-ombre-douce: 0 1px 2px rgba(16, 26, 46, .04);
    --sgm-ombre-survol: 0 8px 18px rgba(16, 26, 46, .10);
    --sgm-transition: .15s ease;

    /* Le fond des bandeaux : bleu nuit, halo dore en haut a droite. */
    --sgm-bandeau:
        radial-gradient(circle at 92% 20%, rgba(245, 165, 0, .22) 0, transparent 38%),
        linear-gradient(125deg, var(--sgm-navy) 0%, var(--sgm-navy-900) 100%);
}

/* ---------- Cartes : meme arrondi, meme accent dore sur l'icone de titre ---------- */
.card {
    --bs-card-border-radius: var(--sgm-rayon-md);
    --bs-card-inner-border-radius: calc(var(--sgm-rayon-md) - 1px);
    border-radius: var(--sgm-rayon-md);
    box-shadow: var(--sgm-ombre-douce);
}
.card-header > .bi:first-child, .card-header > :first-child > .bi:first-child { color: var(--sgm-or-600); }
.sgm-stat__libelle .bi { color: var(--sgm-or-600); margin-right: .15rem; }
a.card, a.sgm-stat { transition: box-shadow var(--sgm-transition), transform var(--sgm-transition); }
a.card:hover, a.sgm-stat:hover { box-shadow: var(--sgm-ombre-survol); transform: translateY(-2px); }

/* ---------- Bandeaux : le tableau de bord, les espaces et le Suivi partagent le meme fond ---------- */
.sgm-dashboard-intro, .sgm-espace__entete, .sgm-suivi__bandeau {
    background: var(--sgm-bandeau);
    border-radius: var(--sgm-rayon-lg);
    box-shadow: 0 8px 22px rgba(16, 26, 46, .18);
}
.sgm-dashboard-intro { border-left: 0; }

/* ---------- Boutons, alertes, menus ---------- */
.btn {
    --bs-btn-border-radius: var(--sgm-rayon-sm);
    --bs-btn-border-radius-sm: .4rem;
    --bs-btn-border-radius-lg: var(--sgm-rayon-md);
    transition: background-color var(--sgm-transition), border-color var(--sgm-transition), color var(--sgm-transition), box-shadow var(--sgm-transition);
}
.alert { border-radius: var(--sgm-rayon-md); }
.dropdown-menu { --bs-dropdown-border-radius: var(--sgm-rayon-md); box-shadow: var(--sgm-ombre); border-color: var(--sgm-bordure); }
.modal-content { border-radius: var(--sgm-rayon-lg); }

/* ---------- Onglets : les « pilules » du Suivi deviennent la regle ---------- */
.nav-pills { gap: .35rem; }
.nav-pills .nav-link {
    border-radius: 999px; font-weight: 600; color: var(--sgm-navy);
    transition: background-color var(--sgm-transition), color var(--sgm-transition);
}
.nav-pills .nav-link:hover { background: var(--sgm-navy-050); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--sgm-navy); color: #fff; }
.nav-tabs { border-bottom-color: var(--sgm-bordure); }
.nav-tabs .nav-link { color: var(--sgm-gris); font-weight: 600; border-radius: var(--sgm-rayon-sm) var(--sgm-rayon-sm) 0 0; }
.nav-tabs .nav-link:hover { color: var(--sgm-navy); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--sgm-navy); border-color: var(--sgm-bordure) var(--sgm-bordure) #fff; box-shadow: inset 0 3px 0 var(--sgm-or); }

/* ---------- Listes et pagination ---------- */
.list-group { --bs-list-group-border-radius: var(--sgm-rayon-md); }
.pagination { --bs-pagination-border-radius: var(--sgm-rayon-sm); }

@media (prefers-reduced-motion: reduce) {
    a.card, a.sgm-stat, .btn, .nav-pills .nav-link { transition: none; }
    a.card:hover, a.sgm-stat:hover { transform: none; }
}

@media print {
    .card, .sgm-dashboard-intro, .sgm-espace__entete, .sgm-suivi__bandeau { box-shadow: none; }
}
