/* =============================================================================
   Listes des documents (lot A2) : critères, segments avec compteurs, tri par en-tête,
   barre d'actions groupées, totaux, liste imprimée, facturation groupée.
   Aucune règle de style en ligne (CSP) : tout passe par ce fichier.
   ============================================================================= */

/* Critères (fenêtre « Consultation des … » : consultation.css) ------------------------------- */
.filters-liste .fld-tiers { flex: 0 1 150px; }
.filters-liste .fld-page { flex: 0 0 90px; }
.seg-n { margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.seg.on .seg-n { color: rgba(255, 255, 255, .75); }

/* Tableau -------------------------------------------------------------------------------- */
.tbl-liste th, .tbl-liste td { padding: 8px 9px; }
.tbl-liste thead th { white-space: normal; vertical-align: bottom; }
.tbl-liste th:first-child, .tbl-liste td:first-child { padding-left: 18px; }
.tbl-liste th a.tri { color: inherit; text-decoration: none; }
.tbl-liste th a.tri:hover, .tbl-liste th a.tri.on { color: var(--ink); text-decoration: underline; }
.tbl-liste th.num a.tri { display: inline-block; }
.tbl-liste td .sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tbl-liste td.num .sub { display: inline; }
/* Client et statut passent à la ligne (alertes, retard) : le tableau tient à 1440 px sans défilement. */
.tbl-liste td.cell-tiers { white-space: normal; min-width: 220px; }
.tbl-liste td.cell-statut { white-space: normal; min-width: 110px; }
.tbl-liste td.cell-tiers .sub, .tbl-liste td.cell-statut .sub { white-space: normal; }
.tbl-liste .badge { white-space: nowrap; }
.tbl-liste .cell-tiers .badge, .tbl-liste .cell-statut .badge { margin-left: 4px; }
.tbl-liste .cell-statut .badge:first-child { margin-left: 0; }
.tbl-liste tr.muted td { color: var(--muted); }
.tbl-liste tfoot td, .tbl-liste tfoot th { white-space: nowrap; }
.txt-amber { color: var(--amber-ink); }
.avancement { width: 56px; height: 8px; vertical-align: middle; accent-color: var(--primary); }

/* Actions groupées -------------------------------------------------------------------------- */
.bulk-liste { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 18px; margin: 0;
  border-bottom: 1px solid var(--line-2); background: var(--surface-3); }
.bulk-liste .bulk-compte { margin-right: auto; align-self: center; }
.bulk-liste .fld { flex: 0 1 170px; }
.bulk-liste.actif { background: var(--blue-bg); }
.btn-danger { color: var(--red-ink); border-color: var(--red-ink); }
.btn-danger:hover { background: var(--red-bg); color: var(--red-ink); }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pager-liste { flex-wrap: wrap; }

/* Facturation groupée ---------------------------------------------------------------------- */
.fg-criteres .fld { flex: 0 1 210px; }
.fg-apercu { padding: 16px 18px 4px; display: flex; flex-direction: column; gap: 6px; }
.fg-apercu p { margin: 0; }
.fg-resume { font-size: 15px; }
.fg-generer { display: flex; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-2); margin: 0; }

/* Liste imprimée (page sans menu) ---------------------------------------------------------- */
body.liste-impression { background: #FFFFFF; padding: 24px; }
.li-entete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 12px; }
.li-entete h1 { margin: 2px 0; font-size: 20px; }
.li-entete p { margin: 0; color: var(--muted); font-size: 12.5px; }
.li-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; color: var(--muted); }
.li-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.liste-impression .alerte { margin-bottom: 12px; }
.liste-impression .tbl td, .liste-impression .tbl th { padding: 6px 8px; }
.liste-impression .scroll-x { overflow: visible; }

@media (max-width: 599px) {
  .filters-liste .fld-tiers { flex: 1 1 100%; }
  .bulk-liste .bulk-compte { flex: 1 1 100%; }
  body.liste-impression { padding: 12px; }
}

@media print {
  .bulk-liste, .pager-liste, .li-actions { display: none !important; }
  body.liste-impression { padding: 0; }
  .liste-impression .tbl { font-size: 10.5px; }
  .liste-impression .tbl td, .liste-impression .tbl th { padding: 3px 5px; }
  .liste-impression thead { display: table-header-group; }
  .liste-impression tr { page-break-inside: avoid; }
  .tbl-liste a { color: inherit; text-decoration: none; }
  .badge { border: 1px solid currentColor; }
}

/* Cadre « Accès » de la liste (lot D, captures 067, 076, 088, 094) : boutons radio, colonne par colonne */
.acces-radios-liste { display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 0 16px; }
.acces-radios-liste .acces-r { min-height: 26px; cursor: pointer; font-size: 12.5px; }
.acces-radios-liste .acces-r input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
@media (max-width: 599px) {
  .acces-radios-liste { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Colonnes de l'ancien + ajouts du web : cellules plus serrées (la liste défile dans sa carte si besoin, comme la grille de 089) */
.tbl-liste th, .tbl-liste td { padding-left: 6px; padding-right: 6px; }
.tbl-liste th:first-child, .tbl-liste td:first-child { padding-left: 14px; }
.tbl-liste td.cell-tiers { min-width: 160px; }
