:root {
  --g-accent: #0070E0;
  --g-texte: #1c2024;
  --g-texte-doux: #6b7280;
  --g-fond-alt: #f6f7f8;
  --g-bordure: #e2e5e9;
  --g-rayon: 8px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; color: var(--g-texte); background: var(--g-fond-alt); }
a { color: var(--g-accent); }

.g-barre {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  height: 68px;
  background: #0B1A2E;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.g-marque {
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  font-size: 17px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.g-marque span { color: var(--g-accent); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

.g-nav { display: flex; align-items: stretch; gap: 4px; height: 100%; }
.g-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 16px;
  border-radius: 8px;
  text-decoration: none;
  color: #b7bac0;
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
  margin: 10px 0;
  transition: background 0.15s, color 0.15s;
}
.g-nav-icone { width: 20px; height: 20px; }
.g-nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.g-nav-item-actif, .g-nav-item-actif:hover { background: var(--g-accent); color: #fff; }

.g-compte { margin-left: auto; display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.g-qui { text-align: right; line-height: 1.25; }
.g-qui span { font-weight: 600; font-size: 13px; display: block; color: #fff; }
.g-qui small { color: #9a9da3; font-size: 11.5px; }
.g-lien { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--g-accent); }

.g-corps { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

.g-entete-page { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.g-entete-page h1 { margin: 0; font-size: 1.4rem; }
.g-lien-retour { font-size: 0.88rem; text-decoration: none; color: var(--g-texte-doux); }

.g-bouton {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  background: var(--g-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}
.g-bouton-discret { background: #fff; color: var(--g-texte); border: 1px solid var(--g-bordure); }
.g-bouton-danger { background: #fff; color: var(--g-accent); border: 1px solid var(--g-accent); margin-left: 0.6rem; }

.g-recherche { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; }
.g-recherche input { flex: 1; max-width: 320px; padding: 0.55rem 0.8rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; }

.g-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--g-rayon); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.g-table th, .g-table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--g-bordure); font-size: 0.9rem; }
.g-table th { background: var(--g-fond-alt); font-size: 0.78rem; text-transform: uppercase; color: var(--g-texte-doux); }
.g-table-image img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; background: var(--g-fond-alt); }
.g-table-filtres th { background: #fff; padding-top: 0.4rem; padding-bottom: 0.6rem; }
.g-table-filtres input, .g-table-filtres select { width: 100%; padding: 0.4rem 0.55rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; font-size: 0.85rem; }
.g-table-filtres button { width: 100%; padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.85rem; }
.g-table-actions { display: flex; gap: 0.8rem; white-space: nowrap; }
.g-vide { text-align: center; color: var(--g-texte-doux); padding: 2rem !important; }

.g-pagination { display: flex; gap: 0.4rem; margin-top: 1.2rem; }
.g-pagination a { display: inline-block; padding: 0.4rem 0.7rem; border: 1px solid var(--g-bordure); border-radius: 6px; text-decoration: none; color: var(--g-texte); font-size: 0.85rem; }
.g-page-active { background: var(--g-accent); color: #fff !important; border-color: var(--g-accent) !important; }

.g-formulaire { background: #fff; padding: 1.5rem; border-radius: var(--g-rayon); box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 1.1rem; width: 100%; }
.g-champ { display: flex; flex-direction: column; gap: 0.35rem; }
.g-champ label { font-size: 0.82rem; font-weight: 700; color: var(--g-texte-doux); }
.g-champ input, .g-champ textarea, .g-champ select { padding: 0.55rem 0.75rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; }
.g-champ-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; align-items: end; }
.g-case { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.g-tarif-ligne { align-items: center; margin-bottom: 0.5rem; grid-template-columns: 1fr 1fr auto; }
.g-tarif-ligne input { width: 100%; }
.g-tarif-ligne button { flex: 0 0 auto; }
.g-tarif-entete { grid-template-columns: 1fr 1fr auto; font-size: 0.78rem; text-transform: uppercase; color: var(--g-texte-doux); margin-bottom: 0.2rem; }
.g-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.g-fiche-entete { display: flex; gap: 1.2rem; align-items: flex-start; }
.g-fiche-image { flex: 0 0 auto; }
.g-fiche-image img { width: 96px; height: 96px; object-fit: contain; border-radius: 8px; background: var(--g-fond-alt); border: 1px solid var(--g-bordure); }
.g-image-vide { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.75rem; color: var(--g-texte-doux); background: var(--g-fond-alt); border-radius: 8px; border: 1px dashed var(--g-bordure); padding: 0.4rem; }
.g-champ-fichier { display: block; margin-top: 0.6rem; font-size: 0.78rem; color: var(--g-texte-doux); }
.g-champ-fichier::file-selector-button {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  margin-right: 0.6rem;
  background: #fff;
  color: var(--g-texte);
  border: 1px solid var(--g-bordure);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.g-champ-fichier::file-selector-button:hover { background: var(--g-fond-alt); }
.g-fiche-identite { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }

.g-cases-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.4rem 1rem; max-height: 260px; overflow-y: auto; padding: 0.8rem; border: 1px solid var(--g-bordure); border-radius: 6px; }
.g-cases-categories-arbre { grid-template-columns: 1fr; max-height: 340px; }
.g-case-profondeur-0 { font-weight: 700; }
.g-case-profondeur-1 { color: var(--g-texte); }
.g-case-profondeur-2 { color: var(--g-texte-doux); font-size: 0.88rem; }

.g-editeur-html { background: #fff; }
.g-editeur-html .ql-container { min-height: 8rem; font-size: 0.95rem; }
#g-editeur-resume .ql-container { min-height: 4rem; }

.g-consultation { display: flex; gap: 2rem; align-items: flex-start; background: #fff; padding: 1.5rem; border-radius: var(--g-rayon); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.g-consultation-image { flex: 0 0 260px; }
.g-consultation-image img { width: 100%; border-radius: 8px; background: var(--g-fond-alt); object-fit: contain; }
.g-consultation-details { flex: 1; min-width: 0; }
.g-consultation-details h2 { font-size: 1rem; margin: 1.2rem 0 0.5rem; }
.g-table-fiche { width: 100%; border-collapse: collapse; }
.g-table-fiche th, .g-table-fiche td { text-align: left; padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--g-bordure); font-size: 0.9rem; }
.g-table-fiche th { color: var(--g-texte-doux); font-weight: 600; width: 220px; }
.g-html { font-size: 0.92rem; line-height: 1.5; }
.g-html img { max-width: 100%; }

.g-recherche-dolibarr { margin-bottom: 1.2rem; }
.g-recherche-dolibarr h2 { margin: 0 0 0.8rem; font-size: 1rem; }
.g-resultats-dolibarr { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.4rem; max-height: 260px; overflow-y: auto; }
.g-resultat-dolibarr { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--g-fond-alt); font-size: 0.9rem; }
.g-recherche-dolibarr .g-note { margin: 0.8rem 0 0; }

.g-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.g-kpi { background: #fff; padding: 1.1rem 1.3rem; border-radius: var(--g-rayon); box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 0.4rem; }
.g-kpi-label { font-size: 0.8rem; color: var(--g-texte-doux); font-weight: 600; }
.g-kpi-valeur { font-size: 1.6rem; font-weight: 800; }
.g-tableau-bord-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; margin-bottom: 1.2rem; }
.g-carte-graphique { margin-top: 0; }

.g-reglages-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.g-carte { background: #fff; padding: 1.2rem; border-radius: var(--g-rayon); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.g-carte h2 { margin: 0 0 0.8rem; font-size: 1rem; }
.g-liste-reglage { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; max-height: 260px; overflow-y: auto; }
.g-liste-reglage li { display: flex; align-items: center; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px solid var(--g-fond-alt); font-size: 0.9rem; }
.g-liste-reglage form { margin: 0; }
.g-ligne-editable { flex-wrap: wrap; }
.g-form-edition { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; flex: 1; }
.g-form-edition[hidden] { display: none; }
.g-form-edition input { padding: 0.35rem 0.5rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; }
.g-form-edition input[name="nom"] { flex: 1; min-width: 120px; }
.g-actions-ligne { display: flex; gap: 0.4rem; align-items: center; }
.g-actions-ligne[hidden] { display: none; }
.g-ajout-reglage { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.g-ajout-reglage input, .g-ajout-reglage select { flex: 1; min-width: 120px; padding: 0.5rem 0.7rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; }

.g-erreur { background: #fdecea; color: #b91c1c; padding: 0.7rem 1rem; border-radius: 6px; font-size: 0.88rem; }
.g-note { color: var(--g-texte-doux); font-size: 0.88rem; margin: -0.6rem 0 1.2rem; max-width: 640px; }
.g-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--g-fond-alt); font-size: 0.78rem; color: var(--g-texte-doux); }
.g-badge-ok { background: #e7f6ec; color: #1f6b3b; }
.g-vide-inline { color: var(--g-texte-doux); font-style: italic; }
.g-utilisateur-ligne { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; flex-wrap: wrap; }
.g-texte-doux { color: var(--g-texte-doux); font-size: 0.85rem; }

.g-connexion { max-width: 360px; margin: 4rem auto; background: #fff; padding: 2rem; border-radius: var(--g-rayon); box-shadow: 0 1px 3px rgba(0,0,0,0.08); display: flex; flex-direction: column; gap: 1rem; }
.g-connexion h1 { text-align: center; font-size: 1.3rem; margin: 0 0 0.5rem; }
.g-connexion h1 span { color: var(--g-accent); }
.g-connexion label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--g-texte-doux); margin-bottom: 1rem; }
.g-connexion input { width: 100%; margin-top: 0.35rem; padding: 0.6rem 0.8rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; }

/* ================================================================
 * Emailing — porté depuis doemo-print-site/gestion/assets/atelier.css
 * (bloc .em-*, même compte o2switch sc1bolo7394, site différent).
 * Classes .em-* laissées telles quelles (propres à l'emailing, sans
 * collision possible ici). Deux adaptations faites en portant ce bloc :
 *   1) Jetons de couleur : var(--at-bord/--at-gris/--at-noir) → les
 *      équivalents de ce fichier (--g-bordure/--g-texte-doux/--g-texte).
 *      var(--at-cyan) et var(--at-magenta) étaient les deux couleurs
 *      d'identité « impression CMJN » de doemo-print (cyan/magenta) :
 *      remplacées par le seul accent de planeo-securite.fr, var(--g-accent)
 *      (#d62828) — y compris la valeur RGB en dur de .em-heatmap td
 *      (0,174,239 → 214,40,40, soit #d62828). var(--at-rouge), une
 *      couleur de danger sans lien avec la marque, devient #b91c1c
 *      (déjà la couleur d'erreur de .g-erreur ci-dessus).
 *   2) Classes d'habillage générique de l'atelier doemo-print, absentes
 *      de ce fichier : .at-bouton → .g-bouton, .at-note → .g-note,
 *      .at-form/.at-form-ligne → .g-formulaire/.g-champ-ligne (déjà
 *      définis plus haut). .at-lien-doux, entièrement définie dans ce
 *      bloc, est reprise sous .g-lien-doux pour rester dans la même
 *      convention de préfixe. À vérifier : que les vues emailing de
 *      planeo-securite.fr (portées en parallèle) posent bien ces classes-là sur
 *      leurs boutons/notes/formulaires — sinon ces règles ne
 *      s'appliqueront simplement pas (aucune casse, juste pas de style).
 * ================================================================ */
.em-nav { display:flex; flex-wrap:wrap; gap:.25rem; margin:-.4rem 0 1rem; border-bottom:1px solid var(--g-bordure); padding-bottom:.5rem; }
.em-nav a { padding:.35rem .7rem; border-radius:6px; font-size:.86rem; font-weight:600; color:var(--g-texte-doux); text-decoration:none; }
.em-nav a:hover { background:#fff; color:var(--g-texte); }
.em-nav a.actif { background:var(--g-texte); color:#fff; }
.em-deux { display:grid; grid-template-columns:1fr 1fr; gap:1rem; align-items:start; }
.em-deux-large { grid-template-columns:minmax(0,1.25fr) minmax(320px,1fr); }
.em-deux-chat { grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr); }
@media (max-width:1000px) { .em-deux, .em-deux-large, .em-deux-chat { grid-template-columns:1fr; } }
.em-carte-tete { display:flex; justify-content:space-between; align-items:center; gap:.8rem; flex-wrap:wrap; margin-bottom:.5rem; }
.em-carte-tete h2 { margin:0; }
.em-btn-court { width:auto; margin-top:0; padding:.45rem .9rem; font-size:.9rem; }
.em-inline { display:inline; }
.em-inline .g-bouton { margin-top:0; }
.g-lien-doux { background:none; border:0; padding:0; font:inherit; font-size:.86rem; color:var(--g-texte-doux); text-decoration:underline; cursor:pointer; }
.g-lien-doux:hover { color:var(--g-texte); }
.em-badge { display:inline-block; font-size:.72rem; font-weight:700; letter-spacing:.03em; padding:.14rem .5rem; border-radius:999px; vertical-align:middle; white-space:nowrap; }
.em-badge-vert { background:#E3F5EA; color:#14572F; }
.em-badge-orange { background:#FFF1DB; color:#8A4B00; }
.em-badge-rouge { background:#FDEDED; color:#8C1F1F; }
.em-badge-bleu { background:#E1F3FB; color:#065A79; }
.em-badge-gris { background:#EEF1F4; color:#4A535D; }
.em-table { font-size:.88rem; }
.em-table th, .em-table td { text-align:left; white-space:normal; vertical-align:top; }
.em-table td .g-note { font-size:.78rem; }
.em-url a { font-size:.8rem; word-break:break-all; }
.em-filtres { display:flex; flex-wrap:wrap; gap:.3rem; margin:.4rem 0 .8rem; }
.em-filtres a { padding:.3rem .65rem; border-radius:999px; border:1px solid var(--g-bordure); background:#fff; font-size:.82rem; color:var(--g-texte-doux); text-decoration:none; }
.em-filtres a span { font-weight:700; color:var(--g-texte); margin-left:.2rem; }
.em-filtres a.actif { background:var(--g-texte); color:#fff; border-color:var(--g-texte); }
.em-filtres a.actif span { color:#fff; }
.em-filtres-form { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; }
.em-filtres-form input, .em-filtres-form select { font:inherit; font-size:.88rem; padding:.42rem .6rem; border:1px solid var(--g-bordure); border-radius:6px; background:#fff; }
.em-filtres-form input[type=search] { min-width:240px; }
.em-court { width:7.5rem !important; }
.em-recherche { font:inherit; font-size:.88rem; padding:.4rem .6rem; border:1px solid var(--g-bordure); border-radius:6px; }
.em-pagination { margin-top:.8rem; font-size:.88rem; color:var(--g-texte-doux); }
.em-pagination a { margin-left:.6rem; }
.em-liens { margin:.3rem 0 0 1.1rem; font-size:.9rem; line-height:1.55; }
.em-liens li { margin-bottom:.3rem; }
.em-fiche { width:100%; font-size:.9rem; border-collapse:collapse; }
.em-fiche th { text-align:left; font-weight:600; color:var(--g-texte-doux); width:38%; padding:.35rem .5rem .35rem 0; vertical-align:top; }
.em-fiche td { padding:.35rem 0; }
.em-code, .em-html { width:100%; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.78rem; padding:.6rem .7rem; border:1px solid var(--g-bordure); border-radius:6px; background:#FAFBFC; }
.em-code-inline { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.78rem; word-break:break-all; background:#F3F5F7; padding:.15rem .35rem; border-radius:4px; }
.em-h3 { font-size:.95rem; margin:1rem 0 .4rem; }
.em-form-apercu { display:flex; justify-content:center; padding:1rem; background:#F3F5F7; border-radius:8px; }
.em-details { margin-top:.6rem; }
.em-details summary { cursor:pointer; font-size:.86rem; font-weight:600; color:var(--g-texte-doux); }
.em-hr { border:0; border-top:1px solid var(--g-bordure); margin:.9rem 0; }
.em-actions-cellule { white-space:nowrap; }
.em-ligne-active td { background:#F7FBFE; }
.em-journal { list-style:none; margin:0; padding:0; font-size:.84rem; }
.em-journal li { padding:.3rem 0; border-bottom:1px solid #EEF1F4; }
/* Cases et formulaires */
.em-cases { display:flex; flex-wrap:wrap; gap:.35rem .9rem; margin:.3rem 0 .5rem; }
.em-case { display:flex; gap:.45rem; align-items:flex-start; font-size:.88rem; font-weight:500 !important; color:var(--g-texte) !important; cursor:pointer; }
.em-case input { margin-top:.2rem; }
.em-avec-bouton { display:flex; gap:.5rem; align-items:center; }
.em-avec-bouton input, .em-avec-bouton select { flex:1; min-width:0; font:inherit; padding:.5rem .65rem; border:1px solid var(--g-bordure); border-radius:6px; background:#fff; }
.em-avec-bouton .g-bouton { margin-top:0; white-space:nowrap; }
.g-formulaire textarea, .g-formulaire select, .g-formulaire input[type=number], .g-formulaire input[type=tel], .g-formulaire input[type=url], .g-formulaire input[type=datetime-local], .g-formulaire input[type=file] { font:inherit; padding:.55rem .7rem; border:1px solid var(--g-bordure); border-radius:6px; background:#fff; width:100%; }
.g-formulaire textarea:focus, .g-formulaire select:focus { outline:2px solid var(--g-accent); outline-offset:1px; }
.g-formulaire .g-champ-ligne label { display:block; }
.em-modes { display:flex; gap:.6rem; align-items:center; font-size:.86rem; }
.em-modes label { font-weight:600; color:var(--g-texte-doux); cursor:pointer; }
/* Modèles */
.em-modeles-grille { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:.7rem; }
.em-modeles-grille-large { grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); }
.em-modele-carte { display:flex; flex-direction:column; gap:.3rem; border:1px solid var(--g-bordure); border-radius:8px; padding:.8rem; background:#fff; font-size:.88rem; }
.em-modele-carte iframe { width:100%; height:190px; border:1px solid #EEF1F4; border-radius:6px; background:#f2f4f6; pointer-events:none; }
.em-modele-carte .g-note { font-size:.78rem; flex:1; }
.em-modele-actions { display:flex; gap:.6rem; align-items:center; margin-top:.3rem; }
.em-modele-actions .g-bouton { margin-top:0; }
/* IA */
.em-ia-carte { border-left:4px solid var(--g-accent); }
.em-ia-ligne { display:flex; gap:.5rem; }
.em-ia-ligne input { flex:1; font:inherit; padding:.5rem .65rem; border:1px solid var(--g-bordure); border-radius:6px; }
.em-ia-ligne .g-bouton { margin-top:0; }
.em-objets { display:flex; flex-direction:column; gap:.3rem; margin:.4rem 0; }
.em-objets .em-palette-btn { text-align:left; }
.em-idee { border-top:1px solid #EEF1F4; padding:.7rem 0; font-size:.9rem; }
.em-idee p { margin:.25rem 0; }
.em-idee .g-bouton { margin-top:.3rem; }
.em-conseil { background:#FFF7E6; border-radius:6px; padding:.6rem .8rem; font-size:.88rem; margin-top:.6rem; }
.em-suggestions { display:flex; flex-direction:column; gap:.35rem; }
.em-suggestions .em-palette-btn { text-align:left; white-space:normal; }
/* Éditeur de blocs */
.em-blocs { display:flex; flex-direction:column; gap:.5rem; margin:.4rem 0 .8rem; }
.em-bloc { border:1px solid var(--g-bordure); border-radius:8px; background:#fff; }
.em-bloc.em-drag { opacity:.5; }
.em-bloc.em-cible { outline:2px dashed var(--g-accent); outline-offset:2px; }
.em-bloc-tete { display:flex; align-items:center; gap:.5rem; padding:.45rem .6rem; background:#F8FAFC; border-bottom:1px solid #EEF1F4; border-radius:8px 8px 0 0; font-size:.86rem; }
.em-bloc-poignee { cursor:grab; color:#9AA4AE; letter-spacing:-.1em; user-select:none; }
.em-bloc-actions { margin-left:auto; display:flex; gap:.2rem; }
.em-mini { font:inherit; font-size:.76rem; padding:.15rem .45rem; border:1px solid var(--g-bordure); border-radius:5px; background:#fff; cursor:pointer; color:var(--g-texte-doux); }
.em-mini:hover { border-color:var(--g-texte-doux); color:var(--g-texte); }
.em-mini-danger:hover { border-color:#b91c1c; color:#b91c1c; }
.em-bloc-corps { padding:.55rem .6rem .35rem; }
.em-bloc-ligne { display:block; margin-bottom:.45rem; }
.em-bloc-ligne > span:first-child { display:block; font-size:.74rem; font-weight:600; color:var(--g-texte-doux); margin-bottom:.15rem; }
.em-bloc-champ { width:100%; font:inherit; font-size:.9rem; padding:.42rem .55rem; border:1px solid var(--g-bordure); border-radius:6px; background:#fff; }
.em-bloc-champ:focus { outline:2px solid var(--g-accent); outline-offset:1px; }
textarea.em-bloc-champ { resize:vertical; line-height:1.45; }
.em-bloc-ia { display:flex; gap:.25rem; flex-wrap:wrap; margin-top:.3rem; }
.em-palette { display:flex; flex-wrap:wrap; gap:.3rem; align-items:center; }
.em-palette-btn { font:inherit; font-size:.8rem; padding:.3rem .6rem; border:1px solid var(--g-bordure); border-radius:999px; background:#fff; cursor:pointer; color:var(--g-texte); }
.em-palette-btn:hover { border-color:var(--g-texte-doux); }
.em-palette-btn.actif { background:var(--g-texte); color:#fff; border-color:var(--g-texte); }
/* Aperçu */
.em-col-cote { position:sticky; top:.8rem; }
@media (max-width:1000px) { .em-col-cote { position:static; } }
.em-apercu-cadre { background:#f2f4f6; border:1px solid var(--g-bordure); border-radius:8px; padding:.6rem; display:flex; justify-content:center; overflow:auto; }
.em-apercu-cadre iframe { width:600px; max-width:100%; height:560px; border:0; background:#f2f4f6; transition:width .2s; }
.em-apercu-fixe { width:100%; height:640px; border:1px solid var(--g-bordure); border-radius:8px; background:#f2f4f6; }
.em-spam-points { margin:.3rem 0 .5rem 1rem; font-size:.86rem; }
.em-spam-points li { margin-bottom:.2rem; padding-left:.2rem; }
.em-pt-rouge { color:#8C1F1F; } .em-pt-orange { color:#8A4B00; } .em-pt-gris { color:var(--g-texte-doux); } .em-pt-vert { color:#14572F; }
.em-carte-envoi { border-left:4px solid var(--g-accent); }
.em-barre-fixe { position:sticky; bottom:0; display:flex; gap:.8rem; align-items:center; padding:.6rem .9rem; margin-top:.6rem; background:rgba(243,245,247,.95); border-top:1px solid var(--g-bordure); backdrop-filter:blur(4px); z-index:5; }
.em-barre-fixe .g-bouton { margin-top:0; }
.em-non-sauve { color:#8A4B00; font-weight:600; }
/* Segments */
.em-regle { display:flex; gap:.5rem; align-items:center; padding:.35rem 0; border-bottom:1px solid #EEF1F4; font-size:.88rem; }
.em-regle > span { flex:1; }
.em-regle input, .em-regle select { font:inherit; font-size:.86rem; padding:.35rem .5rem; border:1px solid var(--g-bordure); border-radius:6px; }
.em-regle-badge { display:inline-block; background:#EEF1F4; border-radius:4px; padding:.05rem .4rem; font-size:.76rem; margin:.1rem .1rem 0 0; }
.em-compte-segment { margin:.6rem 0; font-size:.9rem; }
.em-compte-segment strong { font-size:1.2rem; }
.em-exemples { margin-top:1rem; }
/* Statistiques */
.em-heatmap table { border-collapse:separate; border-spacing:2px; font-size:.7rem; }
.em-heatmap th { font-weight:600; color:var(--g-texte-doux); padding:0 .15rem; }
.em-heatmap td { width:1.35rem; height:1.35rem; border-radius:3px; background:rgba(214,40,40,calc(.08 + var(--i,0) * .92)); }
/* Assistant */
.em-chat { display:flex; flex-direction:column; min-height:520px; }
.em-chat-fil { flex:1; overflow-y:auto; max-height:60vh; display:flex; flex-direction:column; gap:.6rem; padding:.3rem .2rem .8rem; }
.em-msg { max-width:88%; padding:.65rem .9rem; border-radius:12px; font-size:.92rem; line-height:1.5; white-space:pre-wrap; position:relative; }
.em-msg-utilisateur { align-self:flex-end; background:var(--g-texte); color:#fff; border-bottom-right-radius:3px; }
.em-msg-assistant { align-self:flex-start; background:#F3F5F7; border-bottom-left-radius:3px; }
.em-msg-action { align-self:flex-start; background:#E3F5EA; color:#14572F; font-size:.84rem; }
.em-msg-erreur { background:#FDEDED; color:#8C1F1F; }
.em-msg-date { display:block; font-size:.68rem; opacity:.6; margin-top:.3rem; }
.em-chat-saisie { display:flex; gap:.5rem; align-items:flex-end; border-top:1px solid var(--g-bordure); padding-top:.7rem; }
.em-chat-saisie textarea { flex:1; font:inherit; padding:.55rem .7rem; border:1px solid var(--g-bordure); border-radius:8px; resize:none; }
.em-chat-saisie .g-bouton { margin-top:0; }
/* Catégories de contacts (23/09/2026) : la pastille prend la couleur choisie. */
.em-cat { --cat:#4A535D; background:color-mix(in srgb, var(--cat) 14%, #fff); color:var(--cat); border:1px solid color-mix(in srgb, var(--cat) 35%, #fff); }
.em-masse { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; padding:.5rem .7rem; background:#F8FAFC; border:1px solid var(--g-bordure); border-radius:8px; margin-bottom:.6rem; font-size:.88rem; }
.em-masse select { font:inherit; font-size:.88rem; padding:.35rem .5rem; border:1px solid var(--g-bordure); border-radius:6px; }
.em-masse .g-bouton { margin-top:0; }
.em-analyse { border-left:4px solid var(--g-accent); }
.em-mapping select { font:inherit; font-size:.86rem; padding:.3rem .5rem; border:1px solid var(--g-bordure); border-radius:6px; }
.em-mapping .g-bouton { margin-top:.5rem; margin-right:.6rem; }

/* ================================================================
 * Vérification faite après coup (les vues emailing/*.php étaient portées
 * en parallèle du bloc .em-* ci-dessus, par un autre agent) : elles posent
 * en fait les classes d'HABILLAGE GÉNÉRIQUE de l'atelier doemo-print
 * (.at-bouton, .at-carte, .at-note…), pas les .g-*/.em-* déjà définies plus
 * haut. Sans ces règles, boutons/cartes/formulaires des 17 vues restaient
 * NUS (pas de style, mais pas de casse non plus). Reprises ici depuis
 * gestion/assets/atelier.css avec les mêmes jetons que le reste de ce
 * fichier (--g-accent au lieu de --at-cyan/--at-magenta, --g-texte au lieu
 * de --at-noir, --g-texte-doux au lieu de --at-gris, --g-bordure au lieu de
 * --at-bord). `.at-fil`/`.at-sauvegarde`/`.at-saisie`/`.at-input`/`.at-effacer`
 * n'existent nulle part dans la référence (introduites par le port) : traitement
 * raisonnable inventé ici, cohérent avec le reste.
 * ================================================================ */
.at-titre { margin-bottom: 1.1rem; }
.at-titre h1 { font-size: 1.4rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
.at-lead { color: var(--g-texte-doux); margin-top: 0.15rem; }

.at-carte { background: #fff; border: 1px solid var(--g-bordure); border-radius: var(--g-rayon); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.at-carte h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }

.at-note { color: var(--g-texte-doux); font-size: 0.88rem; }
.at-aide { color: var(--g-texte-doux); font-size: 0.84rem; margin-top: 0.5rem; }
.at-lien-doux { background: none; border: 0; padding: 0; font: inherit; font-size: 0.86rem; color: var(--g-texte-doux); text-decoration: underline; cursor: pointer; }
.at-lien-doux:hover { color: var(--g-texte); }

.at-ok, .at-ko { border-radius: 7px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; font-size: 0.92rem; }
.at-ok { background: #EAF7EF; border-left: 3px solid #1f6b3b; color: #14572F; }
.at-ko { background: #FDEDED; border-left: 3px solid #b91c1c; color: #8C1F1F; }

.at-form { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.7rem; }
.at-form label { font-size: 0.82rem; font-weight: 600; color: var(--g-texte-doux); }
.at-form input[type=text], .at-form input[type=email], .at-form input[type=password],
.at-form textarea, .at-form select, .at-form input[type=number], .at-form input[type=tel],
.at-form input[type=url], .at-form input[type=datetime-local], .at-form input[type=file],
.at-input {
  font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--g-bordure);
  border-radius: 6px; background: #fff; width: 100%;
}
.at-form input:focus, .at-form textarea:focus, .at-form select:focus, .at-input:focus {
  outline: 2px solid var(--g-accent); outline-offset: 1px; border-color: var(--g-accent);
}
.at-form-ligne { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem; }
.at-form-ligne > span { display: flex; flex-direction: column; gap: 0.2rem; }
.at-form-ligne .at-large, .at-large { flex: 1; min-width: 240px; }

.at-bouton {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  background: #fff; color: var(--g-texte); border: 1px solid var(--g-bordure);
  border-radius: 6px; padding: 0.55rem 1rem; text-decoration: none; margin-top: 0.6rem;
}
.at-bouton:hover { border-color: var(--g-texte-doux); }
.at-bouton-plein, .at-sauvegarde { background: var(--g-accent); border-color: var(--g-accent); color: #fff; width: 100%; }
.at-bouton-plein:hover, .at-sauvegarde:hover { background: #b01f1f; border-color: #b01f1f; }
.at-bouton-danger { background: var(--g-accent); border-color: var(--g-accent); color: #fff; }

.at-actions { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.at-actions-ligne { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.at-actions-ligne .at-actions { margin: 0; }

.at-retour, .at-retour a {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.95rem;
  font-weight: 600; color: var(--g-texte-doux); text-decoration: none;
}
.at-retour { margin: 0 0 0.7rem; }
.at-retour a:hover, a.at-retour:hover { color: var(--g-texte); }

.at-ligne-lien { cursor: pointer; }
.at-ligne-lien:hover { background: var(--g-fond-alt); }

.at-vide { text-align: center; color: var(--g-texte-doux); padding: 1.6rem 1rem; }

.at-id-lib {
  display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em;
  font-weight: 700; color: var(--g-texte-doux); margin-bottom: 0.15rem;
}
.at-sous-chiffre { font-size: 0.76rem; color: var(--g-texte-doux); margin-top: 0.15rem; }

.at-compteurs { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.at-compteur {
  display: flex; flex-direction: column; gap: 0.1rem; min-width: 14rem;
  background: #fff; border: 1px solid var(--g-bordure); border-left: 4px solid var(--g-accent);
  border-radius: 0 10px 10px 0; padding: 0.85rem 1.1rem; text-decoration: none;
  color: var(--g-texte); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.at-compteur:hover { border-color: var(--g-accent); }
.at-compteur-nb { font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.at-compteur-nom { font-size: 0.92rem; font-weight: 600; }
.at-compteur-note { font-size: 0.76rem; color: var(--g-texte-doux); }
@media (max-width: 600px) { .at-compteur { min-width: 0; flex: 1 1 100%; } }

.at-fil { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.86rem; color: var(--g-texte-doux); margin-bottom: 0.8rem; }
.at-saisie { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--g-bordure); border-radius: 6px; background: #fff; }
.at-effacer { background: none; border: 0; padding: 0; font: inherit; font-size: 0.86rem; color: var(--g-texte-doux); text-decoration: underline; cursor: pointer; }
.at-effacer:hover { color: var(--g-accent); }

.g-inline { display: inline-flex; align-items: center; gap: 0.5rem; }

/* Page Amazon */
.g-badge-erreur { background: #fdecea; color: #b3261e; }
.g-journal { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 8px; font-size: .82rem; line-height: 1.5; overflow: auto; max-height: 24rem; white-space: pre-wrap; }
.g-table-etat th { width: 16rem; text-align: left; font-weight: 600; }
.g-table-etat td form { margin: 0; }
/* Articles Amazon */
.g-badge-gris { background: #eef0f3; color: #5b6572; }
.g-badge-attente { background: #fff4e0; color: #9a5b00; }
.g-note-forte { background: #e7f6ec; border-left: 4px solid #1f6b3b; padding: .7rem 1rem; }
.g-details summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.g-barre-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0; }
.g-case-tout { margin-right: auto; font-size: .9rem; }
.g-table-amazon { font-size: .86rem; }
.g-table-amazon .g-num { text-align: right; white-space: nowrap; }
.g-table-amazon .g-ref { white-space: nowrap; }
.g-doux { color: var(--g-texte-doux); }
.g-prix-edit { display: inline-flex; gap: .3rem; }
.g-prix-edit input { width: 5.2rem; text-align: right; padding: .25rem .4rem; }
.g-bouton-mini { padding: .25rem .5rem; font-size: .8rem; }
.g-marge-pos { color: #1f6b3b; font-weight: 600; }
.g-marge-neg { color: #b3261e; font-weight: 600; }
.g-ligne-perte td { background: #fff5f5; }
.g-detail-statut summary { cursor: pointer; font-size: .78rem; color: var(--g-texte-doux); }
.g-detail-statut pre { white-space: pre-wrap; font-size: .75rem; max-width: 26rem; margin: .3rem 0 0; }
.g-form-cache { display: none; }
/* Mon compte */
.g-carte-etroite { max-width: 34rem; }
a.g-qui { text-decoration: none; color: inherit; }
a.g-qui:hover span { text-decoration: underline; }
.g-col-case { width: 2.6rem; text-align: center !important; }
.g-table-amazon input[type=checkbox] { width: 1.25rem; height: 1.25rem; accent-color: #0070E0; cursor: pointer; vertical-align: middle; }
.g-case-tout input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: #0070E0; vertical-align: middle; margin-right: .3rem; }
.g-ligne-cochee td { background: #eaf3fd; }
/* Pages larges (tableaux à beaucoup de colonnes) : toute la largeur de l'écran */
.g-corps:has(.g-pleine-largeur) { max-width: none; padding-left: 1rem; padding-right: 1rem; }
.g-table-amazon th, .g-table-amazon td { padding: .5rem .55rem; }
.g-table-amazon td:nth-child(3) { min-width: 18rem; }
.g-barre-actions .g-case-tout { color: #fff; }
.g-coef { display: inline-flex; align-items: center; gap: .4rem; color: #fff; margin-right: .5rem; }
.g-coef input { width: 4.2rem; text-align: right; padding: .4rem .5rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; }
.g-defilable { overflow-x: auto; border-radius: var(--g-rayon); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.g-defilable .g-table { box-shadow: none; overflow: visible; }
.g-col-statut { white-space: nowrap; }
.g-filtres-tete th { background: #fff; padding: .35rem .4rem; text-transform: none; }
.g-filtres-tete input, .g-filtres-tete select { width: 100%; min-width: 5rem; padding: .35rem .45rem; border: 1px solid var(--g-bordure); border-radius: 6px; font: inherit; font-size: .82rem; }
.g-barre-actions { height: auto; padding: .6rem 1rem; row-gap: .5rem; }
.g-stock-input { width: 3.6rem !important; }
.g-stock-zero { color: #b3261e; font-weight: 600; }
/* Fiche Amazon en fenêtre modale */
.g-ligne-cliquable { cursor: pointer; }
.g-ligne-cliquable:hover td { background: #f4f8fd; }
.g-modal[hidden] { display: none; }
.g-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }
.g-modal-fond { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.g-modal-boite { position: relative; background: #fff; border-radius: 12px; width: min(1100px, 100%); max-height: calc(100vh - 4rem); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
body.g-modal-ouverte { overflow: hidden; }
.g-modal-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.2rem 1.5rem .8rem; border-bottom: 1px solid var(--g-bordure); position: sticky; top: 0; background: #fff; z-index: 2; }
.g-modal-entete h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.g-modal-entete p { margin: 0; font-size: .85rem; }
.g-modal-fermer { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--g-texte-doux); }
.g-modal-corps { padding: .5rem 1.5rem 1rem; }
.g-modal-pied { display: flex; justify-content: flex-end; align-items: center; gap: .8rem; padding: .9rem 1.5rem; border-top: 1px solid var(--g-bordure); position: sticky; bottom: 0; background: #fff; }
.g-case-envoi { margin-right: auto; font-size: .9rem; }
.g-fiche-groupe { border: 1px solid var(--g-bordure); border-radius: 8px; padding: .6rem 1rem 1rem; margin: 1rem 0 0; }
.g-fiche-groupe legend { font-weight: 700; padding: 0 .4rem; }
.g-champ-ligne-fiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem 1rem; }
.g-champ-ligne-fiche .g-champ-large { grid-column: 1 / -1; }
.g-fiche-amazon .g-champ input, .g-fiche-amazon .g-champ textarea { width: 100%; box-sizing: border-box; }
.g-fiche-amazon .g-champ label { font-size: .8rem; color: var(--g-texte-doux); display: block; margin-bottom: .2rem; }
/* Veille marché */
.g-vignette { width: 48px; height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--g-bordure); border-radius: 4px; }
.g-form-marche { align-items: flex-end; }
.g-form-marche .g-champ-large { flex: 1 1 280px; }
.g-form-marche input, .g-form-marche select { width: 100%; box-sizing: border-box; }
.g-mots-edit input { width: 16rem !important; text-align: left !important; font-size: .8rem; }
.g-table-comparatif td { vertical-align: middle; }
.g-kpis-comp .g-kpi { text-decoration: none; color: inherit; border: 2px solid transparent; }
.g-kpis-comp .g-kpi:hover { border-color: var(--g-bordure); }
.g-kpis-comp .g-kpi-actif { border-color: #0070E0; }
.g-kpi-rouge .g-kpi-valeur { color: #b3261e; }
.g-kpi-vert .g-kpi-valeur { color: #1f6b3b; }
.g-prix-edit input.g-saisi { border-color: #0070E0; background: #eaf3fd; }
.g-kpi-marge .g-kpi-valeur { color: #1f6b3b; }
.g-kpi small { display: block; margin-top: .2rem; font-size: .75rem; }
/* Encarts compacts (Articles Amazon, Veille marché) */
.g-kpis-comp { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.g-kpis-comp .g-kpi { padding: .5rem .7rem; }
.g-kpis-comp .g-kpi-label { font-size: .7rem; }
.g-kpis-comp .g-kpi-valeur { font-size: 1.25rem; line-height: 1.2; }
.g-kpis-comp .g-kpi small { font-size: .68rem; margin-top: .1rem; }
.g-kpis-comp .g-kpi-valeur { font-size: 1.7rem; }
