/* ADKOUL Compta — feuille de style */
:root {
  --bleu: #1f4e79;
  --bleu-fonce: #153553;
  --bleu-clair: #e8f0f8;
  --bleu-ligne: #dbe7f3;
  --texte: #1d2733;
  --gris: #5f6b78;
  --gris-clair: #f4f6f9;
  --bord: #d8dee6;
  --vert: #1e7b4a;
  --vert-vif: #2e9d5b;
  --vert-fonce: #155c37;
  --vert-clair: #e3f4ea;
  --vert-pale: #f1faf4;
  --rouge: #b42318;
  --rouge-clair: #fdecea;
  --orange: #b25e09;
  --orange-clair: #fff3dc;
  --jaune: #fff8d6;
  --rayon: 6px;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 14px; }
body {
  margin: 0; color: var(--texte); background: var(--gris-clair);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}
a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 4px; color: var(--bleu-fonce); font-weight: 600; }
h2 { font-size: 1.15rem; margin: 22px 0 10px; color: var(--bleu-fonce); font-weight: 600; }
h3 { font-size: 1rem; margin: 16px 0 8px; color: var(--bleu-fonce); }
.sous-titre { color: var(--gris); margin: 0 0 16px; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: .93em; }
.muet { color: var(--gris); }
.petit { font-size: .86rem; }
.nowrap { white-space: nowrap; }

/* En-tête et menus */
.entete {
  background: var(--bleu-fonce); color: #fff; display: flex; align-items: center; gap: 18px;
  padding: 0 18px; height: 50px; position: sticky; top: 0; z-index: 50;
}
.entete .marque { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.entete .marque img { height: 32px; background: #fff; border-radius: 4px; padding: 2px; }
.entete .marque .pastille { width: 30px; height: 30px; border-radius: 6px; background: #fff; color: var(--bleu-fonce);
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.menus { display: flex; height: 100%; flex: 1; }
.menu { position: relative; height: 100%; }
.menu > button {
  height: 100%; background: none; border: 0; color: #dfe9f4; padding: 0 13px; font: inherit; cursor: pointer;
}
.menu > button:hover, .menu.ouvert > button { background: rgba(255,255,255,.1); color: #fff; }
.menu.inactif > button { color: #8ea6bf; }
.sous-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 270px; background: #fff; color: var(--texte);
  border: 1px solid var(--bord); border-radius: 0 0 var(--rayon) var(--rayon); box-shadow: 0 8px 24px rgba(16,24,40,.16);
  padding: 6px 0; max-height: calc(100vh - 60px); overflow-y: auto;
}
.menu.ouvert .sous-menu { display: block; }
@media (hover: hover) { .menu:hover .sous-menu { display: block; } }
.sous-menu a, .sous-menu span.titre-groupe, .sous-menu .desactive { display: block; padding: 7px 16px; color: var(--texte); }
.sous-menu a:hover { background: var(--bleu-clair); text-decoration: none; }
.sous-menu .titre-groupe { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); padding-top: 10px; }
.sous-menu .desactive { color: #a0a9b4; }
.sous-menu hr { border: 0; border-top: 1px solid var(--bord); margin: 6px 0; }
.entete .droite { display: flex; align-items: center; gap: 12px; font-size: .9rem; white-space: nowrap; }
.entete .droite select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; padding: 4px 6px; }
.entete .droite select option { color: var(--texte); }
.entete .droite a { color: #dfe9f4; }

/* Page */
.page { padding: 20px 24px 60px; max-width: 1680px; margin: 0 auto; }
.barre-titre { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px 18px; margin-bottom: 16px; }
.carte.serree { padding: 0; overflow: hidden; }
.grille { display: grid; gap: 14px; }
.grille.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grille.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grille.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--bord); background: #fff; color: var(--texte);
  border-radius: 5px; padding: 6px 12px; font: inherit; cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { background: var(--gris-clair); text-decoration: none; }
.btn.primaire { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn.primaire:hover { background: var(--bleu-fonce); }
.btn.vert { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn.danger { color: var(--rouge); border-color: #f1b8b2; }
.btn.danger:hover { background: var(--rouge-clair); }
.btn.mini { padding: 2px 8px; font-size: .84rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 3px; color: #2f3b48; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search],
input:not([type]), select, textarea {
  width: 100%; padding: 6px 8px; border: 1px solid #c4cdd8; border-radius: 4px; font: inherit; background: #fff; color: var(--texte);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0e4; outline-offset: 0; border-color: var(--bleu); }
input[type=checkbox] { width: auto; }
.champ { margin-bottom: 12px; }
.champ .aide { color: var(--gris); font-size: .82rem; margin-top: 3px; }
.champ .erreur, .errorlist { color: var(--rouge); font-size: .85rem; margin: 3px 0 0; padding: 0; list-style: none; }
.champ.case label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.formulaire { max-width: 760px; }
.formulaire .grille { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filtres .champ { margin: 0; }
.filtres input, .filtres select { width: auto; min-width: 130px; }
.filtres input[type=checkbox] { min-width: 0; }
.filtres .champ.case { align-self: center; }
ul.cases { list-style: none; padding: 0; margin: 0; columns: 2; }
ul.cases li label { font-weight: 500; display: flex; gap: 6px; align-items: center; }

/* Messages */
.messages { margin-bottom: 14px; }
.message { padding: 10px 14px; border-radius: var(--rayon); margin-bottom: 8px; border: 1px solid; }
.message.success { background: var(--vert-clair); border-color: #b6dfc6; color: #14532d; }
.message.error { background: var(--rouge-clair); border-color: #f4c2bd; color: #7a1a12; }
.message.warning { background: var(--orange-clair); border-color: #f5d39a; color: #6b3a05; }
.message.info { background: var(--bleu-clair); border-color: #bcd3ea; color: #173b5e; }
.encadre { padding: 10px 14px; border-radius: var(--rayon); background: var(--bleu-clair); border: 1px solid #bcd3ea; margin-bottom: 14px; }
.encadre.orange { background: var(--orange-clair); border-color: #f5d39a; }

/* Tableaux */
table { border-collapse: collapse; width: 100%; background: #fff; }
.tableau-defile { overflow-x: auto; }
th, td { padding: 6px 9px; border-bottom: 1px solid #e6ebf1; vertical-align: top; text-align: left; }
th { background: #f0f4f9; color: #33475b; font-weight: 600; font-size: .84rem; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--bord); }
tbody tr:hover td { background: #fafcff; }
tfoot td { font-weight: 700; background: #f0f4f9; border-top: 2px solid var(--bord); }
tr.sous-total td { background: #f5f8fb; font-weight: 600; }
tr.classe td { background: #e9f0f8; font-weight: 700; }
td.vide { color: var(--gris); text-align: center; padding: 24px; }

/* Journal : écritures regroupées */
table.journal td, table.journal th { padding: 5px 7px; font-size: .9rem; }
table.journal tbody.ecriture { border-top: 2px solid #c9d6e4; }
table.journal tbody.ecriture:hover td { background: #fbfdff; }
table.journal tr.contrepartie td { background: #eef5fc; color: #24486d; }
table.journal td.col-lib { min-width: 210px; }
table.journal td.col-four { min-width: 150px; }
table.journal td.col-ref { min-width: 90px; }
table.journal td.col-actions { width: 190px; }
table.journal .pile { display: flex; flex-wrap: wrap; gap: 4px; }
table.journal .pile form { margin: 0; }
table.journal tr.entete-ecriture td { background: #f7f9fc; font-size: .84rem; }
table.journal tbody.brouillard tr.entete-ecriture td { background: #fffbea; }
table.journal tbody.extournee td { color: #8b96a3; }
table.journal tbody.extournee td .num { text-decoration: line-through; }

/* Badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.brouillard { background: #fff4cc; color: #7a5200; border-color: #f2d98a; }
.badge.validee, .badge.valide { background: var(--vert-clair); color: var(--vert); border-color: #b6dfc6; }
.badge.transmis { background: #e5e1fb; color: #3d2f8f; }
.badge.non-liquidee { background: var(--orange-clair); color: var(--orange); border-color: #f5d39a; }
.badge.liquidee { background: var(--vert-clair); color: var(--vert); }
.badge.gris { background: #eef1f4; color: var(--gris); }
.badge.bleu { background: var(--bleu-clair); color: var(--bleu); }
.badge.rouge { background: var(--rouge-clair); color: var(--rouge); }

/* Totaux */
.totaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 1px solid var(--bord); }
.totaux div { padding: 10px 14px; border-right: 1px solid #e6ebf1; }
.totaux div:last-child { border-right: 0; }
.totaux .lib { display: block; font-size: .76rem; color: var(--gris); text-transform: uppercase; letter-spacing: .03em; }
.totaux .val { font-size: 1.08rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.totaux .val.ok { color: var(--vert); }
.totaux .val.ko { color: var(--rouge); }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .val { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bleu-fonce); }
.kpi .lib { font-size: .8rem; color: var(--gris); }

/* Onglets */
.onglets { display: flex; gap: 2px; border-bottom: 2px solid var(--bord); margin-bottom: 14px; flex-wrap: wrap; }
.onglets a { padding: 8px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--gris); margin-bottom: -2px; }
.onglets a.actif { background: #fff; border-color: var(--bord); border-bottom: 2px solid #fff; color: var(--bleu-fonce); font-weight: 600; }
.onglets a:hover { text-decoration: none; color: var(--bleu-fonce); }

/* Saisie */
.grille-saisie td { padding: 3px 4px; }
.grille-saisie input, .grille-saisie select { padding: 5px 6px; }
.grille-saisie input.montant { text-align: right; font-variant-numeric: tabular-nums; }
.grille-saisie tr.auto td { background: #eef5fc; color: #24486d; font-style: italic; }
.grille-saisie .col-num { width: 28px; color: var(--gris); text-align: center; }
.equilibre { font-weight: 700; }
.equilibre.ok { color: var(--vert); }
.equilibre.ko { color: var(--rouge); }
.raccourcis { font-size: .8rem; color: var(--gris); }

/* Liste des journaux */
.carte-journal { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--bord); border-radius: var(--rayon); background: #fff; gap: 10px; }
.carte-journal:hover { border-color: #9cc0e4; text-decoration: none; background: #fbfdff; }
.carte-journal .code { font-weight: 700; color: var(--bleu-fonce); }
.carte-journal.inactif { opacity: .55; }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #153553 0%, #1f4e79 60%, #2b6aa3 100%); }
.connexion .boite { background: #fff; width: 360px; max-width: calc(100vw - 32px); padding: 28px; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

/* Impression */
/* Saisie : montants proposés, ligne banque automatique, dernière écriture */
.grille-saisie input.provisoire { background: #fff6d1; border-color: #e8c55a; color: #6b4e00; font-style: italic; }
.grille-saisie tr.auto input { background: transparent; border-color: transparent; color: #155c37; font-style: italic; }
.grille-saisie tr.auto td { background: var(--vert-pale); color: var(--vert-fonce); }
.aide-calcul { color: #8a6500; font-size: .78rem; min-height: 0; }
.aide-calcul:empty { display: none; }
table.journal tbody.derniere td { background: #e6f5ec !important; }
table.journal tbody.derniere { border-left: 4px solid var(--vert-vif); }
.badge.vert { background: var(--vert-clair); color: var(--vert); border-color: #b6dfc6; }

/* Touches de vert ADKOUL */
.entete { border-bottom: 3px solid var(--m-vif); }
.entete .marque .pastille { background: var(--m-vif); color: #fff; }
.menu > button:hover, .menu.ouvert > button { box-shadow: inset 0 -3px 0 var(--m-vif); }
.sous-menu { border-top: 3px solid var(--m-vif); }
.sous-menu a:hover { background: var(--m-clair); color: var(--m-fonce); }
.sous-menu .titre-groupe { color: var(--m); }
h1 { border-left: 4px solid var(--m-vif); padding-left: 10px; }
.onglets { border-bottom-color: var(--m-vif); }
.onglets a { background: var(--m-pale); border-color: var(--m-ligne); color: var(--m-fonce); }
.onglets a:hover { background: var(--m-clair); color: var(--m-fonce); }
.onglets a.actif { background: var(--m); border-color: var(--m); border-bottom: 2px solid var(--m); color: #fff; }
.btn.primaire { background: var(--m); border-color: var(--m); }
.btn.primaire:hover { background: var(--m-fonce); border-color: var(--m-fonce); }
th { background: var(--m-clair); color: var(--m-fonce); }
tfoot td { background: var(--m-clair); }
tbody tr:hover td { background: var(--m-pale); }
.carte-journal:hover { border-color: var(--vert-vif); background: var(--vert-pale); }
.carte-journal .code { color: var(--vert-fonce); }
.kpi .val { color: var(--m-fonce); }
input:focus, select:focus, textarea:focus { outline-color: var(--m-ciel); border-color: var(--m); }
.connexion { background: linear-gradient(160deg, #153553 0%, #1f4e79 55%, var(--m) 100%); }

@media print {
  .entete, .no-print, .messages, .onglets, .filtres { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .carte { box-shadow: none; border: 0; padding: 0; }
  th { position: static; }
  a { color: inherit; }
}
@media (max-width: 900px) {
  .entete { height: auto; flex-wrap: wrap; padding: 8px 12px; }
  .menus { order: 3; width: 100%; overflow-x: auto; }
  .page { padding: 14px 12px 40px; }
}
h2, h3 { color: var(--m-fonce); }
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }

/* Suivi budgétaire à la saisie */
.alerte-budget { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--rayon); background: var(--m-pale); border: 1px solid var(--m-ligne); color: var(--m-fonce); }
.alerte-budget.depasse { background: var(--orange-clair); border-color: #f5c46b; color: #6b3a05; }
.alerte-budget .titre { font-weight: 700; margin-bottom: 4px; }
.alerte-budget ul { margin: 0 0 4px; padding-left: 18px; }
.champ-od input { border-color: #9fd8b3; background: var(--vert-pale); }
.grille-saisie select.f-type { min-width: 105px; }
.aide-calcul { font-weight: 600; }
.btn.mini.vert { background: var(--vert); border-color: var(--vert); color: #fff; }

/* Liste fine des journaux (menu Saisie › Journaux) */
table.liste-fine td, table.liste-fine th { padding: 3px 10px; font-size: .9rem; line-height: 1.35; }
table.liste-fine tbody tr { cursor: default; user-select: none; }
table.liste-fine tbody tr:hover td { background: var(--m-pale); }
table.liste-fine tr.debut-groupe td { border-top: 2px solid var(--m-ligne); }
table.liste-fine tr.ferme td { color: #6b7785; }
table.liste-fine tr.ouvert td.col-journal { font-weight: 700; }
table.liste-fine tr.mois-courant td.col-mois { font-weight: 700; color: var(--m-fonce); }
table.liste-fine .col-mois { width: 120px; }
table.liste-fine .col-journal { width: 120px; }
table.liste-fine .col-projet { width: 280px; }
table.liste-fine .col-act { width: 70px; text-align: right; }
table.liste-fine .col-act .btn { visibility: hidden; padding: 0 8px; }
table.liste-fine tr:hover .col-act .btn { visibility: visible; }
.tri-col { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-weight: 600; }
.tri-col:hover { color: var(--m-fonce); text-decoration: underline; }
.tri-col .fleche { font-size: .75em; color: var(--m); }
.icone-bic { vertical-align: -2px; }
.bic { cursor: help; }

/* Lignes verticales : colonnes bien séparées dans les journaux et la grille de saisie */
table.journal th, table.journal td,
table.grille-saisie th, table.grille-saisie td,
table.liste-fine th, table.liste-fine td { border-right: 1px solid #dbe7df; }
table.journal th:last-child, table.journal td:last-child,
table.grille-saisie th:last-child, table.grille-saisie td:last-child,
table.liste-fine th:last-child, table.liste-fine td:last-child { border-right: 0; }
table.journal th, table.grille-saisie th { border-right-color: #c6e2d0; }
table.journal td[rowspan] { background: #fbfdfc; }
table.journal tbody.ecriture { border-top: 2px solid #9fd0b0; }

/* Haut du journal et de la saisie en vert */
.entete-journal { background: linear-gradient(90deg, #e3f4ea 0%, #f1faf4 70%, #fff 100%); border: 1px solid #cfe9d8;
  border-left: 5px solid var(--vert-vif); border-radius: var(--rayon); padding: 12px 16px; }
.entete-journal h1 { border-left: 0; padding-left: 0; }
.filtres.bandeau-vert { background: var(--m-pale); border: 1px solid var(--m-ligne); border-radius: var(--rayon); padding: 10px 14px; }
.filtres.bandeau-vert label { color: var(--m-fonce); }
.carte.entete-saisie { background: linear-gradient(180deg, #e3f4ea 0%, #f1faf4 100%); border-color: #b9dcc6; border-left: 5px solid var(--vert-vif); }
.carte.entete-saisie label { color: var(--vert-fonce); }
.carte.entete-saisie input, .carte.entete-saisie select { border-color: #a9d3b8; }
.grille-saisie thead th { background: #d7efe0; color: #14462b; }
.btn.mini.modif { border-color: var(--m-ciel); color: var(--m-fonce); background: var(--m-pale); }
.btn.mini.modif:hover { background: var(--m-clair); }
.carte.modele-excel { border-left: 5px solid var(--m-vif); }
.carte.modele-excel ol.etapes { padding-left: 20px; }
.carte.modele-excel ol.etapes li { margin-bottom: 8px; }
.carte.modele-excel code { background: var(--m-clair); padding: 0 4px; border-radius: 3px; color: var(--m-fonce); }

/* En-tête de saisie sur 6 colonnes */
.entete-grille { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 14px; align-items: start; }
.entete-grille .span2 { grid-column: span 2; }
.entete-grille .span3 { grid-column: span 3; }
.badge.orange { background: var(--orange-clair); color: var(--orange); border-color: #f5d39a; }
@media (max-width: 1100px) { .entete-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.formulaire ul { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; }
.formulaire ul li label { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.formulaire input[type=radio] { width: auto; }
.mode-od { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.mode-od label { display: inline-flex; gap: 5px; align-items: center; font-weight: 500; font-size: .88rem; padding: 2px 10px;
  border: 1px solid var(--m-ligne); border-radius: 14px; background: #fff; cursor: pointer; margin: 0; }
.mode-od label.actif { background: var(--m); color: #fff; border-color: var(--m); }
.mode-od input { width: auto; margin: 0; }

/* Sélection multiple dans un journal */
.col-sel { width: 30px; text-align: center; }
.col-sel input { width: auto; }
table.journal tbody.selectionnee td { background: #fff8db !important; }
.barre-lot { position: sticky; top: 52px; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--nuit, #12324a); background: #12324a; color: #fff; padding: 8px 14px; border-radius: var(--rayon); margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.barre-lot .sep { flex: 0 0 12px; }
.barre-lot .btn.mini { background: #fff; }
.barre-lot .btn.mini.vert { background: var(--vert-vif); color: #fff; border-color: var(--vert-vif); }
.panneau-lot { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: rgba(255,255,255,.08);
  padding: 8px 10px; border-radius: 6px; }
.panneau-lot label { color: #fff; font-weight: 500; display: flex; gap: 6px; align-items: center; margin: 0; }
.panneau-lot select, .panneau-lot input { width: auto; color: var(--texte); }

/* Fenêtres : agrandir, arrière-plan */
.page { position: relative; }
.fenetre-outils { position: absolute; top: 8px; right: 10px; display: flex; gap: 4px; z-index: 5; }
.fenetre-outils button { width: 28px; height: 26px; border: 1px solid #cfe9d8; border-radius: 5px; background: #fff; color: var(--vert-fonce);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.fenetre-outils button:hover { background: var(--vert-clair); }
/* plein écran : l'en-tête et ses onglets restent affichés (v4.50) */
body.plein-ecran .page { max-width: none; padding: 14px 18px 60px; }
.barre-fenetres { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 6px; align-items: center;
  padding: 6px 12px; background: #12324a; border-top: 3px solid var(--vert-vif); overflow-x: auto; }
.barre-fenetres .titre { color: #b9d3e6; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; margin-right: 6px; }
.barre-fenetres .onglet-fen { display: inline-flex; gap: 8px; align-items: center; background: #fff; color: var(--nuit, #12324a);
  border-radius: 5px; padding: 4px 6px 4px 10px; font-size: .85rem; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.barre-fenetres .onglet-fen:hover { text-decoration: none; background: var(--vert-clair); }
.barre-fenetres .onglet-fen button { border: 0; background: #eef2f0; border-radius: 3px; cursor: pointer; padding: 0 5px; }
body:has(.barre-fenetres:not([hidden])) .page { padding-bottom: 80px; }

/* Aperçu avant impression */
.apercu-fond { position: fixed; inset: 0; z-index: 200; background: rgba(10, 25, 40, .55); display: grid; place-items: center; }
.apercu-fond[hidden] { display: none; }
.apercu-boite { width: min(1180px, 96vw); height: 92vh; background: #fff; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.apercu-barre { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--m-pale); border-bottom: 2px solid var(--m-vif); }
.apercu-barre .sep { flex: 1; }
.apercu-boite iframe { flex: 1; border: 0; width: 100%; background: var(--m-clair); }
body.apercu-ouvert { overflow: hidden; }

/* Page affichée dans la fenêtre d'aperçu : présentation d'impression */
body.mode-apercu { background: #fff; }
body.mode-apercu .entete, body.mode-apercu .no-print, body.mode-apercu .fenetre-outils, body.mode-apercu .barre-fenetres,
body.mode-apercu .messages, body.mode-apercu .onglets, body.mode-apercu .filtres { display: none !important; }
body.mode-apercu .page { max-width: none; padding: 16px 22px; }
body.mode-apercu .carte { box-shadow: none; }

/* Fiscalité */
.etats-impots { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.etat-impot { border-top: 4px solid #e0b25a; margin: 0; }
.etat-impot.choisi { border-color: var(--m-vif); box-shadow: 0 0 0 2px var(--m-ligne); }
.etat-impot .tete { display: flex; justify-content: space-between; align-items: center; }
.etat-impot .code { font-weight: 800; color: #5a3825; font-size: 1.1rem; }
.etat-impot .montant { font-size: 1.5rem; font-weight: 800; color: var(--m-fonce); margin-top: 4px; }
.etat-impot .montant small { font-size: .8rem; color: var(--gris); font-weight: 600; }
select.select-impot { width: auto; padding: 2px 4px; font-size: .84rem; }
select.select-impot.a-classer { border-color: var(--rouge); background: var(--rouge-clair); }
.grille-fiscale input.cell { width: 86px; padding: 3px 4px; text-align: right; font-size: .82rem; }
.grille-fiscale input.cell::placeholder { color: #8a96a3; }
.grille-fiscale input.cell.manuel { color: #1f6fbf; font-weight: 700; border-color: #9cc0e4; background: #f2f8fe; }
table.its th.mois { text-align: center; background: var(--m-ligne); }
table.its tr.cloture td { color: #9aa5b1; font-style: italic; }
.logo-projet { height: 54px; max-width: 120px; object-fit: contain; border: 1px solid var(--bord); border-radius: 6px; background: #fff; padding: 3px; }
.barre-lot .btn.mini.primaire { background: var(--vert-vif); border-color: var(--vert-vif); color: #fff; }

/* --- Version 3.1 ------------------------------------------------------- */
/* Solde de banque figé en haut du journal */
.solde-fige { position: sticky; top: 52px; z-index: 32; display: flex; flex-wrap: wrap; align-items: stretch; gap: 0;
  background: #fff; border: 1px solid #cfe9d8; border-left: 5px solid var(--vert-vif); border-radius: 8px;
  box-shadow: 0 4px 12px rgba(18, 50, 74, .10); margin: 0 0 12px; }
.solde-fige .bloc { padding: 7px 16px; border-right: 1px solid #e6efe9; display: flex; flex-direction: column; justify-content: center; }
.solde-fige .bloc .lib { font-size: .72rem; color: var(--gris); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.solde-fige .bloc .val { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.solde-fige .bloc.principal { background: var(--vert-clair, #e8f5ec); }
.solde-fige .bloc.principal .val { font-size: 1.25rem; color: var(--vert-fonce, #1b5e20); }
.solde-fige .val.ok { color: var(--vert); } .solde-fige .val.ko { color: var(--rouge); }
.solde-fige .val small { font-size: .7rem; font-weight: 500; color: var(--gris); }
.solde-fige .sep { flex: 1; }
.solde-fige .nav-fige { display: flex; gap: 6px; align-items: center; padding: 6px 10px; }
.solde-fige ~ .carte .barre-lot { top: 112px; }
tbody.ecriture { scroll-margin-top: 130px; }
tbody.ecriture.derniere-op > tr:first-child > td { box-shadow: inset 0 3px 0 var(--vert-vif); }
@media print { .solde-fige { position: static; box-shadow: none; } }

/* Fermer la fenêtre */
.fenetre-outils button.fermer { color: #b3261e; border-color: #f2c9c6; font-size: 15px; }
.fenetre-outils button.fermer:hover { background: #fdecea; }

/* Logo de l'ONG dans l'en-tête */
.entete .marque img.logo-ong { height: 38px; width: 38px; border-radius: 50%; padding: 0; background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.connexion .logo-connexion { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.15); }

/* Suivi de l'activité */
.pastille-en-ligne { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2fb344; box-shadow: 0 0 0 3px rgba(47,179,68,.2); vertical-align: middle; }
.entete .en-ligne { display: inline-flex; align-items: center; gap: 6px; color: #fff; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 2px 10px; font-size: .82rem; text-decoration: none; }
.entete .en-ligne:hover { background: rgba(255,255,255,.22); }
.message.autres-utilisateurs { border-left-color: var(--orange); }

/* États individuels du mois */
.groupe-impot { margin-bottom: 14px; }
.groupe-impot .tete-groupe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; background: #fff7e6; border-bottom: 1px solid #f0dcb4; }
.groupe-impot .tete-groupe strong { font-size: 1.02rem; color: #5a3825; }
.groupe-impot .montant-groupe { font-weight: 700; font-variant-numeric: tabular-nums; }
.groupe-impot .sep, .barre-lot .sep { flex: 1; }

.titre-bloc-banque { border-top: 1px solid var(--m-clair); padding-top: 10px; margin-top: 4px; color: var(--vert-fonce, var(--m-fonce)); }
.barre-lot label { color: #fff; display: inline-flex; gap: 5px; align-items: center; }
/* Les boutons de fenêtre ne recouvrent plus les boutons de la page */
.page { padding-top: 44px; }
body.plein-ecran .page { padding-top: 40px; }

/* --- Accueil : la vallée --------------------------------------------- */
.menu-lien { display: flex; align-items: center; height: 100%; padding: 0 13px; color: #dfe9f4; text-decoration: none; }
.menu-lien:hover, .menu-lien.actif { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 -3px 0 var(--m-vif); text-decoration: none; }
.hero-accueil { position: relative; height: 360px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(18, 50, 74, .18); background: #a9dcf6; }
.hero-accueil svg.vallee { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-texte { position: absolute; left: 44px; top: 40px; display: flex; gap: 20px; align-items: center; }
.hero-logo { width: 96px; height: 96px; border-radius: 50%; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18), 0 0 0 4px rgba(255,255,255,.7); }
.hero-bonjour { margin: 0 0 2px; color: #0d4a6b; font-size: 1.05rem; font-weight: 500; }
.hero-nom { margin: 0; font-size: 3.1rem; line-height: 1; letter-spacing: -.01em; color: var(--m-fonce); font-weight: 800;
  text-shadow: 0 2px 0 rgba(255,255,255,.65), 0 6px 22px rgba(255,255,255,.55); border: 0; padding: 0; }
.hero-nom span { color: #1576b3; font-weight: 700; }
.hero-sous { margin: 8px 0 0; color: #134a63; font-size: 1rem; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
.nuages .nuage { animation: derive 60s ease-in-out infinite alternate; }
.nuages .n2 { animation-duration: 75s; animation-delay: -20s; } .nuages .n3 { animation-duration: 50s; animation-delay: -10s; }
.nuages .n4 { animation-duration: 90s; animation-delay: -35s; } .nuages .n5 { animation-duration: 66s; animation-delay: -5s; }
@keyframes derive { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
@media (prefers-reduced-motion: reduce) { .nuages .nuage { animation: none; } }
.accueil-espace { height: 34px; }
.accueil-cases { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.case-accueil { background: #fff; border-radius: 14px; padding: 22px 24px; border: 1px solid var(--m-ligne);
  box-shadow: 0 4px 14px rgba(18, 50, 74, .07); }
.case-recherche { border-top: 5px solid var(--m); }
.case-dictionnaire { border-top: 5px solid #3aa3e0; }
.case-accueil h2 { margin: 0 0 4px; font-size: 1.3rem; color: #12324a; display: flex; gap: 8px; align-items: center; border: 0; padding: 0; }
.case-accueil .icone { font-size: 1.15rem; }
.form-recherche fieldset { border: 1px solid var(--m-clair); border-radius: 10px; padding: 8px 12px 12px; margin: 10px 0; }
.form-recherche legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--m); font-weight: 600; padding: 0 4px; }
.form-recherche .ligne, .case-dictionnaire .ligne, .form-recherche-page .ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-recherche input, .form-recherche select, .case-dictionnaire input { padding: 7px 9px; border: 1px solid #cfdbe5; border-radius: 6px; font: inherit; }
.form-recherche .combiner { display: flex; gap: 14px; align-items: center; margin: 2px 4px; }
.liste-lecons { list-style: none; padding: 0; margin: 0 0 14px; }
.liste-lecons li a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: inherit; border-left: 3px solid transparent; }
.liste-lecons li a:hover { background: #eef8fe; border-left-color: #3aa3e0; }
.liste-lecons li strong { display: block; color: #12324a; }
.liste-lecons li span { display: block; color: var(--gris); font-size: .86rem; }
.acces-rapides { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 10px; }
.acces-rapides a { background: #fff; border: 1px solid var(--m-ligne); border-radius: 999px; padding: 8px 16px; color: var(--m-fonce); text-decoration: none; font-weight: 500; }
.acces-rapides a:hover { background: var(--m-clair); }
@media (max-width: 900px) { .accueil-cases { grid-template-columns: 1fr; } .hero-nom { font-size: 2.2rem; } .hero-texte { left: 20px; top: 24px; } .hero-logo { width: 64px; height: 64px; } }

/* Recherche : résultats */
.resume-recherche { margin: 4px 0 10px; }
.resultats-recherche .ligne-res { white-space: nowrap; }
.resultats-recherche .ligne-res .mt { font-variant-numeric: tabular-nums; color: var(--gris); }
.resultats-recherche .ligne-res.trouve { background: #fff3c4; border-radius: 4px; padding: 0 4px; font-weight: 600; }
.resultats-recherche .ligne-res.trouve .mt { color: #7a4b00; }

/* Dictionnaire */
.dico { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: start; }
.dico-index { position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow: auto; background: #fff; border: 1px solid var(--m-ligne); border-radius: 12px; padding: 12px; }
.dico-index input { width: 100%; padding: 8px 10px; border: 1px solid #cfdbe5; border-radius: 6px; margin-bottom: 8px; font: inherit; }
.dico-index .titre-groupe { display: block; margin: 10px 0 4px; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--m); font-weight: 700; }
.dico-index a { display: block; padding: 4px 6px; border-radius: 5px; color: #12324a; text-decoration: none; font-size: .9rem; }
.dico-index a:hover { background: #eef8fe; }
.dico-cat h2 { color: var(--m-fonce); margin: 6px 0 10px; }
.lecon { padding: 16px 20px; margin-bottom: 14px; scroll-margin-top: 70px; border-left: 4px solid #3aa3e0; }
.lecon.ouverte { box-shadow: 0 0 0 3px rgba(58,163,224,.35); }
.lecon h3 { margin: 0 0 4px; color: #12324a; }
.lecon .resume { margin: 0 0 8px; color: var(--m-fonce); font-weight: 600; }
.lecon p { margin: 6px 0; line-height: 1.5; }
.lecon code { background: #eef4f8; padding: 1px 5px; border-radius: 4px; }
.lecon table.exemple { margin-top: 10px; max-width: 640px; }
@media (max-width: 900px) { .dico { grid-template-columns: 1fr; } .dico-index { position: static; max-height: none; } }
@media print { .hero-accueil { height: 220px; } .lecon { break-inside: avoid; } }
.form-recherche .ligne > select, .form-recherche .ligne > input { width: auto; flex: 0 1 auto; }
.form-recherche .ligne > input { flex: 1 1 140px; min-width: 120px; }
.form-recherche .ligne label { display: inline-flex; gap: 6px; align-items: center; }
.form-recherche .ligne label input { width: auto; }

/* Accueil : photo de la prairie */
.hero-accueil { height: 400px; background: #3d8ae0; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  transform-origin: 60% 60%; animation: respire 38s ease-in-out infinite alternate; }
@keyframes respire { from { transform: scale(1); } to { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .hero-photo { animation: none; } }
.hero-voile { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(8, 40, 90, .38) 0%, rgba(8, 40, 90, .12) 38%, rgba(8, 40, 90, 0) 60%); }
.hero-texte { z-index: 2; }
.hero-bonjour { color: #e8f4ff; text-shadow: 0 1px 4px rgba(0, 30, 70, .5); }
.hero-nom { color: #ffffff; text-shadow: 0 2px 6px rgba(0, 30, 70, .45), 0 8px 30px rgba(0, 30, 70, .35); }
.hero-nom span { color: var(--m-ciel); }
.hero-sous { color: #f2f8ff; text-shadow: 0 1px 4px rgba(0, 30, 70, .55); }
/* Plusieurs chèques par opération */
#form-saisie:not(.multi) .col-multi { display: none; }
#form-saisie.multi .col-multi input { background: var(--m-pale); }
.champ-multi { padding-top: 22px; }
/* Pièces scannées */
.zone-pieces { border: 1px solid var(--m-ligne); border-radius: 10px; background: var(--m-pale); padding: 10px 14px; }
.zp-tete { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.zp-depot { border: 2px dashed #8cc9a0; border-radius: 10px; padding: 14px; text-align: center; background: #fff; transition: background .15s, border-color .15s; outline: none; }
.zp-depot.survol, .zp-depot:focus { background: #e8f5ec; border-color: #2e9d4a; }
.zp-texte { margin-bottom: 6px; color: #1f5f33; }
.zp-boutons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.zp-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.zp-liste li, .zp-piece { display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1px solid #cfe9d8; border-radius: 999px; padding: 3px 6px 3px 12px; font-size: .86rem; }
.zp-liste li button, .zp-retirer { border: 0; background: #fdecea; color: #b3261e; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; padding: 0; }
.zp-existantes { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn-piece input { display: none; }
.badge.sans-piece { background: #fdecea; color: #b3261e; }
tbody.ecriture.depot-piece > tr > td { background: var(--m-clair) !important; box-shadow: inset 0 0 0 1px var(--m); }
.ligne-piece { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
tr.ligne-op-piece.sans td { background: #fff8f7; }
tr.ligne-op-piece.depot-piece td { background: var(--m-clair) !important; }
.btn.vert { background: #2e9d4a; color: #fff; border-color: #2e9d4a; }
.btn.vert:hover { background: #24843d; }

table.liste-fine tr.choisie td { background: var(--m-ligne) !important; }
table.liste-fine a.lien-journal { color: var(--m-fonce); font-weight: 500; cursor: pointer; }
table.liste-fine a.lien-journal:hover { text-decoration: underline; }
/* Pièces chargées : coche verte */
.badge.piece-ok { background: #dff3e5; color: #1b6b35; font-weight: 600; text-decoration: none; }
.zp-etat { color: #1b6b35; font-weight: 600; background: #dff3e5; border-radius: 999px; padding: 2px 10px; }
.zp-liste .coche { color: #1b8a3c; font-weight: 700; }
.zone-pieces.chargee .zp-depot { border-color: #2e9d4a; border-style: solid; background: #f1fbf4; }

/* ======================================================================
   Thème vert sur tous les onglets (version 3.3)
   ====================================================================== */
:root {
  --bleu: var(--m); --bleu-fonce: var(--m-fonce); --bleu-clair: var(--m-clair); --bleu-ligne: var(--m-ligne);
  --gris-clair: var(--m-pale); --bord: var(--m-ligne); --nuit: var(--m-fonce);
}
body { background: linear-gradient(180deg, var(--m-pale) 0, var(--m-pale) 260px, var(--m-pale) 100%); }
.entete { background: linear-gradient(90deg, var(--m-fonce) 0%, var(--m-fonce) 55%, var(--m) 100%); border-bottom: 3px solid var(--m-ciel); }
.menu > button, .menu-lien, .entete .droite a { color: var(--m-clair); }
.menu > button:hover, .menu.ouvert > button, .menu-lien:hover, .menu-lien.actif { background: rgba(255,255,255,.14); box-shadow: inset 0 -3px 0 var(--m-ciel); }
.sous-menu { border-top: 3px solid var(--m-vif); }
.sous-menu a:hover { background: var(--m-clair); color: var(--m-fonce); }
.sous-menu .titre-groupe { color: var(--m); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--m-ciel); border-color: var(--m); }
th { background: var(--m-clair); color: var(--m-fonce); border-bottom: 1px solid var(--m-ligne); }
tfoot td { background: var(--m-clair); }
table.journal tbody.ecriture:hover td { background: #f6fcf8; }
table.journal tr.contrepartie td, .grille-saisie tr.auto td { background: #eef8f1; color: #1f5f33; }
.carte { border-color: var(--m-ligne); }
.carte.kpi { border-top: 3px solid var(--m-ciel); }
.barre-titre h1 { color: var(--m-fonce); }
.filtres { background: var(--m-pale); border: 1px solid var(--m-ligne); border-radius: 8px; padding: 10px 12px; }
.filtres label { color: var(--m-fonce); }
.onglets { border-bottom-color: var(--m-vif); }
.onglets a { background: var(--m-pale); border-color: var(--m-ligne); color: var(--m-fonce); }
.onglets a.actif { background: var(--m); border-color: var(--m); color: #fff; }
.onglets a:hover { background: var(--m-clair); color: var(--m-fonce); }
.onglets a.actif:hover { background: var(--m); color: #fff; }
.message.info, .encadre { background: var(--m-clair); border-color: var(--m-ligne); color: var(--m-fonce); }
.badge.bleu { background: var(--m-clair); color: var(--m); }
.kpi .val { color: var(--m-fonce); }
.barre-lot, .barre-fenetres { background: #0f3d24; }
.barre-fenetres .onglet-fen { color: #0f3d24; }
.carte-journal:hover { border-color: #9fd8b3; background: #f6fcf8; }
.connexion { background: linear-gradient(160deg, var(--m-fonce) 0%, var(--m-fonce) 50%, var(--m-vif) 100%); }
.case-accueil h2, .liste-lecons li strong, .dico-index a, .lecon h3 { color: var(--m-fonce); }
.case-dictionnaire { border-top-color: var(--m-vif); }
.lecon { border-left-color: var(--m-vif); }
.liste-lecons li a:hover { background: var(--m-pale); border-left-color: var(--m-vif); }
.grille-fiscale input.cell.manuel { color: var(--m-fonce); border-color: var(--m-ciel); background: var(--m-pale); }
/* Saisie rapide : le formulaire reste en place, la liste du mois défile dessous */
.zone-saisies { overflow: auto; }
.zone-saisies thead th { position: sticky; top: 0; z-index: 2; }
.equilibre.clignote { animation: clignote .3s 3; }
@keyframes clignote { 50% { background: #fdecea; color: #b42318; } }
.grille-saisie tr.auto td { background: #eef8f1; }
.grille-saisie tr.auto input { background: #f6fcf8; color: #1f5f33; font-style: normal; }
.grille-saisie tr.auto input.auto-lib { background: #fff; border-color: #9fd8b3; }
.grille-saisie input.f-nif { width: 110px; }
.grille-saisie input.f-nif[data-auto="1"] { color: var(--gris); }
/* Saisie compacte : tout le formulaire tient en haut de l'écran */
.page-saisie .barre-titre { margin-bottom: 6px; }
.page-saisie .barre-titre h1 { font-size: 1.25rem; }
.page-saisie .sous-titre { margin-bottom: 6px; font-size: .86rem; }
.page-saisie .carte.entete-saisie { padding: 10px 14px 6px; margin-bottom: 10px; }
.page-saisie .entete-saisie .champ { margin-bottom: 6px; }
.page-saisie .entete-saisie label { margin-bottom: 2px; font-size: .82rem; }
.page-saisie .entete-saisie input, .page-saisie .entete-saisie select { padding: 5px 8px; }
.page-saisie #aide-date-od { display: none; }
.page-saisie .entete-saisie details summary { margin-top: 0; }
.page-saisie .grille-saisie td { padding-top: 3px; padding-bottom: 3px; }
.page-saisie .grille-saisie input, .page-saisie .grille-saisie select { padding: 4px 6px; }
.page-saisie .carte.zone-actions { padding: 8px 12px; }
.page-saisie .zone-pieces { padding: 6px 10px; }
.page-saisie .zp-tete { margin-bottom: 4px; }
.page-saisie .zp-tete .muet { display: none; }
.page-saisie .zp-depot { padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.page-saisie .zp-texte { margin: 0; font-size: .86rem; }
.page-saisie .zp-boutons { margin: 0; }
.page-saisie #saisies { margin-top: 10px !important; }
/* Ligne de banque : remplie automatiquement, modifiable */
.grille-saisie tr.auto td { background: #eef8f1; }
.grille-saisie tr.auto input { background: #fff; color: #1f5f33; border-color: #b6dfc6; }
.grille-saisie tr.auto .auto-info { font-size: .82rem; color: #2e7d32; white-space: nowrap; }
.grille-saisie tr.auto.modifiee td { background: #fff8e6; }
.grille-saisie tr.auto.modifiee .auto-info::after { content: " · modifiée"; color: #b25e09; }
/* Saisie intégrée dans le tiroir du journal */
body.mode-integre { background: #f6fcf8; }
body.mode-integre .entete, body.mode-integre .fenetre-outils, body.mode-integre .barre-fenetres,
body.mode-integre .page-saisie > .barre-titre { display: none !important; }
body.mode-integre .page { max-width: none; padding: 8px 12px 12px; }
body.mode-integre .messages { margin-bottom: 6px; }
body.mode-integre .message { padding: 5px 10px; font-size: .86rem; }

/* Tiroir de saisie, fixé en bas du journal */
.tiroir-saisie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 3px solid #2e9d5b;
  box-shadow: 0 -8px 24px rgba(15, 61, 36, .18); display: flex; flex-direction: column; height: 46vh; transition: height .15s; }
.tiroir-saisie.grand { height: 78vh; }
.tiroir-saisie.reduit { height: 40px; }
.tiroir-saisie .tiroir-tete { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: linear-gradient(90deg, #0d3b22, #1e7b4a); color: #fff; cursor: pointer; }
.tiroir-saisie .tiroir-tete strong { font-size: .95rem; }
.tiroir-saisie .tiroir-tete .sep { flex: 1; }
.tiroir-saisie .tiroir-tete button { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 5px; padding: 2px 9px; cursor: pointer; }
.tiroir-saisie .tiroir-tete button:hover { background: rgba(255,255,255,.28); }
.tiroir-saisie iframe { flex: 1; border: 0; width: 100%; }
.tiroir-saisie.reduit iframe { display: none; }
body.avec-tiroir .page { padding-bottom: calc(46vh + 24px); }
body.avec-tiroir.tiroir-grand .page { padding-bottom: calc(78vh + 24px); }
body.avec-tiroir.tiroir-reduit .page { padding-bottom: 64px; }
body.avec-tiroir .barre-fenetres { bottom: 46vh; }
@media print { .tiroir-saisie { display: none; } body.avec-tiroir .page { padding-bottom: 0; } }
/* Tiroir de saisie en HAUT du journal (version 3.5) : il reste fixé sous le menu pendant qu'on parcourt le journal */
.tiroir-saisie { position: sticky; top: 52px; left: auto; right: auto; bottom: auto; z-index: 34; height: 44vh; margin: 0 0 10px;
  border: 1px solid #9fd8b3; border-top: 0; border-radius: 0 0 10px 10px; box-shadow: 0 8px 18px rgba(15, 61, 36, .16); overflow: hidden; }
.tiroir-saisie.grand { height: 72vh; }
.tiroir-saisie.reduit { height: 38px; }
.tiroir-saisie .tiroir-tete { border-radius: 0; }
body.avec-tiroir .page, body.avec-tiroir.tiroir-grand .page, body.avec-tiroir.tiroir-reduit .page { padding-bottom: 60px; }
body.avec-tiroir .barre-fenetres { bottom: 0; }
body.avec-tiroir .solde-fige { top: calc(52px + var(--h-tiroir, 0px) + 4px); }
body.avec-tiroir .solde-fige ~ .carte .barre-lot { top: calc(112px + var(--h-tiroir, 0px)); }
body.avec-tiroir tbody.ecriture { scroll-margin-top: calc(140px + var(--h-tiroir, 0px)); }
/* Liste des comptes (F4) */
dialog.selecteur { width: min(900px, 94vw); max-height: 86vh; padding: 0; border: 2px solid var(--m-vif); border-radius: 12px; box-shadow: 0 18px 50px rgba(11, 58, 91, .35); display: none; flex-direction: column; }
dialog.selecteur[open] { display: flex; }
dialog.selecteur::backdrop { background: rgba(11, 58, 91, .35); }
.sel-tete { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: linear-gradient(90deg, var(--m-fonce), var(--m)); }
.sel-onglets button { background: rgba(255,255,255,.12); color: var(--m-clair); border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 4px 12px; cursor: pointer; margin-right: 4px; }
.sel-onglets button.actif { background: #fff; color: var(--m-fonce); font-weight: 600; }
.sel-tete .sep, .sel-pied .sep, .sel-creer-actions .sep { flex: 1; }
.sel-fermer { background: transparent; color: #fff; border: 0; font-size: 1.1rem; cursor: pointer; }
#sel-q { margin: 10px; padding: 8px 10px; font-size: 1rem; border: 1px solid var(--m-ciel); border-radius: 6px; }
.sel-liste { overflow: auto; flex: 1; min-height: 200px; max-height: 52vh; border-top: 1px solid var(--m-ligne); }
.sel-liste table { width: 100%; border-collapse: collapse; }
.sel-liste td, .sel-liste th { padding: 4px 10px; font-size: .9rem; text-align: left; }
.sel-liste th { position: sticky; top: 0; }
.sel-liste tbody tr { cursor: pointer; }
.sel-liste tbody tr:hover td { background: var(--m-pale); }
.sel-liste tbody tr.actif td { background: var(--m-ligne); font-weight: 600; }
dialog.selecteur:not(.tiers) .sel-col-t { display: none; }
.sel-pied { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--m-ligne); background: var(--m-pale); }
.sel-creer { padding: 10px; border-top: 2px solid var(--m-vif); background: var(--m-pale); }
.sel-creer label { display: inline-flex; flex-direction: column; gap: 2px; font-size: .82rem; color: var(--m-fonce); margin: 0 8px 8px 0; }
.sel-creer label.large { min-width: 280px; }
.sel-creer input, .sel-creer select { padding: 5px 8px; border: 1px solid var(--m-ligne); border-radius: 5px; font: inherit; }
dialog.selecteur:not(.tiers) .sel-creer-t, dialog.selecteur.tiers .sel-creer-g { display: none; }
.sel-creer-actions { display: flex; gap: 8px; align-items: center; }
.sel-creer-actions .erreur { color: #b42318; font-size: .86rem; }

/* La zone « Nouvelle écriture » du journal : bordure verte, bien séparée du journal */
.tiroir-saisie { border: 3px solid #2e9d5b !important; border-radius: 12px !important; background: #eef8f1;
  box-shadow: 0 10px 24px rgba(15, 61, 36, .22), 0 0 0 4px #dff3e5 !important; margin: 4px 0 16px; }
.tiroir-saisie .tiroir-tete { border-radius: 9px 9px 0 0 !important; }
.tiroir-saisie iframe { background: #f6fcf8; }
body.avec-tiroir .solde-fige { margin-top: 6px; }
#sel-q { width: calc(100% - 20px); box-sizing: border-box; }
.sel-recherche { display: flex; gap: 8px; align-items: center; margin: 10px; }
.sel-recherche #sel-q { margin: 0; flex: 1; width: auto; }
.sel-vide { padding: 18px 12px !important; color: var(--gris); text-align: center !important; }
.sel-vide .btn { margin-left: 8px; }
.creer-flottant { position: absolute; z-index: 60; background: #1e7b4a; color: #fff; border: 0; border-radius: 6px; padding: 4px 10px;
  font-size: .82rem; box-shadow: 0 4px 12px rgba(15, 61, 36, .3); cursor: pointer; }
.creer-flottant:hover { background: #155c37; }
#btn-annuler { color: #b42318; border-color: #f2c9c6; }
#btn-annuler:hover { background: #fdecea; }

/* ======================================================================
   Zone « Nouvelle écriture » du journal : compacte, sans espaces vides
   ====================================================================== */
body.mode-integre .page { padding: 4px 8px 4px; }
body.mode-integre .page-saisie .sous-titre, body.mode-integre .encadre { display: none; }
body.mode-integre .messages { margin: 0 0 4px; }
body.mode-integre .carte { margin-bottom: 6px; }
/* En-tête de l'écriture sur une seule ligne */
body.mode-integre .carte.entete-saisie { padding: 4px 8px 2px; border-left-width: 4px; }
body.mode-integre .entete-grille { grid-template-columns: 128px minmax(180px, 2.4fr) minmax(90px, 1fr) minmax(100px, 1fr) minmax(130px, 1.4fr) 132px auto auto; gap: 0 8px; align-items: end; }
body.mode-integre .entete-grille > .champ { grid-column: auto !important; margin-bottom: 2px; }
body.mode-integre .entete-grille > .champ:has(#date) { order: 1; }
body.mode-integre .entete-grille > .champ:has(#libelle) { order: 2; }
body.mode-integre .entete-grille > .champ:has(#ref_piece) { order: 3; }
body.mode-integre .entete-grille > .champ:has(#num_cheque) { order: 4; }
body.mode-integre .entete-grille > .champ:has(#nom_prenom) { order: 5; }
body.mode-integre .entete-grille > .champ:has(#date_od) { order: 6; }
body.mode-integre .entete-grille > .champ:has(#est_avance) { order: 7; }
body.mode-integre .entete-grille > .champ.champ-multi { order: 8; }
body.mode-integre .entete-grille label { font-size: .74rem; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mode-integre .entete-grille input, body.mode-integre .entete-grille select { padding: 3px 6px; font-size: .88rem; }
body.mode-integre .entete-grille .champ.case { padding-top: 0 !important; align-self: center; }
body.mode-integre .entete-grille .champ.case label { font-size: .76rem; white-space: normal; line-height: 1.1; max-width: 110px; }
body.mode-integre .entete-saisie details { display: none; }
/* Grille des lignes */
body.mode-integre .grille-saisie th { padding: 3px 6px; font-size: .76rem; }
body.mode-integre .grille-saisie td { padding: 1px 4px; }
body.mode-integre .grille-saisie input, body.mode-integre .grille-saisie select { padding: 2px 6px; font-size: .88rem; height: 26px; }
body.mode-integre .grille-saisie .raccourcis { display: none; }
body.mode-integre .grille-saisie tfoot td { padding: 2px 6px; }
body.mode-integre .aide-calcul:empty { display: none; }
body.mode-integre .alerte-budget { margin: 0 0 4px; padding: 4px 10px; font-size: .82rem; }
/* Pièces et boutons sur une seule ligne */
body.mode-integre .carte.zone-actions { padding: 4px 8px; }
body.mode-integre .zone-actions > .grille { align-items: center !important; gap: 8px; }
body.mode-integre .zone-pieces { padding: 0; border: 0; background: transparent; }
body.mode-integre .zp-tete { display: none; }
body.mode-integre .zp-depot { padding: 3px 8px; display: flex; gap: 8px; align-items: center; justify-content: flex-start; border-width: 1px; }
body.mode-integre .zp-texte { margin: 0; font-size: .78rem; }
body.mode-integre .zp-depot .muet { display: none; }
body.mode-integre .zp-boutons { margin: 0; }
body.mode-integre .zp-boutons .btn { padding: 2px 8px; font-size: .78rem; }
body.mode-integre .zp-liste { margin-top: 3px; }
body.mode-integre .zone-actions .actions .btn { padding: 4px 12px; }
/* Le tiroir prend la hauteur de son contenu */
.tiroir-saisie.ajuste { height: auto; }
.tiroir-saisie.ajuste iframe { flex: none; }

/* --- Version 3.7 : accueil épuré, journaux plus serrés ------------------- */
.accueil { display: flex; flex-direction: column; gap: 34px; }
.accueil .hero-accueil { height: clamp(320px, calc(100vh - 330px), 520px); }
.tuiles-accueil { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }
.tuile { width: 210px; padding: 24px 16px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--m-ligne); border-radius: 16px; text-decoration: none; color: var(--m-fonce);
  box-shadow: 0 2px 6px rgba(15, 69, 39, .06), 0 10px 24px rgba(15, 69, 39, .06);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.tuile:hover, .tuile:focus-visible { transform: translateY(-3px); border-color: var(--m-ciel); text-decoration: none;
  box-shadow: 0 4px 10px rgba(15, 69, 39, .08), 0 16px 34px rgba(15, 69, 39, .12); }
.tuile-icone { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--m-vif), var(--m)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.tuile-nom { font-size: 1.12rem; font-weight: 600; letter-spacing: .01em; }
@media (prefers-reduced-motion: reduce) { .tuile { transition: none; } .tuile:hover { transform: none; } }

/* Journaux : moins d'espace */
.page:has(> .entete-journal) { padding-top: 8px; }
.entete-journal { padding: 6px 140px 6px 14px; margin-bottom: 8px; align-items: center; gap: 4px 16px; }
.entete-journal h1 { font-size: 1.18rem; margin: 0; line-height: 1.3; }
.entete-journal .sous-titre { margin: 0; font-size: .82rem; display: inline; }
.entete-journal .mode-od { display: inline-flex; margin: 0 0 0 12px; gap: 6px; }
.entete-journal .mode-od label { padding: 0 8px; font-size: .8rem; }
.entete-journal .actions .btn { padding: 5px 12px; }
.page:has(> .entete-journal) .onglets { margin-bottom: 8px; }
.page:has(> .entete-journal) .onglets a { padding: 4px 14px; font-size: .88rem; }
.page:has(> .entete-journal) .filtres.bandeau-vert { padding: 5px 10px; margin-bottom: 8px; gap: 8px; align-items: center; }
.page:has(> .entete-journal) .filtres .champ { display: flex; align-items: center; gap: 6px; }
.page:has(> .entete-journal) .filtres label { margin: 0; font-size: .8rem; white-space: nowrap; }
.page:has(> .entete-journal) .filtres input, .page:has(> .entete-journal) .filtres select { padding: 3px 8px; min-width: 0; font-size: .86rem; }
.page:has(> .entete-journal) .filtres .btn { padding: 4px 12px; }
.page:has(> .entete-journal) .solde-fige { margin-bottom: 8px; }
.page:has(> .entete-journal) .solde-fige .bloc { padding: 3px 14px; }
.page:has(> .entete-journal) .solde-fige .bloc .lib { font-size: .66rem; }
.page:has(> .entete-journal) .solde-fige .bloc .val { font-size: .95rem; }
.page:has(> .entete-journal) .solde-fige .bloc.principal .val { font-size: 1.1rem; }
table.journal th { padding: 4px 6px; font-size: .78rem; line-height: 1.2; }
table.journal td { padding: 3px 6px; font-size: .86rem; line-height: 1.3; }
table.journal td.col-lib { min-width: 240px; }
table.journal td.col-actions { width: auto; }
table.journal .pile { flex-wrap: nowrap; gap: 3px; }
table.journal .pile .btn.mini { padding: 1px 7px; font-size: .78rem; white-space: nowrap; }
table.journal td .badge { font-size: .7rem; padding: 0 6px; }
table.journal td.mono, table.journal td .mono { font-size: .8rem; }
table.journal td.col-four { min-width: 130px; }
table.journal td.col-actions { width: 150px; }
table.journal .pile { flex-wrap: wrap; }
table.journal td.col-cg { white-space: nowrap; }
table.journal td.mono { word-break: break-all; min-width: 72px; }
table.journal .auto-cp { font-family: inherit; font-size: .66rem; color: #4d8a63; background: #e3f4ea; border-radius: 6px; padding: 0 4px; }
table.journal td.col-ref { min-width: 60px; }
.page:has(> .entete-journal) .totaux div { padding: 4px 12px; }
.page:has(> .entete-journal) .totaux .lib { font-size: .66rem; }
.page:has(> .entete-journal) .totaux .val { font-size: .95rem; }

/* --- Version 3.8 : pied du journal avec « Fermer » ----------------------- */
.pied-journal { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.pied-journal form { margin: 0; }
.pied-journal .sep { flex: 1; }
.btn.fermer-journal { border-color: #e3b4b0; color: #a3261e; background: #fff; font-weight: 600; }
.btn.fermer-journal:hover { background: #fdecea; }
.boite-fermeture { max-width: 560px; border: 1px solid #e3b4b0; border-top: 5px solid #c0392b; border-radius: 12px; padding: 18px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.boite-fermeture::backdrop { background: rgba(10, 30, 20, .45); }
.boite-fermeture h3 { margin: 0 0 10px; color: #a3261e; font-size: 1.05rem; }
.boite-fermeture ul { margin: 4px 0 10px; padding-left: 20px; max-height: 220px; overflow: auto; }
.boite-fermeture .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
table.journal td.mono .petit { word-break: normal; white-space: nowrap; }
/* v3.9 : barre figée — boutons à gauche, soldes à droite */
.solde-fige .nav-fige { padding: 4px 10px; gap: 6px; }
.solde-fige .nav-fige .btn.primaire { padding: 4px 12px; font-size: .86rem; }
.solde-fige .sep ~ .bloc { border-right: 0; border-left: 1px solid #e6efe9; }
.solde-fige .sep ~ .bloc:last-child { border-radius: 0 7px 7px 0; }

/* --- v4.0 : boutons de retenues dans la saisie ------------------------ */
.barre-retenues { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-left: 10px; vertical-align: middle; }
.barre-retenues .btn-retenue { background: #fff7e6; border-color: #f0d49a; color: #6b4300; font-weight: 600; }
.barre-retenues .btn-retenue:hover { background: #ffefcc; }
.pop-retenue { position: fixed; z-index: 120; background: #fff; border: 1px solid #e6c47a; border-top: 4px solid #d99a1e; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 10px 12px; min-width: 280px; max-width: 380px; }
.pop-retenue .pr-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #6b4300; }
.pop-retenue .pr-tete .sep { flex: 1; }
.pop-retenue .pr-fermer { border: 0; background: none; cursor: pointer; font-size: 14px; color: #8a6d3b; }
.pop-retenue .pr-taux { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.pop-retenue .puce { border-radius: 999px; padding: 2px 10px; background: #fff7e6; border-color: #f0d49a; }
.pop-retenue .puce:hover { background: #d99a1e; color: #fff; }
.pop-retenue .pr-ligne { display: flex; gap: 8px; align-items: center; }
.pop-retenue .pr-ligne input { width: 64px; padding: 3px 6px; text-align: right; }
.pop-retenue .pr-calcul { margin-top: 6px; color: #555; }
.pop-retenue .pr-calcul.ko { color: #b42318; }
tr.retenue-ajoutee td { animation: flash-retenue 1.4s ease; }
@keyframes flash-retenue { from { background: #ffe8b0; } to { background: transparent; } }

/* --- v4.0 : exercices et clôture ---------------------------------------- */
.tableau-exercices tr.courant td { background: var(--m-pale); }
.boite-cloture { max-width: 620px; border: 1px solid #cfe9d8; border-top: 5px solid var(--vert-vif, #2e9d5b); border-radius: 12px; padding: 18px 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.boite-cloture::backdrop { background: rgba(10, 30, 20, .45); }
.boite-cloture h3 { margin: 0 0 8px; color: #0f4527; }
.boite-cloture .choix { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #d7ebe0; border-radius: 8px; margin: 8px 0; cursor: pointer; }
.boite-cloture .choix:has(input:checked) { border-color: #2e9d5b; background: #f1faf4; }
.boite-cloture .choix input, .boite-cloture .case-ligne input { width: auto; margin-top: 3px; }
.boite-cloture .case-ligne { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-weight: 500; }
.boite-cloture .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.grille-mois { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.grille-mois form { margin: 0; }
.mois-tuile { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--m-ligne); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; }
.mois-tuile:hover:not(:disabled) { border-color: var(--m-ciel); background: var(--m-pale); }
.mois-tuile .mt-nom { font-weight: 600; color: var(--m-fonce); }
.mois-tuile .mt-etat { font-size: .78rem; color: var(--m); }
.mois-tuile.clos { background: #f3f4f6; border-color: #d1d5db; }
.mois-tuile.clos .mt-etat { color: #6b7280; }
.mois-tuile:disabled { cursor: default; opacity: .8; }
@media (max-width: 900px) { .grille-mois { grid-template-columns: repeat(3, 1fr); } }
.table-ef tr.ef-t td { background: #e8f4fa; font-weight: 700; }
.table-ef tr.ef-g td { font-weight: 700; }
.table-ef tr.ef-s td { background: var(--m-pale); }
.table-ef td:first-child { width: 42px; text-align: center; font-weight: 600; color: var(--m-fonce); }

/* --- v4.1 : virements et DAP --------------------------------------------- */
.vir-grille { grid-template-columns: 170px 1fr 1fr 150px 160px; }
.vir-grille .span3 { grid-column: span 3; } .vir-grille .span2 { grid-column: span 2; }
.choix-type { display: flex; gap: 12px; padding-top: 6px; } .choix-type label { display: flex; gap: 5px; align-items: center; font-weight: 600; }
.choix-type input { width: auto; }
#form-vir.mode-dap .col-vir { display: none; }
#table-benef .b-etat .ok { color: #1e7b45; font-weight: 600; } #table-benef .b-etat .ko { color: #b42318; }
#table-benef input[readonly] { background: var(--m-pale); color: var(--m-fonce); }
.pastille-couleur { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid rgba(0,0,0,.15); }

/* --- Version 4.1 : accueil (paysage, 4 cases, tableau blanc) et bibliothèque --- */
.accueil-v41 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: stretch; }
.accueil-v41 .accueil-gauche { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.accueil-v41 .hero-accueil { height: clamp(280px, calc(100vh - 300px), 500px); box-shadow: 0 10px 30px rgba(10, 50, 100, .18); }
.accueil-v41 .hero-photo { object-position: 50% 55%; }
.accueil-v41 .tuiles-accueil { gap: 16px; flex-wrap: nowrap; }
.accueil-v41 .tuile { width: auto; flex: 1 1 0; max-width: 190px; padding: 12px 10px 11px; gap: 8px; border-radius: 12px; }
.accueil-v41 .tuile-icone { width: 44px; height: 44px; }
.accueil-v41 .tuile-nom { font-size: .9rem; text-align: center; line-height: 1.2; }
.tuile:nth-child(2) .tuile-icone { background: linear-gradient(145deg, #3b82c4, #1d5a93); }
.tuile:nth-child(3) .tuile-icone { background: linear-gradient(145deg, #e39a2d, #b46d0c); }
.tuile:nth-child(4) .tuile-icone { background: linear-gradient(145deg, #8b5cc4, #5e3a96); }

/* Tableau blanc */
.tableau-blanc { position: relative; min-height: 420px; }
.tb-cadre { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 9px 9px 0;
  border-radius: 10px; background: linear-gradient(180deg, #e9edf1, #c3cad2 50%, #dde2e7);
  box-shadow: 0 1px 0 #fff inset, 0 10px 24px rgba(20, 40, 60, .18), 0 0 0 1px #aab3bd; }
.tb-surface { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 4px; padding: 12px 12px 8px;
  background: radial-gradient(120% 80% at 20% 0%, #ffffff 0%, #fbfcfd 55%, #f2f5f8 100%);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .14); }
.tb-entete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tb-entete h2 { margin: 0; padding: 0; border: 0; font-size: 1.22rem; color: #1d4f91;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; letter-spacing: .01em; }
.tb-direct { font-size: .72rem; color: var(--m); font-weight: 600; white-space: nowrap; }
.tb-direct.hors { color: #b42318; }
.tb-recherche { display: flex; align-items: center; gap: 6px; border: 1px solid #d3dae2; border-radius: 999px;
  padding: 3px 10px; background: #fff; color: #6b7a89; margin-bottom: 8px; }
.tb-recherche:focus-within { border-color: #6aa0d8; box-shadow: 0 0 0 3px rgba(59, 130, 196, .15); }
.tb-recherche input { border: 0; outline: 0; padding: 3px 0; font-size: .84rem; width: 100%; background: transparent; box-shadow: none; }
.tb-liste { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.tb-vide { color: #7a8794; font-style: italic; font-size: .88rem; text-align: center; margin: 30px 0; }
.tb-jour { position: sticky; top: 0; z-index: 1; background: #f8fafc; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #6b7a89; padding: 4px 2px 3px; border-bottom: 1px dashed #d5dce3; }
.tb-op { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 6px 4px 6px 2px;
  border-bottom: 1px solid #eef1f4; color: #1f2d3a; text-decoration: none; border-left: 3px solid transparent; }
.tb-op:hover { background: #f1f6fc; text-decoration: none; }
.tb-heure { font-variant-numeric: tabular-nums; font-size: .78rem; color: #6b7a89; padding-top: 1px; }
.tb-corps { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tb-ligne1 { font-size: .8rem; line-height: 1.3; }
.tb-ligne1 b { color: #1d4f91; font-weight: 600; }
.tb-num { font-family: ui-monospace, Consolas, monospace; font-size: .76rem; white-space: nowrap; }
.tb-libelle { font-size: .82rem; color: #33424f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-montant { font-variant-numeric: tabular-nums; font-size: .8rem; font-weight: 600; white-space: nowrap; color: var(--m-fonce); padding-top: 1px; }
.tb-ecriture { border-left-color: #3b82c4; }
.tb-virement { border-left-color: var(--m); }
.tb-dap { border-left-color: #e39a2d; }
.tb-rapport { border-left-color: #c0392b; }
.tb-brouillard { font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; color: #9a6700; background: #fff4d6;
  border-radius: 3px; padding: 0 4px; }
.tb-neuf { animation: tb-arrivee 2.4s ease-out; }
@keyframes tb-arrivee { 0% { background: #fff3b0; transform: translateX(-8px); opacity: 0; } 15% { transform: none; opacity: 1; } 100% { background: transparent; } }
.tb-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; font-size: .72rem; color: #7a8794; }
.tb-defil { border: 1px solid #d3dae2; background: #fff; border-radius: 999px; font-size: .72rem; padding: 2px 9px; cursor: pointer; color: #44535f; }
.tb-defil:hover { border-color: #6aa0d8; }
.tb-auget { position: relative; height: 16px; margin: 0 -9px; border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #b7bfc8, #e6eaee 40%, #9aa4ae); display: flex; align-items: center; gap: 10px; padding-left: 26px; }
.tb-auget i { display: block; width: 42px; height: 7px; border-radius: 4px 2px 2px 4px; background: #333; box-shadow: 0 1px 1px rgba(0, 0, 0, .3); }
.tb-auget i::after { content: ""; display: block; width: 12px; height: 7px; margin-left: 30px; border-radius: 1px 4px 4px 1px; background: rgba(255, 255, 255, .35); }
.tb-auget .m-bleu { background: #2463b8; } .tb-auget .m-rouge { background: #c0392b; } .tb-auget .m-vert { background: var(--m); }
.tb-auget b { display: block; width: 46px; height: 10px; margin-left: auto; margin-right: 26px; border-radius: 3px; background: linear-gradient(#5b6670 0 45%, #f4f4f4 45%); }
@media (max-width: 1100px) { .accueil-v41 { grid-template-columns: 1fr; } .tableau-blanc { min-height: 460px; } }
@media (max-width: 700px) { .accueil-v41 .tuiles-accueil { flex-wrap: wrap; } .accueil-v41 .tuile { flex-basis: 40%; } }
@media (prefers-reduced-motion: reduce) { .tb-neuf { animation: none; } }

/* Bibliothèque des pièces */
.biblio-choix { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.biblio-choix label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: #44535f; }
.biblio-choix select { min-width: 280px; }
.etageres { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 12px 0 6px; }
.etagere { position: relative; display: flex; flex-direction: column; gap: 0; padding: 6px 8px 7px; font-size: .88rem; border-radius: 8px;
  text-decoration: none; color: var(--m-fonce); background: linear-gradient(180deg, #fff, var(--m-pale)); border: 1px solid var(--m-ligne);
  box-shadow: 0 3px 0 #c9a97a, 0 4px 0 #a88655; }
.etagere:hover { border-color: var(--m-ciel); text-decoration: none; background: var(--m-pale); }
.etagere.actif { background: var(--m); color: #fff; border-color: var(--m); }
.etagere .et-mois { font-weight: 700; }
.etagere .et-n { font-size: .78rem; color: var(--m); }
.etagere.actif .et-n { color: var(--m-clair); }
.etagere.vide { opacity: .65; }
.biblio-op { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--m-clair); }
.biblio-num { text-align: center; background: var(--m-pale); border-radius: 10px; padding: 8px 4px; align-self: start; }
.biblio-num b { display: block; font-size: 1.25rem; color: var(--m); font-variant-numeric: tabular-nums; }
.biblio-num span { font-size: .7rem; color: #5b6b62; font-family: ui-monospace, Consolas, monospace; }
.biblio-tete { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 8px; }
.biblio-tete .lib { font-weight: 600; color: #12324a; }
.biblio-tete .mt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.biblio-tete .mt.sortie { color: #b42318; } .biblio-tete .mt.entree { color: #1f8a46; }
.biblio-pieces { display: flex; flex-wrap: wrap; gap: 10px; }
.vignette { width: 116px; display: flex; flex-direction: column; border: 1px solid #d7e0e8; border-radius: 8px; overflow: hidden;
  background: #fff; cursor: zoom-in; padding: 0; text-align: left; font: inherit; color: inherit; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.vignette:hover { border-color: #6aa0d8; box-shadow: 0 4px 12px rgba(29, 79, 145, .15); }
.vignette .v-img { height: 128px; background: #f3f5f7 center/cover no-repeat; display: grid; place-items: center; color: #b42318; font-weight: 800; font-size: 1.1rem; }
.vignette .v-img.pdf { background: linear-gradient(160deg, #fff 0 70%, #fde8e6); }
.vignette .v-nom { font-size: .72rem; padding: 4px 6px 5px; line-height: 1.25; }
.vignette .v-nom b { display: block; font-family: ui-monospace, Consolas, monospace; color: var(--m); }
.v-nom .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #44535f; }
.biblio-sans { color: #b42318; font-size: .85rem; font-style: italic; }
dialog.visionneuse { width: min(1100px, 96vw); height: 92vh; padding: 0; border: 0; border-radius: 12px; overflow: hidden; }
dialog.visionneuse::backdrop { background: rgba(10, 20, 30, .72); }
.vis-barre { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #12324a; color: #fff; }
.vis-barre .vis-titre { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.vis-barre button, .vis-barre a { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: .85rem; text-decoration: none; }
.vis-barre button:hover, .vis-barre a:hover { background: rgba(255, 255, 255, .25); }
.vis-corps { height: calc(92vh - 44px); background: #2a3640; display: grid; place-items: center; }
.vis-corps img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.vis-corps iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* Travaux de fin d'exercice */
.points-controle { display: flex; flex-direction: column; gap: 6px; }
.point-controle { border: 1px solid var(--m-clair); border-radius: 8px; padding: 7px 10px; background: #fff; }
.point-controle summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.point-controle summary::-webkit-details-marker { display: none; }
.pc-icone { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; flex: none; }
.pc-ok .pc-icone { background: #1f8a46; } .pc-alerte .pc-icone { background: #d97706; } .pc-info .pc-icone { background: #3b82c4; }
.pc-alerte { border-color: #f3d19c; background: #fffaf0; }
.point-controle table { margin-top: 8px; }
table.compact td { padding: 3px 8px; font-size: .85rem; }
.barre-carte { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 10px 12px; }
.barre-carte h3 { margin: 0; }
.barre-carte .btn { margin-left: auto; }
.action-inventaire { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 12px; }
.grille-inventaire { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.grille-inventaire .champ { display: flex; flex-direction: column; gap: 3px; margin-bottom: 9px; }
.grille-inventaire .champ label { font-size: .82rem; color: #44535f; }
.gros-chiffre { font-size: 1.6rem; font-weight: 800; color: var(--m); margin: 6px 0; }
.gros-chiffre.negatif { color: #b42318; }
@media (max-width: 900px) { .grille-inventaire { grid-template-columns: 1fr; } }

.accueil-v41 .hero-photo { object-position: 50% 62%; }
.hero-credit { position: absolute; right: 10px; bottom: 6px; z-index: 2; font-size: .68rem; color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

/* Accueil : photos qui changent à chaque visite ou clic ; leurs couleurs habillent la page */
body.page-accueil { --th-fonce: var(--m-fonce); --th-accent: var(--m); --th-clair: var(--m-pale);
  background: linear-gradient(180deg, var(--th-clair) 0%, #ffffff 75%) fixed; transition: background .8s ease; }
body.page-accueil .entete { background: var(--th-fonce); border-bottom-color: var(--th-accent); transition: background-color .8s ease, border-color .8s ease; }
body.page-accueil .entete .menu-lien.actif { background: color-mix(in srgb, var(--th-accent) 55%, transparent); }
.accueil-v41 .hero-accueil { background: var(--th-fonce); }
.accueil-v41 .hero-photo { opacity: 0; transition: opacity 2s ease-in-out; }
.accueil-v41 .hero-photo.visible { opacity: 1; }
.accueil-v41 .hero-voile { background: linear-gradient(100deg, color-mix(in srgb, var(--th-fonce) 62%, transparent) 0%,
  color-mix(in srgb, var(--th-fonce) 22%, transparent) 40%, transparent 65%); transition: background .8s ease; }
.accueil-v41 .hero-nom span { color: color-mix(in srgb, var(--th-accent) 30%, #ffffff); transition: color .8s ease; }
.accueil-v41 .tuile-icone, .accueil-v41 .tuile:nth-child(n) .tuile-icone {
  background: linear-gradient(145deg, color-mix(in srgb, var(--th-accent) 85%, #ffffff), var(--th-fonce)); transition: background .8s ease; }
.accueil-v41 .tuile { border-color: color-mix(in srgb, var(--th-accent) 22%, #ffffff); color: var(--th-fonce); }
.accueil-v41 .tuile:hover { border-color: var(--th-accent); box-shadow: 0 4px 10px rgba(0, 0, 0, .06), 0 16px 34px color-mix(in srgb, var(--th-accent) 22%, transparent); }
.accueil-v41 .tb-entete h2 { color: var(--th-fonce); transition: color .8s ease; }
.accueil-v41 .tb-ligne1 b { color: var(--th-fonce); }
.hero-nav { position: absolute; left: 14px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, .28); border-radius: 999px; padding: 2px 6px; color: #fff; font-size: .78rem; }
.hero-nav button { background: transparent; border: 0; color: #fff; font-size: 1.15rem; line-height: 1; padding: 2px 6px; cursor: pointer; }
.hero-nav button:hover { color: color-mix(in srgb, var(--th-accent) 30%, #ffffff); }
@media (prefers-reduced-motion: reduce) { .accueil-v41 .hero-photo, body.page-accueil, body.page-accueil .entete { transition: none; } }

.hero-deconnexion { position: absolute; top: 12px; right: 12px; z-index: 3; margin: 0; }
.hero-deconnexion button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(0, 0, 0, .28); color: #fff; border-radius: 999px; padding: 5px 12px; font-size: .82rem; cursor: pointer;
  backdrop-filter: blur(4px); transition: background .2s ease; }
.hero-deconnexion button:hover { background: color-mix(in srgb, var(--th-fonce) 85%, transparent); }
.accueil-v41 .hero-photo.visible { animation: respire 16s ease-in-out infinite alternate; }

/* Suivi des dossiers reçus */
.grille-dossier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.grille-dossier .grille.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.grille-dossier .champ { display: flex; flex-direction: column; gap: 3px; }
.grille-dossier .champ.span2 { grid-column: span 2; }
.grille-dossier .champ label { font-size: .8rem; color: #44535f; }
.titre-bloc { margin: 0 0 10px; color: var(--m); display: flex; gap: 10px; align-items: center; }
.choix-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pastille-type { border: 1px solid #cfe3d7; border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: .85rem; background: #fff; }
.pastille-type:has(input:checked) { background: #1e6b3f; color: #fff; border-color: #1e6b3f; }
.pastille-type input { display: none; }
.bloc-mission { margin: 10px 0; padding: 8px 10px; background: #f4f8fc; border: 1px solid #dbe7f3; border-radius: 8px; }
.bloc-mission h4 { margin: 0 0 6px; font-size: .9rem; color: #1d4f91; }
.table-pieces td { font-size: .82rem; } .table-pieces .centre { text-align: center; width: 54px; }
.petit-champ { width: 100%; font-size: .8rem; padding: 2px 4px; }
.barre-actions-dossier { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 10px 0; background: linear-gradient(transparent, var(--m-pale) 30%); }
.compteurs-dossiers { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.compteurs-dossiers .cd { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--m-ligne); text-decoration: none; color: #12324a; min-width: 130px; }
.compteurs-dossiers .cd b { font-size: 1.3rem; } .compteurs-dossiers .cd span { font-size: .78rem; color: #5b6b62; }
.compteurs-dossiers .attente b { color: #b45309; } .compteurs-dossiers .ok b { color: #1f8a46; } .compteurs-dossiers .alerte b { color: #b42318; }
.ligne-attente td { background: #fffbeb; }
.badge.type-tdr { background: #dbeafe; color: #1d4ed8; } .badge.type-ach { background: var(--m-clair); color: var(--m-fonce); }
.badge.type-fct { background: #fef3c7; color: #92400e; } .badge.type-dao { background: #ede9fe; color: #5b21b6; } .badge.type-liq { background: #fce7f3; color: #9d174d; }
.badge.statut-recu { background: #fff4d6; color: #92400e; } .badge.statut-en_cours { background: #e0f2fe; color: #075985; }
.badge.statut-traite { background: #dcfce7; color: #166534; } .badge.statut-rejete, .badge.statut-annule { background: #f3f4f6; color: #6b7280; }
@media (max-width: 1000px) { .grille-dossier { grid-template-columns: 1fr; } }

/* Tableau de l'accueil : dossiers à traiter, par projet */
.tb-compte { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 999px; background: var(--th-accent, #2e7d32);
  color: #fff; font: 700 .78rem/1.6 "Segoe UI", Arial, sans-serif; text-align: center; vertical-align: middle; }
.tb-compte:empty { display: none; }
.tb-projet { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px 4px 5px; margin-top: 4px;
  background: linear-gradient(#f8fafc 85%, rgba(248, 250, 252, 0)); border-bottom: 1px solid #e3e8ee; }
.tb-projet img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid #e3e8ee; padding: 2px; }
.tb-p-nom { font-weight: 700; color: var(--th-fonce, var(--m-fonce)); font-size: .84rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-p-n { font-size: .72rem; color: #6b7a89; white-space: nowrap; }
.tb-dos { display: flex; flex-direction: column; gap: 1px; padding: 6px 6px 6px 9px; margin: 3px 0 3px 12px; border-radius: 6px;
  border-left: 3px solid #3b82c4; background: #fff; color: #1f2d3a; text-decoration: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.tb-dos:hover { background: #f1f6fc; text-decoration: none; }
.tb-t-ach { border-left-color: var(--m); } .tb-t-fct { border-left-color: #d97706; } .tb-t-dao { border-left-color: #7c3aed; }
.tb-vieux { box-shadow: inset 0 0 0 1px #fca5a5; }
.tb-d-l1 { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.tb-type { font-size: .66rem; font-weight: 700; padding: 0 5px; border-radius: 3px; background: #eef2f7; color: #334155; }
.tb-d-l1 .tb-montant { margin-left: auto; }
.tb-d-l3 { font-size: .72rem; color: #6b7a89; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-d-l3 i { font-style: normal; color: #9a6700; }
.tb-vieux .tb-d-l3 i { color: #b42318; font-weight: 600; }
.tb-ajout { font-size: .72rem; text-decoration: none; padding: 2px 8px; border-radius: 999px; background: var(--th-accent, var(--m)); color: #fff; }
.tb-ajout:hover { text-decoration: none; filter: brightness(1.1); }
.menu > button, .menu-lien { white-space: nowrap; }
@media (max-width: 1500px) { .menu > button, .menu-lien { padding-left: 10px; padding-right: 10px; } .entete .droite { gap: 8px; } }
.table-pieces { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table-pieces th { background: var(--m); color: #fff; font-size: .76rem; font-weight: 600; padding: 5px 6px; text-align: left; }
.table-pieces th:nth-child(1) { width: 30px; } .table-pieces th:nth-child(3), .table-pieces th:nth-child(4), .table-pieces th:nth-child(5) { width: 58px; text-align: center; }
.table-pieces th:nth-child(6) { width: 26%; }
.table-pieces td { border-bottom: 1px solid #eef1f4; padding: 4px 6px; vertical-align: middle; }
.table-pieces tr:hover td { background: var(--m-pale); }
.table-pieces tr[hidden] { display: none; }
.table-pieces input[type=radio] { width: 17px; height: 17px; accent-color: var(--m); }
.table-pieces td:nth-child(4) input[type=radio] { accent-color: #b42318; }

.bouton-son { background: transparent; border: 0; cursor: pointer; font-size: 1rem; padding: 2px 4px; opacity: .85; }
.bouton-son:hover { opacity: 1; }

.choix-base-dar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0 0 10px; font-size: .88rem; }
.choix-base-dar label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.cases-feuilles { display: flex; flex-wrap: wrap; gap: 4px 14px; } .cases-feuilles label { display: inline-flex; gap: 5px; align-items: center; font-size: .88rem; }

/* Messagerie */
.grille-messagerie { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grille-messagerie .champ { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.grille-messagerie .champ label { font-size: .82rem; color: #44535f; }
.grille-messagerie textarea { width: 100%; font: inherit; }
.choix-doc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.choix-doc a { padding: 6px 12px; border: 1px solid var(--m-ligne); border-radius: 999px; text-decoration: none; color: var(--m-fonce); font-size: .88rem; }
.choix-doc a.actif { background: var(--m); color: #fff; border-color: var(--m); }
.liste-pieces { max-height: 230px; overflow-y: auto; border: 1px solid var(--m-clair); border-radius: 8px; padding: 4px; margin-bottom: 10px; }
.piece-choix { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: .86rem; }
.piece-choix:hover { background: #f2f8f4; }
.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.contact { border: 1px solid var(--m-clair); border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: .86rem; }
.contact:has(input:checked) { border-color: var(--m); background: var(--m-pale); }
.actions-envoi { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
@media (max-width: 1000px) { .grille-messagerie { grid-template-columns: 1fr; } }

/* Saisie d'un numéro de compte : 8 cases (chiffres seulement) */
input.saisie-compte { font-family: Consolas, "Courier New", monospace; font-size: 1.1rem; letter-spacing: .6em;
  width: calc(8 * (1ch + .6em) + 1.2em); padding: 6px .6em 8px; text-align: left;
  background-image: repeating-linear-gradient(90deg, var(--m-vif) 0, var(--m-vif) 1ch, transparent 1ch, transparent calc(1ch + .6em));
  background-size: calc(8 * (1ch + .6em) - .6em) 2px; background-repeat: no-repeat; background-position: .6em calc(100% - 5px); }
input.saisie-compte::placeholder { color: var(--m-ciel); letter-spacing: .6em; }

input.saisie-compte.saisie-tiers { width: calc(12 * (1ch + .6em) + 1.2em);
  background-size: calc(11 * (1ch + .6em) - .6em) 2px; }

/* Menu Exercice */
.sous-menu-exercices form { margin: 0; }
.lien-exercice { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 14px; font: inherit;
  color: inherit; cursor: pointer; }
.lien-exercice:hover { background: var(--m-pale); }
.lien-exercice.actuel { font-weight: 700; color: var(--m); }

/* ===== v4.7 ===== */
/* Journal : en-tête figé (code, intitulé, mois) et bouton Fermer toujours visibles */
.solde-fige .ident-journal { display: flex; flex-direction: column; justify-content: center; padding: 6px 14px; border-right: 1px solid #e6efe9;
  background: linear-gradient(90deg, #0f4527, #1e7b4a); color: #fff; border-radius: 3px 0 0 3px; min-width: 150px; max-width: 290px; }
.solde-fige .ij-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 1.08rem; letter-spacing: .03em; }
.solde-fige .ij-nom { font-size: .78rem; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solde-fige .ij-mois { font-size: .78rem; font-weight: 600; color: #c9f1d6; white-space: nowrap; }
.solde-fige .fermer-journal { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 64px; border: 0; border-left: 1px solid #f2c9c6; background: #fff5f4; color: #b3261e; font-size: 1.15rem; font-weight: 700;
  cursor: pointer; border-radius: 0 7px 7px 0; padding: 0 12px; }
.solde-fige .fermer-journal span { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.solde-fige .fermer-journal:hover { background: #fdecea; }
@media print { .solde-fige .ident-journal { background: none; color: inherit; } }
.btn.mini.vert-clair { background: #eef8f1; border-color: #bfe3cb; color: #145c32; }

/* Pièces jointes d'une écriture : visionneuse */
.btn-voir-pieces { background: #eef6ff; border-color: #c4dcf5; color: #17497a; }
dialog.dlg-pieces { width: min(1180px, 96vw); height: min(86vh, 900px); padding: 0; border: 2px solid var(--m-vif); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(11, 58, 91, .35); display: none; flex-direction: column; overflow: hidden; }
dialog.dlg-pieces[open] { display: flex; }
dialog.dlg-pieces::backdrop { background: rgba(11, 58, 91, .45); }
.dp-tete { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: linear-gradient(90deg, var(--m-fonce), var(--m)); color: #fff; }
.dp-tete .sep { flex: 1; }
.dp-tete button { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.dp-tete #dp-fermer { background: #fdecea; color: #b3261e; border-color: #f2c9c6; font-weight: 700; }
.dp-corps { flex: 1; display: grid; grid-template-columns: 330px 1fr; min-height: 0; }
.dp-liste { list-style: none; margin: 0; padding: 8px; overflow-y: auto; border-right: 1px solid var(--m-clair); background: var(--m-pale); }
.dp-liste li { border: 1px solid var(--m-ligne); border-radius: 8px; background: #fff; padding: 7px 8px; margin-bottom: 7px; display: flex; flex-direction: column; gap: 4px; }
.dp-liste li.actif { border-color: var(--m-vif); box-shadow: 0 0 0 2px var(--m-ligne); }
.dp-liste .pj-voir { text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--m-fonce); word-break: break-word; }
.dp-liste .pj-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dp-vue { display: grid; place-items: center; background: #3a4048; min-height: 0; overflow: auto; }
.dp-vue img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.dp-vue iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.dp-vue .muet { color: #dfe6ea; }
@media (max-width: 800px) { .dp-corps { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .dp-liste { max-height: 30vh; } }

/* Structure › Codes budget : chargement Excel */
.charger-budget { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.6fr); gap: 18px; margin-bottom: 14px; }
.charger-budget .cb-etape { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.charger-budget .cb-etape > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.charger-budget .cb-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--m); color: #fff; display: grid; place-items: center; font-weight: 700; }
.charger-budget .cb-champs { flex: 1; }
.charger-budget .cb-ligne { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; width: 100%; }
.charger-budget .cb-ligne .champ { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: #44535f; margin: 0; }
.charger-budget .cb-ligne select { min-width: 260px; }
@media (max-width: 900px) { .charger-budget { grid-template-columns: 1fr; } }

/* Messagerie compacte */
.msg-entete { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; }
.msg-entete h1 { margin: 0; font-size: 1.3rem; }
.msg-onglets { display: flex; gap: 4px; flex: 1; }
.msg-onglets a { padding: 5px 12px; border: 1px solid var(--m-ligne); border-radius: 999px; font-size: .86rem; color: var(--m-fonce); text-decoration: none; background: #fff; }
.msg-onglets a.actif { background: var(--m); color: #fff; border-color: var(--m); }
.msg-boite { max-width: 1060px; }
.msg-nouveau { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; padding: 12px 14px; }
.msg-nouveau .mn-titre { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #5b6b76; margin-bottom: 6px; }
.msg-nouveau .mn-doc { display: flex; flex-direction: column; gap: 7px; border-right: 1px solid var(--m-clair); padding-right: 14px; }
.msg-nouveau .choix-doc { margin: 0; gap: 4px; }
.msg-nouveau .choix-doc a { padding: 3px 9px; font-size: .78rem; }
.msg-nouveau select, .msg-nouveau .mn-cherche input { width: 100%; font-size: .86rem; }
.msg-nouveau .mn-cherche { display: flex; gap: 4px; }
.msg-nouveau .liste-pieces { max-height: 150px; margin: 0; font-size: .82rem; }
.msg-nouveau .mn-format { display: flex; gap: 10px; align-items: center; font-size: .86rem; }
.msg-nouveau .mn-format button { margin-left: auto; }
.msg-nouveau .mn-message { display: flex; flex-direction: column; gap: 6px; }
.msg-nouveau .contacts { display: flex; flex-wrap: wrap; gap: 4px; }
.msg-nouveau .contact { padding: 2px 8px; border-radius: 999px; font-size: .8rem; }
.msg-nouveau .mn-ligne { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 6px; }
.msg-nouveau .mn-ligne label { font-size: .8rem; color: #5b6b76; text-align: right; }
.msg-nouveau .mn-ligne input { width: 100%; padding: 4px 8px; }
.msg-nouveau textarea { width: 100%; font: inherit; font-size: .9rem; resize: vertical; }
.msg-nouveau .actions-envoi { align-items: center; gap: 8px; margin: 0; }
@media (max-width: 860px) { .msg-nouveau { grid-template-columns: 1fr; } .msg-nouveau .mn-doc { border-right: 0; padding-right: 0; } }
table.compact td, table.compact th { padding: 4px 8px; }
.msg-recus { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; border: 1px solid #dfe9e3; border-radius: 10px; background: #fff;
  height: calc(100vh - 190px); min-height: 380px; overflow: hidden; }
.msg-liste { display: flex; flex-direction: column; border-right: 1px solid var(--m-clair); min-height: 0; }
.msg-cherche { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--m-clair); background: var(--m-pale); }
.msg-cherche input { flex: 1; min-width: 0; padding: 3px 8px; }
.msg-liste ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.msg-liste li a { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; padding: 7px 10px; border-bottom: 1px solid var(--m-clair); color: #33424d; text-decoration: none; font-size: .84rem; }
.msg-liste li a:hover { background: var(--m-pale); }
.msg-liste li.actif a { background: var(--m-clair); box-shadow: inset 3px 0 0 var(--m); }
.msg-liste li.non-lu .ml-de, .msg-liste li.non-lu .ml-objet { font-weight: 700; color: var(--m-fonce); }
.msg-liste .ml-date { font-size: .74rem; color: #7a8a94; white-space: nowrap; }
.msg-liste .ml-objet { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #5b6b76; }
.msg-lecture { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 12px 16px; }
.msg-lecture .ml-tete h3 { margin: 0 0 4px; }
.msg-lecture .ml-actions, .msg-lecture .ml-pieces { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.msg-lecture .ml-texte { white-space: pre-wrap; font: inherit; font-size: .92rem; background: var(--m-pale); border: 1px solid var(--m-clair); border-radius: 8px; padding: 10px 12px; margin: 0; }
.msg-lecture .ml-html { flex: 1; min-height: 340px; width: 100%; border: 1px solid var(--m-clair); border-radius: 8px; background: #fff; }
.msg-vide { padding: 30px 16px; text-align: center; color: #7a8a94; }
@media (max-width: 860px) { .msg-recus { grid-template-columns: 1fr; height: auto; } .msg-liste ul { max-height: 40vh; } }

/* Notifications système */
.tuile-notif { position: relative; }
.notif-pastille { position: absolute; top: 6px; right: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e08a00; color: #fff;
  font-size: .78rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.notif-pastille.urgent { background: #c62828; animation: notif-pouls 2s ease-in-out infinite; }
@keyframes notif-pouls { 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(198, 40, 40, .2); } }
@media (prefers-reduced-motion: reduce) { .notif-pastille.urgent { animation: none; } }
.notif-resume { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.notif-puce { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .84rem; text-decoration: none; border: 1px solid; }
.notif-puce.rouge { background: #fdecea; border-color: #f2c9c6; color: #8e1c16; }
.notif-puce.orange { background: #fff4e0; border-color: #f3d9a8; color: #7a4a00; }
.notif-puce.bleu { background: #eef6ff; border-color: #c4dcf5; color: #17497a; }
.notif-groupes { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; align-items: start; }
.notif-groupe { margin: 0; border-left: 5px solid; }
.notif-groupe.rouge { border-left-color: #c62828; } .notif-groupe.orange { border-left-color: #e08a00; } .notif-groupe.bleu { border-left-color: #2f6fb0; }
.notif-groupe h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 1rem; }
.notif-groupe ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.notif-groupe li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--m-clair); }
.notif-groupe li a { font-weight: 600; }
.notif-rien { display: flex; gap: 14px; align-items: center; max-width: 640px; }
.notif-rien > span { font-size: 2rem; color: var(--m); }
@media (max-width: 520px) { .notif-groupes { grid-template-columns: 1fr; } }

/* v4.8 : bouton « Liquidé » des avances mission */
.liquider-pop { position: relative; display: inline-block; }
.liquider-pop > summary { list-style: none; cursor: pointer; }
.liquider-pop > summary::-webkit-details-marker { display: none; }
.liquider-pop[open] > form { position: absolute; right: 0; top: 110%; z-index: 20; width: 260px; background: #fff; border: 1px solid #cfe9d8;
  border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 61, 36, .2); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; white-space: normal; }
.liquider-pop label { display: flex; flex-direction: column; font-size: .8rem; color: #44535f; gap: 2px; }

/* v4.8 : saisie automatique des salaires */
.btn-auto, .champ-auto .btn-auto { background: #fff7e0; border-color: #f0d48a; color: #6b4a00; font-weight: 600; white-space: nowrap; }
dialog.dlg-salaires { width: min(620px, 94vw); padding: 0; border: 2px solid var(--m-vif); border-radius: 12px; box-shadow: 0 18px 50px rgba(11, 58, 91, .35); }
dialog.dlg-salaires::backdrop { background: rgba(11, 58, 91, .4); }
.dlg-salaires .ds-tete { display: flex; align-items: center; padding: 9px 12px; background: linear-gradient(90deg, var(--m-fonce), var(--m)); color: #fff; }
.dlg-salaires .ds-tete .sep, .dlg-salaires .ds-pied .sep { flex: 1; }
.dlg-salaires .ds-fermer { background: #fdecea; color: #b3261e; border: 1px solid #f2c9c6; border-radius: 6px; padding: 2px 9px; cursor: pointer; font-weight: 700; }
.dlg-salaires .ds-corps { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.dlg-salaires .ds-etape { display: flex; gap: 10px; align-items: flex-start; }
.dlg-salaires .ds-etape label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.dlg-salaires .cb-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--m); color: #fff; display: grid; place-items: center; font-weight: 700; }
.dlg-salaires .ds-pied { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--m-clair); background: var(--m-pale); }
.dlg-retenues { width: min(880px, 96vw) !important; }
.dlg-retenues .ds-ligne { display: flex; gap: 16px; flex-wrap: wrap; }
.dlg-retenues .ds-ligne label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.dlg-retenues .ret-apercu { max-height: 46vh; overflow: auto; border: 1px solid var(--m-clair); border-radius: 8px; padding: 6px; }
.dlg-retenues .ret-apercu table { width: 100%; }
body.mode-integre .champ-auto { display: none; }  /* dans le tiroir du journal : boutons dans la barre figée */

/* v4.10 : verrou des journaux */
.journal-occupe { display: flex; gap: 22px; align-items: flex-start; max-width: 780px; margin: 30px auto; padding: 26px 28px; border-left: 5px solid #e08a00; }
.journal-occupe h1 { margin: 0 0 8px; border: 0; padding: 0; }
.jo-cadenas { font-size: 3rem; line-height: 1; }
.badge-occupe { display: inline-block; font-size: .72rem; padding: 0 7px; border-radius: 999px; background: #fff4e0; color: #7a4a00; border: 1px solid #f3d9a8; white-space: nowrap; }
.verrou-perdu { position: fixed; left: 50%; transform: translateX(-50%); top: 60px; z-index: 90; background: #fdecea; color: #8e1c16; border: 1px solid #f2c9c6;
  border-radius: 8px; padding: 8px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.15); font-weight: 600; }

/* Montants négatifs (soldes de banque créditeurs…) en rouge */
td.negatif { color: var(--rouge, #b42318); font-weight: 600; }
/* Finitions : survol des lignes de tableaux */
table:not(.journal) tbody tr:hover > td { background: color-mix(in srgb, #1e78c8 5%, transparent); }

/* Comptes › Relevés PDF → Excel */
.releve-depot { display: flex; flex-direction: column; gap: 10px; }
.zone-depot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border: 2px dashed var(--m-ligne); border-radius: 10px;
  background: var(--m-pale); cursor: pointer; transition: background .15s, border-color .15s; }
.zone-depot:hover, .zone-depot.survol { background: var(--m-clair); border-color: var(--m); }
.zone-depot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zone-depot .zd-icone { font-size: 1.8rem; }
.zone-depot .zd-liste { flex-basis: 100%; color: var(--m); font-weight: 600; }
.zone-depot .zd-liste:empty { display: none; }
.rd-options { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rd-options .btn { margin-left: auto; }
form.en-ligne { display: inline; margin: 0; }
.barre-prog { width: 140px; height: 8px; border-radius: 4px; background: var(--m-clair); overflow: hidden; }
.barre-prog span { display: block; height: 100%; background: var(--m); transition: width .6s; }
.alerte-texte { color: #b42318; font-weight: 600; }
.ok-texte { color: var(--vert); font-weight: 600; }
.rl-compte { padding: 3px 0; border-bottom: 1px dotted var(--m-ligne); }
.rl-compte:last-of-type { border-bottom: 0; }
tr.ligne-erreur td { background: #fff6f5; }
.aide-releves summary { cursor: pointer; font-weight: 600; }
.barre-prog.arretee span { background: #9aa9a0; }

/* Rapprochement bancaire */
.rb-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.rb-kpis .kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; }
.rb-kpis .kpi .lib { font-size: .78rem; color: #5b6b62; }
.rb-kpis .kpi .val { font-size: 1.15rem; font-weight: 700; }
.rb-kpis .rb-ok { border-left: 4px solid var(--vert); } .rb-kpis .rb-ok .val { color: var(--vert); }
.rb-kpis .rb-ko { border-left: 4px solid #b42318; } .rb-kpis .rb-ko .val { color: #b42318; }
.rb-releve, .rb-attente, .rb-reprise { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-bottom: 10px; }
.rb-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.rb-radio { display: block; margin: 4px 0; }
.rb-outils { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.rb-outils input[type=search] { width: 320px; }
.rb-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.rb-cote { min-width: 0; }
.rb-tete { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--m-clair); }
.rb-defile { max-height: calc(100vh - 330px); overflow: auto; }
.rb-table th { position: sticky; top: 0; z-index: 1; }
.rb-table td.rb-lib { min-width: 180px; }
.rb-table tr.rb-ligne { cursor: pointer; }
.rb-table tr.rb-ligne:has(input:checked) td { background: #dbeafe !important; }
.rb-table tr.pointee td { color: #6b7a71; background: var(--m-pale); }
.rb-table tr.instance td:first-child { box-shadow: inset 3px 0 0 #e5a400; }
.rb-table tr.candidat td { background: #fff7c2 !important; }
.rb-j { display: block; font-size: .68rem; color: #8a6d00; white-space: nowrap; }
.rb-table tr.rb-sep td { background: var(--m-clair); font-weight: 600; font-size: .78rem; color: var(--m-fonce); padding: 4px 8px; }
.rb-badge { border: 0; border-radius: 10px; background: var(--m); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 7px; cursor: pointer; }
.rb-badge.auto { background: #4f8a68; }
.rb-modif { border: 0; background: none; cursor: pointer; color: #5b6b62; }
.rb-instance-txt { border-bottom: 3px solid #e5a400; }
.rb-barre { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 10px;
  padding: 10px 14px; background: #fff; border: 1px solid var(--m-ligne); border-radius: 10px; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.rb-barre.actif { border-color: var(--m); }
.rb-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.rb-grille .large { grid-column: 1 / -1; }
.rb-grille label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; }
.rb-nouveau .ds-etape { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.rb-nouveau .ds-etape > label { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rb-choix { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
/* État de rapprochement (présentation du modèle ADKOUL) */
.erb { background: #fff; padding: 18px; border-radius: 10px; max-width: 1200px; }
.erb-titre { display: grid; grid-template-columns: 1.2fr .4fr 1fr; gap: 0; font-weight: 800; color: #fff; font-size: 1.05rem; }
.erb-titre span { background: #c55a11; padding: 4px 8px; }
.erb-titre span:last-child { grid-column: 3; text-align: center; }
.erb-compte { font-weight: 800; font-size: 1.05rem; margin: 6px 0; }
.erb-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.erb-table th, .erb-table td { border: 1px solid #000; padding: 3px 6px; }
.erb-table thead th, .erb-table tfoot td { background: #c55a11; color: #fff; font-weight: 700; text-align: center; }
.erb-table tbody td { background: #bdd7ee; }
.erb-table tbody tr.g td { font-weight: 700; }
.erb-table td.erb-jaune { background: #ffff00; }
.erb-table th.erb-date { width: 80px; }
.erb-table tfoot td.num { text-align: right; }
.erb-arrete { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 4px; }
.erb-ecart { justify-self: end; margin-right: 140px; background: #c55a11; color: #fff; font-weight: 800; font-size: 1.2rem; padding: 2px 40px; }
.erb-ecart.ko { background: #b42318; }
.erb-somme { display: grid; grid-template-columns: 1fr auto 120px; background: #c55a11; color: #fff; font-weight: 800; align-items: center; }
.erb-somme span { padding: 4px 8px; } .erb-somme b { padding: 4px 20px; font-size: 1.1rem; }
.erb-somme .erb-fcfa { background: #fff; color: #000; text-align: center; border: 1px solid #000; }
.erb-lieu { text-align: center; margin: 16px 0 6px; font-size: 1.05rem; }
.erb-sign { display: flex; justify-content: space-between; font-weight: 800; text-decoration: underline; margin-bottom: 40px; }
@media (max-width: 1100px) { .rb-deux { grid-template-columns: 1fr; } .rb-kpis { grid-template-columns: 1fr 1fr; } }
.rb-etapes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.rb-etapes ol { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 300px; }
.rb-etapes li { flex: 1; text-align: center; padding: 7px 10px; background: var(--m-clair); color: #5b6b62; font-weight: 600; font-size: .85rem;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); }
.rb-etapes li:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.rb-etapes li a { color: inherit; text-decoration: none; display: block; }
.rb-etapes li.fait { background: var(--m-ligne); color: var(--m); }
.rb-etapes li.actif { background: var(--m); color: #fff; }
.rb-decalage { border-left: 4px solid #e5a400; background: #fffaf0; margin-bottom: 10px; }
.rb-mois { margin: 4px 0 8px; font-size: .85rem; } .rb-mois summary { cursor: pointer; color: var(--m-fonce); }

/* Cadres dans la page (à côté ou au centre) */
:root { --l-panneau: 50vw; }
.adk-panneau { position: fixed; top: 0; right: 0; bottom: 0; width: var(--l-panneau); z-index: 900; display: flex; flex-direction: column;
  background: #fff; border-left: 3px solid var(--m); box-shadow: -10px 0 30px rgba(11, 58, 91, .18); }
.adk-panneau[hidden] { display: none; }
.adk-panneau.centre { top: 5vh; bottom: 5vh; right: 4vw; width: 92vw; border: 2px solid var(--m); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(11, 58, 91, .35); }
.adk-panneau.centre .adk-poignee { display: none; }
.adk-panneau-tete { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--m-pale); border-bottom: 1px solid var(--m-ligne); }
.adk-panneau-tete .sep { flex: 1; }
.adk-panneau iframe { flex: 1; width: 100%; border: 0; background: var(--m-pale); }
.adk-poignee { position: absolute; left: -6px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 2; }
body.panneau-glisse { user-select: none; } body.panneau-glisse .adk-panneau iframe { pointer-events: none; }
body.avec-panneau .page, body.avec-panneau .entete, body.avec-panneau .rb-barre { margin-right: var(--l-panneau); }
body.avec-panneau .page { max-width: none; }
/* Page affichée dans un cadre : sans en-tête ni barres */
body.mode-cadre .entete, body.mode-cadre .fenetre-outils, body.mode-cadre .barre-fenetres, body.mode-cadre .rb-etapes { display: none !important; }
body.mode-cadre .page { max-width: none; padding: 8px 12px; }
body.mode-cadre { background: var(--m-pale); }
.rb-precedent { margin-bottom: 12px; border-top: 4px solid #e5a400; }
.rb-defile-inst { max-height: 38vh; overflow: auto; }
.rb-inst { font-size: .82rem; }
.rb-inst tbody td { background: #bdd7ee; }
.rb-inst tr.pointee td { background: var(--m-clair) !important; color: #6b7a71; }
.rb-inst thead th { position: sticky; top: 0; z-index: 1; }
.rb-inst thead tr:nth-child(2) th { top: 24px; }
.rb-titre-2 { margin: 6px 0; font-size: 1rem; color: var(--m-fonce); }
.erb-actions .btn { padding: 1px 6px; }

/* 4.18 — état de rapprochement en direct pendant la saisie dans le journal */
.erb-direct { position: fixed; left: 16px; bottom: 16px; z-index: 900; max-width: min(560px, calc(100vw - 32px)); background: var(--m-clair); border: 1px solid var(--m-ciel);
  border-left: 4px solid var(--m); padding: 10px 14px; border-radius: 8px; font-size: .9rem; box-shadow: 0 6px 22px rgba(0,0,0,.18); }
body.avec-panneau .erb-direct { max-width: min(560px, calc(100vw - var(--l-panneau, 50vw) - 48px)); }
@keyframes erb-flash { 0% { background: #fff59d; } 100% { background: transparent; } }
.erb-table tr.erb-flash td { animation: erb-flash 2.5s ease-out; }

/* 4.19 — ADKOUL 471 : marque et ouverture animée */
.marque-471 { color: #f5c518; font-weight: 800; letter-spacing: .02em; }
.marque-connexion { font-weight: 800; font-size: 1.25rem; color: var(--m-fonce); letter-spacing: .03em; }
.marque-connexion .marque-471 { color: #d9a400; }
.hero-nom span { color: #f5c518 !important; }
.hero-slogan { margin: 6px 0 0; color: #fff8d6; font-style: italic; font-size: 1.05rem; text-shadow: 0 1px 4px rgba(0,30,70,.6); }
.hero-intro { color: inherit; opacity: .8; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.hero-intro:hover { opacity: 1; text-decoration: underline; }

html.intro-active, html.intro-active body { overflow: hidden; }
.adk-intro { position: fixed; inset: 0; z-index: 100000; background: #000; color: #fff; cursor: pointer; user-select: none;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; transition: opacity .85s ease, filter .85s ease; overflow: hidden; }
.adk-intro .ai-fond { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.adk-intro .ai-voile { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%); pointer-events: none; }
.adk-intro .ai-centre { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); text-align: center; width: min(92vw, 760px); }
.adk-intro .ai-logo { width: clamp(70px, 11vw, 120px); height: auto; border-radius: 50%; opacity: 0; transform: scale(.85);
  filter: drop-shadow(0 0 18px rgba(245,197,24,.55)) drop-shadow(0 0 2px rgba(255,255,255,.8)); }
.adk-intro .ai-nom { margin-top: 18px; font-size: clamp(2.4rem, 8vw, 5rem); font-weight: 300; letter-spacing: .9em; line-height: 1;
  opacity: 0; white-space: nowrap; text-shadow: 0 0 22px rgba(255,255,255,.35); }
.adk-intro .ai-adkoul { color: #fff; }
.adk-intro .ai-471 { color: #f5c518; font-weight: 700; margin-left: .35em; text-shadow: 0 0 26px rgba(245,197,24,.7); }
.adk-intro .ai-trait { height: 1px; width: 0; margin: 18px auto 14px; background: linear-gradient(90deg, transparent, rgba(255,230,160,.9), transparent); }
.adk-intro .ai-slogan { font-size: clamp(.95rem, 2.4vw, 1.25rem); font-style: italic; color: #f3ead0; opacity: 0; letter-spacing: .04em; }
.adk-intro .ai-chargement { position: relative; width: 46px; height: 46px; margin: 34px auto 0; opacity: 0; }
.adk-intro .ai-chargement span { position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -5.5px; border-radius: 50%;
  background: #f5c518; box-shadow: 0 0 10px rgba(245,197,24,.9), 0 0 2px #fff; }
.adk-intro .ai-chargement span:nth-child(1) { transform: rotate(0deg) translateY(-16px); }
.adk-intro .ai-chargement span:nth-child(2) { transform: rotate(120deg) translateY(-16px); }
.adk-intro .ai-chargement span:nth-child(3) { transform: rotate(240deg) translateY(-16px); }
.adk-intro .ai-passer { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: .78rem; color: rgba(255,255,255,.55); opacity: 0; letter-spacing: .05em; }

.adk-intro.ai-go .ai-logo { animation: ai-logo 1.4s cubic-bezier(.2,.7,.2,1) .9s forwards; }
.adk-intro.ai-go .ai-nom { animation: ai-nom 1.9s cubic-bezier(.2,.7,.2,1) 1.7s forwards; }
.adk-intro.ai-go .ai-trait { animation: ai-trait 1.2s ease-out 2.6s forwards; }
.adk-intro.ai-go .ai-slogan { animation: ai-fondu 1.1s ease-out 3.1s forwards; }
.adk-intro.ai-go .ai-chargement { animation: ai-fondu .6s ease-out 3.1s forwards, ai-tourne 1.15s linear 3.1s infinite; }
.adk-intro.ai-go .ai-chargement span { animation: ai-pulse 1.15s ease-in-out infinite; }
.adk-intro.ai-go .ai-chargement span:nth-child(2) { animation-delay: -.38s; }
.adk-intro.ai-go .ai-chargement span:nth-child(3) { animation-delay: -.76s; }
.adk-intro.ai-go .ai-passer { animation: ai-fondu 1s ease 1.2s forwards; }
.adk-intro.ai-sortie { opacity: 0; filter: brightness(1.6) blur(2px); pointer-events: none; }
.adk-intro.ai-reduit .ai-logo, .adk-intro.ai-reduit .ai-nom, .adk-intro.ai-reduit .ai-slogan, .adk-intro.ai-reduit .ai-chargement { animation-delay: 0s !important; animation-duration: .4s !important; }
.adk-intro.ai-reduit .ai-trait { animation: none; width: 60%; }

@keyframes ai-logo { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: scale(1); } }
@keyframes ai-nom { 0% { opacity: 0; letter-spacing: .9em; filter: blur(6px); } 60% { filter: blur(0); } 100% { opacity: 1; letter-spacing: .08em; filter: blur(0); } }
@keyframes ai-trait { to { width: 62%; } }
@keyframes ai-fondu { to { opacity: 1; } }
@keyframes ai-tourne { to { transform: rotate(360deg); } }
@keyframes ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .adk-intro.ai-go .ai-chargement { animation: ai-fondu .4s ease forwards, ai-tourne 2.4s linear infinite; } }
@media print { .adk-intro { display: none !important; } }

/* 4.22 — Suivi des charges de fonctionnement */
.hero-onglet-fct { position: absolute; right: 12px; bottom: 24px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--m-fonce); font-weight: 700; font-size: .86rem;
  text-decoration: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .6); backdrop-filter: blur(4px);
  transition: transform .15s ease, background .15s ease; }
.hero-onglet-fct:hover { background: #fff; transform: translateY(-1px); }
.cf-filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.cf-filtres label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--gris); }
.cf-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.cf-kpi > div { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 10px 14px; box-shadow: var(--ombre); }
.cf-kpi span { display: block; font-size: .78rem; color: var(--gris); }
.cf-kpi b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.cf-kpi .ko b { color: var(--rouge); }
.cf-barre { display: block; height: 6px; border-radius: 3px; background: var(--m-clair); overflow: hidden; margin: 6px 0 4px; }
.cf-barre > i { display: block; height: 100%; background: var(--m-vif); }
.cf-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; align-items: start; }
.cf-carte { background: #fff; border: 1px solid var(--bord); border-left: 4px solid var(--m-vif); border-radius: 10px; box-shadow: var(--ombre); }
.cf-carte.alerte { border-left-color: #d98e04; } .cf-carte.alerte .cf-barre > i { background: #d98e04; }
.cf-carte.depasse { border-left-color: var(--rouge); } .cf-carte.depasse .cf-barre > i { background: var(--rouge); }
.cf-carte > summary { list-style: none; cursor: pointer; padding: 10px 14px; }
.cf-carte > summary::-webkit-details-marker { display: none; }
.cf-carte[open] { grid-column: 1 / -1; }
.cf-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cf-ico { font-size: 1.3rem; }
.cf-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cf-chiffres span { display: block; font-size: .72rem; color: var(--gris); }
.cf-chiffres b { font-variant-numeric: tabular-nums; }
.cf-detail { margin: 0 10px 10px; width: calc(100% - 20px); }
tr.cf-retenue td { background: var(--m-pale); }
@media (max-width: 760px) { .cf-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-onglet-fct { font-size: .78rem; bottom: 22px; } }
/* 4.23 — tableau des lignes de fonctionnement et cadre de détail */
.cf-table tbody tr.cf-ligne { cursor: pointer; }
.cf-table tbody tr.cf-ligne:hover td, .cf-table tbody tr.cf-ligne:focus td { background: var(--m-pale); outline: none; }
.cf-table tbody tr.cf-ligne td:first-child { border-left: 4px solid var(--m-vif); }
.cf-table tbody tr.cf-ligne.alerte td:first-child { border-left-color: #d98e04; }
.cf-table tbody tr.cf-ligne.depasse td:first-child { border-left-color: var(--rouge); }
.cf-table tbody tr.cf-ligne.vide-ligne td:first-child { border-left-color: #cfd6d2; }
.cf-table tbody tr.vide-ligne td { color: var(--gris); }
.cf-table tr.alerte .cf-barre > i { background: #d98e04; } .cf-table tr.depasse .cf-barre > i { background: var(--rouge); }
.cf-table td.num, .cf-table th.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-table tfoot td { font-weight: 800; background: var(--m-clair); }
.cf-col-taux { width: 190px; }
.cf-taux { display: flex; align-items: center; gap: 8px; } .cf-taux .cf-barre { flex: 1; margin: 0; } .cf-taux span { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.cf-voir { color: var(--gris); font-size: 1.3rem; text-align: center; width: 24px; }
dialog.dlg-salaires.cf-dlg { width: min(1000px, 94vw); }
.cf-dlg-resume { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.cf-dlg-resume > div { background: var(--gris-clair); border-radius: 8px; padding: 8px 10px; }
.cf-dlg-resume span { display: block; font-size: .75rem; color: var(--gris); } .cf-dlg-resume b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.cf-dlg-resume .ko b { color: var(--rouge); }
.cf-lieu { font-weight: 700; vertical-align: top; background: var(--m-pale); }
tr.cf-sous-total td { font-weight: 700; background: var(--gris-clair); }
@media (max-width: 760px) { .cf-dlg-resume { grid-template-columns: repeat(2, 1fr); } .cf-col-taux { width: 120px; } }
.lieux-puces { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.lieux-puces .btn.mini { font-size: .75rem; padding: 2px 8px; }
.cf-table td { vertical-align: middle; }

/* 4.24 — cadres déplaçables, redimensionnables, réductibles ; boîtes de dialogue déplaçables */
.adk-panneau-tete { cursor: move; user-select: none; }
.adk-panneau-tete button, .adk-panneau-tete a { cursor: pointer; }
.adk-panneau.flottant { border: 2px solid var(--vert); border-radius: 12px; box-shadow: 0 18px 50px rgba(13, 59, 34, .35); overflow: hidden; min-width: 360px; min-height: 220px; }
.adk-panneau.flottant .adk-poignee, .adk-panneau.agrandi .adk-poignee { display: none; }
.adk-panneau.agrandi { top: 0; left: 0; right: 0; bottom: 0; width: auto; z-index: 950; border: 0; border-radius: 0; }
.adk-panneau.reduit { display: none; }
.adk-coin { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 2;
  background: linear-gradient(135deg, transparent 50%, rgba(30, 123, 74, .55) 50%, rgba(30, 123, 74, .55) 60%, transparent 60%, transparent 70%, rgba(30, 123, 74, .55) 70%, rgba(30, 123, 74, .55) 80%, transparent 80%); }
.adk-panneau:not(.flottant):not(.centre) .adk-coin { display: none; }
.adk-pastille { position: fixed; left: 14px; bottom: 14px; z-index: 960; display: inline-flex; align-items: center; gap: 6px; max-width: 46vw;
  padding: 8px 14px; border-radius: 999px; border: 2px solid var(--m); background: #fff; color: var(--m-fonce);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2); cursor: pointer; font: inherit; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adk-pastille:hover { background: var(--m-pale); }
body.panneau-glisse iframe { pointer-events: none; }
body.panneau-glisse, body.panneau-glisse * { cursor: grabbing !important; }
dialog .ds-tete, dialog .dp-tete, .apercu-barre { cursor: move; user-select: none; }
dialog .ds-tete button, dialog .dp-tete button, .apercu-barre button, .apercu-barre a { cursor: pointer; }
/* Actions rapides */
.ar-filtres { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 12px; }
.ar-filtres label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--gris); }
.ar-case { width: 32px; text-align: center; }
.ar-table tr.ar-instance td { background: #fff7e6; color: #8a5a00; }
.ar-det summary { cursor: pointer; color: var(--gris); font-size: .75rem; } .ar-det ul { margin: 4px 0 0; padding-left: 16px; font-size: .78rem; }
.hero-onglet-ar { right: 268px; }
@media (max-width: 760px) { .hero-onglet-ar { right: 12px; bottom: 64px; } }
/* Actions rapides : les trois lignes (v4.26) */
.ar-fil { margin: 0 0 2px; font-size: .8rem; } .ar-fil a { color: var(--gris); text-decoration: none; } .ar-fil a:hover { text-decoration: underline; }
.ar-lignes { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ar-ligne { display: grid; grid-template-columns: 46px 1fr minmax(220px, 300px) auto auto; gap: 14px; align-items: center; padding: 14px 16px;
  border: 1px solid var(--bord, var(--m-ligne)); border-radius: 12px; background: var(--fond-carte, #fff); color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.ar-ligne:hover { border-color: var(--m); box-shadow: 0 4px 14px rgba(11, 58, 91,.12); transform: translateY(-1px); }
.ar-num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; background: var(--m-clair); color: var(--m); }
.ar-ligne.ar-fait .ar-num { background: var(--m); color: #fff; }
.ar-ligne h3 { margin: 0 0 3px; font-size: 1rem; } .ar-ligne p { margin: 0; font-size: .8rem; color: var(--gris); }
.ar-flux { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; font-size: .75rem; }
.ar-flux span { padding: 2px 8px; border-radius: 999px; background: var(--m-pale); border: 1px solid var(--m-ligne); }
.ar-etat { font-size: .8rem; line-height: 1.45; } .ar-etat b { font-variant-numeric: tabular-nums; }
.ar-go { white-space: nowrap; }
.ar-groupe { margin-top: 12px; } .ar-groupe h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 0 0 6px; }
.ar-cheque { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 8px; padding: 8px 10px; background: var(--m-pale); border-radius: 8px; }
.ar-cheque label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--gris); }
.ar-table tr.ar-regle td { color: var(--gris); background: #f3f3f3; }
@media (max-width: 760px) { .ar-ligne { grid-template-columns: 40px 1fr; } .ar-ligne .ar-etat, .ar-ligne .ar-go { grid-column: 2; } }
.ar-ligne:hover, .ar-ligne:hover * { text-decoration: none; }
/* Synthèse des activités récentes (v4.27) */
.hero-onglets { position: absolute; right: 12px; bottom: 24px; z-index: 3; display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 8px; max-width: calc(100% - 24px); }
.hero-onglets .hero-onglet-fct { position: static; right: auto; bottom: auto; }
@media (max-width: 760px) { .hero-onglets { bottom: 22px; gap: 6px; } .hero-onglets .hero-onglet-ar { right: auto; bottom: auto; } }
.sy-page { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.sy-periodes { position: sticky; top: 8px; background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 8px; }
.sy-periodes h4 { margin: 8px 6px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gris); }
.sy-periodes a { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; padding: 6px 8px; border-radius: 7px; color: var(--texte); text-decoration: none; font-size: .86rem; }
.sy-periodes a small { flex-basis: 100%; color: var(--gris); font-size: .72rem; }
.sy-periodes a:hover { background: var(--m-pale); }
.sy-periodes a.actif { background: var(--m-clair); color: var(--m-fonce); font-weight: 600; box-shadow: inset 3px 0 0 var(--m); }
.sy-pastille { width: 7px; height: 7px; border-radius: 50%; background: var(--m-vif); box-shadow: 0 0 0 3px rgba(11, 58, 91,.18); }
.sy-rapport { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 18px 26px 16px; max-width: 900px; }
.sy-entete img { width: 100%; max-height: 110px; object-fit: contain; object-position: left center; display: block; }
.sy-appli { text-align: right; font-size: .75rem; color: var(--m-fonce); border-bottom: 2px solid var(--m); padding: 2px 0 5px; }
.sy-appli span { font-weight: 700; }
.sy-titre { margin: 14px 0 0; color: var(--m-fonce); font-size: 1.35rem; letter-spacing: .02em; text-transform: uppercase; }
.sy-periode { margin: 2px 0 12px; color: var(--gris); font-style: italic; }
.sy-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.sy-kpi div { background: var(--m-pale); border: 1px solid var(--bord); border-radius: 8px; padding: 8px 10px; }
.sy-kpi b { display: block; font-size: 1.1rem; color: var(--m-fonce); font-variant-numeric: tabular-nums; }
.sy-kpi span { font-size: .74rem; color: var(--gris); }
.sy-kpi .sy-alerte { background: var(--orange-clair); } .sy-kpi .sy-alerte b { color: var(--orange); }
.sy-section h3 { margin: 14px 0 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; color: var(--m-fonce); }
.sy-section p, .sy-section li { line-height: 1.55; margin: 0 0 4px; }
.sy-section ul { margin: 0; padding-left: 18px; }
.sy-table { margin-top: 6px; }
.sy-pied { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--bord); font-size: .72rem; color: var(--gris); text-align: center; }
@media (max-width: 760px) { .sy-page { grid-template-columns: 1fr; } .sy-periodes { position: static; } .sy-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sy-rapport { padding: 12px; } }
@media print { .sy-page { display: block; } .sy-rapport { border: 0; padding: 0; max-width: none; } }
.sy-det summary { cursor: pointer; font-size: .8rem; color: var(--m-fonce); margin: 6px 0 2px; }
@media print { .sy-det summary { display: none; } }
/* Logo d'ADKOUL 471 et ciel de la page d'accueil (v4.28) */
.entete .marque img.logo-appli { height: 40px; width: 40px; padding: 0; background: transparent; border-radius: 50%;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.hero-logo.hero-logo-appli { background: transparent; box-shadow: none; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.connexion .logo-connexion.logo-connexion-appli { box-shadow: none; filter: drop-shadow(0 3px 8px rgba(0,0,0,.2)); }
body.page-accueil { background: #2a5784 url("ciel_accueil.svg") center top / cover no-repeat fixed; }
/* Maquette de paie (v4.29) */
dialog.dlg-paie.dlg-salaires { width: min(760px, 96vw); }
.paie-dates, .paie-comptes { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.paie-dates label, .paie-comptes label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; }
.paie-comptes select { max-width: 330px; }
.paie-quoi { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.paie-quoi label { display: inline-flex; gap: 4px; align-items: center; font-size: .85rem; }
/* Contrôle : patrimoine du projet (v4.29) */
.pt-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; max-width: 1200px; }
.pt-table { width: 100%; }
.pt-table thead th { font-size: .82rem; }
.pt-table td { vertical-align: top; }
.pt-rub summary { cursor: pointer; }
.pt-det { list-style: none; margin: 4px 0 2px; padding: 0 0 0 14px; font-size: .78rem; color: var(--gris); }
.pt-det li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--bord); padding: 1px 0; }
.pt-det b { font-weight: 600; color: var(--texte); white-space: nowrap; }
.pt-table tfoot td { font-weight: 700; }
.pt-ecart { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; max-width: 1200px; font-size: .9rem; }
.pt-ecart.ok { background: var(--vert-clair); color: var(--vert-fonce); }
.pt-ecart.ko { background: var(--rouge-clair); color: var(--rouge); }
@media (max-width: 860px) { .pt-grille { grid-template-columns: 1fr; } }
@media print { .pt-rub details > *:not(summary) { display: block; } }
.paie-quoi label { flex-direction: row !important; white-space: nowrap; }
.paie-quoi label input { width: auto !important; margin: 0; display: inline-block; }
/* Scan des chèques / virements (v4.31) */
.btn-cheque.ok { background: #e6f2fb; border-color: #9cc3e6; }
.badge.piece-cheque { background: #e6f2fb; color: #1f5f99; border: 1px solid #9cc3e6; }
.form-cheque-ecr { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 8px; border-top: 1px dashed var(--bord); }
.form-cheque-ecr label { cursor: pointer; }
/* Situation des chèques / virements (v4.31) */
.sc-filtres { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 10px; }
.sc-filtres label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--gris); }
.sc-filtres .sc-recherche { flex: 1 1 340px; flex-direction: row; align-items: center; gap: 6px; font-size: 1rem; }
.sc-filtres .sc-recherche input { flex: 1; font-size: .95rem; padding: 7px 10px; }
.sc-resume { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 8px; font-size: .85rem; color: var(--gris); }
.sc-resume b { color: var(--texte); }
.sc-mode { display: inline-block; min-width: 62px; text-align: center; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-right: 4px; }
.sc-mode.chq { background: #e6f2fb; color: #1f5f99; } .sc-mode.vir { background: var(--m-clair); color: var(--m); }
.sc-mode.dap { background: #fff3dc; color: #b25e09; } .sc-mode.nr { background: #f1f1f1; color: #888; }
.sc-table td { vertical-align: middle; }

/* v4.32 — sous-titre de l'application */
.entete .marque .marque-textes { display: flex; flex-direction: column; line-height: 1.1; }
.entete .marque .marque-slogan { font-size: .52rem; font-weight: 500; opacity: .88; letter-spacing: 0; white-space: normal; max-width: 118px; line-height: 1.12; margin-top: 1px; }
@media (max-width: 1600px) { .menu > button, .menu-lien { padding-left: 7px; padding-right: 7px; } .entete .en-ligne-txt { display: none; } .entete .en-ligne { padding: 2px 7px; } }
.entete .nom-utilisateur { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; font-size: .85rem; }
@media (max-width: 1340px) { .entete .marque .marque-slogan { display: none; } .entete .nom-utilisateur { max-width: 80px; } .menu > button, .menu-lien { padding-left: 5px !important; padding-right: 5px !important; } }
.slogan-connexion { font-weight: 600; color: var(--vert-fonce, var(--m-fonce)); font-size: .88rem; margin: 2px 0; }
.cloche-notif { position: relative; color: #fff; text-decoration: none; font-size: 1.05rem; padding: 2px 4px; opacity: .8; }
.cloche-notif.a-lire { opacity: 1; animation: cloche 1.2s ease 2; }
.cloche-notif .cloche-n { position: absolute; top: -4px; right: -6px; background: #d32f2f; color: #fff; border-radius: 9px; font-size: .62rem; font-weight: 700; padding: 0 5px; line-height: 15px; min-width: 15px; text-align: center; }
@keyframes cloche { 0%,100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }
tr.notif-non-lue td { background: #fff8e1; }
/* v4.32 — bouton Fermer en bas à droite (onglets de Structure…) */
.btn.fermer-bas { position: fixed; right: 18px; bottom: 16px; z-index: 60; background: #fff; border: 1.5px solid #b71c1c; color: #b71c1c; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.btn.fermer-bas:hover { background: #b71c1c; color: #fff; }
body:has(.barre-fenetres:not([hidden])) .btn.fermer-bas { bottom: 52px; }

/* v4.32 — journal plus compact, Réduire / Fermer toujours visibles, deux journaux côte à côte */
.page:has(> .entete-journal) { padding-top: 4px; }
.entete-journal { padding: 3px 140px 3px 12px; margin-bottom: 5px; min-height: 0; }
.entete-journal h1 { font-size: 1rem; line-height: 1.2; display: inline; }
.entete-journal > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.entete-journal .sous-titre { font-size: .76rem; }
.entete-journal .mode-od { margin: 0; }
.entete-journal .actions .btn { padding: 3px 10px; font-size: .84rem; }
.page:has(> .entete-journal) .onglets { margin-bottom: 5px; }
.page:has(> .entete-journal) .filtres.bandeau-vert { padding: 3px 8px; margin-bottom: 5px; }
.page:has(> .entete-journal) .solde-fige { margin-bottom: 6px; flex-wrap: nowrap; }
.page:has(> .entete-journal) .solde-fige .nav-fige { flex-wrap: wrap; padding: 3px 8px; gap: 4px; flex: 1 1 auto; min-width: 0; }
.page:has(> .entete-journal) .solde-fige .sep { display: none; }
.page:has(> .entete-journal) .solde-fige .bloc { padding: 2px 10px; }
.page:has(> .entete-journal) .solde-fige .ident-journal { padding: 3px 10px; min-width: 120px; }
.page:has(> .entete-journal) .solde-fige .ij-code { font-size: .98rem; }
.page:has(> .entete-journal) .tiroir-saisie { margin-bottom: 6px; }
.solde-fige .fen-journal { display: flex; align-self: stretch; flex: 0 0 auto; }
.solde-fige .fen-journal button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 56px;
  border: 0; border-left: 1px solid #e6efe9; cursor: pointer; padding: 0 8px; font-size: 1.05rem; font-weight: 700; }
.solde-fige .fen-journal button span { font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.solde-fige .fen-journal .fj-reduire { background: #f3f7fb; color: #22476b; }
.solde-fige .fen-journal .fj-reduire:hover { background: #e3edf7; }
.solde-fige .fen-journal .fermer-journal { min-width: 56px; padding: 0 8px; }
body.mode-cadre .solde-fige { top: 0; }
.dlg-cote { border: 1px solid var(--m-ligne); border-radius: 10px; padding: 14px 16px; width: min(560px, 92vw); }
.dlg-cote::backdrop { background: rgba(10,30,20,.35); }
.solde-fige .fen-journal .fj-trait { display: block; width: 16px; height: 3px; background: currentColor; border-radius: 2px; margin: 6px 0 4px; }
/* v4.32 — ITS / FSSP : choix de la période, tableau défilant avec en-têtes et projets figés */
.its-periodes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 0 8px; }
.its-periodes button { border: 1px solid var(--m-ligne); background: #fff; border-radius: 14px; padding: 3px 12px; cursor: pointer; font-size: .84rem; }
.its-periodes button.actif { background: var(--vert, var(--m)); color: #fff; border-color: var(--vert, var(--m)); }
.its-defile { overflow: auto; max-height: calc(100vh - 300px); min-height: 260px; padding: 0; }
.its-defile table.its thead th { position: sticky; top: 0; z-index: 3; }
.its-defile table.its thead tr:nth-child(2) th { top: 26px; }
.its-defile table.its td:nth-child(1), .its-defile table.its td:nth-child(2) { position: sticky; background: #fff; z-index: 2; }
.its-defile table.its td:nth-child(1) { left: 0; min-width: 34px; }
.its-defile table.its td:nth-child(2) { left: 34px; box-shadow: 2px 0 0 var(--m-clair); }
.its-defile table.its thead tr:first-child th:nth-child(-n+2) { position: sticky; z-index: 4; }
.its-defile table.its thead tr:first-child th:nth-child(1) { left: 0; }
.its-defile table.its thead tr:first-child th:nth-child(2) { left: 34px; }
.its-defile table.its tfoot td { position: sticky; bottom: 0; background: var(--m-clair); z-index: 2; }
.its-defile table.its input.cell { width: 84px; }
.ar-deja-badge { align-self: center; background: #fff3cd; color: #7a5b00; border: 1px solid #f0d68a; border-radius: 12px; padding: 2px 10px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.ar-refaire { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; color: #8a5a00; font-weight: 600; font-size: .86rem; }
/* v4.33 — Entrée de fonds, préfinancements */
.btn.mini.btn-tr { background: #eef5fb; border-color: #bcd3ea; color: #1d4a74; }
.dlg-tr { border: 1px solid #cfe0ee; border-radius: 10px; padding: 0; width: min(720px, 94vw); }
.dlg-tr::backdrop { background: rgba(10,30,40,.38); }
.dlg-tr form { padding: 12px 16px 14px; }
.dlg-tr-tete { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e3edf5; margin: -2px 0 8px; padding-bottom: 6px; }
.dlg-tr-tete h3 { margin: 0; font-size: 1.02rem; color: #1d4a74; }
.dlg-tr-pied { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tr-natures { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 6px 0 10px; }
.tr-nature { display: flex; gap: 6px; align-items: center; font-size: .88rem; cursor: pointer; }
.tr-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
.tr-grille label, .tr-bloc label { display: flex; flex-direction: column; font-size: .8rem; font-weight: 600; color: #345; gap: 3px; }
.tr-grille .tr-large, .tr-bloc .tr-large { grid-column: 1 / -1; }
.tr-bloc { margin-top: 10px; padding: 8px 10px; background: #f6fafd; border: 1px solid #e3edf5; border-radius: 8px; }
.tr-rep { width: 100%; border-collapse: collapse; margin-top: 4px; } .tr-rep td, .tr-rep th { padding: 2px 4px; font-size: .82rem; text-align: left; }
.tr-rep select, .tr-rep input { width: 100%; }
.tr-montant { text-align: right; font-weight: 700; }
.pref-kpi { display: flex; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.pref-kpi div { background: #fff; border: 1px solid #d6e6f2; border-radius: 8px; padding: 6px 16px; display: flex; flex-direction: column; min-width: 160px; }
.pref-kpi span { font-size: .72rem; text-transform: uppercase; color: var(--gris); }
.pref-kpi b { font-size: 1.15rem; } .pref-kpi b.ok { color: var(--vert); }
.pref-kpi .principal { background: #eef5fb; } .pref-kpi .principal b { color: #1d4a74; }
/* v4.34 — Relevés bancaires par journal et par mois, ERB signés */
.rel-defile { overflow: auto; max-height: calc(100vh - 220px); padding: 0; }
.rel-grille thead th { position: sticky; top: 0; z-index: 2; }
.rel-grille td.rel-case { min-width: 58px; white-space: nowrap; }
.rel-grille td.rel-ok { background: #eaf6ee; }
.rel-grille td.rel-ok > a:first-child { color: #1e7b4a; font-weight: 800; font-size: 1.05rem; text-decoration: none; }
.rel-grille .rel-erb { margin-left: 3px; text-decoration: none; }
.rel-ajout, .rel-remplacer { border: 1px dashed var(--m-ciel); background: #fff; border-radius: 6px; cursor: pointer; color: var(--m); font-weight: 700; padding: 1px 8px; }
.rel-remplacer { border: 0; color: #8aa; padding: 0 2px; font-size: .8rem; }
.rel-ajout:hover { background: var(--m-clair); }
.erb-signe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 10px; border-left: 5px solid #1e7b4a; }
.erb-signe.a-reimprimer { border-left-color: #d84315; background: #fff3e0; }
.biblio-docs { padding: 7px 14px !important; display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: .9rem; }
/* v4.35 — sélection d'une écriture entière, menu du clic droit, OD, avances */
tbody.ecriture { cursor: default; }
tbody.ecriture.choisie > tr > td { background: #fff7cf !important; }
tbody.ecriture.choisie > tr:first-child > td { box-shadow: inset 0 2px 0 #f0b400; }
tbody.ecriture.choisie > tr:last-child > td { box-shadow: inset 0 -2px 0 #f0b400; }
.menu-ecr { position: fixed; z-index: 9000; background: #fff; border: 1px solid #c9d8e4; border-radius: 8px; box-shadow: 0 10px 28px rgba(0,30,50,.22); min-width: 280px; padding: 4px 0; font-size: .9rem; }
.menu-ecr .me-tete { padding: 5px 14px; font-weight: 800; font-family: ui-monospace, Consolas, monospace; color: #1d4a74; border-bottom: 1px solid #e3edf5; margin-bottom: 3px; }
.menu-ecr a { display: block; padding: 6px 14px; cursor: pointer; color: #1b2b38; text-decoration: none; }
.menu-ecr a:hover { background: #eef5fb; }
.menu-ecr a[hidden] { display: none; }
.menu-ecr .me-sep { border-top: 1px solid #e3edf5; margin: 3px 0; }
.badge.od-oui { background: var(--m-clair); color: var(--m-fonce); border: 1px solid var(--m-ligne); }
.badge.od-non { background: #fdecea; color: #b42318; border: 1px solid #f3c1bb; }
.badge.od-avance { background: #fff3e0; color: #9a5b00; border: 1px solid #f1d29b; }
.badge.od-sans { background: #f1f3f5; color: #667; border: 1px solid #dde2e6; }
.av-boutons { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.valid-table th { font-size: .74rem; white-space: normal; max-width: 110px; }
.valid-table tr.valide-mois td { background: #f1faf3; }
.valid-table .ko { color: #b42318; } .valid-table .ok { color: #2e7d32; }

/* v4.35 — moins d'espace perdu partout : en-têtes, titres, filtres plus compacts */
.page { padding-top: 8px; }
.page .barre-titre { margin-bottom: 8px; padding-right: 150px; gap: 8px 16px; align-items: center; }
body.mode-cadre .page .barre-titre, body.mode-integre .page .barre-titre { padding-right: 0; }
.barre-titre h1 { font-size: 1.24rem; margin-bottom: 2px; }
.barre-titre .sous-titre { margin: 0 0 2px; font-size: .84rem; line-height: 1.35; }
.filtres { padding: 6px 10px; margin-bottom: 8px; gap: 6px 10px; }
.filtres .champ label, .filtres > label { font-size: .76rem; margin-bottom: 1px; }
.filtres input, .filtres select { padding: 4px 8px; }
#liste-journaux thead th { position: sticky; top: 0; z-index: 2; background: #eaf5ee; }
#liste-journaux td { padding-top: 3px; padding-bottom: 3px; }
tr.ligne-fg td { background: #fff4cc; font-weight: 600; }
/* v4.37 — messagerie dans l'application, signatures */
.mn-appli { margin: 8px 0; border: 1px dashed var(--m-ciel); border-radius: 8px; padding: 6px 10px; background: var(--m-pale); }
.mn-appli summary { cursor: pointer; font-weight: 600; color: var(--m); font-size: .88rem; }
.sig-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sig-carte h3 { margin: 0 0 8px; }
.sig-apercu { height: 90px; border: 1px dashed var(--m-ligne); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; margin-bottom: 8px; }
.sig-apercu img { max-height: 84px; max-width: 95%; object-fit: contain; }
.sig-recus { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 10px; align-items: start; }
.sig-liste ul { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 230px); overflow: auto; }
.sig-liste li a { display: block; padding: 7px 10px; border-bottom: 1px solid var(--m-clair); color: inherit; text-decoration: none; }
.sig-liste li.actif a { background: var(--m-clair); box-shadow: inset 3px 0 0 var(--m); }
.sig-liste li.st-attente a b { color: #8a5a00; }
.sig-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sig-doc { width: 100%; height: calc(100vh - 250px); min-height: 480px; border: 1px solid var(--m-ligne); border-radius: 8px; background: #fff; }
@media (max-width: 860px) { .sig-recus { grid-template-columns: 1fr; } }
.places-types { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
table.maint td.m-ico { width: 24px; text-align: center; font-weight: 800; }
table.maint tr.m-ok td.m-ico { color: #1e7b4a; } table.maint tr.m-alerte td.m-ico { color: #b26a00; } table.maint tr.m-erreur td.m-ico { color: #b3261e; }
table.maint tr.m-erreur td { background: #fdecea; } table.maint tr.m-alerte td { background: #fff8e1; }
/* v4.39 — code de vérification du téléphone affiché sur l'ordinateur */
.code-tel { position: fixed; inset: 0; background: rgba(10,30,20,.55); z-index: 999; display: flex; align-items: center; justify-content: center; }
.code-tel > div { background: #fff; border-radius: 14px; padding: 22px 28px; text-align: center; max-width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.code-tel p { margin: 0 0 8px; font-weight: 700; color: var(--m); }
.code-tel b { display: block; font-size: 2.4rem; letter-spacing: .25em; color: var(--m-fonce); margin: 6px 0 10px; font-family: ui-monospace, Consolas, monospace; }
.code-tel small { display: block; color: #5b6b76; margin-bottom: 14px; }
.code-tel a { display: inline-block; background: var(--m); color: #fff; padding: 8px 18px; border-radius: 8px; text-decoration: none; font-weight: 700; }

/* v4.48 — 🧾 Charger le scan : choix de la source (PC, téléphone, fichier) et suivi de la photo du téléphone */
.scan-choix { position: absolute; z-index: 9000; width: 340px; background: #fff; border: 1px solid #d6dde6; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(15,30,50,.22); padding: 6px; font-size: 13px; }
.scan-choix .sc-titre { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7785; padding: 6px 10px 4px; }
.scan-choix button { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0;
  border-radius: 8px; padding: 9px 10px; cursor: pointer; font: inherit; color: inherit; }
.scan-choix button:hover, .scan-choix button:focus-visible { background: #eef4fb; outline: none; }
.scan-choix button > span:first-child { font-size: 20px; line-height: 1.2; }
.scan-choix b { display: block; } .scan-choix small { display: block; color: #6b7785; margin-top: 1px; line-height: 1.35; word-break: break-word; }
.scan-fond { position: fixed; inset: 0; z-index: 9500; background: rgba(15,25,40,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.scan-boite { position: relative; width: 560px; max-width: 100%; max-height: 92vh; overflow: auto; background: #fff; border-radius: 16px;
  padding: 20px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.scan-boite h3 { margin: 0 30px 10px 0; font-size: 17px; }
.scan-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 18px; cursor: pointer; color: #6b7785; }
.scan-etapes { margin: 0 0 12px; padding-left: 20px; line-height: 1.5; font-size: 13.5px; }
.scan-qr { display: flex; gap: 14px; align-items: center; background: #f4f8fc; border-radius: 12px; padding: 10px; }
.scan-qr > div { width: 150px; flex: none; } .scan-qr svg { width: 100%; height: auto; display: block; }
.scan-qr p { margin: 0; font-size: 13px; color: #44515e; }
.scan-etat { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-weight: 600; color: #1e5fa8; }
.scan-tourne { width: 18px; height: 18px; border: 3px solid #c9d8ec; border-top-color: #1e5fa8; border-radius: 50%; animation: scan-tour .8s linear infinite; flex: none; }
@keyframes scan-tour { to { transform: rotate(360deg); } }
.scan-ok { color: #1e7b4a; } .scan-alerte { color: #b3261e; font-weight: 600; }
.scan-boutons { text-align: right; margin-top: 8px; }

/* Projet Trésorerie (v4.51) */
.rb-tresorerie { border-left: 4px solid #0e7490; background: #f0f9fc; margin: 0 0 12px; font-size: .92rem; }
.rb-tresorerie p { margin: 6px 0 0; }
.rb-bloquantes { margin-top: 8px; color: #8a4b00; }
.rb-bloquantes ul { margin: 4px 0 0 18px; padding: 0; }
.badge.tresorerie { background: #e0f2fe; color: #0e7490; border: 1px solid #7dd3fc; }

/* =====================================================================================================================
   v4.53 — Identité visuelle fixe : bleu marine + bleu ciel (comme le portail), vert gardé dans les journaux.
   Les couleurs ne changent plus selon la photo de l'accueil. Les verts / orange / rouges restent pour les statuts.
   ===================================================================================================================== */
:root {
  --m-nuit: #0a2540; --m-fonce: #0b3a5b; --m: #0369a1; --m-vif: #0284c7; --m-ciel: #7dd3fc;
  --m-clair: #e0f2fe; --m-pale: #f0f8ff; --m-ligne: #bae0f7;
  --fond: #f3f6fa; --carte-bord: #e2e8f0; --th-fond: #eef4fa; --th-texte: #1e3a56;
  --ombre-douce: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .05);
  --bleu: var(--m); --bleu-fonce: var(--m-fonce); --bleu-clair: var(--m-clair); --bleu-ligne: var(--m-ligne);
  --gris-clair: var(--fond); --bord: #d9e2ec; --nuit: var(--m-nuit); --rayon: 8px;
}
/* Écritures (journaux, saisie et fiche d'une écriture) : le vert ADKOUL reste, mais seulement dans le contenu de la page ;
   l'en-tête, les menus et les onglets gardent le bleu partout */
body.theme-journal main.page {
  --m-nuit: #0d3b22; --m-fonce: #0f4527; --m: #1e7b4a; --m-vif: #2e9d5b; --m-ciel: #a5e3b5;
  --m-clair: #e3f4ea; --m-pale: #f1faf4; --m-ligne: #cfe9d8;
  --fond: #f2f8f3; --carte-bord: #d7ebe0; --th-fond: #e3f4ea; --th-texte: #1f5f33; --bord: #cfe3d6;
}

body { background: var(--fond); }
a { color: var(--m); }

/* En-tête */
.entete { background: linear-gradient(90deg, var(--m-nuit) 0%, var(--m-fonce) 100%); border-bottom: 2px solid var(--m-vif);
  box-shadow: 0 2px 10px rgba(10, 37, 64, .18); }
.menu > button, .menu-lien, .entete .droite a { color: #dbe7f3; font-weight: 500; }
.menu > button:hover, .menu.ouvert > button, .menu-lien:hover, .menu-lien.actif {
  background: rgba(255, 255, 255, .10); color: #fff; box-shadow: inset 0 -3px 0 var(--m-ciel); }
.sous-menu { border-top: 3px solid var(--m-vif); border-radius: 0 0 10px 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.sous-menu a { border-radius: 6px; margin: 0 6px; padding: 7px 10px; }
.sous-menu a:hover { background: var(--m-clair); color: var(--m-fonce); }
.sous-menu .titre-groupe { color: var(--m); font-weight: 700; }
.entete .marque .pastille { background: var(--m-vif); }

/* Titres */
h1, .barre-titre h1 { color: var(--m-fonce); border-left: 4px solid var(--m-vif); padding-left: 10px; letter-spacing: -.01em; }
h2, h3, .case-accueil h2 { color: var(--m-fonce); }
.sous-titre { color: #5b6b7c; }

/* Cartes, filtres, tableaux */
.carte { border: 1px solid var(--carte-bord); border-radius: 10px; box-shadow: var(--ombre-douce); }
.carte.kpi { border-top: 3px solid var(--m-vif); }
.kpi .val { color: var(--m-fonce); }
.filtres { background: #fff; border: 1px solid var(--carte-bord); border-radius: 10px; padding: 10px 14px; box-shadow: var(--ombre-douce); }
.filtres label { color: var(--th-texte); }
th { background: var(--th-fond); color: var(--th-texte); border-bottom: 1px solid var(--m-ligne); font-weight: 600; }
tfoot td { background: var(--th-fond); font-weight: 600; }
tbody tr:hover td, table.journal tbody.ecriture:hover td { background: var(--m-pale); }
table.journal tr.contrepartie td { background: var(--m-pale); color: var(--th-texte); }

/* Boutons et champs */
.btn { border-radius: 7px; border-color: #cfd8e3; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn:hover { background: #f5f8fb; border-color: #b9c6d4; }
.btn.primaire { background: var(--m); border-color: var(--m); color: #fff; box-shadow: 0 1px 2px rgba(3, 105, 161, .25); }
.btn.primaire:hover { background: var(--m-fonce); border-color: var(--m-fonce); }
.btn.vert, .btn.mini.vert { background: #1e7b4a; border-color: #1e7b4a; color: #fff; }   /* « valider » reste vert */
.btn.vert:hover { background: #155c37; border-color: #155c37; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search],
input:not([type]), select, textarea { border-radius: 6px; border-color: #c7d2de; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--m-vif) 22%, transparent); outline-offset: 0;
  border-color: var(--m-vif); }

/* Onglets, encadrés, badges */
.onglets { border-bottom-color: var(--m-vif); }
.onglets a { background: var(--m-pale); border-color: var(--m-ligne); color: var(--m-fonce); }
.onglets a:hover { background: var(--m-clair); color: var(--m-fonce); }
.onglets a.actif, .onglets a.actif:hover { background: var(--m); border-color: var(--m); color: #fff; }
.message.info, .encadre { background: var(--m-clair); border-color: var(--m-ligne); color: var(--m-fonce); }
.badge.bleu { background: var(--m-clair); color: var(--m); border-color: var(--m-ligne); }
.barre-lot, .barre-fenetres { background: var(--m-nuit); }
.barre-fenetres .onglet-fen { color: var(--m-nuit); }
.carte-journal:hover { border-color: var(--m-ciel); background: var(--m-pale); }
.connexion { background: radial-gradient(1100px 600px at 15% 0%, #0ea5e9 0%, transparent 60%),
  linear-gradient(160deg, #0a2540 0%, #0b3a5b 55%, #0369a1 100%); }
.marque-connexion { color: var(--m-fonce); }

/* Accueil : couleurs fixes (plus de changement selon la photo) */
body.page-accueil { --th-fonce: #0b3a5b; --th-accent: #0284c7; --th-clair: #e0f2fe;
  background: #0b3a5b url("ciel_accueil.svg") center top / cover no-repeat fixed; transition: none; }
body.page-accueil .entete { background: linear-gradient(90deg, #0a2540 0%, #0b3a5b 100%); border-bottom-color: #0284c7; transition: none; }
body.page-accueil .entete .menu-lien.actif { background: rgba(255, 255, 255, .10); }
.accueil-v41 .hero-voile, .accueil-v41 .hero-nom span, .accueil-v41 .tuile-icone, .accueil-v41 .tb-entete h2 { transition: none; }
.accueil-v41 .hero-voile { background: linear-gradient(100deg, rgba(10, 37, 64, .66) 0%, rgba(10, 37, 64, .25) 40%, transparent 65%); }
.accueil-v41 .tuile { border-radius: 12px; }
/* En-tête plus net : nom de l'application seul, exercice lisible, utilisateur en pastille */
.entete .marque .marque-slogan { display: none; }
.entete .marque .marque-textes > span:first-child { font-size: 1.12rem; letter-spacing: .01em; }
.entete .droite select { width: auto; min-width: 132px; background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .28); border-radius: 6px; }
.entete .nom-utilisateur { background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 3px 12px; }
.barre-titre { margin-bottom: 16px; }
.slogan-connexion { color: var(--m); }
.entete .droite { gap: 8px; }
.entete .nom-utilisateur { padding: 3px 10px; max-width: 132px; }
@media (max-width: 1600px) { .menu > button, .menu-lien { padding-left: 9px; padding-right: 9px; } }
@media (max-width: 1480px) { .entete .en-ligne-txt { display: none; } .entete .nom-utilisateur { max-width: 96px; } .entete { gap: 12px; } }
@media (max-width: 1500px) { .menu > button, .menu-lien { padding-left: 7px; padding-right: 7px; font-size: .96rem; }
  .entete .droite select { min-width: 116px; } .entete .marque .marque-textes > span:first-child { font-size: 1.02rem; } }
@media (max-width: 1400px) { .entete .marque .marque-textes { display: none; } }

/* v4.54 — Tableau des dossiers à traiter : écran de projection qui s'enroule vers le haut ------------------------------- */
.tableau-blanc { --h-rouleau: 40px; --h-ecran: 400px; }
.tb-rouleau { position: absolute; top: 0; left: -6px; right: -6px; height: var(--h-rouleau); z-index: 4; display: flex; align-items: center;
  gap: 10px; padding: 0 16px; border-radius: 20px; cursor: default;
  background: linear-gradient(180deg, #f4f6f8 0%, #d9dee4 22%, #aab3bd 55%, #7f8994 78%, #a9b1ba 100%);
  box-shadow: 0 4px 10px rgba(10, 37, 64, .28), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -2px 3px rgba(0, 0, 0, .18); }
.tb-rouleau::before, .tb-rouleau::after { content: ""; position: absolute; top: 4px; bottom: 4px; width: 10px; border-radius: 6px;
  background: linear-gradient(90deg, #5b6570, #c9d0d7 45%, #5b6570); }
.tb-rouleau::before { left: 4px; } .tb-rouleau::after { right: 4px; }
.tb-r-titre { flex: 1; min-width: 0; font-weight: 700; font-size: .9rem; color: #0b3a5b; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); opacity: 0; transition: opacity .35s ease; }
.tb-r-compte:not(:empty) { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #0b3a5b;
  color: #fff; font-size: .74rem; text-align: center; text-shadow: none; }
.tb-enrouler { flex: none; margin-right: 112px; border: 1px solid rgba(11, 58, 91, .35); background: rgba(255, 255, 255, .85); color: #0b3a5b;
  border-radius: 999px; padding: 3px 12px; font: 600 .78rem/1.4 inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.tb-enrouler:hover { background: #fff; border-color: #0284c7; color: #0369a1; }
.tb-enrouler:focus-visible { outline: 3px solid rgba(2, 132, 199, .35); outline-offset: 1px; }
.tableau-blanc .tb-cadre { top: calc(var(--h-rouleau) - 10px); left: 0; right: 0; bottom: 14px; border-radius: 0 0 6px 6px;
  clip-path: inset(0 0 0 0); transition: clip-path .95s cubic-bezier(.65, .05, .3, 1); }
.tableau-blanc .tb-auget { position: absolute; left: -4px; right: -4px; bottom: 0; margin: 0; z-index: 3; border-radius: 6px;
  transform: translateY(0); transition: transform .95s cubic-bezier(.65, .05, .3, 1); }
/* en train de s'enrouler / enroulé : la toile remonte dans le rouleau, la barre lestée la suit */
.tableau-blanc.enroulement .tb-cadre { clip-path: inset(0 0 100% 0); }
.tableau-blanc.enroulement .tb-auget { transform: translateY(calc(-1 * var(--h-ecran))); }
.tableau-blanc.enroulement .tb-r-titre { opacity: 1; }
.tableau-blanc.enroule { min-height: calc(var(--h-rouleau) + 22px); height: calc(var(--h-rouleau) + 22px); align-self: start; }
.tableau-blanc.enroule .tb-cadre { visibility: hidden; }
.tableau-blanc.enroule .tb-auget { top: calc(var(--h-rouleau) - 6px); bottom: auto; transform: none; transition: none; }
.tableau-blanc.enroule .tb-rouleau { cursor: pointer; }
/* tirette : petit anneau pour tirer la toile */
.tableau-blanc.enroule .tb-auget::after { content: ""; position: absolute; left: 50%; top: 100%; width: 14px; height: 14px; margin-left: -7px;
  border: 3px solid #7f8994; border-top-width: 0; border-radius: 0 0 9px 9px; }
.tableau-blanc.sans-anim .tb-cadre, .tableau-blanc.sans-anim .tb-auget, .tableau-blanc.sans-anim .tb-r-titre { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .tableau-blanc .tb-cadre, .tableau-blanc .tb-auget { transition: none; } }
@media (max-width: 1100px) { .tableau-blanc.enroule { min-height: calc(var(--h-rouleau) + 22px); } .tb-enrouler { margin-right: 0; } }

/* v4.55 — Citation qui apparaît sous le rouleau enroulé (hadith du jeudi 19 h au vendredi 19 h) */
.tableau-blanc.enroule { height: auto; }
.tb-citation { display: none; margin: 0; }
.tableau-blanc.enroule .tb-citation:not([hidden]) { display: block; position: relative; margin: calc(var(--h-rouleau) + 30px) 10px 0;
  padding: 16px 18px 14px; border-radius: 12px; background: #fff; border: 1px solid #dbe5ef; border-top: 3px solid #0284c7;
  box-shadow: 0 10px 26px rgba(10, 37, 64, .16); transform-origin: 50% -24px; }
/* deux fils qui la suspendent au rouleau */
.tableau-blanc.enroule .tb-citation::before, .tableau-blanc.enroule .tb-citation::after { content: ""; position: absolute; top: -30px;
  width: 2px; height: 28px; background: linear-gradient(#7f8994, #b9c2cb); }
.tableau-blanc.enroule .tb-citation::before { left: 28%; } .tableau-blanc.enroule .tb-citation::after { right: 28%; }
.tb-cit-etiquette { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #0284c7; margin-bottom: 6px; }
.tb-citation blockquote { margin: 0; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 1.04rem; line-height: 1.5; color: #0b3a5b; }
.tb-citation figcaption { margin-top: 10px; text-align: right; font-size: .8rem; font-weight: 600; color: #5b6b7c; }
.tb-citation.hadith { border-top-color: #1e7b4a; background: linear-gradient(180deg, #f6fbf7 0%, #ffffff 60%); }
.tb-citation.hadith .tb-cit-etiquette { color: #1e7b4a; }
.tb-citation.hadith blockquote { color: #14532d; }
.tb-citation.apparait { animation: tb-cit-arrivee 1.1s cubic-bezier(.2, .8, .2, 1); }
@keyframes tb-cit-arrivee {
  0% { opacity: 0; transform: translateY(-18px) rotate(-3deg); }
  45% { opacity: 1; transform: translateY(2px) rotate(1.6deg); }
  70% { transform: rotate(-.8deg); }
  100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tb-citation.apparait { animation: none; } }
/* v4.56 — citation en plus grand (meilleure lecture) */
.tableau-blanc.enroule .tb-citation:not([hidden]) { padding: 20px 22px 18px; margin-left: 4px; margin-right: 4px; }
.tb-cit-etiquette { font-size: .82rem; margin-bottom: 10px; }
.tb-citation blockquote { font-size: 1.42rem; line-height: 1.45; }
.tb-citation figcaption { font-size: 1rem; margin-top: 14px; }
/* v4.57 — « + Créer le compte » dans la fiche projet */
.btn-creer-compte { margin-top: 6px; }
dialog.dlg-compte { border: 1px solid var(--carte-bord); border-radius: 12px; padding: 18px 20px; width: min(440px, 92vw); box-shadow: 0 18px 50px rgba(10, 37, 64, .3); }
dialog.dlg-compte label { margin-bottom: 10px; }
dialog.dlg-compte::backdrop { background: rgba(10, 37, 64, .35); }

/* v4.59 — compensation des retenues subies sur nos factures de vente (Actions rapides ③, états globaux) */
.ar-table tr.ar-comp td { background: #eef7ff; color: var(--m-fonce); font-style: italic; }
.ar-compensation { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--m-ligne); border-radius: 8px; background: var(--m-pale); }
.ar-compensation table { margin-top: 6px; background: #fff; }
tr.ligne-comp td { background: #eef7ff; font-style: italic; }

/* v4.60 — plein écran persistant : les pages s'ouvrent dans la coque (cadre plein écran) */
iframe.adk-coque { position: fixed; inset: 0; width: 100vw; height: 100vh; border: 0; z-index: 2147483000; background: var(--fond, #f4f7fb); }
html.coque-active, html.coque-active body { overflow: hidden; }
html.coque-active body > *:not(#adk-coque) { visibility: hidden; }

/* v4.60 — double authentification et sécurité */
input.code-2fa { font-size: 1.5rem; letter-spacing: .35em; text-align: center; font-family: ui-monospace, Consolas, monospace; max-width: 14ch; }
.da-etapes li { margin: 0 0 14px; line-height: 1.5; }
.da-qr { margin: 10px 0; padding: 10px; background: #fff; display: block; width: fit-content; border: 1px solid var(--m-ligne); border-radius: 10px; }
.da-cle { font-size: 1rem; letter-spacing: .08em; background: var(--m-clair); padding: 2px 8px; border-radius: 6px; }
.da-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.da-codes .da-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.da-codes .da-liste code { font-size: 1.1rem; padding: 8px; text-align: center; border: 1px dashed var(--m); border-radius: 8px; background: var(--m-pale); }
.inactivite-alerte { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2147483600; background: #0a2540; color: #fff;
  padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); display: flex; gap: 14px; align-items: center; font-size: .95rem; }
.inactivite-alerte .btn { background: #fff; color: #0a2540; }

/* v4.61 — suivi budgétaire avec révisions, dossier d'audit */
tr.ligne-alerte td { background: #fdecea; }
tr.ligne-marge td { background: #fff7e6; }
.var-hausse { color: #17663a; font-weight: 600; } .var-baisse { color: #b3261e; font-weight: 600; }
.versions-budget { margin-top: 8px; } .versions-budget table { margin-top: 6px; } tr.ligne-vigueur td { background: var(--m-pale); }
.revision-budget { border-left: 4px solid var(--m); margin-bottom: 12px; }
.audit-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; margin: 10px 0; }
.audit-etat { font-size: .85rem; } .audit-etat .barre { height: 6px; background: var(--m-clair); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.audit-etat .barre i { display: block; height: 6px; background: var(--m); }

/* Champ mot de passe avec bouton « œil » (afficher / masquer) */
.mdp-boite { position: relative; display: block; width: 100%; }
.mdp-boite > input { width: 100%; padding-right: 42px !important; box-sizing: border-box; }
.mdp-oeil { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 4px 6px;
  color: #5b6b7a; cursor: pointer; line-height: 0; border-radius: 6px; }
.mdp-oeil:hover, .mdp-oeil:focus-visible { color: var(--bleu, #0b3a5b); background: rgba(11,58,91,.08); outline: none; }
.mdp-oeil[aria-pressed="true"] { color: var(--bleu, #0b3a5b); }
input::-ms-reveal, input::-ms-clear { display: none; }   /* pas de 2e œil dans Edge */

/* v4.69 — petit calendrier sous la citation (jour en cours, mois, jours fériés du Niger) */
.tb-calendrier { display: none; }
.tableau-blanc.enroule .tb-calendrier { display: block; margin: 14px 4px 0; padding: 12px 14px 12px; background: #fff;
  border: 1px solid #dbe5ef; border-radius: 12px; box-shadow: 0 6px 18px rgba(10, 37, 64, .10); font-size: .86rem; color: #1b2b38; }
.cal-auj { font-size: .84rem; color: #3d5266; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #e6edf4; }
.cal-auj b { color: #0b3a5b; }
.cal-ferie-txt { color: #b3261e; font-weight: 600; }
.cal-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-tete b { font-size: .95rem; color: #0b3a5b; }
.cal-nav { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #cfdbe7; background: #f5f9fc; color: #0b3a5b;
  font-size: 1.05rem; line-height: 1; cursor: pointer; }
.cal-nav:hover { background: #e3eef8; }
.cal-grille { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.cal-grille th { font-size: .7rem; font-weight: 700; color: #6b7c8c; padding: 2px 0 4px; }
.cal-grille td { padding: 0; height: 28px; font-variant-numeric: tabular-nums; border-radius: 7px; }
.cal-grille td.we { color: #7a8794; }
.cal-grille td.ferie { background: #fdeceb; color: #b3261e; font-weight: 700; cursor: help; }
.cal-grille td.auj { background: #0b5ea8; color: #fff; font-weight: 700; box-shadow: 0 0 0 2px #bcdcf5; }
.cal-grille td.auj.ferie { background: #b3261e; }
.cal-feries { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed #dbe5ef; font-size: .8rem; }
.cal-feries li { display: flex; gap: 8px; padding: 2px 0; color: #3d5266; }
.cal-feries li span { min-width: 54px; color: #b3261e; font-weight: 700; }
.cal-feries li i { color: #8a96a3; font-style: normal; cursor: help; }
.cal-rien { margin: 8px 0 0; font-size: .78rem; color: #8a96a3; }
.cal-retour { margin-top: 8px; width: 100%; border: 1px solid #cfdbe7; background: #f5f9fc; color: #0b3a5b; border-radius: 8px;
  padding: 5px; font-size: .78rem; cursor: pointer; }

/* =====================================================================================================================
   v4.69 — Journaux et écritures en bleu : en haut un bleu franc (barre du journal, zone « Nouvelle écriture »), dans
   les écritures un bleu très doux, reposant pour les yeux (fond blanc, contreparties et sélection en bleu pâle).
   Le vert ne reste que pour les statuts (« Validée », bouton Valider, montants justes).
   ===================================================================================================================== */
body.theme-journal main.page, body.theme-journal, body.mode-integre {
  --m-nuit: #0a2540; --m-fonce: #0b3a5b; --m: #0f5e9c; --m-vif: #1d74c4; --m-ciel: #9cc9ef;
  --m-clair: #e9f2fb; --m-pale: #f5f9fd; --m-ligne: #d3e3f3;
  --fond: #f3f7fb; --carte-bord: #dce7f2; --th-fond: #edf4fb; --th-texte: #1e3a56; --bord: #d5e1ed;
  --vert-vif: #1d74c4; --vert-fonce: #0b3a5b; --vert-clair: #e9f2fb; --vert-pale: #f5f9fd;
}
body.mode-integre { background: #f5f9fd; }
/* bandeau du journal : bleu franc */
.solde-fige .ident-journal { background: linear-gradient(90deg, #0b3a5b, #0f5e9c); border-right-color: #d5e1ed; }
.solde-fige .ij-mois { color: #cfe6fb; }
.solde-fige .bloc { border-right-color: #e3ecf5; }
.solde-fige .bloc.principal { background: #e9f2fb; }
.solde-fige .bloc.principal .val { color: #0b3a5b; }
/* zone « Nouvelle écriture » */
.tiroir-saisie { border-color: #1d74c4 !important; background: #f2f7fc; box-shadow: 0 10px 24px rgba(11, 58, 91, .18), 0 0 0 4px #e1eefa !important; }
.tiroir-saisie .tiroir-tete { background: linear-gradient(90deg, #0b3a5b, #0f5e9c); }
.tiroir-saisie iframe { background: #f5f9fd; }
body.theme-journal .carte.entete-saisie, body.mode-integre .carte.entete-saisie {
  background: linear-gradient(180deg, #edf4fb 0%, #f7fbfe 100%); border-color: #cfe0f1; border-left-color: #1d74c4; }
body.theme-journal .carte.entete-saisie label, body.mode-integre .carte.entete-saisie label { color: #0b3a5b; }
/* les écritures : fond blanc, séparations et contreparties en bleu très pâle */
body.theme-journal table.journal tbody.ecriture:hover td { background: #f7fafd; }
body.theme-journal table.journal tr.contrepartie td, body.theme-journal .grille-saisie tr.auto td,
body.mode-integre .grille-saisie tr.auto td { background: #f1f6fb; color: #24527a; }
body.theme-journal .grille-saisie tr.auto input, body.mode-integre .grille-saisie tr.auto input { background: #fff; color: #24527a; border-color: #cfe0f1; }
body.theme-journal table.journal tbody.ecriture { border-top-color: #d5e1ed; }
body.theme-journal tbody.ecriture.choisie > tr > td { background: #eaf3fc !important; }
body.theme-journal tbody.ecriture.choisie > tr:first-child > td { box-shadow: inset 0 2px 0 #6aa6dc; }
body.theme-journal tbody.ecriture.choisie > tr:last-child > td { box-shadow: inset 0 -2px 0 #6aa6dc; }
body.theme-journal table.journal tbody.selectionnee td { background: #eaf3fc !important; }
body.theme-journal .champ-od input, body.mode-integre .champ-od input { border-color: #a9c9e8; background: #f5f9fd; }
.adk-panneau.flottant { border-color: #1d74c4; box-shadow: 0 18px 50px rgba(11, 58, 91, .32); }
.creer-flottant { background: #0f5e9c; } .creer-flottant:hover { background: #0b3a5b; }
/* les statuts gardent leur vert */
body.theme-journal .badge.validee, body.theme-journal .badge.valide, body.mode-integre .badge.validee,
body.theme-journal .badge.vert { background: #e3f4ea; color: #1e7b4a; border-color: #b6dfc6; }
body.theme-journal .solde-fige .val.ok, body.theme-journal .equilibre.ok, body.theme-journal .totaux .val.ok,
body.mode-integre .equilibre.ok, body.mode-integre .totaux .val.ok { color: #1e7b4a; }
body.theme-journal table.journal th, body.theme-journal table.grille-saisie th, body.mode-integre table.grille-saisie th { border-right-color: #d3e3f3; }
body.theme-journal .grille-saisie thead th, body.mode-integre .grille-saisie thead th { background: #e3eef9; color: #0b3a5b; }
body.theme-journal .zp-depot, body.mode-integre .zp-depot { border-color: #9cc3e6; }
body.theme-journal .zp-depot.survol, body.theme-journal .zp-depot:focus, body.mode-integre .zp-depot.survol { background: #eaf3fc; border-color: #1d74c4; }
body.theme-journal .zp-texte, body.mode-integre .zp-texte { color: #24527a; }
body.theme-journal .zp-liste li, body.theme-journal .zp-piece, body.mode-integre .zp-liste li { border-color: #cfe0f1; }
.choix-excel { display: inline-flex; gap: 0; }
.choix-excel .btn:first-child { border-radius: 8px 0 0 8px; border-right: 1px solid rgba(255,255,255,.35); }
.choix-excel .btn:last-child { border-radius: 0 8px 8px 0; }
/* lien à copier (lien des pièces pour le bailleur) */
.lien-a-copier { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.copie-lien { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 420px; flex-wrap: wrap; }
.copie-lien input { flex: 1 1 320px; min-width: 240px; font-family: ui-monospace, Consolas, monospace; font-size: .82rem;
  padding: 5px 8px; border: 1px solid #b9d3ea; border-radius: 6px; background: #fff; color: #0b3a5b; }
/* Relevés bancaires : projets sans journal Banque, banques de l'ONG sans projet */
.rel-grille tr.rel-sans-banque td { background: #fff8eb; }
.rel-grille tr.rel-titre-ong td { background: #edf4fb; color: #0b3a5b; padding-top: 10px; }
.rel-rattacher { display: inline-flex; gap: 6px; align-items: center; margin-left: 10px; }
.rel-rattacher select { max-width: 320px; }
.messages .lien-a-copier { padding-right: 150px; }   /* les boutons de la fenêtre (en haut à droite) ne cachent pas « Copier » */

/* v4.70 — agenda de l'accueil : vert, quelques fleurs, heure automatique */
.tableau-blanc.enroule .tb-calendrier { position: relative; overflow: hidden; padding: 0 0 14px; border: 1px solid #b9dfc6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath d='M58 38 C 40 34, 22 22, 14 6' stroke='%233f9d63' stroke-width='1.6' fill='none'/%3E%3Cellipse cx='30' cy='26' rx='7' ry='3' fill='%234caf72' transform='rotate(35 30 26)'/%3E%3Cellipse cx='44' cy='33' rx='7' ry='3' fill='%236cc08b' transform='rotate(15 44 33)'/%3E%3Cg fill='%23fbcfe8'%3E%3Cellipse cx='14' cy='0.8' rx='4.7' ry='7.2' transform='rotate(0 14 8)'/%3E%3Cellipse cx='14' cy='0.8' rx='4.7' ry='7.2' transform='rotate(72 14 8)'/%3E%3Cellipse cx='14' cy='0.8' rx='4.7' ry='7.2' transform='rotate(144 14 8)'/%3E%3Cellipse cx='14' cy='0.8' rx='4.7' ry='7.2' transform='rotate(216 14 8)'/%3E%3Cellipse cx='14' cy='0.8' rx='4.7' ry='7.2' transform='rotate(288 14 8)'/%3E%3C/g%3E%3Ccircle cx='14' cy='8' r='3.1' fill='%23fcd34d'/%3E%3Cg fill='%23ffffff'%3E%3Cellipse cx='36' cy='25.1' rx='3.2' ry='5.0' transform='rotate(0 36 30)'/%3E%3Cellipse cx='36' cy='25.1' rx='3.2' ry='5.0' transform='rotate(72 36 30)'/%3E%3Cellipse cx='36' cy='25.1' rx='3.2' ry='5.0' transform='rotate(144 36 30)'/%3E%3Cellipse cx='36' cy='25.1' rx='3.2' ry='5.0' transform='rotate(216 36 30)'/%3E%3Cellipse cx='36' cy='25.1' rx='3.2' ry='5.0' transform='rotate(288 36 30)'/%3E%3C/g%3E%3Ccircle cx='36' cy='30' r='2.2' fill='%23f59e0b'/%3E%3C/svg%3E") no-repeat right -4px bottom -2px / 74px auto, linear-gradient(180deg, #f2faf4 0%, #ffffff 55%);
  box-shadow: 0 8px 22px rgba(20, 83, 45, .14); }
.tb-calendrier .cal-auj { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 10px; padding: 12px 14px 12px 16px; border: 0; color: #fff;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 70'%3E%3Cpath d='M2 68 C 30 60, 55 40, 70 12' stroke='%233f9d63' stroke-width='2' fill='none'/%3E%3Cpath d='M10 68 C 40 64, 80 58, 118 40' stroke='%233f9d63' stroke-width='1.6' fill='none'/%3E%3Cellipse cx='40' cy='52' rx='7' ry='3' fill='%234caf72' transform='rotate(-35 40 52)'/%3E%3Cellipse cx='58' cy='30' rx='7' ry='3' fill='%234caf72' transform='rotate(-55 58 30)'/%3E%3Cellipse cx='78' cy='55' rx='7' ry='3' fill='%236cc08b' transform='rotate(-15 78 55)'/%3E%3Cellipse cx='100' cy='46' rx='7' ry='3' fill='%234caf72' transform='rotate(-25 100 46)'/%3E%3Cg fill='%23f9a8c4'%3E%3Cellipse cx='70' cy='3.0' rx='7.2' ry='11.0' transform='rotate(0 70 14)'/%3E%3Cellipse cx='70' cy='3.0' rx='7.2' ry='11.0' transform='rotate(72 70 14)'/%3E%3Cellipse cx='70' cy='3.0' rx='7.2' ry='11.0' transform='rotate(144 70 14)'/%3E%3Cellipse cx='70' cy='3.0' rx='7.2' ry='11.0' transform='rotate(216 70 14)'/%3E%3Cellipse cx='70' cy='3.0' rx='7.2' ry='11.0' transform='rotate(288 70 14)'/%3E%3C/g%3E%3Ccircle cx='70' cy='14' r='4.8' fill='%23fcd34d'/%3E%3Cg fill='%23ffffff'%3E%3Cellipse cx='30' cy='42.3' rx='5.0' ry='7.7' transform='rotate(0 30 50)'/%3E%3Cellipse cx='30' cy='42.3' rx='5.0' ry='7.7' transform='rotate(72 30 50)'/%3E%3Cellipse cx='30' cy='42.3' rx='5.0' ry='7.7' transform='rotate(144 30 50)'/%3E%3Cellipse cx='30' cy='42.3' rx='5.0' ry='7.7' transform='rotate(216 30 50)'/%3E%3Cellipse cx='30' cy='42.3' rx='5.0' ry='7.7' transform='rotate(288 30 50)'/%3E%3C/g%3E%3Ccircle cx='30' cy='50' r='3.4' fill='%23f59e0b'/%3E%3Cg fill='%23fbcfe8'%3E%3Cellipse cx='112' cy='30.3' rx='5.0' ry='7.7' transform='rotate(0 112 38)'/%3E%3Cellipse cx='112' cy='30.3' rx='5.0' ry='7.7' transform='rotate(72 112 38)'/%3E%3Cellipse cx='112' cy='30.3' rx='5.0' ry='7.7' transform='rotate(144 112 38)'/%3E%3Cellipse cx='112' cy='30.3' rx='5.0' ry='7.7' transform='rotate(216 112 38)'/%3E%3Cellipse cx='112' cy='30.3' rx='5.0' ry='7.7' transform='rotate(288 112 38)'/%3E%3C/g%3E%3Ccircle cx='112' cy='38' r='3.4' fill='%23fcd34d'/%3E%3Cg fill='%23fde68a'%3E%3Cellipse cx='88' cy='50.5' rx='3.6' ry='5.5' transform='rotate(0 88 56)'/%3E%3Cellipse cx='88' cy='50.5' rx='3.6' ry='5.5' transform='rotate(72 88 56)'/%3E%3Cellipse cx='88' cy='50.5' rx='3.6' ry='5.5' transform='rotate(144 88 56)'/%3E%3Cellipse cx='88' cy='50.5' rx='3.6' ry='5.5' transform='rotate(216 88 56)'/%3E%3Cellipse cx='88' cy='50.5' rx='3.6' ry='5.5' transform='rotate(288 88 56)'/%3E%3C/g%3E%3Ccircle cx='88' cy='56' r='2.4' fill='%23f97316'/%3E%3C/svg%3E") no-repeat left -10px bottom -8px / 118px auto, linear-gradient(120deg, #14532d 0%, #1e7b4a 55%, #34a067 100%); }
.tb-calendrier .cal-date { display: flex; flex-direction: column; gap: 1px; position: relative; z-index: 1; padding-left: 64px; }
.tb-calendrier .cal-date-lib { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #c9f1d6; }
.tb-calendrier .cal-date b { color: #fff; font-size: .96rem; }
.tb-calendrier .cal-ferie-txt { color: #fde68a; font-weight: 700; font-size: .78rem; }
.cal-horloge { display: flex; align-items: center; gap: 8px; flex: none; }
.cal-cadran { width: 46px; height: 46px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.cal-cadran .cad-fond { fill: #fffdf7; stroke: #bbf7d0; stroke-width: 1.5; }
.cal-cadran .cad-trait { stroke: #3f9d63; stroke-width: 1.1; stroke-linecap: round; }
.cal-cadran .aig-h { stroke: #14532d; stroke-width: 2.4; stroke-linecap: round; }
.cal-cadran .aig-m { stroke: #1e7b4a; stroke-width: 1.7; stroke-linecap: round; }
.cal-cadran .aig-s { stroke: #e11d48; stroke-width: .8; stroke-linecap: round; }
.cal-cadran .cad-centre { fill: #e11d48; }
.cal-heure { font-variant-numeric: tabular-nums; line-height: 1; }
.cal-heure b { font-size: 1.55rem; font-weight: 800; color: #fff; letter-spacing: .02em; }
.cal-heure small { font-size: .85rem; color: #c9f1d6; font-weight: 600; }
.tb-calendrier .cal-corps { padding: 0 14px; position: relative; z-index: 1; }
.tb-calendrier .cal-tete b { color: #14532d; }
.tb-calendrier .cal-nav { border-color: #b9dfc6; background: #ecf8f0; color: #14532d; }
.tb-calendrier .cal-nav:hover { background: #d4f0de; }
.tb-calendrier .cal-grille th { color: #3f7f57; }
.tb-calendrier .cal-grille td.we { color: #7b9a86; }
.tb-calendrier .cal-grille td.auj { background: #1e7b4a; color: #fff; box-shadow: 0 0 0 2px #bbf7d0; }
.tb-calendrier .cal-grille td.ferie { background: #fde8ef; color: #be185d; }
.tb-calendrier .cal-grille td.auj.ferie { background: #be185d; color: #fff; }
.tb-calendrier .cal-grille td:not(:empty):not(.auj):hover { background: #ecf8f0; }
.tb-calendrier .cal-feries { border-top-color: #cfe9d8; }
.tb-calendrier .cal-feries li span { color: #be185d; }
.tb-calendrier .cal-feries li::before { content: "✿"; color: #f472b6; margin-right: -2px; }
.tb-calendrier .cal-retour { border-color: #b9dfc6; background: #ecf8f0; color: #14532d; }
.tb-calendrier .cal-rien { color: #6b8f78; }
.tb-calendrier .cal-auj { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 14px 10px; background-size: 104px auto, auto;
  background-position: left -6px bottom -6px, 0 0; }
.tb-calendrier .cal-date { padding-left: 0; }
.tb-calendrier .cal-horloge { align-self: flex-end; }
.tableau-blanc.enroule .tb-calendrier { padding-bottom: 30px; background-size: 58px auto, auto; }
.tb-calendrier .cal-grille th { background: #eaf6ee; color: #2f6f47; border-bottom: 1px solid #cfe9d8; }
.tb-calendrier .cal-grille td { border-color: #e3f1e7; }

/* v4.71 — retour d'un journal : la ligne du journal quitté est remise en vue et clignote doucement */
#liste-journaux tr.revenu td { animation: adk-revenu 2.4s ease-out; }
@keyframes adk-revenu { 0%, 30% { background: #fff1b8; } 100% { background: transparent; } }

/* v4.71 — boutons de scan : plus grands et colorés (pièce justificative = orange, chèque / virement = turquoise) */
.btn.btn-justif, .btn.btn-cheque, .btn.btn-scan-direct {
  font-size: 13px !important; font-weight: 700; padding: 6px 12px !important; border-radius: 8px; border-width: 1px; border-style: solid;
  box-shadow: 0 2px 0 rgba(0,0,0,.12), 0 3px 8px rgba(0,0,0,.08); color: #fff !important; text-shadow: 0 1px 0 rgba(0,0,0,.18);
  white-space: nowrap; cursor: pointer; line-height: 1.25; }
.btn.btn-justif { background: linear-gradient(#f39a2b, #dd7a0c); border-color: #c26a08; }
.btn.btn-justif:hover { background: linear-gradient(#f7a940, #e5850f); }
.btn.btn-justif.ok { background: linear-gradient(#3bb36a, #23914f); border-color: #1d7c43; }
.btn.btn-cheque { background: linear-gradient(#1fb5b0, #128f8b); border-color: #0e7a76; }
.btn.btn-cheque:hover { background: linear-gradient(#2cc4bf, #149994); }
.btn.btn-cheque.ok { background: linear-gradient(#2f86d6, #1f69b0); border-color: #195a98; }
.btn.btn-scan-direct { background: linear-gradient(#8e5bd6, #6c3fb4); border-color: #5b329b; }
.btn.btn-scan-direct:hover { background: linear-gradient(#9d6ce0, #7646c2); }
.btn.btn-scan-direct:disabled { opacity: .7; cursor: wait; }
.col-actions .pile .btn-justif, .col-actions .pile .btn-cheque { display: inline-block; margin: 3px 0; }
.form-cheque-ecr { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.zp-chargeur { display: inline-flex; gap: 4px; align-items: center; color: #5b329b; }
.scan-options { display: flex; flex-wrap: wrap; gap: 8px 16px; background: #f4f8fc; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 13.5px; }
.scan-options label { display: inline-flex; gap: 6px; align-items: center; }
.grille-fiscale input.cell.etat-sal::placeholder { color: #c2620a; font-style: italic; font-weight: 600; }
.etat-sal-leg { color: #c2620a; font-weight: 600; font-style: italic; }

/* v4.71 — accueil : onglets du bas sur une seule ligne, chacun sa couleur ; tuile Messagerie */
.hero-onglets.hero-onglets-ligne { flex-wrap: nowrap; gap: 6px; left: 12px; right: 12px; max-width: none; justify-content: flex-end; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.hero-onglets.hero-onglets-ligne::-webkit-scrollbar { display: none; }
.hero-onglets-ligne .hero-onglet-fct { flex: none; white-space: nowrap; font-size: .76rem; padding: 6px 11px; color: #fff; border: 1px solid rgba(255,255,255,.35);
  text-shadow: 0 1px 1px rgba(0,0,0,.25); box-shadow: 0 3px 10px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.25); }
.hero-onglets-ligne .hero-onglet-fct:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hero-onglets-ligne .ho-c1 { background: linear-gradient(#2f7fd1, #1d62a8); }
.hero-onglets-ligne .ho-c2 { background: linear-gradient(#8a5ad0, #6a3fae); }
.hero-onglets-ligne .ho-c3 { background: linear-gradient(#1eaaa4, #138883); }
.hero-onglets-ligne .ho-c4 { background: linear-gradient(#f2a33a, #d9820f); }
.hero-onglets-ligne .ho-c5 { background: linear-gradient(#3fae5f, #2a8a47); }
.hero-onglets-ligne .ho-c6 { background: linear-gradient(#e35d6a, #c23b4a); }
.tuile-messagerie .tuile-icone { background: linear-gradient(135deg, #f0a03a, #d7741a) !important; }

/* v4.71 — menus déroulants du haut en relief (bordure, ombre portée, léger dégradé) */
.menu .sous-menu { border: 1px solid #b9c6d6 !important; border-top: 3px solid var(--m-fonce, #1d5fa8) !important; border-radius: 4px 4px 12px 12px !important;
  background: linear-gradient(#ffffff, #f4f7fb) !important;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(255,255,255,.9) inset, 0 14px 30px rgba(15, 35, 70, .28), 0 4px 8px rgba(15, 35, 70, .18), 0 0 0 1px rgba(255,255,255,.6) !important;
  padding: 6px !important; }
.menu .sous-menu a { border: 1px solid transparent; border-radius: 8px; margin: 1px 0; }
.menu .sous-menu a:hover, .menu .sous-menu a:focus-visible { border-color: #c9d8ec; background: linear-gradient(#f3f8fe, #e5eef9) !important;
  box-shadow: 0 1px 2px rgba(15,35,70,.12), inset 0 1px 0 #fff; }
.menu .sous-menu hr { border: 0; border-top: 1px solid #d6dfea; border-bottom: 1px solid #fff; margin: 5px 6px; }
.menu .sous-menu .titre-groupe { background: linear-gradient(#e9f0f8, #dde7f3); border: 1px solid #cdd9e7; border-radius: 6px; margin: 6px 2px 3px; }

/* v4.71 — Sécurité sociale, état du personnel */
.ss-lignes { display: flex; flex-direction: column; gap: 14px; }
.ss-ligne { display: grid; grid-template-columns: 64px 1fr 260px auto; gap: 16px; align-items: center; background: #fff; border: 1px solid #cfdae6;
  border-left: 6px solid #2a8a47; border-radius: 14px; padding: 16px 18px; color: inherit; text-decoration: none; box-shadow: 0 6px 18px rgba(15,35,70,.10); }
.ss-ligne.ss-assurance { border-left-color: #6a3fae; }
.ss-ligne:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,35,70,.16); text-decoration: none; }
.ss-ligne h3 { margin: 0 0 4px; } .ss-ligne p { margin: 0; color: #55616e; font-size: .9rem; }
.ss-icone { font-size: 38px; text-align: center; }
.ss-chiffres { text-align: right; }
.ss-table tbody tr { cursor: pointer; } .ss-table tbody tr.choisie td { background: #fff7d6; }
.ss-totaux { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.ss-totaux span { background: #f4f8fc; border: 1px solid #d6e2ef; border-radius: 10px; padding: 6px 12px; }
.ss-totaux small { display: block; color: #66717d; font-size: .75rem; } .ss-totaux .tot { background: #e8f5ec; border-color: #b9dfc4; }
.cases-cat { display: flex; flex-wrap: wrap; gap: 4px 12px; } .cases-cat label { display: inline-flex; gap: 4px; align-items: center; font-weight: 400; }
@media (max-width: 760px) { .ss-ligne { grid-template-columns: 40px 1fr; } .ss-chiffres { text-align: left; grid-column: 2; } }

/* v4.71 — sélection d'écritures (clic, Ctrl + clic, Maj + clic) et somme en haut à droite */
table.sel-table tbody tr[data-d], table.sel-table tbody tr[data-c] { cursor: pointer; }
table.sel-table tbody tr.sel-choisie > td { background: #ffe9a8 !important; box-shadow: inset 0 1px 0 #f1c94f, inset 0 -1px 0 #f1c94f; }
table.sel-table tbody tr.sel-revenu > td { animation: adk-revenu 2.4s ease-out; }
.sel-badge { position: fixed; top: 64px; right: 16px; z-index: 8500; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: #fffdf3; border: 1px solid #e3c25a; border-left: 5px solid #e0a800; border-radius: 12px; padding: 8px 10px 8px 14px;
  box-shadow: 0 10px 26px rgba(15,35,70,.22); font-size: 13.5px; max-width: calc(100vw - 32px); }
.sel-badge .sel-n { font-weight: 700; color: #6b5200; }
.sel-badge .sel-total { font-size: 15px; } .sel-badge .sel-total.deb b { color: #1d5fa8; } .sel-badge .sel-total.cre b { color: #b3261e; }
.sel-badge button { border: 0; background: #f1e3b0; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.cred-tiers > td { background: #fdecea; } .cred-tiers > td:first-child { box-shadow: inset 4px 0 0 #d93025; }
.retour-btn { background: linear-gradient(#fff, #eef3f9); border-color: #b9c8da; font-weight: 600; }
/* liste F4 */
.dlg-f4 { width: 720px; max-width: 96vw; border: 1px solid #b9c6d6; border-radius: 14px; padding: 0; box-shadow: 0 20px 50px rgba(15,35,70,.35); }
.dlg-f4 .dlg-tete { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(#f4f8fc, #e6eef8); border-bottom: 1px solid #cdd9e7; cursor: move; }
.dlg-f4 .sep { flex: 1; } .dlg-f4 .f4-fermer { border: 0; background: none; font-size: 17px; cursor: pointer; }
.f4-onglets button { border: 1px solid #c4d2e3; background: #fff; border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; }
.f4-onglets button.actif { background: var(--m-fonce, #1d5fa8); color: #fff; border-color: transparent; }
.dlg-f4 .f4-q { width: calc(100% - 24px); margin: 10px 12px; padding: 8px 10px; font-size: 14px; }
.f4-liste { max-height: 52vh; overflow: auto; margin: 0 12px; border: 1px solid #e1e8f0; border-radius: 8px; }
.f4-liste table { width: 100%; border-collapse: collapse; } .f4-liste td { padding: 5px 8px; border-bottom: 1px solid #eef2f6; cursor: pointer; font-size: 13px; }
.f4-liste tr.actif td { background: #dbe9f8; } .dlg-f4 .f4-compte { margin: 6px 12px 10px; }

/* v4.71 — balance commentée */
.balance-table tr.bal-orange > td { background: #fff4e0; }
.balance-table tr.bal-rouge > td { background: #fde8e6; }
.balance-table tr.bal-cred > td:nth-child(2) { color: #b3261e; font-weight: 600; }
.balance-table tr.bal-585 > td { background: #f3e8ff !important; font-weight: 700; }
.balance-table tr.bal-585.bal-rouge > td { background: #f8d7f0 !important; box-shadow: inset 0 0 0 1px #c03fa0; }
.balance-table td.solde-net { font-weight: 700; white-space: nowrap; }
.bal-legende { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 8px; font-size: 12.5px; }
.bal-legende .lg { padding: 2px 10px; border-radius: 6px; border: 1px solid #ddd; }
.lg-rouge { background: #fde8e6; } .lg-orange { background: #fff4e0; } .lg-585 { background: #f3e8ff; font-weight: 700; } .lg-cred { color: #b3261e; font-weight: 600; }
.btn-synthese { font-weight: 700; } .btn-synthese.alerte { background: linear-gradient(#e35d6a, #c23b4a); color: #fff; border-color: #a52f3c; }
.btn-synthese.attention { background: linear-gradient(#f2a33a, #d9820f); color: #fff; border-color: #b96c0b; }
.btn-synthese .pastille { background: #fff; color: #b3261e; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.dlg-synthese { width: 980px; max-width: 96vw; max-height: 90vh; border: 1px solid #b9c6d6; border-radius: 14px; padding: 0; box-shadow: 0 20px 50px rgba(15,35,70,.35); }
.dlg-synthese .dlg-tete { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: linear-gradient(#f4f8fc, #e6eef8); border-bottom: 1px solid #cdd9e7; position: sticky; top: 0; }
.dlg-synthese .sep { flex: 1; } .dlg-synthese .ds-corps { padding: 12px 16px; overflow: auto; }
.syn-groupe { border: 1px solid #e3e8ee; border-left: 5px solid #e0a800; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; background: #fffdf6; }
.syn-groupe.syn-rouge { border-left-color: #c23b4a; background: #fff7f6; }
.syn-groupe h3 { margin: 0 0 4px; font-size: 15px; } .syn-ecriture { margin: 0 0 6px; font-size: 13px; }

/* v4.71 — notifications système simplifiées : rubriques dépliables, un projet par ligne */
.notif-simple { display: flex; flex-direction: column; gap: 10px; max-width: 1100px; }
.notif-rubrique { background: #fff; border: 1px solid #d9e2ec; border-left: 6px solid #2f6fb0; border-radius: 12px; box-shadow: 0 3px 10px rgba(15,35,70,.07); }
.notif-rubrique.rouge { border-left-color: #c62828; } .notif-rubrique.orange { border-left-color: #e08a00; }
.notif-rubrique > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-weight: 700; font-size: 1rem; list-style: none; }
.notif-rubrique > summary::-webkit-details-marker { display: none; }
.notif-rubrique > summary::after { content: "▸"; margin-left: auto; color: #7a8796; transition: transform .15s; }
.notif-rubrique[open] > summary::after { transform: rotate(90deg); }
.notif-rubrique .nr-titre { flex: none; }
.nr-aide { margin: -4px 16px 6px; }
.nr-liste { list-style: none; margin: 0; padding: 0 16px 12px; }
.nr-liste > li { padding: 7px 0; border-top: 1px solid #eef2f6; }
.nr-projet > summary { cursor: pointer; } .nr-projet[open] > summary { margin-bottom: 6px; }
.nr-lignes { list-style: none; margin: 0 0 8px 18px; padding: 0; }
.nr-lignes li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed #edf1f5; }
.menu .sous-menu { margin-top: 6px; border-top: 4px solid #2f86d6 !important; border-right: 3px solid #93a8c2 !important; border-bottom: 3px solid #93a8c2 !important;
  border-left: 1px solid #c3d0df !important; border-radius: 10px !important; }
.menu .sous-menu::before { content: ""; position: absolute; top: -11px; left: 22px; border: 7px solid transparent; border-bottom-color: #2f86d6; }
.menu .sous-menu::after { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.situation-cpt td.col-jx { min-width: 190px; max-width: 260px; white-space: normal; line-height: 1.35; }
.sel-badge { right: 150px; }
@media (max-width: 900px) { .sel-badge { right: 12px; top: auto; bottom: 12px; } }
.sel-badge { top: 104px; right: 24px; padding: 5px 8px 5px 12px; }
@media (max-width: 900px) { .sel-badge { right: 12px; top: auto; bottom: 12px; } }

/* v4.72 — boutons des écritures plus grands et colorés (journal, détail, zone des pièces) */
table.journal td.col-actions { width: 230px; min-width: 230px; }
table.journal .pile { display: grid !important; grid-template-columns: 1fr 1fr; gap: 5px !important; align-items: stretch; }
table.journal .pile > * { min-width: 0; }
table.journal .pile form.inline, table.journal .pile form { display: block; margin: 0; }
table.journal .pile .btn.act, table.journal .pile .btn.btn-justif, table.journal .pile .btn.btn-cheque,
table.journal .pile form .btn.act {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; box-sizing: border-box;
  font-size: .84rem !important; font-weight: 700; padding: 6px 8px !important; border-radius: 8px; white-space: nowrap;
  color: #fff !important; border: 1px solid rgba(0,0,0,.18); text-shadow: 0 1px 0 rgba(0,0,0,.2); text-decoration: none;
  box-shadow: 0 2px 0 rgba(0,0,0,.14), 0 3px 8px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.25); }
table.journal .pile .btn.act:hover, table.journal .pile .btn.btn-justif:hover, table.journal .pile .btn.btn-cheque:hover { filter: brightness(1.08); transform: translateY(-1px); }
table.journal .pile .btn.btn-justif, table.journal .pile .btn.btn-cheque { margin: 0 !important; }
table.journal .pile form.form-piece, table.journal .pile form.form-cheque { grid-column: auto; }
.btn.act-dp { background: linear-gradient(#3b8de0, #1f69b0) !important; }
.btn.act-vir { background: linear-gradient(#2c5a8f, #1c3f68) !important; }
.btn.act-dap { background: linear-gradient(#8a5ad0, #6a3fae) !important; }
.btn.act-od { background: linear-gradient(#3fae5f, #2a8a47) !important; grid-column: 1 / -1; }
.btn.act-od-fait { background: linear-gradient(#7fbf91, #5a9e6d) !important; grid-column: 1 / -1; }
.btn.act-valider { background: linear-gradient(#18a058, #0f7a42) !important; }
.btn.act-modif { background: linear-gradient(#f4c542, #d9a514) !important; color: #3d2c00 !important; text-shadow: none !important; }
.btn.act-voir { background: linear-gradient(#6c7a8a, #4f5c6b) !important; }
.btn.act-pj { background: linear-gradient(#e35d6a, #c23b4a) !important; }
.btn.act-chq-voir { background: linear-gradient(#139a95, #0d7571) !important; }
table.journal .pile .btn.btn-justif { background: linear-gradient(#f39a2b, #dd7a0c) !important; }
table.journal .pile .btn.btn-justif.ok { background: linear-gradient(#3bb36a, #23914f) !important; }
table.journal .pile .btn.btn-cheque { background: linear-gradient(#1fb5b0, #128f8b) !important; }
table.journal .pile .btn.btn-cheque.ok { background: linear-gradient(#2f86d6, #1f69b0) !important; }
/* zone « pièces scannées » (saisie et détail de l'écriture) */
.zp-boutons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.zp-boutons .btn.act, .zp-boutons .btn-scan-direct { font-size: 13px !important; font-weight: 700; padding: 7px 13px !important; border-radius: 8px;
  color: #fff !important; border: 1px solid rgba(0,0,0,.18); text-shadow: 0 1px 0 rgba(0,0,0,.2);
  box-shadow: 0 2px 0 rgba(0,0,0,.14), 0 3px 8px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.25); cursor: pointer; }
.btn.act-fichier { background: linear-gradient(#3b8de0, #1f69b0) !important; }
.btn.act-camera { background: linear-gradient(#1fb5b0, #128f8b) !important; }
.btn.act-reglage { background: linear-gradient(#8c98a6, #66727f) !important; }
.form-cheque-ecr .btn-piece { font-size: 14px !important; padding: 8px 16px !important; }
table.journal td.col-actions { width: 196px; min-width: 196px; max-width: 196px; }
table.journal .pile .btn.act, table.journal .pile .btn.btn-justif, table.journal .pile .btn.btn-cheque,
table.journal .pile form .btn.act { font-size: .8rem !important; padding: 5px 5px !important; }
table.journal td.col-actions { width: 132px; min-width: 132px; max-width: 132px; }
table.journal .pile { grid-template-columns: 1fr; gap: 4px !important; }
table.journal td.col-actions { width: 122px; min-width: 122px; max-width: 122px; }

/* v4.73 — boutons des écritures resserrés (rectangles plus petits) */
table.journal td.col-actions { width: 108px; min-width: 108px; max-width: 108px; }
table.journal .pile { gap: 3px !important; }
table.journal .pile .btn.act, table.journal .pile .btn.btn-justif, table.journal .pile .btn.btn-cheque,
table.journal .pile form .btn.act { font-size: .74rem !important; padding: 2px 4px !important; border-radius: 6px; line-height: 1.3;
  box-shadow: 0 1px 0 rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.22); }
.zp-boutons { gap: 6px; }
.zp-boutons .btn.act, .zp-boutons .btn-scan-direct { font-size: 12px !important; padding: 4px 10px !important; border-radius: 7px; }
.form-cheque-ecr .btn-piece { font-size: 12.5px !important; padding: 5px 12px !important; }
.btn.btn-justif, .btn.btn-cheque, .btn.btn-scan-direct { padding: 4px 10px !important; font-size: 12px !important; }

/* v4.74 — dossiers signés */
.compteurs-dossiers .signe b { color: #6a3fae; }
.btn.act-signer { background: linear-gradient(#8a5ad0, #6a3fae) !important; color: #fff !important; border-color: #5b329b; font-weight: 700; }
[data-471][hidden], [data-banque][hidden] { display: none !important; }
.formulaire .champ div[id^="id_projets"], .formulaire .champ ul[id^="id_projets"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 14px; padding: 6px 0; }
.formulaire .champ div[id^="id_projets"] label, .formulaire .champ ul[id^="id_projets"] label { display: flex; gap: 6px; align-items: center; font-weight: 400; }

/* v4.77 — boutons de conversion FCFA / EUR / USD */
.dv-bascule { display: inline-flex; align-items: center; gap: 0; border: 1px solid #c4d2e3; border-radius: 999px; overflow: hidden; background: #fff; vertical-align: middle; }
.dv-bascule button { border: 0; background: none; padding: 3px 10px; font-weight: 700; font-size: 12px; cursor: pointer; color: #34485e; }
.dv-bascule button + button { border-left: 1px solid #e1e8f0; }
.dv-bascule button.actif { background: linear-gradient(#2f86d6, #1f69b0); color: #fff; }
.dv-bascule button[data-dv="EUR"].actif { background: linear-gradient(#3b5bdb, #2b44a8); }
.dv-bascule button[data-dv="USD"].actif { background: linear-gradient(#2a8a47, #1f6c37); }
.dv-bascule .dv-cours { padding: 3px 8px; font-size: 11px; color: #66717d; border-left: 1px solid #e1e8f0; text-decoration: none; white-space: nowrap; }
.dv-bascule .dv-info:empty { display: none; } .dv-bascule .dv-info { padding: 0 8px; color: #1f6c37; font-weight: 600; }
.dv-conv { color: #1f4fa8 !important; font-style: italic; }
.col-dv { color: #1f4fa8; font-size: .9em; white-space: nowrap; }
.pp-detail { list-style: none; margin: 4px 0 0; padding: 0; max-height: 220px; overflow: auto; font-size: 12px; min-width: 300px; } .pp-detail li { padding: 3px 0; border-bottom: 1px dashed #e6ebf1; }
/* v4.78 — code SWIFT / BIC : colonne affichée pour les virements en dollars ou en euros */
#form-vir:not(.mode-international) .col-swift { display: none; }
#form-vir.mode-international .b-swift { background: #fffbea; }

/* v4.80 — Accueil : tuile Suivi budgétaire ; suivi budgétaire des projets du chef de projet / logistique / RH */
.tuile-budget .tuile-icone { background: linear-gradient(135deg, #2bb673, #13804e) !important; }
.mes-projets { margin: 18px 0 8px; }
.mes-projets h2 { color: #fff; font-size: 1.15rem; margin: 0 0 10px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.mes-projets h2 small { font-weight: 400; opacity: .85; font-size: .8rem; }
.mp-carte { background: #fff; border-radius: 14px; padding: 14px 18px; box-shadow: 0 6px 22px rgba(10,40,80,.18); margin-bottom: 14px; }
.mp-carte header { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #1f4e79; font-size: 1.02rem; }
.mp-chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 10px; }
.mp-chiffres span { background: #f3f7fb; border-radius: 10px; padding: 8px 12px; border-left: 4px solid #2f6fb0; }
.mp-chiffres small { display: block; color: #5b6b7c; font-size: .74rem; }
.mp-chiffres b { font-size: 1.12rem; color: #12324f; font-variant-numeric: tabular-nums; }
.mp-chiffres span.pos { border-left-color: #2e9d5b; } .mp-chiffres span.pos b { color: #1d7a44; }
.mp-chiffres span.neg { border-left-color: #c62828; } .mp-chiffres span.neg b { color: #c62828; }
.mp-barre { position: relative; height: 10px; border-radius: 6px; background: #e7edf3; overflow: hidden; }
.mp-barre em { position: absolute; inset: 0 auto 0 0; background: #f2c14e; }
.mp-barre i { position: absolute; inset: 0 auto 0 0; background: #2e9d5b; z-index: 1; }
.mp-taux { margin: 6px 0 4px; font-size: .84rem; color: #445; }
.mp-dossiers { display: flex; gap: 18px; margin: 6px 0; font-size: .9rem; }
.mp-dossiers a { text-decoration: none; font-weight: 600; }
.mp-dep { background: #fdecec; border-radius: 10px; padding: 8px 12px; margin-top: 8px; color: #8a1c1c; font-size: .86rem; }
.mp-dep ul { margin: 4px 0 0; padding-left: 18px; } .mp-dep .neg { color: #c62828; }
.mp-ok { color: #1d7a44; font-size: .86rem; margin: 6px 0 0; }
@media (max-width: 800px) { .mp-chiffres { grid-template-columns: repeat(2, 1fr); } }

/* v4.82 — Ciel de l'accueil : ciel d'été de 7 h à 19 h, nuit étoilée (voie lactée) de 19 h à 7 h */
body.page-accueil { background: #1d63c8 url("accueil/ciel_jour.jpg") center top / cover no-repeat fixed; }
body.page-accueil.nuit { background: #0b1736 url("accueil/ciel_nuit.jpg") center bottom / cover no-repeat fixed; }
body.page-accueil.nuit .entete { background: linear-gradient(90deg, #050b1f 0%, #101d48 100%); border-bottom-color: #7b8ee6; }
body.page-accueil.nuit .accueil-v41 .hero-accueil { box-shadow: 0 10px 34px rgba(0, 0, 0, .45); }
body.page-accueil.nuit .tuile { box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
body.page-accueil .mes-projets h2 { text-shadow: 0 1px 4px rgba(0, 0, 0, .55); }

/* v5.0 — Espaces RH et Logistique */
.badge.info { background: #e6f0fb; color: #1e5fa8; border-color: #bcd5f2; }
.badge.rejete { background: #fdecec; color: #b3261e; border-color: #f3c9c5; }
.badge.attente { background: #fff4dc; color: #a35f00; border-color: #f2d59a; }
.rh-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.rh-carte { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--m-ligne, #d9e2ec); border-left: 5px solid var(--m, #0369a1);
  border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; box-shadow: 0 2px 8px rgba(10,40,80,.06); }
.rh-carte:hover { box-shadow: 0 6px 16px rgba(10,40,80,.12); }
.rh-carte small { color: var(--gris, #667); font-size: .78rem; } .rh-carte b { font-size: 1.35rem; color: var(--m-fonce, #0b3a5b); font-variant-numeric: tabular-nums; }
.rh-carte span { font-size: .8rem; color: var(--gris, #667); } .rh-carte.alerte { border-left-color: #c62828; } .rh-carte.alerte b { color: #c62828; }
.rh-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.rh-grille .carte h2 { font-size: 1rem; margin: 0 0 8px; } .rh-grille .carte p { margin: 4px 0; font-size: .9rem; }
.rh-form .grille-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; }
.rh-form .champ input:not([type=checkbox]), .rh-form .champ select, .rh-form .champ textarea { width: 100%; }
.rh-form .champ.large { grid-column: span 2; }
.rh-form .carte { margin-bottom: 14px; } .rh-form .carte h2 { font-size: 1.02rem; margin: 0 0 10px; }
.rh-rep { position: relative; display: flex; justify-content: space-between; padding: 6px 8px; margin-bottom: 5px; border-radius: 6px; background: #f3f7fb; overflow: hidden; font-size: .9rem; }
.rh-rep span, .rh-rep b { position: relative; z-index: 1; } .rh-rep i { position: absolute; inset: 0 auto 0 0; background: #d6e8fa; }
.paie-table input, .paie-table textarea { font-size: .82rem; padding: 3px 4px; }
.w50 { width: 56px; } .w90 { width: 92px; } .w160 { width: 160px; } .nowrap { white-space: nowrap; }
.paie-table td { vertical-align: top; }
.etapes-achat { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; padding: 0; list-style: none; counter-reset: etape; }
.etapes-achat li { counter-increment: etape; flex: 1 1 120px; font-size: .8rem; padding: 7px 8px 7px 30px; position: relative; border-radius: 8px; background: #eef2f6; color: #5b6b7c; }
.etapes-achat li::before { content: counter(etape); position: absolute; left: 8px; top: 7px; width: 17px; height: 17px; border-radius: 50%; background: #c5cfd9; color: #fff; font-weight: 700; font-size: .72rem; text-align: center; line-height: 17px; }
.etapes-achat li.fait { background: #e3f4e8; color: #1e6b3f; } .etapes-achat li.fait::before { background: #2e9d5b; content: "✓"; }
.etapes-achat li.encours { background: #e6f0fb; color: #0b3a5b; font-weight: 700; } .etapes-achat li.encours::before { background: #0369a1; }
.achat-section { margin-bottom: 14px; } .achat-section > h2 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 0 0 8px; }
.achat-section > h2 .num-etape { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: #0369a1; color: #fff; align-items: center; justify-content: center; font-size: .85rem; }
.check-liste li { list-style: none; margin: 3px 0; } .check-liste { padding-left: 4px; } .check-liste .ok::before { content: "✔ "; color: #1e7b4a; } .check-liste .ko::before { content: "✗ "; color: #b3261e; }
.moins-disant { background: #e3f4e8 !important; font-weight: 700; }
.tb-t-sal { border-left-color: #0e9f6e; } .tb-t-ctr { border-left-color: #d97706; } .tb-t-dao { border-left-color: #7c3aed; }
body.page-accueil.espace-rh .hero-nom span, body.page-accueil.espace-logistique .hero-nom span { color: #fbbf24; }

/* v5.3 — panier de la Finance, espaces reliés */
.tb-panier { background: #dbeafe !important; color: #1e40af !important; }
.badge.panier { background: #dbeafe; color: #1e40af; }
.progression { display: inline-flex; align-items: center; gap: 6px; min-width: 120px; }
.progression .barre { flex: 1; height: 8px; border-radius: 4px; background: #e6ebf1; overflow: hidden; min-width: 60px; }
.progression .barre i { display: block; height: 8px; background: var(--vert, #2e7d32); }
.progression .barre i.moyen { background: #f59e0b; } .progression .barre i.debut { background: #60a5fa; }
.progression b { font-size: .8rem; white-space: nowrap; }
.prochaine-etape { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; border-radius: 12px;
  background: linear-gradient(90deg, #eff6ff, #f8fbff); border: 1px solid #bfdbfe; }
.prochaine-etape .pe-txt { flex: 1; min-width: 220px; } .prochaine-etape .pe-txt b { display: block; color: #1e3a8a; font-size: 1.02rem; }
.prochaine-etape .pe-txt span { color: #475569; font-size: .88rem; }

/* v5.9 : pastille du panier de réception des espaces */
.pastille-p { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e53935; color: #fff; font: 700 11px/18px sans-serif; text-align: center; margin-left: 3px; }

/* v5.9 — pages des espaces ouvertes sur un téléphone : sans boutons de fenêtre, tableaux défilant de côté */
@media (max-width: 700px) {
  .fenetre-outils, .barre-fenetres { display: none !important; }
  .page table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page table td, .page table th { white-space: nowrap; }
  .page table td.objet, .page table td .sous { white-space: normal; min-width: 160px; }
  .page h1, .page h2 { font-size: 1.15rem; }
}

/* v5.11 — saisie des écritures : cases de saisie sur fond bleu */
.grille-saisie input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .grille-saisie select, .grille-saisie textarea {
  background: #dbeafe; border-color: #93c5fd; color: #0b2a5b; }
.grille-saisie input:focus, .grille-saisie select:focus, .grille-saisie textarea:focus { background: #eff6ff; border-color: #2563eb; outline: 2px solid #bfdbfe; }
.grille-saisie input[readonly], .grille-saisie input:disabled { background: #e2e8f0; }
.page-saisie .entete-grille input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .page-saisie .entete-grille select,
.page-saisie .entete-grille textarea { background: #dbeafe; border-color: #93c5fd; color: #0b2a5b; }

/* v5.12 — menu déroulant de la page en cours (TDR · factures de la Logistique…) */
.menu.actif > button { background: rgba(255, 255, 255, .14); box-shadow: inset 0 -3px 0 var(--m-ciel, #7dd3fc); color: #fff; }
/* v5.12 — la barre des menus ne déborde plus à droite : l'exercice reste dans le menu « Exercice », la partie droite ne se fait plus
   pousser hors de l'écran (le nom de l'utilisateur reste dans le menu « Utilisateurs »). */
.entete .droite { flex-shrink: 0; }
@media (max-width: 1750px) { .entete #form-exercice { display: none; } }
@media (max-width: 1480px) { .entete .nom-utilisateur { display: none; } }

/* v5.12 / v5.13 — Mode tranquille (bouton en haut à gauche de l'accueil) : tout disparaît, il ne reste que la photo en fond,
   dans tous les espaces ; « ☀ Tout afficher » remet la page. */
.mode-calme-btn { border: 1px solid rgba(255, 255, 255, .55); background: rgba(11, 29, 46, .55); color: #fff; border-radius: 999px; padding: 6px 14px;
  font: 600 .86rem/1.2 inherit; cursor: pointer; backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); white-space: nowrap; }
.mode-calme-btn:hover { background: rgba(11, 29, 46, .78); }
.mode-calme-btn:focus-visible { outline: 3px solid #fde68a; outline-offset: 2px; }
.hero-accueil > .mode-calme-btn { position: absolute; top: 14px; left: 14px; z-index: 6; }
.mode-calme-btn.en-ligne-page { position: static; background: #0b3a63; border-color: #0b3a63; margin: 0 0 10px; }
.accueil-v41 .hero-texte { top: 58px; }
.calme-fond { display: none; position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 400; background: #1d63c8 center top / cover no-repeat; }
.calme-fond.nuit { background-color: #0b1736; background-position: center bottom; }
.calme-fond .calme-btn { position: absolute; top: 16px; left: 18px; background: rgba(255, 255, 255, .92); color: #0b3a63; border-color: #cbd5e1; }
.calme-fond .calme-pied { position: absolute; right: 18px; bottom: 14px; color: #fff; font-size: .82rem; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); opacity: .85; }
.calme-fond .calme-heure { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); color: #fff; font-weight: 300; font-size: clamp(2.4rem, 6vw, 5rem); letter-spacing: .04em; text-align: center; white-space: nowrap;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .55); font-variant-numeric: tabular-nums; }
.calme-fond .calme-heure small { display: block; font-size: .3em; letter-spacing: .12em; text-transform: uppercase; text-align: center; margin-top: 4px; font-weight: 500; }
html.mode-calme .calme-fond { display: block; }
html.mode-calme main.page > :not(.calme-fond) { display: none !important; }
html.mode-calme main.page { padding: 0 !important; min-height: 0; }
html.mode-calme #barre-fenetres, html.mode-calme .adk-panneau, html.mode-calme #adk-pastille { display: none !important; }
html.mode-calme body { overflow: hidden; }
html.mode-calme header.entete, html.mode-calme .entete-mobile, html.mode-calme .barre-mobile { visibility: hidden; }   /* v5.13 : tout disparaît, il ne reste que la photo */
@media (max-width: 900px) { .calme-fond { top: 0; z-index: 90; } }

/* v5.13 — travail à plusieurs : bandeau du verrou de fiche */
.verrou-bandeau { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; border-radius: 10px; margin: 0 0 12px; background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; font-size: .92rem; }
.verrou-bandeau.occupe { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.verrou-liste { display: inline-block; font-size: .78rem; color: #b45309; background: #fff7ed; border: 1px solid #fdba74; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
/* v5.13 — avertissement dans un formulaire (ex. DA déjà validée) */
p.alerte.attention { background: #fff7ed; border: 1px solid #fdba74; border-left: 4px solid #ea580c; color: #7c2d12; border-radius: 8px; padding: 8px 12px; margin: 4px 0 12px; font-size: .9rem; }
/* v5.15 — fenêtres : jamais plus larges que l'écran */
dialog { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
.apercu-boite, .adk-panneau.flottant { max-width: 100vw; }
/* v5.15 — case en erreur : bordure et fond rouges, libellé en rouge ; le message lié à une case la montre au clic */
.case-erreur, input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"],
.champ.erreur input, .champ.erreur select, .champ.erreur textarea { border: 2px solid #dc2626 !important; background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15) !important; }
.champ.erreur > label, label.erreur { color: #b91c1c; font-weight: 700; }
td.erreur { background: #fff1f2 !important; }
.message.lie { cursor: pointer; } .message.lie::after { content: "  → voir la case"; font-weight: 700; text-decoration: underline; }

/* ===== v5.15.1 — haut du journal en bleu (titre, onglets, filtres, bande des soldes), aussi en plein écran et pendant la saisie ===== */
body .entete-journal { background: linear-gradient(90deg, #b7d4f7 0%, #d2e5fb 55%, #e6f0fd 100%); border: 1px solid #a9cbf1;
  border-left: 5px solid #1d5fb0; }
body .entete-journal h1, body .entete-journal h1 .muet { color: #0b3a5b; }
body .entete-journal .sous-titre, body .entete-journal .mode-od .petit { color: #24507a; }
body .page:has(> .entete-journal) .onglets { border-bottom-color: #1d5fb0; }
body .page:has(> .entete-journal) .onglets a { background: #d2e5fb; color: #0b3a5b; border-color: #a9cbf1; }
body .page:has(> .entete-journal) .onglets a.actif { background: #1d5fb0; color: #fff; border-color: #1d5fb0; }
body .filtres.bandeau-vert { background: #c7ddf8; border: 1px solid #a9cbf1; border-left: 5px solid #1d5fb0; }
body .filtres.bandeau-vert label { color: #0b3a5b; }
body .solde-fige { background: #d9e9fb; border: 1px solid #a9cbf1; border-left: 5px solid #1d5fb0; }
body .solde-fige .nav-fige { background: #c7ddf8; }
body .solde-fige .bloc { background: #e3effd; border-right-color: #c6dcf4; }
body .solde-fige .bloc .lib { color: #3d6488; }
body .solde-fige .bloc.principal { background: #b7d4f7; }
body .solde-fige .bloc.principal .val { color: #0b3a5b; }
body .solde-fige .ident-journal { background: linear-gradient(90deg, #0b3a5b, #1d5fb0); }
body .solde-fige .fen-journal .fj-reduire { background: #dbeafb; color: #0b3a5b; }
@media print { body .entete-journal, body .filtres.bandeau-vert, body .solde-fige, body .solde-fige .bloc, body .solde-fige .nav-fige { background: none; } }
/* v5.16 : bénéficiaire des envois de la caissière sur les lignes OD */
.benef-od { display: flex; flex-direction: column; font-weight: 600; color: #0b3a5b; }
.benef-od small { font-weight: 400; color: #475569; font-size: .78rem; }

/* ===== v5.17 — coupure de connexion : saisie gardée, bandeau, reprise ===== */
.hors-connexion { position: fixed; left: 50%; top: 58px; transform: translateX(-50%); z-index: 2000; max-width: min(760px, calc(100vw - 24px));
  background: #b91c1c; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: .92rem; line-height: 1.4; }
.hors-connexion[hidden] { display: none; }
.hors-connexion.retour { background: #15803d; }
.hors-connexion.secoue { animation: adk-secoue .4s; }
@keyframes adk-secoue { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 8px)); } 75% { transform: translateX(calc(-50% + 8px)); } }
.brouillon-remis { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.reprendre-ici { position: fixed; right: 18px; bottom: 18px; z-index: 1500; display: flex; flex-direction: column; gap: 2px; max-width: min(420px, calc(100vw - 36px));
  background: #0b3a63; color: #fff; padding: 12px 16px; border-radius: 12px; text-decoration: none; box-shadow: 0 10px 30px rgba(11,58,99,.35); }
.reprendre-ici:hover { background: #0b63b6; color: #fff; text-decoration: none; }
.reprendre-ici small { color: #cfe6fb; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media print { .hors-connexion, .reprendre-ici, .brouillon-remis { display: none !important; } }

/* v5.19 — Accueils du SE et du Contrôle interne : présentation d'avant, sur le ciel de jour (7 h – 19 h) ou de nuit */
body.accueil-ciel .barre-titre h1, body.accueil-ciel .barre-titre .sous-titre { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .55); }
body.accueil-ciel .carte, body.accueil-ciel .se-tuile { box-shadow: 0 6px 20px rgba(10, 30, 70, .18); }
body.accueil-ciel.nuit .carte, body.accueil-ciel.nuit .se-tuile { box-shadow: 0 6px 22px rgba(0, 0, 0, .4); }

/* v5.21 — copyright au bas de chaque page */
.pied-copyright { text-align: center; font-size: .72rem; color: #64748b; padding: 18px 12px 12px; }
.pied-copyright a { color: inherit; text-decoration: underline; }
body.page-accueil .pied-copyright { color: rgba(255, 255, 255, .9); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
body.mode-cadre .pied-copyright, body.mode-integre .pied-copyright, body.mode-apercu .pied-copyright { display: none; }
@media print { .pied-copyright { display: none !important; } }
html.mode-calme .pied-copyright { display: none; }
