:root {
  color-scheme: dark;
  --fond: #10151b;
  --carte: #1a212b;
  --carte-2: #212a35;
  --encre: #e7ecf2;
  --encre-2: #9aa7b5;
  --accent: #4aa8e0;
  --accent-fonce: #6cbcee;
  --ok: #3ecf8e;
  --alerte: #e0873a;
  --bord: #2b333f;
  font-size: 17px; /* lecture : tout le site suit (tailles en rem) */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--fond);
  color: var(--encre);
}
header {
  background: var(--carte);
  border-bottom: 1px solid var(--bord);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative; /* ancre le bouton de synchro centré */
}
header h1 { font-size: 1.05rem; margin: 14px 0; letter-spacing: 0.2px; }
header h1 span { color: var(--accent); }
nav { display: flex; gap: 4px; }
nav a {
  padding: 16px 14px;
  text-decoration: none;
  color: var(--encre-2);
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
nav a.actif { color: var(--accent); border-bottom-color: var(--accent); }
nav a:hover { color: var(--accent-fonce); }
/* 75 % de la fenêtre (plafond 1600 px sur ultra-large) : place pour les descriptions. */
main { max-width: min(75vw, 1600px); margin: 28px auto; padding: 0 24px; }
main.recherche-produit { max-width: min(97vw, 1960px); } /* ensemble complet des blocs = 1 867 px (14/09/2026) */
.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
h2 { font-size: 1rem; margin: 0 0 14px; }
.sous-titre { color: var(--encre-2); font-size: 0.88rem; margin: -8px 0 16px; }
input[type="search"], input[type="text"], input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--bord);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--fond);
  color: var(--encre);
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  cursor: pointer;
}
button:hover { background: var(--accent-fonce); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--bord); }
th { color: var(--encre-2); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.4px; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.ok { background: rgba(62, 207, 142, 0.16); color: var(--ok); }
.badge.vieux { background: rgba(224, 135, 58, 0.16); color: var(--alerte); }
.compteur { color: var(--encre-2); font-size: 0.85rem; }
.ligne-marque {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid var(--bord);
}
.ligne-marque:last-child { border-bottom: 0; }
.interrupteur { position: relative; width: 40px; height: 22px; flex: none; }
.interrupteur input { opacity: 0; width: 0; height: 0; }
.glissiere {
  position: absolute; inset: 0;
  background: #3a4552; border-radius: 99px;
  transition: background 0.15s; cursor: pointer;
}
.glissiere::before {
  content: ""; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform 0.15s;
}
.interrupteur input:checked + .glissiere { background: var(--ok); }
.interrupteur input:checked + .glissiere::before { transform: translateX(18px); }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 16px; }
.onglets button {
  background: none; color: var(--encre-2);
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 8px 14px; font-weight: 500; cursor: pointer;
}
.onglets button.actif { color: var(--accent); border-bottom-color: var(--accent); }
.onglets button:hover { color: var(--accent-fonce); background: none; }
.barre-outils { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.barre-outils input[type="search"] { flex: 1; min-width: 220px; }
/* Accès équipe : champ e-mail à l'image du champ de recherche (même gabarit, même ombre), 1,5× plus large */
.acces-ajout { margin-top: 4px; }
.acces-ajout input[type="email"] { flex: 0 1 360px; min-width: 260px; padding: 12px 16px; font-size: 1rem; box-shadow: 0 1px 3px rgba(20,40,60,0.06); }
.acces-ajout button { padding: 12px 22px; font-size: 1rem; }
.vide { color: var(--encre-2); text-align: center; padding: 26px 0; }

/* Page recherche */
.hero { text-align: center; padding: 26px 0 22px; }
.hero h2 { font-size: 1.5rem; margin: 0 0 6px; }
.hero .sous-titre { margin: 0 auto 18px; max-width: 520px; }
.recherche { display: flex; gap: 10px; max-width: 920px; margin: 0 auto; }
.recherche input[type="search"] { padding: 12px 16px; font-size: 1rem; box-shadow: 0 1px 3px rgba(20,40,60,0.06); }
.recherche button { padding: 12px 22px; font-size: 1rem; }
/* Bouton ✕ (reset) : carré rouge à droite de « Rechercher », même hauteur que lui */
.recherche .btn-reset { flex: none; width: 46px; height: 46px; padding: 0; background: #DC6464; color: #fff; font-size: 1.15rem; font-weight: 700; line-height: 1; border-radius: 8px; }
.recherche .btn-reset:hover { background: #c95656; }
/* Œil / œil barré (14/09/2026) : même carré que la croix, œil en haut, texte en bas, espacement = 3 × celui
   entre « Rechercher » et la croix avant le 1er œil (10 px de gap + 20 px), gap simple entre les deux œils. Masqué = œil barré, atténué. */
.recherche .btn-oeil { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 8px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 0.56rem; font-weight: 700; line-height: 1; letter-spacing: 0.2px; }
.recherche .btn-oeil svg { width: 18px; height: 18px; }
.recherche .btn-oeil .oeil-barre { display: none; }
.recherche .btn-oeil.masque .oeil-ouvert { display: none; }
.recherche .btn-oeil.masque .oeil-barre { display: block; }
.recherche .btn-oeil.masque { opacity: 0.5; }
/* Stocks masquables (14/09) : colonnes Stock FR / Stock EU du bloc principal ; « Prix CAP » devient le bord droit. */
.resultats-plat.sans-stock col.c-sfr, .resultats-plat.sans-stock col.c-seu, .resultats-plat.sans-stock .stock-th, .resultats-plat.sans-stock td.stock-col { display: none; }
.resultats-plat.sans-stock thead th.cap-th { border-top-right-radius: 10px; }
.resultats-plat.sans-stock tbody tr:last-child td.cap-cell { border-bottom-right-radius: 10px; }
.recherche .oeil-stock { background: #297A2D; margin-left: 20px; } .recherche .oeil-stock:hover { background: #338c38; } /* 30 px après la croix ; 10 px entre les œils (14/09) */
.recherche .oeil-pa { background: #7260EF; } .recherche .oeil-pa:hover { background: #8373f2; }
.recherche .oeil-cot { background: #D97757; } .recherche .oeil-cot:hover { background: #e08a6e; }
.compteur-res { color: var(--encre-2); font-size: 0.85rem; margin: 4px 2px 12px; }
/* Rangée compteur (gauche) + pastilles de filtre par distributeur (droite) */
.barre-res { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.barre-res .compteur-res { margin: 4px 2px 8px; }
.filtres-dist { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0 0 8px; } /* marge droite posée en JS = largeur du bloc PA */
/* Bloc Meilleur / Dernier PA masquable (14/09/2026) : colonnes, séparateur et cellules disparaissent d'un coup. */
.resultats-plat.sans-pa col.c-sep:not(.c-sep2), .resultats-plat.sans-pa col.c-pa, .resultats-plat.sans-pa .sep:not(.sep2), .resultats-plat.sans-pa .pa-th, .resultats-plat.sans-pa .pa-cell { display: none; } /* :not(.sep2) : le séparateur du bloc Cotations reste (bug du 14/09) */
.resultats-plat.sans-pa thead th:last-of-type, .resultats-plat.sans-pa tbody tr:last-child td:nth-last-child(4) { border-top-right-radius: 0; }
/* (liens « masquer / afficher » sous le tableau retirés le 14/09 : remplacés par les œils de la barre de recherche) */
/* Bloc « Cotation / Client » (14/09/2026), masquable comme le bloc PA ; plusieurs clients = une ligne par client. */
.resultats-plat.sans-cot col.c-sep2, .resultats-plat.sans-cot col.c-cot, .resultats-plat.sans-cot .sep2, .resultats-plat.sans-cot .cot-th, .resultats-plat.sans-cot .cot-cell { display: none; }
.cot-cell { font-weight: 600; }
.cot-cell.cot-client { font-weight: 500; font-size: 0.86rem; color: var(--encre-2); }
.cot-cell div { line-height: 1.35; white-space: nowrap; }
/* Coins arrondis du bloc PA quand il n'est plus le dernier : gérés par :has(+ .sep) déjà en place. */
.lien-pa { background: none; border: 0; color: var(--encre-2); font-size: 0.78rem; font-weight: 500; padding: 2px 4px; cursor: pointer; }
.lien-pa:hover { background: none; color: var(--accent); }
.chip { background: var(--carte); color: var(--encre); border: 1px solid var(--bord); border-radius: 999px; padding: 4px 11px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--carte-2); color: var(--encre); }
.chip .n { color: var(--ok); font-weight: 700; margin-left: 5px; } /* nombre d'offres en vert, comme « autorisé » (Paramètres) */
.chip.off { opacity: 0.4; text-decoration: line-through; }
.chip.off:hover { opacity: 0.7; }
/* Distributeurs n'ayant pas répondu correctement (session expirée, délai…) — discret, sous le tableau. */
.etats-dist { color: var(--encre-2); font-size: 0.82rem; margin: 10px 2px 0; }
.carte.produit { padding: 0; overflow: hidden; }
.produit-tete { padding: 14px 18px; background: var(--carte-2); border-bottom: 1px solid var(--bord); }
.produit-nom { font-weight: 600; font-size: 0.98rem; }
.produit-meta { color: var(--encre-2); font-size: 0.84rem; margin-top: 2px; }
table.offres { width: 100%; border-collapse: collapse; }
table.offres th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--encre-2); text-align: left; padding: 8px 18px; }
table.offres td { padding: 11px 18px; border-top: 1px solid var(--bord); font-size: 0.92rem; }
table.offres tr.best { background: rgba(62, 207, 142, 0.12); }
table.offres td { vertical-align: top; }
table.offres tr.best .prix-cell { color: var(--ok); font-weight: 700; }
.prix-cell { font-weight: 600; white-space: nowrap; }
.tag { display: inline-block; background: var(--ok); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.3px; }
.vide-carte { text-align: center; }

/* Pages connexion */
.page-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 32px 30px; width: 340px; box-shadow: 0 4px 20px rgba(20,40,60,0.08); }
.auth-carte h1 { font-size: 1.1rem; margin: 0 0 4px; }
.auth-carte h1 span { color: var(--accent); }
.auth-carte .sous-titre { margin: 0 0 18px; }
.auth-carte form { display: flex; flex-direction: column; gap: 10px; }
.auth-carte input { padding: 11px 14px; border: 1px solid var(--bord); border-radius: 8px; font-size: 0.95rem; }
.auth-carte button { padding: 11px; font-size: 0.95rem; margin-top: 4px; }
.auth-carte .err { color: var(--alerte); font-size: 0.85rem; margin: 10px 0 0; min-height: 1em; }
.compte { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--encre-2); }
.compte button { background: none; color: var(--accent); border: 1px solid var(--bord); padding: 5px 12px; border-radius: 7px; }
.compte button:hover { background: var(--fond); }
#carte-acces button:not(.entete-pliable) { padding: 4px 10px; font-size: 0.8rem; margin: 0 2px; } /* petits boutons du tableau ; l'en-tête pliable garde le style des sections */
.lien-bulle { background: var(--carte-2); border-color: var(--bord); margin: 12px 0; padding: 12px 14px; }
.lien-bulle input { width: 100%; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 6px; font-size: 0.82rem; background: var(--fond); color: var(--encre); }
.pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.pastille.verte { background: var(--ok); box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.22); }
.pastille.rouge { background: #e5533d; box-shadow: 0 0 0 3px rgba(229, 83, 61, 0.22); }
.pastille.grise { background: #7a8699; box-shadow: 0 0 0 3px rgba(122, 134, 153, 0.20); }
.btn-outil { padding: 7px 13px; font-size: 0.85rem; background: var(--carte-2); color: var(--encre); border: 1px solid var(--bord); border-radius: 8px; cursor: pointer; }
.btn-outil:hover { border-color: var(--accent); }

/* Bouton de synchro dans l'en-tête (onglet Paramètres). Orange (#C08A3E) : texte fixe, il
   s'atténue pendant une synchro (.occupe). */
.btn-synchro { padding: 7px 16px; font-size: 0.85rem; font-weight: 600; color: #17120a; background: #C08A3E; border: 0; border-radius: 8px; cursor: pointer; transition: opacity 0.15s ease; }
/* centré horizontalement dans l'en-tête (donc au centre de la page) */
header .entete-actions { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 10px; }
.btn-synchro:hover { background: #cf9a4e; } /* garde l'orange au survol (sinon le button:hover global le repeint en bleu) */
.btn-synchro.occupe { opacity: 0.25; cursor: progress; }
#synchro-msg { margin: 0; }

/* Sections / distributeurs pliables (Paramètres) */
.entete-pliable { width: 100%; text-align: left; background: none; color: var(--encre); border: 0; padding: 4px 0 2px; font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.entete-pliable:hover { background: none; color: var(--accent); }
.chevron { display: inline-block; width: 1em; color: var(--encre-2); }
.corps-pliable { margin-top: 8px; }
.item-pliable { border: 1px solid var(--bord); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.entete-item .pastille { margin-right: 9px; vertical-align: middle; }
.entete-item-row { display: flex; align-items: center; gap: 10px; background: var(--carte-2); border-radius: 8px; }
.entete-item-row .entete-item { flex: 0 0 250px; white-space: nowrap; background: none; border-radius: 8px 0 0 8px; } /* 250 px : « AUDIO-TECHNICA » sur une ligne (21/09/2026) */
.entete-item-row .lien-site { flex: 0 0 auto; }
.switch-rech { display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 0 14px; font-size: 0.8rem; color: var(--encre-2); cursor: pointer; white-space: nowrap; user-select: none; }
.switch-rech input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.item-pliable.inactif .entete-item b { opacity: 0.5; text-decoration: line-through; }
.axeos-corps { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.axeos-corps .barre-outils { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.axeos-corps input[type="file"] { color: var(--encre-2); font-size: 0.85rem; }
.axeos-import { padding: 8px 14px; font-size: 0.9rem; background: var(--accent); color: #04121c; border: 0; border-radius: 8px; cursor: pointer; }
.axeos-import:disabled { opacity: 0.5; cursor: not-allowed; }
.entete-item { width: 100%; text-align: left; background: var(--carte-2); color: var(--encre); border: 0; padding: 11px 14px; font-size: 0.95rem; cursor: pointer; }
.entete-item:hover { background: var(--carte-2); color: var(--accent); }
.corps-item { padding: 12px 14px; }
.lien-site { font-size: 0.82rem; color: var(--accent); text-decoration: none; white-space: nowrap; }
.lien-site:hover { text-decoration: underline; color: var(--accent-fonce); }
.lien-connexion, .lien-connexion-vide { margin-left: 15ch; font-style: italic; display: inline-block; min-width: 16ch; } /* 15 espaces après « Lien vers le site » ; largeur fixe pour aligner la colonne « Synchroniser les achats » même sans lien de connexion */
.entete-item.fixe { cursor: default; }
.entete-item.fixe:hover { color: var(--encre); }
.lien-connexion.occupe { opacity: 0.4; cursor: progress; }
.lien-achats { margin-left: 15ch; font-style: italic; }
.lien-achats.occupe { opacity: 0.4; cursor: progress; }
.msg-achats { margin-left: 8px; font-size: 0.8rem; }
.msg-connexion { margin-left: 8px; font-size: 0.8rem; }

/* Stock détaillé dans les résultats */
.reappro { color: var(--encre-2); font-style: italic; }

/* Tableau de résultats à plat (une ligne par offre, colonnes alignées) */
/* Largeurs FIGÉES en px (14/09/2026) = maximum utile mesuré + 10 % : le bloc principal ne bouge jamais,
   les blocs PA et Cotations s'ajoutent à droite. La table fait la somme des colonnes visibles (JS,
   ajusterBarre), le conteneur .deux-blocs la largeur de l'ensemble complet, centré dans la page. */
.resultats-plat { width: auto; border-collapse: collapse; table-layout: fixed; }
.resultats-plat .c-plus { width: 50px; }
.resultats-plat .c-dist { width: 170px; }   /* « AUDIO-TECHNICA » sur une ligne (135 px mesurés + 20 px de marges + 10 %, 21/09/2026) */
.resultats-plat td.dist-cell { white-space: nowrap; } /* le nom du distributeur ne se coupe jamais */
.resultats-plat .c-design { width: 660px; } /* désignation 66 caractères en gras */
.resultats-plat .c-pub, .resultats-plat .c-cap { width: 110px; } /* « 35 900,78 € » */
.resultats-plat .c-sfr { width: 154px; }    /* « 142 en approvisionnement » (à cheval FR+EU) */
.resultats-plat .c-seu { width: 110px; }
.resultats-plat .c-pa, .resultats-plat .c-cot { width: 130px; } /* « 12 989,90 € » + date ; « CRÉDIT AGRICOLE » */
.deux-blocs, .barre-res, .etats-dist { margin-left: auto; margin-right: auto; max-width: 100%; }
/* Les 4 colonnes de droite (Prix public, Prix CAP, Stock FR, Stock EU) : largeur ÉGALE (même
   espacement) et resserrée → la désignation récupère la place. */
.resultats-plat .c-num { width: 110px; } /* repli ; les largeurs par colonne priment ci-dessus */
/* Deux blocs : tableau principal | 5 px | bloc PA. Le conteneur n'a plus de fond : ce sont les
   cellules qui portent fond et bordures, la colonne « sep » reste transparente. */
.deux-blocs { overflow-x: visible; }
.resultats-plat .c-sep { width: 5px; }
.resultats-plat td.sep, .resultats-plat th.sep { background: transparent !important; border: 0 !important; padding: 0; width: 5px; }
.resultats-plat th, .resultats-plat td { background: var(--carte); }
.resultats-plat th:first-child, .resultats-plat td:first-child { border-left: 1px solid var(--bord); }
.resultats-plat th:has(+ .sep), .resultats-plat td:has(+ .sep) { border-right: 1px solid var(--bord); }
.resultats-plat .sep + th, .resultats-plat .sep + td { border-left: 1px solid var(--bord); }
.resultats-plat th:last-child, .resultats-plat td:last-child { border-right: 1px solid var(--bord); }
.resultats-plat thead th { border-top: 1px solid var(--bord); }
.resultats-plat thead th:first-child { border-top-left-radius: 10px; }
.resultats-plat thead th:has(+ .sep) { border-top-right-radius: 10px; }
.resultats-plat thead .sep + th { border-top-left-radius: 10px; }
.resultats-plat thead th:last-child { border-top-right-radius: 10px; }
.resultats-plat tbody tr:last-child td { border-bottom: 1px solid var(--bord); }
.resultats-plat tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.resultats-plat tbody tr:last-child td:has(+ .sep) { border-bottom-right-radius: 10px; }
.resultats-plat tbody tr:last-child .sep + td { border-bottom-left-radius: 10px; }
.resultats-plat tbody tr:last-child td:last-child { border-bottom-right-radius: 10px; }
.pa-cell { color: var(--encre); font-weight: 600; }
.pa-cell small { display: block; color: var(--encre-2); font-weight: 400; font-size: 0.72rem; margin-top: 2px; }
.resultats-plat .prix-cell, .resultats-plat .stock-col { padding-left: 6px; padding-right: 6px; }
.resultats-plat .prix-pub { color: var(--encre-2); font-weight: 500; } /* public = référence, discret */
.resultats-plat th { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.4px; color: var(--encre-2); font-weight: 600; padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--bord); }
.resultats-plat td { padding: 12px 10px; text-align: center; vertical-align: middle; border-top: 1px solid var(--bord); font-size: 0.98rem; }
.resultats-plat .col-design { text-align: center; padding-left: 18px; padding-right: 18px; }
.resultats-plat .ref-sub { color: var(--encre-2); font-size: inherit; margin-bottom: 2px; } /* même taille que la désignation */
.resultats-plat .ref-lien { color: var(--accent); text-decoration: none; }
.resultats-plat .ref-lien:hover { text-decoration: underline; }
/* Description : UNE seule ligne. Le texte est tronqué AU MOT en JS (ajusterDesign) pour tenir
   dans la largeur → jamais de « … » ni de mot coupé. overflow caché = simple filet de sécurité. */
.resultats-plat .design-nom { font-weight: 500; display: block; max-width: 640px; margin: 0 auto; white-space: nowrap; overflow: hidden; }
.resultats-plat .ref-sub { white-space: nowrap; }
.resultats-plat tr.grp-first td { border-top: 1px solid var(--bord); }
/* Rangée de séparation entre deux références (14/09/2026) : 8 px transparents, sans bordure ; la ligne
   qui précède ferme son groupe par une bordure basse, celle qui suit (grp-first) ouvre le sien. */
.resultats-plat tr.grp-sep td { height: 8px; padding: 0; border: 0 !important; background: transparent !important; }
.resultats-plat tr:has(+ tr.grp-sep) td:not(.sep) { border-bottom: 1px solid var(--bord); }
.resultats-plat tr:has(+ tr.grp-sep) td:first-child { border-bottom-left-radius: 8px; }
.resultats-plat tr:has(+ tr.grp-sep) td:has(+ .sep), .resultats-plat tr:has(+ tr.grp-sep) td:last-child { border-bottom-right-radius: 8px; }
.resultats-plat tr:has(+ tr.grp-sep) .sep + td { border-bottom-left-radius: 8px; }
.resultats-plat tr.grp-sep + tr.grp-first td:first-child { border-top-left-radius: 8px; }
.resultats-plat tr.grp-sep + tr.grp-first td:has(+ .sep), .resultats-plat tr.grp-sep + tr.grp-first td:last-child { border-top-right-radius: 8px; }
.resultats-plat tr.grp-sep + tr.grp-first .sep + td { border-top-left-radius: 8px; }
.resultats-plat tr.best-row td:not(.sep) { background: linear-gradient(rgba(62, 207, 142, 0.10), rgba(62, 207, 142, 0.10)), var(--carte); }
/* Nos achats (sous les résultats de la Recherche Produit) */
.achats { margin-top: 22px; }
.achats h3 { font-size: 0.95rem; margin: 0 0 6px; }
.achats-resume { color: var(--encre-2); font-size: 0.85rem; margin: 0 0 10px; }
.achats-resume b { color: var(--encre); }
.achats-table .prix-cell { font-weight: 600; }
/* Recherche Marque : fournisseurs qui n'ont ni la marque au catalogue ni d'offre en direct */
.resultats-plat tr.ligne-non td { opacity: 0.45; }

/* Contrats de service : teinte ambre discrète, référence ambre, étiquette « Contrat » — les produits restent bleus */
/* Contrats de service : fond ambre discret + référence ambre (les produits restent bleus). Pas d'étiquette. */
.resultats-plat tr.ligne-contrat td:not(.sep) { background: linear-gradient(rgba(224, 135, 58, 0.07), rgba(224, 135, 58, 0.07)), var(--carte); }
.resultats-plat tr.ligne-contrat .ref-lien { color: var(--alerte); }
.resultats-plat tr.best-row .prix-cell:not(.prix-pub) { color: var(--ok); font-weight: 700; }
.resultats-plat .prix-cell { white-space: nowrap; }
.stock-col { white-space: nowrap; font-size: 0.94rem; }
/* État textuel (EAVS : « En stock », « Réassort - expédition 5 à 7j ») centré entre Stock FR et Stock EU. */
.stock-col.etat, .stock-col.reappro { text-align: center; white-space: normal; overflow-wrap: anywhere; } /* texte long : à la ligne, jamais par-dessus le bloc PA (bug du 10/09) */
.tag-moins-cher { display: block; width: fit-content; margin: 5px auto 0; background: var(--ok); color: #08130d; font-size: 0.64rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.4px; }

/* Page État — simple */
.ligne-etat { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--bord); font-size: 1rem; }
.ligne-etat:last-child { border-bottom: 0; }
.nom-etat { font-weight: 500; }
.auth-carte .lien { background: none; color: var(--accent); border: 0; padding: 6px; font-size: 0.82rem; text-decoration: underline; margin-top: 4px; }
.auth-carte .lien:hover { background: none; }

/* ----- Création Article (11/09/2026) ----- */
/* Recherche Produit : case « + » avant le distributeur, seulement quand le mode est activé dans l'onglet.
   Le « + » est DESSINÉ (deux barres centrées), pas un glyphe : un glyphe s'asseyait trop bas dans le carré
   (retours de Nicolas du 11/09 : « trop gras », puis « plus bas »). L'état ✓ reste un glyphe. */
/* (largeur c-plus : bloc « Largeurs FIGÉES » plus haut) */
.resultats-plat th.col-plus, .resultats-plat td.col-plus { padding-left: 6px; padding-right: 6px; }
.btn-plus { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; margin: 0 auto; border-radius: 8px; font-size: 1rem; font-weight: 600; line-height: 1; vertical-align: middle; }
.btn-plus:not(.fait) { font-size: 0; }
.btn-plus:not(.fait)::before, .btn-plus:not(.fait)::after { content: ""; position: absolute; left: 50%; top: 50%; background: #fff; border-radius: 1px; transform: translate(-50%, -50%); }
.btn-plus:not(.fait)::before { width: 14px; height: 2px; }
.btn-plus:not(.fait)::after { width: 2px; height: 14px; }
.btn-plus.fait { background: var(--ok); color: #08130d; cursor: default; opacity: 1; }
.btn-plus:disabled:not(.fait) { opacity: 0.5; cursor: progress; }
/* Onglet Création Article : page large, une seule barre centrée (interrupteur + export), tableau en
   largeurs FIXES (pourcentages) → il tient toujours dans la page, jamais de barre de défilement ;
   champs sur le fond sombre, même hauteur de « bulle » (34 px) pour tous, une ligne de texte par champ. */
main.large { max-width: min(97vw, 2600px); }
.barre-mode { display: flex; justify-content: center; align-items: center; gap: 28px; margin-bottom: 18px; }
.switch-mode { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.switch-mode input { width: 20px; height: 20px; margin: 0; accent-color: var(--ok); flex: none; }
/* Envoi à l'ADV : nom du projet (objet du mail) + bouton, sur la même barre. */
.envoi-adv { display: flex; align-items: center; gap: 10px; }
.envoi-adv .champ-projet { position: relative; display: inline-block; }
.envoi-adv input[type="text"] { width: 320px; height: 34px; padding: 0 34px 0 34px; font-size: 0.9rem; text-align: center; background: var(--carte-2); color: var(--encre); border: 1px solid var(--bord); border-radius: 6px; box-shadow: none; }
/* Croix d'effacement dans le champ Projet : même rouge que le ✕ de la recherche, discrète, à droite. */
.envoi-adv #projet-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border-radius: 6px; background: #DC6464; color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.envoi-adv #projet-x:hover { background: #c95656; }
.envoi-adv .msg-envoi { font-size: 0.85rem; color: var(--encre-2); white-space: nowrap; }
.envoi-adv .msg-envoi.ok { color: var(--ok); }
.envoi-adv .msg-envoi.ko { color: #DC6464; }
.barre-creations { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.tbl-creations { table-layout: fixed; width: 100%; }
.tbl-creations th { text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.4px; color: var(--encre-2); font-weight: 600; padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--bord); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-creations td { height: 46px; padding: 5px 4px; border-top: 1px solid var(--bord); vertical-align: middle; font-size: 0.9rem; text-align: center; overflow: hidden; }
.tbl-creations td.fixe { padding: 5px 8px; white-space: nowrap; color: var(--encre-2); }
.tbl-creations td.vide { text-align: center; color: var(--encre-2); padding: 22px; }
.tbl-creations .cell { display: block; box-sizing: border-box; width: 100%; height: 34px; padding: 0 8px; font-size: 0.9rem; line-height: 32px; text-align: center; background: var(--carte-2); color: var(--encre); border: 1px solid var(--bord); border-radius: 6px; transition: box-shadow 0.2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-creations select.cell { line-height: normal; text-align: center; text-align-last: center; }
.tbl-creations .cell.code4 { text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.tbl-creations .cell.ok { box-shadow: 0 0 0 2px var(--ok); }
.tbl-creations tr.cree td { opacity: 0.45; }
.tbl-creations .chip.statut { white-space: nowrap; }
.tbl-creations .btn-x { width: 28px; height: 28px; padding: 0; background: #DC6464; color: #fff; border-radius: 6px; font-size: 0.85rem; font-weight: 700; line-height: 1; }
.tbl-creations .btn-x:hover { background: #c95656; }
/* Paramètres → Accès équipe : colonne Nom / Prénom (champ) avant l'e-mail, en-têtes et cellules centrés (11/09/2026). */
/* table.offres th (style.css) est plus spécifique que .tbl-acces th : on qualifie pour que le centrage gagne. */
table.offres.tbl-acces th, table.offres.tbl-acces td { text-align: center; vertical-align: middle; }
/* Champ sur le fond sombre de la page (retour du 11/09), pas de champ clair ici. */
.tbl-acces .nom-acces { width: 100%; min-width: 170px; padding: 6px 8px; font-size: 0.9rem; text-align: center; background: var(--carte-2); color: var(--encre); border: 1px solid var(--bord); border-radius: 6px; transition: box-shadow 0.2s ease; }
.tbl-acces .nom-acces.ok { box-shadow: 0 0 0 2px var(--ok); }

/* Paramètres → Cotations clients (14/09/2026) */
.cot-outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
.cot-outils select { height: 38px; padding: 0 10px; background: var(--carte-2); color: var(--encre); border: 1px solid var(--bord); border-radius: 8px; font-size: 0.95rem; }
.tbl-cot-apercu td, .tbl-cot-etat td { padding: 7px 12px; font-size: 0.88rem; }
.tbl-cot-apercu tr.ligne-non td { opacity: 0.5; }
.tbl-cot-apercu input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ok); }
.cot-etat { margin-top: 12px; }
.tbl-cot-etat .btn-x { width: 24px; height: 24px; padding: 0; background: #DC6464; color: #fff; border-radius: 6px; font-size: 0.75rem; font-weight: 700; line-height: 1; }
/* Bloc cotations masqué : « Dernier PA » redevient le bord droit → sa bordure droite. */
.resultats-plat.sans-cot th:nth-last-child(4), .resultats-plat.sans-cot td:nth-last-child(4) { border-right: 1px solid var(--bord); }

/* Comparatif Devis (14/09/2026) */
.tbl-comparatif { width: 100% !important; table-layout: fixed; }
.tbl-comparatif th, .tbl-comparatif td { text-align: center; }
.tbl-comparatif td.ref-cell { text-align: center; }
.tbl-comparatif td small, .tbl-comparatif th small { display: block; color: var(--encre-2); font-weight: 400; font-size: 0.74rem; margin-top: 2px; }
.tbl-comparatif .num { font-weight: 600; }
.tbl-comparatif .pa-projet { font-weight: 700; }
.tbl-comparatif .ecart.baisse { color: var(--ok); font-weight: 700; }   /* prix du jour plus bas que l'achat */
.tbl-comparatif .ecart.hausse { color: #DC6464; font-weight: 700; }     /* prix du jour plus haut */
.tbl-comparatif .attente { color: var(--encre-2); }
.tbl-comparatif tfoot th { padding: 12px 10px; border-top: 2px solid var(--bord); font-size: 0.9rem; text-transform: none; letter-spacing: 0; color: var(--encre); }
.tbl-comparatif tfoot th:first-child { text-align: right; color: var(--encre-2); }
.impact.baisse { color: var(--ok); font-weight: 600; }
.impact.hausse { color: #DC6464; font-weight: 600; }

/* Liste de produits (17/09/2026) : même tableau que la Recherche Produit. Barre = interrupteur +
   Actualiser + ✕ (vider) + les trois œils, centrée. Dans la Recherche, le « + » de la liste est
   sarcelle pour le distinguer du « + » bleu de la Création Article ; ✓ vert = dans ma liste (un clic retire). */
.recherche.barre-liste { justify-content: center; align-items: center; max-width: none; }
.recherche.barre-liste .switch-mode { margin-right: 18px; }
.btn-plus.btn-liste:not(.fait) { background: #1F9D94; }
.btn-plus.btn-liste:not(.fait):hover { background: #27b3a9; }
.btn-plus.btn-liste.fait { cursor: pointer; }
.resultats-plat th.col-liste { color: #35c9be; }
.resultats-plat .btn-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: #DC6464; color: #fff; border-radius: 6px; font-size: 0.85rem; font-weight: 700; line-height: 1; }
.resultats-plat .btn-x:hover { background: #c95656; }
.note-dist { margin-top: 4px; font-size: 0.68rem; color: var(--encre-2); font-style: italic; }
/* Champ des liens hypertexte, sous la désignation : discret, largeur de la désignation, halo vert à l'enregistrement. */
.resultats-plat .cell-lien { display: block; box-sizing: border-box; width: 100%; max-width: 640px; height: 26px; margin: 6px auto 0; padding: 0 8px; font-size: 0.72rem; text-align: center; background: var(--carte-2); color: var(--accent-fonce); border: 1px solid var(--bord); border-radius: 6px; box-shadow: none; transition: box-shadow 0.2s ease; text-overflow: ellipsis; }
.resultats-plat .cell-lien::placeholder { color: var(--encre-2); opacity: 0.6; }
.resultats-plat .cell-lien.ok { box-shadow: 0 0 0 2px var(--ok); }
/* Liste de produits : colonnes Qté et Total après « Prix CAP » (17/09/2026). Quand les stocks sont masqués,
   c'est « Total » (et non plus « Prix CAP ») qui devient le bord droit arrondi du bloc principal. */
.resultats-plat .c-qte { width: 84px; }
.resultats-plat .c-total { width: 124px; }
.resultats-plat .cell-qte { display: block; box-sizing: border-box; width: 64px; height: 32px; margin: 0 auto; padding: 0 4px; font-size: 0.95rem; font-weight: 600; text-align: center; background: var(--carte-2); color: var(--encre); border: 1px solid var(--bord); border-radius: 6px; box-shadow: none; transition: box-shadow 0.2s ease; }
.resultats-plat .cell-qte.ok { box-shadow: 0 0 0 2px var(--ok); }
.resultats-plat .total-cell { font-weight: 700; }
.resultats-plat.avec-qte.sans-stock thead th.cap-th, .resultats-plat.avec-qte.sans-stock tbody tr:last-child td.cap-cell { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.resultats-plat.avec-qte.sans-stock thead th.total-th { border-top-right-radius: 10px; border-right: 1px solid var(--bord); }
.resultats-plat.avec-qte.sans-stock td.total-cell { border-right: 1px solid var(--bord); }
.resultats-plat.avec-qte.sans-stock tbody tr:last-child td.total-cell { border-bottom-right-radius: 10px; }
.resultats-plat .ligne-total td { font-weight: 700; font-size: 1.02rem; }
.resultats-plat .ligne-total .total-lib { text-align: right; padding-right: 18px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--encre-2); font-size: 0.82rem; }
.resultats-plat .ligne-total .total-lib small { text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; }
.resultats-plat .ligne-total .total-cell { color: var(--ok); }
/* Liste de produits, 21/09/2026 : colonne d'actions ✕ ▲ ▼ (plus large, rien d'autre ne rétrécit), lignes
   Titre / Sous-total, boutons Titre / Sous-total empilés sous « Actualiser les prix ». */
.resultats-plat.liste-tbl col.c-plus { width: 122px; }
.resultats-plat td.col-actions { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.resultats-plat td.col-actions button + button { margin-left: 5px; }
.resultats-plat .btn-fleche { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: #3a4453; color: var(--encre); border-radius: 6px; font-size: 0.7rem; line-height: 1; vertical-align: middle; }
.resultats-plat .btn-fleche:hover { background: #4a5668; }
.resultats-plat .btn-fleche:disabled { opacity: 0.25; cursor: default; }
.resultats-plat .btn-x { vertical-align: middle; }
.resultats-plat .ligne-titre td { background: var(--carte-2); }
.resultats-plat .titre-cell { text-align: left; padding-left: 18px; }
.resultats-plat .cell-titre { display: block; box-sizing: border-box; width: 100%; height: 36px; padding: 0 12px; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.3px; text-align: left; background: var(--carte); color: var(--encre); border: 1px solid var(--bord); border-radius: 6px; box-shadow: none; transition: box-shadow 0.2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resultats-plat .cell-titre::placeholder { color: var(--encre-2); opacity: 0.6; font-weight: 500; }
.resultats-plat .cell-titre.ok { box-shadow: 0 0 0 2px var(--ok); }
.resultats-plat .ligne-soustotal td { font-weight: 700; background: var(--carte-2); }
.resultats-plat .ligne-soustotal .total-lib { text-align: right; padding-right: 18px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--encre-2); font-size: 0.82rem; }
.resultats-plat .ligne-soustotal .total-lib small { text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; }
.resultats-plat .ligne-soustotal .total-cell { color: var(--accent-fonce); }
/* « Actualiser les prix » reste sur la ligne de Mail, ✕ et des œils ; Titre / Sous-total sont posés EN DESSOUS,
   hors du flux (la ligne ne grandit pas), centrés sous Actualiser, de la taille de la bulle Mail (retour du 21/09). */
.barre-liste .pile-actualiser { position: relative; display: flex; align-items: center; }
.barre-liste .sous-boutons { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; white-space: nowrap; }
.recherche .btn-petit { padding: 12px 22px; font-size: 1rem; font-weight: 600; background: #3a4453; color: var(--encre); border-radius: 8px; }
.recherche .btn-petit:hover { background: #4a5668; }
main.recherche-produit .hero:has(.barre-liste) { padding-bottom: 76px; } /* place pour la rangée Titre / Sous-total */
/* Lien de la fiche produit (21/09/2026) : texte propre cliquable sous la désignation, crayon pour modifier. */
.resultats-plat .liens-fiche { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 640px; margin: 6px auto 0; white-space: nowrap; }
.resultats-plat .lien-fiche { color: var(--accent-fonce); font-size: 0.8rem; font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.resultats-plat .lien-fiche:hover { text-decoration: underline; }
.resultats-plat .sep-lien { color: var(--encre-2); font-size: 0.8rem; }
.resultats-plat .btn-lien-edit { flex: none; width: 22px; height: 22px; padding: 0; background: #3a4453; color: var(--encre-2); border-radius: 5px; font-size: 0.7rem; line-height: 1; }
.resultats-plat .btn-lien-edit:hover { background: #4a5668; color: var(--encre); }
/* Crayon du lien de la référence (21/09/2026) et champ provisoire entre référence et désignation. */
.resultats-plat .btn-crayon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; margin-left: 8px; background: #3a4453; color: var(--encre-2); border-radius: 5px; font-size: 0.68rem; line-height: 1; vertical-align: middle; transition: box-shadow 0.2s ease; }
.resultats-plat .btn-crayon:hover { background: #4a5668; color: var(--encre); }
.resultats-plat .btn-crayon.ok { box-shadow: 0 0 0 2px var(--ok); }
.resultats-plat .edit-lien { display: flex; align-items: center; gap: 6px; max-width: 640px; margin: 4px auto 6px; }
.resultats-plat .edit-lien .cell-lien { flex: 1; margin: 0; }
.resultats-plat .btn-lien-ok { flex: none; width: 26px; height: 26px; padding: 0; background: var(--ok); color: #08130d; border-radius: 6px; font-size: 0.85rem; font-weight: 700; line-height: 1; }
/* Compteur D1 (26/09/2026) : bas gauche, discret, fixe. */
.quota-d1 { position: fixed; left: 14px; bottom: 12px; z-index: 50; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--carte); border: 1px solid var(--bord); color: var(--encre-2); font-size: 0.72rem; line-height: 1; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.35); cursor: default; }
.quota-d1 b { color: var(--encre); font-weight: 700; letter-spacing: 0.3px; }
.quota-d1 .barre { display: inline-block; width: 70px; height: 6px; border-radius: 99px; background: var(--carte-2); overflow: hidden; }
.quota-d1 .barre i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.quota-d1.orange .barre i { background: var(--alerte); }
.quota-d1.rouge .barre i { background: #DC6464; }
.quota-d1.rouge { border-color: #DC6464; color: var(--encre); }
.quota-d1.inconnu { opacity: 0.6; }
