:root {
  color-scheme: light;
  --menu-fond: #0e141b;
  --menu-texte: #cfd8de;
  --menu-texte-fort: #ffffff;
  --menu-muet: #7f97a5;
  --menu-bord: #1c2a36;
  --menu-bord-fort: #2c5a73;
  --menu-chip: #1d3a4a;
  --menu-survol: #18232e;
  --menu-champ: #121b24;
  --menu-compte-fond: #121b24;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --survol: #eef6f9;
  --survol-fort: #e4ebf0;
  --bord-leger: var(--bord-leger);
  --bleu: #0080A2;
  --bleu-fonce: #006a86;
  --rouge: #D02F35;
  --jaune: #F0B000;
  --vert: #2e8b57;
  --orange: #e07b00;
  --gris-fond: #f3f5f8;
  --gris-bord: #dde3e8;
  --gris-texte: #4a5561;
  --texte: #1c2733;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Titillium Web", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--texte);
  background: var(--gris-fond);
}
h1 { font-family: "Titillium Web", "Segoe UI", sans-serif; font-weight: 200; font-size: 26px; margin: 0; }
h2 { font-family: "Titillium Web", "Segoe UI", sans-serif; font-weight: 600; font-size: 16px; margin: 0 0 10px; color: var(--bleu-fonce); }
a { color: var(--bleu); }

/* Structure */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: var(--menu-fond); color: var(--menu-texte); flex-shrink: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;   /* le bas du menu reste au bas de l'écran */
}
.sidebar .logo { padding: 18px 16px; border-bottom: 1px solid var(--menu-bord); }
.sidebar .logo b { color: var(--menu-texte-fort); font-family: "Titillium Web", sans-serif; font-size: 17px; display: block; }
.sidebar .logo span { font-size: 11px; color: var(--menu-muet); }
.sidebar nav { padding: 10px 0; flex: 1; }
.sidebar nav a {
  display: block; padding: 9px 16px; color: var(--menu-texte); text-decoration: none;
  border-left: 3px solid transparent; font-size: 13.5px;
}
.sidebar nav a:hover { background: var(--menu-survol); }
.sidebar nav a.active { background: var(--menu-survol); border-left-color: var(--bleu); color: var(--menu-texte-fort); }
.sidebar .pied { padding: 12px 16px; font-size: 11px; color: var(--menu-muet); }
.sidebar .pied { color: var(--menu-muet); }

.sidebar { border-right: 1px solid var(--menu-bord); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--gris-bord);
  padding: 12px 22px; display: flex; align-items: center; gap: 14px;
}
.topbar .fil { font-size: 12px; color: var(--gris-texte); }
.content { padding: 22px; width: 100%; }  /* règle 6 : pleine largeur */

/* Cartes et indicateurs */
.cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px;
  padding: 12px 16px; min-width: 160px; flex: 1;
}
.card .val { font-size: 22px; font-weight: 600; color: var(--bleu-fonce); }
.card .lab { font-size: 11.5px; color: var(--gris-texte); text-transform: uppercase; letter-spacing: 0.4px; }

/* Barre d'outils */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] { min-width: 240px; }

/* Boutons */
.btn {
  background: var(--bleu); color: #fff; border: none; border-radius: 4px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--bleu-fonce); }
.btn.secondaire { background: var(--surface); color: var(--bleu-fonce); border: 1px solid var(--gris-bord); }
.btn.secondaire:hover { border-color: var(--bleu); }
.btn.danger { background: var(--rouge); }
.btn.small { padding: 3px 9px; font-size: 12px; }

/* Tableaux */
.table-wrap { background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px; overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gris-texte); padding: 9px 12px; border-bottom: 1px solid var(--gris-bord);
  background: var(--surface-2); white-space: nowrap;
}
td { padding: 8px 12px; border-bottom: 1px solid var(--bord-leger); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--survol); cursor: pointer; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* Pastilles */
.pastille {
  display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11.5px; white-space: nowrap;
}
.gris { background: #e8ecef; color: #4a5561; }
.vert { background: #e0f2e9; color: #1d6b3c; }
.orange { background: #fdeed7; color: #9a5a00; }
.bleu { background: #dcefF5; color: #0a5c78; }
.bleu { background: #dceff5; color: #0a5c78; }
.rouge { background: #fbdfe0; color: #a31f24; }
.violet { background: #eaddf5; color: #5b2d8d; }

/* Panneau latéral (fiche) */
.panel-backdrop {
  position: fixed; inset: 0; background: rgba(16, 37, 50, 0.35);
  display: flex; justify-content: flex-end; z-index: 20;
}
.panel {
  background: var(--surface); width: 640px; max-width: 92vw; overflow-y: auto; height: 100%;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15); padding: 20px 24px;
}
.panel .entete { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.panel .fermer { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gris-texte); }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 16px; }
.champs > .modale.formulaire-page { grid-column: 1 / -1; margin-top: 0; }   /* formulaire Modifier : pleine largeur comme la création */
.champ .k { font-size: 11px; color: var(--gris-texte); text-transform: uppercase; }
.champ .v { font-size: 13.5px; }
.champ .v.modifiable { outline: none; min-height: 20px; }
.champ .v.modifiable:focus { background: #fffbe8; border-bottom: 1px dashed var(--jaune); }
.section-bloc { margin-bottom: 18px; }
.section-bloc h3 { font-size: 13px; color: var(--bleu-fonce); margin: 0 0 8px; border-bottom: 1px solid var(--gris-bord); padding-bottom: 4px; }
.muted { color: var(--gris-texte); font-size: 12px; }
.journal-item { font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--bord-leger); }

/* Admin */
.grille-droits { overflow: auto; }
.grille-droits select { height: 30px; font-size: 12px; }
.badge-role { background: #eef; border: 1px solid #ccd; padding: 1px 6px; border-radius: 8px; font-size: 11px; margin-right: 4px; }
.param-ligne td { vertical-align: middle; }
.param-input {
  width: 100%; min-width: 160px; height: 34px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px;
}
.param-input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,128,162,0.18); }

/* Modale */
.modale-backdrop { position: fixed; inset: 0; background: rgba(16,37,50,0.4); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modale { background: var(--surface); border-radius: 8px; padding: 22px; width: 520px; max-width: 94vw; max-height: 90vh; overflow-y: auto; }
.modale label { display: block; font-size: 12px; color: var(--gris-texte); margin: 10px 0 3px; }
.modale input:not([type=checkbox]):not([type=radio]), .modale select { width: 100%; }
.modale .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modale.formulaire-page { width: 100%; max-width: 100%; max-height: none; overflow: visible; border: 1px solid var(--gris-bord); margin-top: 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 20px; align-content: start; }   /* pages en pleine largeur (champs en colonnes) */
.modale.formulaire-page > * { grid-column: 1 / -1; }
.modale.formulaire-page > .champ-form { grid-column: auto; min-width: 0; }
.modale.formulaire-page > .champ-form.large { grid-column: 1 / -1; }
/* blocs d'un formulaire : titre + grille de 4 colonnes (2 sur écran étroit) */
.bloc-form { border: 1px solid var(--gris-bord); border-radius: 8px; padding: 12px 16px 6px; margin: 0 0 14px; background: var(--surface); }
.bloc-form[hidden] { display: none; }
.bloc-form > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 14px; }
.bloc-form > h3 svg.lucide { width: 16px; height: 16px; color: var(--bleu); }
.bloc-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.bloc-grille > .champ-form { min-width: 0; padding-bottom: 8px; }
.bloc-grille > .x2 { grid-column: span 2; }
@media (max-width: 1100px) { .bloc-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bloc-grille { grid-template-columns: 1fr; } .bloc-grille > .x2 { grid-column: auto; } }
/* Connexion */
#ecran-connexion {
  position: fixed; inset: 0; background: linear-gradient(135deg, #102532, #055f75);
  display: flex; align-items: center; justify-content: center; z-index: 40;
}
.login-boite {
  position: relative;
  background: var(--surface); border-radius: 10px; padding: 34px 38px; width: 400px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.login-logo b { font-family: "Titillium Web", sans-serif; font-size: 26px; color: #055f75; display: block; }
.login-logo span { font-size: 12px; color: #6d8494; }
.login-ms {
  margin-top: 22px; width: 100%; padding: 11px; font-size: 14px;
}
.login-form { margin-top: 20px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.login-form label { font-size: 12px; color: var(--texte-doux, #6d8494); margin-top: 8px; }
.login-form input { width: 100%; height: 36px; padding: 0 10px; font-size: 14px; box-sizing: border-box; }
.login-form .login-ms { margin-top: 16px; }
.mdp-compte { margin: 12px 0 16px; padding: 14px 16px; border: 1px solid var(--gris-bord, #dde3e8); border-radius: 10px; }
.mdp-compte h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.mdp-compte h4 svg.lucide { width: 16px; height: 16px; }
.mdp-compte .mdp-nouveau { display: flex; gap: 6px; align-items: center; }
.mdp-compte .mdp-nouveau input { flex: 1; font-family: ui-monospace, Consolas, monospace; }
.login-erreur { margin-top: 10px; color: #b42318; font-size: 13px; }
.login-separateur { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--texte-doux, #6d8494); font-size: 12px; }
.login-separateur::before, .login-separateur::after { content: ""; flex: 1; border-top: 1px solid var(--gris-bord, #dde3e8); }
.login-microsoft { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; font-size: 14px; box-sizing: border-box; text-decoration: none; }

/* Onboarding */
.onb-backdrop { position: fixed; inset: 0; background: rgba(16,37,50,0.55); display: flex; align-items: center; justify-content: center; z-index: 45; }
.onb-modal {
  background: var(--surface); border-radius: 10px; width: 620px; max-width: 94vw; overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,0.4);
}
.onb-header {
  background: linear-gradient(90deg, #077D99, #055f75); color: #fff; padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.onb-header .titre { font-family: "Titillium Web", sans-serif; font-size: 15px; }
.onb-header .etape { font-size: 12px; opacity: 0.85; }
.onb-image { width: 100%; display: block; border-bottom: 1px solid var(--gris-bord); max-height: 300px; object-fit: cover; background: var(--survol); }
.onb-corps { padding: 18px 22px; }
.onb-corps h3 { margin: 0 0 8px; font-family: "Titillium Web", sans-serif; color: var(--bleu-fonce); font-size: 17px; }
.onb-corps p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--texte); }
.onb-actions { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px 18px; }
.onb-points { display: flex; gap: 6px; }
.onb-points span { width: 8px; height: 8px; border-radius: 50%; background: #c9d6dd; display: inline-block; }
.onb-points span.actif { background: var(--bleu); }
.onb-skip { background: none; border: none; color: var(--gris-texte); cursor: pointer; font-size: 13px; text-decoration: underline; font-family: inherit; }
.onb-x { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }

/* Suivi onboarding admin */
.case-vue { text-align: center; }

.toast {
  position: fixed; bottom: 18px; right: 18px; background: #102532; color: #fff;
  padding: 10px 16px; border-radius: 6px; z-index: 50; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Badge environnement */
.badge-env {
  display: inline-block; padding: 3px 12px; border-radius: 12px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.6px;
}
.badge-env.sandbox { background: #F0B000; color: #102532; }
.badge-env.prod { background: #D02F35; color: #fff; }
.badge-env.sandbox.clair { background: #fff3d6; color: #7a5600; }

/* --------- règles UX --------- */

/* Menu bas : roue crantée administration toujours visible (règle 7) */
.sidebar { display: flex; flex-direction: column; }
.sidebar nav#menu { flex: 1; min-height: 0; overflow-y: auto; }
.sidebar nav#menu-bas { flex: 0 0 auto; border-top: 1px solid var(--menu-bord); padding: 8px 0; }
.sidebar nav#menu-bas { display: flex; align-items: center; }
.sidebar nav#menu-bas a { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.sidebar nav#menu-bas a:first-child { flex: 1; min-width: 0; }
.sidebar nav#menu-bas a.lien-aide { flex: 0 0 auto; margin-left: 0; padding-left: 10px; padding-right: 14px; }
.sidebar.replie nav#menu-bas { flex-direction: column; }

/* Barre de liste : actions à gauche, recherche réellement centrée dans la barre,
   pagination puis vues à droite (règle 9). Trois colonnes : les deux côtés se partagent
   l'espace restant à parts égales, la recherche reste donc au milieu quel que soit leur contenu. */
.liste-barre { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.liste-barre-3 { display: grid;
  /* recherche : 640 px max, réduite pour laisser ~290 px de chaque côté (pagination + vues) */
  grid-template-columns: minmax(0, 1fr) min(640px, max(240px, calc(100% - 600px))) minmax(0, 1fr); }
.liste-barre-3 .liste-gauche { display: flex; align-items: center; gap: 8px; justify-self: start; }
.liste-barre-3 .liste-droite { display: flex; align-items: center; gap: 10px; justify-self: end; }
.liste-barre-3 #pager-zone { display: flex; align-items: center; white-space: nowrap; }
.liste-barre-3 .recherche-zone { width: 100%; }
@media (max-width: 1180px) {
  /* fenêtre étroite : actions et vues sur une ligne, recherche centrée sur la ligne suivante */
  .liste-barre-3 { grid-template-columns: 1fr auto; }
  .liste-barre-3 .liste-gauche { grid-column: 1; grid-row: 1; }
  .liste-barre-3 .liste-droite { grid-column: 2; grid-row: 1; }
  .liste-barre-3 #barre-recherche { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: min(640px, 100%); }
}
.recherche-input {
  flex: 1; min-width: 260px; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--gris-bord); border-radius: 5px; font-family: inherit;
}
.recherche-input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 2px rgba(0,128,162,0.15); }
.compteur-resultats { font-size: 12px; color: var(--gris-texte); white-space: nowrap; }

/* Sélecteur de vues (règle 10) */
.selecteur-vues { display: flex; gap: 4px; border: 1px solid var(--gris-bord); border-radius: 5px; padding: 3px; }
.btn-vue {
  border: none; background: none; padding: 4px 9px; cursor: pointer; font-size: 13px;
  border-radius: 4px; color: var(--gris-texte);
}
.btn-vue.active { background: var(--bleu); color: #fff; }
.btn-vue:disabled { opacity: 0.3; cursor: default; }

/* Pagination (règle 4) */
.pager-btn {
  border: 1px solid var(--gris-bord); background: var(--surface); border-radius: 4px;
  padding: 4px 10px; cursor: pointer; font-size: 13px;
}
.pager-btn:disabled { opacity: 0.35; cursor: default; }
.pager-info { font-size: 12.5px; color: var(--gris-texte); margin: 0 4px; }

/* Tri des colonnes (règle 12) */
.th-tri { cursor: pointer; user-select: none; }
.th-tri:hover { color: var(--bleu-fonce); }
.th-tri.tri-actif { color: var(--bleu-fonce); }

/* Pleine largeur (règle 6) */
.pleine-largeur { width: 100%; }
.num-cell { display: inline-block; text-align: right; white-space: nowrap; }
td:has(> .num-cell) { text-align: right; }

/* Détail en page (règles 5, 6, 8) : en-tête aéré, le retour se fait par le fil d'Ariane */
.detail-page { width: 100%; }
.detail-entete {
  display: flex; align-items: center; gap: 16px; margin: 0 0 24px; padding: 0 0 20px;
  border-bottom: 1px solid var(--bord-leger); flex-wrap: wrap;
}
.detail-titres { flex: 1; min-width: 0; }
.detail-titres h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; color: var(--texte); }
.detail-titres .muted { margin-top: 6px; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-nav { display: flex; gap: 6px; }
.detail-nav .btn { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.detail-nav .btn:disabled { opacity: .4; cursor: not-allowed; }

/* Fil d'Ariane (sous le haut de page, au-dessus du contenu) */
.bandeau { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 6px 22px; background: var(--surface); border-bottom: 1px solid var(--bord-leger); }
.fil-ariane { flex: 1; min-width: 0; font-size: 13px; }
.fil-ariane[hidden] { display: none; }
.fil-ariane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.fil-ariane li { display: inline-flex; align-items: center; min-width: 0; }
.fil-ariane li + li::before {
  content: ""; width: 16px; height: 16px; flex: none; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a9aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.fil-ariane a, .fil-ariane .fil-courant { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; max-width: 320px; }
.fil-ariane a span, .fil-ariane .fil-courant span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-ariane a { color: var(--gris-texte); text-decoration: none; transition: background-color .15s, color .15s; }
.fil-ariane a:hover { background: var(--survol); color: var(--bleu-fonce); }
.fil-ariane .fil-courant { color: var(--texte); font-weight: 600; }
.fil-ariane i[data-lucide], .fil-ariane svg { width: 15px; height: 15px; }

/* En-tête des écrans de synthèse : titre + onglets */
.page-entete { margin: 0 0 24px; }
.page-entete h1 { margin: 0 0 16px; font-size: 28px; font-weight: 200; letter-spacing: -0.01em; line-height: 1.25; color: var(--texte); }
.barre-outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* Kanban (règle 10) */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 240px; flex: 1; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px; padding: 10px; }
.kanban-col h4 { margin: 0 0 10px; font-size: 13px; color: var(--bleu-fonce); }
.kanban-col.depot { outline: 2px dashed var(--bleu); background: #eef5ff; }
.kanban-carte[draggable="true"] { cursor: grab; }
.kanban-carte {
  border: 1px solid var(--gris-bord); border-radius: 5px; padding: 8px 10px;
  margin-bottom: 8px; cursor: pointer; background: var(--surface); font-size: 13px;
}
.kanban-carte:hover { border-color: var(--bleu); }
.kanban-vert { border-left: 3px solid var(--vert); }
.kanban-rouge { border-left: 3px solid var(--rouge); }
.kanban-orange { border-left: 3px solid var(--orange); }
.kanban-bleu { border-left: 3px solid var(--bleu); }
.kanban-gris { border-left: 3px solid #9aa7b1; }


/* Carte Leaflet (règle 11) : toute la hauteur et largeur disponibles */
.carte-container {
  height: calc(100vh - 200px);
  min-height: 320px;
  width: 100%;
  border: 1px solid var(--gris-bord);
  border-radius: 6px;
  z-index: 1;
}

/* Panneau colonnes (règle 3) */
.panneau-colonnes {
  background: var(--surface); border-radius: 8px; padding: 18px; width: 320px; max-width: 92vw;
}
.panneau-colonnes ul { list-style: none; padding: 0; margin: 10px 0; }
.panneau-colonnes li {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--gris-bord); border-radius: 4px; margin-bottom: 5px;
  cursor: grab; background: var(--surface); font-size: 13px;
}
.poignee { color: #9aa7b1; }
.panneau-colonnes .actions { text-align: right; }

/* Icônes Lucide : trait fin noir et blanc (règle 13) */
svg.lucide {
  width: 16px; height: 16px; stroke-width: 2;
  vertical-align: -2px; color: currentColor; fill: none;
  flex-shrink: 0;
}
.btn svg.lucide, .btn-vue svg.lucide { width: 15px; height: 15px; }
.sidebar nav a svg.lucide { width: 17px; height: 17px; margin-right: 8px; }
.sidebar nav#menu a, .sidebar nav#menu-bas a { display: flex; align-items: center; }
.detail-nav svg.lucide, .pager-btn svg.lucide { width: 14px; height: 14px; }
.pastille svg.lucide { width: 12px; height: 12px; }
h2 svg.lucide, h3 svg.lucide { width: 18px; height: 18px; vertical-align: -3px; }
.onb-header svg.lucide { color: #fff; }

/* Panneau recherche intelligente façon Odoo (règle 14) */
.recherche-zone { position: relative; flex: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panneau-recherche {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14); min-width: 460px;
}
.panneau-recherche-colonnes { display: flex; }
.pr-col { flex: 1; padding: 12px 14px; }
.pr-col + .pr-col { border-left: 1px solid var(--gris-bord); }
.pr-col h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gris-texte); }
/* lignes du panneau : cases à cocher + ">" façon Odoo */
.pr-col .pr-item { padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; gap: 7px; }
.pr-col .pr-item:hover { background: var(--survol); }
.pr-col .pr-item.actif { background: #dceff5; font-weight: 600; }
.pr-col .pr-item input[type="checkbox"] { cursor: pointer; flex-shrink: 0; }
.pr-compteur { margin-left: auto; color: var(--gris-texte); font-size: 12px; }
.pr-sous-menu svg { flex-shrink: 0; }
.pr-sous-menu.ouvert svg { transform: rotate(90deg); }
.pr-sous-menu svg { transition: transform 0.12s ease; }
.pr-valeurs { margin-left: 22px; border-left: 1px solid var(--gris-bord); padding-left: 2px; }
.pr-valeurs .pr-item { font-size: 12.5px; }
.pr-groupe-titre { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gris-texte); padding: 6px 8px 2px; }
.pr-perso { border-top: 1px solid var(--gris-bord); margin-top: 6px; padding-top: 4px; }
.pr-personnalise { color: var(--bleu-fonce); }

/* chips de filtres actifs */
.chips-zone { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #dceff5; color: #0a5c78; border: 1px solid #b5d9e5;
  border-radius: 12px; padding: 3px 10px; font-size: 12px;
}
.chip-groupe { background: #eaddf5; color: #5b2d8d; border-color: #d3bfe8; }
.chip-x { border: none; background: none; cursor: pointer; font-size: 13px; color: inherit; padding: 0; line-height: 1; }

/* lignes de groupe dans la liste groupée */
tr.ligne-groupe td {
  background: var(--survol); font-size: 13px; cursor: pointer;
  border-top: 1px solid var(--gris-bord);
}
tr.ligne-groupe:hover { background: var(--survol-fort); }

/* Icône colonnes en bout d'en-tête de tableau */
.th-actions-colonnes { width: 40px; padding-right: 8px; }
.btn-icone-colonnes {
  border: none; background: none; cursor: pointer; color: var(--gris-texte);
  padding: 3px; border-radius: 4px; display: inline-flex; align-items: center;
}
.btn-icone-colonnes:hover { background: var(--survol-fort); color: var(--bleu-fonce); }
/* les lignes du tableau n'ont pas cette colonne : on masque la cellule fantôme */
tbody td.cellule-fantome { border: none; background: transparent; }

/* Menu : titres de groupes */
button.menu-titre-groupe { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
button.menu-titre-groupe svg.lucide { width: 13px; height: 13px; transition: transform .15s; }
.menu-groupe.ferme > .menu-groupe-corps { display: none; }
.menu-groupe.ferme > button.menu-titre-groupe svg.lucide { transform: rotate(-90deg); }
.sidebar.replie .menu-groupe.ferme > .menu-groupe-corps { display: block; }
.sidebar.replie button.menu-titre-groupe svg.lucide { display: none; }
.menu-titre-groupe {
  padding: 12px 16px 4px; font-size: 10.5px; letter-spacing: 0.8px;
  color: var(--menu-muet); text-transform: uppercase; font-weight: 600;
}

/* Éditeur de menu (Administration) */
.editeur-menu { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.editeur-disponibles, .editeur-groupe {
  background: var(--surface); border: 1px dashed var(--gris-bord); border-radius: 6px; padding: 10px; min-width: 200px; min-height: 80px;
}
.editeur-disponibles h4, .editeur-groupe h4 { margin: 0 0 8px; font-size: 12px; color: var(--gris-texte); text-transform: uppercase; }
.editeur-groupes { display: flex; gap: 12px; flex-wrap: wrap; }
.editeur-groupe-entete { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.editeur-groupe-entete input {
  border: none; border-bottom: 1px dashed var(--gris-bord); font-size: 13px;
  font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
  background: transparent; padding: 2px 4px; width: 150px; color: var(--bleu-fonce);
}
.editeur-groupe-entete input:focus { outline: none; border-bottom-color: var(--bleu); }
.editeur-items { display: flex; flex-direction: column; gap: 4px; }
.editeur-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--gris-bord); border-radius: 4px; background: var(--surface);
  font-size: 13px; cursor: grab;
}
.editeur-item:hover { border-color: var(--bleu); }
.editeur-item-x { margin-left: auto; cursor: pointer; color: var(--gris-texte); font-size: 14px; }
.editeur-item-x:hover { color: var(--rouge); }
.editeur-groupe-nouveau { background: var(--survol); }
[data-drop].survol { border-color: var(--bleu); background: var(--survol); }
.editeur-vide { padding: 4px 2px; }

/* Administration : onglets par groupe de besoin */
.admin-onglets {
  display: flex; gap: 2px; border-bottom: 2px solid var(--gris-bord);
  margin-bottom: 18px; flex-wrap: wrap;
}
.admin-onglet {
  border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 9px 14px; font-size: 13.5px; color: var(--gris-texte);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  display: inline-flex; align-items: center; gap: 7px;
}
.admin-onglet:hover { color: var(--bleu-fonce); }
.admin-onglet.actif { color: var(--bleu-fonce); border-bottom-color: var(--bleu); font-weight: 600; }
.admin-section { margin-bottom: 10px; }

/* Sélection multiple dans les listes */
.th-coche, .cellule-coche { width: 40px; text-align: center; }
.cellule-coche, .cellule-coche input { cursor: pointer; }
tr.ligne-objet.ligne-selectionnee td { background: var(--survol); }
.barre-selection {
  position: sticky; bottom: 10px; background: #102532; color: #fff;
  padding: 8px 14px; border-radius: 6px; display: inline-flex; gap: 10px;
  align-items: center; font-size: 13px; margin-top: 8px;
}
.barre-selection .btn { background: #fff; color: #102532; }
.ligne-totaux td { font-weight: 600; border-top: 2px solid var(--gris-bord); background: var(--surface-2); }
.aggregate-cell { color: var(--gris-texte); }

/* Éditeur de menu : ordre des items et des groupes */
.editeur-item-position {
  height: 6px; border-radius: 3px; margin: 1px 0;
}
.editeur-item-position.survol, [data-drop-groupe].survol {
  background: var(--bleu); height: 8px;
}
.editeur-groupe-position { height: 8px; }
.editeur-groupe-entete .poignee { cursor: grab; color: #9aa7b1; display: inline-flex; }

/* Dropdowns ancrés (colonnes, recherche, suggestions) façon Odoo */
.dropdown-colonnes, .dropdown-ancre {
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16); z-index: 60;
  padding: 6px;
}
.dropdown-ancre { padding: 10px 12px; }
.dc-liste { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.dc-liste li {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 5px; font-size: 13px; cursor: grab; user-select: none;
}
.dc-liste li:hover { background: var(--survol); }
.dc-liste input { cursor: pointer; }
.dc-poignee svg { width: 13px; height: 13px; color: #9aa7b1; }

/* Colonnes redimensionnables (règle 15) */
th.th-tri { position: relative; }
th .poignee-colonne {
  position: absolute; right: -3px; top: 0; width: 6px; height: 100%;
  cursor: col-resize; user-select: none; z-index: 5;
}
/* trait séparateur toujours visible sur les en-têtes, renforcé au survol */
th .poignee-colonne::after {
  content: ""; position: absolute; right: 3px; top: 20%; height: 60%;
  width: 1px; background: #c3ced6;
}
th .poignee-colonne:hover::after, th .poignee-colonne:active::after {
  width: 2px; background: var(--bleu); top: 15%; height: 70%;
}
table.col-resize-en-cours { cursor: col-resize; }
table.col-resize-en-cours td, table.col-resize-en-cours th { overflow: hidden; }

/* Boîte de recherche : champ + croix conditionnelle + flèche combo (façon Odoo) */
.recherche-zone.recherche-boite {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--gris-bord); border-radius: 5px; background: var(--surface);
  padding: 2px 6px; min-height: 34px; flex-wrap: wrap;
}
.recherche-zone.recherche-boite:focus-within { border-color: var(--bleu); box-shadow: 0 0 0 2px rgba(0,128,162,0.15); }
.recherche-zone.recherche-boite .recherche-input { border: none; box-shadow: none; flex: 1; min-width: 120px; background: transparent; }
.recherche-zone.recherche-boite .recherche-input:focus { box-shadow: none; }
.recherche-effacer, .recherche-flèche {
  border: none; background: none; cursor: pointer; color: var(--gris-texte);
  padding: 4px; border-radius: 4px; display: inline-flex; align-items: center;
}
.recherche-effacer:hover { color: var(--rouge); background: #fdeeee; }
.recherche-flèche:hover { color: var(--bleu-fonce); background: var(--survol); }
.recherche-zone .chips-zone { margin: 2px 0; }
.recherche-zone .chips-zone:empty { display: none; }
.recherche-zone .chip { margin: 1px 0; }

/* case « tout sélectionner » dans l'en-tête, à gauche */
th.th-coche { width: 30px; padding-left: 10px; }
th.th-coche input { cursor: pointer; vertical-align: middle; }

/* Kanban sans regroupement : cards en grille fluide */
.kanban-sans-groupe {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; padding: 4px; align-items: start;
}
.kanban-sans-groupe .kanban-carte { margin: 0; }

/* Toolbar de la vue graph */
.graph-toolbar { display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px 6px 0 0;
  padding: 8px 12px; margin-bottom: -1px; flex-wrap: wrap; gap: 8px; }
.graph-outil { display: flex; align-items: center; gap: 8px; }
.graph-separateur { width: 1px; height: 20px; background: var(--gris-bord); display: inline-block; }
.graph-stacked { font-size: 11.5px; color: var(--gris-texte); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

/* Utilisateur connecté, dans le menu latéral */
.sidebar-user {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--menu-bord); font-size: 13.5px; color: var(--menu-texte-fort);
}
.sidebar-user svg.lucide { width: 17px; height: 17px; flex-shrink: 0; color: var(--menu-muet); }
.sidebar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Menu latéral rétractable : barre d'icônes (état mémorisé par utilisateur) */
.sidebar { transition: width .15s ease; overflow: hidden; }
.sidebar .logo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-menu-replier {
  flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--menu-muet); cursor: pointer;
}
.btn-menu-replier:hover { background: var(--menu-survol); color: var(--menu-texte-fort); }
.btn-menu-replier svg.lucide { width: 17px; height: 17px; }
.sidebar.replie { width: 60px; }
.sidebar.replie .logo { flex-direction: column; padding: 12px 0; }
.sidebar.replie .logo-texte { display: none; }
.sidebar.replie .menu-compte { display: none; }
.sidebar.replie .sidebar-user { justify-content: center; padding: 12px 0; }
.sidebar.replie .sidebar-user > span:not(.avatar),
.sidebar.replie .sidebar-user > svg.lucide:last-child { display: none; }
.sidebar.replie .recherche-globale-btn { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.replie .recherche-globale-btn span,
.sidebar.replie .recherche-globale-btn kbd { display: none; }
.sidebar.replie .menu-titre-groupe { font-size: 0; height: 0; padding: 0; margin: 8px 14px 4px; border-top: 1px solid var(--menu-bord); }
.sidebar.replie nav a { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.replie nav a span { display: none; }
.sidebar.replie nav a svg.lucide { margin-right: 0; }

/* Centre de notifications : cloche dans le menu, panneau à droite du menu */
.logo-actions { display: flex; align-items: center; gap: 2px; }
.sidebar.replie .logo-actions { flex-direction: column; }
.btn-notifs { position: relative; }
.sidebar .logo .notifs-compteur {
  position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--rouge); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center;
}
.panneau-notifs {
  position: fixed; top: 12px; left: 240px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 24px);
  display: flex; flex-direction: column; z-index: 40;
  background: var(--surface); color: var(--texte); border: 1px solid var(--gris-bord);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.panneau-notifs[hidden] { display: none; }
.notifs-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--gris-bord); }
.notifs-entete button { background: none; border: 0; color: var(--bleu); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.notifs-entete button:hover:not(:disabled) { background: var(--survol); }
.notifs-entete button:disabled { color: var(--gris-texte); opacity: .5; cursor: default; }
.notifs-entete svg.lucide { width: 16px; height: 16px; vertical-align: middle; }
.notifs-actions { display: flex; align-items: center; gap: 4px; }
.notifs-liste { overflow-y: auto; }
.notif {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--gris-bord); padding: 10px 14px; cursor: pointer;
  min-height: 44px;
}
.notif:hover { background: var(--survol); }
.notif.non-lue { border-left: 3px solid var(--bleu); padding-left: 11px; }
.notif-type { font-size: 11px; color: var(--gris-texte); text-transform: uppercase; letter-spacing: .4px; }
.notif-type em { font-style: normal; font-weight: 700; color: var(--bleu); margin-left: 6px; }
.notif-titre { font-size: 13.5px; }
.notif.lue .notif-titre { color: var(--gris-texte); }
.notif-date { font-size: 11.5px; color: var(--gris-texte); }
.notifs-vide { margin: 0; padding: 24px 14px; text-align: center; color: var(--gris-texte); }
.notifs-prefs { padding: 8px 14px 14px; }
.pref-ligne { display: grid; grid-template-columns: 1fr 80px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--gris-bord); font-size: 13px; }
.pref-ligne input { justify-self: center; width: 18px; height: 18px; }
.pref-tete { font-size: 11px; text-transform: uppercase; color: var(--gris-texte); letter-spacing: .4px; }
.pref-tete span:not(:first-child) { text-align: center; }
.notifs-note { margin: 10px 0 0; font-size: 12px; color: var(--gris-texte); }

/* Accueil : widgets personnalisables */
.accueil-entete { display: flex; align-items: flex-start; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.accueil-entete h1 { margin-bottom: 2px; }
.accueil-entete .btn svg.lucide, .perso-ajout .btn svg.lucide { margin-right: 4px; vertical-align: -2px; }
.accueil-grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.accueil-grille .widget { grid-column: span 4; position: relative; display: flex; flex-direction: column; min-width: 0; }
.accueil-grille .widget .wd-corps { overflow: auto; flex: 1; }
@media (max-width: 900px) { .accueil-grille .widget { grid-column: span 12 !important; height: auto !important; } .wd-redim { display: none; } }
.widget h3 { display: flex; align-items: center; gap: 8px; }
.wd-tout { margin-left: auto; font-size: 12px; font-weight: 400; }
.wd-ligne { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--gris-bord); color: var(--texte); text-decoration: none; font-size: 13px; min-height: 40px; align-items: center; }
.wd-ligne:last-child { border-bottom: 0; }
a.wd-ligne:hover span { color: var(--bleu); }
.wd-ligne em { font-style: normal; color: var(--gris-texte); font-size: 12px; white-space: nowrap; }
.wd-vide { margin: 0; padding: 10px 0; color: var(--gris-texte); font-size: 13px; }
.perso-liste { display: flex; flex-direction: column; margin-bottom: 14px; }
.perso-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gris-bord); }
.perso-ligne label { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; }
.perso-ligne input { width: 18px; height: 18px; }
.perso-ligne .btn svg.lucide { width: 14px; height: 14px; }
.perso-ligne .btn:disabled { opacity: .4; cursor: default; }
.accueil-perso h4 { margin: 4px 0 8px; font-size: 13px; color: var(--bleu-fonce); }
.perso-ajout { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* Import Excel, fusion de doublons, contacts et documents */
.modale.modale-large { width: min(860px, 96vw); }
.import-etapes { display: flex; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 12px; color: var(--gris-texte); }
.import-etapes li { padding: 4px 10px; border-radius: 12px; background: var(--survol-fort); }
.import-etapes li.actif { background: var(--bleu); color: #fff; font-weight: 600; }
.import-etapes li.fait { background: var(--survol); color: var(--bleu-fonce); }
.import-corps { display: flex; flex-direction: column; gap: 12px; }
.import-depot { display: flex; align-items: center; gap: 10px; padding: 26px; border: 2px dashed var(--gris-bord); border-radius: 8px; cursor: pointer; justify-content: center; color: var(--bleu-fonce); margin: 0; font-size: 14px; }
.import-depot:hover { border-color: var(--bleu); background: var(--survol); }
.import-depot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-depot svg.lucide { width: 20px; height: 20px; }
.import-grille { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 8px 14px; align-items: center; }
.import-grille label { margin: 0; font-size: 13px; color: var(--texte); }
.import-grille select { width: 100%; }
.import-resume { display: flex; gap: 14px; flex-wrap: wrap; }
.import-resume > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 110px; padding: 10px 14px; border: 1px solid var(--gris-bord); border-radius: 8px; }
.import-resume b { font-size: 22px; font-weight: 600; color: var(--bleu-fonce); }
.import-liste { max-height: 260px; overflow: auto; }
.import-doublons { border: 1px solid var(--gris-bord); border-radius: 8px; padding: 10px 14px; }
.import-doublons label { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; color: var(--texte); }
.import-doublons input { width: auto; }
.import-erreur { margin: 0; color: var(--rouge); font-size: 13px; }
.doublon-groupe { border: 1px solid var(--gris-bord); border-radius: 8px; padding: 8px 14px 12px; margin: 0 0 12px; }
.doublon-groupe legend { font-size: 12px; color: var(--gris-texte); padding: 0 6px; }
.doublon-ligne { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px; color: var(--texte); }
.doublon-ligne input { width: auto; margin-top: 3px; }
.doublon-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; }
.section-bloc h3 .btn { margin-left: 10px; vertical-align: middle; }
.section-bloc h3 .btn svg.lucide { width: 13px; height: 13px; vertical-align: -2px; }
.bouton-plus { padding: 0 6px; height: 24px; }   /* « + » à droite du titre d'une liste associée */
.onglets-fiche { margin: 4px 0 16px; }
.actions-ligne { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.actions-ligne .btn svg.lucide { width: 14px; height: 14px; vertical-align: -2px; }

/* Administration : intégration Alice */
.alice-resultat { margin: 12px 0 0; min-height: 1.4em; font-size: 13px; }
.alice-resultat.ok { color: var(--vert); }
.alice-resultat.ko { color: var(--rouge); }

/* Langue : écran de connexion et menu du compte */
.langue-connexion { position: absolute; top: 14px; right: 14px; background: var(--surface-2); }
.langue-connexion button { color: var(--gris-texte); }
.theme-choix button[data-langue] { min-width: 34px; font: 600 11px/1 inherit; letter-spacing: .4px; }

/* Administration : traductions */
.trad-barre { align-items: center; margin-top: 0; }
.trad-barre input[type="search"] { flex: 1; min-width: 240px; height: 36px; padding: 0 12px; border: 1px solid var(--gris-bord); border-radius: 6px; background: var(--surface); color: var(--texte); font: inherit; }
.trad-case { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.trad-table td { vertical-align: middle; }
.trad-table td:first-child { width: 42%; color: var(--gris-texte); }
.trad-saisie { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--gris-bord); border-radius: 6px; background: var(--surface); color: var(--texte); font: inherit; }
.trad-saisie:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,128,162,0.18); }
.trad-etat { white-space: nowrap; text-align: right; }
.trad-plus { padding: 12px; text-align: center; }

/* Tickets Alice */
.tk-grille { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 10px 14px; align-items: start; }
.tk-grille > label { margin: 8px 0 0; font-size: 13px; color: var(--texte); }
.tk-grille input, .tk-grille select, .tk-grille textarea { width: 100%; font: inherit; }
.tk-grille textarea { resize: vertical; min-height: 110px; }
.tk-depot { display: flex; align-items: center; gap: 10px; padding: 16px; border: 2px dashed var(--gris-bord); border-radius: 8px; cursor: pointer; color: var(--bleu-fonce); }
.tk-depot:hover, .tk-depot.survol, .tk-depot:focus-visible { border-color: var(--bleu); background: var(--survol); outline: none; }
.tk-depot svg.lucide { width: 18px; height: 18px; flex: 0 0 auto; }
.tk-limites { margin: 6px 0 0; }
.tk-fichiers { list-style: none; margin: 8px 0 0; padding: 0; }
.tk-fichiers li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--gris-bord); font-size: 13px; flex-wrap: wrap; }
.tk-fichiers em { font-style: normal; color: var(--gris-texte); font-size: 12px; }
.tk-fichiers .btn { margin-left: auto; }
.tk-fichiers .btn svg.lucide { width: 13px; height: 13px; }

/* Graphique Chart.js (graph.js) */
.graph-cadre { background: var(--surface); border: 1px solid var(--gris-bord);
  border-radius: 0 0 6px 6px; padding: 16px 16px 10px; }
.graph-canvas-wrap { position: relative; width: 100%; height: 380px; }
.graph-vide { height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--gris-texte); font-size: 14px; }
.graph-stacked.inactif { opacity: 0.5; cursor: not-allowed; }

/* Thème : « système » suit l'OS ; « clair » / « sombre » forcent le choix (attribut data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
  color-scheme: dark;
  --menu-fond: #102532;
  --menu-texte: #cfd8de;
  --menu-texte-fort: #ffffff;
  --menu-muet: #7f97a5;
  --menu-bord: #1d3a4a;
  --menu-bord-fort: #2c5a73;
  --menu-chip: #1d3a4a;
  --menu-survol: #16303f;
  --menu-champ: #0b1c27;
  --menu-compte-fond: #0d2230;
  --surface: #172631;
  --surface-2: #1b2d3a;
  --survol: #1f3442;
  --survol-fort: #274051;
  --bord-leger: #243845;
  --bleu-fonce: #6cc4da;
  --gris-fond: #0f1a22;
  --gris-bord: #2c4150;
  --gris-texte: #9fb2bf;
  --texte: #e4ecf1;
  }
  :root:not([data-theme="clair"]) .btn:hover { background: #055f75; }
  :root:not([data-theme="clair"]) .gris { background: #2a3b47; color: #c5d2db; }
  :root:not([data-theme="clair"]) .vert { background: #1b3b2b; color: #7fd6a2; }
  :root:not([data-theme="clair"]) .orange { background: #43310f; color: #f2b865; }
  :root:not([data-theme="clair"]) .bleu { background: #12384a; color: #7cc9e0; }
  :root:not([data-theme="clair"]) .rouge { background: #44201f; color: #f09a9d; }
  :root:not([data-theme="clair"]) .violet { background: #33264a; color: #c9aaee; }
  :root:not([data-theme="clair"]) .champ .v.modifiable:focus { background: #3a3417; }
}
:root[data-theme="sombre"] {
  color-scheme: dark;
  --menu-fond: #102532;
  --menu-texte: #cfd8de;
  --menu-texte-fort: #ffffff;
  --menu-muet: #7f97a5;
  --menu-bord: #1d3a4a;
  --menu-bord-fort: #2c5a73;
  --menu-chip: #1d3a4a;
  --menu-survol: #16303f;
  --menu-champ: #0b1c27;
  --menu-compte-fond: #0d2230;
  --surface: #172631;
  --surface-2: #1b2d3a;
  --survol: #1f3442;
  --survol-fort: #274051;
  --bord-leger: #243845;
  --bleu-fonce: #6cc4da;
  --gris-fond: #0f1a22;
  --gris-bord: #2c4150;
  --gris-texte: #9fb2bf;
  --texte: #e4ecf1;
}
:root[data-theme="sombre"] .btn:hover { background: #055f75; }
:root[data-theme="sombre"] .gris { background: #2a3b47; color: #c5d2db; }
:root[data-theme="sombre"] .vert { background: #1b3b2b; color: #7fd6a2; }
:root[data-theme="sombre"] .orange { background: #43310f; color: #f2b865; }
:root[data-theme="sombre"] .bleu { background: #12384a; color: #7cc9e0; }
:root[data-theme="sombre"] .rouge { background: #44201f; color: #f09a9d; }
:root[data-theme="sombre"] .violet { background: #33264a; color: #c9aaee; }
:root[data-theme="sombre"] .champ .v.modifiable:focus { background: #3a3417; }

/* Sélecteur de thème (menu latéral) */
.theme-choix { display: flex; gap: 2px; padding: 3px; background: var(--menu-champ); border-radius: 8px; }
.theme-choix button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  color: var(--menu-muet); font: inherit; font-size: 11.5px;
}
.theme-choix button:hover { color: var(--menu-texte-fort); }
.theme-choix button.actif { background: var(--menu-chip); color: var(--menu-texte-fort); }
.theme-choix svg.lucide { width: 14px; height: 14px; }

/* Fiche société (Administration) */
.admin-page { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.admin-intro { margin: 0; color: var(--gris-texte); font-size: 13px; }
.admin-carte {
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 10px;
  padding: 18px 22px 20px;
}
.admin-carte h3 {
  margin: 0 0 14px; font-family: "Titillium Web", "Segoe UI", sans-serif; font-size: 14px;
  font-weight: 600; color: var(--texte); display: flex; align-items: center; gap: 8px;
}
.admin-carte h3 svg.lucide { width: 16px; height: 16px; color: var(--bleu); }
.grille-societe { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px 20px; }   /* utilise toute la largeur */
.champ-societe { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.champ-societe > span { font-size: 12px; font-weight: 600; color: var(--gris-texte); }
.champ-societe input[type="text"], .champ-societe input[type="number"], .champ-societe input[type="password"] {
  width: 100%; height: 36px; padding: 0 11px; font: inherit; font-size: 13.5px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px;
  transition: border-color .12s, box-shadow .12s;
}
.champ-societe input:hover { border-color: var(--gris-texte); }
.champ-societe input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,128,162,0.18); }
.champ-interrupteur { flex-direction: row; align-items: center; justify-content: space-between; align-self: end; height: 36px; gap: 10px; }
.champ-interrupteur input { position: absolute; opacity: 0; pointer-events: none; }
.champ-interrupteur i.interrupteur {
  position: relative; width: 38px; height: 22px; flex-shrink: 0; border-radius: 11px;
  background: var(--gris-bord); transition: background .15s; cursor: pointer;
}
.champ-interrupteur i.interrupteur::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s;
}
.champ-interrupteur input:checked + i.interrupteur { background: var(--bleu); }
.champ-interrupteur input:checked + i.interrupteur::after { transform: translateX(16px); }
.champ-interrupteur input:focus-visible + i.interrupteur { box-shadow: 0 0 0 3px rgba(0,128,162,0.25); }
/* fiche produit : zone de dépôt du lien de la fiche technique (TKT-2026-0213) */
.depot-lien { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 12px 14px; border: 1.5px dashed var(--gris-bord); border-radius: 8px; color: var(--gris-texte); font-size: 13px; }
.depot-lien svg.lucide { width: 16px; height: 16px; color: var(--bleu); }
.depot-lien input { flex: 1 1 220px; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--gris-bord); border-radius: 6px; background: var(--surface); color: var(--texte); font: inherit; }
.depot-lien.survol { border-color: var(--bleu); background: rgba(0,128,162,0.06); }
/* fiches (edition.js) : l'interrupteur reste sous son libellé, à gauche, dans sa colonne (TKT-2026-0213) */
.modale .champ-form > label.champ-interrupteur { display: inline-flex; justify-content: flex-start; width: auto; max-width: 100%; margin: 0; }
.modale .champ-form > label.champ-interrupteur > span:empty { display: none; }
.admin-actions {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end;
  padding: 12px 0; background: linear-gradient(to top, var(--gris-fond) 70%, transparent);
}

/* Recherche générale (Ctrl+K / loupe du menu) */
.recherche-globale-btn {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 32px); margin: 10px 16px 0;
  padding: 7px 10px; border: 1px solid var(--menu-bord); border-radius: 8px; background: var(--menu-champ);
  color: var(--menu-muet); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left;
}
.recherche-globale-btn:hover { color: var(--menu-texte-fort); border-color: var(--menu-bord-fort); }
.recherche-globale-btn svg.lucide { width: 15px; height: 15px; flex-shrink: 0; }
.recherche-globale-btn span { flex: 1; }
.recherche-globale-btn kbd {
  font: inherit; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; background: var(--menu-chip); color: var(--menu-muet);
}
.rg-fond {
  position: fixed; inset: 0; z-index: 80; background: rgba(8, 20, 28, 0.55);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh;
}
.rg-boite {
  width: 640px; max-width: 94vw; background: var(--surface); color: var(--texte);
  border: 1px solid var(--gris-bord); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden; display: flex; flex-direction: column; max-height: 70vh;
}
.rg-entree { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--gris-bord); }
.rg-entree svg.lucide { width: 18px; height: 18px; color: var(--gris-texte); flex-shrink: 0; }
.rg-entree input {
  flex: 1; border: 0; outline: 0; background: transparent; color: var(--texte);
  font: inherit; font-size: 16px;
}
.rg-entree kbd { font: inherit; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--survol-fort); color: var(--gris-texte); }
.rg-liste { overflow-y: auto; padding: 6px 0 8px; }
.rg-groupe { padding: 10px 16px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gris-texte); }
.rg-ligne {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer; text-decoration: none; color: inherit;
}
.rg-ligne svg.lucide { width: 16px; height: 16px; color: var(--gris-texte); flex-shrink: 0; }
.rg-ligne.actif { background: var(--survol); }
.rg-ligne .rg-titre { font-size: 13.5px; }
.rg-ligne .rg-detail { margin-left: auto; font-size: 12px; color: var(--gris-texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.rg-vide { padding: 22px 16px; text-align: center; color: var(--gris-texte); font-size: 13px; }
.rg-pied { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--gris-bord); font-size: 11.5px; color: var(--gris-texte); }
/* page de tous les résultats (#/recherche?q=…) */
.rgp-page { max-width: 980px; padding: 0 0 32px; }
.rgp-champ { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; margin: 4px 0 10px;
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 8px; }
.rgp-champ svg.lucide { width: 18px; height: 18px; color: var(--gris-texte); flex-shrink: 0; }
.rgp-champ input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--texte); font: inherit; font-size: 14px; }
.rgp-total { margin: 0 0 10px; font-size: 13px; }
.rgp-sommaire { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rgp-puce { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--gris-bord); border-radius: 999px;
  background: var(--surface); color: var(--texte); font: inherit; font-size: 12.5px; cursor: pointer; }
.rgp-puce:hover { background: var(--survol); }
.rgp-puce svg.lucide { width: 14px; height: 14px; color: var(--gris-texte); }
.rgp-puce b { font-weight: 600; color: var(--gris-texte); }
.rgp-groupe { background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 10px; margin-bottom: 14px; overflow: hidden; scroll-margin-top: 12px; }
.rgp-groupe h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 16px; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--gris-texte); border-bottom: 1px solid var(--gris-bord); }
.rgp-groupe h2 svg.lucide { width: 16px; height: 16px; }
.rgp-nb { margin-left: auto; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--survol-fort); }
.rgp-lignes .rg-ligne + .rg-ligne { border-top: 1px solid var(--gris-bord); }
.rgp-lignes .rg-ligne:hover { background: var(--survol); }

/* Design commun des écrans d'administration : cartes arrondies, titres à icône, champs 36 px */
.admin-entete { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-entete .admin-intro { flex: 1; }
.admin-carte.sans-marge { padding: 0; overflow: hidden; }
.admin-carte.sans-marge h3.avec-marge { margin: 0; padding: 16px 22px 12px; }
.admin-carte.sans-marge table { width: 100%; }
.admin-carte.sans-marge th { background: var(--surface-2); border-top: 1px solid var(--bord-leger); }
.admin-carte.sans-marge tbody tr:last-child td { border-bottom: 0; }
.admin-carte .admin-intro { margin: 0 0 12px; }
.admin-actions-ligne { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.user-cellule { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--survol-fort); color: var(--bleu-fonce); font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.admin-page code { background: var(--survol-fort); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* Champ image : clic sur l'aperçu pour choisir un fichier, ou saisie d'une URL */
.champ-image { grid-column: 1 / -1; }
.image-zone { display: flex; align-items: center; gap: 16px; }
.image-apercu {
  width: 88px; height: 88px; flex-shrink: 0; border: 1.5px dashed var(--gris-bord); border-radius: 10px;
  background: var(--surface-2); color: var(--gris-texte); cursor: pointer; padding: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.image-apercu:hover { border-color: var(--bleu); color: var(--bleu); }
.image-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-apercu svg.lucide { width: 26px; height: 26px; }
.image-saisie { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.image-boutons { display: flex; gap: 8px; }
.image-boutons .btn:disabled { opacity: .4; cursor: default; }
.image-info { color: var(--vert); font-size: 12px; min-height: 14px; }
.image-info:empty { display: none; }
.champ-societe input.image-url { max-width: 640px; }

/* Menu du compte : zone dépliée sous le nom de l'utilisateur */
.sidebar-user { cursor: pointer; user-select: none; }
.sidebar-user:hover { background: var(--menu-survol); }
.sidebar-user span { flex: 1; }
.sidebar-user svg.lucide:last-child { margin-left: auto; transition: transform .15s; }
.sidebar-user.ouvert svg.lucide:last-child { transform: rotate(180deg); }
.menu-compte { padding: 6px 10px 10px; border-bottom: 1px solid var(--menu-bord); background: var(--menu-compte-fond); }
.menu-compte[hidden] { display: none; }
.menu-compte-lien {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--menu-texte); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; text-align: left;
}
.menu-compte-lien:hover { background: var(--menu-survol); color: var(--menu-texte-fort); }
.menu-compte-lien svg.lucide { width: 16px; height: 16px; flex-shrink: 0; color: var(--menu-muet); }
.menu-compte-lien span { flex: 1; }
.menu-compte-lien em { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 8px; background: var(--menu-chip); color: var(--menu-muet); }
.menu-compte-lien.desactive { cursor: default; opacity: .7; }
.menu-compte-lien.desactive:hover { background: transparent; color: var(--menu-texte); }
.menu-compte-theme { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.menu-compte-theme > span { font-size: 11px; color: var(--menu-muet); text-transform: uppercase; letter-spacing: .05em; }

/* Photo d'utilisateur : toujours ronde */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar-user .avatar { width: 24px; height: 24px; font-size: 10px; flex: 0 0 24px; }
.champ-image.rond .image-apercu { border-radius: 50%; width: 96px; height: 96px; padding: 0; }
.champ-image.rond .image-apercu img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.modale .champ-image { margin-bottom: 6px; }
.modale .champ-image > span, .modale .champ-societe > span { font-size: 12px; color: var(--gris-texte); font-weight: 400; }
.modale .image-url { font-size: 12.5px; }
.modale .champ-interrupteur { margin-top: 14px; }

/* Utilisateur désactivé et interrupteur compact de la grille */
.ligne-inactive td { opacity: .5; }
.ligne-inactive td:has(.actif-user), .ligne-inactive td:has(.user-cellule) { opacity: 1; }
.ligne-inactive .user-cellule { opacity: .6; }
.user-cellule[data-uid] { cursor: pointer; }
.user-cellule[data-uid]:hover b { color: var(--bleu-fonce); text-decoration: underline; }
.champ-interrupteur.petit { height: 22px; align-self: center; margin: 0; }
.champ-interrupteur.petit .interrupteur { cursor: pointer; }
.champ-interrupteur input:disabled + i.interrupteur { opacity: .4; cursor: not-allowed; }
.modale label.champ-interrupteur { display: flex; margin: 14px 0 0; font-size: 13px; color: var(--texte); }
.modale .champ-interrupteur input { width: auto; }

/* Suivi des tickets Alice */
.tk-messages { margin-top: 6px; }
.tk-messages summary { cursor: pointer; color: var(--bleu); font-size: 12px; }
.tk-message { margin-top: 6px; padding: 6px 8px; border-left: 3px solid var(--gris-bord); font-size: 12px; }
.tk-message em { font-style: normal; color: var(--gris-texte); margin-left: 6px; }

/* Vues enregistrées d'une liste (S5) */
.dropdown-vues { z-index: 60; width: 280px; background: var(--blanc, #fff); border: 1px solid var(--gris-bord); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); padding: 8px; }
.dv-liste { list-style: none; margin: 0 0 8px; padding: 0; max-height: 220px; overflow-y: auto; }
.dv-liste li { display: flex; align-items: center; gap: 4px; }
.dv-liste .dv-appliquer { flex: 1; text-align: left; background: none; border: none; padding: 6px 8px; border-radius: 4px; cursor: pointer; font: inherit; }
.dv-liste .dv-appliquer:hover { background: var(--survol); }
.dv-liste .dv-appliquer em { margin-left: 6px; font-size: 11px; color: var(--gris-texte); font-style: normal; }
.dv-liste .dv-supprimer { background: none; border: none; cursor: pointer; padding: 4px; color: var(--gris-texte); }
.dv-vide { padding: 6px 8px; color: var(--gris-texte); font-size: 12px; }
.dv-nouvelle { display: grid; gap: 6px; border-top: 1px solid var(--gris-bord); padding-top: 8px; }
.dv-nouvelle label { font-size: 12px; color: var(--gris-texte); }
.dv-nouvelle input[name="nom"] { padding: 6px 8px; border: 1px solid var(--gris-bord); border-radius: 4px; font: inherit; }
.dv-nouvelle .dv-partage { display: flex; align-items: center; gap: 6px; }

/* Éditeur d'offre (S6) */
.ed-boutons { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.ed-entete { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.ed-entete h3 { display: flex; align-items: center; gap: 6px; margin: 0; }
.ed-chapitre { border: 1px solid var(--gris-bord); border-radius: 8px; margin-bottom: 12px; overflow: hidden; background: var(--surface, #fff); }
.ed-barre { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #1f2d3d; color: #fff; flex-wrap: wrap; }
.ed-barre .ed-titre { flex: 1; min-width: 160px; background: transparent; border: 1px solid transparent; color: inherit; font: inherit; font-weight: 600; padding: 4px 6px; border-radius: 4px; }
.ed-barre .ed-titre:hover, .ed-barre .ed-titre:focus { border-color: rgba(255,255,255,0.4); outline: none; }
.ed-soustotal { display: flex; gap: 14px; font-size: 12px; white-space: nowrap; }
.ed-table { width: 100%; border-collapse: collapse; }
.ed-table th { font-size: 11px; text-transform: uppercase; color: var(--gris-texte); text-align: left; padding: 6px 8px; }
.ed-table th.num, .ed-table td.num { text-align: right; }
.ed-table td { padding: 6px 8px; border-top: 1px solid var(--gris-bord); vertical-align: top; }
.ed-article { display: flex; gap: 8px; align-items: flex-start; }
.ed-desc { font-size: 12px; color: var(--gris-texte); }
.ed-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--survol); border: 1px solid var(--gris-bord); }
.ed-champ { width: 84px; padding: 4px 6px; border: 1px solid var(--gris-bord); border-radius: 4px; text-align: right; font: inherit; background: transparent; color: inherit; }
.ed-champ:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 2px rgba(0,128,162,0.15); }
.ed-champ:disabled { border-color: transparent; }
.ed-interne { background: rgba(120,120,120,0.06); }
.ed-option { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(60,160,90,0.12) 6px 12px); }
.ed-cadenas { color: var(--bleu); margin-right: 2px; }
/* cellule de tableau : ne jamais la passer en flex (le trait de séparation se décale) */
.ed-actions { display: flex; gap: 4px; white-space: nowrap; }
td.ed-actions { display: table-cell; }
td.ed-actions > * + * { margin-left: 4px; }
.ed-ajout { padding: 8px 12px; border-top: 1px solid var(--gris-bord); }
.ed-totaux { display: flex; justify-content: flex-end; gap: 24px; padding: 10px 14px; border-radius: 8px; background: var(--survol); border: 1px solid var(--gris-bord); }
.ed-total-final { font-size: 16px; }
.marge-verte { color: #1a7f37; font-weight: 600; }
.marge-rouge { color: #cf222e; font-weight: 600; }
.ed-barre .marge-verte { color: #7ee2a0; }
.ed-barre .marge-rouge { color: #ff9b9b; }
.ed-onglets { display: flex; gap: 6px; margin-bottom: 10px; }
.ed-resultats { max-height: 240px; overflow-y: auto; margin: 6px 0 10px; }
.ed-resultat { display: grid; grid-template-columns: 1fr auto; text-align: left; width: 100%; gap: 2px 10px; padding: 6px 8px; background: none; border: 1px solid var(--gris-bord); border-radius: 6px; margin-bottom: 4px; cursor: pointer; font: inherit; color: inherit; }
.ed-resultat:hover { background: var(--survol); }
.ed-resultat span { grid-column: 1; font-size: 12px; color: var(--gris-texte); }
.ed-resultat em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; color: var(--gris-texte); }

/* Alertes d'une offre (S7) */
.ed-alertes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.ed-alerte { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--gris-bord); font-size: 13px; }
.ed-alerte .pastille { display: inline-flex; align-items: center; }
.ed-alerte-rouge { border-left: 4px solid #cf222e; }
.ed-alerte-orange { border-left: 4px solid #d98a00; }
.ed-alerte-bleu { border-left: 4px solid var(--bleu); }

/* Éditeur d'offre conforme au CDC (S7bis) */
.ed-defile { overflow-x: auto; }
.ed-table { min-width: 1100px; }
.ed-petit { width: 56px; }
.ed-remise-neg { border-color: #d97706; background: #fff4e0; color: #9a4b00; }
.ed-pv { white-space: nowrap; }
.ed-verrou { background: none; border: none; cursor: pointer; padding: 2px; color: var(--gris-texte); vertical-align: middle; }
.ed-verrou.actif { color: var(--bleu); }
.ed-verrou:disabled { cursor: default; opacity: 0.5; }
.ed-pied { margin-top: 12px; }
.ed-validation { margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-pied-table { width: 100%; max-width: 640px; margin-left: auto; border-collapse: collapse; }
.ed-pied-table td { padding: 4px 8px; }
.ed-pied-table td.num { text-align: right; white-space: nowrap; }
.ed-pied-saisie { display: flex; gap: 6px; align-items: center; }
.ed-pied-saisie select, .ed-pied-saisie input { height: 30px; }
.ed-pied-net td { border-top: 1px solid var(--gris-bord); font-size: 15px; }
.ed-pied-ttc td { font-size: 15px; }
.ed-heures { margin: 8px 0 0; font-size: 12px; }

/* Structure de l'offre (S7ter) : sous-chapitres, texte, bundle, variante */
.ed-sous { margin: 8px 12px 12px; border-left: 4px solid var(--bleu); }
.ed-sous > .ed-barre { background: #34506b; }
.ed-repli { background: none; border: none; color: inherit; cursor: pointer; padding: 2px 4px; }
.ed-numero { display: inline-block; min-width: 34px; font-size: 11px; color: var(--gris-texte); font-weight: 600; margin-right: 4px; }
.ed-numero-chap { color: #fff; opacity: 0.8; }
.ed-composant td { background: rgba(120,120,120,0.08); color: var(--gris-texte); }
.ed-composant .ed-article { padding-left: 28px; }
.ed-variante { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(139,92,246,0.14) 6px 12px); }
.ed-tete td { font-weight: 500; }
.ed-impact { font-size: 11px; }
.ed-impact.plus { color: #cf222e; }
.ed-impact.moins { color: #1a7f37; }
.ed-comptee { font-size: 11px; white-space: nowrap; }
.ed-texte td, .ed-saut td { background: rgba(120,120,120,0.05); }
.ed-texte-champ { width: 100%; text-align: left; font-style: italic; resize: vertical; }
.ed-saut td { text-align: center; font-size: 11px; color: var(--gris-texte); border-top: 1px dashed var(--gris-bord); }
.ed-ajout { display: flex; gap: 6px; flex-wrap: wrap; }

/* Centre d'alertes (S7.2) */
.al-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.al-tuile { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--gris-bord);
  border-radius: 8px; background: var(--surface, #fff); cursor: pointer; font: inherit; color: inherit; }
.al-tuile b { font-size: 20px; }
.al-tuile span { grid-column: 1 / -1; font-size: 12px; color: var(--gris-texte); }
.al-tuile.actif { border-color: var(--bleu); box-shadow: 0 0 0 2px rgba(0,128,162,0.18); }
.al-filtres { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.al-filtres label { display: grid; gap: 4px; font-size: 12px; color: var(--gris-texte); }
.al-case { display: flex !important; align-items: center; gap: 6px; }
.al-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.al-table td { vertical-align: top; }
.al-ferme { opacity: 0.6; }
.menu-compteur { margin-left: auto; background: #cf222e; color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.pastille.violet { background: rgba(139,92,246,0.15); color: #6d3fd1; }

/* Assistant d'appel d'offres (S8) */
.ao-assistant { max-width: min(1100px, 96vw); }
.ao-etapes { display: flex; gap: 6px; list-style: none; padding: 0; margin: 4px 0 12px; flex-wrap: wrap; }
.ao-etapes li { padding: 4px 10px; border-radius: 14px; background: var(--survol); font-size: 12px; color: var(--gris-texte); }
.ao-etapes li.actif { background: var(--bleu); color: #fff; }
.ao-etapes li.fait { background: rgba(26,127,55,0.15); color: #1a7f37; }
.ao-etapes span { font-weight: 700; margin-right: 2px; }
.ao-erreur { color: #cf222e; margin: 4px 0 8px; }
.ao-reglages, .ao-colonnes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 8px 0; }
.ao-reglages label, .ao-colonnes label { display: grid; gap: 4px; font-size: 12px; color: var(--gris-texte); }
.ao-apercu, .ao-postes { max-height: 300px; overflow: auto; border: 1px solid var(--gris-bord); border-radius: 6px; margin: 8px 0; }
.ao-apercu table, .ao-postes table { border-collapse: collapse; width: 100%; font-size: 12px; }
.ao-apercu td, .ao-apercu th, .ao-postes td, .ao-postes th { border: 1px solid var(--gris-bord); padding: 3px 6px; text-align: left; white-space: nowrap; }
.ao-postes td { white-space: normal; }
.ao-entete td { background: rgba(0,128,162,0.12) !important; font-weight: 700; }
.ao-avant td { opacity: 0.5; }
.ao-chapitre td { background: var(--survol); }
.ao-actions { white-space: nowrap; }

/* Document client (S10) */
.doc-ligne { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.doc-ligne label { display: grid; gap: 4px; font-size: 12px; color: var(--gris-texte); }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.doc-table th, .doc-table td { border-bottom: 1px solid var(--gris-bord); padding: 4px 6px; text-align: left; }
.doc-table .num { text-align: right; }
.doc-section { border-top: 1px solid var(--gris-bord); padding: 8px 0; }
.doc-section-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.doc-section textarea { width: 100%; font: inherit; border: 1px solid var(--gris-bord); border-radius: 6px; padding: 6px 8px; background: transparent; color: inherit; }
.doc-options { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; font-size: 13px; }

/* S11-S12 : circuit de validation, versions, page Validations */
.ed-consigne { display: block; margin: 8px 0; padding: 8px 10px; background: #fff8e1; border: 1px solid #f0d98c; border-radius: 6px; }
.ligne-case { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: 400; }
.ligne-case input { width: auto; }
.liste-simple { margin: 8px 0 0; padding-left: 18px; }
tr.ligne-active td { background: #eef5ff; }
.onglets { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--gris-bord); }
.onglet {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0;
  padding: 9px 16px; font: inherit; font-size: 13.5px; color: var(--gris-texte); cursor: pointer; transition: color .15s, background-color .15s;
}
.onglet:hover { color: var(--texte); background: var(--survol); }
.onglet.actif { color: var(--bleu-fonce); border-bottom-color: var(--bleu); font-weight: 600; background: none; }

/* S13-S14 : CRM */
.crm-barre { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.crm-barre .btn { margin-left: auto; }
.crm-indicateurs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-tuile { flex: 1; min-width: 150px; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px; padding: 10px 12px; }
.crm-tuile span { display: block; font-size: 12px; color: var(--gris-texte); }
.crm-tuile b { display: block; font-size: 18px; color: var(--bleu-fonce); margin: 2px 0; }
.crm-tuile em { font-style: normal; font-size: 12px; color: var(--gris-texte); }
.crm-etapes { margin-top: 0; }
tr.ligne-retard td { background: #fff1f0; }
.rouge { color: var(--rouge); }

/* S21-S25 : facturation et finance */
.fin-barre { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-size: 12px; }
.fin-barre span { width: 90px; color: var(--gris-texte); }
.fin-barre > div { flex: 1; background: var(--surface); border-radius: 3px; height: 14px; position: relative; overflow: hidden; }
.fin-barre i { display: block; height: 7px; }
.fin-barre i.b1 { background: var(--bleu); }
.fin-barre i.b2 { background: var(--vert); }
.fin-barre i.b3 { background: var(--rouge); height: 14px; }
.fin-barre em { width: 190px; font-style: normal; text-align: right; }

/* Champs de saisie modernes : base commune (spécificité nulle, les classes spécifiques gardent la main) */
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=button]):not([type=submit]):not([type=hidden]), select, textarea) {
  box-sizing: border-box; height: 36px; padding: 0 12px; font: inherit; font-size: 13px; line-height: 1.3;
  color: var(--texte); background-color: var(--surface);
  border: 1px solid var(--gris-bord); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
:where(textarea) { height: auto; min-height: 80px; padding: 8px 12px; resize: vertical; }
:where(input, select, textarea)::placeholder { color: var(--menu-muet); opacity: 1; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=button]):not([type=submit]), select, textarea):hover:not(:disabled) { border-color: var(--menu-bord-fort); }
:where(input, select, textarea):focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,128,162,0.18); }
:where(input, select, textarea):disabled { background-color: var(--surface-2); color: var(--gris-texte); cursor: not-allowed; opacity: .75; }
:where(select) {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a9aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
:where(select[multiple]) { height: auto; padding: 6px; background-image: none; }
:where(select option) { background: var(--surface); color: var(--texte); }
:where(input[type=date], input[type=datetime-local], input[type=month], input[type=time]) { cursor: pointer; min-width: 140px; }
:where(input[type=date], input[type=datetime-local], input[type=month], input[type=time])::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; border-radius: 4px; padding: 2px; }
:where(input[type=date], input[type=datetime-local], input[type=month], input[type=time])::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--survol); }
:where(input[type=checkbox], input[type=radio]) { accent-color: var(--bleu); }
:where(input[type=file]) { font: inherit; font-size: 13px; color: var(--texte); }
:where(input[type=file])::file-selector-button { margin-right: 10px; padding: 7px 12px; border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); color: var(--bleu-fonce); font: inherit; cursor: pointer; }
:where(input[type=file])::file-selector-button:hover { border-color: var(--bleu); }

/* Compte de l'utilisateur : à droite du fil d'Ariane, menu déroulant en carte flottante */
.bandeau .sidebar-user { flex: none; width: auto; padding: 4px 10px 4px 6px; border: 0; border-radius: 10px; color: var(--texte); font-size: 13.5px; }
.bandeau .sidebar-user:hover, .bandeau .sidebar-user.ouvert { background: var(--survol); }
.bandeau .sidebar-user span { flex: none; max-width: 220px; }
.bandeau .sidebar-user .avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.bandeau .sidebar-user svg.lucide { color: var(--gris-texte); }
.bandeau .menu-compte {
  position: absolute; right: 22px; top: calc(100% + 6px); width: 280px; z-index: 25; padding: 8px;
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 37, 50, 0.18);
  /* la carte suit le thème de la page (les variables --menu-* sont celles du menu latéral sombre) */
  --menu-texte: var(--texte); --menu-texte-fort: var(--texte); --menu-muet: var(--gris-texte);
  --menu-survol: var(--survol); --menu-champ: var(--surface-2); --menu-chip: var(--surface); --menu-bord: var(--bord-leger);
}
.bandeau .menu-compte .theme-choix button.actif { background: var(--surface); box-shadow: 0 0 0 1px var(--gris-bord); color: var(--bleu); }

/* Profils de droits (Administration › Profils) : liste, puis écran à deux colonnes façon Zoho */
.ligne-cliquable { cursor: pointer; }
.ligne-cliquable:hover td { background: var(--survol); }
.profil-page { max-width: none; }
.profil-corps { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.profil-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; }
.pf-nav-titre { margin: 14px 0 4px; font-weight: 600; font-size: 13px; }
.pf-nav-titre:first-child { margin-top: 0; }
.pf-nav { display: block; padding: 7px 10px; border-radius: 6px; color: var(--texte); text-decoration: none; font-size: 13.5px; }
.pf-nav:hover { background: var(--survol); }
.pf-nav.actif { background: var(--surface-2); color: var(--bleu); font-weight: 600; }
.profil-droite { max-width: 900px; }
.pf-titre { margin: 0 0 12px; font-size: 17px; }
.pf-titre:not(:first-child) { margin-top: 28px; }
.pf-ligne { display: grid; grid-template-columns: minmax(180px, 1fr) 60px minmax(240px, 1fr); align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--bord-leger); }
.pf-ligne .pf-nom .muted { font-size: 12.5px; }
.pf-ligne .champ-interrupteur { align-self: center; }
.pf-select { width: 100%; height: 36px; }
@media (max-width: 800px) { .profil-corps { grid-template-columns: 1fr; } .profil-nav { position: static; flex-direction: row; flex-wrap: wrap; } .pf-ligne { grid-template-columns: 1fr 60px; } .pf-niveau { grid-column: 1 / -1; } }


/* Recettage (Administration) : tableur du plan de test, tiroir des échanges */
.admin-page-large { max-width: none; }
.rc-barre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rc-case { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rc-puces { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-chip { border: 1px solid var(--gris-bord); background: var(--surface); color: var(--texte); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.rc-chip b { margin-left: 4px; }
.rc-chip.actif { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.rc-tableur { overflow: auto; max-height: calc(100vh - 290px); border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); }
.rc-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1500px; font-size: 13px; }
.rc-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; white-space: nowrap; }
.rc-table th, .rc-table td { padding: 6px 10px; border-right: 1px solid var(--bord-leger); border-bottom: 1px solid var(--bord-leger); vertical-align: top; }
.rc-table td.rc-id, .rc-table th:first-child { position: sticky; left: 0; background: var(--surface-2); z-index: 1; }
.rc-table th:first-child { z-index: 3; }
.rc-table tbody tr:nth-child(even) td:not(.rc-id) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.rc-table tbody tr:hover td { background: var(--survol); }
.rc-table td.rc-long { min-width: 220px; }
.rc-edit { min-height: 20px; max-height: 66px; overflow: hidden; white-space: pre-wrap; padding: 2px 4px; margin: -2px -4px; border-radius: 4px; outline: none; cursor: text; }
.rc-edit:focus { max-height: none; overflow: visible; background: var(--surface); box-shadow: 0 0 0 2px var(--bleu); position: relative; z-index: 1; }
.rc-actions { white-space: nowrap; }
.rc-actions .btn { padding: 0 8px; height: 28px; }
.rc-actions .btn.danger { background: var(--rouge, #c0392b); color: #fff; border-color: var(--rouge, #c0392b); }
.rc-ajout td { background: transparent !important; border-bottom: 0; }
.rc-ajout-bouton { border: 0; background: none; color: var(--bleu); font: inherit; cursor: pointer; padding: 4px 0; display: inline-flex; gap: 6px; align-items: center; }
.rc-ajout-bouton:hover { text-decoration: underline; }
.rc-menu-colonnes { z-index: 70; }
.rc-table select, .rc-table input { height: 30px; width: 100%; min-width: 110px; }
.rc-statut-ok .rc-statut { border-color: var(--vert, #2e9b5f); }
.rc-statut-ko .rc-statut, .rc-statut-bloque .rc-statut { border-color: var(--rouge, #c0392b); }
.rc-statut-en_correction .rc-statut, .rc-statut-attente_client .rc-statut { border-color: var(--orange, #d9822b); }
.rc-tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 60; display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--gris-bord); box-shadow: -12px 0 32px rgba(16, 37, 50, 0.18); }
.rc-tiroir-tete { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--bord-leger); }
.rc-tiroir-corps { flex: 1; overflow: auto; padding: 4px 16px 16px; }
.rc-tiroir-corps h4 { margin: 16px 0 4px; font-size: 13px; }
.rc-tiroir-corps p { margin: 0; font-size: 13px; }
.rc-message { padding: 8px 10px; margin-top: 8px; border: 1px solid var(--bord-leger); border-radius: 8px; }
.rc-message.rc-systeme { background: var(--surface-2); border-style: dashed; }
.rc-meta { font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rc-texte { margin-top: 4px; font-size: 13px; }
.rc-tiroir-pied { padding: 12px 16px; border-top: 1px solid var(--bord-leger); display: flex; flex-direction: column; gap: 8px; }
.rc-tiroir-pied textarea { width: 100%; }
.rc-pied-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Centre d'aide (icône ? à côté d'Administration) : sommaire, page façon Notion, plan de la page */
.aide { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 32px; align-items: start; max-width: 1400px; margin: 0 auto; }
.aide-sommaire, .aide-plan { position: sticky; top: 8px; max-height: calc(100vh - 90px); overflow-y: auto; font-size: 13.5px; }
.aide-recherche { display: flex; align-items: center; gap: 8px; border: 1px solid var(--gris-bord); border-radius: 8px; padding: 0 10px; background: var(--surface); margin-bottom: 14px; }
.aide-recherche input { border: 0; outline: none; background: none; height: 34px; width: 100%; font: inherit; color: var(--texte); }
.aide-groupe { margin-bottom: 14px; }
.aide-groupe-titre { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted, #6b7280); padding: 4px 8px; }
.aide-lien { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--texte); text-decoration: none; }
.aide-lien:hover { background: var(--survol); }
.aide-lien.actif { background: color-mix(in srgb, var(--bleu) 12%, transparent); color: var(--bleu); font-weight: 600; }
.aide-lien svg.lucide, .aide-resultat svg.lucide { width: 16px; height: 16px; flex: none; }
.aide-page { min-width: 0; max-width: 820px; padding-bottom: 60px; }
.aide-icone-page svg.lucide { width: 42px; height: 42px; stroke-width: 1.5; color: var(--bleu); }
.aide-page h1 { font-weight: 200; font-size: 38px; margin: 8px 0 6px; }
.aide-resume { font-size: 16px; color: var(--muted, #6b7280); margin: 0 0 14px; }
.aide-corps { font-size: 15px; line-height: 1.65; margin-top: 18px; }
.aide-corps h2 { font-size: 24px; font-weight: 600; margin: 38px 0 8px; padding-top: 10px; border-top: 1px solid var(--bord-leger); scroll-margin-top: 12px; }
.aide-corps h3 { font-size: 18px; font-weight: 600; margin: 24px 0 4px; scroll-margin-top: 12px; }
.aide-corps p { margin: 8px 0; }
.aide-corps ul, .aide-corps ol { padding-left: 24px; margin: 8px 0; }
.aide-corps li { margin: 3px 0; }
.aide-corps code { background: var(--surface-2); border: 1px solid var(--bord-leger); border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.aide-corps hr { border: 0; border-top: 1px solid var(--bord-leger); margin: 24px 0; }
.aide-table { overflow-x: auto; margin: 12px 0; }
.aide-table table { border-collapse: collapse; width: 100%; font-size: 14px; }
.aide-table th, .aide-table td { border: 1px solid var(--bord-leger); padding: 7px 10px; text-align: left; vertical-align: top; }
.aide-table th { background: var(--surface-2); }
.aide-callout { display: flex; gap: 10px; border-radius: 8px; padding: 12px 14px; margin: 14px 0; background: var(--surface-2); border-left: 4px solid var(--bleu); }
.aide-callout svg.lucide { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.aide-astuce { border-left-color: #2e9b5f; } .aide-attention { border-left-color: #d9822b; } .aide-regle { border-left-color: #8F3042; }
.aide-figure { margin: 18px 0; }
.aide-figure img { max-width: 100%; border: 1px solid var(--gris-bord); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.08); cursor: zoom-in; }
.aide-figure figcaption { font-size: 13px; color: var(--muted, #6b7280); margin-top: 6px; text-align: center; }
.aide-img-inline { height: 1.2em; vertical-align: text-bottom; }
.aide-plan a { display: block; padding: 4px 10px; color: var(--muted, #6b7280); text-decoration: none; border-left: 2px solid var(--bord-leger); }
.aide-plan a:hover { color: var(--bleu); border-left-color: var(--bleu); }
.aide-plan-titre { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted, #6b7280); margin-bottom: 6px; }
.aide-pied { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; }
.aide-pied a { display: flex; align-items: center; gap: 8px; border: 1px solid var(--gris-bord); border-radius: 8px; padding: 10px 14px; color: var(--texte); text-decoration: none; }
.aide-pied a:hover { border-color: var(--bleu); }
.aide-pied small { display: block; color: var(--muted, #6b7280); font-size: 11.5px; }
.aide-suiv { margin-left: auto; text-align: right; }
.aide-resultat { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--bord-leger); color: var(--texte); text-decoration: none; }
.aide-resultat:hover { background: var(--survol); }
.aide-zoom { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.78); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.aide-zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; }
@media (max-width: 1200px) { .aide { grid-template-columns: 230px minmax(0, 1fr); } .aide-plan { display: none; } }
@media (max-width: 800px) { .aide { grid-template-columns: 1fr; } .aide-sommaire { position: static; max-height: none; } }

/* Parcours d'une opportunité (chevrons façon pipe) */
.pipe-etapes { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.pipe-etapes ol { display: flex; list-style: none; margin: 0; padding: 0; flex: 1 1 auto; min-width: 0; }
.pipe-etapes li { flex: 1 1 0; min-width: 0; margin-left: -10px; }
.pipe-etapes li:first-child { margin-left: 0; }
.pipe-etape { width: 100%; height: 44px; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; padding: 0 22px 0 28px; color: var(--texte-doux, #5b6670); background: var(--gris-bord, #d8dde2);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); transition: filter .15s; }
.pipe-etapes li:first-child .pipe-etape { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); border-radius: 8px 0 0 8px; padding-left: 18px; }
.pipe-etape span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-etape:hover { filter: brightness(.95); }
.pipe-etape.franchie { background: color-mix(in srgb, var(--bleu) 28%, var(--surface)); color: var(--bleu); }
.pipe-etape.courante { background: var(--bleu); color: #fff; }
.pipe-etape.a-venir { background: color-mix(in srgb, var(--gris-bord) 45%, var(--surface)); }
.validation-objet { flex: 0 0 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.validation-objet:empty { display: none; }
.pipe-fin { display: flex; gap: 8px; }
.pipe-etape:disabled, .pipe-issue:disabled { cursor: default; }
.pipe-etape:disabled:hover { filter: none; }
.pipe-issue:disabled:not(.courante) { opacity: .55; }
.pipe-issue { height: 44px; padding: 0 18px; border-radius: 22px; border: 1.5px solid var(--gris-bord); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pipe-issue.gagnee { color: #1a7f4b; border-color: #1a7f4b; } .pipe-issue.gagnee.courante { background: #1a7f4b; color: #fff; }
.pipe-issue.perdue { color: #b42318; border-color: #b42318; } .pipe-issue.perdue.courante { background: #b42318; color: #fff; }
@media (max-width: 800px) { .pipe-etape { font-size: 11px; padding: 0 14px 0 20px; } }

/* Animation d'issue d'une opportunité (gagnée : confettis ; perdue : chute grise), sans prise de clic */
.anim-issue { position: fixed; inset: 0; z-index: 9999; pointer-events: none; overflow: hidden; }
.anim-issue i { position: absolute; width: 9px; height: 14px; border-radius: 2px; opacity: 0; }
.anim-issue.gagnee i { top: 42%; animation: confetti 1.8s cubic-bezier(.2,.7,.3,1) forwards; }
.anim-issue.perdue i { top: -4%; width: 7px; height: 7px; border-radius: 50%; animation: chute 1.6s ease-in forwards; }
.anim-issue b { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.6); padding: 10px 26px; border-radius: 28px; font-size: 20px; font-weight: 600; color: #fff; opacity: 0; animation: pastille-issue 2s ease forwards; }
.anim-issue.gagnee b { background: #1a7f4b; }
.anim-issue.perdue b { background: #6b7680; }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }
@keyframes chute { 0% { opacity: .9; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
@keyframes pastille-issue { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1); } }

/* Texte riche : barre de mise en forme + zone éditable */
.riche { border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); overflow: hidden; }
.riche:focus-within { border-color: var(--bleu); }
.riche-barre { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--gris-bord); background: var(--surface-2); flex-wrap: wrap; }
.riche-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: inherit; }
.riche-btn:hover { background: var(--gris-bord); }
.riche-btn svg.lucide { width: 16px; height: 16px; }
.riche-sep { width: 1px; height: 18px; background: var(--gris-bord); margin: 0 6px; }
.riche-zone { min-height: 140px; padding: 10px 12px; outline: none; line-height: 1.55; }
.riche-zone:empty::before { content: attr(data-placeholder); color: var(--texte-doux, #8a949e); pointer-events: none; }
.riche-zone h3, .riche-lecture h3 { font-size: 15px; margin: 8px 0 4px; }
.riche-zone p, .riche-lecture p { margin: 0 0 8px; }
.riche-zone ul, .riche-zone ol, .riche-lecture ul, .riche-lecture ol { margin: 0 0 8px; padding-left: 22px; }
.riche-lecture { line-height: 1.55; }

/* Éditeur de workflows : parcours Quand → Si → Alors */
.wf-parcours { width: 100%; }
.wf-etape { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 12px; padding: 12px 14px; }
.wf-corps { flex: 1; min-width: 0; }
.wf-k { font-size: 12px; color: var(--texte-doux, #5b6670); margin-bottom: 6px; }
.wf-ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.wf-ico svg.lucide { width: 18px; height: 18px; }
.wf-ico.quand { background: color-mix(in srgb, var(--bleu) 16%, var(--surface)); color: var(--bleu); }
.wf-ico.si { background: #fdf0d5; color: #8a5a00; }
.wf-ico.alors, .wf-ico.notif { background: #e3f4ea; color: #1a7f4b; }
.wf-lien { height: 16px; margin-left: 30px; border-left: 2px dashed var(--gris-bord); }
.wf-ligne { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.wf-ligne select, .wf-ligne input { width: auto; flex: 1 1 130px; }
.wf-ligne input[type=number] { flex: 0 1 120px; }
.wf-champ { margin-bottom: 10px; } .wf-champ label { display: block; font-size: 12px; margin-bottom: 3px; }
.wf-duo { display: flex; gap: 8px; } .wf-duo select { flex: 1; }
.wf-ajout { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Texte riche : palettes de couleurs */
.riche-couleur { position: relative; display: inline-flex; }
.riche-palette { position: absolute; top: 34px; left: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; width: 176px; padding: 8px; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.riche-palette[hidden] { display: none; }
.riche-nuance { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gris-bord); cursor: pointer; padding: 0; line-height: 1; color: var(--texte-doux, #5b6670); background: var(--surface); }
.riche-nuance:hover { transform: scale(1.12); }

/* Onglets de fiche : nombre de lignes de la liste associée */
.onglet-compte { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--gris-bord); color: var(--texte-doux, #5b6670); font-size: 11px; font-weight: 600; text-align: center; line-height: 18px; }
.admin-onglet.actif .onglet-compte { background: color-mix(in srgb, var(--bleu) 18%, var(--surface)); color: var(--bleu); }

/* Administration : page d'accueil en tuiles, puis détail de la rubrique */
.admin-accueil { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.admin-accueil[hidden], .admin-retour[hidden] { display: none; }
.admin-tuile { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 12px; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, transform .15s; }
.admin-tuile:hover { border-color: var(--bleu); transform: translateY(-1px); }
.admin-tuile-ico { width: 44px; height: 44px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bleu) 12%, var(--surface)); color: var(--bleu); }
.admin-tuile-ico svg.lucide { width: 22px; height: 22px; }
.admin-tuile-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-tuile-texte b { font-size: 14.5px; }
.admin-tuile-texte small { color: var(--texte-doux, #5b6670); font-size: 12.5px; line-height: 1.4; }
.admin-tuile > svg.lucide { width: 18px; height: 18px; color: var(--texte-doux, #8a949e); flex: none; }
.admin-retour { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-weight: 600; }
.admin-retour #admin-retour-titre { display: inline-flex; align-items: center; gap: 7px; }
.admin-onglets[hidden] { display: none; }

/* Workflows génériques : création par événement, essai sur un exemple, résultat */
.wf-nouveau { display: flex; gap: 8px; align-items: center; }
.wf-nouveau select { min-width: 260px; }
.wf-test .wf-ligne select { flex: 1; max-width: 420px; }
.wf-resultat { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--bleu) 8%, var(--surface)); border: 1px solid var(--gris-bord); }
.wf-resultat ul { margin: 8px 0; padding-left: 20px; }

/* Workflows façon flux de travail : rond QUAND, losanges CONDITION n, cartes et actions */
.wf-flux { width: 100%; margin-bottom: 18px; }
.wf-rang { display: flex; align-items: flex-start; }
.wf-rond { width: 84px; height: 84px; border-radius: 50%; background: var(--bleu); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.wf-losange { width: 84px; height: 84px; flex: none; position: relative; }
.wf-losange::before { content: ""; position: absolute; inset: 12px; background: var(--bleu); transform: rotate(45deg); border-radius: 8px; }
.wf-losange span { position: relative; z-index: 1; color: #fff; font-weight: 700; font-size: 11px; line-height: 1.2; text-align: center; display: flex; align-items: center; justify-content: center; height: 100%; }
.wf-trait { width: 28px; height: 2px; background: var(--bleu); margin-top: 41px; flex: none; }
.wf-flux > .wf-lien, .wf-flux .wf-lien { margin-left: 41px; height: 22px; border-left: 2px solid var(--bleu); }
.wf-carte { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--bleu); border-radius: 12px; padding: 16px 18px; }
.wf-ligne-quand { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.wf-ligne-quand > label { width: 280px; flex: none; font-size: 13px; color: var(--texte-doux, #5b6670); }
.wf-ligne-quand select { max-width: 320px; }
.wf-choix { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.wf-choix label { display: flex; gap: 8px; align-items: center; }
.wf-choix-ligne { flex-direction: row; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; }
.wf-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; padding: 8px 0 0 22px; }
.wf-question { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 600; font-size: 13.5px; }
.wf-num { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gris-bord); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.wf-actions-titre { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--gris-bord); font-weight: 600; font-size: 13px; }
.wf-actions-titre svg.lucide { width: 16px; height: 16px; color: var(--bleu); }
.wf-action { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--gris-bord); border-radius: 10px; background: color-mix(in srgb, var(--bleu) 4%, var(--surface)); }
.wf-action-ico { width: 32px; height: 32px; border-radius: 8px; background: #e3f4ea; color: #1a7f4b; display: flex; align-items: center; justify-content: center; flex: none; }
.wf-action-ico svg.lucide { width: 17px; height: 17px; }
.wf-menu-hote { position: relative; display: inline-block; }
.wf-menu { position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 4px; min-width: 240px; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 6px; display: flex; flex-direction: column; }
.wf-menu button { display: flex; gap: 8px; align-items: center; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; color: inherit; }
.wf-menu button:hover:not(:disabled) { background: color-mix(in srgb, var(--bleu) 10%, var(--surface)); }
.wf-menu button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 800px) { .wf-ligne-quand { flex-direction: column; align-items: stretch; } .wf-ligne-quand > label { width: auto; } .wf-rond, .wf-losange { width: 64px; height: 64px; } .wf-trait { margin-top: 31px; } }

/* Workflows : liste déroulante à cases (champs modifiés) */
.wf-select-multi { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 280px; max-width: 460px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.wf-select-multi svg.lucide { width: 16px; height: 16px; flex: none; }
.wf-menu-champs { max-height: 260px; overflow: auto; min-width: 280px; }
.wf-menu-champs label { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.wf-menu-champs label { justify-content: flex-start; text-align: left; width: 100%; box-sizing: border-box; margin: 0; font-weight: 400; }
.wf-menu-champs input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; }
.wf-menu-champs label:hover { background: color-mix(in srgb, var(--bleu) 10%, var(--surface)); }
.wf-valeurs { flex: 1 1 220px; } .wf-valeurs .wf-select-multi { width: 100%; max-width: none; min-width: 0; }
.wf-texte { width: 100%; min-height: 110px; padding: 8px 10px; border: 1px solid var(--gris-bord); border-radius: 8px; font: inherit; resize: vertical; background: var(--surface); color: inherit; }

/* Fiche en lecture : même présentation que le formulaire, champs non modifiables mais lisibles */
.formulaire-page.lecture input:disabled, .formulaire-page.lecture select:disabled, .formulaire-page.lecture textarea:disabled { opacity: 1; color: var(--texte); -webkit-text-fill-color: var(--texte); background: var(--surface); cursor: default; }
.formulaire-page.lecture select:disabled { appearance: none; background-image: none; }

/* Colonnes et tri des listes associées d'une fiche */
.colonnes-hote { position: relative; display: inline-block; margin-left: 4px; vertical-align: middle; }
.colonnes-menu { position: absolute; z-index: 30; top: 100%; right: 0; text-align: left; margin-top: 6px; width: 300px; padding: 10px; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); font-weight: 400; font-size: 13px; }
.colonnes-titre { font-weight: 600; margin-bottom: 8px; }
.colonnes-ligne { display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.colonnes-ligne label { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.colonnes-ligne button { background: none; border: 0; padding: 4px; border-radius: 6px; cursor: pointer; color: var(--texte); display: inline-flex; }
.colonnes-ligne button:hover:not(:disabled) { background: var(--survol); }
.colonnes-ligne button:disabled { opacity: .3; cursor: default; }
.colonnes-ligne svg.lucide { width: 15px; height: 15px; }
.colonnes-menu [data-defaut] { margin-top: 8px; }
th.th-triable { cursor: pointer; user-select: none; white-space: nowrap; }
th.tri-asc::after { content: " ▲"; font-size: 10px; } th.tri-desc::after { content: " ▼"; font-size: 10px; }

/* Vue calendrier */
.cal-barre { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-titre { margin: 0 10px; flex: 1; min-width: 160px; }
.cal-modes { display: inline-flex; gap: 4px; }
.cal-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--gris-bord); border-radius: 10px; overflow: hidden; }
.cal-entete { padding: 6px 8px; font-weight: 600; font-size: 12px; background: var(--survol); border-bottom: 1px solid var(--gris-bord); }
.cal-jour { min-height: 110px; padding: 4px; border-right: 1px solid var(--gris-bord); border-bottom: 1px solid var(--gris-bord); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-semaine .cal-jour { min-height: 300px; }
.cal-jour.autre { background: var(--survol); opacity: .6; }
.cal-jour.aujourdhui .cal-num { background: #111; color: #fff; }
.cal-num { align-self: flex-end; background: none; border: 0; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 12px; color: inherit; }
.cal-entree { display: block; padding: 2px 6px; border-radius: 6px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); color: inherit; text-decoration: none; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-entree.fini { text-decoration: line-through; opacity: .6; }
.cal-entree em { font-style: normal; opacity: .7; }
.cal-plus { background: none; border: 0; cursor: pointer; font-size: 11px; text-align: left; padding: 0 6px; color: inherit; opacity: .7; }
.cal-jour-vue { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--gris-bord); border-radius: 10px; }
.cal-jour-vue .cal-entree { padding: 8px 10px; font-size: 14px; }
.cal-legende { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; }
.cal-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.cal-jour[data-creer], .cal-creneau[data-creer] { cursor: cell; }
.cal-jour[data-creer]:hover, .cal-creneau[data-creer]:hover { background: var(--survol); }
.cal-creneau { display: flex; gap: 10px; min-height: 36px; padding: 2px 4px; border-bottom: 1px solid var(--gris-bord); }
.cal-creneau > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-heure { width: 54px; font-size: 12px; opacity: .6; padding-top: 4px; }
.cal-jour-vue { padding: 0; gap: 0; }

/* Accueil : glisser-déposer et redimensionnement des widgets */
.wd-poignee { cursor: grab; display: inline-flex; opacity: .45; }
.wd-poignee:hover { opacity: 1; }
.widget.wd-glisse { opacity: .4; }
.widget.wd-cible { outline: 2px dashed #2563eb; outline-offset: 2px; }
.wd-redim { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, #9ca3af 50%, #9ca3af 58%, transparent 58%, transparent 72%, #9ca3af 72%, #9ca3af 80%, transparent 80%); }
.perso-vue { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.perso-vue select { min-width: 260px; }
.wd-table { width: 100%; font-size: 13px; }
.wd-table tr[data-chemin] { cursor: pointer; }

/* Pages de détail : les champs en lecture ont la présentation du formulaire (carte, libellé au-dessus, champ de 36 px) — partout, comme la création et la modification */
.detail-page .champs:not(:has(> .modale)) { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; padding: 12px 16px 6px; border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); }
.detail-page .champs:not(:has(> .modale)) .champ { min-width: 0; padding-bottom: 10px; }
.detail-page .champs:not(:has(> .modale)) .champ .k { font-size: 12px; color: var(--gris-texte); text-transform: none; margin-bottom: 3px; }
.detail-page .champs:not(:has(> .modale)) .champ .v { box-sizing: border-box; min-height: 36px; padding: 7px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 13px; line-height: 1.3;
  border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
.detail-page .champs:not(:has(> .modale)) .champ .v:has(input, select, textarea) { padding: 0; border: 0; min-height: 0; display: block; }
th.th-outils { text-align: right; width: 1%; white-space: nowrap; }
th.th-outils .colonnes-hote { margin: 0; }
.valeur-info { min-height: 36px; box-sizing: border-box; padding: 7px 12px; display: flex; align-items: center; border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); font-size: 13px; overflow-wrap: anywhere; }
.bloc-form > h3 .wd-tout { margin-left: auto; font-weight: 400; font-size: 12px; }
.ctx-autres { margin: 6px 0 4px; }

/* liste déroulante avec recherche (select-recherche.js) */
.sr-boite { position: fixed; z-index: 10000; display: flex; flex-direction: column; background: var(--surface, #fff); color: var(--texte); border: 1px solid var(--bord-leger); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; }
.sr-champ { margin: 8px; padding: 7px 10px; border: 1px solid var(--bord-leger); border-radius: 6px; font: inherit; background: var(--surface, #fff); color: inherit; }
.sr-champ:focus { outline: 2px solid var(--bleu); outline-offset: -1px; }
.sr-liste { overflow-y: auto; padding: 0 4px 6px; }
.sr-option { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.sr-option.actif { background: var(--bleu); color: #fff; }
.sr-option.courant:not(.actif) { font-weight: 600; }
.sr-option.sr-creer { font-weight: 600; color: var(--bleu); border-bottom: 1px solid var(--gris-bord); border-radius: 6px 6px 0 0; margin-bottom: 2px; }
.sr-option.sr-creer.actif { color: #fff; }
.sr-option.inactif { opacity: .45; cursor: default; }
.sr-vide { padding: 10px; color: var(--muted, #6b7280); font-size: 13px; }

/* logo Hi-Technologies en tête du menu ; sur le thème sombre il repose sur un fond blanc pour rester lisible */
.sidebar .logo-img { display: block; width: 100%; max-width: 132px; height: auto; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .sidebar .logo-img { background: #fff; border-radius: 6px; padding: 4px 6px; box-sizing: content-box; } }
:root[data-theme="sombre"] .sidebar .logo-img { background: #fff; border-radius: 6px; padding: 4px 6px; box-sizing: content-box; }
.al-tuile.al-recalcul { background: var(--bleu); border-color: var(--bleu); color: #fff; cursor: pointer; }
.al-tuile.al-recalcul span { color: rgba(255,255,255,.85); }
.al-tuile.al-recalcul:hover { filter: brightness(1.08); }
.al-barre { display: block; margin: 12px 0; }
.rc-recherche { flex: 1; min-width: 280px; margin: 0; }

/* fonctions d'un utilisateur : pastilles à cocher */
.pastilles-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille-role { display: inline-flex; margin: 0; cursor: pointer; }
.pastille-role input { position: absolute; opacity: 0; pointer-events: none; }
.pastille-role span { padding: 6px 14px; border: 1px solid var(--gris-bord); border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface, #fff); color: var(--texte); transition: background .12s, border-color .12s; }
.pastille-role:hover span { border-color: var(--bleu); }
.pastille-role input:checked + span { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.pastille-role input:focus-visible + span { outline: 2px solid var(--bleu); outline-offset: 2px; }
.carte-bulle { padding: 4px 0; line-height: 1.3; }
.carte-bulle + .carte-bulle { border-top: 1px solid var(--gris-bord, #ddd); }
.pin-couleur { background: none; border: 0; }
.carte-legende { background: #fff; padding: 6px 10px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 12px; line-height: 1.7; }
.carte-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.lien-lookup { color: var(--bleu, #2f6fdb); text-decoration: none; }
.lien-lookup:hover { text-decoration: underline; }
.valeur-lien { display: block; min-height: 36px; line-height: 36px; }
.champ-avec-lien { display: flex; gap: 6px; align-items: center; }
.champ-avec-lien select { flex: 1; min-width: 0; }
.btn-lien-fiche { flex: none; width: 36px; height: 36px; line-height: 34px; text-align: center; border: 1px solid var(--gris-bord, #ddd); border-radius: 6px; color: var(--bleu, #2f6fdb); text-decoration: none; font-size: 16px; }
.btn-lien-fiche:hover { background: var(--bleu, #2f6fdb); color: #fff; }
.pf-fins { border: 1px solid var(--gris-bord, #ddd); border-radius: 8px; margin: 8px 0; background: var(--surface, #fff); }
.pf-fins summary { cursor: pointer; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.pf-fins-corps { padding: 4px 14px 14px; }
.pf-fins-corps h4, .pf-groupe { margin: 16px 0 6px; font-size: 13px; }
.pf-fins-ligne { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 4px 0; }
.pf-fins-ligne select { min-width: 220px; height: 36px; }
.pf-f-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.pf-case { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; }
.pf-f-champs { max-height: 360px; overflow: auto; border-top: 1px solid var(--gris-bord, #ddd); }

/* En-tête d'une offre : grille de 12 colonnes en trois groupes (Identification, Suivi, Facturation), champs de saisie de 36 px et de largeur proportionnée à leur contenu */
.detail-page .champs#champs-offre { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 20px; padding: 6px 20px 20px; }
#champs-offre .champs-titre { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--gris-bord); font-size: 13px; font-weight: 600; }
#champs-offre .champs-titre:first-child { margin-top: 8px; }
#champs-offre .champs-titre svg.lucide { width: 15px; height: 15px; color: var(--bleu); }
#champs-offre .champ { grid-column: span 4; padding-bottom: 0; }
#champs-offre .s2 { grid-column: span 2; } #champs-offre .s3 { grid-column: span 3; } #champs-offre .s5 { grid-column: span 5; } #champs-offre .s6 { grid-column: span 6; }
#champs-offre .champ .k { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
#champs-offre .champ .v input, #champs-offre .champ .v select { display: block; width: 100%; box-sizing: border-box; height: 36px; padding: 0 11px; font: inherit; font-size: 13.5px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px; transition: border-color .12s, box-shadow .12s; }
#champs-offre .champ .v input:hover, #champs-offre .champ .v select:hover { border-color: var(--gris-texte); }
#champs-offre .champ .v input:focus, #champs-offre .champ .v select:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,128,162,0.18); }
#champs-offre .champ .v.lecture { height: 36px; min-height: 36px; padding: 0 12px; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 90%, var(--gris-texte)); }
#champs-offre .champ .v.lecture svg.lucide { width: 14px; height: 14px; flex: none; color: var(--gris-texte); }
#champs-offre .champ .v.lecture .muted { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
@media (max-width: 1100px) { #champs-offre .champ, #champs-offre .s2, #champs-offre .s3, #champs-offre .s5, #champs-offre .s6 { grid-column: span 6; } }
@media (max-width: 640px) { #champs-offre .champ, #champs-offre .s2, #champs-offre .s3, #champs-offre .s5, #champs-offre .s6 { grid-column: 1 / -1; } }

/* En-tête d'une facture (même présentation que l'offre) : grille de 12 colonnes en trois groupes (Identification, Suivi, Facturation), champs de saisie de 36 px et de largeur proportionnée à leur contenu */
.detail-page .champs#champs-facture { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 20px; padding: 6px 20px 20px; }
#champs-facture .champs-titre { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--gris-bord); font-size: 13px; font-weight: 600; }
#champs-facture .champs-titre:first-child { margin-top: 8px; }
#champs-facture .champs-titre svg.lucide { width: 15px; height: 15px; color: var(--bleu); }
#champs-facture .champ { grid-column: span 4; padding-bottom: 0; }
#champs-facture .s2 { grid-column: span 2; } #champs-facture .s3 { grid-column: span 3; } #champs-facture .s5 { grid-column: span 5; } #champs-facture .s6 { grid-column: span 6; } #champs-facture .s12 { grid-column: 1 / -1; }
#champs-facture .champ .k { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
#champs-facture .champ .v input, #champs-facture .champ .v select { display: block; width: 100%; box-sizing: border-box; height: 36px; padding: 0 11px; font: inherit; font-size: 13.5px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px; transition: border-color .12s, box-shadow .12s; }
#champs-facture .champ .v input[type=checkbox], #champs-offre .champ .v input[type=checkbox] { display: inline-block; width: 18px; height: 18px; padding: 0; margin: 0; flex: none; }
#champs-facture .champ .v input:hover, #champs-facture .champ .v select:hover { border-color: var(--gris-texte); }
#champs-facture .champ .v input:focus, #champs-facture .champ .v select:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,128,162,0.18); }
#champs-facture .champ .v.lecture { height: 36px; min-height: 36px; padding: 0 12px; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 90%, var(--gris-texte)); }
#champs-facture .champ .v.lecture svg.lucide { width: 14px; height: 14px; flex: none; color: var(--gris-texte); }
#champs-facture .champ .v.lecture .muted { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
@media (max-width: 1100px) { #champs-facture .champ, #champs-facture .s2, #champs-facture .s3, #champs-facture .s5, #champs-facture .s6 { grid-column: span 6; } }
@media (max-width: 640px) { #champs-facture .champ, #champs-facture .s2, #champs-facture .s3, #champs-facture .s5, #champs-facture .s6 { grid-column: 1 / -1; } }

#champs-facture .champ .v textarea { display: block; width: 100%; box-sizing: border-box; padding: 8px 11px; font: inherit; font-size: 13.5px; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 6px; }
#champs-facture .champ .v input:disabled, #champs-facture .champ .v select:disabled, #champs-facture .champ .v textarea:disabled { background: color-mix(in srgb, var(--surface) 90%, var(--gris-texte)); }

/* Lignes de la facture : tableau encadré, distinct des totaux */
.facture-lignes { border: 1px solid var(--gris-bord); border-radius: 8px; padding: 12px 14px 4px; background: var(--surface); }
.facture-lignes h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.facture-lignes h3 svg.lucide { width: 15px; height: 15px; color: var(--bleu); }
.facture-lignes table.liste { margin-bottom: 8px; }
.facture-lignes th.num, .facture-lignes td.num-cell { text-align: right; }
.facture-lignes input { height: 34px; box-sizing: border-box; padding: 0 9px; font: inherit; font-size: 13.5px; border: 1px solid var(--gris-bord); border-radius: 6px; background: var(--surface); color: var(--texte); }
.facture-lignes .l-desc { width: 100%; min-width: 220px; }
.facture-lignes .l-qte, .facture-lignes .l-prix, .facture-lignes .l-tva { text-align: right; }
.facture-lignes .l-qte { width: 80px; } .facture-lignes .l-prix { width: 120px; } .facture-lignes .l-tva { width: 70px; }
.facture-lignes input:disabled { border-color: transparent; background: transparent; }
.facture-lignes .ed-ajout { border-top: 0; padding: 0 0 12px; }
/* Totaux : carte distincte alignée à droite, TTC et solde mis en valeur */
.facture-totaux { display: flex; justify-content: flex-end; margin: 4px 0 18px; }
.ft-carte { width: 100%; max-width: 380px; padding: 12px 16px 14px; border: 1px solid var(--bleu); border-radius: 8px; background: color-mix(in srgb, var(--bleu) 6%, var(--surface)); }
.ft-carte h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--gris-bord); font-size: 13px; }
.ft-carte h3 svg.lucide { width: 15px; height: 15px; color: var(--bleu); }
.ft-ligne { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 13.5px; }
.ft-ligne b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ft-ttc { margin-top: 4px; padding: 8px 10px; border-radius: 6px; background: var(--bleu); color: #fff; font-size: 15px; }
.ft-reglement { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--gris-bord); }
.ft-solde { font-size: 15px; } .ft-solde b { color: var(--bleu-fonce); }

/* Studio de documents (Administration › Modèles de document) */
.md-barre { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; padding: 14px 18px; margin-bottom: 14px; border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); }
.md-barre .champ-societe input[type="text"] { min-width: 260px; }
.md-barre-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.md-studio { display: grid; grid-template-columns: minmax(420px, 560px) minmax(0, 1fr); gap: 16px; align-items: start; }
.md-colonne { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.md-apercu { position: sticky; top: 12px; border: 1px solid var(--gris-bord); border-radius: 8px; background: var(--surface); padding: 14px; min-width: 0; }
.md-apercu-outils { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 10px; }
.md-ap-cadres { display: grid; grid-template-columns: 1fr; gap: 12px; }
.md-ap-cadres.deux { grid-template-columns: 1fr 1fr; }
.md-apercu iframe { width: 100%; height: calc(100vh - 260px); min-height: 420px; border: 1px solid var(--gris-bord); border-radius: 6px; background: #fff; }
.md-alerte { display: flex; align-items: center; gap: 8px; margin: 4px 0; padding: 6px 10px; border-radius: 6px; font-size: 12.5px; background: color-mix(in srgb, var(--surface) 88%, #d97706); }
.md-alerte-rouge { background: color-mix(in srgb, var(--surface) 85%, #cf222e); }
.md-alerte-info { background: color-mix(in srgb, var(--surface) 88%, var(--bleu)); }
.md-alerte svg.lucide { width: 15px; height: 15px; flex: none; }
.md-couleur { width: 100%; height: 36px; padding: 2px; border: 1px solid var(--gris-bord); border-radius: 6px; background: var(--surface); cursor: pointer; }
.md-bloc { border: 1px solid var(--gris-bord); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface); }
.md-bloc.glisse { opacity: .45; }
.pf-ligne > span { display: inline-flex; align-items: center; gap: 6px; }
.pf-ligne svg.lucide { width: 14px; height: 14px; }
.pf-prefere > span svg.lucide { color: #e0a100; fill: #e0a100; }
.pf-mobile { cursor: grab; } .pf-mobile:active { cursor: grabbing; }
.pf-poignee { display: inline-flex; color: #9aa7b1; font-style: normal; }
.pf-ligne.glisse { opacity: .45; }
.md-bloc.survol { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,128,162,0.18); }
.md-bloc-tete { display: flex; align-items: center; gap: 8px; }
.md-bloc-actions { margin-left: auto; display: flex; gap: 6px; }
.md-poignee { cursor: grab; color: var(--gris-texte); display: inline-flex; }
.md-bloc .grille-societe { margin-top: 10px; }
.md-avance { padding: 0 22px 16px; }
.md-avance summary { cursor: pointer; font-size: 13px; color: var(--texte-discret, #6b7280); padding: 8px 0; }
.md-logo-societe { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.md-logo-societe img { max-width: 140px; object-fit: contain; border: 1px solid var(--gris-bord); border-radius: 6px; padding: 4px; background: #fff; }
.md-proposition { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--bleu); border-radius: 8px; }
.lien-discret { background: none; border: 0; padding: 0 2px; cursor: pointer; color: inherit; font: inherit; }
@media (max-width: 1100px) { .md-studio { grid-template-columns: 1fr; } .md-apercu { position: static; } .md-ap-cadres.deux { grid-template-columns: 1fr; } }

/* logo Friday (fond noir) : pas de fond blanc sur le thème sombre, coins arrondis */
.sidebar .logo-img.logo-friday, :root[data-theme="sombre"] .sidebar .logo-img.logo-friday { background: transparent; padding: 0; border-radius: 6px; max-width: 64px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .sidebar .logo-img.logo-friday { background: transparent; padding: 0; } }

/* point de validation dans la liste des offres : orange = à valider, vert = aucune validation requise */
.pt-validation { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pt-validation.orange { background: #f59e0b; }
.pt-validation.vert { background: #22c55e; }

/* Menu « Action » des pages de détail : boutons secondaires regroupés en haut à droite de l'en-tête */
.menu-action { position: relative; margin-left: 4px; }
.menu-action > .btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; }
.menu-action-liste { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.menu-action-liste[hidden] { display: none; }
.menu-action-liste .btn { width: 100%; justify-content: flex-start; text-align: left; border: 0; background: transparent; height: 34px; padding: 0 10px; }
.menu-action-liste .btn:hover { background: var(--survol); }

/* Lignes de facture : colonnes à largeur fixe, titres et valeurs alignés (nombres à droite) */
.facture-lignes table.liste { table-layout: fixed; width: 100%; }
.facture-lignes th:nth-child(2), .facture-lignes td:nth-child(2) { width: 110px; }
.facture-lignes th:nth-child(3), .facture-lignes td:nth-child(3) { width: 150px; }
.facture-lignes th:nth-child(4), .facture-lignes td:nth-child(4) { width: 100px; }
.facture-lignes th:nth-child(5), .facture-lignes td:nth-child(5) { width: 150px; }
.facture-lignes th:nth-child(6), .facture-lignes td:nth-child(6) { width: 120px; }
.facture-lignes th.num { text-align: right; }
.facture-lignes td { vertical-align: middle; }
.facture-lignes td:nth-child(n+2) input { width: 100%; box-sizing: border-box; text-align: right; }
.facture-lignes td.actions-ligne { display: table-cell; text-align: right; white-space: nowrap; }
.facture-lignes td.actions-ligne .btn { margin-left: 4px; }
.facture-lignes td:has(> .num-cell) { text-align: right; }

/* Champs numériques : pas de flèches de défilement sur le côté (la saisie au clavier suffit) */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }


/* Formulaire « Nouveau site » : blocs en cartes, zone d'accès pleine largeur */
.bloc-grille > .x4 { grid-column: 1 / -1; }
.bloc-grille textarea { width: 100%; box-sizing: border-box; min-height: 84px; resize: vertical; }
#champs-offre .s9 { grid-column: span 9; }
@media (max-width: 1100px) { #champs-offre .s9 { grid-column: span 6; } }
@media (max-width: 640px) { #champs-offre .s9 { grid-column: 1 / -1; } }

/* Nom de l'ERP en tête du menu : police « IA » (Orbitron), dégradé cyan et halo léger */
.sidebar .logo-ia { display: block; font-family: "Orbitron", "Segoe UI", sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 3px; white-space: nowrap;
  background: linear-gradient(90deg, #22d3ee, #38bdf8 55%, #818cf8); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, .35)); }

/* Mon compte : photo de profil */
.detail-entete:has(.photo-profil) { display: flex; align-items: center; gap: 16px; }
.avatar.avatar-grand { width: 72px; height: 72px; font-size: 24px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.photo-actions { margin-top: 8px; }

/* Lignes d'une commande fournisseur : mêmes cadre et champs que les lignes d'une facture, colonnes propres */
.facture-lignes.cmd-creation th:nth-child(2), .facture-lignes.cmd-creation td:nth-child(2) { width: 110px; }
.facture-lignes.cmd-creation th:nth-child(3), .facture-lignes.cmd-creation td:nth-child(3) { width: 150px; }
.facture-lignes.cmd-creation th:nth-child(4), .facture-lignes.cmd-creation td:nth-child(4) { width: 150px; }
.facture-lignes.cmd-creation th:nth-child(5), .facture-lignes.cmd-creation td:nth-child(5) { width: 60px; }
.facture-lignes.cmd-fiche th:nth-child(2), .facture-lignes.cmd-fiche td:nth-child(2) { width: 110px; }
.facture-lignes.cmd-fiche th:nth-child(3), .facture-lignes.cmd-fiche td:nth-child(3) { width: 110px; }
.facture-lignes.cmd-fiche th:nth-child(4), .facture-lignes.cmd-fiche td:nth-child(4) { width: 90px; }
.facture-lignes.cmd-fiche th:nth-child(5), .facture-lignes.cmd-fiche td:nth-child(5) { width: 90px; }
.facture-lignes.cmd-fiche th:nth-child(6), .facture-lignes.cmd-fiche td:nth-child(6) { width: 140px; }
.facture-lignes.cmd-fiche th:nth-child(7), .facture-lignes.cmd-fiche td:nth-child(7) { width: 140px; }
.facture-lignes.cmd-fiche th:nth-child(8), .facture-lignes.cmd-fiche td:nth-child(8) { width: 60px; }
.facture-lignes.cmd-fiche td:nth-child(2) { text-align: left; }
.facture-lignes.cmd-fiche td:nth-child(3), .facture-lignes.cmd-fiche td:nth-child(4), .facture-lignes.cmd-fiche td:nth-child(5) { text-align: right; }
.facture-lignes td.num-cell { white-space: nowrap; }
.facture-lignes td.cel-num { text-align: right; white-space: nowrap; }

/* Lignes d'un bon de livraison : colonnes de chiffres alignées à droite, n° de série à gauche */
.facture-lignes.bl-lignes th:nth-child(n+2):nth-child(-n+5), .facture-lignes.bl-lignes td:nth-child(n+2):nth-child(-n+5) { width: 100px; text-align: right; }
.facture-lignes.bl-lignes th:nth-child(6), .facture-lignes.bl-lignes td:nth-child(6) { width: 300px; text-align: left; }
.facture-lignes.bl-lignes td.cel-serie { white-space: normal; }

/* Lignes d'une réception : 5 colonnes de chiffres à droite, emplacement et n° de série à gauche */
.facture-lignes.rc-lignes th:nth-child(n+2):nth-child(-n+6), .facture-lignes.rc-lignes td:nth-child(n+2):nth-child(-n+6) { width: 96px; text-align: right; }
.facture-lignes.rc-lignes th:nth-child(7), .facture-lignes.rc-lignes td:nth-child(7) { width: 170px; text-align: left; }
.facture-lignes.rc-lignes th:nth-child(8), .facture-lignes.rc-lignes td:nth-child(8) { width: 240px; text-align: left; }
.facture-lignes.rc-lignes input.rc-q { width: 80px; text-align: right; }
.facture-lignes.rc-lignes select.rc-e { width: 100%; }

/* Colonnes fixes : si leur somme dépasse le cadre, la colonne « Article » s'écrasait et les titres se superposaient.
   Le tableau garde une largeur minimale (article ≥ 220 px) et c'est le cadre des lignes qui défile, pas la page. */
.facture-lignes { overflow-x: auto; }
.facture-lignes.cmd-creation table.liste { min-width: 690px; }
.facture-lignes.cmd-fiche table.liste { min-width: 960px; }
.facture-lignes.bl-lignes table.liste { min-width: 920px; }
.facture-lignes.rc-lignes table.liste { min-width: 1110px; }

/* Accueil : barre de filtres, disposition et widgets de performance (CDC UI/UX, page 1) */
.acc-filtres { background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; display: grid; gap: 10px; }
.acc-ligne { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.acc-ligne label { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--gris-texte); }
.acc-ligne input, .acc-ligne select { height: 32px; border: 1px solid var(--gris-bord); border-radius: 6px; background: var(--surface); color: var(--texte); padding: 0 8px; font-family: inherit; font-size: 13px; }
.acc-ligne input[type="number"] { width: 110px; }
.acc-ligne input[type="search"] { flex: 1; min-width: 220px; }
.acc-ligne input:focus, .acc-ligne select:focus { outline: 2px solid var(--bleu); outline-offset: -1px; }
.acc-espace { flex: 1; }
.acc-bascule, .acc-grille-choix { display: inline-flex; border: 1px solid var(--gris-bord); border-radius: 6px; overflow: hidden; }
.acc-bascule button, .acc-grille-choix button { border: 0; background: var(--surface); color: var(--texte); padding: 0 12px; height: 30px; cursor: pointer; font-family: inherit; font-size: 13px; }
.acc-bascule button.actif, .acc-grille-choix button.actif { background: var(--bleu); color: #fff; }
.acc-pastille, .acc-lien { border: 1px solid var(--gris-bord); background: var(--surface); color: var(--texte); border-radius: 999px; padding: 0 10px; height: 28px; cursor: pointer; font-family: inherit; font-size: 12px; }
.acc-pastille:hover { border-color: var(--bleu); color: var(--bleu); }
.acc-lien { border: 0; background: none; color: var(--bleu); }
.acc-lien:disabled { color: var(--gris-texte); cursor: default; opacity: .6; }
.acc-personnes { position: relative; }
.acc-personnes summary { list-style: none; cursor: pointer; height: 32px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gris-bord); border-radius: 6px; padding: 0 10px; font-size: 13px; }
.acc-menu { position: absolute; z-index: 20; top: 36px; left: 0; background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 8px; padding: 8px; min-width: 220px; max-height: 260px; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.acc-menu label { display: flex; padding: 5px 4px; font-size: 13px; color: var(--texte); }
.acc-resultats { border-top: 1px solid var(--gris-bord); padding-top: 8px; }
.acc-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--survol); color: var(--bleu-fonce); border-radius: 999px; padding: 2px 6px 2px 10px; font-size: 12px; margin-bottom: 4px; }
.acc-chip button { border: 0; background: none; cursor: pointer; color: inherit; display: inline-flex; }
.wd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 12px; }
.wd-kpis > div { display: grid; gap: 2px; }
.wd-kpis b { font-size: 22px; font-weight: 600; color: var(--bleu-fonce); }
.wd-kpis span { font-size: 12px; color: var(--gris-texte); }
.wd-kpis em { font-style: normal; font-size: 11px; }
.wd-hausse { color: var(--vert); } .wd-baisse { color: var(--rouge); }
.wd-mois { display: flex; gap: 6px; align-items: flex-end; height: 110px; margin-top: 6px; }
.wd-mois > div { flex: 1; display: grid; justify-items: center; gap: 2px; height: 100%; grid-template-rows: 1fr auto; }
.wd-colonnes { display: flex; gap: 2px; align-items: flex-end; width: 100%; height: 100%; }
.wd-colonnes i, .wd-legende i { display: block; flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; }
.wd-colonnes i.env, .wd-legende i.env { background: var(--bleu); } .wd-colonnes i.gag, .wd-legende i.gag { background: var(--vert); }
.wd-mois small { font-size: 10px; color: var(--gris-texte); }
.wd-legende { font-size: 11px; color: var(--gris-texte); margin: 6px 0 0; display: flex; gap: 6px; align-items: center; }
.wd-legende i { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; }
.wd-base { font-size: 11px; color: var(--gris-texte); margin: 8px 0 0; }
.wd-barre { display: block; height: 6px; border-radius: 3px; background: var(--survol-fort); margin-top: 4px; min-width: 120px; }
.wd-barre i { display: block; height: 100%; border-radius: 3px; background: var(--bleu); }
.wd-barre.bas i { background: var(--rouge); } .wd-barre.ok i { background: var(--vert); }
.wd-ligne-barre > span { flex: 1; }
.marge-basse { color: var(--rouge); } .marge-ok { color: var(--vert); }
.mq-distrib { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.mq-etoile { border: 0; background: none; cursor: pointer; color: var(--gris-texte); display: inline-flex; padding: 2px; }
.mq-etoile.actif { color: var(--jaune); }
.mq-etoile:hover { color: var(--bleu); }

/* Vues de l'offre : relecture client (colonnes internes masquées) et compact — CDC UI/UX, pages 8 et 12 */
.ed-vues { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--gris-texte); font-size: 12px; }
.ed-vues select { height: 30px; border: 1px solid var(--gris-bord); border-radius: 6px; background: var(--surface); color: var(--texte); font-family: inherit; }
.ed-vue-relecture .ed-interne, .ed-vue-relecture .ed-badge, .ed-vue-relecture .ed-verrou, .ed-vue-relecture .ed-composant, .ed-vue-relecture .ed-actions,
.ed-vue-relecture .ed-validation, .ed-vue-relecture .ed-ajout, .ed-vue-relecture .ed-alertes, .ed-vue-relecture .ed-repli,
.ed-vue-relecture .ed-soustotal span:not(:last-child), .ed-vue-relecture .ed-pied-table tr:has(.ed-interne), .ed-vue-relecture .ed-heures { display: none !important; }
.ed-vue-relecture .ed-champ { pointer-events: none; border-color: transparent; background: transparent; }
.ed-vue-relecture .ed-entete h3::after { content: " · lecture client"; font-weight: 400; color: var(--gris-texte); font-size: 13px; }
.ed-vue-compact .ed-desc, .ed-vue-compact .ed-table th:nth-child(3), .ed-vue-compact .ed-table td:nth-child(3),
.ed-vue-compact .ed-table th:nth-child(8), .ed-vue-compact .ed-table td:nth-child(8), .ed-vue-compact .ed-table th:nth-child(9), .ed-vue-compact .ed-table td:nth-child(9) { display: none; }

/* Gestion de l'offre (page 11) */
.gest-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.gest-kpis > div { background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; }
.gest-kpis span { font-size: 12px; color: var(--gris-texte); } .gest-kpis b { font-size: 18px; font-weight: 600; color: var(--bleu-fonce); } .gest-kpis em { font-style: normal; font-size: 12px; color: var(--gris-texte); }
.gest-sim { font-style: normal; color: var(--violet, #7b3fb3); font-size: 12px; }
.gest-simulation { border-color: #7b3fb3; margin: 12px 0; }
.gest-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.gest-ligne { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.gest-ligne .wd-barre { flex: 1; margin: 0; }
.gest-jauge { position: relative; height: 12px; border-radius: 6px; background: var(--survol-fort); margin: 8px 0 4px; }
.gest-jauge i { display: block; height: 100%; border-radius: 6px; background: var(--rouge); } .gest-jauge i.marge-verte { background: var(--vert); }
.gest-jauge u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--texte); }
.gest-tous { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }

/* Fenêtre flottante « Prix client 90 j » (page 10) */
.pc-fenetre { position: fixed; right: 24px; bottom: 24px; width: 760px; height: 520px; min-width: 420px; min-height: 260px; max-width: 96vw; max-height: 92vh; resize: both; overflow: auto; z-index: 900;
  background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.pc-entete { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--gris-bord); cursor: move; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.pc-entete span { display: inline-flex; gap: 6px; }
.pc-corps { padding: 12px 14px; display: grid; gap: 14px; }
.pc-refs, .pc-regles { display: grid; gap: 6px; font-size: 13px; } .pc-refs label, .pc-regles label { display: flex; align-items: center; gap: 6px; }
.pc-actions { display: flex; gap: 8px; margin-top: 4px; }
.pc-plus { color: var(--rouge); } .pc-moins { color: var(--vert); }
.pc-table { overflow: auto; }
.pc-page .pc-fenetre { position: static; width: auto; height: auto; resize: none; box-shadow: none; }
.cir-fusion-bandeau { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; background: #efe6f8; color: #3d2160; border-left: 4px solid #7b3fb3; border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.cir-fusion-bandeau a { color: inherit; font-weight: 600; }
:root[data-theme="sombre"] .cir-fusion-bandeau { background: #33264a; color: #e3d4f6; }

/* ======================================================================================================================
   Refonte « Control Hub » (CDC UI/UX, principes de design) : navigation latérale sombre, cartes blanches, listes avec panneau
   de détail à droite. Titillium Web pour les textes, Poppins pour les titres ; bleu pétrole #0080A2, rouge #D02F35, jaune #F0B000.
   ====================================================================================================================== */
h1, h2, .page-entete h1, .aide-page h1 { font-family: "Poppins", "Titillium Web", "Segoe UI", sans-serif; }
.page-entete h1 { font-size: 22px; font-weight: 600; letter-spacing: 0; }
.aide-page h1 { font-weight: 600; font-size: 30px; }
h2 { font-weight: 600; }
.sidebar { width: 248px; }
.sidebar .actions-rapides { display: grid; gap: 8px; padding: 12px 12px 4px; }
.btn-offre-vierge { display: flex; align-items: center; gap: 8px; background: var(--bleu); color: #fff !important; border-radius: 8px; padding: 10px 12px; font-weight: 600; text-decoration: none; font-size: 14px; }
.btn-offre-vierge:hover { background: var(--bleu-fonce); }
.sidebar.replie .actions-rapides span { display: none; }
.sidebar.replie .actions-rapides { padding: 8px 6px; }
.sidebar.replie .btn-offre-vierge { justify-content: center; padding: 9px 0; }
.sidebar nav#menu a { border-radius: 8px; margin: 1px 8px; border-left: 0; }
.sidebar nav#menu a.active { background: var(--menu-survol); box-shadow: inset 3px 0 0 var(--bleu); }
.menu-titre-groupe { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }

.carte-hub { background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 12px; }
.table-hub { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-hub th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gris-texte); padding: 10px 12px; border-bottom: 1px solid var(--gris-bord); background: var(--surface-2); position: sticky; top: 0; }
.table-hub td { padding: 10px 12px; border-bottom: 1px solid var(--gris-bord); vertical-align: middle; }
.table-hub td small { display: block; color: var(--gris-texte); font-size: 12px; }
.table-hub .num, .table-hub th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-hub tr[data-id], .table-hub tr[data-offre] { cursor: pointer; }
.table-hub tbody tr:hover { background: var(--survol); } .table-hub tr.sel { background: var(--survol-fort); box-shadow: inset 3px 0 0 var(--bleu); }
.chip { border: 1px solid var(--gris-bord); background: var(--surface); color: var(--texte); border-radius: 999px; padding: 4px 12px; font-family: inherit; font-size: 13px; cursor: pointer; }
.chip b { font-weight: 600; margin-left: 4px; color: var(--gris-texte); }
.chip.actif { background: var(--survol); border-color: var(--bleu); color: var(--bleu-fonce); } .chip:hover { border-color: var(--bleu); }
.etiquette { display: inline-block; background: var(--survol-fort); color: var(--texte); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.pastille.pt { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 600; padding: 2px 10px; }
.pastille.pt::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.btn-hub { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gris-bord); background: var(--surface); color: var(--texte) !important; border-radius: 8px; padding: 7px 14px; font-family: inherit; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.btn-hub:hover { border-color: var(--bleu); } .btn-hub.petit { padding: 4px 10px; font-size: 12.5px; }
.btn-hub.principal { background: var(--bleu); border-color: var(--bleu); color: #fff !important; font-weight: 600; } .btn-hub.principal:hover { background: var(--bleu-fonce); }
.avatar-hub { width: 40px; height: 40px; border-radius: 10px; background: var(--survol-fort); color: var(--bleu-fonce); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.onglets-hub { display: flex; gap: 4px; border-bottom: 1px solid var(--gris-bord); padding: 0 16px; overflow-x: auto; }
.onglets-hub button { border: 0; background: none; padding: 12px 12px; font-family: inherit; font-size: 14px; color: var(--gris-texte); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.onglets-hub button b { font-weight: 600; margin-left: 2px; } .onglets-hub button.actif { color: var(--bleu-fonce); border-bottom-color: var(--bleu); font-weight: 600; }

/* Liste + fiche à droite (clients, fournisseurs) */
.mdv-actions-haut { display: flex; justify-content: flex-end; margin: -52px 0 14px; position: relative; z-index: 2; }
.mdv { display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 1fr); gap: 16px; align-items: start; }
.mdv-liste { display: flex; flex-direction: column; min-height: calc(100vh - 190px); overflow: hidden; }
.mdv-recherche { display: flex; align-items: center; gap: 8px; margin: 14px 14px 8px; border: 1px solid var(--gris-bord); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.mdv-recherche input { border: 0; outline: 0; background: none; height: 38px; flex: 1; font-family: inherit; font-size: 14px; color: var(--texte); }
.mdv-recherche:focus-within { border-color: var(--bleu); box-shadow: 0 0 0 2px rgba(0,128,162,.18); }
.mdv-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 8px; }
.mdv-options { display: flex; gap: 16px; align-items: center; padding: 0 14px 10px; font-size: 13px; color: var(--gris-texte); }
.mdv-options label { display: inline-flex; gap: 6px; align-items: center; } .lien-discret { margin-left: auto; color: var(--bleu); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.mdv-table { flex: 1; overflow: auto; } .mdv-pied { padding: 10px 14px; border-top: 1px solid var(--gris-bord); font-size: 12px; color: var(--gris-texte); }
.mdv-detail { position: sticky; top: 12px; min-height: calc(100vh - 190px); overflow: auto; max-height: calc(100vh - 100px); }
.mdv-vide { display: grid; place-items: center; }
.mdv-entete { display: flex; align-items: center; gap: 12px; padding: 16px; flex-wrap: wrap; }
.mdv-entete h2 { margin: 0; font-size: 17px; color: var(--texte); } .mdv-entete small { color: var(--gris-texte); }
.mdv-actions { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.mdv-corps { padding: 16px; display: grid; gap: 14px; }
.mdv-adresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mdv-adresse { border: 1px solid var(--gris-bord); border-radius: 10px; padding: 12px; display: grid; gap: 6px; align-content: start; font-size: 13.5px; }
.mdv-adresse.principale { border-color: var(--bleu); background: var(--survol); }
.mdv-adresse p { margin: 0; } .mdv-adresse-t { display: flex; align-items: center; gap: 6px; }
.mdv-ajout { border: 1.5px dashed var(--gris-bord); border-radius: 10px; display: grid; place-items: center; min-height: 110px; color: var(--gris-texte); text-decoration: none; gap: 4px; }
.mdv-ajout:hover { border-color: var(--bleu); color: var(--bleu); }
.mdv-carte-kv { border: 1px solid var(--gris-bord); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; } .mdv-carte-kv h4 { margin: 0 0 4px; font-size: 14px; } .mdv-carte-kv p { margin: 0; font-size: 13.5px; }
.mdv-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gris-bord); font-size: 13.5px; } .mdv-kv:last-child { border-bottom: 0; }
.mdv-kv span { color: var(--gris-texte); } .mdv-grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mdv-table tr.mdv-groupe td { background: var(--survol); } .mdv-table tr.mdv-groupe.sel td { background: var(--survol-fort); }
.mdv-table tr.mdv-groupe b { display: inline-flex; align-items: center; gap: 6px; } .mdv-table tr.mdv-groupe b svg { width: 15px; height: 15px; color: var(--bleu); }
.mdv-table tr.mdv-membre td:first-child { padding-left: 30px; }
.mdv-rattacher { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .mdv-rattacher select { flex: 1; min-width: 200px; }
.mdv-journal { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gris-bord); font-size: 13px; }
.etoile { color: var(--jaune); }
@media (max-width: 1100px) { .mdv { grid-template-columns: 1fr; } .mdv-detail { position: static; max-height: none; } .mdv-actions-haut { margin: 0 0 10px; } }

/* Centre d'alertes façon Control Hub : tuiles en cartes, liste et panneau de détail à droite */
.al-tuiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.al-tuile { border-radius: 12px; background: var(--surface); padding: 14px; }
.al-tuile b { font-size: 28px; font-family: "Poppins", "Titillium Web", sans-serif; }
.al-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gris-texte); }
.al-table tr[data-id] { cursor: pointer; } .al-table tr.sel { background: var(--survol-fort); box-shadow: inset 3px 0 0 var(--bleu); }
.al-maitre { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.al-maitre.avec-detail { grid-template-columns: minmax(0, 1fr) 380px; }
.al-detail:empty { display: none; }
.al-detail { background: var(--surface); border: 1px solid var(--gris-bord); border-radius: 12px; padding: 16px; display: grid; gap: 10px; position: sticky; top: 12px; }
.al-detail h3 { margin: 0; font-size: 17px; } .al-detail-t { display: flex; justify-content: space-between; align-items: center; }
.al-suggestion { border: 1px solid #d9cdf3; background: #f5f1fd; border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.al-suggestion p { margin: 0; }
@media (max-width: 1100px) { .al-maitre.avec-detail { grid-template-columns: 1fr; } }

/* Accueil et éditeur d'offre : cartes et barres façon Control Hub (CDC UI/UX, pages 1 et 8) */
.admin-carte, .widget { border-radius: 12px; border-color: var(--gris-bord); }
.widget h3 { font-family: "Poppins", "Titillium Web", sans-serif; font-size: 15px; font-weight: 600; }
.wd-ligne { padding: 10px 2px; }
.wd-kpis > div { border: 1px solid var(--gris-bord); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.wd-kpis b { font-family: "Poppins", "Titillium Web", sans-serif; font-size: 24px; color: var(--texte); }
.ed-chapitre { border-radius: 12px; }
.ed-barre { background: #0e141b; padding: 10px 14px; }
.ed-table th { letter-spacing: .06em; background: var(--surface-2); }
.ed-table tbody tr:hover { background: var(--survol); }
.ed-pied { border-radius: 12px; }
.bandeau-fusion { background: #f1ecfc; border: 1px solid #d3c5f3; color: #4b2fa0; border-radius: 10px; padding: 10px 14px; }
.bandeau-refus { background: #fdecec; border: 1px solid #f3c1c3; color: #a3242a; border-radius: 10px; padding: 10px 14px; }

/* Console anti-doublon (CDC UI/UX, page 6) et bandeau de fusion violet */
.console-doublon:empty { display: none; }
.console-doublon { grid-column: 1 / -1; margin-top: 14px; background: #0e141b; color: #d6dee6; border-radius: 12px; padding: 12px 16px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; display: grid; gap: 4px; }
.console-doublon a { color: #7fd0e6; } .cd-entete { display: flex; align-items: center; gap: 10px; font-family: "Titillium Web", sans-serif; margin-bottom: 6px; color: #fff; }
.cd-info { margin-left: auto; color: #8a98a6; font-size: 12px; } .cd-h { color: #6c7a88; } .cd-orange { color: #f0b000; } .cd-rouge { color: #ff7a7f; } .cd-vert { color: #5ed69a; }
.cir-fusion-bandeau { background: #f1ecfc; border: 1px solid #d3c5f3; color: #4b2fa0; border-radius: 10px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Fenêtre « Nouvelle version » (CDC UI/UX, page 2) */
.nv-t { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gris-texte); }
.nv-frise { display: flex; gap: 10px; margin: 8px 0 14px; overflow-x: auto; }
.nv-v { border: 1px solid var(--gris-bord); border-radius: 10px; padding: 8px 12px; display: grid; gap: 2px; min-width: 150px; font-size: 13px; }
.nv-v small, .nv-v em { color: var(--gris-texte); font-size: 12px; } .nv-v.actuelle { background: var(--surface-2); }
.nv-v.nouvelle { border: 2px solid var(--bleu); background: var(--survol); }
.nv-motifs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; } .nv-compte { margin-left: auto; }
.nv-info { background: var(--survol); border: 1px solid #b7dde7; border-radius: 10px; padding: 12px 14px; margin-top: 12px; } .nv-info p { margin: 6px 0 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.bandeau-refus { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.bandeau-refus svg.lucide { vertical-align: -3px; }

/* Fenêtres « Soumettre à validation » et « Fusionner » (CDC UI/UX, pages 9 et 10) */
.so-regles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; }
.so-valideur { display: flex; gap: 12px; align-items: center; border: 1px solid var(--gris-bord); border-radius: 10px; padding: 12px; margin: 6px 0 12px; }
.so-notifs, .fu-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 12px; } .so-notifs .carte-hub { padding: 12px; } .so-notifs p { margin: 4px 0 0; }
.so-lecture { background: #fff8e6; border: 1px solid #f0d98a; border-radius: 10px; padding: 10px 14px; display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.fu-paire { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 6px 0 8px; } .fu-paire .carte-hub { padding: 12px; display: grid; gap: 6px; }
.fu-choix { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--gris-bord); border-radius: 10px; padding: 10px 12px; margin: 6px 0; cursor: pointer; } .fu-choix input { width: auto; margin-top: 4px; }
.fu-choix span { display: grid; gap: 2px; } .fu-choix small { color: var(--gris-texte); } .fu-choix:has(input:checked) { border: 2px solid var(--bleu); background: var(--survol); }
.fu-info { background: #f1ecfc; border-color: #d3c5f3; }
@media (max-width: 800px) { .so-notifs, .fu-grille, .fu-paire { grid-template-columns: 1fr; } }

/* Fenêtre « Nouvelle offre » : cartes du point de départ (CDC UI/UX, page 11) */
.no-departs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.no-depart { display: grid; gap: 4px; justify-items: start; text-align: left; border: 1px solid var(--gris-bord); border-radius: 10px; background: var(--surface); padding: 12px; font-family: inherit; cursor: pointer; color: var(--texte); }
.no-depart small { color: var(--gris-texte); } .no-depart:hover { border-color: var(--bleu); } .no-depart.actif { border: 2px solid var(--bleu); background: var(--survol); }
@media (max-width: 800px) { .no-departs { grid-template-columns: 1fr; } }

/* Fenêtre « Prix client 90 j » : en-tête sombre (CDC UI/UX, page 10) */
.pc-fenetre { border-radius: 12px; overflow: hidden; }
.pc-entete { background: #0e141b; color: #fff; }
.pc-entete .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }

/* Panneau de notifications (CDC UI/UX, page 8) */
.notifs-titre { display: inline-flex; align-items: center; gap: 8px; font-family: "Poppins", "Titillium Web", sans-serif; }
.notifs-badge { background: var(--survol-fort); color: var(--bleu-fonce); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.notif { display: grid; grid-template-columns: 22px 1fr auto; column-gap: 10px; align-items: start; }
.notif .notif-icone { grid-row: 1 / span 2; color: var(--bleu); } .notif .notif-icone svg { width: 18px; height: 18px; }
.notif .notif-titre { grid-column: 2; } .notif .notif-date { grid-column: 3; grid-row: 1; font-size: 12px; color: var(--gris-texte); }
.notif.non-lue { background: var(--survol); }

/* Tiroir « Affichage & paramètres de l'offre » (CDC UI/UX, page 21) */
.tiroir-fond { position: fixed; inset: 0; background: rgba(14,20,27,.35); z-index: 90; display: flex; justify-content: flex-end; }
.tiroir { width: min(520px, 100vw); height: 100%; background: var(--gris-fond); display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,.18); }
.tiroir header, .tiroir footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface); } .tiroir header { border-bottom: 1px solid var(--gris-bord); } .tiroir footer { border-top: 1px solid var(--gris-bord); font-size: 12px; }
.tiroir-corps { flex: 1; overflow: auto; padding: 16px; display: grid; gap: 14px; align-content: start; } .tiroir-corps .carte-hub { padding: 14px 16px; } .tiroir-corps h4 { margin: 0 0 8px; font-size: 14px; }
.tiroir-vues { display: flex; gap: 8px; flex-wrap: wrap; } .tiroir-col { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--gris-bord); } .tiroir-col span { flex: 1; } .tiroir-col input { width: auto; }
.tiroir kbd { border: 1px solid var(--gris-bord); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-size: 12px; background: var(--surface); }
.ed-cache-2 .ed-table th:nth-child(2), .ed-cache-2 .ed-table td:nth-child(2) { display: none; }
.ed-cache-3 .ed-table th:nth-child(3), .ed-cache-3 .ed-table td:nth-child(3) { display: none; }
.ed-cache-4 .ed-table th:nth-child(4), .ed-cache-4 .ed-table td:nth-child(4) { display: none; }
.ed-cache-5 .ed-table th:nth-child(5), .ed-cache-5 .ed-table td:nth-child(5) { display: none; }
.ed-cache-6 .ed-table th:nth-child(6), .ed-cache-6 .ed-table td:nth-child(6) { display: none; }
.ed-cache-7 .ed-table th:nth-child(7), .ed-cache-7 .ed-table td:nth-child(7) { display: none; }
.ed-cache-8 .ed-table th:nth-child(8), .ed-cache-8 .ed-table td:nth-child(8) { display: none; }
.ed-cache-9 .ed-table th:nth-child(9), .ed-cache-9 .ed-table td:nth-child(9) { display: none; }
.ed-cache-10 .ed-table th:nth-child(10), .ed-cache-10 .ed-table td:nth-child(10) { display: none; }
.so-controle { margin: 6px 0 12px; } .so-controle p { margin: 4px 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }

/* Commentaires de ligne (CDC UI/UX, page 8) */
.ed-ligne.ed-commentee { background: #fff8d6; } .ed-com-actif { color: #a86b00; border-color: #f0b000; }
.com-fil { border: 1px solid var(--gris-bord); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; } .com-fil.resolu { opacity: .6; }
.com-msg p { margin: 2px 0 8px; } .com-actions { display: flex; gap: 6px; } .com-actions input { flex: 1; } .com-nouveau { display: grid; gap: 6px; justify-items: end; }
.bandeau-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }

.ed-sans-repere-hw .ed-badge-hw { display: none; }
.ed-sans-repere-licence .ed-badge-licence { display: none; }
.ed-sans-repere-moe .ed-badge-moe { display: none; }
.ed-sans-repere-service .ed-badge-service { display: none; }
.chip-vue { display: inline-flex; align-items: center; gap: 2px; }
.chip-vue .chip-x { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.chip-vue .chip-x:hover { background: var(--gris-fond, #eee); }
.chip-vue .chip-x svg { width: 12px; height: 12px; }
.acc-onglets { display: inline-flex; gap: 2px; background: var(--gris-fond, #f3f5f8); border-radius: 8px; padding: 2px; }
.acc-onglets button { border: none; background: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: inherit; }
.acc-onglets button.actif { background: #fff; color: var(--bleu, #0080A2); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.wd-actions { white-space: nowrap; text-align: right; }
.wd-actions .btn { margin-left: 4px; }
.wd-case { width: 28px; }
.wd-pied { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 0; font-size: 13px; }
/* Éditeur d'offre : barre d'outils et sélection (CDC UI/UX p. 12) */
.ed-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; margin-bottom: 10px; background: #fff; border: 1px solid #dfe5ec; border-radius: 10px; position: sticky; top: 0; z-index: 5; }
.ed-outil { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 6px 10px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; color: #25313f; }
.ed-outil:hover:not(:disabled) { background: #eaf4f8; color: var(--bleu, #0080A2); }
.ed-outil:disabled { opacity: .4; cursor: not-allowed; }
.ed-outil svg { width: 16px; height: 16px; }
.ed-outils-sep { width: 1px; height: 22px; background: #dfe5ec; margin: 0 6px; }
.ed-sous > .ed-barre { background: #dcecf3; color: #1f2d3d; }
.ed-sous > .ed-barre .ed-numero-chap { color: #1f2d3d; }
.ed-sous > .ed-barre .btn { background: #fff; }
tr.ed-selectionnee > td { background: #eaf4f8 !important; box-shadow: inset 3px 0 0 var(--bleu, #0080A2); }
.ed-vue-relecture .ed-outils .ed-outil[data-outil="pv"] { display: none; }
@media (max-width: 760px) { .ed-outil span { display: none; } }
.ed-recherche-inline { position: relative; flex: 1; min-width: 260px; display: flex; align-items: center; gap: 6px; border: 1px solid #dfe5ec; border-radius: 8px; padding: 0 8px; background: #fff; }
.ed-recherche-inline svg { width: 16px; height: 16px; color: #6b7a8a; }
.ed-rech-input { flex: 1; border: none; outline: none; padding: 7px 0; font: inherit; background: transparent; }
.ed-rech-res { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid #dfe5ec; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow: auto; }
.ed-rech-res[hidden] { display: none; }
/* la liste des items proposés déborde du chapitre (overflow: hidden pour les coins arrondis) : sinon elle est coupée et on ne peut pas choisir */
.ed-chapitre:has(.ed-rech-res:not([hidden])) { overflow: visible; }
.ed-recherche-inline:has(.ed-rech-res:not([hidden])) { z-index: 30; }
.ed-rech-res .ed-resultat { border: 0; border-bottom: 1px solid var(--gris-bord); border-radius: 0; margin: 0; padding: 8px 10px; }
.ed-rech-res .ed-resultat.actif, .ed-rech-res .ed-resultat:focus { background: var(--survol); outline: none; }
.ed-ajout { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-heures-cartes > div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ed-carte-mo { display: flex; flex-direction: column; gap: 2px; min-width: 130px; padding: 10px 12px; border: 1px solid #dfe5ec; border-radius: 10px; background: #f7fafc; }
.ed-carte-mo span { font-size: 12px; color: #6b7a8a; } .ed-carte-mo b { font-size: 18px; } .ed-carte-mo em { font-style: normal; font-size: 12px; } .ed-carte-mo small { color: var(--bleu, #0080A2); font-weight: 600; }

/* Photo d'utilisateur : bloc compact (aperçu rond + boutons), l'adresse web n'apparaît qu'à la demande */
.champ-image.rond .image-zone { gap: 20px; }
.champ-image.rond .image-saisie { flex: 0 1 auto; gap: 10px; }
.champ-image.rond .image-boutons { flex-wrap: wrap; align-items: center; }
.champ-image.rond .image-lien { background: none; border: 0; color: var(--bleu); padding: 4px 6px; }
.champ-image.rond input.image-url { max-width: 420px; }

/* Fiche utilisateur › Accès : « Compte actif » sur la ligne du profil, libellé collé à son interrupteur */
.bloc-grille > .champ-interrupteur.acces-actif { justify-content: flex-start; align-self: start; margin-top: 22px; gap: 12px; }

/* Fiche utilisateur › Identité : photo à droite, les champs à gauche */
@media (min-width: 1101px) {
  .bloc-grille > .identite-photo { grid-column: 3 / span 2; grid-row: 1 / span 3; display: flex; align-items: center; justify-content: center; }
  .bloc-grille > .identite-photo .image-zone { flex-direction: column; text-align: center; }
  .bloc-grille > .identite-photo .image-saisie { align-items: center; }
}

/* Fiche utilisateur › Fonctions : une ligne par fonction (pastille + ce qu'elle permet) et résumé des droits de départ */
.liste-fonctions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.liste-fonctions .carte-fonction { position: relative; display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px;
  border: 1px solid var(--gris-bord); border-radius: 10px; background: var(--surface, #fff); cursor: pointer;
  font-weight: normal; text-transform: none; letter-spacing: 0; transition: border-color .12s, background .12s; }
.carte-fonction:hover { border-color: var(--bleu); }
.carte-fonction input { position: absolute; opacity: 0; pointer-events: none; }
.carte-fonction-case { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px;
  border: 1.5px solid var(--gris-bord); border-radius: 5px; background: var(--surface, #fff); color: #fff; }
.carte-fonction-case svg.lucide { width: 13px; height: 13px; stroke-width: 3; opacity: 0; }
.carte-fonction-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.carte-fonction-texte b { font-size: 13.5px; font-weight: 600; color: var(--texte); }
.carte-fonction-texte small { font-size: 12.5px; line-height: 1.4; color: var(--gris-texte, #6b7280); }
.carte-fonction:has(input:checked) { border-color: var(--bleu); background: color-mix(in srgb, var(--bleu) 7%, var(--surface, #fff)); }
.carte-fonction input:checked + .carte-fonction-case { background: var(--bleu); border-color: var(--bleu); }
.carte-fonction input:checked + .carte-fonction-case svg.lucide { opacity: 1; }
.carte-fonction input:focus-visible + .carte-fonction-case { outline: 2px solid var(--bleu); outline-offset: 2px; }
.resume-fonctions { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2, #f5f7f9); font-size: 13px; }
.resume-fonctions ul { margin: 6px 0 0; padding-left: 18px; columns: 2; }
.resume-fonctions svg.lucide { width: 15px; height: 15px; vertical-align: -3px; }

.rc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rc-poubelle { margin-left: auto; padding: 2px 6px; opacity: .55; }
.rc-message:hover .rc-poubelle { opacity: 1; }

/* Accueil › Personnaliser : bouton bleu quand le panneau est ouvert, lignes déplaçables par une poignée */
.accueil-entete #btn-perso.actif { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.accueil-entete #btn-perso.actif svg.lucide { color: #fff; }
.perso-ligne { position: relative; justify-content: flex-start; }
.perso-ligne > label { flex: 1; }
.perso-ligne > span:last-child { margin-left: auto; }
.perso-poignee { display: inline-flex; cursor: grab; color: var(--gris-texte); padding: 4px; }
.perso-poignee svg.lucide { width: 16px; height: 16px; }
.perso-ligne.wd-glisse { opacity: .4; }
.perso-ligne.perso-haut::before, .perso-ligne.perso-bas::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--bleu); }
.perso-ligne.perso-haut::before { top: -1px; }
.perso-ligne.perso-bas::after { bottom: -1px; }

.acc-groupe { margin: 10px 0 2px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gris-texte); }
.mdv-actions-haut { gap: 8px; align-items: center; }

.saisie-series .ss-champ { width: 100%; height: 40px; font-size: 15px; }
.saisie-series .ss-etat { margin: 6px 0; font-size: 13px; }
.saisie-series .ss-etat.rouge { color: var(--rouge, #c0392b); font-weight: 600; }
.saisie-series .ss-etat.vert { color: var(--vert, #1e8e4e); font-weight: 600; }
.saisie-series .ss-puces { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; }
.saisie-series .ss-retirer { border: 0; background: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 4px; color: inherit; }

.serie-resume { margin-bottom: 8px; }
.serie-chrono { list-style: none; margin: 8px 0 0; padding: 0; border-left: 2px solid var(--bordure, #d9e2e7); margin-left: 16px; }
.serie-evt { position: relative; padding: 0 0 18px 28px; }
.serie-point { position: absolute; left: -17px; top: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--fond-carte, #fff); border: 2px solid var(--bordure, #d9e2e7); display: flex; align-items: center; justify-content: center; }
.serie-point svg { width: 16px; height: 16px; }
.serie-ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.serie-date { margin-left: auto; font-size: 12.5px; }

.rt-tableau { width: 100%; margin: 6px 0 14px; }
.rt-tableau td, .rt-tableau th { vertical-align: top; }
.rt-tableau .rt-cel { min-width: 320px; }
.rt-tableau .rt-q { width: 110px; }
.rt-propositions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.rt-prop { border: 0; cursor: pointer; }
.rt-prop:hover { background: var(--bleu-clair, #dcf0f5); }
.rt-prop[hidden] { display: none; }

/* Pages de création et de saisie : « Annuler » puis « Créer » en haut à droite de l'en-tête, qui reste visible au défilement (actions-creation.js) */
.creation-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.creation-actions .btn { height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.detail-page > .detail-entete:has(.creation-actions) { position: sticky; top: 0; z-index: 20; background: var(--gris-fond); padding-top: 12px; margin-top: -12px; }
.champ-erreur, .champ-erreur:focus { border-color: var(--rouge, #d63c3c) !important; box-shadow: 0 0 0 3px rgba(214, 60, 60, .18) !important; }

/* Grille des fiches d'offre et de document : toutes les largeurs (sur 12 colonnes) */
#champs-offre .s1, #champs-facture .s1 { grid-column: span 1; } #champs-offre .s4, #champs-facture .s4 { grid-column: span 4; }
#champs-offre .s7, #champs-facture .s7 { grid-column: span 7; } #champs-offre .s8, #champs-facture .s8 { grid-column: span 8; }
#champs-offre .s9, #champs-facture .s9 { grid-column: span 9; } #champs-offre .s10, #champs-facture .s10 { grid-column: span 10; }
#champs-offre .s12 { grid-column: 1 / -1; }
#champs-offre .champ[hidden], #champs-facture .champ[hidden] { display: none; }
#champs-offre .no-indice, #champs-facture .no-indice { margin-top: -6px; font-size: 12.5px; }
#champs-offre .no-indice svg.lucide { width: 13px; height: 13px; vertical-align: -2px; }
#champs-offre .no-departs { margin-bottom: 0; }
@media (max-width: 1100px) { #champs-offre .s4, #champs-offre .s7, #champs-offre .s8, #champs-offre .s9, #champs-offre .s10 { grid-column: 1 / -1; } }

/* Fenêtres de message (dialogue.js) : remplacent alert / confirm / prompt du navigateur */
.dlg-fond { position: fixed; inset: 0; z-index: 1000; background: rgba(16, 37, 50, .45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: dlg-fond .12s ease-out; }
.dlg { background: var(--surface); color: var(--texte); border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); width: 440px; max-width: 100%; padding: 22px 22px 18px; animation: dlg-entree .15s ease-out; }
.dlg-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dlg-tete h3 { margin: 0; font-size: 16px; font-weight: 600; }
.dlg-icone { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--survol); color: var(--bleu); }
.dlg-attention .dlg-icone { background: #fdf1dd; color: #c97a06; }
.dlg-danger .dlg-icone { background: #fbe4e5; color: var(--rouge); }
.dlg-message { font-size: 14px; line-height: 1.5; color: var(--texte); margin: 0 0 6px 52px; }
.dlg-champ { display: block; width: 100%; box-sizing: border-box; margin: 10px 0 0; min-height: 36px; padding: 7px 11px; border: 1px solid var(--gris-bord); border-radius: 6px; font: inherit; font-size: 13.5px; background: var(--surface); color: var(--texte); }
.dlg-champ:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0, 128, 162, .18); }
.dlg-erreur { color: var(--rouge); font-size: 12.5px; margin: 6px 0 0; }
.dlg-boutons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg-boutons .btn { min-width: 96px; height: 36px; }
.dlg .btn.danger { background: var(--rouge); border-color: var(--rouge); color: #fff; }
@keyframes dlg-fond { from { opacity: 0; } }
@keyframes dlg-entree { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .dlg, .dlg-fond { animation: none; } }

/* Menu « Actions » de la barre de sélection des listes (actions de la liste, Exporter CSV) */
.menu-selection { position: relative; display: inline-block; }
.menu-selection-liste { position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface); color: var(--texte); border: 1px solid var(--gris-bord); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; z-index: 40; }
.menu-selection-liste button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--texte); cursor: pointer; text-align: left; }
.menu-selection-liste button:hover { background: var(--survol); }
.menu-selection-liste svg.lucide { width: 15px; height: 15px; }

/* En-tête des fiches : l'action principale (étape suivante) avant le menu « Action », en-tête collant au défilement (action-menu.js) */
.actions-principales { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-principales .btn { height: 34px; display: inline-flex; align-items: center; gap: 6px; }
.detail-page > .detail-entete:has(.menu-action, .actions-principales) { position: sticky; top: 0; z-index: 20; background: var(--gris-fond); padding-top: 12px; margin-top: -12px; }

/* Nouvelle facture d'achat : bandeau de lecture de la facture du fournisseur (OCR Claude) */
.ffo-depot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; border: 1px dashed var(--gris-bord); border-radius: 10px; background: var(--surface); }
.ffo-icone { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--survol); color: var(--bleu); flex: none; }
.ffo-texte { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ffo-depot input[type=file] { font-size: 13px; max-width: 280px; }

/* Une cellule de tableau marquée num-cell reste une cellule (sinon elle se décale hors de sa colonne) : chiffres alignés à droite */
td.num-cell, th.num-cell { display: table-cell; text-align: right; white-space: nowrap; }
