/* ============================================================
   Facturation PMC — thème aux couleurs de la marque
   Bleu marine (enseignes) + rouge (la clé du logo) + blanc.
   ============================================================ */

:root{
  --navy:       #17263f;   /* barre latérale */
  --navy-2:     #243a5a;
  --navy-dark:  #0f1b2e;
  --navy-soft:  #eef2f8;   /* fonds doux bleutés */
  --navy-line:  #d8e0ec;
  --red:        #c1121f;   /* rouge PMC (la clé) — accent / actions clés */
  --red-dark:   #9a0e18;
  --red-soft:   #fceaec;
  --ink:        #1f2937;
  --muted:      #64748b;
  --line:       #e5e7eb;
  --line-2:     #eef0f4;
  --bg:         #f3f5f9;
  --card:       #ffffff;
  --green:      #16a34a;  --green-bg:#dcfce7;
  --amber:      #d97706;  --amber-bg:#fef3c7;
  --blue:       #2563eb;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --shadow-md:  0 4px 12px rgba(16,24,40,.12);
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; height:100%; }
body{
  font-family:"Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size:13px; color:var(--ink); background:var(--bg); -webkit-font-smoothing:antialiased;
}

/* ---------- Barre latérale ---------- */
.appli{ display:grid; grid-template-columns:194px 1fr; min-height:100vh; }
.cote{ background:linear-gradient(180deg, #1f3252 0%, var(--navy) 38%, var(--navy-dark) 100%);
       color:#fff; display:flex; flex-direction:column; box-shadow:var(--shadow-md); z-index:2;
       position:sticky; top:0; height:100vh; overflow-y:auto; }
/* défilement discret dans la barre foncée */
.cote::-webkit-scrollbar{ width:8px; }
.cote::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.16); border-radius:8px; }
.cote::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,.28); }
.cote{ scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.18) transparent; }
/* En-tête de marque compact : petit logo + nom, sur une ligne */
.logo-zone{ padding:9px 12px; display:flex; align-items:center; gap:9px;
            border-bottom:1px solid rgba(255,255,255,.10); }
.logo-zone img{ height:30px; width:auto; max-width:128px; object-fit:contain; flex:none;
                background:transparent; padding:0; box-shadow:none; }
.logo-zone .marque{ display:flex; flex-direction:column; line-height:1.2; min-width:0; }
.logo-zone .marque b{ display:none; }   /* le logo contient déjà « PMC MÉCANIQUE » */
.logo-zone .atelier-nom{ color:#9fb0cc; font-size:10px; }
.cote h2{ margin:10px 0 1px; padding:4px 15px 4px; font-size:10px; font-weight:700; letter-spacing:.13em;
          text-transform:uppercase; color:#7f96ba; }
.menu > h2:first-child{ margin-top:6px; }
/* En-tête de section AWSpec : petit point rouge = le cerveau PMC */
.cote h2.aw-titre{ color:#e7b3b8; display:flex; align-items:center; gap:7px; }
.cote h2.aw-titre::before{ content:""; width:6px; height:6px; border-radius:50%;
                           background:var(--red); box-shadow:0 0 0 3px rgba(193,18,31,.25); flex:none; }

.formulaires, .nav-grp{ list-style:none; margin:0; padding:1px 7px; }
.formulaires li a, .nav-grp li a{ display:flex; align-items:center; gap:8px; padding:6px 11px;
                   color:#dbe3f0; text-decoration:none; border-radius:7px; font-size:12.5px;
                   transition:background .12s, color .12s; }
.formulaires li a:hover, .nav-grp li a:hover{ background:var(--navy-2); color:#fff; }
.formulaires li a.actif, .nav-grp li a.actif{ background:#fff; color:var(--red); font-weight:600;
                         box-shadow:inset 3px 0 0 var(--red); }
.nav-grp li a .ic{ width:16px; text-align:center; flex:none; font-size:13px; }
/* Groupe AWSpec mis en valeur : liseré bleu doux à gauche */
.nav-aw{ margin:1px 7px 2px; padding:2px 0; border-left:2px solid rgba(231,179,184,.45);
         background:rgba(255,255,255,.03); border-radius:0 8px 8px 0; }

.cote .espace{ flex:0 0 6px; }
.modules{ margin:0; padding:2px 7px 14px; border-top:1px solid rgba(255,255,255,.12); }
.mod-titre{ cursor:pointer; user-select:none; display:flex; align-items:center; gap:7px; }
.mod-titre .chev{ font-size:10px; color:#8ea3c4; transition:transform .15s; display:inline-block; }
.modules.replie .mod-titre .chev{ transform:rotate(-90deg); }
.modules.replie .mod-section{ display:none; }
.mod-section{ margin-bottom:1px; }
.mod-head{ width:100%; text-align:left; background:transparent; border:none; color:#fff;
           font-weight:600; font-size:12.5px; padding:6px 11px; border-radius:7px; cursor:pointer;
           display:flex; align-items:center; gap:8px; transition:background .12s; }
.mod-head:hover{ background:var(--navy-2); }
.mod-head .chev{ font-size:10px; transition:transform .15s; display:inline-block; color:#8ea3c4; }
.mod-section.ouvert > .mod-head{ background:var(--navy-2); }
.mod-section.ouvert > .mod-head .chev{ transform:rotate(90deg); color:#fff; }
.mod-sous{ list-style:none; margin:0; padding:2px 0 4px; display:none; }
.mod-section.ouvert > .mod-sous{ display:block; }
.mod-sous li a{ display:block; padding:6px 12px 6px 30px; color:#cfd8e6; text-decoration:none;
                font-size:12.5px; border-radius:6px; }
.mod-sous li a:hover{ background:var(--navy-2); color:#fff; }
.mod-sous .avenir{ display:block; padding:6px 12px 6px 30px; color:#5e708c;
                   font-size:12.5px; font-style:italic; }
.mod-sous .avenir::after{ content:" · à venir"; font-size:10px; opacity:.7; }

/* ---------- En-tête + recherche ---------- */
main{ display:flex; flex-direction:column; min-width:0; }
.entete-appli{ background:var(--card); border-bottom:1px solid var(--line); padding:6px 16px;
               font-weight:700; font-size:12.5px; color:var(--navy); display:flex; align-items:center;
               gap:12px; box-shadow:var(--shadow); position:sticky; top:0; z-index:1; }
.entete-appli .ver{ color:var(--muted); font-weight:500; font-size:12px; }
.recherche-haut{ margin-left:auto; display:flex; gap:6px; align-items:center; }
.recherche-haut input{ width:360px; max-width:38vw; padding:6px 12px; font-size:12.5px;
                       border:1px solid var(--line); border-radius:999px; background:#f8fafc; }
.recherche-haut input:focus{ outline:none; border-color:var(--navy-2);
                             box-shadow:0 0 0 3px rgba(36,58,90,.15); background:#fff; }
.recherche-haut button{ background:var(--navy); color:#fff; border:none; border-radius:999px;
                        padding:6px 16px; cursor:pointer; font-weight:600; font-size:12.5px; }
.recherche-haut button:hover{ background:var(--navy-2); }

/* ---------- Barre d'outils (compacte, façon Costar) ---------- */
.outils{ display:flex; gap:2px; padding:4px 12px; background:var(--card);
         border-bottom:1px solid var(--line); flex-wrap:wrap; }
.outils button{ background:transparent; border:1px solid transparent; border-radius:7px;
                padding:4px 8px; cursor:pointer; display:flex; flex-direction:column;
                align-items:center; gap:2px; font-size:10px; color:var(--muted); min-width:46px;
                transition:background .12s, color .12s; }
.outils button:hover{ background:var(--navy-soft); color:var(--navy); }
.outils .ico{ font-size:15px; line-height:1; }
.outils button.off{ opacity:.35; cursor:default; }
.outils button.off:hover{ background:transparent; color:var(--muted); }

/* ---------- Contenu ---------- */
.doc{ padding:12px 16px; }
.doc-titre{ display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.doc-titre .nom-doc{ font-size:20px; font-weight:700; color:var(--ink); letter-spacing:-.01em; }
.badge-num{ background:var(--red-soft); color:var(--red-dark); border:1px solid #f3c9cd;
            border-radius:999px; font-weight:700; padding:4px 16px; font-size:14px; }
.doc-titre .ref{ color:var(--muted); font-size:13px; }
.doc-titre .ref b{ color:var(--ink); }
.etat-bandeau{ font-size:12px; color:var(--muted); margin:0 0 4px 2px; }

.doc-onglets{ display:flex; gap:4px; margin:0 0 12px; }
.doc-onglets .og{ padding:6px 16px; font-size:12px; border-radius:999px; background:#fff;
                  border:1px solid var(--line); color:var(--muted); cursor:default; }
.doc-onglets .og.actif{ background:var(--amber-bg); color:#92500e; border-color:#fcd9a3;
                        font-weight:700; }
.doc-onglets .og-annule.actif{ background:var(--red-soft); color:var(--red-dark);
                               border-color:#f3c9cd; }

.commentaires-bar{ display:flex; align-items:stretch; gap:8px; margin-bottom:12px; max-width:820px; }
.commentaires-bar .lab{ display:flex; align-items:center; }
.commentaires-bar .comm-val{ flex:1; border:1px solid var(--line); background:#fffbeb;
                             padding:6px 10px; font-size:13px; border-radius:var(--radius-sm); }

/* ---------- En-tête 3 colonnes ---------- */
.entete{ display:grid; grid-template-columns:minmax(300px,1fr) minmax(330px,1.15fr) minmax(310px,1fr);
         gap:10px; align-items:start; }
.bloc{ border:1px solid var(--line); background:var(--card); border-radius:var(--radius);
       box-shadow:var(--shadow); overflow:hidden; }
/* Libellés sobres + COMPACTS (densité Costar) */
.lab{ background:transparent; color:var(--muted); padding:0 1px 1px; font-size:9.5px; font-weight:700;
      letter-spacing:.04em; text-transform:uppercase; display:block; }
.lab.rouge{ color:var(--red); background:transparent; }
.ligne-lab{ display:grid; grid-auto-flow:column; gap:6px; margin:5px 0 1px; }
/* Champs blancs compacts */
.champ{ width:100%; border:1px solid var(--line); background:#fff; padding:3px 7px; min-height:24px;
        font-size:11.5px; border-radius:5px; color:var(--ink); transition:border-color .12s, box-shadow .12s; }
.champ::placeholder{ color:#9aa6b8; }
.champ:focus{ outline:none; border-color:var(--navy-2); box-shadow:0 0 0 2px rgba(36,58,90,.14); }
.champ.gros{ font-weight:600; color:var(--ink); }
.client .champ.gros{ background:#fff; border-color:var(--line); color:var(--ink); }
.client table, .etats table{ width:100%; border-collapse:separate; border-spacing:0 3px; }
.client td{ padding:0 2px; vertical-align:middle; }
.mini-btn{ border:1px solid var(--line); background:#fff; padding:4px 10px; cursor:pointer;
           font-size:12px; border-radius:6px; color:var(--ink); }
.mini-btn:hover{ background:var(--navy-soft); border-color:var(--navy-line); }

.etats{ display:grid; grid-template-columns:1fr 1fr; gap:3px 10px; align-content:start; }
.etat-ligne{ display:grid; grid-template-columns:70px 1fr; align-items:center; gap:6px; }
.etat-ligne .lab{ margin:0; padding:0; text-align:right; }
.etat-ligne .val{ width:100%; border:1px solid var(--line); background:#fff; padding:3px 7px;
                  border-radius:5px; font-size:11.5px; min-height:24px; }
.etat-ligne .val.actif{ background:var(--green-bg); border-color:#bbf7d0; color:#14532d; font-weight:600; }
.cases{ grid-column:1 / -1; margin-top:6px; display:grid; grid-template-columns:1fr 1fr 1fr; gap:1px; }
.cases label{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ink);
              padding:2px 6px; border-radius:6px; cursor:pointer; }
.cases label:hover{ background:var(--navy-soft); }
.cases label.coche{ background:var(--green-bg); color:#14532d; font-weight:600; }

.veh-onglets{ display:flex; gap:4px; padding:8px 8px 0; }
.veh-onglets span{ padding:6px 14px; border-radius:8px 8px 0 0; background:#f1f5f9;
                   font-size:12px; color:var(--muted); }
.veh-onglets span.actif{ background:var(--navy); color:#fff; font-weight:600; }
.veh-boutons{ display:flex; gap:6px; padding:8px; flex-wrap:wrap; }
.veh-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.veh-table th{ background:#f8fafc; color:var(--muted); font-weight:600; text-align:left;
               padding:6px 10px; border-bottom:1px solid var(--line); }
.veh-table td{ padding:6px 10px; border-bottom:1px solid var(--line-2); }
.veh-table tr.courant td{ background:var(--green-bg); }
.veh-odo{ text-align:right; width:78px; color:var(--muted); }

/* ---------- Grille des lignes ---------- */
.grille-zone{ margin-top:16px; border:1px solid var(--line); border-radius:var(--radius);
              box-shadow:var(--shadow); overflow:hidden; background:var(--card); }
.legende{ display:flex; gap:14px; font-size:11.5px; padding:8px 12px; color:var(--muted);
          border-bottom:1px solid var(--line-2); background:#fafbfc; }
.legende span{ display:flex; align-items:center; gap:5px; }
.grille{ width:100%; border-collapse:collapse; font-size:12.5px; }
.grille th{ background:var(--navy); color:#eaf0fa; font-weight:600; padding:8px 10px;
            text-align:left; border-bottom:none; white-space:nowrap; letter-spacing:.01em; }
.grille td{ border-bottom:1px solid var(--line-2); padding:4px 9px; height:26px; }
.grille tbody tr:hover td{ background:#f5f8fd; }
.grille .no{ width:30px; text-align:center; color:var(--muted); background:#fafbfc; }
.grille .qte,.grille .num{ text-align:right; }
.grille .net,.grille .staxe{ text-align:right; font-weight:600; color:#14532d; }
.grille .dim{ text-align:center; }
.grille tr.ligne-vide td{ background:#fff; height:30px; }
.grille tr.ligne-soustotal td{ background:var(--green-bg); font-weight:700; color:#14532d; }
.grille tr.ligne-sep td{ background:#f8fafc; color:#cbd5e1; }
.stat{ display:inline-block; width:11px; height:11px; border-radius:50%; }
.stat.requis{ background:var(--red); } .stat.ouvert{ background:var(--amber); }
.stat.envoye{ background:var(--blue); } .stat.recu{ background:var(--green); }
.grille .bc{ width:46px; text-align:center; color:var(--muted); font-size:11px; }

/* Cellule Produit colorée par statut de ligne (façon Costar, couleurs PMC) */
.grille td.prod{ font-weight:600; white-space:nowrap; }
.grille td.prod.p-recu  { background:var(--green-bg); color:#14532d; box-shadow:inset 3px 0 var(--green); }
.grille td.prod.p-requis{ background:var(--red-soft);  color:var(--red-dark); box-shadow:inset 3px 0 var(--red); }
.grille td.prod.p-envoye{ background:#e7f0ff;          color:#1e3a8a; box-shadow:inset 3px 0 var(--blue); }
.grille td.prod.p-ouvert{ background:#fff7e6;          color:#92400e; box-shadow:inset 3px 0 var(--amber); }
.grille td.prod.p-core  { background:#fef3c7;          color:#854d0e; box-shadow:inset 3px 0 #ca8a04; }
.grille td.prod.p-note  { background:var(--navy-soft);  color:var(--navy); box-shadow:inset 3px 0 var(--navy); text-align:center; }
.grille tr.ligne-note td{ background:#f6f8fc; color:#475569; font-style:italic; }
.grille tr.ligne-note td.prod{ font-style:normal; }

/* Légende = pastilles carrées aux mêmes couleurs que les cellules */
.legende .sw{ display:inline-block; width:15px; height:12px; border-radius:3px; }
.legende .sw.p-recu  { background:var(--green-bg); box-shadow:inset 3px 0 var(--green); }
.legende .sw.p-requis{ background:var(--red-soft);  box-shadow:inset 3px 0 var(--red); }
.legende .sw.p-envoye{ background:#e7f0ff;          box-shadow:inset 3px 0 var(--blue); }
.legende .sw.p-ouvert{ background:#fff7e6;          box-shadow:inset 3px 0 var(--amber); }
.legende .sw.p-core  { background:#fef3c7;          box-shadow:inset 3px 0 #ca8a04; }
.legende .sw.p-note  { background:var(--navy-soft);  box-shadow:inset 3px 0 var(--navy); }

/* ---------- Totaux ---------- */
.barre-totaux{ margin-top:14px; display:flex; justify-content:flex-end; align-items:center; gap:14px; }
.exempt-note{ background:var(--red-soft); color:var(--red-dark); font-weight:700; font-size:12px;
              padding:6px 14px; border-radius:999px; border:1px solid var(--red); }
.totaux{ border-collapse:separate; border-spacing:0; font-size:13px; min-width:520px;
         border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
         box-shadow:var(--shadow); background:#fff; }
.totaux th{ background:var(--navy); color:#eaf0fa; font-weight:600; padding:8px 18px;
            border-bottom:none; text-align:right; }
.totaux td{ padding:10px 18px; text-align:right; font-weight:700; color:var(--ink); }
.totaux td.final{ background:var(--navy); color:#fff; font-size:15px; }
.totaux td.final-credit{ background:var(--red); color:#fff; font-size:15px; }
.credit-badge{ background:var(--red-soft); color:var(--red-dark); }

.paiements-zone{ margin-top:16px; }
.totaux.paie{ min-width:380px; }
.totaux.paie .solde-du{ background:var(--red-soft); color:var(--red-dark); }
.totaux.paie .solde-paye{ background:var(--green-bg); color:#14532d; }
.paie-form{ margin-top:12px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.paie-form .lab{ display:flex; align-items:center; }
.paie-form input, .paie-form select{ padding:7px 10px; border:1px solid var(--line);
                                      border-radius:var(--radius-sm); font-size:13px; }
.paye-badge{ margin-top:12px; display:inline-block; background:var(--green-bg); color:#14532d;
             font-weight:700; padding:7px 18px; border-radius:999px; }
.outils-bas{ margin-top:12px; display:flex; gap:8px; }
.outils-bas button{ border:1px solid var(--line); background:#fff; padding:8px 16px;
                    cursor:pointer; border-radius:var(--radius-sm); color:var(--ink); }
.outils-bas button:hover{ background:var(--navy-soft); }

/* ---------- Boutons d'action ---------- */
.btn-convertir, .btn-credit{ text-decoration:none; border-radius:999px; padding:8px 14px;
  font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:6px;
  box-shadow:var(--shadow); margin-right:6px; }
.btn-convertir{ background:var(--navy-2); color:#fff; }
.btn-credit{ background:#fff; color:var(--red); border:1px solid #f3c9cd; box-shadow:none; }
.btn-credit:hover{ background:var(--red); color:#fff; }
.btn-convertir:hover{ filter:brightness(1.1); }
.lien-conv{ font-size:12px; color:var(--navy-2); text-decoration:none; background:var(--navy-soft);
            padding:3px 10px; border-radius:999px; margin-left:6px; }
.lien-conv:hover{ text-decoration:underline; }
.btn-vendre{ text-decoration:none; background:var(--green); color:#fff; border-radius:999px;
             padding:8px 16px; font-size:13px; font-weight:700; box-shadow:var(--shadow); margin-right:6px; }
.btn-vendre:hover{ filter:brightness(1.08); }
.btn-autoriser{ background:#fff; color:var(--blue); border:1px solid #bcd4f5; border-radius:999px;
                padding:8px 14px; font-size:13px; font-weight:600; cursor:pointer; margin-right:6px; }
.btn-autoriser:hover{ background:var(--blue); color:#fff; }

/* écran Caisse (Vendre) */
.caisse-vente{ max-width:520px; margin-top:10px; background:var(--card); border:1px solid var(--line);
               border-radius:var(--radius); box-shadow:var(--shadow-md); padding:22px; }
.cv-info{ display:flex; gap:14px; margin-bottom:18px; }
.cv-client{ flex:1; background:var(--navy-soft); border-radius:var(--radius); padding:12px 16px;
            font-size:13px; color:var(--muted); }
.cv-client b{ font-size:16px; color:var(--ink); }
.cv-total{ flex:1; background:var(--navy); color:#fff; border-radius:var(--radius); padding:12px 16px;
           font-size:13px; }
.cv-total span{ font-size:26px; font-weight:700; }
.cv-form label{ display:block; font-size:13px; color:var(--muted); font-weight:600; margin:10px 0 5px; }
.cv-modes{ display:flex; gap:8px; flex-wrap:wrap; }
.cv-mode{ display:inline-flex !important; align-items:center; gap:6px; background:#f8fafc;
          border:1px solid var(--line); border-radius:999px; padding:8px 14px; cursor:pointer;
          margin:0 !important; }
#cv-recu{ width:100%; padding:12px 14px; font-size:20px; text-align:right; border:1px solid var(--line);
          border-radius:var(--radius-sm); }
.cv-monnaie{ margin:14px 0; font-size:15px; color:var(--muted); }
.cv-monnaie b{ color:var(--green); font-size:20px; }
.btn-finaliser{ width:100%; padding:14px; font-size:17px; font-weight:700; color:#fff;
                background:var(--green); border:none; border-radius:var(--radius); cursor:pointer;
                box-shadow:var(--shadow); }
.btn-finaliser:hover{ filter:brightness(1.08); }
.btn-modifier, .btn-nouveau, .btn-sauver, .btn-annuler, .btn-imprimer, .btn-facturer{
  text-decoration:none; border-radius:999px; padding:8px 16px; font-size:13px; font-weight:600;
  cursor:pointer; border:none; display:inline-flex; align-items:center; gap:6px;
  transition:filter .12s, box-shadow .12s; box-shadow:var(--shadow); }
.btn-modifier{ background:var(--navy); color:#fff; }
.btn-nouveau{ background:var(--green); color:#fff; }
.btn-sauver{ background:var(--green); color:#fff; }
.btn-facturer{ background:var(--red); color:#fff; }
.btn-imprimer{ background:#475569; color:#fff; }
.btn-annuler{ background:#fff; color:var(--ink); border:1px solid var(--line); box-shadow:none; }
.btn-modifier:hover,.btn-nouveau:hover,.btn-sauver:hover,.btn-facturer:hover,.btn-imprimer:hover{
  filter:brightness(1.08); box-shadow:var(--shadow-md); }
.btn-supprimer{ background:#fff; color:var(--red); border:1px solid #f3c9cd; border-radius:999px;
                padding:8px 12px; cursor:pointer; font-size:13px; }
.btn-supprimer:hover{ background:var(--red); color:#fff; }
.mode-edition{ background:var(--amber-bg); color:#92500e; font-weight:700; padding:4px 12px;
               border-radius:999px; font-size:12px; }
.btn-awspec{ display:block; width:100%; margin-top:8px; background:var(--navy); color:#fff;
             border:none; border-radius:var(--radius-sm); padding:9px; cursor:pointer;
             font-weight:600; font-size:13px; box-shadow:var(--shadow); }
.btn-awspec:hover{ filter:brightness(1.12); }
.awspec-msg{ display:block; font-size:12px; margin-top:5px; min-height:14px; }
.awspec-msg.ok{ color:var(--green); } .awspec-msg.err{ color:var(--red); }

/* ---------- Édition ---------- */
.edit input, .edit select{ font-family:inherit; box-sizing:border-box; }
.edit input.champ{ width:100%; display:block; margin-bottom:4px; }
.edit .trio{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:5px; margin-bottom:1px; }
.edit .etats input.val, .edit .etats select.val{ width:100%; box-sizing:border-box; }
.edit-grille input{ width:100%; box-sizing:border-box; border:1px solid var(--line);
                    padding:5px 7px; font-size:12.5px; border-radius:5px; background:#fff; }
.edit-grille input:focus{ outline:none; border-color:var(--navy-2);
                          box-shadow:0 0 0 2px rgba(36,58,90,.15); }
.edit-grille input.num{ text-align:right; }
.edit-grille td{ padding:3px 5px; }
.edit-grille .tax{ text-align:center; }
.edit-grille .xrow{ border:none; background:var(--red-soft); color:var(--red); width:24px;
                    height:24px; border-radius:6px; cursor:pointer; }
.edit-grille .xrow:hover{ background:var(--red); color:#fff; }
/* Sélecteur de statut de ligne (compact) */
.edit-grille .i-statut{ width:100%; box-sizing:border-box; border:1px solid var(--line);
                        padding:4px 4px; font-size:11.5px; border-radius:5px; background:#fff; }
/* Cellule Produit colorée en direct par statut (mêmes teintes que la vue) */
.edit-grille td.cell-prod{ padding:3px 5px; box-shadow:none; }
.edit-grille td.cell-prod.p-recu  { background:#c7eec7; box-shadow:inset 4px 0 var(--cos-green-d); }
.edit-grille td.cell-prod.p-requis{ background:#f4b4b4; box-shadow:inset 4px 0 var(--red); }
.edit-grille td.cell-prod.p-envoye{ background:#d8c6f0; box-shadow:inset 4px 0 var(--cos-lav); }
.edit-grille td.cell-prod.p-ouvert{ background:#f1dd86; box-shadow:inset 4px 0 var(--cos-gold); }
.edit-grille td.cell-prod.p-core  { background:#f3e3a0; box-shadow:inset 4px 0 #b8860b; }
.edit-grille td.cell-prod.p-note  { background:#efe1a6; box-shadow:inset 4px 0 var(--cos-gold); }
.edit-grille td.cell-prod input{ background:transparent; border-color:transparent; font-weight:600; }
.edit-grille td.cell-prod input:focus{ background:#fff; border-color:var(--navy-2); }
.add-ligne{ margin:10px; background:var(--green-bg); border:1px dashed var(--green);
            color:#14532d; padding:8px 16px; cursor:pointer; border-radius:999px; font-weight:600; }
.add-ligne.mo{ background:var(--navy-soft); border-color:var(--navy); color:var(--navy); }

/* ---------- Recherche & résultats ---------- */
.res-entete{ margin:2px 0 12px; font-size:14px; color:var(--ink); }
.res-plafond{ color:var(--amber); font-size:12px; margin-left:8px; }
.res-vide{ padding:22px; color:var(--muted); }
.res-table{ width:100%; border-collapse:collapse; font-size:13px; background:var(--card);
            border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
            box-shadow:var(--shadow); }
.res-table th{ background:var(--navy); color:#eaf0fa; font-weight:600; text-align:left;
               padding:9px 12px; border-bottom:none; white-space:nowrap; letter-spacing:.01em; }
.res-table td{ padding:6px 11px; border-bottom:1px solid var(--line-2); }
.res-table tbody tr{ cursor:pointer; transition:background .1s; }
.res-table tbody tr:last-child td{ border-bottom:none; }
.res-table tbody tr:hover td{ background:var(--navy-soft); }
.res-table .num{ text-align:right; }
.res-table .mono{ font-family:"SFMono-Regular", Consolas, monospace; font-size:12px; color:var(--muted); }
.pastille-type{ display:inline-block; padding:3px 10px; border-radius:999px; color:#fff;
                font-size:11px; font-weight:600; white-space:nowrap; background:#94a3b8; }
.pastille-type.t-bon_reparation{ background:var(--navy); }
.pastille-type.t-facture{ background:var(--green); }
.pastille-type.t-devis{ background:var(--amber); }
.pastille-type.t-note_credit{ background:var(--red); }

/* ---------- Liste « en cours » ---------- */
.liste-titre{ font-size:17px; font-weight:700; color:var(--navy); margin:0 0 12px;
              border-left:3px solid var(--red); padding-left:10px; line-height:1.2; }
.recherche-costar{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
                   padding:14px 16px; margin-bottom:14px; box-shadow:var(--shadow); }
.rc-grille{ display:grid; grid-template-columns:auto 220px auto 220px; gap:8px 12px; align-items:center; }
.rc-grille label{ font-size:12.5px; color:var(--muted); text-align:right; }
.rc-grille input{ padding:7px 10px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:13px; }
.rc-grille input:focus{ outline:none; border-color:var(--navy-2); box-shadow:0 0 0 3px rgba(36,58,90,.12); }
.rc-actions{ margin-top:12px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.rc-mode{ font-size:12.5px; color:var(--muted); display:flex; align-items:center; gap:4px; }
.rc-btn{ text-decoration:none; border:none; border-radius:999px; padding:8px 18px; font-size:13px;
         font-weight:600; cursor:pointer; background:var(--navy); color:#fff; box-shadow:var(--shadow); }
.rc-btn:hover{ background:var(--navy-2); }
.rc-clear{ background:#fff; color:var(--ink); border:1px solid var(--line); box-shadow:none; }
.rc-new{ background:var(--green); }
.liste-costar tbody tr:nth-child(even) td{ background:#fcfcfd; }
.liste-costar tbody tr:hover td{ background:var(--navy-soft); }
.liste-costar .comm{ color:var(--red); }
.liste-costar .non-paye{ color:var(--red); font-weight:700; }
.res-table tr.jour-sep td{ background:var(--navy-soft); color:var(--navy); font-weight:700; }
.res-table tr.stock-bas td{ color:var(--red); }
.res-table tr.a-commander td{ color:#92400e; }
.liste-costar tr.ligne-annule td{ color:#94a3b8; text-decoration:line-through; }
.liste-costar tr.ligne-annule:hover td{ text-decoration:none; }

/* Pastilles d'état (façon Costar, couleurs PMC) */
.etat-pill{ display:inline-block; padding:2px 9px; border-radius:999px; font-size:11px;
            font-weight:700; line-height:1.5; white-space:nowrap; }
.et-ouvert{ background:#fff7e6; color:#92400e; }
.et-wip{    background:#fef3c7; color:#854d0e; }
.et-fact{   background:#e7f0ff; color:#1e3a8a; }
.et-compl{  background:var(--green-bg); color:#14532d; }
.et-soum{   background:var(--navy-soft); color:var(--navy); }
.et-credit{ background:var(--red-soft); color:var(--red-dark); }
.et-annule{ background:#f1f5f9; color:#64748b; }
.et-paye{   background:var(--green-bg); color:#14532d; }
.etat-legende{ margin-left:14px; display:inline-flex; gap:5px; flex-wrap:wrap; vertical-align:middle; }
.etat-legende .etat-pill{ opacity:.85; }

/* ---------- Écrans de maintenance (MàJ tables de référence) ---------- */
.ref-entete{ display:grid; gap:8px; font-size:12px; font-weight:600; color:var(--muted);
             padding:4px 10px; }
.ref-row{ display:grid; gap:8px; align-items:center; padding:5px 10px; border:1px solid var(--line);
          border-radius:8px; margin-bottom:6px; background:#fff; }
.ref-row.ajout{ background:var(--green-bg); border-color:#bbf7d0; }
.ref-row input{ width:100%; box-sizing:border-box; border:1px solid var(--line);
                padding:6px 8px; border-radius:6px; font-size:13px; }
.ref-row input.num{ text-align:right; }
.ref-row form{ display:none; }            /* formulaires m{id}/d{id} invisibles */
.ref-actions{ display:flex; gap:6px; justify-content:flex-end; align-items:center; }
.ref-actions .xrow{ border:none; background:var(--red-soft); color:var(--red); width:28px;
                    height:28px; border-radius:6px; cursor:pointer; }
.ref-actions .xrow:hover{ background:var(--red); color:#fff; }

/* ---------- Recherche client (loupe) dans l'éditeur ---------- */
.cli-recherche{ position:relative; margin-bottom:8px; }
.cli-recherche #cli-q{ width:100%; box-sizing:border-box; border:1px solid var(--navy-2);
    border-radius:8px; padding:8px 10px; font-size:13px; background:#fff; }
.edit .bloc{ overflow:visible; }   /* ne pas rogner la liste déroulante de recherche client */
.cli-res{ display:none; position:absolute; z-index:60; left:0; right:0; top:100%; margin-top:2px;
    background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow);
    max-height:280px; overflow:auto; }
.cli-item{ display:block; padding:7px 10px; border-bottom:1px solid var(--line-2); color:var(--ink);
    text-decoration:none; font-size:13px; cursor:pointer; }
.cli-item:hover{ background:var(--navy-soft); }
.cli-item .cli-meta{ color:var(--muted); font-size:11.5px; margin-left:6px; }
.cli-vide{ color:var(--muted); cursor:default; }
.veh-existants{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:4px 0 8px; }
.veh-existants .lab{ margin:0; }
.veh-chip{ display:inline-block; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600;
    background:var(--green-bg); color:#14532d; border:1px solid #bbf7d0; text-decoration:none; cursor:pointer; }
.veh-chip:hover{ background:var(--green); color:#fff; }
/* Sélecteur de véhicule du client (prise de RDV / fiche RDV) */
.veh-chips{ display:flex; flex-wrap:wrap; gap:6px; align-items:stretch; margin:2px 0 4px; }
.veh-chips .veh-chip{ font:inherit; text-align:left; line-height:1.15; padding:4px 11px; }
.veh-chips .veh-chip b{ display:block; font-weight:600; white-space:nowrap; }
.veh-chips .veh-chip span{ display:block; font-size:9.5px; opacity:.75; font-weight:500; }
.veh-chips .veh-chip.actif{ background:var(--green); color:#fff; border-color:var(--green); }
.veh-vide{ color:var(--muted); font-size:11.5px; }

/* Ligne de détail « travail » dans l'ÉDITEUR (technicien, heures, demandé/fait, mémo) */
.edit-grille .acts{ white-space:nowrap; text-align:right; }
.trow{ border:none; background:transparent; cursor:pointer; font-size:13px; opacity:.4;
       padding:2px 4px; border-radius:4px; }
.trow:hover{ opacity:1; background:var(--navy-soft); }
.trow.actif{ opacity:1; }

/* Ligne REFUSÉE (type_item X de Costar) : sur le bon, mais hors totaux */
.rrow{ border:none; background:transparent; cursor:pointer; font-size:13px; opacity:.35;
       padding:2px 4px; border-radius:4px; color:var(--red); font-weight:800; }
.rrow:hover{ opacity:1; background:var(--red-soft); }
.rrow.actif{ opacity:1; background:var(--red-soft); }
.edit-grille tr.lrow-refuse td{ background:#f2f3f6 !important; }
.edit-grille tr.lrow-refuse input:not([type=checkbox]){ color:#8b90a0; text-decoration:line-through; }
.edit-grille tr.lrow-refuse td.net, .edit-grille tr.lrow-refuse td.staxe{ color:#b0b4c0; text-decoration:line-through; }
/* Vue lecture + impression */
tr.ligne-refusee td{ background:#f2f3f6; color:#8b90a0; }
tr.ligne-refusee td.descr, tr.ligne-refusee td.net{ text-decoration:line-through; }
tr.ldetail > td{ background:#f3f6fc; border-top:none; padding:6px 10px 10px; }
.travail-grid{ display:flex; flex-wrap:wrap; gap:8px 12px; align-items:flex-end; }
.travail-grid label{ display:flex; flex-direction:column; gap:2px; font-size:9px; font-weight:700;
                     text-transform:uppercase; letter-spacing:.02em; color:var(--muted); }
.travail-grid input, .travail-grid textarea{ font:inherit; font-size:12px; font-weight:400;
   text-transform:none; letter-spacing:0; padding:4px 7px; border:1px solid var(--line);
   border-radius:5px; background:#fff; }
.travail-grid .t-court input{ width:88px; }
.travail-grid .t-large{ flex:1 1 240px; }
.travail-grid .t-large input{ width:100%; }
.travail-grid .t-plein{ flex:1 1 100%; }
.travail-grid .t-plein textarea{ width:100%; resize:vertical; }

/* Vérification d'inventaire — écran de recherche (frstkchk) */
.vi-grille{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.vi-grille .vi-q{ flex:1 1 300px; min-width:220px; }
.vi-grille select.champ{ width:auto; min-width:130px; }
.vi-check{ display:flex; align-items:center; gap:5px; font-size:12px; color:var(--navy); white-space:nowrap; }
.vi-client{ margin-top:8px; }
.vi-cli-actif{ font-size:12.5px; color:var(--navy); background:var(--navy-soft);
               padding:4px 10px; border-radius:6px; }
.vi-cli-clear{ font-size:11.5px; color:var(--red); margin-left:8px; text-decoration:none; }
#vi-table th[data-tri]:hover{ background:var(--navy-2); }
.stock-bas{ color:var(--red); font-weight:700; }
.vi-note{ background:#fff7e6; border:1px solid #f0d28a; border-radius:8px; padding:8px 12px;
          font-size:12px; color:#7a5b12; margin-bottom:10px; }
.vi-portail{ background:#f7f9fc; }
.vi-import summary{ cursor:pointer; font-weight:600; color:var(--navy); font-size:12.5px; padding:4px 0; }
.vi-import-grille{ display:flex; flex-wrap:wrap; gap:8px 12px; align-items:flex-end; margin-top:8px; }
.vi-import-grille label{ display:flex; flex-direction:column; gap:2px; font-size:9px; font-weight:700;
   text-transform:uppercase; letter-spacing:.02em; color:var(--muted); }
.vi-import-grille .t-court input{ width:96px; }
.vi-import-grille .t-large{ flex:1 1 220px; }
.vi-import-grille .t-large input{ width:100%; }
.vi-ok{ color:#0f7a3d; font-weight:600; font-size:12px; margin:4px 0; }
.vi-err{ color:var(--red); font-weight:600; font-size:12px; margin:4px 0; }
.vi-live{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:10px;
          border-top:1px dashed var(--line-2); padding-top:8px; }
.vi-live-lbl{ font-size:12px; font-weight:700; color:var(--navy); }
.nx-ok{ color:#0f7a3d; font-weight:600; }
.nx-pret{ color:#7a5b12; font-weight:600; }
.nx-off{ color:var(--muted); }

/* Hub Recherches / Divers / Intégration / Lien Internets (panneau Costar, 4 colonnes) */
.hub-grille{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; align-items:start; }
.hub-col{ border:1px solid var(--navy-line); border-radius:var(--radius); overflow:hidden;
          background:#fff; box-shadow:var(--shadow); }
.hub-titre{ background:linear-gradient(180deg,#7b3aa0,#5e2483); color:#fff; font-weight:700;
            font-size:12.5px; padding:7px 12px; letter-spacing:.02em; }
.hub-liste{ list-style:none; margin:0; padding:4px 0; }
.hub-liste a{ display:block; padding:6px 12px; color:var(--navy); text-decoration:none;
              font-size:12.5px; border-left:3px solid transparent; }
.hub-liste a:hover{ background:var(--navy-soft); border-left-color:var(--red); }
.hub-ext{ color:var(--muted); font-size:10px; }
@media(max-width:900px){ .hub-grille{ grid-template-columns:repeat(2,1fr); } }

/* Barre d'outils du bas de l'éditeur (ajout depuis les catalogues) */
.edit-toolbar{ display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin-top:8px; }
.add-sel{ font:inherit; font-size:12px; font-weight:600; padding:6px 10px; border-radius:8px;
          border:1px solid var(--navy-line); background:var(--green-bg); color:#14532d; cursor:pointer; }
.add-sel:hover{ background:#cdeed8; }
.add-sel:focus{ outline:2px solid var(--navy-2); }

/* Consultation NIV (AWSpec) */
.niv-veh{ display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; background:var(--navy);
          color:#eaf0fa; padding:8px 14px; border-radius:var(--radius); margin-bottom:10px; }
.niv-veh-titre{ font-size:15px; font-weight:700; }
.niv-veh-moteur{ font-size:12px; opacity:.85; }
.niv-veh-src{ font-size:10px; font-weight:700; background:rgba(255,255,255,.18); padding:2px 7px; border-radius:999px; }
.niv-veh-vin{ margin-left:auto; font-size:12px; opacity:.8; }
.niv-grille{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:10px; }
.niv-carte{ border:1px solid var(--navy-line); border-radius:var(--radius); overflow:hidden;
            background:#fff; box-shadow:var(--shadow); }
.niv-carte-titre{ background:var(--navy-soft); color:var(--navy); font-weight:700; font-size:11.5px;
                  padding:5px 10px; border-left:3px solid var(--red); }
.niv-specs{ width:100%; border-collapse:collapse; }
.niv-specs th{ text-align:left; font-weight:600; color:var(--muted); font-size:11px; padding:4px 10px;
               width:42%; vertical-align:top; }
.niv-specs td{ font-size:12px; color:var(--navy); padding:4px 10px; font-weight:600; }
.niv-specs tr + tr th, .niv-specs tr + tr td{ border-top:1px solid var(--line); }

/* Panneau AWSpec dans l'éditeur */
.awspec-panel{ border:1px solid var(--navy-line); border-radius:var(--radius); background:#f7faff;
               margin:6px 0 10px; box-shadow:var(--shadow); overflow:hidden; }
.awspec-panel-tete{ background:var(--navy); color:#eaf0fa; font-weight:700; font-size:12.5px;
                    padding:6px 12px; display:flex; align-items:center; gap:8px; }
.awspec-x{ margin-left:auto; background:transparent; border:none; color:#eaf0fa; cursor:pointer; font-size:13px; }
.awspec-cartes{ display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:8px; padding:10px; }
.awspec-carte{ border:1px solid var(--line); border-radius:6px; background:#fff; padding:6px 8px; }
.awspec-carte-t{ font-size:10px; font-weight:700; text-transform:uppercase; color:var(--red); margin-bottom:3px; }
.awspec-it{ display:flex; justify-content:space-between; gap:8px; font-size:11.5px; padding:1px 0; }
.awspec-it span{ color:var(--muted); }
.awspec-it b{ color:var(--navy); text-align:right; }
.awspec-sugg{ border-top:1px solid var(--line); padding:10px; font-size:12px; }
.awspec-sl{ display:flex; align-items:center; gap:6px; padding:2px 0; }
.awspec-add{ width:22px; height:22px; border:none; border-radius:5px; background:var(--green); color:#fff;
             font-weight:700; cursor:pointer; flex:none; }
.awspec-add:hover{ filter:brightness(.93); }
.awspec-tout{ margin-top:8px; }
.awspec-learn{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:var(--navy);
               margin-left:10px; background:var(--navy-soft); padding:3px 8px; border-radius:8px; }
.awspec-learn input{ padding:3px 6px; border:1px solid var(--line); border-radius:5px; font-size:11.5px; }

/* Panneau AWSpec « en parallèle » (coulissant, sur tous les écrans) */
.aw-backdrop{ position:fixed; inset:0; background:rgba(15,27,46,.35); opacity:0; visibility:hidden;
              transition:opacity .15s; z-index:90; }
.aw-backdrop.ouvert{ opacity:1; visibility:visible; }
.aw-panel{ position:fixed; top:0; right:0; height:100vh; width:380px; max-width:92vw; background:#fff;
           box-shadow:-4px 0 24px rgba(15,27,46,.22); transform:translateX(100%); transition:transform .18s;
           z-index:100; display:flex; flex-direction:column; }
.aw-panel.ouvert{ transform:translateX(0); }
.aw-head{ background:var(--navy); color:#eaf0fa; font-weight:700; font-size:13px; padding:10px 14px;
          display:flex; align-items:center; gap:8px; }
.aw-x{ margin-left:auto; background:transparent; border:none; color:#eaf0fa; cursor:pointer; font-size:15px; }
.aw-search{ display:flex; gap:6px; padding:10px 12px; border-bottom:1px solid var(--line); }
.aw-search input{ flex:1; padding:6px 9px; border:1px solid var(--navy-line); border-radius:6px;
                  font-family:var(--mono,monospace); font-size:13px; }
.aw-search button{ background:var(--green); color:#fff; border:none; border-radius:6px; padding:6px 12px;
                   font-weight:600; cursor:pointer; }
.aw-body{ flex:1; overflow:auto; padding:12px; }
.aw-hint{ color:var(--muted); font-size:12.5px; }
.aw-veh{ background:var(--navy-soft); color:var(--navy); font-weight:700; font-size:13.5px;
         padding:7px 10px; border-radius:8px; margin-bottom:8px; }
.aw-src{ font-size:9px; font-weight:700; background:var(--navy); color:#fff; padding:1px 6px; border-radius:999px; }
.aw-grp{ border:1px solid var(--line); border-radius:8px; margin-bottom:8px; overflow:hidden; }
.aw-grp-t{ background:#f3f6fc; color:var(--navy); font-weight:700; font-size:11px; padding:4px 10px;
           border-left:3px solid var(--red); }
.aw-it{ display:flex; justify-content:space-between; gap:8px; font-size:12px; padding:3px 10px; }
.aw-it + .aw-it{ border-top:1px solid var(--line); }
.aw-it span{ color:var(--muted); }
.aw-it b{ color:var(--navy); text-align:right; }
.aw-add{ display:block; width:100%; background:var(--green); color:#fff; border:none; border-radius:8px;
         padding:8px; font-weight:700; font-size:12.5px; cursor:pointer; margin-bottom:10px; }
.aw-add:hover{ filter:brightness(.94); }
.aw-histo{ margin-top:10px; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.aw-histo-l{ display:flex; justify-content:space-between; gap:8px; padding:5px 10px; font-size:11.5px;
             text-decoration:none; color:var(--navy); border-top:1px solid var(--line); }
.aw-histo-l:hover{ background:var(--navy-soft); }
.aw-histo-l span{ color:var(--muted); }
.aw-sugs{ border:1px solid var(--line); border-radius:8px; overflow:hidden; margin-bottom:10px; }
.aw-sug{ display:flex; align-items:center; gap:8px; padding:4px 8px; font-size:11.5px; color:var(--navy); border-top:1px solid var(--line); }
.aw-sug:first-of-type{ border-top:none; }
.aw-sug-add{ flex:none; width:22px; height:22px; border:none; border-radius:5px; background:var(--green); color:#fff; font-weight:700; cursor:pointer; }
.aw-sug-add:hover{ filter:brightness(.93); }
.aw-rappel{ background:#fde2e2; color:var(--red); font-weight:600; font-size:11.5px; padding:6px 10px; border-radius:8px; margin-bottom:8px; }
.aw-rappel.ok{ background:var(--green-bg); color:#14532d; }

/* Devis-éclair par NIV */
.eclair-form{ padding:16px; max-width:520px; display:flex; flex-direction:column; gap:8px; }
.eclair-vin{ font-size:16px; letter-spacing:.05em; }
.eclair-go{ font-size:14px; padding:9px 16px; align-self:flex-start; }
.eclair-aide{ margin-top:16px; max-width:560px; font-size:12.5px; color:var(--navy);
              background:var(--navy-soft); border-radius:var(--radius); padding:12px 16px; }
.eclair-aide ol{ margin:6px 0 0; padding-left:20px; }
.eclair-aide li{ margin:3px 0; }

/* Tableau de bord « véhicules à faire » (rappels) */
.retard-badge{ display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700;
               background:var(--navy-soft); color:var(--navy); }
.retard-badge.r-moy{ background:#fff1cc; color:#7a5b12; }
.retard-badge.r-haut{ background:#fde2e2; color:var(--red); }
.rc-btn.mini{ padding:3px 8px; font-size:11px; }

/* Inspection guidée */
.insp-veh{ font-size:12.5px; font-weight:700; color:var(--navy); background:var(--navy-soft); padding:5px 10px; border-radius:6px; }
.insp-cat{ margin-top:10px; border:1px solid var(--navy-line); border-radius:var(--radius); overflow:hidden; background:#fff; }
.insp-cat-t{ background:var(--navy); color:#eaf0fa; font-weight:700; font-size:12px; padding:5px 12px; }
.insp-pt{ display:flex; align-items:center; gap:10px; padding:5px 12px; border-top:1px solid var(--line); }
.insp-pt:first-of-type{ border-top:none; }
.insp-lib{ flex:1 1 180px; font-size:12.5px; color:var(--navy); }
.insp-st{ display:flex; gap:4px; flex:none; }
.insp-st label{ font-size:11px; font-weight:600; padding:2px 7px; border-radius:6px; cursor:pointer;
                border:1px solid var(--line); color:var(--muted); display:flex; align-items:center; gap:3px; }
.insp-st .o-ok:has(input:checked){ background:var(--green-bg); color:#14532d; border-color:var(--green); }
.insp-st .o-su:has(input:checked){ background:#fff1cc; color:#7a5b12; border-color:#e6b800; }
.insp-st .o-re:has(input:checked){ background:#fde2e2; color:var(--red); border-color:var(--red); }
.insp-st .o-na:has(input:checked){ background:var(--navy-soft); color:var(--navy); }
.insp-st input{ margin:0; }
.insp-note{ flex:1 1 140px; min-height:26px; font-size:11.5px; }
.o-re-txt{ color:var(--red); }
@media(max-width:760px){ .insp-pt{ flex-wrap:wrap; } }
/* Inspection intégrée dans l'éditeur (panneau) */
.insp-ed{ padding:10px; max-height:420px; overflow:auto; }
.insp-ed-pied{ padding:0 10px 10px; }
#insp-panel .insp-cat{ margin-top:8px; }
#insp-panel .insp-cat:first-child{ margin-top:0; }
.insp-btn{ background:#eef4ff !important; border-color:var(--navy-2) !important; }

/* Contenu de travail d'une ligne de bon de réparation (← Costar) */
.ligne-travail{ font-size:11px; color:var(--navy); font-weight:600; margin-top:2px; }
.ligne-travail.fait{ color:#0f3d24; font-weight:500; }
.ligne-memo{ font-size:10.5px; color:var(--muted); margin-top:2px; white-space:pre-line;
             border-left:2px solid var(--line-2); padding-left:6px; }

/* ---------- Modules ---------- */
.module-titre{ font-size:17px; font-weight:700; color:var(--navy); margin:0 0 14px;
               display:flex; align-items:center; gap:8px;
               border-left:3px solid var(--red); padding-left:10px; }
.recherche-module{ display:flex; gap:8px; margin-bottom:14px; }
.recherche-module input{ flex:1; max-width:580px; padding:9px 14px; font-size:13px;
                         border:1px solid var(--line); border-radius:999px; background:#f8fafc; }
.recherche-module input:focus{ outline:none; border-color:var(--navy-2);
                               box-shadow:0 0 0 3px rgba(36,58,90,.15); background:#fff; }
.recherche-module button{ background:var(--navy); color:#fff; border:none; border-radius:999px;
                          padding:9px 18px; cursor:pointer; font-weight:600; }
.recherche-module button:hover{ background:var(--navy-2); }
table.fiche{ width:100%; border-collapse:collapse; font-size:13px; }
table.fiche td{ padding:6px 10px; border-bottom:1px solid var(--line-2); }
table.fiche td:first-child{ color:var(--muted); font-weight:600; width:110px; }

.historique{ margin-top:18px; }
.histo-titre{ background:var(--navy); color:#fff; padding:10px 14px; font-weight:600;
              border-radius:var(--radius) var(--radius) 0 0; }
.historique .res-table{ border-radius:0 0 var(--radius) var(--radius); border-top:none; }
.historique .res-table th{ background:var(--navy-2); }

/* ---------- Agenda (prise de RDV, postes × heures) ---------- */
.agenda{ display:grid; position:relative; border:1px solid var(--navy-line);
         border-radius:var(--radius); overflow:hidden; background:#fff; box-shadow:var(--shadow); }
.ag-h{ background:var(--navy); color:#eaf0fa; font-size:11.5px; font-weight:600; padding:6px 4px;
       text-align:center; display:flex; align-items:center; justify-content:center; letter-spacing:.01em; }
.ag-corner{ background:var(--navy-dark); }
.ag-heure{ font-size:10.5px; color:var(--muted); padding:0 6px; text-align:right; background:#f7f9fc;
           border-top:1px solid var(--line); border-right:1px solid var(--navy-line); display:flex;
           align-items:center; justify-content:flex-end; }
.ag-heure.demi{ border-top:1px dashed var(--line-2); background:#fbfcfe; }
.ag-cell{ border-top:1px solid var(--line); border-right:1px solid var(--line-2); z-index:1;
          transition:background .1s, box-shadow .1s; }
.ag-cell.demi{ border-top:1px dashed var(--line-2); }
.ag-cell:hover{ background:var(--navy-soft); cursor:pointer; box-shadow:inset 0 0 0 1.5px var(--navy-2); }
.ag-now{ position:absolute; left:58px; right:0; height:0; border-top:2px solid var(--red); z-index:5; pointer-events:none; }
.ag-now span{ position:absolute; left:-50px; top:-8px; background:var(--red); color:#fff; font-size:9.5px;
              font-weight:700; padding:1px 5px; border-radius:4px; }
.ag-rdv{ z-index:2; margin:2px; border-radius:6px; padding:3px 7px; background:var(--green-bg);
         border-left:3px solid var(--green); font-size:11px; line-height:1.2; text-decoration:none;
         overflow:hidden; display:block; }
.ag-rdv b{ display:block; color:#0f3d24; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ag-rdv span{ display:block; color:#3b6d4e; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ag-rdv:hover{ background:#cdeed8; box-shadow:0 1px 6px rgba(15,61,36,.18); }
.ag-rdv.ag-converti{ background:#e7eefb; border-left-color:var(--navy-2); }
.ag-rdv.ag-converti b{ color:var(--navy); }
.ag-rdv.ag-converti span{ color:#456; }
.ag-rdv.ag-converti:hover{ background:#d9e4f7; }
.agenda form{ display:none; }

/* Bandeau crédit & âge des comptes (fiche client) */
.credit-strip{ display:flex; flex-wrap:wrap; align-items:stretch; gap:0; margin:8px 0 4px;
               border:1px solid var(--navy-line); border-radius:var(--radius); overflow:hidden;
               background:#fff; box-shadow:var(--shadow); }
.cs-item{ display:flex; flex-direction:column; gap:2px; padding:7px 14px; min-width:96px;
          border-right:1px solid var(--line); }
.cs-lab{ font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.cs-val{ font-size:13px; font-weight:600; color:var(--navy); white-space:nowrap; }
.cs-val.non-paye{ color:var(--red); }
.cs-sep{ width:0; border-right:2px solid var(--navy-line); }

/* Fiche d'un rendez-vous */
.rdv-badge{ background:var(--navy); color:#eaf0fa; font-size:11px; font-weight:600;
            padding:3px 9px; border-radius:6px; }
.fiche-actions{ display:flex; flex-wrap:wrap; gap:8px; border-top:1px solid var(--line); padding-top:12px; }
.rc-btn.rc-bon{ background:var(--green); border-color:var(--green); color:#fff; }
.rc-btn.rc-bon:hover{ filter:brightness(.94); }
.rc-btn.rc-suppr{ background:#fff; border-color:var(--red); color:var(--red); margin-left:auto; }
.rc-btn.rc-suppr:hover{ background:var(--red); color:#fff; }

/* ---------- Calendrier ---------- */
.cal-barre{ display:flex; align-items:center; gap:16px; margin-bottom:14px; flex-wrap:wrap; }
.cal-titre{ font-size:13px; color:var(--muted); }
.cal-titre b{ font-size:18px; color:var(--ink); }
.cal-nav{ background:#fff; border:1px solid var(--line); border-radius:999px; padding:7px 14px;
          cursor:pointer; font-size:12.5px; }
.cal-nav:hover{ background:var(--navy-soft); }
.cal-legende{ display:flex; align-items:center; gap:10px; font-size:12px; color:var(--muted); }
.cal-legende .lg{ display:inline-block; width:14px; height:14px; border-radius:4px; }
.lg-rdv{ background:#bfdbfe; } .lg-ligne{ background:#c7d2fe; }
.lg-cours{ background:#fde68a; } .lg-compl{ background:#bbf7d0; }
.lg-annule{ background:#fecaca; }

/* Liste RDV façon Costar — navigation + rangées teintées par statut */
.rdv-nav{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.rdv-nav .jour{ font-weight:600; }
.rdv-nav input[type=date]{ padding:5px 8px; border:1px solid var(--line); border-radius:8px; }
.rdv-titre{ text-align:center; font-size:16px; font-weight:700; color:var(--navy); margin:6px 0 12px; }
.liste-rdv td{ font-size:12px; padding:6px 8px; }
.liste-rdv .ck{ text-align:center; width:34px; }
.liste-rdv tr.rdv-cours td{ background:#fffaf0; box-shadow:inset 0 0 0 transparent; }
.liste-rdv tr.rdv-cours td:first-child{ box-shadow:inset 3px 0 var(--amber); }
.liste-rdv tr.rdv-rdv td:first-child{ box-shadow:inset 3px 0 var(--blue); }
.liste-rdv tr:hover td{ background:var(--navy-soft); }
.rdv-promis{ color:var(--red); font-weight:700; }
.calendrier{ width:100%; border-collapse:collapse; font-size:12px; background:#fff;
             border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.calendrier th{ background:var(--navy); color:#fff; font-weight:600; padding:8px; }
.calendrier td{ border:1px solid var(--line-2); height:38px; vertical-align:top; }
.calendrier .h-col{ width:64px; background:#f8fafc; text-align:center; font-weight:600; color:var(--muted); }
.calendrier .creneau:hover{ background:#f5f8fd; cursor:pointer; }
.calendrier .bloque{ background:repeating-linear-gradient(45deg,#f1f5f9,#f1f5f9 8px,#e7edf5 8px,#e7edf5 16px);
                     color:var(--muted); text-align:center; font-size:10px; font-weight:600; }

/* ---------- Ventes ---------- */
.vt-total td{ background:var(--navy-soft) !important; font-weight:700; color:var(--navy);
              border-top:2px solid var(--navy); }

/* ---------- Fin de mois ---------- */
.fm-mois{ display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.fm-mois label{ font-size:13px; color:var(--muted); font-weight:600; }
.fm-mois input{ padding:7px 10px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:13px; }
.fm-cartes{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; margin-bottom:8px; }
.fm-carte{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
           box-shadow:var(--shadow); padding:0; overflow:hidden; }
.fm-carte.fm-tax{ border:1px solid var(--line); }
.fm-carte.fm-tax .fm-titre{ background:var(--red-dark); }
.fm-titre{ background:var(--navy); color:#eaf0fa; margin:0; padding:9px 14px; font-size:13px; font-weight:600; }
.fm-carte .fiche{ width:auto; margin:8px 14px 12px; }
.fm-carte table.fiche td{ padding:5px 4px; }
.fm-grand td{ border-top:2px solid var(--navy); font-weight:700; color:var(--navy); padding-top:8px !important; }
.fm-tax .fm-grand td{ border-top-color:var(--red); color:var(--red-dark); }

/* ---------- Liens Internet ---------- */
.liens-grille{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; max-width:760px; }
.lien-carte{ display:block; background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
             box-shadow:var(--shadow); padding:14px 16px; text-decoration:none; transition:border .12s, box-shadow .12s; }
.lien-carte:hover{ border-color:var(--navy-2); box-shadow:var(--shadow-md); }
.lien-nom{ font-weight:700; color:var(--navy); font-size:15px; }
.lien-desc{ color:var(--muted); font-size:12.5px; margin-top:4px; }

/* ---------- Paramètres ---------- */
.param-ok{ background:var(--green-bg); color:#14532d; border:1px solid #bbf7d0; padding:10px 14px;
           border-radius:var(--radius-sm); margin-bottom:12px; max-width:560px; font-weight:600; }
.param-aide{ color:var(--muted); font-size:13px; margin:0 0 14px; }
.param-form{ display:grid; grid-template-columns:200px 360px; gap:10px 14px; align-items:center;
             max-width:600px; background:var(--card); padding:18px; border:1px solid var(--line);
             border-radius:var(--radius); box-shadow:var(--shadow); }
.param-form label{ text-align:right; color:var(--muted); font-weight:600; font-size:13px; }
.param-form input{ padding:8px 11px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:13px; }
.param-form input:focus{ outline:none; border-color:var(--navy-2); box-shadow:0 0 0 3px rgba(36,58,90,.12); }
.param-actions{ grid-column:1 / 3; text-align:right; margin-top:6px; }

/* ---------- Caisse ---------- */
.caisse-form{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
              padding:16px; margin-bottom:14px; max-width:860px; box-shadow:var(--shadow); }
.cf-grille{ display:grid; grid-template-columns:auto 140px auto 170px; gap:10px 12px; align-items:center; }
.cf-grille label{ text-align:right; color:var(--muted); font-weight:600; font-size:12.5px; }
.cf-grille input, .cf-grille select{ padding:8px 10px; border:1px solid var(--line);
                                      border-radius:var(--radius-sm); font-size:13px; }
.cf-grille .cf-large{ grid-column:2 / 5; width:100%; }
.cf-actions{ margin-top:12px; text-align:right; }

/* ============ Tableau de bord (accueil façon Costar) ============ */
.tb{ padding:14px 16px 22px; }
.tb-kpis{ display:grid; grid-template-columns:repeat(6,1fr); gap:10px; }
.tb-kpi{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
         padding:11px 13px; display:flex; flex-direction:column; gap:1px; text-decoration:none;
         box-shadow:var(--shadow); border-left:4px solid var(--navy-2); }
.tb-kpi .v{ font-size:25px; font-weight:700; color:var(--navy); line-height:1.05; }
.tb-kpi .l{ font-size:11.5px; color:var(--muted); font-weight:600; }
.tb-kpi .sub{ font-size:11px; color:var(--red); font-weight:700; margin-top:2px; }
.tb-kpi.c-atelier{ border-left-color:var(--blue); } .tb-kpi.c-atelier .v{ color:var(--blue); }
.tb-kpi.c-attend{ border-left-color:var(--amber); } .tb-kpi.c-attend .v{ color:var(--amber); }
.tb-kpi.c-arrive{ border-left-color:var(--green); } .tb-kpi.c-arrive .v{ color:var(--green); }
.tb-kpi.c-pieces{ border-left-color:var(--red); } .tb-kpi.c-pieces .v{ color:var(--red); }
.tb-kpi.c-impaye{ border-left-color:var(--red-dark); } .tb-kpi.c-impaye .v{ color:var(--red-dark); }
.tb-kpi.c-impaye:hover{ background:var(--red-soft); }

.tb-cols{ display:grid; grid-template-columns:1fr 340px; gap:14px; margin-top:14px; align-items:start; }
.tb-carte{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
           box-shadow:var(--shadow); overflow:hidden; }
.tb-carte h3{ margin:0; background:var(--navy); color:#fff; font-size:13px; font-weight:600;
              padding:8px 13px; display:flex; align-items:center; gap:8px; }
.tb-carte h3 .cpt{ margin-left:auto; background:rgba(255,255,255,.18); border-radius:999px;
                   padding:1px 9px; font-size:12px; }
.tb-side{ display:flex; flex-direction:column; gap:14px; }
.tb-vide{ padding:16px; color:var(--muted); text-align:center; font-size:12.5px; }

.tb-table{ font-size:12px; }
.tb-table tbody tr{ cursor:pointer; }
.tb-table td{ vertical-align:middle; }
.tb-table td.mono{ font-family:"Cascadia Mono",Consolas,monospace; color:var(--navy); font-weight:600; }
.tb-table td.veh{ color:#475569; } .tb-table td.promis{ color:var(--amber); font-weight:600; white-space:nowrap; }
.tb-table td.etat{ white-space:nowrap; }

.pp{ display:inline-block; font-size:10px; font-weight:700; padding:1px 6px; border-radius:999px;
     margin-right:3px; text-transform:uppercase; letter-spacing:.02em; }
.pp-atelier{ background:#e7f0ff; color:#1e3a8a; } .pp-attend{ background:var(--amber-bg); color:#92400e; }
.pp-arrive{ background:var(--green-bg); color:#14532d; } .pp-pieces{ background:var(--red-soft); color:var(--red-dark); }
.pp-estime{ background:#ede9fe; color:#5b21b6; } .pp-bon{ background:var(--navy-soft); color:var(--navy); text-transform:none; }

.tb-liste{ list-style:none; margin:0; padding:4px 0; }
.tb-liste li{ display:flex; align-items:center; gap:9px; padding:7px 13px; cursor:pointer;
              border-bottom:1px solid var(--line-2); font-size:12.5px; }
.tb-liste li:hover{ background:#f5f8fd; }
.tb-liste .h{ font-weight:700; color:var(--navy); min-width:44px; }
.tb-liste .txt{ display:flex; flex-direction:column; line-height:1.25; min-width:0; flex:1; }
.tb-liste .txt small{ color:var(--muted); font-size:11px; }
.tb-liste .solde{ margin-left:auto; font-weight:700; color:var(--red-dark); white-space:nowrap; }
.tb-tout{ display:block; padding:8px 13px; font-size:12px; color:var(--navy); text-decoration:none;
          font-weight:600; border-top:1px solid var(--line-2); }
.tb-tout:hover{ background:var(--navy-soft); }

@media(max-width:1100px){ .tb-kpis{ grid-template-columns:repeat(3,1fr); } .tb-cols{ grid-template-columns:1fr; } }

/* ============ Loupe d'article par ligne (éditeur) ============ */
.inv-pop{ position:absolute; z-index:50; background:var(--card); border:1px solid var(--navy-2);
          border-radius:8px; box-shadow:var(--shadow-md); max-height:300px; overflow-y:auto;
          font-size:12px; padding:3px; }
.inv-it{ display:grid; grid-template-columns:96px 1fr auto auto; gap:8px; align-items:center;
         padding:5px 8px; border-radius:6px; cursor:pointer; }
.inv-it:hover{ background:var(--navy-soft); }
.inv-it .inv-code{ font-family:"Cascadia Mono",Consolas,monospace; font-weight:700; color:var(--navy);
                   white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.inv-it .inv-desc{ color:#334155; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.inv-it .inv-prix{ font-weight:700; color:#14532d; white-space:nowrap; }
.inv-it .inv-stk{ font-size:10.5px; color:var(--green); background:var(--green-bg);
                  padding:1px 6px; border-radius:999px; white-space:nowrap; }
.inv-it .inv-stk.inv-rupt{ color:var(--muted); background:var(--line); }

/* ============ Nouveau client express (NIV) ============ */
.xpress{ max-width:760px; padding:6px 2px 24px; }
.xp-niv-zone{ background:var(--navy-soft); border:1px solid var(--navy-line); border-radius:var(--radius);
              padding:14px 16px; margin-bottom:16px; }
.xp-lab{ display:block; font-weight:700; color:var(--navy); font-size:13px; margin-bottom:6px; }
.xp-lab span{ font-weight:400; color:var(--muted); font-size:12px; }
.xp-niv{ width:100%; font-size:20px; letter-spacing:2px; font-family:"Cascadia Mono",Consolas,monospace;
         padding:11px 14px; border:2px solid var(--navy-2); border-radius:8px; background:#fff; }
.xp-niv:focus{ outline:none; border-color:var(--red); box-shadow:0 0 0 3px rgba(193,18,31,.15); }
.xp-veh{ margin-top:10px; font-size:14px; color:var(--muted); min-height:20px; }
.xp-veh.on{ color:var(--navy); }
.xp-veh.ok{ font-size:17px; }
.xp-veh .xp-mot{ display:block; font-size:12.5px; color:var(--muted); font-weight:400; margin-top:2px; }
.xp-dup{ margin-top:10px; background:var(--amber-bg); border:1px solid #f0c66b; color:#8a5a08;
         padding:9px 12px; border-radius:8px; font-size:12.5px; }
.xp-dup a{ color:var(--red-dark); font-weight:700; }
.xp-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px 14px; }
.xp-grid label{ display:flex; flex-direction:column; font-size:12px; color:var(--muted); font-weight:600; gap:3px; }
.xp-grid label.xp-plein{ grid-column:1 / -1; }
.xp-grid .req{ color:var(--red); font-weight:700; font-size:11px; }
.xp-grid input{ padding:8px 11px; border:1px solid var(--line); border-radius:7px; font-size:14px; }
.xp-grid input:focus{ outline:none; border-color:var(--navy-2); box-shadow:0 0 0 3px rgba(36,58,90,.12); }
.xp-check{ display:flex; align-items:center; gap:8px; margin:16px 0; font-size:13px; color:var(--ink); }
.xp-actions{ display:flex; gap:10px; }
.xp-go{ font-size:14px; padding:10px 22px; }

/* Badge « Créé ici » (document d'origine PMC = à nous, jamais effacé par la synchro Costar) */
.badge-pmc{ background:var(--green-bg); color:#14532d; border:1px solid #86c79b; border-radius:999px;
            padding:2px 10px; font-size:11px; font-weight:700; margin-left:8px; }

/* Marge interne sur le bon (jamais imprimée — @media print la cache) */
.marge-interne{ margin-top:6px; font-size:12px; color:#7c2d12; background:#fff7ed;
                border:1px dashed #fdba74; border-radius:6px; padding:5px 10px; display:inline-block; }
.marge-interne b{ color:#14532d; }
@media print{ .marge-interne{ display:none !important; } }

/* ============ Déclaration TPS/TVQ ============ */
.decl{ max-width:640px; padding:8px 2px 24px; }
.decl-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.decl-table th{ background:var(--navy-soft); color:var(--navy); text-align:left; padding:8px 12px; border-bottom:2px solid var(--navy); }
.decl-table th.num, .decl-table td.num{ text-align:right; white-space:nowrap; }
.decl-table td{ padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
.decl-table .cpt-min{ font-size:11px; color:var(--muted); font-weight:400; }
.decl-table .cpt-min.est{ color:var(--amber); }
.decl-table tr.paye td{ color:#9a0e18; }
.decl-table tr.net td{ background:var(--green-bg); font-weight:700; color:#14532d; font-size:15px; }
.decl-table tfoot td{ background:var(--navy); color:#fff; font-weight:700; padding:10px 12px; }
.decl-table tfoot .total{ font-size:18px; }
.decl-note{ margin-top:14px; background:#fff7ed; border:1px solid #fdba74; border-radius:8px;
            padding:10px 14px; font-size:12.5px; color:#7c2d12; }

/* ============================================================
   SKIN COSTAR — calqué sur les vraies captures de Costar v5.7
   (mauve des étiquettes/en-têtes + vert des champs remplis +
   statuts saturés Requis/Ouvert/Envoyé/Reçu). Surcharge ciblée
   sur l'éditeur de document, pour coller à l'écran que connaît
   l'atelier. (Pass 1 = palette + grille + légende + totaux.)
   ============================================================ */
:root{
  --cos-purple:  #8a2d8a;   /* étiquettes & en-têtes mauves de Costar */
  --cos-purple-d:#6e2370;
  --cos-green:   #bfe8bf;   /* fond vert des champs « remplis » */
  --cos-green-d: #2e9e2e;
  --cos-gold:    #d4af00;   /* statut Ouvert / lignes M */
  --cos-lav:     #7c3aed;   /* statut Envoyé */
}

/* En-tête de la grille de lignes → mauve Costar */
.grille-zone .grille th{ background:var(--cos-purple); color:#fff; }

/* Cellule Produit teintée par le STATUT (la vue ÉDITION utilise .cell-prod,
   qui n'était pas stylée → c'est pour ça qu'aucune couleur n'apparaissait). */
.cell-prod{ font-weight:600; white-space:nowrap; }
.cell-prod.p-recu,   .grille td.prod.p-recu  { background:#c7eec7; color:#0f3d12; box-shadow:inset 4px 0 var(--cos-green-d); }
.cell-prod.p-requis, .grille td.prod.p-requis{ background:#f4b4b4; color:#7a0d0d; box-shadow:inset 4px 0 var(--red); }
.cell-prod.p-envoye, .grille td.prod.p-envoye{ background:#d8c6f0; color:#3a1d6e; box-shadow:inset 4px 0 var(--cos-lav); }
.cell-prod.p-ouvert, .grille td.prod.p-ouvert{ background:#f1dd86; color:#5a4500; box-shadow:inset 4px 0 var(--cos-gold); }
.cell-prod.p-core,   .grille td.prod.p-core  { background:#f3e3a0; color:#6b5300; box-shadow:inset 4px 0 #b8860b; }
.cell-prod.p-note,   .grille td.prod.p-note  { background:#efe1a6; color:#5a4500; box-shadow:inset 4px 0 var(--cos-gold); text-align:left; }

/* Champs CLÉS remplis → vert, comme Costar (client + véhicule + dates d'état) */
.doc.edit input[name=client_nom]:not(:placeholder-shown),
.doc.edit input[name=compte]:not(:placeholder-shown),
.doc.edit input[name=annee]:not(:placeholder-shown),
.doc.edit input[name=marque]:not(:placeholder-shown),
.doc.edit input[name=modele]:not(:placeholder-shown),
.doc.edit input[name=moteur]:not(:placeholder-shown),
.doc.edit input[name=date_repare]:not([value=""]),
.doc.edit input[name=date_autorise]:not([value=""]),
.doc.edit input[name=date_facture]:not([value=""]){
  background:var(--cos-green); color:#0f3d12; font-weight:600;
}

/* Légende des statuts au-dessus de la grille (sous « Produit » dans Costar) */
.grille-legende{ display:flex; align-items:center; gap:14px; padding:6px 4px 4px;
  font-size:11px; color:var(--muted); font-weight:700; }
.grille-legende .lg{ display:inline-flex; align-items:center; gap:5px; }
.grille-legende .sw{ display:inline-block; width:16px; height:13px; border-radius:3px; }
.grille-legende .sw.p-requis{ background:#f4b4b4; box-shadow:inset 4px 0 var(--red); }
.grille-legende .sw.p-ouvert{ background:#f1dd86; box-shadow:inset 4px 0 var(--cos-gold); }
.grille-legende .sw.p-envoye{ background:#d8c6f0; box-shadow:inset 4px 0 var(--cos-lav); }
.grille-legende .sw.p-recu  { background:#c7eec7; box-shadow:inset 4px 0 var(--cos-green-d); }

/* La cellule Produit est teintée par le statut → input transparent pour
   laisser voir la couleur (comme Costar, cellule entièrement colorée). */
.cell-prod .i-produit{ background:transparent; font-weight:600; }
.cell-prod .i-produit:focus{ background:#fff; }

/* PASS 2 — grille structurellement identique à Costar (br_grid.png) :
   statut par COULEUR (pastille cliquable, plus de menu) · code taxe « GP » ·
   colonne « S.taxe » verte. */
.edit-grille td.cell-prod{ display:flex; align-items:center; gap:5px; }
.edit-grille td.cell-prod .stat-chip{ flex:none; width:11px; height:11px; border-radius:2px;
  border:1px solid rgba(0,0,0,.28); cursor:pointer; }
.edit-grille td.cell-prod .stat-chip.p-ouvert{ background:var(--cos-gold); }
.edit-grille td.cell-prod .stat-chip.p-requis{ background:var(--red); }
.edit-grille td.cell-prod .stat-chip.p-envoye{ background:var(--cos-lav); }
.edit-grille td.cell-prod .stat-chip.p-recu  { background:var(--cos-green-d); }
.edit-grille td.cell-prod .i-produit{ flex:1; min-width:0; }
/* Colonne Taxe = code « GP » cliquable (case cachée) */
.edit-grille .tax{ text-align:center; }
.edit-grille .tax .gp{ cursor:pointer; display:inline-block; }
.edit-grille .tax .gp input{ display:none; }
.edit-grille .tax .gp b{ font-size:11px; font-weight:700; color:var(--cos-purple-d); letter-spacing:.5px; }
.edit-grille .tax .gp input:not(:checked) + b{ opacity:.12; }
/* Colonne S.taxe = sous-total taxable, en vert (comme Costar) */
.edit-grille td.staxe{ text-align:right; font-weight:600; color:#0f3d12; }
.edit-grille td.staxe:not(:empty){ background:#d9f2d9; }

/* PASS 3 — fidélité d'en-tête + ligne M.O. */
/* Ligne main-d'œuvre (LAB / M.O.) → verte pleine, comme Costar */
.edit-grille tr.lrow-lab td{ background:#d3efd3; }
.edit-grille tr.lrow-lab td.cell-prod{ background:#c1e6c1; box-shadow:inset 4px 0 var(--cos-green-d); }
/* Étiquettes d'en-tête en BARRES MAUVES (client / véhicule / états), comme Costar */
.doc.edit .ligne-lab{ gap:2px; margin:4px 0 1px; }
.doc.edit .ligne-lab .lab,
.doc.edit .etat-ligne .lab{ background:var(--cos-purple); color:#fff; padding:2px 7px;
  border-radius:2px; font-size:10px; font-weight:700; letter-spacing:.2px; }
.doc.edit .ligne-lab .lab.rouge{ background:var(--cos-purple); color:#fff; }
.doc.edit .etat-ligne .lab{ text-align:left; white-space:nowrap; }

/* Barre de totaux → mauve Costar (Total · S.tax · TPS · TVQ · Avec taxes) */
.barre-totaux .totaux th{ background:var(--cos-purple); }
.barre-totaux .totaux td.final{ background:var(--cos-purple); }

/* PASS 4 (2026-06-23) — grille « tableur » comme Costar (réf. capture RDV A0029481) :
   champs de ligne SANS bordure → la couleur de statut/M.O. traverse toute la cellule
   (services/M.O. en vert plein), fines lignes de cellule, cellule active en blanc. */
/* Champs CLAIREMENT éditables (fond clair + bordure) ; le vert des lignes M.O.
   transparaît doucement ; cellule active bien éclairée au focus. */
.edit-grille .lrow input:not([type=checkbox]){ background:rgba(255,255,255,.62); border:1px solid #d7dbe3; border-radius:3px; }
.edit-grille .lrow input:not([type=checkbox]):focus{ background:#fff; border-color:var(--navy-2); box-shadow:0 0 0 2px rgba(36,58,90,.22); outline:none; }
.edit-grille .lrow td.dim{ text-align:center; }

/* Loupe d'article dans chaque cellule Produit (comme Costar : 🔍 par ligne) */
.edit-grille td.cell-prod{ position:relative; }
.edit-grille td.cell-prod .loupe{ flex:none; cursor:pointer; opacity:.4; font-size:11px; padding:0 1px; }
.edit-grille td.cell-prod .loupe:hover{ opacity:1; }

/* Lignes vides = blanches comme Costar (pas de pastille ni « GP ») */
.edit-grille .lrow.ligne-vide .stat-chip{ visibility:hidden; }
.edit-grille .lrow.ligne-vide .tax .gp b{ visibility:hidden; }

/* Loupe — boîte de recherche d'article (modal façon Costar) */
.loupe-modal{ position:fixed; inset:0; background:rgba(15,23,42,.4); z-index:2000;
  display:flex; align-items:flex-start; justify-content:center; }
.loupe-box{ background:#fff; width:660px; max-width:94vw; margin-top:7vh; border-radius:8px;
  box-shadow:0 14px 50px rgba(0,0,0,.35); overflow:hidden; }
.loupe-tete{ background:var(--cos-purple); color:#fff; padding:8px 12px; display:flex;
  align-items:center; gap:10px; font-weight:700; font-size:13px; }
.loupe-tete input{ flex:1; padding:7px 10px; border:none; border-radius:4px; font-size:14px; }
.loupe-x{ background:transparent; border:none; color:#fff; font-size:17px; cursor:pointer; line-height:1; }
.loupe-scroll{ max-height:56vh; overflow:auto; }
.loupe-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.loupe-table th{ background:#eef0f4; color:var(--ink); text-align:left; padding:6px 9px;
  position:sticky; top:0; border-bottom:2px solid var(--cos-purple); }
.loupe-table th.r{ text-align:right; }
.loupe-table td{ padding:5px 9px; border-bottom:1px solid #eef0f4; cursor:pointer; }
.loupe-table td.r{ text-align:right; white-space:nowrap; }
.loupe-table td.mono{ font-family:Consolas,monospace; font-weight:700; white-space:nowrap; }
.loupe-table tbody tr:hover td{ background:#eaf2ff; }
.loupe-table .rupt{ color:var(--red); font-weight:700; }
.loupe-vide{ text-align:center; color:#94a3b8; padding:16px; }

/* Loupe « Choix » — barre de catégories latérale (façon Costar) */
.loupe-box{ width:780px; }
.loupe-corps{ display:flex; }
.loupe-cats{ flex:none; width:152px; background:#f3eef6; border-right:1px solid #e2d8ea;
  padding:6px; display:flex; flex-direction:column; gap:3px; }
.loupe-cat{ text-align:left; background:#fff; border:1px solid #e2d8ea; border-radius:5px;
  padding:7px 10px; font-size:12.5px; cursor:pointer; color:var(--ink); }
.loupe-cat:hover{ background:#efe6f4; }
.loupe-cat.actif{ background:var(--cos-purple); color:#fff; border-color:var(--cos-purple); font-weight:700; }
.loupe-corps .loupe-scroll{ flex:1; max-height:58vh; }

/* Caisse — boutons de montants rapides */
.cv-rapide{ display:flex; gap:6px; flex-wrap:wrap; margin:4px 0 8px; }
.cv-rapide button{ background:#fff; border:1px solid var(--navy-line); border-radius:6px;
  padding:8px 14px; font-size:14px; font-weight:700; color:var(--navy); cursor:pointer; }
.cv-rapide button:hover{ background:var(--navy); color:#fff; border-color:var(--navy); }

/* Loupe « Catalogue » : panneau liens fournisseurs (← « Lien Internets » de Costar) */
.loupe-corps .loupe-droite{ flex:1; display:flex; flex-direction:column; min-width:0; }
.loupe-corps .loupe-droite .loupe-scroll{ flex:1; }
.loupe-liens{ border-top:1px solid #e2d8ea; padding:7px 10px; font-size:12px; background:#faf7fc; }
.loupe-liens .lf-titre{ font-weight:700; color:var(--cos-purple-d); }
.loupe-liens .lf-lien{ display:inline-block; margin:2px 8px 2px 0; color:var(--navy-2); text-decoration:none;
  background:#fff; border:1px solid var(--navy-line); border-radius:5px; padding:3px 8px; }
.loupe-liens .lf-lien:hover{ background:var(--navy); color:#fff; border-color:var(--navy); }

/* ============ Grille interactive façon Costar ============ */
/* Totaux TOUJOURS visibles pendant la saisie (barre collante au bas de l'écran) */
.edit .barre-totaux{ position:sticky; bottom:0; z-index:6; background:var(--bg);
                     padding:8px 4px 10px; margin-top:10px; border-top:2px solid var(--navy);
                     box-shadow:0 -4px 12px rgba(16,24,40,.08); }
/* Sélection au clavier dans la liste d'articles (↑↓) */
.inv-it.sel{ background:var(--navy); }
.inv-it.sel .inv-code, .inv-it.sel .inv-desc, .inv-it.sel .inv-prix{ color:#fff; }
.inv-it.sel .inv-stk{ background:rgba(255,255,255,.2); color:#fff; }

/* ============ ÉCRAN D'ÉDITION IDENTIQUE À COSTAR (scope .cos) ============ */
/* Fond crème + bandeaux mauves + champs blancs carrés, comme l'écran Quotation/RO de Costar. */
.doc.edit.cos{ background:#f4f1de; border:1px solid #cfc9a8; border-radius:0; padding:8px 10px 14px; }
.cos .bloc, .cos .etats{ background:#f4f1de; border:1px solid #d6d0b2; border-radius:0; box-shadow:none; }
/* Bandeaux d'étiquettes mauves (le « plum » Costar) */
.cos .ligne-lab .lab, .cos .etat-ligne .lab, .cos .veh-table th{
  background:#a1538c; color:#fff; font-size:10.5px; font-weight:700; padding:2px 6px;
  border-radius:0; text-transform:none; letter-spacing:0; }
.cos .ligne-lab{ gap:2px; margin:3px 0 1px; }
.cos .etat-ligne{ display:grid; grid-template-columns:110px 1fr; gap:2px; margin-bottom:2px; align-items:stretch; }
.cos .etat-ligne .lab{ display:flex; align-items:center; }
.cos .etat-ligne .val{ background:#fff; border:1px solid #b9b294; border-radius:0; padding:3px 6px; font-size:12px; }
/* Champs blancs carrés à la Costar */
.cos .champ, .cos input.champ{ background:#fff; border:1px solid #b9b294; border-radius:0; padding:3px 6px; font-size:12px; }
.cos .champ:focus{ outline:none; border-color:#a1538c; box-shadow:0 0 0 2px rgba(161,83,140,.18); }
.cos .champ.num{ text-align:right; }
/* Onglets du bloc Véhicule (Véhicule | Expédier à | Facturer à | Contacts | Notes) */
.cos .veh-onglets{ display:flex; gap:1px; margin-bottom:3px; }
.cos .veh-onglets span{ background:#e6e0c4; color:#4c4634; font-size:11px; padding:3px 10px;
  border:1px solid #c9c2a0; border-bottom:none; cursor:default; }
.cos .veh-onglets span.actif{ background:#a1538c; color:#fff; font-weight:700; border-color:#8a4477; }
.cos .veh-boutons{ display:flex; gap:4px; margin:3px 0; }
.cos .mini-btn{ background:#efe9cf; color:#3d3826; border:1px solid #b9b294; border-radius:0;
  font-size:11px; padding:2px 9px; cursor:pointer; text-decoration:none; }
.cos .mini-btn:hover{ background:#a1538c; color:#fff; }
.cos .veh-table{ width:100%; border-collapse:collapse; }
.cos .veh-table td{ padding:1px; }
.cos .veh-table .veh-odo{ width:86px; }
.cos .veh-table input{ width:100%; box-sizing:border-box; }
/* Grille : en-tête mauve, cellules blanches, numérotation grise (comme Costar) */
.cos .grille thead th{ background:#a1538c; color:#fff; border-bottom:1px solid #8a4477; }
.cos .grille td{ background:#fff; border-bottom:1px solid #ddd6b8; }
.cos .grille .no{ background:#efe9cf; color:#6b6450; font-weight:600; }
.cos .grille-zone{ border:1px solid #cfc9a8; border-radius:0; background:#f4f1de; }
/* Totaux : boîte à droite, en-tête mauve — Total | S.Taxe | TPS | TVQ | Avec taxes */
.cos .totaux th{ background:#a1538c; color:#fff; border-radius:0; }
.cos .totaux td{ background:#fff; border:1px solid #b9b294; }
.cos .totaux td.final{ background:#a1538c; color:#fff; font-weight:700; }
.cos.doc.edit .barre-totaux{ background:#f4f1de; border-top:2px solid #a1538c; }
/* Numéro du document en VERT vif (comme Costar) */
.cos-bar .badge-num{ background:#8ef583; color:#0b3d0b; border:1px solid #3faf3f; border-radius:0;
  font-weight:700; letter-spacing:.5px; }
/* Boutons d'ajout sous la grille, en beige Costar */
.cos .edit-toolbar{ background:#f4f1de; border-top:1px solid #d6d0b2; }
.cos .edit-toolbar .add-ligne, .cos .edit-toolbar .add-sel{
  background:#efe9cf; color:#3d3826; border:1px solid #b9b294; border-radius:0; }
.cos .edit-toolbar .add-ligne:hover{ background:#a1538c; color:#fff; }

/* ================================================================
   THÈME GLOBAL « COSTAR IDENTIQUE » (scope .cos-app)
   Copié de l'écran réel : barre grise « Formulaires » (liste plate),
   sections MAUVES en bas, fond CRÈME, listes à en-tête gris foncé.
   ================================================================ */
.cos-app{ background:#faf8e8; }
.cos-app .appli{ grid-template-columns:176px 1fr; }

/* --- Barre latérale grise, comme Costar --- */
.cos-app .cote{ background:#d8d5cb; color:#1c1c1c; box-shadow:none;
  border-right:1px solid #a8a597; position:sticky; top:0; height:100vh; overflow-y:auto; }
.cos-app .cote-h{ background:linear-gradient(180deg,#b7b4a9,#a5a296); color:#1c1c1c;
  font-weight:700; font-size:12px; padding:4px 10px; border-bottom:1px solid #8f8c80; }
.cos-app .formulaires{ list-style:none; margin:0; padding:2px 0; }
.cos-app .formulaires li a{ display:block; padding:3px 14px; color:#111; text-decoration:none;
  font-size:12px; border-radius:0; }
.cos-app .formulaires li a:hover{ background:#c8c5b9; color:#000; }
.cos-app .formulaires li a.actif{ background:#b3b0a4; color:#000; font-weight:600; box-shadow:none; }
.cos-app .cote .espace{ flex:1 1 auto; min-height:6px; }

/* --- Sections MAUVES du bas (Ventes, Rendez-vous, Clients, …) --- */
.cos-app .modules{ margin:0; padding:0; border-top:1px solid #8f8c80; }
.cos-app .mod-section{ margin:0; }
.cos-app .mod-head{ display:block; width:100%; text-align:left; border:none; cursor:pointer;
  background:linear-gradient(180deg,#a04ba0,#7d327d); color:#fff; font-weight:700; font-size:12px;
  padding:5px 12px; border-radius:0; border-bottom:1px solid #6b2a6b; }
.cos-app .mod-head:hover{ background:linear-gradient(180deg,#b158b1,#8b3a8b); }
.cos-app .mod-head.mod-aw{ background:linear-gradient(180deg,#3f6ea5,#2c5482); border-bottom-color:#234569; }
.cos-app .mod-sous{ list-style:none; margin:0; padding:2px 0; background:#e9e6da; display:none; }
.cos-app .mod-section.ouvert > .mod-sous{ display:block; }
.cos-app .mod-sous li a{ display:block; padding:3px 16px; color:#111; font-size:12px; text-decoration:none; }
.cos-app .mod-sous li a:hover{ background:#d0cdc1; }
.cos-app .mod-sous .avenir{ display:block; padding:3px 16px; color:#8a877b; font-size:12px; font-style:italic; }

/* --- Bandeau du haut (Sortie/Aide + Atelier + Notifications) --- */
.cos-app .cos-top1{ background:#efece0; border-bottom:1px solid #c9c6b8; padding:2px 8px;
  display:flex; gap:12px; }
.cos-app .cos-ico{ font-size:10.5px; color:#333; text-decoration:none; text-align:center; }
.cos-app .cos-ico span{ display:block; font-size:14px; line-height:1; }
.cos-app .cos-top2{ background:#faf8e8; border-bottom:2px solid #c9c6b8; padding:4px 12px;
  display:flex; align-items:center; gap:12px; }
.cos-app .cos-branch{ font-weight:700; font-size:13px; color:#111; }
.cos-app .cos-car{ color:#666; font-size:10px; }
.cos-app .cos-notif{ font-size:11px; text-align:center; color:#444; line-height:1.1; }
.cos-app .cos-msg{ background:linear-gradient(180deg,#a04ba0,#7d327d); color:#fff; text-decoration:none;
  font-size:11px; text-align:center; padding:3px 12px; line-height:1.1; border:1px solid #6b2a6b; }
.cos-app .cos-notif small, .cos-app .cos-msg small{ font-size:9.5px; }

/* --- Contenu : fond crème + listes à la Costar --- */
.cos-app main{ background:#faf8e8; }
.cos-app .doc{ background:transparent; }
.cos-app .module-titre{ color:#111; font-size:13px; font-weight:700; }
.cos-app .res-table thead th, .cos-app .liste-costar thead th{
  background:#54545e; color:#fff; border-radius:0; border-bottom:1px solid #3d3d46; }
.cos-app .res-table td{ background:#fff; }
.cos-app .res-table tbody tr:hover td{ background:#cfe0f7; }
.cos-app .rc-btn{ background:#efece0; color:#222; border:1px solid #a8a597; border-radius:2px; }
.cos-app .rc-btn:hover{ background:#dedbcd; }
.cos-app .rc-btn.rc-new{ background:#efece0; color:#222; }

/* --- Zone de recherche des listes, IDENTIQUE à l'écran Costar --- */
.cos-app .liste-titre{ font-weight:700; font-size:13px; color:#111; padding:4px 2px 2px; }
.cos-app .cos-rech{ display:flex; align-items:flex-start; gap:14px; background:transparent;
  border:none; box-shadow:none; padding:6px 2px; }
.cos-app .cos-rech-mid{ display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.cos-app .cos-effacer{ font-size:11px; padding:1px 10px; }
.cos-app .rc-grille{ display:grid; grid-template-columns:auto 210px; gap:2px 8px; align-items:center; }
.cos-app .rc-grille label{ text-align:right; font-weight:700; font-size:12px; color:#111; }
.cos-app .rc-grille input{ background:#fff; border:1px solid #9a978a; border-radius:0;
  padding:2px 6px; font-size:12px; height:22px; }
.cos-app .cos-radios{ display:grid; grid-template-columns:auto auto; gap:2px 10px;
  align-items:center; padding-top:18px; }
.cos-app .cos-radio-t{ font-size:11px; color:#111; }
.cos-app .cos-radios .rc-mode{ margin:0; text-align:center; }
.cos-app .cos-gros-btn{ display:inline-flex; flex-direction:column; align-items:center; gap:2px;
  background:linear-gradient(180deg,#f4f1e6,#dcd9cb); border:1px solid #9a978a; border-radius:3px;
  color:#111; font-size:11.5px; font-weight:600; padding:7px 14px; text-decoration:none; cursor:pointer; }
.cos-app .cos-gros-btn span{ font-size:17px; line-height:1; }
.cos-app .cos-gros-btn:hover{ background:linear-gradient(180deg,#fff,#e6e3d5); }
.cos-app .cos-gros-btn.cos-ok span{ color:#1c7c2a; }
.cos-app .cos-gros-btn.off{ opacity:.45; cursor:default; }
.cos-app .cos-trier{ font-weight:700; font-size:11.5px; color:#111; padding:2px 2px 3px; }
.cos-app .res-entete{ font-size:11.5px; }

/* ===== Fenêtre « Vérification des clients » (façon Costar) ===== */
.cli-recherche{ display:flex; gap:4px; align-items:center; margin-bottom:4px; }
.cli-recherche #cli-q{ flex:1; background:#fff; border:1px solid #9a978a; border-radius:0;
  padding:3px 8px; font-size:12px; height:24px; cursor:pointer; color:#333; }
.cli-recherche #cli-q:hover{ background:#eef4ff; border-color:#a1538c; }
.cli-recherche .cli-loupe{ background:linear-gradient(180deg,#f4f1e6,#dcd9cb); border:1px solid #9a978a;
  border-radius:2px; cursor:pointer; font-size:14px; padding:2px 9px; height:24px; }
.cli-recherche .cli-loupe:hover{ background:linear-gradient(180deg,#fff,#e6e3d5); }
.loupe-box.cli-box{ width:min(760px,94vw); max-height:82vh; }
.cli-box .loupe-tete{ background:#a1538c; }
#climres tr{ cursor:pointer; }
#climres tr:hover{ background:#cfe0f7; }
#climres tr.sel{ background:#2c5482; color:#fff; }
#climres tr.sel b{ color:#fff; }
#climres td{ padding:4px 8px; font-size:12px; }
#climres td.mono{ font-family:"Cascadia Mono",Consolas,monospace; color:#0b3d66; }
#climres tr.sel td.mono{ color:#cfe0f7; }
.cli-table th{ background:#54545e; color:#fff; }
.cli-table th.r, .cli-table td.r{ text-align:right; }

/* ===== Barre d'outils éditeur : Horaire + menu Historique (F6/F7/F8) façon Costar ===== */
.cos-bar .btn-horaire{ background:linear-gradient(180deg,#f4f1e6,#dcd9cb); border:1px solid #9a978a;
  border-radius:3px; color:#111; font-size:12px; padding:5px 10px; text-decoration:none; cursor:pointer; }
.cos-bar .btn-horaire:hover{ background:#fff; }
.cos-bar .histo-wrap{ position:relative; display:inline-block; }
.cos-bar .btn-histo{ background:linear-gradient(180deg,#f4f1e6,#dcd9cb); border:1px solid #9a978a;
  border-radius:3px; color:#111; font-size:12px; padding:5px 10px; cursor:pointer; }
.cos-bar .btn-histo:hover{ background:#fff; }
.cos-bar .histo-menu{ display:none; position:absolute; right:0; top:100%; margin-top:2px; z-index:80;
  background:#fff; border:1px solid #9a978a; box-shadow:0 6px 18px rgba(16,24,40,.18); min-width:230px; }
.cos-bar .histo-wrap.ouvert .histo-menu{ display:block; }
.cos-bar .histo-menu a{ display:flex; justify-content:space-between; align-items:center; gap:16px;
  padding:6px 12px; color:#111; text-decoration:none; font-size:12px; border-bottom:1px solid #eee; }
.cos-bar .histo-menu a:hover{ background:#cfe0f7; }
.cos-bar .histo-menu kbd{ background:#54545e; color:#fff; border-radius:2px; padding:0 6px; font-size:10.5px;
  font-family:"Cascadia Mono",Consolas,monospace; }

/* ===== Zone de recherche : un couple Débute/Contient PAR CHAMP (vrai Costar) ===== */
.cos-app .cos-rech-grille{ border-collapse:collapse; }
.cos-app .cos-rech-grille td, .cos-app .cos-rech-grille th{ padding:1px 4px; }
.cos-app .cos-rech-grille .cos-lab{ text-align:right; font-weight:700; font-size:12px; color:#111;
  white-space:nowrap; padding-right:8px; }
.cos-app .cos-rech-grille input[type=text], .cos-app .cos-rech-grille input:not([type]){
  width:210px; background:#fff; border:1px solid #9a978a; border-radius:0; padding:2px 6px;
  font-size:12px; height:22px; box-sizing:border-box; }
.cos-app .cos-rech-grille .cos-radio-t{ font-size:11px; font-weight:400; color:#111; text-align:center; padding:0 6px; }
.cos-app .cos-rech-grille .cos-rad{ text-align:center; }
/* ===== Colonne État : texte simple gris, comme Costar (plus de pastille colorée) ===== */
.cos-app .liste-costar td.etat-txt{ color:#444; font-size:12px; }
.cos-app .res-entete{ padding:2px 0 3px; }

/* ===== Barre latérale = ACCORDÉON COSTAR (observé à l'écran 2026-07-17) =====
   Toutes les sections sont des bandeaux MAUVES (Formulaires inclus) ; la section
   OUVERTE a un bandeau GRIS FONCÉ ; ses items sont sur fond BLANC ; l'item courant
   est surligné en gris. Une seule section ouverte à la fois (géré par cosSection). */
.cos-app .cote{ background:#faf8e8; }                  /* le fond crème passe derrière */
.cos-app .cote .mod-section.ouvert > .mod-head{        /* section ouverte = bandeau gris foncé */
  background:linear-gradient(180deg,#8a8a8a,#6f6f6f); color:#fff; border-bottom-color:#5a5a5a; }
.cos-app .cote .mod-sous{ background:#fff; }           /* items sur BLANC (pas gris) */
.cos-app .cote .mod-sous li a{ color:#111; padding:3px 14px; }
.cos-app .cote .mod-sous li a:hover{ background:#e3e3e3; }
.cos-app .cote .mod-sous li a.actif{ background:#8a8a8a; color:#fff; font-weight:600; }

/* Colonnes ajoutées à la liste (mieux que Costar) : conseiller + dépôt du client */
.cos-app .liste-costar td.conseiller{ color:#333; font-size:11.5px; white-space:nowrap; }
.cos-app .liste-costar td.depot:not(:empty){ color:#0b3d0b; background:#e8f6e8; font-weight:700; }
