/* ventes — styles propres à ce module.
   0.4.23 : panneau de filtres et choix de colonnes (calqués sur Achats et
   Stocks), bouton vert de validation, bandeau des pièces importées,
   verdicts du contrôle. Aucune couleur nouvelle : les jetons --ok, --ambre
   et --alerte existants. */

/* ---- Filtres ---- */
.ven-filtres {
  display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px;
  padding: 12px 14px; border-radius: var(--r-ctl); background: var(--panneau); box-shadow: 0 0 0 1px var(--trait);
}
.ven-f-entete { display: flex; align-items: center; justify-content: space-between; }
.ven-f-nom { font-weight: 600; font-size: var(--fs-sm); }
.ven-btn-filtres { position: relative; }
.ven-btn-filtres.ouvert, .ven-btn-filtres.filtre-actif { box-shadow: inset 0 0 0 1px var(--encre); }
.ven-f-compte {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px;
  margin-left: 4px; border-radius: 9px; background: var(--encre); color: var(--panneau);
  font-size: 11px; font-weight: 600; line-height: 1;
}
.ven-f-resume { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; }
.ven-f-titre { font-size: var(--fs-sm); color: var(--encre2); margin-right: 2px; }
.ven-f-pastille {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px;
  border-radius: 999px; background: var(--panneau); box-shadow: 0 0 0 1px var(--trait);
  font-size: var(--fs-sm); color: var(--encre);
}
.ven-f-retirer {
  border: 0; background: none; cursor: pointer; color: var(--encre2);
  width: 22px; height: 22px; border-radius: 50%; font-size: 15px; line-height: 1;
}
.ven-f-retirer:hover { background: var(--trait); color: var(--encre); }
.ven-f-retirer:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }
.ven-f-crit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ven-f { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.ven-f > span:first-child { font-size: var(--fs-xs); color: var(--encre3); }
.ven-f .inp { min-width: 160px; max-width: 240px; }
.ven-f-listes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ven-fm { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ven-fm legend { font-size: var(--fs-xs); color: var(--encre3); padding: 0; margin-bottom: 4px; }
.ven-fm-n {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
  border-radius: 8px; background: var(--encre); color: var(--panneau); font-size: 10px; font-weight: 600;
}
.ven-fm-liste { max-height: 168px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  padding: 4px; border-radius: var(--r-ctl); box-shadow: 0 0 0 1px var(--trait); }
.ven-fm-opt { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 4px; font-size: var(--fs-sm); cursor: pointer; }
.ven-fm-opt:hover { background: var(--trait); }
.ven-fm-opt[hidden] { display: none; }
.ven-fm-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ven-fm .btn { align-self: flex-start; }
@media (max-width: 640px) { .ven-f { flex: 1 1 140px; } .ven-f .inp { max-width: none; } }

/* ---- Colonnes ---- */
.ven-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px 18px; }
.ven-col { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 7px 8px; border-radius: 8px; font-size: 13px; color: var(--encre2); }
.ven-col:hover { background: var(--voile2); }
.ven-col input { width: 15px; height: 15px; margin: 0; accent-color: var(--encre); cursor: pointer; }
.ven-col.fixe { cursor: default; color: var(--encre3); }
.ven-col.fixe:hover { background: none; }
.ven-col .hint { margin: 0 0 0 auto; font-size: var(--fs-xs); }

/* ---- Le bouton vert : valider, c'est faire le lien définitif ---- */
.btn.valider { background: var(--ok); color: var(--panneau); box-shadow: none; font-weight: 600; }
.btn.valider:hover { filter: brightness(1.08); box-shadow: 0 0 0 3px var(--ok-voile); }
.btn.valider:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; }
.btn.valider[disabled] { opacity: .45; filter: none; box-shadow: none; cursor: not-allowed; }
.btn.valider svg { margin-right: 6px; }

/* ---- Bandeau des pièces importées en attente ---- */
.ven-bandeau {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 14px;
  border-radius: var(--r-ctl); background: var(--ambre-voile); box-shadow: 0 0 0 1px var(--trait);
}
.ven-bandeau > div { flex: 1; min-width: 0; font-size: var(--fs-sm); }
.ven-bandeau .hint { display: block; margin-top: 2px; }
@media (max-width: 640px) { .ven-bandeau { flex-wrap: wrap; } .ven-bandeau .btn { width: 100%; justify-content: center; } }
.ven-tbl tr.ven-a-valider td:first-child { box-shadow: inset 3px 0 0 var(--ambre); }

/* ---- Avertissement avant import ---- */
.ven-avert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 12px;
  border-radius: var(--r-ctl); background: var(--ambre-voile); }
.ven-avert .led { margin-top: 6px; }
.ven-avert p { margin: 0; }
.ven-imp-resume { padding: 10px 14px; margin: 0 0 12px; border-radius: var(--r-ctl); box-shadow: 0 0 0 1px var(--trait); }
.ven-imp-resume p { margin: 0 0 4px; }

/* ---- Validation : liens et verdicts ---- */
.ven-lien {
  display: inline-block; margin: 0 4px 2px 0; padding: 1px 8px; border-radius: 999px;
  font-size: var(--fs-xs); background: var(--voile2); color: var(--encre2);
}
.ven-lien-stock { background: var(--ambre-voile); color: var(--ambre); }
.ven-lien-comptable { background: var(--ok-voile); color: var(--ok); }
.ven-lien-tresorerie { background: var(--voile2); color: var(--encre); box-shadow: inset 0 0 0 1px var(--trait); }
.ven-motifs { margin: 4px 0 0; padding-left: 16px; font-size: var(--fs-xs); color: var(--encre2); max-width: 460px; }
.ven-motifs li { margin: 2px 0; }
.ven-motifs.bad { color: var(--alerte); }
.ven-val-tbl td { vertical-align: top; }
.ven-val-tbl input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ok); margin-top: 2px; }
.ven-val-tbl tr.ven-focus td { background: var(--ambre-voile); }
.ven-c-controle { min-width: 240px; }
.ven-verdict { padding: 10px 14px; margin: 0 0 14px; border-radius: var(--r-ctl); box-shadow: 0 0 0 1px var(--trait); }
.ven-verdict.ok { background: var(--ok-voile); }
.ven-verdict.bad { background: var(--alerte-voile); }
.ven-verdict .ven-motifs { max-width: none; }
.ven-verdict-liens { margin-top: 8px; }

/* ---- Clients (0.4.24) ---- */
.vcl-fiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.ven-his-intro { margin: -6px 0 12px; }

/* ---- Sélection multiple (0.4.25) ---- */
.ven-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; padding: 10px 14px;
  border-radius: var(--r-ctl); background: var(--panneau); box-shadow: 0 0 0 2px var(--encre); }
.ven-selbar .row { gap: 6px; margin-left: auto; flex-wrap: wrap; }
.ven-tbl tr.ven-sel td { background: var(--voile2); }
.ven-tbl tr.ven-sel td:first-child { box-shadow: inset 3px 0 0 var(--encre); }
.ven-astuce { color: var(--encre3); margin-right: 14px; }
.ven-sel-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; margin-top: 12px; }

/* 0.4.31.P7 (OCR, point a) : bloc « Règlements » de la fiche d'une facture (ventes et achats). */
.regl-bloc { margin-top: 14px; }
.regl-bloc .regl-vide { padding: 12px 14px; margin: 0; }
.regl-bloc .lb-code {
  display: inline-block; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500;
  background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 1px 7px;
}
.regl-pied { justify-content: flex-end; gap: 18px; padding: 10px 14px; border-top: 1px solid var(--trait); font-size: var(--fs-sm); }
.regl-bloc td, .regl-bloc th { padding-left: 8px; padding-right: 8px; }
.regl-bloc .nowrap { white-space: nowrap; }
.regl-bloc .btn.sm { white-space: nowrap; }

/* 0.4.31.P10 (VEN) : nature du client ; prix, remise et TVA d'une pièce en brouillon. */
/* Contrôle MOA du 2026-10-28 : toute la pièce sans défilement latéral. Champs serrés (la remise tient en 3 chiffres :
   elle ne dépasse jamais 100 %), désignation plus large, espacements réduits. */
.ven-ed-tbl { table-layout: auto; width: 100%; }
.ven-ed-tbl td, .ven-ed-tbl th { padding-left: 8px; padding-right: 8px; }
.ven-ed-tbl td:first-child { min-width: 240px; }
.ven-ed-tbl .inp { padding: 0 8px; min-height: 32px; }
.ven-ed-tbl .inp.num input { width: 80px; text-align: right; padding: 6px 0; }
.ven-ed-tbl .inp.num.ven-court input { width: 3.5ch; }
.ven-ed-tbl select { padding: 6px 0; }
/* Passage Brave UIUX-2 : en largeur réduite (tablette), 9 px de trop à 768 px ; le tableau se resserre encore. */
@media (max-width: 900px) {
  .ven-ed-tbl td, .ven-ed-tbl th { padding-left: 5px; padding-right: 5px; }
  .ven-ed-tbl td:first-child { min-width: 150px; }
  .ven-ed-tbl .inp { padding: 0 6px; }
  .ven-ed-tbl .inp.num input { width: 60px; }
}
/* Le total HT · TVA · TTC sur une ligne élargissait la dernière colonne au-delà du cadre : il passe à la ligne. */
.ven-ed-tbl td, .ven-ed-tbl th { white-space: normal; }
.ven-ed-tbl td[data-ven-tot] { min-width: 120px; }
.ven-ed-tbl tr.ven-modif td { background: var(--ambre-voile); }
.ven-ed-tbl tr.ven-a-saisir td:first-child { box-shadow: inset 3px 0 0 var(--ambre); }   /* 0.4.31.P10 : prix à saisir */
.ven-a-saisir-note { margin: 8px 0; }
.ven-ed-pied { gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ven-motif { min-width: 220px; }
.ven-hist { margin-top: 12px; }

/* 0.5.0.P1 (AUD), lot 7 : pied de liste, une ligne par devise. */
.ven-totaux { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
