/* ---------- Jetons ---------- */
:root {
  --encre: #1f2a37;
  --encre-douce: #5b6673;
  --trait: #d9dde2;
  --fond: #ffffff;
  --fond-bande: #f6f7f8;
  /* Charte de THIBEO Révision (décision Thibaut 16/10/2026) : bandeau marine, accent bleu.
     `--vert` garde son nom historique (112 usages) mais porte l'accent bleu de la Révision. */
  --vert: #1f5f8b;
  --vert-fond: #eaf1f7;
  --rouille: #b3261e;
  --focus: #1f5f8b;
  --bandeau: #112233;
  --bandeau-texte: #dce7f2;
  --bandeau-actif: #2a4a6a;
  --bandeau-doux: #9cc3e4;
  --marque: var(--vert);
  --marque-clair: var(--fond-bande);
  --marque-fond: var(--fond);
  --police: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--police);
  color: var(--encre);
  background: var(--fond);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

a { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.entete {
  background: var(--bandeau);
  color: #fff;
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
}
.entete .marque { font-weight: 700; letter-spacing: 0.08em; color: #fff; text-decoration: none; }
.entete .aide-bouton { background: transparent; border-color: var(--bandeau-texte); color: var(--bandeau-texte); }
.entete .aide-bouton:hover { border-color: #fff; color: #fff; }
.entete .pastille { background: var(--bandeau-actif); border: 1px solid var(--bandeau-doux); }
.entete .marque .module { font-weight: 400; letter-spacing: 0.02em; color: var(--bandeau-doux); }  /* nom du module : Comptabilité, Révision… */
.entete .dossier { font-weight: 600; margin-right: auto; display: flex; align-items: center; gap: 0.5rem; }
/* Première ligne du bandeau : marque · version · dossier … pastille · Quitter (tout à droite) ;
   deuxième ligne : menu, « ? », loupe. */
.entete .session { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.entete nav { flex: 1 1 100%; }
@media (min-width: 720px) { .entete nav { flex: 1 1 auto; } }
.entete .dossier > a { color: #fff; }
.entete .dossier small { font-weight: 400; color: var(--bandeau-texte); margin-left: 0.5rem; }
.entete nav { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.entete nav a { color: var(--bandeau-texte); padding: 0.3rem 0.6rem; border-radius: 4px; }
.entete nav a:hover { background: var(--bandeau-actif); color: #fff; text-decoration: none; }
.entete nav a.actif { background: var(--bandeau-actif); color: #fff; font-weight: 600; }
.loupe { display: flex; gap: 0.25rem; flex: 1 1 100%; }
.loupe input {
  flex: 1; font: inherit; padding: 0.4rem 0.6rem;
  border: 1px solid var(--trait); border-radius: 4px; min-width: 0;
}
@media (min-width: 720px) {
  .loupe { flex: 0 1 18rem; }
}

/* ---------- Contenu ---------- */
main { padding: 1rem; max-width: 72rem; margin: 0 auto; }
h1 { font-size: 1.35rem; font-weight: 600; margin: 0.25rem 0 0.75rem; }
h1 small { font-weight: 400; color: var(--encre-douce); font-size: 0.95rem; display: block; }

.filtres {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: end;
  padding: 0.75rem; background: var(--fond-bande); border-radius: 6px; margin-bottom: 1rem;
}
.filtres label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--encre-douce); gap: 0.2rem; }
.filtres label.ligne { flex-direction: row; align-items: center; gap: 0.4rem; padding-bottom: 0.45rem; }
.filtres select, .filtres input[type=date] {
  font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--trait); border-radius: 4px; background: #fff;
}
.bouton {
  font: inherit; padding: 0.45rem 0.9rem; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--vert); background: var(--vert); color: #fff;
}
.bouton.secondaire { background: #fff; color: var(--vert); }

.avis { padding: 0.6rem 0.9rem; border-left: 4px solid var(--rouille); background: #fbf3f0; margin-bottom: 1rem; }
.avis.success, .avis.info { border-color: var(--vert); background: var(--vert-fond); }
.bouton.danger { background: var(--rouille); border-color: var(--rouille); }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; }
.tableau th, .tableau td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
/* Titres de colonnes figés (règle Thibaut 12/11/2026) : ils restent visibles quand on fait défiler. Les bordures
   d'un tableau « collapse » ne suivent pas une cellule sticky : le filet du bas est rendu par une ombre interne. */
.tableau th { text-align: left; font-weight: 600; color: var(--encre-douce); font-size: 0.85rem; position: sticky; top: 0; z-index: 3; background: #fff; box-shadow: inset 0 -1px 0 var(--trait); }
.tableau .num { text-align: right; white-space: nowrap; }
.tableau th.num { text-align: right; }
.tableau .credit { color: var(--encre); }
.tableau .negatif { color: var(--rouille); }
.tableau tr.classe td { background: var(--fond-bande); font-weight: 600; }
.tableau tr.total td { border-top: 2px solid var(--encre); border-bottom: 0; font-weight: 600; }
.tableau .compte b { font-weight: 600; }
.tableau .compte span { display: block; color: var(--encre-douce); font-size: 0.85rem; }
.tableau .date { white-space: nowrap; }
.tableau .lib small { display: block; color: var(--encre-douce); }
.brouillard { color: var(--rouille); font-size: 0.8rem; font-weight: 600; }
.etiquette { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--vert-fond); color: var(--vert); font-size: 0.8rem; }
.etiquette.brouillard { background: #fbf3f0; color: var(--rouille); }

/* Mobile : on masque les colonnes secondaires */
@media (max-width: 600px) {
  main { padding: 0.5rem; }
  .tableau th, .tableau td { padding: 0.4rem 0.3rem; font-size: 0.92rem; }
  .masque-mobile { display: none; }
}

/* ---------- Écrans pleine page (connexion, dossiers) ---------- */
.carte { max-width: 22rem; margin: 3rem auto; padding: 1.5rem; border: 1px solid var(--trait); border-radius: 8px; }
.carte h1 { margin-top: 0; }
.carte label { display: block; margin-bottom: 0.75rem; }
.carte input { display: block; width: 100%; font: inherit; padding: 0.5rem; border: 1px solid var(--trait); border-radius: 4px; margin-top: 0.25rem; }
.liste-dossiers { list-style: none; padding: 0; margin: 0; }
.liste-dossiers li { margin-bottom: 0.5rem; }
.liste-dossiers button { width: 100%; text-align: left; }

.fiche dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0 0 1rem; }
.fiche dt { color: var(--encre-douce); }
.fiche dd { margin: 0; }

/* ---------- Saisie ---------- */
.journaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.6rem; margin-bottom: 1.5rem; }
.journaux a { display: block; padding: 0.9rem 1rem; border: 1px solid var(--trait); border-radius: 6px; color: var(--encre); }
.journaux a:hover { border-color: var(--vert); text-decoration: none; }
.journaux a { display: flex; flex-direction: column; gap: 0.15rem; }
.journaux a b { font-size: 1.15rem; font-weight: 600; color: var(--vert); }
.journaux a code { font: 600 0.8rem/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.06em; color: var(--encre); }
.journaux a span { margin-top: 0.2rem; font-size: 0.85rem; color: var(--encre-douce); }
.journaux a span em { font-style: normal; font-weight: 600; color: var(--rouille); }
.entete-saisie { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.6rem 1rem; margin-bottom: 1rem; }
.entete-saisie label, .grille label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--encre-douce); gap: 0.2rem; }
.entete-saisie label.large { grid-column: 1 / -1; }
input.champ, select.champ, .grille input, .grille select {
  font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--trait); border-radius: 4px; background: #fff; min-width: 0; width: 100%;
}
.grille input.num { text-align: right; }
.grille { width: 100%; border-collapse: collapse; margin-bottom: 0.75rem; }
.grille th { text-align: left; font-weight: 600; color: var(--encre-douce); font-size: 0.85rem; padding: 0.3rem; }
.grille th.num { text-align: right; }
.grille td { padding: 0.2rem 0.25rem; vertical-align: middle; }
.grille td.retirer { width: 2rem; text-align: center; }
.grille .retirer button { font: inherit; border: 0; background: none; color: var(--encre-douce); cursor: pointer; font-size: 1.1rem; }
.grille tfoot td { padding-top: 0.5rem; font-weight: 600; border-top: 2px solid var(--encre); }
.grille tfoot td.num { text-align: right; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.actions .info { color: var(--encre-douce); margin-left: auto; }
.desequilibre { color: var(--rouille); font-weight: 600; }
.brouillons .lib small { display: block; color: var(--encre-douce); }
.brouillons form { display: inline; }
.brouillons .lien { font: inherit; background: none; border: 0; color: var(--vert); cursor: pointer; padding: 0; }
@media (max-width: 600px) {
  .grille th.masque-mobile, .grille td.masque-mobile { display: none; }
}

/* ---------- Tuiles de dépôt ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.tuile button {
  width: 100%; font: inherit; padding: 0.9rem 0.5rem; border: 1px solid var(--trait); border-radius: 8px;
  background: #fff; color: var(--encre); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.tuile button:hover { border-color: var(--vert); }
.tuile button:disabled { opacity: 0.6; cursor: wait; }
.tuile .ico { font-size: 1.6rem; }
.tuile small { color: var(--vert); font-weight: 600; }

/* ---------- Accueil : tuiles du menu ---------- */
.accueil-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.8rem; margin: 1rem 0 1.5rem; }
.accueil-tuiles a {
  display: flex; flex-direction: column; gap: 0.25rem; min-height: 8.5rem; padding: 1rem 1.1rem;
  border: 1px solid var(--trait); border-radius: 10px; color: var(--encre); background: #fff;
}
.accueil-tuiles a:hover { border-color: var(--marque); text-decoration: none; box-shadow: 0 1px 4px rgba(31, 42, 55, 0.08); }
.accueil-tuiles .ico { font-size: 1.7rem; line-height: 1; }
.accueil-tuiles b { font-size: 1.1rem; font-weight: 600; color: var(--marque); }
.accueil-tuiles span { font-size: 0.85rem; color: var(--encre-douce); }
.accueil-tuiles small { margin-top: auto; padding-top: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--encre-douce); }
.accueil-tuiles small.alerte { color: var(--rouille); }

/* ---------- États comptables et fiscaux ---------- */
.onglets { display: flex; gap: 0.25rem; flex-wrap: wrap; border-bottom: 1px solid var(--trait); margin-bottom: 1rem; }
.onglets a { padding: 0.5rem 0.9rem; color: var(--encre); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets a:hover { text-decoration: none; border-color: var(--trait); }
.onglets a.actif { color: var(--vert); font-weight: 600; border-color: var(--vert); }
.bilan { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
@media (min-width: 1000px) { .bilan { grid-template-columns: 3fr 2fr; } }
.etat td:first-child { padding-left: 0.5rem; }
.etat tr.total td { background: var(--fond-bande); }
.etat tr.classe td { text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.03em; }
.etat .case { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--vert); }
.etat.efi td { padding: 0.3rem 0.5rem; }
.etat-titre { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.etat-titre small { font-weight: 400; color: var(--encre-douce); }
.legende { color: var(--encre-douce); font-size: 0.9rem; }
.negatif { color: var(--rouille); }

/* ---------- Totaux figés en tête de la balance ---------- */
.tableau th .total-tete { display: block; color: var(--encre); font-size: 1rem; font-weight: 600; margin-top: 0.15rem; }
.tableau thead th { border-bottom: 2px solid var(--encre); box-shadow: 0 1px 0 #fff; }

/* ---------- Pastille de l'utilisateur connecté ---------- */
.pastille {
  display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem;
  border-radius: 50%; background: var(--marque); color: #fff; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  cursor: default; vertical-align: middle;
}

/* ---------- Imprimés DGFiP (liasse 2033) ---------- */
.imprime { border: 2px solid var(--encre); border-radius: 4px; padding: 0.75rem 1rem 1rem; margin: 1.25rem 0 2rem; background: #fff; }
.imprime-entete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--encre); padding-bottom: 0.4rem; margin-bottom: 0.6rem; }
.imprime-entete .numero { font-weight: 700; letter-spacing: 0.02em; }
.imprime-entete .ref { font-weight: 700; color: var(--encre-douce); }
.imprime-ident { font-size: 0.9rem; margin-bottom: 0.75rem; display: grid; gap: 0.15rem; }
.imprime-ident span { color: var(--encre-douce); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; margin-right: 0.3rem; }
.imprime-ident span + span, .imprime-ident div span:not(:first-child) { margin-left: 1rem; }
.form { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.form th, .form td { border: 1px solid var(--trait); padding: 0.3rem 0.45rem; vertical-align: middle; }
.form th { font-weight: 600; text-align: left; background: var(--fond-bande); font-size: 0.8rem; }
.form th.mt { text-align: center; }
.form th small { font-weight: 400; color: var(--encre-douce); }
.form tr.groupe td { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--encre-douce); background: #fff; padding: 0.45rem 0.45rem 0.1rem; border-left: 0; border-right: 0; }
.form td.lib { min-width: 14rem; }
.form td.case { width: 2.4rem; text-align: center; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.8rem; font-weight: 700; color: var(--encre); background: #fff; border-right: 0; padding-right: 0.2rem; }
.form td.mt { text-align: right; min-width: 6rem; white-space: nowrap; border-left: 0; }
.form tr.t td { font-weight: 600; background: var(--fond-bande); }
.form tr.t td.case { background: var(--fond-bande); }
.form .dont { color: var(--encre-douce); font-size: 0.78rem; display: block; }
.form .dont .case { font-size: 0.75rem; }
.form.renvois td.lib { font-size: 0.8rem; color: var(--encre-douce); min-width: 0; }
.form.grille td.lib { min-width: 12rem; }
.form.grille td.mt { min-width: 4.5rem; }
@media (max-width: 900px) {
  .form.grille { display: block; overflow-x: auto; }
}
@media print {
  .entete, .onglets, .filtres, .avis, .legende { display: none !important; }
  main { max-width: none; padding: 0; }
  .imprime { break-after: page; border-width: 1px; }
  .form td.mt, .form td.case { min-width: 0; }
}

/* ---------- Plaquette (présentation cabinet) ---------- */
:root { --pq-bleu: #1f4e9c; --pq-bleu-clair: #eaf0fa; --pq-rouge: #8a1c1c; }
.pq-page { margin: 0 0 2.5rem; }
.pq-garde { min-height: 40rem; padding: 3.5rem 2.5rem 2rem; border: 1px solid var(--trait); border-radius: 6px; display: flex; flex-direction: column; justify-content: space-between; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; }
.pq-titre { font-size: 2.6rem; font-weight: 400; color: #5b2d8e; margin: 0 0 1.6rem; letter-spacing: -0.01em; }
.pq-provisoire { font-size: 1rem; color: var(--rouille); border: 1px solid var(--rouille); border-radius: 4px; padding: 0.1rem 0.5rem; vertical-align: middle; }
.pq-societe { font-size: 1.7rem; margin: 0 0 1.4rem; color: #1a1a4a; }
.pq-exercice { font-size: 1.1rem; color: var(--encre); margin: 0; }
.pq-pied { font-size: 0.8rem; line-height: 1.35; color: var(--encre); }
.pq-pied b { display: block; color: #5b2d8e; font-size: 0.95rem; margin-bottom: 0.15rem; }
.pq-h2 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.05em; }
.pq-h2.centre { text-align: center; }
.pq-h3 { font-size: 0.95rem; color: var(--pq-rouge); text-transform: uppercase; letter-spacing: 0.03em; margin: 1.25rem 0 0.4rem; }
.pq-sommaire { font-size: 1.05rem; line-height: 1.5; font-weight: 600; list-style: none; padding: 0; margin: 2rem 0 0 3rem; }
.pq-sommaire li { margin-bottom: 1.2rem; }
.pq-sommaire small { display: block; font-weight: 400; color: var(--encre-douce); font-size: 0.85rem; }
.pq-intercalaire { position: relative; min-height: 14rem; border: 1px solid var(--trait); border-radius: 6px; }
.pq-intercalaire::after { content: ""; position: absolute; top: 0; bottom: 0; right: 1.5rem; width: 3px; background: #5b2d8e; }
.pq-onglet { position: absolute; top: 0; right: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.pq-onglet span { display: block; width: 2.4rem; height: 2rem; background: #7b2f8e; }
.pq-onglet span + span { background: #5b2d8e; }
.pq-onglet b { writing-mode: vertical-rl; transform: rotate(180deg); color: #5b2d8e; font-size: 1.25rem; font-weight: 700; margin-top: 0.6rem; padding-left: 0.5rem; }
.pq-onglet { z-index: 1; }
.pq-entete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--encre-douce); }
.pq-entete b { font-size: 1.1rem; color: var(--encre); }
table.pq { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; margin-bottom: 1rem; }
table.pq th { background: var(--pq-bleu); color: #fff; text-align: left; padding: 0.35rem 0.5rem; font-weight: 600; font-size: 0.85rem; }
table.pq th.num, table.pq td.num { text-align: right; white-space: nowrap; }
table.pq td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--trait); }
table.pq td.cpt { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85rem; width: 6rem; }
table.pq .pct { width: 4rem; color: var(--pq-bleu); }
table.pq .gras { font-weight: 600; }
table.pq tr.pq-groupe td { background: var(--fond-bande); color: var(--pq-rouge); font-weight: 600; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.03em; padding-top: 0.45rem; }
table.pq tr.pq-bande td { background: var(--pq-bleu); color: #fff; font-weight: 600; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.03em; }
table.pq tr.pq-soustotal td { font-weight: 600; border-top: 1px solid var(--encre); border-bottom: 1px solid var(--encre); }
table.pq tr.pq-total td { font-weight: 600; background: var(--fond-bande); color: var(--pq-rouge); }
table.pq tr.pq-bande.total td { color: #fff; }
table.pq tr.sig-l td:first-child { padding-left: 1rem; }
table.pq tr.sig-l td.num { background: var(--pq-bleu-clair); }
table.pq tr.sig-s td { font-weight: 700; border-top: 2px solid var(--encre); border-bottom: 2px solid var(--encre); text-transform: uppercase; }
table.pq tr.sig-r td { font-weight: 700; background: var(--pq-bleu); color: #fff; text-transform: uppercase; }
table.pq tr.sig-r td.pct { color: #fff; }
.plaquette .imprime { margin-top: 0; }
@media print {
  .pq-page { break-before: page; }
  .pq-page:first-child { break-before: auto; }
  .ecran-seul { display: none !important; }
  @page { size: A4; margin: 0; }   /* marge nulle : le navigateur n'imprime plus l'URL ni la date */
  main { padding: 12mm 12mm !important; max-width: none; }
  .pq-garde { border: 0; height: 268mm; min-height: 0; padding: 28mm 6mm 0; box-sizing: border-box; }
  .pq-garde .pq-pied { break-inside: avoid; }
  .pq-intercalaire { border: 0; height: 268mm; min-height: 0; }
  .pq-onglet { right: 0; }
  .pq-intercalaire::after { right: 0; }
  .pq-onglet span, .pq-onglet b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .plaquette .imprime { break-after: page; }
  table.pq th, table.pq tr.pq-bande td, table.pq tr.sig-r td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Saisie d'achat à partir d'une facture déposée ---------- */
.bandeau-facture { display: flex; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; align-items: baseline; padding: 0.6rem 0.9rem; margin-bottom: 1rem; background: var(--vert-fond); border-left: 4px solid var(--vert); border-radius: 4px; }
.bandeau-facture small { color: var(--encre-douce); }
.actions-facture { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; }
.factures-attente { margin-bottom: 1rem; padding: 0.6rem 0.9rem; background: var(--fond-bande); border-radius: 6px; }
.factures-attente summary { cursor: pointer; font-weight: 600; }
.factures-attente ul { margin: 0.5rem 0 0; padding-left: 1.2rem; line-height: 1.8; }
.saisie-avec-piece.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 1100px) { .saisie-avec-piece.deux-colonnes { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.apercu-piece { position: sticky; top: 0.5rem; border: 1px solid var(--trait); border-radius: 6px; overflow: hidden; background: var(--fond-bande); }
.apercu-piece iframe { display: block; width: 100%; height: 80vh; border: 0; background: #fff; }
.apercu-piece img { display: block; width: 100%; height: auto; }
.apercu-piece .legende { margin: 0.4rem 0.6rem; }

/* ---------- Complétion des comptes et tiers ---------- */
.completion { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--trait); border-radius: 6px; box-shadow: 0 4px 14px rgba(31, 42, 55, 0.12); max-height: 18rem; overflow-y: auto; font-size: 0.9rem; }
.completion-item { padding: 0.35rem 0.6rem; cursor: pointer; display: flex; gap: 0.6rem; align-items: baseline; }
.completion-item b { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; color: var(--vert); white-space: nowrap; }
.completion-item span { color: var(--encre); }
.completion-item.actif, .completion-item:hover { background: var(--vert-fond); }
.libelle-compte { display: block; font-size: 0.75rem; color: var(--encre-douce); line-height: 1.2; margin-top: 0.1rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.libelle-compte.inconnu { color: var(--rouille); }

/* ---------- Défilement des comptes dans le grand livre ---------- */
.defilement-comptes { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.defilement-comptes h1 { flex: 1; margin: 0; }
.defilement-comptes .bouton { white-space: nowrap; font-variant-numeric: tabular-nums; }
.defilement-comptes .inactif { opacity: 0.35; cursor: default; }
@media (max-width: 600px) { .defilement-comptes { flex-wrap: wrap; } .defilement-comptes h1 { order: -1; flex-basis: 100%; } }

/* ---------- Boutons copier (aide EFI) ---------- */
.etat.efi td.copie { width: 5rem; text-align: center; }
button.copier { font: inherit; font-size: 0.8rem; padding: 0.1rem 0.5rem; border: 1px solid var(--trait); border-radius: 999px; background: #fff; color: var(--vert); cursor: pointer; }
button.copier:hover { border-color: var(--vert); }
button.copier.ok, .copier-tout.ok { background: var(--vert); color: #fff; border-color: var(--vert); }
.etat-titre .copier-tout { font-size: 0.8rem; padding: 0.2rem 0.6rem; margin-left: 0.75rem; vertical-align: middle; }
@media print { button.copier, .copier-tout, .etat.efi td.copie { display: none !important; } }

/* ---------- Rapprochement bancaire ---------- */
.cartouches { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; margin: 0.75rem 0 1rem; }
.cartouche { border: 1px solid var(--trait); border-radius: 8px; padding: 0.6rem 0.9rem; background: #fff; display: flex; flex-direction: column; gap: 0.15rem; }
.cartouche span { font-size: 0.8rem; color: var(--encre-douce); }
.cartouche b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.cartouche small { color: var(--encre-douce); font-size: 0.8rem; }
.cartouche.vert { border-color: var(--vert); background: var(--vert-fond); }
.cartouche.orange { border-color: #d59a3a; background: #fdf6ea; }
.cartouche.rouge { border-color: var(--rouille); background: #fbf3f0; }
.ok-vert { color: var(--vert); font-weight: 600; }
.nav-releves { float: right; display: inline-flex; gap: 0.6rem; font-size: 1.1rem; }
.nav-releves a { text-decoration: none; }
.nav-releves .inactif { opacity: 0.35; }
.tableau.rapprochement tr.statut-pointee td { color: var(--encre-douce); }
.tableau.rapprochement tr.statut-pointee td.lib, .tableau.rapprochement tr.statut-pointee td.num { color: var(--encre); }
.tableau.rapprochement tr.statut-a_traiter td { background: #fffbf2; }
.tableau.rapprochement tr.statut-ignoree td { color: var(--encre-douce); font-style: italic; }
.tableau.rapprochement td.pointage { min-width: 18rem; }
.tableau.rapprochement td.pointage a { display: inline-block; }
.proposition { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; position: relative; }
.proposition input { font: inherit; font-size: 0.9rem; padding: 0.2rem 0.4rem; border: 1px solid var(--trait); border-radius: 4px; }
.proposition .source { flex-basis: 100%; color: var(--encre-douce); font-size: 0.78rem; }
.proposition .libelle-compte { flex-basis: 100%; font-size: 0.78rem; color: var(--encre-douce); }
.pointage-manuel { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-top: 0.3rem; font-size: 0.85rem; }
.pointage-manuel select { font: inherit; font-size: 0.85rem; max-width: 20rem; }
.pointage-manuel label.ligne { display: inline-flex; gap: 0.25rem; align-items: center; color: var(--encre-douce); }
.bouton.petit { padding: 0.15rem 0.6rem; font-size: 0.85rem; }
button.lien { font: inherit; font-size: 0.85rem; border: 0; background: none; color: var(--vert); cursor: pointer; text-decoration: underline; padding: 0; white-space: nowrap; }
td.actions-ligne { white-space: nowrap; }
@media (max-width: 600px) { .nav-releves { float: none; display: flex; } .tableau.rapprochement td.pointage { min-width: 0; } }

/* ---------- Marque THIBEO ---------- */
.marque-connexion { letter-spacing: 0.08em; color: var(--vert); }

/* ---------- Journal des événements ---------- */
/* Un conteneur à défilement horizontal casse le figeage des titres : on ne le garde que sur petit écran. */
@media (max-width: 900px) { .defilement-large { overflow-x: auto; } }
.evenements td { font-size: 0.9rem; }
.evenements .ev-detail { min-width: 16rem; max-width: 32rem; overflow-wrap: anywhere; color: var(--encre-douce); }
.etiquette-ev { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 3px; background: var(--fond-bande); white-space: nowrap; }
.ev-echec_connexion .etiquette-ev, .ev-reouverture .etiquette-ev,
.ev-suppression_brouillard .etiquette-ev, .ev-suppression_document .etiquette-ev { background: #fbf3f0; color: var(--rouille); }
.ev-validation .etiquette-ev, .ev-cloture .etiquette-ev { background: var(--vert-fond); color: var(--vert); }
.pagination { display: flex; gap: 0.75rem; align-items: center; margin: 1rem 0; }
.motif-reouverture { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--encre-douce); margin-bottom: 0.5rem; max-width: 36rem; }
.motif-reouverture input { font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--trait); border-radius: 4px; color: var(--encre); }

/* ---------- Création d'un fournisseur pendant la saisie ACH ---------- */
.nouveau-tiers { grid-column: 1 / -1; margin: 0; padding: 0.5rem 0.9rem 0.8rem; border: 1px solid var(--vert); border-left-width: 4px; border-radius: 4px; background: var(--vert-fond); }
.nouveau-tiers[hidden] { display: none; }
.nouveau-tiers legend { padding: 0 0.3rem; font-weight: 600; }
.nouveau-tiers label.case { flex-direction: row; align-items: center; gap: 0.4rem; color: var(--encre); font-size: 0.95rem; cursor: pointer; }
.nouveau-tiers .aide { display: block; margin: 0.1rem 0 0.6rem; font-size: 0.85rem; color: var(--encre-douce); }
.champs-nouveau-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.6rem 1rem; }
.champs-nouveau-tiers label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--encre-douce); gap: 0.2rem; }
.champs-nouveau-tiers .champ.fixe { display: block; padding: 0.4rem 0.5rem; border: 1px dashed var(--trait); border-radius: 4px; background: transparent; color: var(--encre); }
.nouveau-tiers:has(input[name=creer_tiers]:not(:checked)) .champs-nouveau-tiers { opacity: 0.45; }

/* ---------- Dépôt et lecture des factures (saisie ACH) ---------- */
.depot-factures { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: -0.25rem 0 1rem; }
.depot-factures .bouton { cursor: pointer; }
.depot-factures .bouton.occupe { opacity: 0.55; pointer-events: none; }
.depot-factures small { color: var(--encre-douce); }
.lecture-facture { margin: -0.5rem 0 1rem; padding: 0.5rem 0.9rem; border-left: 4px solid var(--vert); background: #f3f8f5; border-radius: 4px; font-size: 0.92rem; }
.lecture-facture.vide { border-left-color: var(--encre-douce); background: var(--fond-bande); color: var(--encre-douce); }

/* ---------- Tuile Banque du menu Saisie (lien principal + saisie manuelle) ---------- */
.journaux .tuile-banque { position: relative; display: flex; flex-direction: column; border: 1px solid var(--trait); border-radius: 6px; }
.journaux .tuile-banque:hover { border-color: var(--vert); }
.journaux .tuile-banque > a:first-child { border: 0; flex: 1; padding-bottom: 0.3rem; }
.journaux .tuile-banque > a.secondaire { display: block; border: 0; padding: 0 1rem 0.7rem; font-size: 0.8rem; color: var(--vert); text-decoration: underline; }

/* ---------- Rapprochement : en-têtes relevé / comptabilité, pointage multiple ---------- */
.tableau.rapprochement thead tr.groupes th { position: static; border-bottom: 0; box-shadow: none; padding-bottom: 0.1rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tableau.rapprochement thead tr.groupes th.cote-releve { color: var(--encre); border-top: 3px solid var(--encre-douce); }
.tableau.rapprochement thead tr.groupes th.cote-compta { color: var(--vert); border-top: 3px solid var(--vert); }
.tableau.rapprochement td.pointage { border-left: 2px solid var(--trait); }
details.pointage-manuel { display: block; margin-top: 0.35rem; font-size: 0.85rem; }
details.pointage-manuel summary { cursor: pointer; color: var(--vert); }
details.pointage-manuel .candidats { max-height: 12rem; overflow-y: auto; margin: 0.3rem 0; border: 1px solid var(--trait); border-radius: 4px; background: #fff; }
details.pointage-manuel .candidats label { display: grid; grid-template-columns: auto 4.2rem 2.6rem 1fr auto; gap: 0.4rem; align-items: baseline; padding: 0.2rem 0.4rem; cursor: pointer; border-bottom: 1px solid var(--fond-bande); }
details.pointage-manuel .candidats label:hover { background: var(--fond-bande); }
details.pointage-manuel .candidats .jnl { color: var(--encre-douce); }
details.pointage-manuel .candidats .num { text-align: right; font-variant-numeric: tabular-nums; }
details.pointage-manuel .pied-pointage { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
details.pointage-manuel.egal .somme b { color: var(--vert); }
details.pointage-manuel.egal .somme b::after { content: " ✓"; }
details.pointage-manuel.different .somme b { color: var(--rouille); }
details.pointage-manuel:not(.different) .forcer { display: none; }
.tableau small.clos { color: var(--encre-douce); border: 1px solid var(--trait); border-radius: 3px; padding: 0 0.25rem; }
.tableau.rapprochement .ou-creer { margin: 0.5rem 0 0.2rem; padding-top: 0.4rem; border-top: 1px dashed var(--trait); font-size: 0.8rem; color: var(--encre-douce); }
details.pointage-manuel[open] + .ou-creer, .tableau.rapprochement td.pointage > details.pointage-manuel:first-child { margin-top: 0; }
.fil { margin: 0 0 0.3rem; font-size: 0.85rem; }

/* ---------- Imprimés fiscaux au graphisme officiel (fond SVG + champs placés) ---------- */
.imprime-page { position: relative; container-type: inline-size; width: 100%; max-width: 820px; aspect-ratio: 562 / 814; margin: 1rem auto 2rem; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18); overflow: hidden; color: #000; }
.imprime-page .fond { position: absolute; inset: 0; width: 100%; height: 100%; }
.imprime-page .champ { position: absolute; white-space: pre; overflow: hidden; text-overflow: clip; }
.imprime-page .champ.m { font-family: Helvetica, Arial, "Liberation Sans", sans-serif; font-variant-numeric: tabular-nums; }
.imprime-page .champ.c { font-family: "Courier New", Courier, "Liberation Mono", monospace; }
.imprime-page .tampon { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%) rotate(-35deg); padding: 0 2cqw; border: 0.6cqw solid #b3261e; color: #b3261e; font: 700 11cqw/1.3 Arial, sans-serif; letter-spacing: 1.2cqw; opacity: 0.13; pointer-events: none; white-space: nowrap; }
.plaquette .imprime-page.pq-page { margin: 0 auto 2.5rem; }
@media print {
  .imprime-page { box-shadow: none; margin: 0 auto; break-after: page; break-inside: avoid; max-width: 186mm; }
  .imprime-page .tampon { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ecran-seul { display: none !important; }
  .plaquette .imprime-page.pq-page { break-after: auto; }
}
.tableau.rapprochement .ventilation { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; font-size: 0.85rem; padding: 0.25rem 0; }
.tableau.rapprochement .ventilation b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Immobilisations et emprunts ---------- */
.tableau tr.groupe-immo td { background: var(--fond-bande); color: var(--encre-douce); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.fiche-immo .entete-saisie { max-width: 60rem; }
.fiche-immo .champ.num { text-align: right; }
.bloc-emprunt { margin-bottom: 2.5rem; }
.bloc-emprunt .ligne-courus { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
.bloc-emprunt .ligne-courus input { width: 6rem; }
.details-emprunt summary { cursor: pointer; color: var(--vert); margin: 0.5rem 0; }
.details-emprunt .rapport { white-space: pre-wrap; font-size: 0.8rem; background: var(--fond-bande); padding: 0.5rem 0.75rem; border-radius: 4px; }
/* Menu du haut : mêmes rubriques que les tuiles de l'accueil (views.MENU) */
.entete nav { align-items: center; }
@media (max-width: 1600px) { .entete nav { gap: 0.25rem 0.8rem; } }

/* ---------- Feuille de révision « Emprunts » (modèle B4 du dossier de révision) ---------- */
.feuille-revision { margin: 0.5rem 0 2.5rem; }
.fr-entete { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.85rem; color: var(--encre-douce); border-bottom: 2px solid var(--encre); padding-bottom: 0.3rem; }
.fr-titre { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pq-bleu); margin: 1.2rem 0 0.4rem; }
@media (max-width: 900px) { .defilement { overflow-x: auto; } }
.tableau.fr { font-size: 0.85rem; }
.tableau.fr th { white-space: normal; vertical-align: bottom; }
.tableau.fr th.groupe { text-align: center; color: var(--encre); border-bottom: 1px solid var(--trait); position: static; }
.tableau.fr td small { color: var(--encre-douce); }
.fr-synthese { max-width: 52rem; margin-top: 1rem; font-size: 0.9rem; }
.fr-synthese tr.ecart td { background: #fdf6ea; }
@media print { .feuille-revision { font-size: 9pt; } .tableau.fr { font-size: 8pt; } .fr-titre { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- Import des tableaux d'amortissement ---------- */
.import-immo { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; align-items: flex-end; margin-bottom: 1.5rem; }
.import-immo label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.import-immo .legende { flex-basis: 100%; margin: 0; }
.proposition-immo { border: 1px solid var(--trait); border-radius: 6px; padding: 0.6rem 0.9rem; margin-bottom: 1rem; }
.proposition-immo.ecartee { opacity: 0.7; }
.proposition-immo .entete-proposition { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: center; margin-bottom: 0.5rem; }
.proposition-immo .entete-proposition .num { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.proposition-immo .entete-saisie { max-width: none; }
.proposition-immo .champ.lecture { display: block; background: var(--fond-bande); border-color: transparent; }
.proposition-immo textarea { font-size: 0.85rem; }
.proposition-immo .avis { margin: 0.3rem 0 0; }

/* ---------- Aide en ligne ---------- */
.aide-bouton {
  display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem;
  border-radius: 50%; border: 1px solid var(--trait); background: #fff; color: var(--encre-douce);
  font-weight: 700; text-decoration: none; vertical-align: middle;
}
.aide-bouton:hover { border-color: var(--marque); color: var(--marque); text-decoration: none; }
.aide { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 900px) { .aide { grid-template-columns: 15rem 1fr; } .aide.pleine { grid-template-columns: 1fr; } }
/* Sur téléphone, le texte d'abord, la liste des articles ensuite. */
@media (max-width: 899px) {
  .aide-corps { order: -1; }
  .aide-sommaire { border-left: 0; border-top: 1px solid var(--trait); padding: 0.75rem 0 0; }
}
.aide-sommaire { font-size: 0.95rem; border-left: 3px solid var(--trait); padding-left: 0.9rem; }
.aide-sommaire b { display: block; margin-top: 0.9rem; color: var(--encre-douce); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.04em; }
.aide-sommaire ul { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.aide-sommaire li { margin: 0.2rem 0; }
.aide-sommaire a { color: var(--encre); }
.aide-sommaire a.actif { color: var(--vert); font-weight: 600; }
.aide-corps { max-width: 44rem; }
.aide-corps section + section { border-top: 1px solid var(--trait); margin-top: 2rem; padding-top: 1rem; }
.aide-corps h2 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.aide-corps h2 small { display: block; font-size: 0.9rem; font-weight: 400; color: var(--encre-douce); }
.aide-corps h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.35rem; }
.aide-corps p, .aide-corps li { line-height: 1.55; }
.aide-corps code { background: var(--fond-bande); padding: 0 0.25rem; border-radius: 3px; }
.aide-astuce, .aide-attention {
  border-left: 3px solid var(--vert); background: var(--vert-fond);
  padding: 0.5rem 0.75rem; border-radius: 0 4px 4px 0;
}
.aide-attention { border-left-color: var(--rouille); background: #f8ece8; }
.aide-tableau { border-collapse: collapse; margin: 0.5rem 0; }
.aide-tableau td { border-bottom: 1px solid var(--trait); padding: 0.3rem 0.75rem 0.3rem 0; vertical-align: top; }
.aide-vert { color: var(--vert); font-weight: 600; }
.aide-orange { color: #a06a12; font-weight: 600; }
.aide-rouge { color: var(--rouille); font-weight: 600; }
.aide-cartes { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.aide-cartes a {
  border: 1px solid var(--trait); border-radius: 6px; padding: 0.6rem 0.75rem; color: var(--encre);
  display: block; text-decoration: none;
}
.aide-cartes a:hover { border-color: var(--vert); text-decoration: none; }
.aide-cartes b { display: block; color: var(--vert); }
.aide-cartes span { font-size: 0.9rem; color: var(--encre-douce); }
.aide-actions { margin: 1.5rem 0; display: flex; gap: 1rem; align-items: center; }
@media print {
  .entete, .aide-actions, .aide-sommaire { display: none; }
  .aide-corps { max-width: none; }
  .aide-corps section { break-inside: avoid-page; }
}

/* ---------- Tableau de bord ---------- */
.tb-fraicheur { color: var(--encre-douce); font-size: 0.95rem; margin: 0.25rem 0 1rem; }
.tb-chiffres { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-bottom: 1.5rem; }
.tb-hausse { color: var(--vert); font-weight: 600; }
.tb-baisse { color: var(--rouille); font-weight: 600; }
.tb-titre { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.tb-titre small { font-weight: 400; color: var(--encre-douce); font-size: 0.9rem; }
.tb-cle { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; vertical-align: baseline; }
.tb-cle-n { background: var(--vert); }
.tb-cle-n1 { background: #c3c9d0; }
.tb-graphe { overflow-x: auto; }
.tb-graphe svg { width: 100%; height: auto; overflow: visible; }
/* Sur téléphone, plutôt faire défiler le graphique que rendre les libellés illisibles. */
@media (max-width: 700px) { .tb-graphe svg { min-width: 34rem; } }
.tb-grille { stroke: var(--trait); stroke-width: 1; }
.tb-axe { stroke: var(--encre); stroke-width: 1; }
.tb-graduation { font-size: 11px; fill: var(--encre-douce); text-anchor: end; }
.tb-libelle { font-size: 11px; fill: var(--encre-douce); text-anchor: middle; }
.tb-barre-n { fill: var(--vert); }
.tb-barre-n1 { fill: #c3c9d0; }
.tb-barre-n:hover, .tb-barre-n1:hover { opacity: 0.75; }
.tb-courbe { fill: none; stroke: var(--vert); stroke-width: 2; }
.tb-point { fill: var(--vert); }
.tb-courbe-n1 { fill: none; stroke: #c3c9d0; stroke-width: 2; stroke-dasharray: 5 4; }
.tb-point-n1 { fill: #c3c9d0; }
.tb-trait-n1 { display: inline-block; width: 18px; border-top: 2px dashed #c3c9d0; vertical-align: middle; margin: 0 2px; }
.tb-familles { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 720px) { .tb-familles { grid-template-columns: 15rem 1fr; } }
.tb-familles svg { width: 100%; max-width: 15rem; height: auto; }
.tb-pastille { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 2px; margin-right: 0.5rem; }
.tb-legende tfoot th { border-top: 2px solid var(--encre); }
.tb-note { color: var(--encre-douce); font-size: 0.9rem; margin-top: 1.5rem; }

/* ---------- Identité du dossier (en-tête, accueil, imprimés) ---------- */
.logo-dossier { height: 2rem; width: auto; display: block; }
/* Les boutons de l'en-tête suivent la couleur du dossier ; ailleurs (saisie, balance…)
   les boutons restent verts. */
.entete .bouton { background: var(--marque); border-color: var(--marque); color: #fff; }
.entete .bouton.secondaire { background: transparent; border-color: var(--bandeau-texte); color: var(--bandeau-texte); }
.entete .bouton.secondaire:hover { background: var(--bandeau-actif); color: #fff; }

.accueil-bandeau {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--marque-clair); border-radius: 10px;
  padding: 1rem 1.25rem; margin: 0 0 1.25rem;
}
.accueil-bandeau img { height: 4.5rem; width: auto; }
.accueil-bandeau h1 { margin: 0; }
.accueil-bandeau h1 small { color: var(--encre); opacity: 0.75; }
.accueil-bandeau img.ambiance { margin-left: auto; height: 6rem; width: 12rem; object-fit: cover; border-radius: 8px; }
@media (max-width: 760px) { .accueil-bandeau img.ambiance { display: none; } }

/* Logo sur les imprimés : page de garde de la plaquette, notice complète */
.pq-logo { height: 5rem; width: auto; display: block; margin: 0 0 1.5rem; }
.aide-garde { margin-bottom: 1.5rem; }
.aide-logo { height: 4.5rem; width: auto; display: block; margin: 0 0 0.6rem; }
@media print {
  .pq-logo, .aide-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------------------
   Grand livre par tiers
   --------------------------------------------------------------------------- */
.tableau tr.groupe-tiers td { padding-top: 1rem; font-weight: 600; border-bottom: 1px solid var(--encre); }
.tableau tr.groupe-tiers td small { font-weight: 400; color: var(--encre-douce); }
.tableau tr.groupe-tiers:first-child td { padding-top: 0.4rem; }

/* ---------------------------------------------------------------------------
   Version du logiciel (en-tête, à droite du nom)
   --------------------------------------------------------------------------- */
.entete .version { font-size: 0.72rem; color: var(--bandeau-doux); cursor: help; margin-left: -0.6rem; align-self: center; }
@media print { .entete .version { display: none; } }

/* ---- Grand livre : cases à cocher empilées (non lettrées au-dessus de validées) ---- */
.filtres .cases-empilees { display: flex; flex-direction: column; gap: 0.15rem; }
.filtres .cases-empilees label.ligne { padding-bottom: 0; }

/* ---- Lettrage dans le grand livre ---- */
.barre-lettrage { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-left: auto; align-self: flex-end; }
.barre-lettrage #etat-lettrage { font-size: 0.9rem; }
.barre-lettrage #etat-lettrage { color: var(--encre-douce); }
.barre-lettrage #etat-lettrage.ok { color: var(--vert); font-weight: 600; }
.barre-lettrage #etat-lettrage.ecart { color: var(--rouille); }
.tableau .case { width: 1.6rem; padding-right: 0; }
.tableau .case input { width: 1.05rem; height: 1.05rem; }
button.lettre, span.lettre { font: inherit; font-size: 0.8rem; padding: 0 0.35rem; border: 1px solid var(--trait);
  border-radius: 3px; background: var(--fond, #fff); color: var(--encre-douce); cursor: pointer; }
button.lettre:hover { border-color: var(--rouille); color: var(--rouille); }
.note-lettrage { color: var(--encre-douce); font-size: 0.85rem; margin-top: 0.75rem; }
@media print { .barre-lettrage, .note-lettrage, .tableau .case { display: none !important; } }

.barre-lettrage .bouton:disabled { opacity: 0.45; cursor: not-allowed; }

/* Cartouche cliquable (écran Banque → écritures non pointées) */
a.cartouche { color: inherit; text-decoration: none; }
a.cartouche:hover { border-color: var(--vert); }
a.cartouche small { color: var(--vert); }

/* ---- Relevé : choix des opérations affichées ---- */
.voir-lignes { display: inline-flex; margin-left: auto; border: 1px solid var(--trait); border-radius: 6px; overflow: hidden; background: #fff; }
.voir-lignes a { padding: 0.4rem 0.75rem; color: var(--encre); text-decoration: none; border-left: 1px solid var(--trait); white-space: nowrap; }
.voir-lignes a:first-child { border-left: 0; }
.voir-lignes a small { color: var(--encre-douce); margin-left: 0.2rem; }
.voir-lignes a.actif { background: var(--vert); color: #fff; }
.voir-lignes a.actif small { color: #fff; }
.voir-lignes a:hover:not(.actif) { background: var(--fond-bande); }
@media print { .voir-lignes { display: none !important; } }
.voir-lignes a.alerte:not(.actif) { color: var(--rouille); font-weight: 600; }
.voir-lignes a.alerte:not(.actif) small { color: var(--rouille); }
.proposition input.a-completer { border-color: var(--rouille); background: #fdf3f0; }
.proposition small.motif { display: block; color: var(--rouille); font-weight: 600; }
.filtres a.bouton.alerte { color: var(--rouille); border-color: var(--rouille); font-weight: 600; }
.filtres a.bouton.filtre-actif { background: var(--vert); color: #fff; border-color: var(--vert); text-decoration: none; }

/* ---- Saisie Ventes : Z déposés à saisir ---- */
.z-a-saisir { flex-wrap: wrap; gap: 0.5rem 1rem; }
.z-a-saisir .liste-z { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.z-a-saisir .bouton.petit { padding: 0.15rem 0.6rem; }
.z-a-saisir .bouton.actif { background: var(--vert); color: #fff; border-color: var(--vert); }

/* ---- Saisie Ventes : comptes de vente à créer ---- */
.comptes-a-creer { flex-direction: column; align-items: stretch; gap: 0.5rem; }
.comptes-a-creer .ligne-compte { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.comptes-a-creer .ligne-compte input { flex: 1; min-width: 14rem; max-width: 28rem; }
.comptes-a-creer small { color: var(--encre-douce); }

/* ---- Éditions PDF / Excel ---- */
.boutons-edition { display: inline-flex; gap: 0.4rem; }
.boutons-edition .bouton { padding: 0.35rem 0.75rem; }
.bloc-edition { border: 1px solid var(--trait); border-radius: 6px; padding: 0.5rem 0.9rem; margin: 0 0 1rem; background: #fff; }
.bloc-edition summary { cursor: pointer; font-weight: 600; color: var(--vert); }
.bloc-edition summary small { font-weight: 400; color: var(--encre-douce); }
.bloc-edition .filtres { margin: 0.6rem 0 0.4rem; }
.bloc-edition input[type=text] { font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--trait); border-radius: 4px; }
@media print { .boutons-edition, .bloc-edition { display: none !important; } }

/* ---- Saisie : filtre des brouillards par journal ---- */
.filtre-brouillards { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.6rem; }
.filtre-brouillards a { padding: 0.2rem 0.65rem; border: 1px solid var(--trait); border-radius: 999px; background: #fff; color: var(--encre); text-decoration: none; }
.filtre-brouillards a small { color: var(--encre-douce); }
.filtre-brouillards a.actif { background: var(--vert); border-color: var(--vert); color: #fff; }
.filtre-brouillards a.actif small { color: #fff; }

/* ---- Grand livre : une seule barre (filtres, éditions, changer de compte, lettrage) ---- */
.barre-gl > form { display: contents; }
.barre-gl { gap: 0.5rem 0.8rem; }
.barre-gl select[name=t] { max-width: 9.5rem; }
.barre-gl .champ-compte, .changer-compte .champ-compte { font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--trait); border-radius: 4px; width: 11rem; }
.changer-compte { margin: 0; }
.barre-gl .barre-lettrage { margin-left: auto; }
/* Totaux en tête : sur téléphone la colonne Solde est masquée, le solde s'affiche à côté du libellé */
.solde-mobile { display: none; }
@media (max-width: 600px) { .solde-mobile { display: inline; } }

/* ---- États : détail des comptes d'une rubrique, déplié au clic ---- */
table.pq tr.pq-depliable { cursor: pointer; }
table.pq tr.pq-depliable:hover td { background: var(--pq-bleu-clair); }
table.pq button.deplier { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
table.pq button.deplier::before { content: "▸"; display: inline-block; width: 1rem; color: var(--pq-bleu); }
table.pq tr.ouvert button.deplier::before { content: "▾"; }
table.pq tr.ouvert td { font-weight: 600; }
table.pq button.deplier small { color: var(--encre-douce); font-weight: 400; font-size: 0.75rem; }
table.pq tr.pq-detail td { font-size: 0.84rem; color: var(--encre-douce); background: #fbfcfd; padding-top: 0.2rem; padding-bottom: 0.2rem; }
table.pq tr.pq-detail td:first-child { padding-left: 1.6rem; }
table.pq tr.pq-detail a { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; margin-right: 0.4rem; }
.deplier-tout { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin: 0 0 0.75rem; }
.deplier-tout .bouton { padding: 0.25rem 0.7rem; }
@media print { table.pq button.deplier::before { content: ""; width: 0; } table.pq button.deplier small { display: none; } }
/* Sélecteur d'applications (bandeau), comme dans Sage 100 */
details.apps { position: relative; }
details.apps summary { list-style: none; cursor: pointer; }
details.apps summary::-webkit-details-marker { display: none; }
details.apps .chevron { font-size: 0.75em; color: var(--bandeau-doux); }
details.apps ul { position: absolute; left: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--trait); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 14rem; z-index: 50; }
details.apps li a, details.apps li .a-venir { display: block; padding: 0.45rem 0.9rem; text-decoration: none; color: var(--encre); letter-spacing: 0; font-weight: 400; }
details.apps li a:hover { background: #eef3f8; }
details.apps li a.courante { font-weight: 700; }
details.apps li .a-venir { color: #9aa5b1; cursor: default; }
details.apps li .a-venir small { font-size: 0.75em; }

/* ---------- Collecte des pièces (écran de la saisie) ---------- */
.collecte { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem; margin: 1rem 0 0.75rem; }
.collecte-tuile { display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem 1.1rem; border: 1px solid var(--trait); border-radius: 10px; background: #fff; }
.collecte-tuile:hover { border-color: var(--marque); box-shadow: 0 1px 4px rgba(31, 42, 55, 0.08); }
.collecte-titre { display: flex; flex-direction: column; gap: 0.15rem; }
.collecte-titre .ico { font-size: 1.9rem; line-height: 1; }
.collecte-titre b { font-size: 1.15rem; color: var(--marque); }
.collecte-titre .consigne { font-size: 0.85rem; color: var(--encre-douce); }
.collecte-boutons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; }
.collecte-boutons .bouton { flex: 1; min-width: 7rem; padding: 0.75rem 0.5rem; font-size: 1rem; }
.collecte-compte { font-size: 0.8rem; color: var(--encre-douce); }
.collecte-tuile button:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 600px) { .collecte { grid-template-columns: 1fr 1fr; gap: 0.6rem; } .collecte-tuile { padding: 0.75rem; } .collecte-boutons .bouton { min-width: 0; font-size: 0.9rem; } }
.tableau tr.report td { background: var(--vert-fond); font-style: normal; }
.tableau td.piece-jointe, .tableau th.piece-jointe { width: 1.6rem; padding-left: 0.2rem; padding-right: 0.2rem; text-align: center; white-space: nowrap; }
.tableau td.piece-jointe a { text-decoration: none; font-size: 1rem; }
.tableau td.piece-jointe sup { font-size: 0.65rem; color: var(--encre-douce); }
/* Bouton « ✦ Prompt IA » (règle commune aux modules THIBEO, 10/11/2026) : violet, même gabarit que les boutons d'export */
.bouton-ia { display: inline-block; padding: 0.35rem 0.8rem; border: 1px solid #5b3fa8; border-radius: 4px; background: #5b3fa8; color: #fff; font: inherit; font-size: 0.9rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.bouton-ia:hover { background: #4a3290; border-color: #4a3290; color: #fff; text-decoration: none; }
@media print { .bouton-ia { display: none; } }
/* Boutons-symbole (règle Thibaut 13/11/2026 : économiser l'écran) : même hauteur que les boutons texte */
.bouton-icone { padding-left: 0.55rem; padding-right: 0.55rem; font-size: 1.05rem; line-height: 1; }
.bouton-icone[aria-expanded="true"] { background: var(--vert); color: #fff; }
form.bloc-edition { margin-top: -0.4rem; }
/* Menu du bouton ✦ Prompt IA : un cycle par ligne */
.menu-ia { position: relative; display: inline-block; }
.menu-ia summary { list-style: none; }
.menu-ia summary::-webkit-details-marker { display: none; }
.menu-ia-liste { position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 20; min-width: 17rem; background: #fff; border: 1px solid var(--trait); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,0.12); padding: 0.3rem 0; }
.menu-ia-liste a { display: block; padding: 0.35rem 0.8rem; color: var(--encre); text-decoration: none; font-size: 0.9rem; white-space: nowrap; }
.menu-ia-liste a b { display: inline-block; width: 2.2rem; color: #5b3fa8; }
.menu-ia-liste a:hover { background: var(--vert-fond); }
.tableau.recherche td small { display: block; font-size: 0.78rem; color: var(--encre-douce); font-weight: 400; }

/* ---------- Boutons : une seule taille partout (règle Thibaut 13/11/2026 : moins hauts, alignés) ----------
   Hauteur commune 1,9 rem pour .bouton, .bouton-ia, .bouton-icone ; les champs des barres de filtres ont la même
   hauteur pour que tout s'aligne sur une ligne. Les boutons « petit » des tableaux gardent leur taille. */
.bouton, .bouton-ia, .bouton-icone, .boutons-edition .bouton, .filtres .bouton, .menu-ia summary {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 1.9rem; padding: 0 0.75rem; font-size: 0.9rem; line-height: 1; border-radius: 4px; white-space: nowrap;
}
.bouton.petit { height: auto; padding: 0.1rem 0.55rem; font-size: 0.85rem; }
.bouton-icone { padding: 0 0.5rem; font-size: 1rem; }
.filtres select, .filtres input[type=date], .filtres input[type=text], .filtres input[type=search], .filtres input[list], .filtres .champ, .changer-compte .champ-compte {
  box-sizing: border-box; height: 1.9rem; padding: 0 0.5rem; font-size: 0.9rem;
}
.filtres label.ligne { padding-bottom: 0.35rem; }
.filtres .boutons-edition, .filtres .menu-ia { align-self: end; }
.defilement-comptes .bouton { height: 1.9rem; }
.filtres select[name=rubrique] { max-width: 13rem; } .filtres input[name=q] { width: 12rem; }
