/* Signalétique « Publication » (01.10.2026) - 2GIK Sàrl.
   1. Pastille d'état de publication (views/composants/_etat-publication.ejs) :
      une seule convention, toujours avec un texte (jamais la couleur seule).
      Brouillon : contour orange (charte, --accent) ; Publiée : vert ; Masquée : gris ;
      Interne : contour gris pointillé ; Brouillon clos : contour gris.
   2. Bloc « Publication » du tableau de bord (views/accueil/_publication.ejs).
   3. Puces des pastilles de filtre « À publier », « Publiées », « Masquées ».
   Jetons de app.css seulement (thèmes clair et sombre), aucune ressource externe. */

/* --- 1. Pastille d'état ------------------------------------------------------ */
.etat-pub {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 0 7px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: 1px;
}
.etat-pub::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.etat-pub-brouillon { border-color: var(--accent); background: var(--surface); color: var(--warn-tx); }
.etat-pub-brouillon::before { background: var(--accent); }
.etat-pub-publiee { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-tx); }
.etat-pub-masquee { border-color: var(--neu); background: var(--neu-bg); color: var(--neu-tx); }
.etat-pub-interne { border-color: var(--neu); border-style: dashed; background: transparent; color: var(--muted); }
.etat-pub-interne::before { background: transparent; border: 1px solid currentColor; box-sizing: border-box; }
.etat-pub-archivee { border-color: var(--border-champ); background: transparent; color: var(--muted); }
.etat-pub-archivee::before { background: var(--border-champ); }
/* En tête de volet et de fiche, à côté des badges : même hauteur. */
.volet-reperes .etat-pub { margin-left: 0; font-size: 0.78rem; padding: 1px 9px; }
/* Colonne « Publication » : pas de marge avant la pastille. */
.cel-publication .etat-pub { margin-left: 0; }
/* Liste dense : la pastille suit le titre sur la même ligne quand la place le permet. */
.cel-titre .etat-pub { margin-left: 6px; }
/* Ligne traitée dans « À valider » : la pastille reste lisible (la ligne est estompée). */
.ligne-traitee .etat-pub-publiee { opacity: 1; }

/* --- 3. Pastilles de filtre « Publication » ---------------------------------- */
.pastille-pub-brouillon::before, .pastille-pub-publiee::before, .pastille-pub-masquee::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none;
}
.pastille-pub-brouillon::before { background: var(--surface); border: 2px solid var(--accent); box-sizing: border-box; }
.pastille-pub-publiee::before { background: var(--ok); }
.pastille-pub-masquee::before { background: var(--neu); }

/* --- 2. Bloc « Publication » du tableau de bord ------------------------------ */
.pub-bloc { margin: 0 0 16px; border-left: 4px solid var(--ok); }
.pub-bloc.pub-bloc-attention { border-left-color: var(--accent); }
.pub-resume {
  display: grid; grid-template-columns: minmax(240px, 1.1fr) minmax(240px, 1.1fr) minmax(260px, 1.3fr);
  gap: 0; border-bottom: 1px solid var(--border-leger);
}
.pub-case { padding: 12px 16px 14px; min-width: 0; }
.pub-case + .pub-case { border-left: 1px solid var(--border-leger); }
.pub-case-alerte { background: var(--badge-attention-bg); }
.pub-libelle { margin: 0 0 2px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.pub-chiffre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 8px; }
.pub-valeur { font-size: 2.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.pub-case-alerte .pub-valeur { color: var(--badge-attention-tx); }
.pub-unite { font-size: 0.92rem; color: var(--text-2); }
.pub-chiffre-ok { align-items: center; font-size: 1.35rem; font-weight: 700; color: var(--ok-tx); }
.pub-coche {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); position: relative; flex: none;
}
.pub-coche::after {
  content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid var(--surface); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.pub-detail { margin: 0; font-size: 0.88rem; color: var(--text-2); }
.pub-avancement-texte { margin: 4px 0 8px; font-size: 0.95rem; }
.pub-barre .barre-empilee, .pub-lot-barre .barre-empilee { display: block; width: 100%; height: 10px; }
.pub-lot-barre .barre-empilee { height: 6px; }
.pub-legende { margin: 6px 0 0; font-size: 0.8rem; }
.pub-legende .leg-inline:first-child { margin-left: 0; }

.pub-lots-bloc { padding: 10px 16px 6px; border-bottom: 1px solid var(--border-leger); }
.pub-lots-a-jour { padding-top: 8px; padding-bottom: 8px; }
.pub-lots-a-jour > summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.pub-lots-a-jour[open] > summary { margin-bottom: 6px; }
.pub-detail-jours { margin-bottom: 4px; }
.pub-sous-titre { margin: 0 0 6px; font-size: 0.92rem; font-weight: 600; }
.pub-lots { list-style: none; margin: 0; padding: 0; }
.pub-lot {
  display: grid; grid-template-columns: minmax(180px, 2fr) minmax(90px, 1fr) minmax(200px, 2fr) auto;
  align-items: center; gap: 4px 14px; padding: 5px 0; border-top: 1px solid var(--border-leger);
}
.pub-lot:first-child { border-top: 0; }
.pub-lot-nom { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pub-lot-fait .pub-lot-nom { font-weight: 500; color: var(--text-2); }
.pub-lot-sans-compte {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-tx); font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.pub-lot-nombres { font-size: 0.88rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pub-lot-reste { color: var(--badge-attention-tx); }
.pub-lot-lien { justify-self: end; }

.pub-recentes { padding: 8px 16px; border-bottom: 1px solid var(--border-leger); }
.pub-recentes > summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.pub-recentes-liste { margin: 8px 0 4px; padding-left: 0; list-style: none; }
.pub-recentes-liste > li {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 12px; padding: 4px 0; border-top: 1px solid var(--border-leger);
}
.pub-recentes-liste > li:first-child { border-top: 0; }
.pub-recente-quand { grid-row: span 2; font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub-recente-ref { font-weight: 600; }
.pub-recente-infos { font-size: 0.82rem; color: var(--muted); }
.pub-interne { margin: 0; padding: 8px 16px 10px; font-size: 0.84rem; color: var(--muted); }

@media (max-width: 1100px) {
  .pub-resume { grid-template-columns: 1fr 1fr; }
  .pub-case-avancement { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border-leger); }
  .pub-lot { grid-template-columns: minmax(160px, 1.5fr) minmax(80px, 1fr) minmax(170px, 2fr) auto; }
}
@media (max-width: 700px) {
  .pub-resume { grid-template-columns: 1fr; }
  .pub-case + .pub-case { border-left: 0; border-top: 1px solid var(--border-leger); }
  .pub-lot { grid-template-columns: 1fr auto; }
  .pub-lot-barre { grid-column: 1 / -1; grid-row: 2; }
  .pub-lot-nombres { grid-column: 1 / 2; }
  .pub-recentes-liste > li { grid-template-columns: 1fr; }
  .pub-recente-quand { grid-row: auto; }
}
@media print {
  .pub-recentes { display: none; }
}
