/* ============================================================
   Prototype Mécénat - Groupe Sorégies - Charte graphique
   ============================================================ */

:root {
  --bleu-nuit: #001f3b;
  --bleu-2: #002b4d;
  --bleu-3: #00447a;
  --bleu-4: #0062b4;
  --bleu-5: #007bdf;
  --fond-bleu-1: #eef8ff;
  --fond-bleu-2: #dcf0ff;
  --fond-bleu-3: #f7f9fb;
  --vert: #72d09a;
  --vert-fonce: #29a063;
  --vert-fond: #effaf3;
  --texte: #212121;
  --fond: #fafafa;
  --fond-2: #f5f5f5;
  --gris: #9e9e9e;
  --rouge: #d64545;
  --rouge-fond: #fdeeee;
  --orange: #e8963c;
  --orange-fond: #fdf3e6;
  --radius: 12px;
  --ombre: 0 2px 10px rgba(0, 31, 59, 0.08);
  --ombre-forte: 0 8px 30px rgba(0, 31, 59, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--texte);
  background: var(--fond);
  line-height: 1.5;
}

h1, h2, h3, h4, .titre { font-family: 'Poppins', sans-serif; color: var(--bleu-nuit); }

button { font-family: 'Inter', sans-serif; cursor: pointer; }
input, select, textarea { font-family: 'Inter', sans-serif; font-size: 0.95rem; }

/* ---------- Layout général ---------- */

#app { min-height: 100vh; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  min-width: 250px;
  background: var(--bleu-nuit);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .logo-bloc { margin-bottom: 28px; padding: 0 6px; }

.main {
  flex: 1;
  padding: 28px 34px 60px;
  max-width: 1500px;
  min-width: 0;
}

/* ---------- Logo ---------- */

.logo { display: flex; align-items: center; gap: 9px; }
.logo svg { flex-shrink: 0; }
.logo .logo-texte { font-family: 'Poppins', sans-serif; line-height: 1.05; }
.logo .logo-nom { font-weight: 700; font-size: 1.18rem; color: var(--bleu-nuit); }
.logo .logo-groupe { font-weight: 600; font-size: 0.82rem; color: var(--vert-fonce); letter-spacing: 0.04em; }
.logo.logo-clair .logo-nom { color: #fff; }
.logo.logo-clair .logo-groupe { color: var(--vert); }
.badge-demo {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bleu-4);
  background: var(--fond-bleu-2);
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.logo-clair + .badge-demo, .sidebar .badge-demo { background: rgba(255,255,255,0.14); color: #bcd9f2; }

/* ---------- Navigation sidebar ---------- */

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nav a {
  color: #c5d6e5;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.93rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}
.nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav a.actif { background: var(--vert); color: var(--bleu-nuit); font-weight: 600; }
.nav a .ico { width: 20px; text-align: center; }

.sidebar .bas { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar .profil-actuel { font-size: 0.8rem; color: #8fb0ca; margin-bottom: 8px; padding: 0 6px; }
.sidebar .profil-actuel strong { color: #fff; display: block; font-size: 0.92rem; }
.btn-changer-profil {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 9px;
  border-radius: 9px;
  font-size: 0.85rem;
}
.btn-changer-profil:hover { background: rgba(255,255,255,0.18); }
.btn-reset {
  width: 100%;
  background: none;
  border: none;
  color: #6d8ba3;
  font-size: 0.75rem;
  margin-top: 10px;
  text-decoration: underline;
}

/* ---------- Écran d'accueil / sélecteur ---------- */

.accueil {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--fond-bleu-1) 0%, #fff 55%, var(--vert-fond) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.accueil .logo { margin-bottom: 10px; transform: scale(1.35); }
.accueil h1 { font-size: 1.9rem; margin: 26px 0 6px; text-align: center; }
.accueil .sous-titre { color: var(--bleu-3); margin-bottom: 8px; text-align: center; max-width: 620px; }
.accueil .note-demo { font-size: 0.85rem; color: var(--gris); margin-bottom: 36px; text-align: center; }

.profils {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 240px));
  gap: 18px;
  justify-content: center;
  width: 100%;
  max-width: 1300px;
}
.carte-profil {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 26px 22px;
  text-align: left;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.carte-profil:hover { transform: translateY(-4px); border-color: var(--vert); box-shadow: var(--ombre-forte); }
.carte-profil .pictos { font-size: 1.7rem; margin-bottom: 12px; }
.carte-profil h3 { font-size: 1.05rem; margin-bottom: 6px; }
.carte-profil p { font-size: 0.83rem; color: #5c6b78; }
.carte-profil .tag-role {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--vert-fonce);
  background: var(--vert-fond);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ---------- En-tête de page ---------- */

.entete-page { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.entete-page h1 { font-size: 1.5rem; }
.entete-page .bonjour { font-size: 1.5rem; }
.entete-page .bonjour .nom { color: var(--vert-fonce); }
.entete-page .sous { color: #5c6b78; font-size: 0.92rem; margin-top: 3px; }

/* ---------- Cartes / blocs ---------- */

.carte {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 22px;
  margin-bottom: 20px;
}
.carte h2 { font-size: 1.05rem; margin-bottom: 14px; }
.carte h3 { font-size: 0.95rem; margin-bottom: 10px; }

.grille-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 16px 18px;
}
.kpi .valeur { font-family: 'Poppins', sans-serif; font-size: 1.45rem; font-weight: 700; color: var(--bleu-nuit); }
.kpi .valeur.vert { color: var(--vert-fonce); }
.kpi .libelle { font-size: 0.78rem; color: #5c6b78; margin-top: 2px; }
.kpi .detail { font-size: 0.72rem; color: var(--gris); margin-top: 6px; }

/* KPI cliquable (drill-down) */
.kpi.kpi-cliquable {
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kpi.kpi-cliquable:hover,
.kpi.kpi-cliquable:focus-visible { border-color: var(--vert); box-shadow: var(--ombre-forte); outline: none; }
.kpi .lien-detail { color: var(--vert-fonce); font-weight: 600; text-decoration: underline; }

/* % affiché à côté d'un champ de saisie de montant */
.pct-saisie {
  min-width: 52px;
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--vert-fonce);
  white-space: nowrap;
}

/* Ligne de total sous les listes */
.tableau tr.ligne-total td {
  font-weight: 700;
  background: var(--fond-bleu-1);
  border-top: 2px solid var(--fond-bleu-2);
  border-bottom: none;
  font-size: 0.86rem;
}

/* ---------- Boutons ---------- */

.btn {
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(0.95); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primaire { background: var(--vert); color: var(--bleu-nuit); }
.btn-secondaire { background: var(--fond-bleu-2); color: var(--bleu-3); }
.btn-sombre { background: var(--bleu-nuit); color: #fff; }
.btn-danger { background: var(--rouge-fond); color: var(--rouge); }
.btn-petit { padding: 6px 12px; font-size: 0.8rem; border-radius: 7px; }
.btn-lien { background: none; border: none; color: var(--bleu-4); text-decoration: underline; font-size: 0.83rem; padding: 4px; }

/* ---------- Badges / étiquettes ---------- */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-etape { background: var(--fond-bleu-2); color: var(--bleu-3); }
.badge-vert { background: var(--vert-fond); color: var(--vert-fonce); }
.badge-rouge { background: var(--rouge-fond); color: var(--rouge); }
.badge-orange { background: var(--orange-fond); color: var(--orange); }
.badge-gris { background: var(--fond-2); color: #5c6b78; }
.badge-bleu { background: var(--fond-bleu-2); color: var(--bleu-4); }

/* ---------- Onglets ---------- */

.onglets { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.onglet {
  background: #fff;
  border: 1px solid #e3e9ee;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.87rem;
  color: var(--bleu-3);
}
.onglet.actif { background: var(--bleu-nuit); color: #fff; border-color: var(--bleu-nuit); font-weight: 600; }

/* ---------- Kanban ---------- */

.kanban-scroll { overflow-x: auto; padding-bottom: 12px; }
.kanban { display: flex; gap: 14px; min-width: max-content; align-items: flex-start; }
.colonne {
  width: 235px;
  min-width: 235px;
  background: var(--fond-bleu-3);
  border-radius: var(--radius);
  padding: 12px;
}
.colonne .tete-col { margin-bottom: 10px; padding: 0 4px; }
.colonne .tete-col .num { font-size: 0.68rem; color: var(--gris); font-weight: 600; letter-spacing: 0.05em; }
.colonne .tete-col h3 { font-size: 0.82rem; line-height: 1.25; margin: 1px 0 3px; }
.colonne .tete-col .total-col { font-size: 0.78rem; color: var(--vert-fonce); font-weight: 600; }
.colonne .tete-col .nb { font-size: 0.72rem; color: var(--gris); }
.carte-dossier {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--ombre);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color 0.15s;
}
.carte-dossier:hover { border-color: var(--vert); }
.carte-dossier .ref { font-size: 0.68rem; color: var(--gris); font-weight: 600; }
.carte-dossier .qui { font-weight: 600; font-size: 0.86rem; color: var(--bleu-nuit); margin: 2px 0; }
.carte-dossier .projet { font-size: 0.78rem; color: #5c6b78; margin-bottom: 8px; }
.carte-dossier .pied { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.carte-dossier .montant { font-weight: 700; font-size: 0.85rem; color: var(--bleu-3); }

/* ---------- Tableaux ---------- */

.table-scroll { overflow-x: auto; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.tableau th {
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bleu-3);
  background: var(--fond-bleu-1);
  padding: 10px 12px;
  border-bottom: 2px solid var(--fond-bleu-2);
  white-space: nowrap;
}
.tableau td { padding: 10px 12px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--fond-bleu-1); }
.tableau .droite { text-align: right; }
.tableau tfoot td { font-weight: 700; background: var(--fond-bleu-3); }
.tableau input.montant-edit {
  width: 110px;
  padding: 6px 8px;
  border: 1.5px solid var(--fond-bleu-2);
  border-radius: 7px;
  text-align: right;
  font-weight: 600;
}
.tableau input.montant-edit:focus { outline: none; border-color: var(--vert); }

/* ---------- Panneau détail (drawer) ---------- */

.voile {
  position: fixed; inset: 0;
  background: rgba(0, 31, 59, 0.45);
  z-index: 90;
}
.panneau {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 640px;
  max-width: 95vw;
  background: var(--fond);
  z-index: 100;
  box-shadow: -12px 0 40px rgba(0,31,59,0.25);
  overflow-y: auto;
  padding: 26px 28px 60px;
  animation: glisse 0.22s ease-out;
}
@keyframes glisse { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.panneau .fermer {
  position: absolute; top: 18px; right: 20px;
  background: var(--fond-2); border: none;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 1rem; color: var(--bleu-3);
}
.panneau h2 { font-size: 1.15rem; margin-bottom: 2px; padding-right: 40px; }
.panneau .ref-projet { color: #5c6b78; font-size: 0.88rem; margin-bottom: 16px; }

/* ---------- Frise étapes ---------- */

.frise { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 18px; }
.frise .pas {
  font-size: 0.68rem;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--fond-2);
  color: var(--gris);
  font-weight: 500;
}
.frise .pas.fait { background: var(--vert-fond); color: var(--vert-fonce); }
.frise .pas.courant { background: var(--bleu-nuit); color: #fff; font-weight: 600; }

/* ---------- Liste de pièces ---------- */

.liste-pieces { display: flex; flex-direction: column; gap: 8px; }
.piece {
  background: #fff;
  border: 1px solid #e8edf1;
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.piece .nom-piece { flex: 1; min-width: 180px; font-size: 0.88rem; font-weight: 500; }
.piece .actions-piece { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.piece.non-conforme { border-color: var(--rouge); background: var(--rouge-fond); }
.piece.validee { border-color: var(--vert); }
.piece .motif-nc { width: 100%; font-size: 0.78rem; color: var(--rouge); }

/* Infobulle */
.aide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--fond-bleu-2);
  color: var(--bleu-4);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  flex-shrink: 0;
}
.aide::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bleu-nuit);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 11px;
  border-radius: 8px;
  width: 240px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 50;
}
.aide:hover::after { opacity: 1; }

/* ---------- Formulaires ---------- */

.champ { margin-bottom: 14px; }
.champ label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--bleu-3); margin-bottom: 5px; }
.champ input, .champ select, .champ textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e0e7ed;
  border-radius: 9px;
  background: #fff;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--vert); }
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.champ-copie { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.champ-copie .etiquette { width: 170px; min-width: 170px; font-size: 0.78rem; font-weight: 600; color: var(--bleu-3); }
.champ-copie input { flex: 1; padding: 8px 10px; border: 1.5px solid #e0e7ed; border-radius: 8px; background: var(--fond-bleu-3); font-size: 0.85rem; }

/* ---------- Jauge ---------- */

.jauge { background: var(--fond-bleu-2); border-radius: 20px; height: 16px; overflow: hidden; position: relative; }
.jauge .remplissage { height: 100%; background: linear-gradient(90deg, var(--vert), var(--vert-fonce)); border-radius: 20px; transition: width 0.4s; }
.jauge .remplissage.alerte { background: linear-gradient(90deg, var(--orange), var(--rouge)); }
.jauge-legende { display: flex; justify-content: space-between; font-size: 0.78rem; color: #5c6b78; margin-top: 6px; }

/* ---------- Barres du tableau de bord ---------- */

.barres { display: flex; flex-direction: column; gap: 9px; }
.ligne-barre { display: grid; grid-template-columns: 210px 1fr 46px; gap: 10px; align-items: center; font-size: 0.8rem; }
.ligne-barre .fond-barre { background: var(--fond-bleu-1); border-radius: 6px; height: 20px; overflow: hidden; }
.ligne-barre .barre { height: 100%; background: var(--bleu-4); border-radius: 6px; min-width: 2px; }
.ligne-barre .nb-barre { font-weight: 700; color: var(--bleu-3); }

/* ---------- Historique ---------- */

.historique { border-left: 2px solid var(--fond-bleu-2); padding-left: 16px; display: flex; flex-direction: column; gap: 12px; }
.evenement { position: relative; font-size: 0.83rem; }
.evenement::before {
  content: '';
  position: absolute;
  left: -21px; top: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--vert);
}
.evenement .date-ev { font-size: 0.72rem; color: var(--gris); }
.evenement .acteur-ev { font-weight: 600; color: var(--bleu-3); }

/* ---------- Journal des mails ---------- */

.mail {
  background: #fff;
  border: 1px solid #e8edf1;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.mail .entete-mail { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.78rem; color: var(--gris); }
.mail .objet-mail { font-weight: 600; color: var(--bleu-nuit); font-size: 0.9rem; margin: 4px 0; }
.mail .corps-mail { font-size: 0.83rem; color: #444; white-space: pre-line; }

/* ---------- Toasts ---------- */

#toasts {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  background: var(--bleu-nuit);
  color: #fff;
  padding: 13px 18px;
  border-radius: 10px;
  box-shadow: var(--ombre-forte);
  font-size: 0.86rem;
  animation: monte 0.25s ease-out;
  border-left: 4px solid var(--vert);
}
.toast.toast-mail { border-left-color: var(--bleu-5); }
.toast.toast-erreur { border-left-color: var(--rouge); }
@keyframes monte { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- PV imprimable ---------- */

#zone-pv {
  position: fixed; inset: 0;
  background: rgba(0,31,59,0.5);
  z-index: 300;
  overflow-y: auto;
  padding: 30px 16px;
}
.pv-document {
  background: #fff;
  max-width: 780px;
  margin: 0 auto;
  border-radius: var(--radius);
  padding: 46px 52px;
  box-shadow: var(--ombre-forte);
}
.pv-document .pv-entete { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--vert); padding-bottom: 18px; margin-bottom: 24px; }
.pv-document h1 { font-size: 1.3rem; margin-bottom: 4px; }
.pv-document .pv-sous { color: #5c6b78; font-size: 0.85rem; }
.pv-document table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.85rem; }
.pv-document th { background: var(--fond-bleu-1); color: var(--bleu-3); text-align: left; padding: 8px 10px; font-size: 0.75rem; text-transform: uppercase; }
.pv-document td { padding: 8px 10px; border-bottom: 1px solid #eef1f4; }
.pv-document .pv-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 40px; font-size: 0.85rem; }
.pv-document .pv-signatures .case-signature { border: 1px dashed var(--gris); border-radius: 8px; height: 90px; margin-top: 8px; }
.pv-actions { max-width: 780px; margin: 0 auto 14px; display: flex; justify-content: flex-end; gap: 10px; }

@media print {
  body * { visibility: hidden; }
  #zone-pv, #zone-pv * { visibility: visible; }
  #zone-pv { position: static; background: #fff; padding: 0; }
  .pv-actions { display: none; }
  .pv-document { box-shadow: none; border-radius: 0; padding: 10px; max-width: none; }
}

/* ---------- Divers ---------- */

.vide { text-align: center; color: var(--gris); padding: 34px 10px; font-size: 0.9rem; }
.separateur { border: none; border-top: 1px solid #eef1f4; margin: 18px 0; }
.texte-petit { font-size: 0.8rem; color: #5c6b78; }
.texte-vert { color: var(--vert-fonce); font-weight: 600; }
.texte-rouge { color: var(--rouge); font-weight: 600; }
.ligne-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.espace { flex: 1; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  .sidebar .bas { margin-top: 0; border-top: none; padding-top: 0; margin-left: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 20px 16px 50px; }
  .deux-col { grid-template-columns: 1fr; }
  .ligne-barre { grid-template-columns: 130px 1fr 40px; }
}

/* ---------- Administration et identité nominative ---------- */

.profil-actuel .service-connecte {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 3px;
}
.tableau tr.ligne-inactive td { opacity: 0.55; }
.actions-admin { white-space: nowrap; }
.actions-admin .btn-lien { display: block; padding: 2px 0; text-align: left; }

/* ---------- Tri des tableaux et recherche ---------- */

.tableau th.triable { cursor: pointer; user-select: none; white-space: nowrap; }
.tableau th.triable:hover { color: var(--bleu-nuit); background: var(--fond-bleu-2); }
.tableau th.tri-actif { color: var(--bleu-nuit); background: var(--fond-bleu-2); }
#recherche-liste {
  padding: 10px 12px;
  border: 1.5px solid #e0e7ed;
  border-radius: 9px;
  font-size: 0.9rem;
  flex: 1;
}
#recherche-liste:focus { outline: none; border-color: var(--vert); }

/* ---------- Couleurs par service (déclinaison de la palette Sorégies) ---------- */

.badge-service-com   { background: var(--fond-bleu-2); color: var(--bleu-3); }
.badge-service-jury  { background: var(--vert-fond); color: var(--vert-fonce); }
.badge-service-comex { background: var(--fond-bleu-1); color: var(--bleu-nuit); border: 1px solid rgba(0, 31, 59, 0.25); }
.badge-service-fdf   { background: var(--orange-fond); color: #b26f22; }

/* ---------- Typologies de travaux ---------- */

.badge-typo {
  background: var(--fond-bleu-1);
  color: var(--bleu-3);
  font-size: 0.68rem;
  display: inline-block;
  margin: 1px 2px 1px 0;
}
.ligne-piece-typo {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f4;
}
.ligne-piece-typo .num-piece {
  font-weight: 700;
  color: var(--bleu-3);
  min-width: 22px;
  padding-top: 26px;
}
.actions-piece-typo { display: flex; gap: 2px; padding-top: 24px; white-space: nowrap; }
.actions-piece-typo .btn-lien[disabled] { opacity: 0.35; cursor: default; }

/* ---------- Rubrique « Mes pièces » du demandeur ---------- */

.piece-detail { padding: 10px 0; border-bottom: 1px solid #eef1f4; }
.piece-detail:last-child { border-bottom: none; }
.versions-piece { margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--fond-bleu-2); }
.version-piece { font-size: 0.8rem; color: #5c6b78; padding: 2px 0; }
.version-piece .btn-lien { font-size: 0.78rem; padding: 0 4px; }
