/* ponytail: CSS minimal à la main pour Phase 0. Tailwind v4 (CLI) quand le style grossit. */
* { box-sizing: border-box; }
body { margin: 0; font: 14px system-ui, sans-serif; color: #1a1a1a; }
.layout { display: flex; min-height: 100vh; }

.sidebar {
  flex: 0 0 220px;
  background: linear-gradient(#8aa385, #2f422c);
  color: #fff; padding: 16px 0;
}
.sidebar .logo { font-weight: 700; font-size: 20px; padding: 0 16px 16px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 8px 16px; color: #f2f2f2; cursor: pointer; text-decoration: none; }
.sidebar a:hover { background: rgba(255,255,255,.12); }
.sidebar a.active { background: rgba(255,255,255,.22); font-weight: 600; }

main { flex: 1; padding: 16px; background: #fff; }
.view-head h1 { font-size: 18px; margin: 0 0 10px; }

.filters { display: flex; gap: 8px; align-items: center; background: #e5e7eb; padding: 6px 8px; border-radius: 4px; margin-bottom: 8px; }
.filters .lbl { font-weight: 600; }
.filters input { padding: 4px 6px; border: 1px solid #bbb; border-radius: 3px; }

.grid { width: 100%; border-collapse: collapse; }
.grid th { background: #3d4f3d; color: #fff; font-weight: 600; text-align: left; padding: 6px 8px; }
.grid td { padding: 5px 8px; border-bottom: 1px solid #eee; }
.grid tbody tr:nth-child(even) td { background: #f9f9f9; }
.grid td.empty { text-align: center; color: #888; padding: 20px; }
.grid tr.totaux td { font-weight: 700; background: #eef2ee; border-top: 2px solid #3d4f3d; }

.view-foot { margin-top: 12px; }
.back { display: inline-block; padding: 4px 12px; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; text-decoration: none; color: #333; }

/* Pagination des listes (moteur générique) — réutilise .add-sm existant */
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 12px; flex-wrap: wrap; }
.pagination .pg-info { color: #555; font-size: 13px; }
.pagination .pg-nav { display: flex; align-items: center; gap: 6px; }
.pagination .pg-page { padding: 0 4px; font-size: 13px; color: #333; }

.enregistrer-flottant { position: fixed; right: 20px; bottom: 70px; padding: 10px 16px; border: none;
  border-radius: 24px; background: #3d4f3d; color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.18);
  cursor: pointer; font-size: 14px; z-index: 10; }
.enregistrer-flottant[hidden] { display: none; }
.enregistrer-flottant:disabled { opacity: .75; cursor: wait; }
.enregistrer-flottant.save-error { background: #b3261e; }
/* L'action de sauvegarde de vente reste un mécanisme interne, déclenché par la palette. */
.enregistrer-flottant:not([hidden]) { display: none; }
.signer { display: none; }
#raccourcis-ecran { position: fixed; z-index: 30; right: 18px; top: 50%; transform: translateY(-50%);
  width: 72px; overflow: hidden; border: 1px solid #c7d0c4; border-radius: 17px; background: #fff;
  box-shadow: 0 3px 11px rgba(22,42,22,.18); }
#raccourcis-ecran[hidden] { display: none; }
.raccourci-action { width: 100%; min-height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 7px 4px; border: 0; border-bottom: 1px solid #e1e5df; background: #fff; color: #1d291e;
  cursor: pointer; font: inherit; }
.raccourci-action:last-child { border-bottom: 0; }
.raccourci-action:hover, .raccourci-action:focus-visible { background: #edf3eb; outline: none; }
.raccourci-action > span { color: #3d5d3c; font-size: 21px; line-height: 1; }
.raccourci-action small { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
#raccourcis-toast { position: fixed; z-index: 35; right: 100px; top: 50%; transform: translateY(-50%); max-width: 260px;
  padding: 8px 11px; border-radius: 5px; background: #293729; color: #fff; font-size: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
#raccourcis-toast[hidden] { display: none; }

/* Fiche client */
.view-head { display: flex; align-items: center; gap: 12px; }
.view-head .add { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; border: none; background: #3d4f3d; color: #fff; font-size: 18px; cursor: pointer; }
.grid tr.clickable { cursor: pointer; }
.grid tr.clickable:hover td { background: #eef2ee; }
.flash-ok { color: #1a7f37; font-weight: 600; }
.flash-err { color: #b3261e; font-weight: 600; }
.fld { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.fld input { padding: 5px 7px; border: 1px solid #bbb; border-radius: 3px; }
.record .view-foot { display: flex; justify-content: space-between; align-items: center; max-width: 780px; margin-top: 16px; }
.valider { background: #3d4f3d; color: #fff; border: none; padding: 8px 18px; border-radius: 4px; cursor: pointer; }

/* Historique dans la fiche */
.historique { max-width: 780px; margin-top: 22px; }
.historique h2 { font-size: 14px; margin: 14px 0 4px; color: #3d4f3d; }
.grid.mini th, .grid.mini td { padding: 3px 8px; font-size: 12px; }

/* Vente : lignes + totaux */
.addline { display: flex; gap: 6px; margin: 6px 0 14px; flex-wrap: wrap; align-items: center; }
.addline input { padding: 4px 6px; border: 1px solid #bbb; border-radius: 3px; }
.addline input[name="reference"] { width: 90px; }
.addline input[name="libelle"] { flex: 1; min-width: 160px; }
.addline input[name="quantite"] { width: 60px; }
.addline input[name="prix_unitaire"], .addline input[name="remise"] { width: 90px; }
.del { border: none; background: #b3261e; color: #fff; border-radius: 3px; cursor: pointer; padding: 1px 7px; }
.totaux-bar { display: flex; flex-wrap: wrap; gap: 20px; background: #3d4f3d; color: #fff; padding: 10px 14px; border-radius: 4px; max-width: 780px; }
.totaux-bar b { margin-left: 4px; }

/* Picker d'articles */
.picker-open { background: #3d4f3d; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; margin: 4px 0 8px; }
dialog.picker { width: min(860px, 92vw); max-height: 82vh; border: none; border-radius: 8px; padding: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
dialog.picker::backdrop { background: rgba(0,0,0,.45); }
.picker-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.picker-head h2 { margin: 0; line-height: 1.12; }
dialog.picker .close { border: none; background: transparent; font-size: 18px; cursor: pointer; margin-left: auto; }
.picker-search { width: 100%; padding: 7px 9px; border: 1px solid #bbb; border-radius: 4px; margin: 6px 0 10px; }
.picker-criteres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.picker-criteres input[type="text"], .picker-criteres input:not([type]), .picker-criteres .picker-select {
  padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; flex: 1 1 140px; min-width: 0;
}
.picker-select-label { display: flex; align-items: center; gap: 5px; flex: 1 1 170px; min-width: 0; font-size: 12px; }
.picker-select-label > span { color: #555; white-space: nowrap; }
.picker-select-label .picker-select { width: 100%; }
.type-verre-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.type-verre-form .picker-select-label { flex: 1 1 240px; }
.type-verre-form .picker-select { padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; }
.picker-diam { width: 60px !important; flex: 0 0 60px !important; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; }
.picker-classe-a { display: flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.catalogue-picker { width: min(1180px, 96vw); }
.catalogue-picker .presc-ctx { margin: 4px 0 10px; }
.picker-table-scroll { max-height: 52vh; overflow: auto; border: 1px solid #dce4dc; border-radius: 4px; }
.catalogue-picker .picker-table { min-width: 760px; }
.catalogue-picker .picker-table thead th { position: sticky; top: 0; z-index: 1; }
.catalogue-picker .picker-table td { vertical-align: middle; }
.catalogue-picker .picker-table .muted { color: #6d756d; font-size: 11px; }
.stock-ok { color: #2f6b2f; font-weight: 700; }
.stock-catalogue { color: #8a6d3b; font-size: 11px; white-space: nowrap; }
.price-empty { color: #8a6d3b; font-size: 11px; white-space: nowrap; }
.picker-diam-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #555; }
.picker-diam-label .picker-diam { margin: 0; }
.lens-criteres { align-items: flex-end; }
.lens-criteres .picker-select-label { flex: 1 1 155px; }
.lens-criteres .picker-select-label:first-child { flex-basis: 225px; }
.lentilles-picker .presc-ctx em { display: inline; }
.grid .num, .grid th.num { text-align: right; }

/* Sélecteur de verres — géométrie calée sur l'écran métier WinOptics de référence. */
dialog.verre-picker-reference { width: min(1540px, 97vw); height: min(850px, 94vh); max-height: 94vh;
  padding: 0; overflow: hidden; border-radius: 5px; color: #1f2a1f; }
.verre-selection-form { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #fff; }
.verre-ref-title { display: flex; align-items: center; min-height: 34px; padding-left: 15px; border-bottom: 1px solid #d7ddd4;
  background: #f4f5f3; }
.verre-ref-title strong { align-self: stretch; display: flex; align-items: center; padding: 0 18px;
  border-bottom: 3px solid #496747; font-size: 15px; }
.verre-ref-title > span { padding: 0 17px; color: #315431; font-size: 23px; font-weight: 700; }
.verre-ref-title .close { margin-left: auto; margin-right: 8px; }
.verre-ref-eyes { display: grid; grid-template-columns: minmax(310px, 1fr) minmax(310px, 1fr) 250px;
  gap: 14px; padding: 10px 14px 8px; }
.verre-ref-eye { position: relative; min-height: 83px; overflow: hidden; border: 2px solid #3f583d; border-radius: 6px; }
.verre-ref-eye-title { display: inline-block; min-width: 78px; padding: 7px 18px; background: #2f482e; color: #fff;
  font-size: 14px; font-weight: 650; }
.verre-ref-eye-status { display: inline-block; margin-left: 8px; padding: 3px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; vertical-align: middle; }
.verre-ref-eye-status.ok { background: #dbead8; color: #285426; }
.verre-ref-eye-status.ko { background: #f5d6d3; color: #8b2822; }
.verre-ref-eye.current { box-shadow: inset 0 0 0 1px #8aa883; }
.verre-ref-correction { display: flex; gap: 7px; padding: 8px 14px 5px; }
.verre-ref-correction span { min-width: 66px; padding: 2px 5px; border: 1px solid #b8c1b4; border-radius: 3px;
  color: #52604f; font-size: 11px; }
.verre-ref-correction b { float: right; color: #1d281d; }
.verre-ref-current { margin: 0 10px 7px; padding: 3px 7px; border: 1px solid #d0ad53; background: #ffe69c;
  color: #596048; font-size: 11px; font-style: italic; }
.verre-ref-eye-options { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 9px; font-size: 12px; }
.verre-ref-eye-options label { display: flex; align-items: center; gap: 5px; }
.verre-ref-eye-options select { width: 190px; padding: 4px 6px; border: 1px solid #aeb8aa; border-radius: 3px; }
.verre-ref-workspace { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 8px; flex: 1; min-height: 0;
  padding: 0 14px; }
.verre-ref-sidebar { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.verre-ref-panel { border: 2px solid #334c32; border-radius: 6px; overflow: hidden; background: #fff; }
.verre-ref-panel h2 { margin: 0; padding: 8px 10px; background: #2f482e; color: #fff; font-size: 13px; font-weight: 650; }
.verre-ref-panel.criteria { padding-bottom: 9px; }
.verre-ref-panel.criteria h2 { margin-bottom: 9px; }
.verre-ref-panel.criteria > select, .verre-ref-mutuelle { display: block; width: calc(100% - 18px); margin: 6px 9px 0;
  padding: 4px 5px; border: 1px solid #aeb8aa; border-radius: 3px; background: #fff; font-size: 11px; }
.verre-ref-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 0 9px; }
.verre-ref-quick input { width: 100%; min-width: 0; box-sizing: border-box; padding: 4px; border: 1px solid #aeb8aa; border-radius: 3px; }
.verre-ref-check { display: flex; align-items: center; gap: 5px; margin: 8px 9px; font-size: 11px; }
.verre-ref-mutuelle[disabled] { color: #6e756c; background: #eef0ec; }
.verre-ref-panel.info { flex: 1; min-height: 190px; }
.verre-ref-no-selection { padding: 12px; font-size: 11px; font-style: italic; }
.verre-ref-panel.info dl { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 4px 6px; margin: 10px;
  font-size: 10px; overflow-wrap: anywhere; }
.verre-ref-panel.info dt { color: #657063; }.verre-ref-panel.info dd { margin: 0; font-weight: 600; }
.verre-ref-warning { margin: 8px 9px; padding: 7px 8px; border: 1px solid #c96b63; border-radius: 4px;
  background: #fae3e1; color: #812923; font-size: 10px; line-height: 1.35; }
.verre-ref-panel.total { flex: 0 0 auto; padding-bottom: 8px; }
.verre-ref-panel.total h2 { margin-bottom: 8px; }
.verre-ref-panel.total div { display: flex; justify-content: space-between; padding: 2px 10px; font-size: 10px; }
.verre-ref-results { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid #71816e; border-radius: 5px; overflow: hidden; }
.verre-ref-searchbar { display: flex; align-items: center; gap: 5px; min-height: 37px; padding: 0 8px; background: #4d6b49;
  color: #fff; font-size: 11px; }
.verre-ref-searchbar > span:first-child { min-width: 86px; }
.verre-ref-searchbar select { width: 235px; }.verre-ref-searchbar input { flex: 1; min-width: 120px; }
.verre-ref-searchbar select, .verre-ref-searchbar input { height: 24px; box-sizing: border-box; padding: 2px 6px;
  border: 1px solid #aeb8aa; border-radius: 3px; background: #fff; color: #263226; font-size: 11px; }
.verre-ref-searchbar button { min-width: 23px; height: 24px; padding: 0 3px; border: 0; background: transparent;
  color: #fff; cursor: pointer; font-size: 12px; }.verre-ref-searchbar button:disabled { opacity: .35; cursor: default; }
.verre-ref-filter-button { margin-left: -33px; color: #435b40 !important; z-index: 1; }
.verre-ref-spacer { flex: 0 0 25px; }.verre-ref-pages { min-width: 48px; padding: 3px 6px; border-radius: 3px;
  background: #fff; color: #314331; text-align: center; }
.verre-ref-table-scroll { flex: 1; min-height: 0; overflow: auto; background: #fdfdfc; }
.verre-ref-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.verre-ref-table th { position: sticky; top: 0; z-index: 1; padding: 5px 7px; background: #263c26; color: #fff;
  text-align: left; font-weight: 600; }.verre-ref-table th.num, .verre-ref-table td.num { text-align: right; }
.verre-ref-table th:nth-child(1) { width: 9%; }.verre-ref-table th:nth-child(2) { width: 48%; }
.verre-ref-table th:nth-child(3) { width: 5%; }.verre-ref-table th:nth-child(4) { width: 6%; }
.verre-ref-table th:nth-child(5) { width: 10%; }.verre-ref-table th:nth-child(6), .verre-ref-table th:nth-child(7) { width: 11%; }
.verre-ref-table td { padding: 3px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verre-ref-table td.num small { color: #7a5427; font-size: 9px; }
.verre-ref-table tbody tr:nth-child(odd) td { background: #f8f9f7; }.verre-ref-table tbody tr:nth-child(even) td { background: #e2e6df; }
.verre-ref-table tbody tr:hover td { filter: brightness(.97); }
.verre-ref-table tbody tr.verre-compatible td { background: #edf5eb; }
.verre-ref-table tbody tr.verre-partiel td { background: #ffe2a8; }
.verre-ref-table tbody tr.verre-incompatible td { background: #f7cbc7; color: #742620; }
.verre-ref-table tbody tr.selected td { box-shadow: inset 0 2px #6b5421, inset 0 -2px #6b5421; font-weight: 650; }
.verre-ref-radio { position: absolute; opacity: 0; pointer-events: none; }
.verre-ref-result-count { padding: 6px 9px; color: #536051; font-size: 10px; }
.verre-ref-footer { display: flex; align-items: center; padding: 13px 14px 15px 210px; }
.verre-ref-footer .back, .verre-ref-advanced footer .back { border: 0; background: transparent; color: #466744;
  font-size: 25px; cursor: pointer; }.verre-ref-footer .valider { margin-left: auto; }
.verre-ref-footer .valider:disabled { opacity: .45; cursor: not-allowed; }
.verre-ref-advanced-backdrop { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center;
  background: rgba(30, 35, 30, .55); }
.verre-ref-advanced { position: relative; width: min(560px, 88vw); padding: 18px 20px 13px; border-radius: 9px;
  box-shadow: 0 14px 42px rgba(0,0,0,.35); background: #fff; }
.verre-ref-advanced > .close { position: absolute; top: 9px; right: 10px; border: 0; background: transparent;
  color: #365a34; cursor: pointer; font-size: 17px; }.verre-ref-advanced h2 { margin: 0 30px 18px 0; font-size: 23px; }
.verre-ref-advanced > label { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(150px, 200px);
  align-items: center; gap: 14px; min-height: 35px; font-size: 12px; }
.verre-ref-advanced > label input:not([type="checkbox"]), .verre-ref-advanced > label select { width: 100%; box-sizing: border-box;
  padding: 5px 7px; border: 1px solid #abb5a7; border-radius: 3px; }
.verre-ref-advanced > label input[type="checkbox"] { justify-self: start; }
.verre-ref-gammes { display: grid; grid-template-columns: minmax(190px, 1fr) repeat(3, auto); align-items: center;
  gap: 10px; min-height: 35px; font-size: 12px; }.verre-ref-gammes label { white-space: nowrap; }
.verre-ref-advanced footer { display: flex; align-items: center; margin-top: 14px; }
.verre-ref-advanced footer .valider { margin-left: auto; }
@media (max-width: 900px) {
  dialog.verre-picker-reference { width: 98vw; height: 96vh; max-height: 96vh; }
  .verre-ref-eyes { grid-template-columns: 1fr 1fr; }.verre-ref-eye-options { grid-column: 1 / -1; flex-direction: row; }
  .verre-ref-workspace { grid-template-columns: 145px minmax(0, 1fr); }.verre-ref-searchbar > span:first-child { display: none; }
  .verre-ref-searchbar select { width: 170px; }
}

/* Validation de vente */
.valider-vente { margin-top: 14px; max-width: 780px; display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap; }
.valider.big { font-size: 15px; padding: 10px 20px; }

/* En-tête historique + nouvelle vente */
.hist-head { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 4px; }
.add-sm { background: #3d4f3d; color: #fff; border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.add-sm[disabled] { opacity: .5; cursor: not-allowed; }

/* Prescription OD/OG */
.presc input { width: 70px; padding: 3px 5px; border: 1px solid #bbb; border-radius: 3px; }
.presc td:first-child { font-weight: 700; }

/* Sélection verre */
.verre-actions { display: flex; gap: 8px; margin: 4px 0 14px; }
.presc-ctx { background: #eef2ee; padding: 6px 10px; border-radius: 4px; font-size: 13px; }
.presc-ctx em { color: #666; font-size: 12px; }

/* Fiche client — refonte densité "logiciel métier" */
.fiche .record, .fiche .historique { max-width: 1180px; }

/* Bloc à pilule : cadre fin + titre vert olive posé sur le bord haut-gauche */
.bloc { position: relative; border: 1px solid #ddd; border-radius: 6px; padding: 16px 14px 12px; margin: 18px 0 0; background: #fff; }
.bloc > .pilule {
  position: absolute; top: -10px; left: 12px;
  background: #3d4f3d; color: #fff; border-radius: 10px;
  padding: 3px 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
}

.bloc-identite .identite-top { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 6px; }
.btn-sec { background: #fff; border: 1px solid #3d4f3d; color: #3d4f3d; padding: 4px 10px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.btn-sec:hover:not(:disabled) { background: #eef2ee; }
/* Un bouton indisponible doit se voir avant le clic, pas se découvrir après. */
.btn-sec:disabled { opacity: .45; cursor: not-allowed; border-style: dashed; }
.identite-body { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }

/* .dense : grille de champs serrés, alignés par lignes */
.dense { margin-top: 4px; }
.dense .row { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.dense .row:last-child { margin-bottom: 0; }
.dense .fld { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: #555; }
.dense .fld input, .dense .fld select { padding: 3px 5px; font-size: 12px; border: 1px solid #bbb; border-radius: 3px; }
.dense .w-xs { width: 64px; }
.dense .w-sm { width: 96px; }
.dense .w-md { width: 160px; }
.dense .w-lg { flex: 1; min-width: 200px; }

/* Prestation livraison : le montant reste éditable seulement quand la prestation est active. */
.bloc-vente-extras { width: 100%; max-width: 1180px; }
.bloc-vente-extras .row:last-child { align-items: flex-end; }
.vente-delivery { display: inline-flex; align-items: flex-end; gap: 8px; }
.vente-delivery .extras-amount { width: 112px; min-width: 112px; }
.vente-delivery .extras-amount input { width: 100%; box-sizing: border-box; }
.extension-choice { display: inline-flex; align-items: flex-end; gap: 8px; }
.extension-choice .extras-extension { width: 220px; min-width: 220px; }
.extension-choice .extras-extension select { width: 100%; box-sizing: border-box; }

/* Compteurs financiers : 2 colonnes x 2 lignes, alignés à droite */
.compteurs { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 24px; margin-left: auto; }
.compteurs .cpt { display: flex; flex-direction: column; align-items: flex-end; }
.compteurs .cpt .lbl { font-size: 11px; color: #777; }
.compteurs .cpt b { font-size: 14px; }

/* Bloc "Choix et totaux" (vente) : offre retenue + récap + tableau 2 scénarios */
.bloc-scenarios { width: 100%; max-width: 1180px; }
.vente-finance-row { width: 100%; max-width: 1180px; display: grid; grid-template-columns: minmax(270px, 300px) minmax(0, 1fr);
  align-items: stretch; margin-top: 18px; }
.vente-finance-row > .bloc { min-width: 0; margin: 0; }
.vente-finance-row > .bloc-tp { order: 1; border-radius: 6px 0 0 6px; }
.vente-finance-row > .bloc-scenarios { order: 2; border-left: 0; border-radius: 0 6px 6px 0; }
.vente-finance-row .bloc-tp .dense { min-height: 100%; }
.vente-finance-row .bloc-tp .dense .row { flex-wrap: nowrap; gap: 8px; }
.vente-finance-row .bloc-tp .scn-label { min-width: 104px; white-space: nowrap; }
.vente-finance-row .bloc-tp .toggle { gap: 5px; }
@media (max-width: 1050px) {
  .vente-finance-row { grid-template-columns: 1fr; }
  .vente-finance-row > .bloc-tp { border-radius: 6px 6px 0 0; }
  .vente-finance-row > .bloc-scenarios { border-left: 1px solid #ddd; border-top: 0; border-radius: 0 0 6px 6px; }
}
.offre-choice { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.fld-radio { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.recap-offres { font-size: 13px; margin-bottom: 10px; }
.recap-offres b { color: #3d4f3d; }
.scn-table { overflow-x: auto; }
.scn-head { font-weight: 600; font-size: 11px; color: #3d4f3d; }
.scn-head span { display: inline-block; }
.scn-row { align-items: flex-end; }
.scn-label { font-size: 13px; font-weight: 600; align-self: center; }
.scn-row .valider { padding: 3px 10px; font-size: 12px; }

/* Préfixe téléphone visuel */
.tel-in { display: flex; align-items: center; gap: 4px; }
.tel-in .prefix { font-size: 12px; color: #777; background: #f2f2f2; padding: 3px 6px; border-radius: 3px; border: 1px solid #ddd; }
.tel-in input { flex: 1; min-width: 0; }

/* Observations */
.obs { width: 100%; box-sizing: border-box; resize: vertical; padding: 6px 8px; font-size: 12px; border: 1px solid #bbb; border-radius: 3px; font-family: inherit; }

/* .toggle : interrupteur CSS pur (checkbox cachée + piste stylée), prêt pour "n'est plus client" */
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { width: 32px; height: 18px; background: #ccc; border-radius: 10px; position: relative; transition: background .15s; flex: 0 0 auto; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left .15s; }
.toggle input:checked + .track { background: #3d4f3d; }
.toggle input:checked + .track::after { left: 16px; }
.toggle input:disabled + .track { background: #ccc !important; opacity: .6; }
.toggle input:disabled ~ span { color: #999; }
.toggle:has(input:disabled) { cursor: not-allowed; }

/* Deux colonnes de la fiche : Adresse/Tél à gauche, Observations/Documents à droite */
.fiche-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 900px) {
  .fiche-cols { grid-template-columns: 1fr; }
}

/* Bloc équipement (vente) : nav +/- , onglets, deux yeux côte à côte */
.bloc-equipement { max-width: 1180px; }
.eq-nav { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; }
.eq-nav .eq-pos { font-size: 12px; color: #555; min-width: 32px; text-align: center; }
.eq-nav .del { padding: 4px 10px; border-radius: 4px; }
.eq-nav .add-sm { margin-left: auto; }
/* 4 colonnes simultanées (Type / Écarts / Suivi / Observations), plus larges à droite */
.eq-cols { display: grid; grid-template-columns: 1fr 1fr 1fr 2fr; gap: 16px; margin-bottom: 14px; }
.eq-col > .col-title { font-size: 12px; font-weight: 600; color: #3d4f3d; margin-bottom: 6px; }
.eq-col .dense .fld { width: 100%; }
.eq-col .dense input { width: 100%; box-sizing: border-box; }
.eq-col-obs .obs { height: auto; min-height: 96px; }
@media (max-width: 900px) {
  .eq-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .eq-cols { grid-template-columns: 1fr; }
}

.eq-yeux { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
@media (max-width: 900px) {
  .eq-yeux { grid-template-columns: 1fr; }
}
.verre-choisi { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; font-size: 12px; }
.empty-inline { color: #888; font-size: 12px; margin: 4px 0; }
.eq-total { max-width: none; margin-top: 14px; justify-content: flex-end; }

/* Écarts & Hauteurs : paires côte à côte, champs étroits */
.row-pair { display: flex; gap: 10px; }
.eq-col .dense .fld-xs { width: auto; flex: 0 0 auto; }
.eq-col .fld-xs input { width: 60px; }

/* Suivi & Traçabilité : étiquette + champ sur la même ligne, compact */
.row-inline { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.lbl-inline { width: 60px; flex: 0 0 60px; font-size: 12px; color: #444; }
.row-inline input { flex: 1; padding: 3px 5px; font-size: 12px; }

/* --- Page de connexion (I1) --- */
.login-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(#8aa385, #2f422c); gap: 24px; }
.login-card { width: min(360px, 90vw); background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.3); padding: 32px 28px; }
.login-logo { text-align: center; font-weight: 700; font-size: 26px; color: #3d4f3d; margin-bottom: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #444; }
.login-card input { padding: 8px 10px; border: 1px solid #bbb; border-radius: 4px; font-size: 14px; }
.login-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c0; border-radius: 4px; padding: 8px 10px; font-size: 13px; }
.login-forgot { text-align: center; font-size: 12px; color: #3d4f3d; text-decoration: none; }
.login-footer { color: #eef2ee; font-size: 12px; }

/* --- Menu latéral par modules (H1) --- */
.nav-module { margin-top: 2px; }
.nav-module-head { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; border: none; color: #f2f2f2; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.nav-module-head:hover { background: rgba(255,255,255,.12); }
.nav-module-head .nav-caret { font-size: 10px; transition: transform .15s; }
.nav-module-head.open .nav-caret { transform: rotate(180deg); }
.nav-module-head.disabled { cursor: default; opacity: .55; }
.nav-module-head.disabled:hover { background: none; }
.nav-soon { font-size: 10px; font-weight: 400; color: #cfe0cc; background: rgba(255,255,255,.12); border-radius: 8px; padding: 1px 8px; }
.nav-items { list-style: none; margin: 0; padding: 0; }
.nav-items a, .nav-items .nav-action { display: block; width: 100%; padding: 6px 16px 6px 28px; color: #e6efe4; cursor: pointer; text-decoration: none; font: 13px system-ui, sans-serif; text-align: left; }
.nav-items .nav-action { border: 0; background: transparent; }
.nav-items a:hover, .nav-items .nav-action:hover { background: rgba(255,255,255,.10); }
.nav-items a.active, .nav-items .nav-action.active { background: rgba(255,255,255,.22); font-weight: 600; }
.sidebar-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.2); padding: 12px 16px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-user a { color: #e6efe4; padding: 0; }
.sidebar-user a:hover { background: none; text-decoration: underline; }

/* --- Ordonnance : saisie correction (maquette OD/OG placeholders) --- */
.ordo-card { border: 1px solid #d7ddd7; border-radius: 8px; background: #fff; margin: 18px 0 0; overflow: hidden; max-width: 720px; }
.ordo-head { display: flex; align-items: center; justify-content: space-between;
  background: #3d4f3d; color: #fff; padding: 8px 14px; font-weight: 600; font-size: 15px; }
.ordo-toggle { background: #fff; color: #3d4f3d; border: none; width: 26px; height: 26px;
  border-radius: 5px; font-size: 15px; line-height: 1; cursor: pointer; }
.ordo-toggle.is-closed { transform: rotate(-90deg); }
.ordo-meta { display: flex; gap: 8px; padding: 12px 14px 4px; flex-wrap: wrap; align-items: center; }
.ordo-body { padding: 4px 14px 12px; }
.ordo-eye { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ordo-eye-lbl { width: 78px; flex: 0 0 78px; font-size: 13px; color: #333; }
.ordo-grp { display: flex; gap: 6px; margin-right: 14px; }
.ordo-grp:last-child { margin-right: 0; margin-left: auto; }
.ordo-f, .ordo-f input, .ordo-f select { font-size: 12px; }
.ordo-f { width: 62px; padding: 6px 8px; border: 1px solid #cfd6cf; border-radius: 5px;
  color: #333; background: #fff; box-sizing: border-box; }
.ordo-f::placeholder { color: #9aa39a; font-style: italic; }
label.ordo-f { padding: 0; border: none; }
label.ordo-f input { width: 100%; border: 1px solid #cfd6cf; border-radius: 5px; padding: 6px 8px; box-sizing: border-box; }
.ordo-meta .w-date { width: 120px; }
.ordo-meta .w-presc { width: 130px; }
.ordo-meta .w-nom { width: 150px; }
.ordo-meta .w-finess { width: 110px; }
.ordo-meta .w-cle { width: 48px; }
.ordo-meta .w-val { width: 44px; }
.ordo-meta .w-val { -moz-appearance: textfield; appearance: textfield; }
.ordo-meta .w-val::-webkit-outer-spin-button,
.ordo-meta .w-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ordo-eye .w-ac { width: 48px; }

/* --- Équipement : Monture Stock + Œil Droit/Gauche + Suppléments (maquette LUNETTE) --- */
.eq-card { border: 1px solid #cdd6cd; border-radius: 6px; background: #fff; margin-top: 14px; overflow: hidden; }
.eq-bar { display: flex; align-items: center; gap: 8px; background: #6d8a6d; color: #fff; padding: 6px 10px; font-weight: 600; font-size: 15px; }
.eq-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  background: #fff; color: #3d4f3d; border-radius: 4px; font-weight: 800; font-size: 14px; border: 1px solid rgba(0,0,0,.18); flex: 0 0 auto; }
.eq-title { flex: 1; }
.eq-bar-cart { background: transparent; border: none; color: #fff; font-size: 16px; cursor: pointer; }
.eq-bar-del { width: 22px; height: 22px; border-radius: 50%; border: none; background: #c98a8a; color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer; flex: 0 0 auto; }
.eq-bar-del:hover { background: #b86f6f; }

.mono-row { display: flex; gap: 8px; padding: 8px 10px 10px; flex-wrap: wrap; align-items: flex-end; }
.mf { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: #333; position: relative; }
.mf > input, .mf-pick input { border: 1px solid #cfd6cf; border-radius: 4px; padding: 5px 7px; font-size: 12px;
  background: #fbfcfb; box-sizing: border-box; width: 100%; }
.mf-xs { width: 44px; } .mf-sm { width: 88px; } .mf-lg { flex: 1; min-width: 130px; } .mf-ref { width: 92px; } .mf-pv { width: 92px; }
.mf-pv input.pv { text-align: right; font-weight: 700; }
.mf-ref input { -moz-appearance: textfield; appearance: textfield; }
.mf-ref input::-webkit-outer-spin-button,
.mf-ref input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mf-pick { position: relative; display: block; }
.mf-pick input { padding-right: 22px; }
.mf .dots { position: absolute; right: 2px; top: 2px; bottom: 2px; border: none; background: #e7ede7;
  border-radius: 3px; padding: 0 4px; cursor: pointer; color: #4a614a; font-size: 12px; }
.mf-sel i { position: absolute; right: 6px; bottom: 6px; font-style: normal; color: #888; pointer-events: none; font-size: 10px; }
.mf-sel input { padding-right: 16px; }

.eq-yeux2 { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; }
.eq-card.eye { flex: 1; min-width: 0; margin-top: 0; }
.eye-copy { display: flex; gap: 4px; align-self: flex-start; margin-top: 5px; flex: 0 0 auto; }
.cp { width: 26px; height: 28px; background: #6d8a6d; color: #fff; border: none; border-radius: 4px;
  cursor: pointer; font-weight: 700; font-size: 15px; }
.cp:hover { background: #5c775c; }

.corr { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 10px; }
.cf { position: relative; }
.cf input { width: 58px; border: 1px solid #cfd6cf; border-radius: 5px; padding: 5px 6px; font-size: 12px; box-sizing: border-box; }
.cf input::placeholder { color: #9aa39a; font-style: italic; }
.corr input:focus { outline: 2px solid #e08a2b; outline-offset: -1px; border-color: #e08a2b; }
.cf-type input { width: 70px; padding-right: 18px; }
.cf-type .dots { position: absolute; right: 2px; top: 2px; bottom: 2px; border: none; background: #e7ede7;
  border-radius: 3px; padding: 0 4px; cursor: pointer; color: #4a614a; }

.verre-line { display: flex; align-items: center; gap: 6px; padding: 2px 10px 8px; }
.v-mag, .v-lens { border: none; background: transparent; cursor: pointer; font-size: 14px; color: #666; padding: 0; }
.v-lens { color: #4a6748; font-weight: 700; }
.v-mag:hover, .v-lens:hover { color: #e08a2b; }
.v-eq { color: #6d8a6d; font-weight: 700; font-size: 14px; }
.v-lib { flex: 1; min-width: 0; border: 1px solid #cfd6cf; border-radius: 5px; padding: 5px 7px; font-size: 12px; background: #fbfcfb; }
.v-lib.v-lentille { border-color: #b9cdb5; color: #315431; }
.v-pv { width: 78px; border: 1px solid #cfd6cf; border-radius: 5px; padding: 5px 7px; font-size: 12px; text-align: right; background: #fbfcfb; }
.v-lib::placeholder, .v-pv::placeholder { color: #9aa39a; font-style: italic; }

.supp { padding: 0 10px 10px; }
.supp-head { display: flex; align-items: center; justify-content: space-between; background: #eef2ee;
  border: 1px solid #dce4dc; border-bottom: none; padding: 5px 8px; font-size: 12px; font-weight: 600;
  color: #444; border-radius: 4px 4px 0 0; }
.supp-head.on { color: #2f5a2f; }
.supp-nav { display: flex; align-items: center; gap: 4px; }
.pg { border: none; background: transparent; cursor: pointer; color: #7a8a7a; font-size: 12px; padding: 0 2px; }
.pg[disabled] { color: #b8c2b8; cursor: default; }
.pg.add { color: #3d7a3d; font-weight: 700; font-size: 15px; }
.pg-pos { font-size: 11px; color: #555; min-width: 26px; text-align: center; }
.supp-tbl { width: 100%; border-collapse: collapse; border: 1px solid #dce4dc; border-top: none; font-size: 12px; }
.supp-tbl td { padding: 5px 8px; border-bottom: 1px solid #eee; }
.supp-tbl td.num { text-align: right; }
.supp-tbl td.empty { text-align: center; color: #888; font-style: italic; padding: 14px; }
.supp-tbl tr.tot td { font-weight: 700; color: #2f5a2f; background: #f4f8f4; border-top: 2px solid #6d8a6d; border-bottom: none; }

/* --- Équipement : en-tête + 4 colonnes (maquette n°514) --- */
.eqh { display: flex; align-items: center; gap: 14px; margin: 16px 0 14px; flex-wrap: wrap; }
.eqh-title { background: #3d4f3d; color: #fff; font-weight: 700; font-size: 15px; padding: 7px 16px; border-radius: 6px; white-space: nowrap; }
.eqh-peniche { display: inline-flex; align-items: center; gap: 5px; color: #3d4f3d; font-weight: 700; font-size: 13px; white-space: nowrap; }
.eqh-peniche input { width: 64px; box-sizing: border-box; border: 1px solid #cfd6cf; border-radius: 14px; padding: 6px 9px; font-size: 12px; }
.eqh-peniche input::placeholder { color: #9aa39a; font-style: italic; }
.eqh-vendeur { flex: 1; min-width: 150px; text-align: center; color: #3d6b3d; font-weight: 700; font-size: 15px; }
.eqh-nav { display: flex; align-items: center; gap: 6px; }
.navb { border: none; background: transparent; color: #3d4f3d; font-size: 15px; cursor: pointer; padding: 2px 4px; }
.navb[disabled] { color: #bbb; cursor: default; }
.navb.add { color: #2f6b2f; font-weight: 700; }
.navb.del { color: #c0392b; font-weight: 700; font-size: 18px; }
.eqh-pos { font-size: 13px; color: #444; min-width: 34px; text-align: center; }

.col-title { display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #cdd8c8; color: #33452f; font-weight: 600; font-size: 14px;
  padding: 6px 12px; border-radius: 6px; margin-bottom: 10px; }
.ct-dots, .ct-edit { color: #5a6b52; cursor: pointer; font-size: 14px; }

.eqf-col { display: flex; flex-direction: column; gap: 10px; }
.eqsel { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 13px;
  border: 1px solid #cfd6cf; border-radius: 4px; background: #fff;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233d6b3d'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px; }

.ecarts { display: flex; flex-direction: column; gap: 8px; }
.ec-row { display: flex; gap: 8px; }
.ecf-wrap { position: relative; width: 74px; }
.ecf-wrap i { position: absolute; top: 3px; left: 7px; font-size: 9px; font-style: italic;
  color: #9aa39a; pointer-events: none; line-height: 1; }
.ecf { width: 100%; box-sizing: border-box; padding: 13px 6px 3px; font-size: 12px;
  border: 1px solid #d5dbd3; border-radius: 4px; background: #f0f2ef; color: #333; }
.ecf { -moz-appearance: textfield; appearance: textfield; }
.ecf::-webkit-outer-spin-button,
.ecf::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ecf:focus { background: #fff; color: #222; border-color: #6d8a6d; outline: none; }

.suivi { display: flex; flex-direction: column; gap: 8px; }
.sv { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #333; cursor: pointer; }
.sv-ro { cursor: default; }
.sv input[type=checkbox] { width: 15px; height: 15px; accent-color: #3d6b3d; }
.sv-ro .sv-lbl { margin-left: 21px; }
.st { font-weight: 600; }
.st-warn { color: #d98a2b; } .st-bad { color: #c0392b; } .st-ok { color: #2f6b2f; } .st-mut { color: #777; font-weight: 500; }

.eq-col-obs .obs { width: 100%; box-sizing: border-box; border: 1px solid #cfd6cf; border-radius: 6px; padding: 8px; font: inherit; font-size: 13px; resize: vertical; }
.pen-del { width: 20px; height: 20px; border-radius: 50%; border: none; background: transparent; color: #c0392b; font-size: 16px; cursor: pointer; }

/* --- Panier A / B (classe dérivée : A = 100% santé, B = tarif libre) --- */
.panier { display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.05; font-size: 9px; font-weight: 800; letter-spacing: .3px; text-align: center;
  width: 46px; height: 34px; border-radius: 5px; flex: 0 0 auto; }
.panier-a { background: #e3efe0; color: #2f6b2f; border: 1px solid #b8d4b0; }
.panier-b { background: #f3e2cf; color: #9a5a1e; border: 1px solid #e0c199; }
.eq-badge.eqb-b { color: #9a5a1e; }

/* --- Choix et totaux : grille scénarios (maquette : Brut − Remise = Net − RO − RC = Part) --- */
.bloc-scenarios input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.bloc-scenarios input[type="number"]::-webkit-outer-spin-button,
.bloc-scenarios input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.scn-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.pilule-inline { position: static; display: inline-block; background: #3d4f3d; color: #fff;
  border-radius: 10px; padding: 4px 14px; font-size: 13px; font-weight: 700; }
.recap-offres { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; color: #333; }
.recap-offres b { color: #2f6b2f; }

.offre-choice { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.toggle-soon { opacity: .55; }

.scn-grid { width: 100%; overflow: visible; }
.scn-h, .scn-r { display: grid; align-items: center; gap: 6px; width: 100%; min-width: 0;
  /* Proportions des anciennes colonnes, mais sans largeur minimale : la grille
     se contracte toujours dans la largeur restante du bloc. */
  grid-template-columns: minmax(0, 96fr) minmax(0, 82fr) minmax(0, 12fr)
    minmax(0, 132fr) minmax(0, 12fr) minmax(0, 82fr) minmax(0, 12fr)
    minmax(0, 74fr) minmax(0, 12fr) minmax(0, 74fr) minmax(0, 12fr)
    minmax(0, 92fr) minmax(0, 76fr) minmax(0, 30fr); }
.scn-h { font-size: 11px; color: #667; font-weight: 600; padding: 0 2px 4px; }
.scn-h span { min-width: 0; text-align: center; overflow-wrap: anywhere; }
.scn-r { padding: 6px 2px; border-radius: 6px; }
.scn-r > * { min-width: 0; }
.scn-r.retenu { background: #eef4ec; box-shadow: inset 0 0 0 1px #b8d4b0; }
.scn-ico { display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.05; font-size: 8.5px; font-weight: 800; text-align: center; height: 34px; border-radius: 5px; min-width: 0; overflow: hidden; }
.op { text-align: center; color: #6d8a6d; font-weight: 700; }
.scn-n { width: 100%; min-width: 0; box-sizing: border-box; padding: 5px 6px; font-size: 12px; text-align: right;
  border: 1px solid #cfd6cf; border-radius: 4px; }
.scn-n.ro { background: #f4f6f3; color: #333; }
.scn-n.strong { font-weight: 700; color: #2f5a2f; }
.scn-remise { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.scn-code { width: 54px; min-width: 0; box-sizing: border-box; padding: 5px 6px; font-size: 12px; border: 1px solid #cfd6cf; border-radius: 4px; }
.scn-remise .scn-n { flex: 1; }
.valider.sm { padding: 5px 8px; font-size: 13px; line-height: 1; }

/* --- Retrait ligne verre / supplément dans les cartes œil --- */
.v-del { border: none; background: transparent; color: #c0392b; font-size: 13px; cursor: pointer; padding: 0 2px; }
.s-del { border: none; background: transparent; color: #c0392b; font-size: 11px; cursor: pointer; padding: 0; opacity: .7; }
.s-del:hover, .v-del:hover { opacity: 1; }

/* --- Informations Vitale : clé sécu colorée, Lire CV, sélecteur de caisse --- */
.cle { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.cle-ok { background: #e3efe0; color: #2f6b2f; border: 1px solid #b8d4b0; }
.cle-ko { background: #f7e4e2; color: #c0392b; border: 1px solid #e6bdb8; }
.btn-cv { white-space: nowrap; }
.fld input[readonly] { background: #f4f6f3; color: #444; }
.caisse-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.caisse-filters .picker-search { flex: 1; min-width: 200px; }
.caisse-count { font-size: 12px; color: #777; }

/* Ligne caisse : chaque champ est au moins aussi large que son libellé (pas de retour ligne) */
.row-caisse { align-items: flex-end; }
.row-caisse .fld { width: auto; }
.row-caisse .fld > span { white-space: nowrap; }
.row-caisse .fld > input { width: 100%; box-sizing: border-box; min-width: 0; }
.row-caisse .fld-grow { flex: 1; min-width: 160px; }

/* --- Suggestions de ville (liste maison, pas un <datalist> natif — cf _communes.html) --- */
.fld-vil { position: relative; }
.cp-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 2px;
  background: #fff; border: 1px solid #cfd6cf; border-radius: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
  max-height: 220px; overflow-y: auto; }
.cp-item { padding: 6px 10px; font-size: 13px; cursor: pointer; }
.cp-item:hover { background: #eef2ee; }
.cp-item + .cp-item { border-top: 1px solid #f0f0f0; }

/* --- Correction (Sph/Cyl/Axe/Add) : toujours en gras, partout où elle apparaît --- */
.ordo-f-corr, .cf-corr input { font-weight: 700; }

/* Offre commerciale (3e équipement, dupliqué depuis 100% santé ou autre offre) */
.panier-commerciale { background: #f0e4f7; color: #7a3d9e; border: 1px solid #d9bfe8; font-size: 8px; }
.btn-gift { background: #7a3d9e; color: #fff; border: none; padding: 8px 16px; border-radius: 4px;
  cursor: pointer; font-size: 14px; margin-left: 10px; }
.btn-gift:hover { background: #692f8a; }
.btn-gift[disabled] { background: #c9b3d6; cursor: not-allowed; }

/* --- Impression : liste des documents + pavé de signature --- */
.impr-list td { vertical-align: middle; }
.impr-list .dots { margin-right: 4px; }
.impr-list .flash-ok { font-size: 11px; margin-left: 4px; }
.invoice-print-options { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px;
  font-size: 11px; color: var(--muted); }
.invoice-print-options label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.invoice-print-options input { margin: 0; }
.sig-canvas { width: 100%; max-width: 600px; height: 220px; border: 1px solid #bbb;
  border-radius: 4px; background: #fff; touch-action: none; display: block; margin: 8px 0; }
.sig-pad-label { display: block; font-weight: 700; margin-top: 10px; }

/* ---------- Factures d'acompte ---------- */
.bloc-acomptes { max-width: 1180px; }
.acompte-summary { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: flex-end; }
.acompte-summary > div { display: flex; flex-direction: column; gap: 2px; min-width: 105px; }
.acompte-summary span { color: #666; font-size: 11px; }
.acompte-summary b { color: #2f5a2f; font-size: 14px; }
.acompte-actions { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.acompte-action .row { align-items: flex-end; }
.acompte-action .valider { margin-left: auto; }
.acompte-totaux { max-width: 780px; margin-top: 10px; }
.acompte-page { max-width: 1180px; }
.acompte-page .bloc { max-width: 1180px; }
.acompte-page .view-foot { max-width: 1180px; }

/* ---------- Vue détaillée équipement (pop-up ouvert par ⇄) ---------- */
dialog.eqd { width: min(920px, 94vw); }
.eqd-row3 { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr; gap: 8px; margin-bottom: 8px; }
.eqd-box { border: 1px solid #cdd6cd; border-radius: 6px; overflow: hidden; }
.eqd-h { background: #3d4f3d; color: #fff; font-weight: 600; font-size: 12px; padding: 4px 9px;
  display: flex; align-items: center; gap: 8px; }
.eqd-h .eqd-nav { margin-left: auto; font-size: 11px; }
.eqd-b { padding: 7px 9px; font-size: 12px; }
.eqd-pill { display: inline-block; border: 1px solid #bbb; border-radius: 4px; padding: 3px 8px; background: #f4f6f4; }
.eqd-eh { border-collapse: collapse; font-size: 11.5px; }
.eqd-eh th { color: #3d4f3d; font-weight: 600; padding: 1px 7px; text-align: center; }
.eqd-eh td { padding: 1px 7px; text-align: center; min-width: 26px; }
.eqd-eh td.sp { min-width: 12px; }
.eqd-files { width: 100%; border-collapse: collapse; font-size: 11px; }
.eqd-files th { color: #3d4f3d; text-align: left; padding: 1px 6px; font-weight: 600; }
.eqd-files td.empty { color: #888; font-style: italic; padding: 6px; text-align: center; }
.eqd-mono { margin-bottom: 8px; }
.eqd-yeux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.eqd-corr { width: 100%; border-collapse: collapse; font-size: 12px; }
.eqd-corr th { color: #3d4f3d; font-weight: 600; text-align: center; padding: 1px 4px; }
.eqd-corr td { text-align: center; padding: 1px 4px; font-weight: 700; }
.eqd-verre { margin-top: 5px; font-weight: 600; }
.eqd-supp { color: #444; padding-left: 8px; }
.eqd-tabs { display: flex; gap: 2px; border-bottom: 2px solid #3d4f3d; margin: 4px 0 0; }
.eqd-tabs button { border: none; background: #eef2ee; color: #3d4f3d; padding: 6px 14px; cursor: pointer;
  font-size: 12px; border-radius: 6px 6px 0 0; }
.eqd-tabs button.on { background: #3d4f3d; color: #fff; }
.eqd-tab-body { border: 1px solid #cdd6cd; border-top: none; padding: 10px; min-height: 120px; }
.eqd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eqd-dec { display: flex; flex-direction: column; gap: 6px; }
.eqd-fld { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.eqd-fld span { flex: 0 0 130px; color: #444; }
.eqd-fld input { flex: 1; padding: 4px 6px; border: 1px solid #bbb; border-radius: 4px; }
.eqd-fld i { font-style: normal; color: #777; width: 22px; }
.eqd-note { font-size: 12px; color: #444; line-height: 1.7; }
.eqd-note .link { border: none; background: #3d4f3d; color: #fff; padding: 3px 10px; border-radius: 4px; cursor: pointer; }
.eqd-total { margin-right: auto; font-size: 13px; }

/* ---------- Appel ADRi (chargement) ---------- */
dialog.tp-load { width: min(460px, 90vw); text-align: center; }
.tp-load-t { font-size: 22px; margin: 4px 0 14px; }
.tp-load-s { color: #555; margin: 2px 0; font-size: 13px; }
.tp-spinner { display: flex; justify-content: center; gap: 6px; margin: 18px 0 6px; }
.tp-spinner span { width: 9px; height: 9px; border-radius: 50%; background: #3d4f3d;
  animation: tpb 1s infinite ease-in-out both; }
.tp-spinner span:nth-child(2) { animation-delay: .15s; }
.tp-spinner span:nth-child(3) { animation-delay: .3s; }
@keyframes tpb { 0%,80%,100% { opacity:.25; transform: scale(.7); } 40% { opacity:1; transform: scale(1); } }

/* ---------- Détail remboursements ---------- */
dialog.tpd { width: min(1000px, 96vw); }
.tpd-flag { margin-left: auto; font-size: 16px; }
.tpd-bar { display: flex; align-items: center; gap: 8px; background: #3d4f3d; color: #fff;
  padding: 6px 10px; border-radius: 5px; margin-bottom: 8px; }
.tpd-settings { display: flex; align-items: end; flex-wrap: wrap; gap: 7px; width: 100%; }
.tpd-settings .tpd-check { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 11px; }
.tpd-settings .tpd-rate, .tpd-settings .tpd-mut, .tpd-settings .tpd-adherent { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: #e7eee7; }
.tpd-settings .tpd-rate input, .tpd-settings .tpd-mut select, .tpd-settings .tpd-adherent input { min-width: 72px; padding: 3px 5px; border: 1px solid #b7c5b7; border-radius: 3px; background: #fff; color: #222; font-size: 11px; }
.tpd-settings .tpd-mut select { min-width: 150px; }
.tpd-settings .tpd-adherent input { width: 115px; }
.tpd-badge { background: #55665; background: #566656; border: 1px solid #7a8a7a; color: #dde;
  font-size: 9px; line-height: 1.05; text-align: center; padding: 3px 5px; border-radius: 3px; }
.tpd-tp { color: #e8a33d; font-weight: 600; margin-left: 12px; }
.tpd-taux { background: #fff; color: #333; border-radius: 3px; padding: 3px 8px; font-size: 12px; }
.tpd-mut { flex: 1; max-width: 260px; padding: 4px 8px; border: none; border-radius: 3px; font-style: italic; }
.tpd-tabs { display: flex; gap: 1px; background: #cdd6cd; border-radius: 5px 5px 0 0; overflow: hidden; }
.tpd-tabs button { flex: 1; border: none; background: #eef2ee; color: #3d4f3d; padding: 8px; cursor: pointer; font-size: 13px; }
.tpd-tabs button.on { background: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 #3d4f3d; }
.tpd-body { border: 1px solid #cdd6cd; border-top: none; padding: 8px; max-height: 56vh; overflow: auto; }
.tpd-block { border: 1px solid #cdd6cd; border-radius: 5px; margin-bottom: 10px; overflow: hidden; }
.tpd-block-h { display: flex; align-items: center; gap: 10px; background: #f2f5f2; padding: 4px 8px; }
.tpd-off { background: #3d4f3d; color: #fff; font-size: 9px; font-weight: 700; padding: 3px 6px; border-radius: 3px; }
.tpd-tp2, .tpd-tp { font-size: 12px; }
.tpd-toggle { font-size: 12px; color: #444; }
.tpd-toggle .sw { display: inline-block; width: 26px; height: 14px; background: #bbb; border-radius: 8px; vertical-align: middle; }
.tpd-block-tot { margin-left: auto; display: flex; gap: 6px; }
.tpd-block-tot input { width: 78px; text-align: right; padding: 2px 6px; border: 1px solid #ccc; border-radius: 3px; }
.tpd-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.tpd-tbl th { background: #e7ede7; color: #3d4f3d; text-align: left; padding: 3px 6px; font-weight: 600; }
.tpd-tbl td { padding: 2px 6px; border-top: 1px solid #eee; }
.tpd-tbl td.c, .tpd-tbl th.c { text-align: center; }
.tpd-tbl td.r, .tpd-tbl th.r { text-align: right; white-space: nowrap; }
.tpd-tbl td.det { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpd-tbl tr.tot td { font-weight: 700; border-top: 2px solid #3d4f3d; color: #2b3a2b; }
.tpd-pec, .tpd-fse { padding: 10px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.tpd-foot { display: flex; align-items: center; gap: 16px; }
.link-back { border: none; background: transparent; color: #3d4f3d; font-size: 18px; cursor: pointer; }
.tpd-foot .link { border: none; background: transparent; color: #3d4f3d; cursor: pointer; font-size: 14px; text-decoration: underline; }
.tpd-sesam { color: #3d4f3d; font-weight: 600; }
.tpd-foot .valider { margin-left: auto; }

/* ---------- Vérification taux ---------- */
dialog.tpv { width: min(880px, 94vw); }
.tpv-dates { display: flex; gap: 20px; margin-bottom: 10px; }
.tpv-grid { display: flex; flex-direction: column; gap: 8px; }
.tpv-grid .eqd-fld span:first-child { flex: 0 0 160px; }
.tpv-grid select, .tpv-grid input { flex: 1; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; }
.tpv-ok { color: #2e7d32; font-style: italic; }
.tpv-inline { display: flex; align-items: center; gap: 10px; }
.tpv-inline select { flex: 0 0 90px; }
.tpv-presc { flex: 0 0 160px !important; }
.tpv-chk { display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; }
.tpv-pay { margin-top: 12px; }
.tpv-pay .eqd-fld { padding: 8px; }
.tpv-dates { flex-wrap: wrap; }
.tpv-dates .eqd-fld { flex: 0 0 auto; }
.tpv-dates .eqd-fld span { flex: 0 0 auto; }
.tpv-dates .eqd-fld input { flex: 0 0 130px; width: 130px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; }

/* ---------- Aide (? TODO + Changelog) — minimal, retirable ---------- */
.aide-tabs nav { display: flex; gap: 4px; margin: 6px 0; }
.aide-tabs nav button { border: none; background: #eef2ee; color: #3d4f3d; padding: 6px 16px;
  cursor: pointer; border-radius: 6px 6px 0 0; font-size: 13px; }
.aide-tabs nav button.on { background: #3d4f3d; color: #fff; }
.aide-pre { background: #fafafa; border: 1px solid #ddd; border-radius: 4px; padding: 14px 16px;
  white-space: pre-wrap; word-wrap: break-word; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  max-height: 72vh; overflow: auto; margin: 0; }

/* ---------- Paramétrage (Magasin / Prescripteurs) ---------- */
.cfg-page { display: flex; gap: 16px; align-items: flex-start; }
.cfg-side { flex: 0 0 190px; }
.cfg-group { border: 1px solid #cdd6cd; border-radius: 6px; margin-bottom: 6px; overflow: hidden; }
.cfg-group-h { background: #eef2ee; color: #2b3a2b; font-weight: 700; padding: 6px 10px; font-size: 13px; }
.cfg-group.open .cfg-group-h, .cfg-group-h.open { background: #3d4f3d; color: #fff; }
.cfg-toggle { width: 100%; display: flex; align-items: center; border: none; text-align: left; font: inherit; cursor: pointer; }
.cfg-caret { margin-left: auto; font-size: 12px; transition: transform .16s ease; }
.cfg-caret.open { transform: rotate(180deg); }
.cfg-group ul { list-style: none; margin: 0; padding: 4px 0; }
.cfg-group li { padding: 0; }
.cfg-group li a { display: block; padding: 5px 16px; cursor: pointer; color: #333; font-size: 13px; }
.cfg-group li a:hover { background: #eef2ee; }
.cfg-group li a.on { background: #dfe7df; font-weight: 700; border-left: 3px solid #3d4f3d; }
.cfg-side .soon { display: block; padding: 5px 16px; color: #aaa; font-size: 13px; cursor: default; }
.cfg-group-h.soon { background: #f3f3f3; color: #aaa; }
  .cfg-main { flex: 1; min-width: 0; }

  /* ---------- Magasin : raccourcis écran ---------- */
  .rc-clavier, .rc-screen { overflow: hidden; border: 1px solid #b7c2b3; border-radius: 6px; margin-bottom: 10px; }
  .rc-bar { min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #3d4f3d;
    color: #fff; font-size: 13px; font-weight: 600; }
  .rc-bar button { width: 25px; height: 25px; margin-left: auto; padding: 0; border: 0; border-radius: 4px; background: #fff;
    color: #3d4f3d; cursor: pointer; font-size: 18px; font-weight: 700; }
  .rc-table { margin: 0; border: 0; border-radius: 0; border-collapse: separate; border-spacing: 0; font-size: 12px; }
  .rc-table th { padding: 5px 10px; background: #2e3d2e; color: #fff; font-weight: 600; text-align: center; }
  .rc-table td { padding: 4px 10px; border: 0; }
  .rc-table tbody tr:nth-child(odd) td { background: #f8f9f7; }
  .rc-table tbody tr:nth-child(even) td { background: #e5e8e2; }
  .rc-table tr.clickable { cursor: pointer; }
  .rc-table tr.clickable:hover td { background: #dce7d9; }
  .rc-table th:first-child, .rc-table td:first-child { width: 140px; }
  .rc-table th:last-child, .rc-table td:last-child { width: 150px; }
  .rc-delete { width: 38px !important; text-align: center; }
  .rc-delete button { width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%; background: #edb4b4; color: #a22727;
    cursor: pointer; font-size: 15px; line-height: 14px; }
  .rc-activation { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
  .rc-activation label { display: inline-flex; align-items: center; gap: 7px; }
  .rc-activation input, .rc-type input { accent-color: #4a6748; }
  .rc-activation .btn-sec { padding: 4px 9px; }
  .rc-foot { margin-top: 8px; }
  .rc-foot .back { border: 0; background: transparent; color: #4a6748; padding: 2px 8px; cursor: pointer; font-size: 23px; }
  dialog.rc-edit { width: min(440px, 92vw); }
  .rc-edit .cfg-f > span { flex-basis: 86px; }
  .rc-edit .cfg-f input, .rc-edit .cfg-f select { padding: 5px 7px; }
  .rc-type { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: 13px; }
  .rc-type > span { flex: 0 0 86px; color: #444; }
  .rc-type label { display: inline-flex; align-items: center; gap: 5px; }
  .rc-edit.is-url .rc-fonction { display: none; }
  .rc-edit:not(.is-url) .rc-url { display: none; }

  /* ---------- Magasin : périphériques / connecteur Windows ---------- */
  .periph-tabs { display: flex; margin: 0 0 18px; border-bottom: 2px solid #aab7a5; }
  .periph-tabs a { flex: 1; padding: 10px 14px; text-align: center; color: #707070; background: #f7f8f6;
    text-decoration: none; font-size: 13px; letter-spacing: .2px; border-bottom: 2px solid transparent; }
  .periph-tabs a.on { color: #203420; background: #e5e9e2; border-bottom-color: #4a6748; font-weight: 700; }
  .periph-agent { display: flex; align-items: center; gap: 8px; margin: -7px 0 10px; padding: 7px 10px;
    border: 1px solid #cdd6cd; border-radius: 6px; background: #f7f9f6; color: #5c645a; font-size: 12px; }
  .periph-agent-dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca39a; }
  .periph-agent.is-ready { border-color: #9fbc9c; background: #f1f7f0; color: #2e6336; }
  .periph-agent.is-ready .periph-agent-dot { background: #39734f; }
  .periph-agent.is-missing { border-color: #d8bd96; background: #fff9f0; color: #76511c; }
  .periph-agent.is-missing .periph-agent-dot { background: #bd7c24; }
  .periph-retry { margin-left: auto; border: 0; background: transparent; color: #4a6748; cursor: pointer; font: inherit; }
  .periph-retry:disabled { opacity: .55; cursor: wait; }
  .periph-download { padding: 4px 8px; border-radius: 4px; background: #4a6748; color: #fff; text-decoration: none;
    font-weight: 600; }
  .periph-panel { min-width: 0; margin: 0; padding: 15px 16px 12px; border: 1px solid #3d4f3d; border-radius: 6px; }
  .periph-panel > legend { padding: 9px 16px; margin-left: -1px; border-radius: 5px 5px 0 0;
    background: #3d4f3d; color: #fff; font-size: 13px; font-weight: 600; }
  .periph-row { display: grid; grid-template-columns: minmax(155px, 320px) minmax(230px, 1fr) minmax(120px, .42fr);
    gap: 9px; align-items: center; margin: 7px 0; font-size: 13px; }
  .periph-row > span { color: #2d332d; }
  .periph-row input, .periph-row select { min-width: 0; padding: 5px 7px; border: 1px solid #b7c2b3; border-radius: 4px;
    background: #fff; font: inherit; }
  .periph-row select:disabled { color: #888; background: #f4f4f4; }
  .periph-row.periph-poste { grid-template-columns: minmax(155px, 320px) minmax(230px, .25fr); }
  .periph-bac { max-width: none; }
  .periph-radio-row { display: flex; align-items: center; justify-content: space-evenly; gap: 18px; min-height: 35px;
    margin: 6px 0; font-size: 13px; }
  .periph-radio-row label { display: inline-flex; align-items: center; gap: 6px; }
  .periph-radio-row input { accent-color: #4a6748; }
  .periph-note { margin: 12px 0 3px; color: #667; font-size: 12px; }
  .periph-foot { display: flex; align-items: center; margin-top: 12px; }
  .periph-foot .back { border: 0; background: transparent; color: #4a6748; padding: 2px 8px; font-size: 23px; cursor: pointer; }
  .periph-foot .valider { margin-left: auto; }
  @media (max-width: 800px) {
    .periph-tabs { overflow-x: auto; }
    .periph-tabs a { min-width: 120px; }
    .periph-row, .periph-row.periph-poste { grid-template-columns: 1fr; gap: 4px; }
    .periph-agent { align-items: flex-start; flex-wrap: wrap; }
    .periph-retry { margin-left: 0; }
  }

.cfg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 48px; }
.cfg-col { display: flex; flex-direction: column; }
.cfg-f { display: flex; align-items: center; gap: 10px; margin: 5px 0; font-size: 13px; }
.cfg-f > span:first-child { flex: 0 0 120px; color: #444; }
.cfg-f-nowrap > span:first-child { flex: 0 0 auto; white-space: nowrap; }
.cfg-f input, .cfg-f select { flex: 1; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; min-width: 0; }
.cfg-f-nowrap > .ms { flex: 1 1 0; min-width: 0; }
.cfg-f.wide > span:first-child { flex: 0 0 0; }
.cfg-2 { display: flex; gap: 6px; flex: 1; min-width: 0; }
.cfg-cp { flex: 0 0 70px !important; }
.cfg-cle { flex: 0 0 48px !important; }

/* Liste prescripteurs */
.pre-bar { display: flex; align-items: center; gap: 8px; background: #566656; color: #fff;
  padding: 6px 10px; border-radius: 5px; margin-bottom: 8px; }
.pre-title { font-size: 13px; margin-right: 6px; }
.pre-search { padding: 5px 8px; border: none; border-radius: 3px; font-style: italic; width: 130px; }
.pre-search-nom { width: 180px; }
.pre-tools { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.pre-tools .pg { background: rgba(255,255,255,.15); color: #fff; border: none; width: 26px; height: 26px;
  border-radius: 4px; cursor: pointer; font-size: 12px; }
.pre-tools .pg[disabled] { opacity: .5; cursor: default; }
.pre-tools .pg.add { background: #fff; color: #3d4f3d; font-weight: 700; }
.pre-tools .pg-pos { color: #fff; font-size: 12px; padding: 0 4px; }
.pre-tbl tr.clickable { cursor: pointer; }
.pre-tbl tr.clickable:hover td { background: #eef2ee; }
.pre-del { text-align: center; width: 34px; }
.row-del { background: #c0392b; color: #fff; border: none; width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; line-height: 1; }

/* Modal prescripteur (édition + filtres) */
dialog.pre-edit { width: min(860px, 95vw); }
dialog.pre-filtres { width: min(440px, 92vw); }
.pre-form { margin-top: 4px; }
.pre-fs { border: 1px solid #cdd6cd; border-radius: 8px; padding: 10px 12px 12px; margin: 0 0 12px; }
.pre-fs > legend { background: #3d4f3d; color: #fff; font-weight: 600; padding: 3px 12px; border-radius: 5px;
  font-size: 13px; }
.pre-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 18px; }
.pre-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.pre-finess { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.pre-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 6px; }
.pre-foot { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.pre-foot .valider { margin-left: auto; }
.pre-row3 .cfg-f > span:first-child, .pre-finess .cfg-f > span:first-child { flex: 0 0 auto; }
.pre-row3 .cfg-f, .pre-finess .cfg-f { min-width: 0; }
.logo-pick { align-items: center; }
.logo-prev { height: 28px; max-width: 64px; object-fit: contain; border: 1px solid #ddd; border-radius: 3px; background: #fff; }

/* ---------- Suivi & Traçabilité : liens cliquables + crayon ---------- */
.sv { display: flex; align-items: center; gap: 6px; }
.sv-link { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.sv-link:hover .sv-lbl { text-decoration: underline; }
.sv-edit { border: none; background: transparent; cursor: pointer; color: #3d4f3d; font-size: 12px; padding: 0 2px; }
.sv-edit[disabled] { color: #bbb; cursor: default; }

/* ---------- Pop-ups de confirmation (montage / livraison) ---------- */
dialog.confirm-pop { width: min(460px, 92vw); text-align: center; }
.confirm-q { font-size: 14px; margin: 8px 0 14px; }
.confirm-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 6px 0 14px; }
.confirm-pop .cfg-f { justify-content: center; margin: 8px 0; }
.confirm-pop .cfg-f > span:first-child { flex: 0 0 auto; }
.confirm-foot { display: flex; justify-content: center; gap: 20px; align-items: center; margin-top: 10px; }
.btn-oui { background: #f7c9c9; color: #7a2020; border: none; padding: 8px 22px; border-radius: 4px;
  cursor: pointer; font-weight: 700; }
.btn-non { background: transparent; border: none; color: #333; cursor: pointer; text-decoration: underline; }

/* ---------- Traçabilité des articles ---------- */
dialog.traca { width: min(1000px, 96vw); }
.traca-bar { display: flex; align-items: center; gap: 14px; background: #566656; color: #fff;
  padding: 6px 10px; border-radius: 5px; margin-bottom: 8px; font-size: 12px; }
.traca-warn { color: #e8a33d; font-weight: 600; }
.traca-nav { margin-left: auto; }
.traca-nav .pg { background: rgba(255,255,255,.15); color: #fff; border: none; width: 24px; height: 24px;
  border-radius: 4px; }
.traca-tbl th { background: #3d4f3d; }
.traca-tbl td { vertical-align: middle; }
.traca-tbl select, .traca-code { width: 100%; padding: 4px 6px; border: 1px solid #bbb; border-radius: 4px; }
.traca-tbl td.c { text-align: center; }
.traca-foot { justify-content: flex-start; gap: 16px; }
.traca-foot .valider { margin-left: auto; }

/* ---------- Paramétrage Client : cases + liste déroulante multi-choix ---------- */
[x-cloak] { display: none !important; }
.cfg-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 7px 0; }
.ms { position: relative; max-width: 640px; }
.ms-head { width: 100%; display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid #bbb; border-radius: 4px; padding: 7px 10px; cursor: pointer; font-size: 13px;
  text-align: left; }
.ms-head i { margin-left: auto; font-style: normal; color: #3d4f3d; }
.ms-resume { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 3px);
  background: #fff; border: 1px solid #bbb; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.15);
  max-height: 280px; overflow: auto; padding: 4px 0; }
.ms-item { display: flex; align-items: center; gap: 9px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.ms-item input[type="checkbox"] { flex: 0 0 auto; width: auto; min-width: auto; padding: 0; border: 0; }
.ms-item:hover { background: #eef2ee; }

/* Civilités */
.civ-tbl input, .civ-tbl select { width: 100%; padding: 4px 7px; border: 1px solid #ccc; border-radius: 4px; }
.civ-tbl td { vertical-align: middle; }
.civ-act { width: 44px; text-align: center; }
.civ-new { margin-bottom: 6px; }
.civ-new .valider { padding: 4px 12px; }

/* ---------- Codes libres ---------- */
.cl-tbl td { vertical-align: middle; }
.cl-tbl input[type=text], .cl-tbl input:not([type]) { width: 100%; padding: 4px 7px; border: 1px solid #ccc; border-radius: 4px; }
.cl-tbl td.c { text-align: center; }
dialog.cl-pop { width: min(430px, 92vw); }
.cl-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.cl-row .cfg-f > span:first-child { flex: 0 0 auto; }
.cl-foot { justify-content: flex-start; gap: 16px; }
.cl-foot .valider { margin-left: auto; }

/* ---------- Offres commerciales ---------- */
.off-tbl tr.clickable { cursor: pointer; }
.off-tbl tr.clickable:hover td { background: #eef2ee; }
dialog.off-pop { width: min(780px, 95vw); }
.off-head { display: flex; gap: 10px; margin-bottom: 8px; }
.off-head input { flex: 1; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; }
.off-head .off-code { flex: 0 0 150px; }
.off-cond { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.off-cond .pre-chk { flex: 0 0 260px; }
.off-cond select, .off-cond input { flex: 1; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px;
  min-width: 0; }
.off-cond select:disabled, .off-cond input:disabled { background: #f0f0f0; color: #999; }
.off-lignes { padding: 0; border: none; }
.off-lignes .pre-bar { margin-bottom: 0; border-radius: 5px 5px 0 0; }

/* Paramétrage Offre (fenêtre détaillée) */
dialog.offl-pop { width: min(1000px, 96vw); }
.offl-head { display: flex; gap: 20px; align-items: center; }
.offl-head .cfg-f { flex: 1; }
.offl-head .cfg-f > span:first-child { flex: 0 0 auto; }
.offl-keep { display: flex; align-items: center; gap: 14px; font-size: 12.5px; margin: 8px 0 12px; flex-wrap: wrap; }
.offl-mono, .offl-verre { display: flex; gap: 6px; align-items: center; }
.offl-mono input, .offl-verre input { flex: 1; min-width: 0; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; }
.offl-mono .w-xs, .offl-verre .w-xs { flex: 0 0 62px; }
.offl-mono .w-sm, .offl-verre .w-sm { flex: 0 0 110px; }
.offl-mono .num, .offl-verre .num { text-align: right; }
.offl-yeux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.offl-total { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.offl-total .cfg-f > span:first-child { flex: 0 0 auto; }
.offl-total input { flex: 0 0 110px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; }
.offl-total .num { text-align: right; }
.offl-total select { flex: 0 0 80px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; }
.offl-yeux > .pre-fs { min-width: 0; }
.offl-verre { min-width: 0; flex-wrap: wrap; }

/* ---------- Sociétés ---------- */
dialog.soc-pop { width: min(780px, 95vw); }
.soc-full { width: 100%; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; }
.soc-adr { display: flex; gap: 8px; margin-bottom: 6px; }
.soc-adr input, .soc-adr select { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; }
.soc-adr .soc-num { flex: 0 0 90px; }
.soc-adr .soc-cp { flex: 0 0 110px; }
.soc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.soc-two > .pre-fs { min-width: 0; }

/* ---------- Réglages Ventes ---------- */
.cfg-f .num { text-align: right; }
.cfg-f .w-sm { flex: 0 0 110px !important; }

/* ---------- Ventes Optique / Lentille / Comptoir ---------- */
.vo-bloc .cfg-chk, .vl-bloc .cfg-chk, .vc-bloc .cfg-chk { margin: 6px 0; }
.vo-row, .vl-row, .vc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.vo-row .cfg-chk, .vl-row .cfg-chk, .vc-row .cfg-chk { margin: 0; }
.vo-lbl, .vl-lbl, .vc-lbl { font-size: 13px; color: #333; }
.vo-inline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vo-num { width: 56px; text-align: right; padding: 4px 6px; border: 1px solid #bbb; border-radius: 4px; }
.vo-date, .vc-date { padding: 4px 6px; border: 1px solid #bbb; border-radius: 4px; }
.vo-four { width: 130px; padding: 4px 6px; border: 1px solid #bbb; border-radius: 4px; }
.vo-large, .vl-large { min-width: 340px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; }
.vo-foot, .vl-foot, .vc-foot { display: flex; align-items: center; gap: 12px; }
.vo-foot .valider, .vl-foot .valider, .vc-foot .valider { margin-left: auto; }
.vo-impr { background: #fff; border: 1px solid #3d4f3d; color: #3d4f3d; padding: 6px 12px;
  border-radius: 4px; cursor: pointer; font-size: 13px; }

/* Impressions précochées */
dialog.impr-pop { width: min(560px, 92vw); }
.impr-list { max-height: 62vh; overflow: auto; padding-right: 6px; }
.impr-row { display: flex; align-items: center; gap: 12px; padding: 2px 0; }
.impr-row .cfg-chk { flex: 1; margin: 3px 0; }
.impr-qte { width: 62px; padding: 3px 6px; border: 1px solid #bbb; border-radius: 4px; text-align: right; }

/* ---------- Mutuelles & SS : codes LPP ---------- */
.lpp-bar { display: flex; align-items: center; gap: 10px; background: #566656; color: #fff;
  min-height: 36px; padding: 0 10px; border-radius: 5px 5px 0 0; }
.lpp-title { font-size: 13px; font-weight: 600; }
.lpp-pays { width: 160px; padding: 4px 7px; border: 1px solid #d3dbd0; border-radius: 4px; font-size: 12px; }
.lpp-tools { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.lpp-tools .pg { width: 25px; height: 25px; padding: 0; border: none; border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 13px; }
.lpp-tools .pg:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.lpp-tools .pg:disabled { opacity: .45; cursor: default; }
.lpp-tools .pg.add { background: #fff; color: #3d4f3d; font-size: 18px; font-weight: 700; }
.lpp-tools .pg-pos { padding: 0 4px; color: #fff; font-size: 12px; white-space: nowrap; }
.lpp-tbl { margin: 0; border: 1px solid #c9d0c6; border-top: none; }
.lpp-tbl th { background: #2e3d2e; }
.lpp-tbl tr.clickable { cursor: pointer; }
.lpp-tbl tr.clickable:hover td { background: #eef2ee; }
.lpp-code { width: 150px; }
.lpp-base { width: 105px; text-align: right; }
.lpp-foot { display: flex; align-items: center; margin-top: 10px; }
.lpp-foot .back { border: none; background: transparent; color: #4a6748; padding: 3px 10px; cursor: pointer; font-size: 23px; }
.lpp-foot .saved { margin-left: auto; }
dialog.lpp-edit { width: min(620px, 94vw); }
dialog.lpp-filtres { width: min(430px, 92vw); }
.lpp-form { margin-top: 4px; }
.lpp-error { margin: 6px 0 10px; color: #a12626; font-size: 13px; }
.lpp-form .cfg-f > span:first-child { flex-basis: 135px; }
.lpp-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lpp-dates .cfg-f > span:first-child { flex: 0 0 auto; }
.lpp-filtres .lpp-form { margin-top: 6px; }
.lpp-filtres .cfg-f > span:first-child { flex-basis: 145px; }
.lpp-filtres .cfg-f input, .lpp-filtres .cfg-f select { max-width: 220px; }
.lpp-check { margin: 10px 0 0 145px; }
.lpp-foot-modal { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.lpp-foot-modal .back { border: none; background: transparent; color: #4a6748; padding: 2px 6px; cursor: pointer; font-size: 23px; }
.lpp-foot-modal .valider { margin-left: auto; }

/* ---------- Mutuelles & SS : Tiers Payant ---------- */
.tp-defaults { margin-bottom: 8px; }
.tp-defaults .cfg-f { max-width: 1120px; }
.tp-defaults .cfg-f > span:first-child { flex: 0 0 min(52%, 630px); }
.tp-defaults .cfg-f select { max-width: 500px; padding: 4px 7px; }
.tp-defaults .cfg-chk { margin: 6px 0 9px; }
.tp-pmss { padding: 0; overflow: hidden; margin: 8px 0; }
.tp-pmss-bar { display: flex; align-items: center; min-height: 34px; padding: 0 12px; background: #566656; color: #fff; }
.tp-pmss-title { font-size: 13px; font-weight: 600; }
.tp-pmss-tools { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.tp-pmss-tools .pg { width: 25px; height: 25px; padding: 0; border: none; border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 13px; }
.tp-pmss-tools .pg:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.tp-pmss-tools .pg:disabled { opacity: .45; cursor: default; }
.tp-pmss-tools .pg.add { background: #fff; color: #3d4f3d; font-size: 18px; font-weight: 700; }
.tp-pmss-tools .pg-pos { padding: 0 4px; font-size: 12px; white-space: nowrap; }
.tp-pmss-tbl { margin: 0; }
.tp-pmss-tbl th { background: #2e3d2e; }
.tp-pmss-tbl tr.clickable { cursor: pointer; }
.tp-pmss-tbl tr.clickable:hover td { background: #eef2ee; }
.tp-pmss-tbl .date { width: 50%; }
.tp-pmss-tbl .amount { text-align: right; width: 50%; }
.tp-suivi { margin: 8px 0; }
.tp-suivi .cfg-f { max-width: 1120px; }
.tp-suivi .cfg-f > span:first-child { flex: 0 0 min(52%, 630px); }
.tp-suivi .cfg-f select { max-width: 500px; padding: 4px 7px; }
.tp-foot { display: flex; align-items: center; margin-top: 10px; }
.tp-foot .back { border: none; background: transparent; color: #4a6748; padding: 3px 10px; cursor: pointer; font-size: 23px; }
.tp-foot .saved { margin-left: auto; }
.tp-foot .valider { margin-left: auto; }
dialog.pmss-edit { width: min(420px, 92vw); }
.pmss-form { margin-top: 6px; }
.pmss-form .cfg-f > span:first-child { flex: 0 0 110px; }
.pmss-form input { text-align: right; }
.pmss-error { margin: 6px 0 10px; color: #a12626; font-size: 13px; }
.pmss-foot { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.pmss-foot .back { border: none; background: transparent; color: #4a6748; padding: 2px 6px; cursor: pointer; font-size: 23px; }
.pmss-foot .valider { margin-left: auto; }

/* ---------- Mutuelles & SS : Grilles tarifaires ---------- */
.gt-bloc { padding: 0; overflow: hidden; margin-bottom: 10px; }
.gt-bar { display: flex; align-items: center; min-height: 34px; padding: 0 12px; background: #566656; color: #fff; }
.gt-title { font-size: 13px; font-weight: 600; }
.gt-tools { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.gt-tools .pg { width: 25px; height: 25px; padding: 0; border: none; border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 13px; }
.gt-tools .pg:disabled { opacity: .45; cursor: default; }
.gt-tools .pg-pos { padding: 0 4px; font-size: 12px; white-space: nowrap; }
.gt-tbl { margin: 0; }
.gt-tbl th { background: #2e3d2e; }
.gt-tbl .name { width: 80%; }
.gt-tbl .choice { width: 20%; text-align: center; }
.gt-tbl td.choice { text-align: center; }
.gt-tbl select { width: min(160px, 95%); padding: 3px 6px; border: 1px solid #bbb; border-radius: 4px; }
.gt-remise { margin: 6px 0 12px; }
.gt-foot { display: flex; align-items: center; margin-top: 10px; }
.gt-foot .back { border: none; background: transparent; color: #4a6748; padding: 3px 10px; cursor: pointer; font-size: 23px; }
.gt-foot .saved { margin-left: auto; }
.gt-foot .valider { margin-left: auto; }

/* ---------- Mutuelles & SS : mutuelles ---------- */
.mut-bar { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px;
  background: #566656; color: #fff; border-radius: 5px 5px 0 0; }
.mut-title { font-size: 13px; font-weight: 600; margin-right: 8px; }
.mut-search { width: 165px; padding: 4px 7px; border: 1px solid #d3dbd0; border-radius: 4px; font-size: 12px; }
.mut-plateau { width: 145px; }
.mut-tools { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.mut-tools .pg { width: 25px; height: 25px; padding: 0; border: none; border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 13px; }
.mut-tools .pg:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.mut-tools .pg:disabled { opacity: .45; cursor: default; }
.mut-tools .pg.add { background: #fff; color: #3d4f3d; font-size: 18px; font-weight: 700; }
.mut-tools .pg-pos { padding: 0 4px; font-size: 12px; white-space: nowrap; }
.mut-tbl { margin: 0; border: 1px solid #c9d0c6; border-top: none; border-radius: 0 0 6px 6px;
  border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 12px; }
.mut-tbl th { background: #2e3d2e; color: #fff; padding: 7px 12px; border-right: 1px solid rgba(255,255,255,.15);
  letter-spacing: .08px; text-align: left; white-space: nowrap; }
.mut-tbl th:last-child { border-right: none; }
.mut-tbl tr.clickable { cursor: pointer; }
.mut-tbl tr.clickable:hover td { background: #eef2ee; }
.mut-tbl td { padding: 6px 12px; white-space: nowrap; }
.mut-tbl th:nth-child(n+3):not(:last-child), .mut-tbl td:nth-child(n+3):not(:last-child) { text-align: center; }
.mut-tbl th:first-child, .mut-tbl td:first-child { min-width: 180px; }
.mut-tbl th:nth-child(2), .mut-tbl td:nth-child(2) { min-width: 145px; }
.mut-tbl th:nth-child(3), .mut-tbl td:nth-child(3) { min-width: 90px; }
.mut-mode { display: inline-block; min-width: 22px; padding: 1px 5px; border-radius: 3px; color: #fff; text-align: center; }
.mut-mode.mode-n { background: #72766d; }
.mut-mode.mode-s { background: #39734f; }
.mut-mode.mode-u { background: #286a62; }
.mut-select-cell { width: 32px; text-align: center; }
.mut-empty { color: #666; font-style: italic; text-align: center; padding: 14px !important; }
.mut-all { display: flex; justify-content: center; align-items: center; gap: 7px; font-size: 12px; margin: 5px 0; }
.mut-foot { display: flex; align-items: center; margin-top: 9px; }
.mut-foot .back, .mut-form-foot .back, .mut-info-foot .back { border: none; background: transparent; color: #4a6748;
  padding: 2px 6px; cursor: pointer; font-size: 23px; }
dialog.mut-edit { width: min(850px, 96vw); max-height: 92vh; overflow: auto; }
.mut-form { margin-top: 4px; }
.mut-error { margin: 6px 0 10px; color: #a12626; font-size: 13px; }
.mut-fs { min-width: 0; border: 1px solid #cdd6cd; border-radius: 8px; padding: 9px 12px 10px; margin: 0 0 10px; }
.mut-fs > legend { background: #3d4f3d; color: #fff; font-weight: 600; padding: 4px 14px; border-radius: 5px;
  font-size: 13px; }
.mut-info-row, .mut-columns, .mut-diverses { display: grid; gap: 10px 18px; }
.mut-info-row { grid-template-columns: 1fr 1fr; }
.mut-columns { grid-template-columns: 1fr 1fr; }
.mut-columns .mut-fs { margin: 0 0 10px; }
.mut-diverses { grid-template-columns: 1fr 1fr; }
.mut-diverses .cfg-f > span:first-child { flex-basis: 142px; }
.mut-diverses .cfg-f select, .mut-diverses .cfg-f input { padding: 5px 7px; }
.mut-columns .cfg-f { margin: 4px 0; }
.mut-columns .cfg-f > span:first-child { flex-basis: 86px; }
.mut-form-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.mut-useful { margin-left: auto; border: none; background: transparent; color: #4a6748; font-size: 14px; cursor: pointer; }
.mut-form-foot .valider { margin-left: 0; }
dialog.mut-infos { width: min(570px, 92vw); max-height: 80vh; overflow: auto; }
.mut-tabs { display: flex; gap: 2px; border-bottom: 2px solid #b5bdb1; margin: 3px 0 14px; }
.mut-tabs button { min-width: 104px; padding: 7px 12px; border: none; border-radius: 4px 4px 0 0; background: #f0f2ef;
  color: #4a4a4a; cursor: pointer; font-size: 13px; }
.mut-tabs button.on { background: #e0e5dd; color: #203420; font-weight: 700; }
.mut-resume { min-height: 150px; font-size: 13px; }
.mut-resume ul { padding-left: 22px; }
.mut-docs { min-height: 185px; font-size: 13px; }
.mut-docs > p { color: #555; margin: 4px 0 9px; }
.mut-docs .cfg-f { margin-top: 11px; max-width: 430px; }
.mut-docs .cfg-f > span:first-child { flex-basis: 190px; }
.mut-info-foot { display: flex; align-items: center; margin-top: 10px; }
dialog.mut-groupe { width: min(470px, 94vw); }
.mut-groupe form { margin-top: 6px; }
.mut-groupe .cfg-f > span:first-child { flex-basis: 185px; }
.mut-groupe .cfg-f select, .mut-groupe .cfg-f input { padding: 5px 7px; }
.mut-warning { color: #d37630; font-size: 12px; line-height: 1.35; margin: 11px 0 4px; }

/* ---------- Mutuelles & SS : Grands régimes ---------- */
.gr-bar { display: flex; align-items: center; gap: 14px; min-height: 36px; padding: 0 12px;
  background: #566656; color: #fff; border-radius: 5px 5px 0 0; }
.gr-title { font-size: 13px; font-weight: 600; }
.gr-unique { display: flex; align-items: center; gap: 7px; margin-left: auto; font-size: 12px; white-space: nowrap; }
.gr-tools { display: flex; align-items: center; gap: 3px; }
.gr-tools .pg { width: 25px; height: 25px; padding: 0; border: none; border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 13px; }
.gr-tools .pg:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.gr-tools .pg:disabled { opacity: .45; cursor: default; }
.gr-tools .pg-pos { padding: 0 4px; font-size: 12px; white-space: nowrap; }
.gr-search { width: 118px; padding: 4px 7px; border: 1px solid #d3dbd0; border-radius: 4px; font-size: 12px; }
.gr-tbl { margin: 0; border: 1px solid #c9d0c6; border-top: none; border-radius: 0 0 6px 6px;
  border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 12px; }
.gr-tbl th { background: #2e3d2e; color: #fff; padding: 6px 10px; white-space: nowrap; }
.gr-tbl td { padding: 5px 10px; white-space: nowrap; }
.gr-tbl tr.clickable { cursor: pointer; }
.gr-tbl tr.clickable:hover td { background: #eef2ee; }
.gr-tbl th:nth-child(4) { min-width: 265px; }
.gr-tbl th:nth-child(7) { min-width: 220px; }
.gr-tdest { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.gr-teletrans { width: 42px; text-align: center; }
.gr-teletrans input { accent-color: #566656; }
.gr-foot { display: flex; align-items: center; margin-top: 10px; }
.gr-foot .back { border: none; background: transparent; color: #4a6748; padding: 3px 10px; cursor: pointer; font-size: 23px; }
.gr-foot .valider { margin-left: auto; }
dialog.gr-edit { width: min(446px, 94vw); max-height: calc(100vh - 28px); padding: 12px 18px 10px; overflow: hidden; }
dialog.gr-edit .picker-head { margin-bottom: 9px; }
.gr-form { margin-top: 0; }
.gr-form .cfg-f { margin: 2px 0; font-size: 11px; }
.gr-form .cfg-f > span:first-child { flex: 0 0 163px; }
.gr-form .cfg-f input, .gr-form .cfg-f select { padding: 2px 5px; font-size: 11px; }
.gr-form .gr-empty-label { margin-top: -2px; }
.gr-numero { flex: 0 0 50px !important; }
.gr-pj { align-items: flex-start; margin-top: 13px !important; }
.gr-pj textarea { flex: 1; min-height: 74px; resize: vertical; padding: 5px; border: 1px solid #bbb; border-radius: 4px; font: inherit; font-size: 11px; }
.gr-teletrans-check { margin: 5px 0 5px 163px; font-size: 11px; }
.gr-form .mut-form-foot { margin-top: 5px; }
dialog.gr-filtres { width: min(370px, 92vw); padding: 12px 18px 14px; }
.gr-filtres .picker-head { margin-bottom: 14px; }
.gr-filtres .cfg-f { margin: 6px 0; font-size: 11px; }
.gr-filtres .cfg-f > span:first-child { flex: 0 0 110px; }
.gr-filtres .cfg-f input { max-width: 165px; padding: 3px 6px; font-size: 11px; }
.gr-filtres .mut-form-foot { margin-top: 15px; }

  /* ---------- Mutuelles & SS : Organismes payeurs ---------- */
  .op-list { width: 100%; border: 1px solid #b7c2b3; border-radius: 6px; overflow: hidden; background: #fff; }
  .op-bar { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px;
    background: #566656; color: #fff; }
  .op-title { font-size: 13px; font-weight: 600; margin-right: 8px; }
.op-search { width: 165px; margin-left: auto; padding: 4px 7px; border: 1px solid #d3dbd0; border-radius: 4px; font-size: 12px; }
.op-tools { display: flex; align-items: center; gap: 3px; }
.op-tools .pg { width: 25px; height: 25px; padding: 0; border: none; border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 13px; }
.op-tools .pg:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.op-tools .pg:disabled { opacity: .45; cursor: default; }
.op-tools .pg-pos { padding: 0 4px; font-size: 12px; white-space: nowrap; }
  .op-tbl { margin: 0; border: 0; border-radius: 0; border-collapse: separate; border-spacing: 0; overflow: hidden;
    font-size: 12px; }
  .op-tbl th { background: #2e3d2e; color: #fff; text-align: center; padding: 5px 10px; font-weight: 600; }
  .op-tbl td { padding: 5px 10px; border: 0; }
  .op-tbl tbody tr:nth-child(odd) td { background: #f8f9f7; }
  .op-tbl tbody tr:nth-child(even) td { background: #e5e8e2; }
  .op-empty { height: 16px; background: #fff !important; }
.op-foot { display: flex; align-items: center; margin-top: 10px; }
.op-foot .back { border: none; background: transparent; color: #4a6748; padding: 3px 10px; cursor: pointer; font-size: 23px; }

@media (max-width: 820px) {
  .gr-bar { flex-wrap: wrap; padding: 7px 10px; }
  .gr-unique { margin-left: 0; }
}
.mut-regimes { padding: 0; overflow: hidden; }
.mut-regimes > legend { margin-left: 12px; }
.mut-regime-tools { display: flex; align-items: center; min-height: 32px; padding: 0 11px; background: #566656; color: #fff; font-size: 12px; }
.mut-regime-tools span { margin-left: auto; margin-right: 12px; opacity: .9; }
.mut-regime-tools button, .mut-add-forfait { border: none; border-radius: 4px; background: #fff; color: #3d4f3d; font-size: 18px; font-weight: 700; cursor: pointer; }
.mut-regime-tools button { width: 25px; height: 25px; }
.mut-regimes table { margin: 0; }
.mut-regimes th, .mut-forfaits th { background: #2e3d2e; color: #fff; }
.mut-regimes tr.clickable { cursor: pointer; }
.mut-regimes tr.clickable:hover td { background: #eef2ee; }
.mut-regime-open { width: 28px; color: #4a6748; font-size: 17px; text-align: center; }
.mut-regime-note { color: #777; font-size: 12px; margin: -2px 0 8px; }
dialog.mut-regime-edit { width: min(920px, 96vw); max-height: 90vh; overflow: auto; }
.mut-regime-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 4px 0 9px; font-size: 13px; }
.mut-regime-head label { display: flex; align-items: center; gap: 7px; }
.mut-regime-head input { width: 180px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; }
.mut-regime-checks { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mut-regime-checks .cfg-chk { margin: 4px 0; }
.mut-forfaits { border: 1px solid #cdd6cd; border-radius: 7px; overflow: hidden; margin: 8px 0; }
.mut-forfaits-bar { min-height: 32px; display: flex; align-items: center; padding: 0 12px; background: #566656; color: #fff; font-size: 13px; font-weight: 600; }
.mut-forfaits table { margin: 0; font-size: 11px; }
.mut-forfaits td { white-space: nowrap; text-align: center; }
.mut-forfait-add { padding-top: 5px; }
.mut-forfait-grid { display: grid; grid-template-columns: repeat(9, minmax(66px, 1fr)) 28px; align-items: end; gap: 6px; }
.mut-forfait-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; white-space: nowrap; }
.mut-forfait-grid input, .mut-forfait-grid select { min-width: 0; width: 100%; padding: 4px 5px; border: 1px solid #bbb; border-radius: 4px; }
.mut-add-forfait { height: 26px; width: 26px; }

@media (max-width: 760px) {
  .mut-info-row, .mut-columns, .mut-diverses { grid-template-columns: 1fr; }
  .mut-bar { flex-wrap: wrap; padding: 7px 10px; }
  .mut-tools { margin-left: 0; }
  .mut-regime-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .mut-forfait-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Dictionnaire ---------- */
.dico-activation { margin-bottom: 10px; }
.dico-bloc { max-width: none; padding: 0; overflow: hidden; }
.dico-head { display: flex; align-items: center; gap: 18px; min-height: 34px; padding: 0 14px;
  background: #3d4f3d; color: #fff; font-size: 13px; font-weight: 600; }
.dico-search { flex: 0 1 250px; }
.dico-search input { width: 100%; padding: 4px 8px; border: 1px solid #ced5ca; border-radius: 4px;
  font: inherit; font-weight: 400; }
.dico-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dico-table th { background: #293729; color: #fff; padding: 4px 8px; text-align: center; font-weight: 600; }
.dico-table td { padding: 3px 8px; border: 0; }
.dico-table tbody tr:nth-child(even) { background: #e7eae5; }
.dico-empty { color: #666; font-style: italic; text-align: center; padding: 14px !important; }
.dico-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 7px 12px;
  border-top: 1px solid #d4d9d1; color: #3d4f3d; font-size: 12px; }
.dico-pager button { border: 0; background: transparent; color: #3d4f3d; padding: 1px 4px; cursor: pointer;
  font-size: 16px; line-height: 1; }
.dico-pager button:disabled { color: #aaa; cursor: default; }

/* ---------- Documents : Avoirs et courriers ---------- */
.doc-config { min-width: 0; }
.doc-param { margin-top: 0; min-height: 154px; padding: 21px 18px 13px; border-color: #3d4f3d; }
.doc-param .cfg-chk { width: fit-content; margin: 7px 0; }
.doc-param .cfg-chk input { accent-color: #4d6b4b; }
.doc-form-actions { display: flex; justify-content: flex-end; margin-top: -5px; }
.doc-form-actions .valider { padding: 6px 16px; }
.doc-list { width: 100%; overflow: hidden; border: 1px solid #b7c2b3; border-radius: 7px; background: #fff; }
.doc-bar { display: flex; align-items: center; min-height: 35px; padding: 0 12px; background: #566656; color: #fff; font-size: 13px; font-weight: 600; }
.doc-tools { display: flex; align-items: center; margin-left: auto; }
.doc-tools button { width: 25px; height: 25px; padding: 0; border: none; border-radius: 4px; background: #fff; color: #3d4f3d; font-size: 19px; font-weight: 700; cursor: pointer; }
.doc-table { margin: 0; border: 0; border-radius: 0; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.doc-table th { padding: 5px 10px; background: #2e3d2e; color: #fff; text-align: center; font-weight: 600; }
.doc-table td { padding: 5px 9px; vertical-align: middle; }
.doc-table tbody tr:nth-child(odd) td { background: #f8f9f7; }
.doc-table tbody tr:nth-child(even) td { background: #e5e8e2; }
.doc-table tr.clickable { cursor: pointer; }
.doc-table tr.clickable:hover td { background: #eef2ee; }
.doc-table th:first-child, .doc-table td:first-child { min-width: 200px; }
.doc-table th:nth-child(2), .doc-table td:nth-child(2) { width: 18%; }
.doc-preview { max-width: 450px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-default { width: 70px; text-align: center; color: #3d6640; font-weight: 700; }
.doc-delete { width: 31px; text-align: center; }
.doc-delete button { width: 17px; height: 17px; padding: 0; border: 1px solid #d19191; border-radius: 50%; background: #f7dada; color: #bc4a4a; font-size: 14px; line-height: 12px; cursor: pointer; }
.doc-mediateur { display: flex; align-items: center; gap: 10px; margin: 7px 0; padding: 6px 10px; border: 1px solid #b7c2b3; border-radius: 6px; background: #fff; cursor: pointer; }
.doc-mediateur:hover { background: #eef2ee; }
.doc-mediateur > span:first-child { font-weight: 600; white-space: nowrap; }
.doc-mediateur .doc-preview { min-width: 0; }
.doc-foot { display: flex; align-items: center; margin-top: 10px; }
.doc-foot .back, .doc-modal-foot .back { border: none; background: transparent; color: #4a6748; padding: 3px 10px; cursor: pointer; font-size: 23px; }
dialog.doc-edit { width: min(680px, 94vw); }
.doc-edit-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .8fr) auto; align-items: end; gap: 6px 14px; }
.doc-edit-meta .cfg-f { min-width: 0; }
.doc-edit-meta .cfg-f > span:first-child { flex: 0 0 auto; }
.doc-edit-meta input, .doc-edit-meta select, .courrier-meta input, .courrier-meta select { min-width: 0; padding: 5px 7px; border: 1px solid #b9c3b5; border-radius: 4px; font: inherit; }
.doc-text-label { display: block; margin: 5px 0 4px; font-size: 12px; font-weight: 600; color: #324632; }
.doc-rich-editor { margin-top: 12px; border: 1px solid #b9c3b5; border-radius: 6px; overflow: hidden; background: #fff; }
.doc-rich-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 5px 7px; background: #f2f4f0; border-bottom: 1px solid #d5ddd2; }
.doc-rich-tools button { min-width: 28px; height: 26px; padding: 2px 5px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #1f2b20; cursor: pointer; font: 600 14px system-ui, sans-serif; }
.doc-rich-tools button:hover, .doc-rich-tools button:focus-visible { border-color: #a9b9a6; background: #fff; outline: none; }
.doc-rich-tools select { height: 26px; max-width: 180px; padding: 2px 5px; border: 1px solid #b9c3b5; border-radius: 4px; background: #fff; color: #243524; font: 12px system-ui, sans-serif; }
.doc-rich-tools select[data-rich-variable] { min-width: 175px; margin-left: auto; }
.doc-rich-tools input[type="color"] { width: 30px; height: 26px; padding: 2px; border: 1px solid #b9c3b5; border-radius: 4px; background: #fff; cursor: pointer; }
.doc-tool-sep { width: 1px; height: 20px; margin: 0 3px; background: #cbd3c7; }
.doc-rich-area { display: block; width: 100%; min-height: 205px; padding: 9px 10px; overflow: auto; color: #202820; background: #fff; font: 13px/1.48 system-ui, sans-serif; outline: none; }
.doc-rich-area:empty::before { content: "Texte de facture…"; color: #879087; font-style: italic; pointer-events: none; }
.doc-rich-area a { color: #285f8f; text-decoration: underline; }
.doc-rich-area ul, .doc-rich-area ol { margin: .35em 0; padding-left: 1.7em; }
.doc-hint { margin: 7px 0 0; color: #647064; font-size: 11px; line-height: 1.35; }
.doc-modal-foot { display: flex; align-items: center; margin-top: 12px; }
.doc-modal-foot .valider { margin-left: auto; }
dialog.courrier-edit { width: min(920px, 96vw); max-height: 91vh; overflow: auto; }
.doc-fieldset { min-width: 0; margin: 0; border: 1px solid #3d4f3d; border-radius: 8px; padding: 18px 16px 12px; }
.doc-fieldset > legend { padding: 5px 14px; border-radius: 5px; background: #3d4f3d; color: #fff; font-size: 13px; font-weight: 600; }
.courrier-meta { display: grid; grid-template-columns: 1.2fr .8fr 1.2fr; align-items: end; gap: 3px 16px; }
.courrier-meta .cfg-f { min-width: 0; margin: 3px 0; }
.courrier-meta .cfg-f > span:first-child { flex: 0 0 auto; white-space: nowrap; }
.courrier-textarea { min-height: 315px; }
.courrier-table th:first-child, .courrier-table td:first-child { width: 34%; }
.courrier-table th:nth-child(2), .courrier-table td:nth-child(2) { width: 48%; }
@media (max-width: 720px) {
  .doc-edit-meta, .courrier-meta { grid-template-columns: 1fr; }
  .doc-rich-tools select[data-rich-variable] { min-width: 150px; margin-left: 0; }
  .doc-table { min-width: 620px; }
  .doc-list { overflow-x: auto; }
  .doc-param { min-height: 0; }
}

/* ---------- Documents : Devis normalisé et extensions de garantie ---------- */
.devis-normalise .saved { margin-bottom: 8px; }
.dn-bloc { margin: 0 0 16px; padding: 13px 20px 15px; border-color: #3d4f3d; }
.dn-bloc > legend { padding: 8px 20px; border-radius: 0 0 5px 0; background: #3d4f3d; color: #fff; font-size: 14px; font-weight: 600; }
.dn-param .cfg-f { max-width: 700px; }
.dn-param .cfg-f > span:first-child { flex: 1; }
.dn-small { width: 58px; text-align: right; }
.dn-prestations { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.2fr); gap: 0 36px; align-items: center; }
.dn-prestations > .cfg-f { margin: 5px 0; }
.dn-prestations > .cfg-f > span:first-child { flex: 1; }
.dn-prestations input { width: 58px; padding: 4px 6px; border: 1px solid #b9c3b5; border-radius: 4px; text-align: right; font: inherit; }
.dn-levels { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap: 18px; }
.dn-levels .cfg-f { margin: 0; }
.dn-levels .cfg-f > span:first-child { flex: 1; white-space: nowrap; }
.dn-garantie-row { display: flex; align-items: center; gap: 11px; font-size: 13px; }
.dn-add { width: 25px; height: 25px; border: 0; border-radius: 4px; background: transparent; color: #3d5d3c; font-size: 21px; font-weight: 700; line-height: 1; cursor: pointer; }
.dn-add:hover { background: #edf3eb; }
.dn-textes { padding: 0 20px 20px; overflow: hidden; }
.dn-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 -20px 20px; border-bottom: 2px solid #b5bdb1; }
.dn-tabs button { min-height: 42px; border: 0; border-bottom: 2px solid transparent; background: #f5f6f4; color: #6d716d; cursor: pointer; font: 13px system-ui, sans-serif; letter-spacing: .4px; }
.dn-tabs button.on { border-bottom-color: #4b6749; background: #e6e9e3; color: #283d28; font-weight: 700; }
.fa-tabs { grid-template-columns: repeat(2, 1fr); margin: 0 0 16px; }
.dn-textes textarea { display: block; width: 100%; min-height: 102px; resize: vertical; padding: 8px 10px; border: 1px solid #b9c3b5; border-radius: 5px; font: 13px/1.4 system-ui, sans-serif; }
.dn-foot { display: flex; align-items: center; margin: 7px 0 0; }
.dn-foot .back, .garanties-foot .back, .garantie-edit-foot .back { border: 0; background: transparent; color: #4a6748; padding: 3px 10px; cursor: pointer; font-size: 23px; }
.dn-foot .valider { margin-left: auto; }
dialog.garanties-modal { width: min(760px, 94vw); }
.garanties-list { overflow: hidden; border: 1px solid #b7c2b3; border-radius: 7px; }
.garanties-bar { display: flex; align-items: center; min-height: 35px; padding: 0 11px; background: #566656; color: #fff; font-size: 13px; font-weight: 600; }
.garanties-tools { display: flex; align-items: center; gap: 9px; margin-left: auto; font-size: 12px; }
.garanties-tools button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 4px; background: #fff; color: #3d4f3d; font-size: 19px; font-weight: 700; cursor: pointer; }
.garanties-table { margin: 0; border: 0; border-radius: 0; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.garanties-table th { padding: 5px 9px; background: #2e3d2e; color: #fff; text-align: center; }
.garanties-table td { padding: 5px 9px; }
.garanties-table tbody tr:nth-child(odd) td { background: #f8f9f7; }
.garanties-table tbody tr:nth-child(even) td { background: #e5e8e2; }
.garanties-table tr.clickable { cursor: pointer; }
.garanties-table tr.clickable:hover td { background: #eef2ee; }
.garanties-table th:first-child { width: 31%; }.garanties-table th:nth-child(2), .garanties-table th:nth-child(3) { width: 19%; }
.garantie-default { width: 58px; text-align: center; color: #3d6640; font-weight: 700; }
.garanties-foot { display: flex; align-items: center; margin-top: 9px; }
dialog.garantie-edit { width: min(620px, 94vw); max-height: 90vh; overflow: auto; }
.garantie-edit form { margin-top: 8px; }
.garantie-edit .cfg-f { margin: 6px 0; }
.garantie-edit .cfg-f > span:first-child { flex: 0 0 92px; }
.garantie-edit .cfg-f input, .garantie-edit .cfg-f select { flex: 1; min-width: 0; padding: 5px 7px; border: 1px solid #b9c3b5; border-radius: 4px; font: inherit; }
.garantie-description { align-items: flex-start; }
.garantie-description textarea { flex: 1; min-height: 160px; resize: vertical; padding: 6px 8px; border: 1px solid #b9c3b5; border-radius: 4px; font: inherit; }
.garantie-defaut { margin: 7px 0 0 102px; }
.garantie-edit-foot { display: flex; align-items: center; margin-top: 14px; }
.garantie-edit-foot .valider { margin-left: auto; }
@media (max-width: 760px) {
  .dn-prestations { grid-template-columns: 1fr; gap: 8px; }
  .dn-levels { grid-template-columns: 1fr; gap: 5px; }
  .dn-tabs { grid-template-columns: 1fr; }
  .dn-tabs button { min-height: 34px; }
}

.dep-wrap { overflow-x: auto; }
.dep-table { border-collapse: collapse; white-space: nowrap; }
.dep-table th, .dep-table td { border: 1px solid #cdd6cd; padding: 4px 6px; }
.dep-rayon-btn { display: flex; align-items: center; gap: 4px; border: none; background: transparent; font: inherit; font-weight: 600; cursor: pointer; color: #2d332d; white-space: normal; max-width: 130px; }
.dep-rayon-pick { color: #6d716d; }
.dep-cell { width: 64px; border: 1px solid #cdd6cd; border-radius: 3px; padding: 3px 5px; text-align: right; }

dialog.rayon-picker { display: flex; flex-direction: column; }
.rayon-tree { list-style: none; margin: 0; padding: 0 0 0 4px; overflow-y: auto; max-height: 55vh; }
.rayon-tree ul { list-style: none; margin: 0; padding-left: 20px; }
.rayon-row { display: flex; align-items: center; gap: 4px; padding: 1px 0; }
.rayon-toggle { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid #b7c2b3; border-radius: 2px; background: #fff; color: #566656; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.rayon-toggle-leaf { border: none; background: transparent; }
.rayon-pick { border: none; background: transparent; font: inherit; text-align: left; padding: 1px 4px; border-radius: 3px; cursor: pointer; color: #2d332d; }
.rayon-pick:hover { background: #eef2ee; }
.rayon-pick.on { background: #3d4f3d; color: #fff; font-weight: 600; }
.rayon-current { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; padding: 6px 10px; border: 1px solid #cdd6cd; border-radius: 5px; background: #f5f6f4; font-size: 13px; }
.rayon-reset { border: 1px solid #d19191; border-radius: 4px; background: #f7dada; color: #bc4a4a; font: inherit; padding: 3px 8px; cursor: pointer; }
.rayon-reset:hover { background: #f2c6c6; }

/* --- Référentiel stock MIRIS : produits, catalogues, inventaires -------------------------- */
.stock-form { max-width: 1180px; }
.stock-form .bloc { margin-top: 20px; }
.stock-grid { display: grid; grid-template-columns: repeat(6, minmax(80px, 1fr)); gap: 9px 10px; align-items: end; }
.stock-grid .w-xs { width: auto; grid-column: span 1; }
.stock-grid .w-sm { width: auto; grid-column: span 1; }
.stock-grid .w-md { width: auto; grid-column: span 2; }
.stock-grid .stock-wide { width: auto; grid-column: span 3; }
.stock-grid .fld input, .stock-grid .fld select, .stock-form textarea { min-width: 0; width: 100%; }
.stock-grid .checkline { align-self: center; }
.checkline { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; font-size: 12px; color: #333; }
.checkline input[type="checkbox"] { accent-color: #3d4f3d; }
.stock-help { grid-column: span 3; align-self: center; color: #687268; font-size: 12px; }
.stock-actions { display: flex; align-items: center; gap: 10px; max-width: 1180px !important; }
.catalogue-form .bloc { max-width: 1180px; }
.catalogue-form .view-head, .inventory-page .view-head { max-width: 1180px; }
.stock-config-page .cfg-main { max-width: 1320px; }
.stock-config-lines { display: grid; gap: 12px; max-width: 860px; }
.stock-config-lines .fld { display: grid; grid-template-columns: minmax(270px, 1fr) minmax(360px, 1.5fr); align-items: center; gap: 12px; }
.stock-config-table { overflow: hidden; border: 1px solid #b7c2b3; border-radius: 6px; margin: 8px 0 14px; }
.stock-config-filters { display:flex; align-items:end; gap:12px; margin: 4px 0 8px; font-size:12px; }
.stock-config-filters label { display:grid; gap:3px; }
.stock-config-bar { display: flex; align-items: center; min-height: 34px; padding: 0 10px 0 14px; background: #3d4f3d; color: #fff; font-size: 13px; }
.stock-config-bar .add { margin-left: auto; color: #fff; font-size: 21px; line-height: 1; }
.stock-config-table .grid { margin: 0; border: 0; border-radius: 0; width: 100%; }
.stock-config-table tr[hx-get] { cursor: pointer; }
.stock-config-editor { margin: 18px auto; padding: 18px; border: 1px solid #b7c2b3; border-radius: 10px; background: #fff; max-width: 900px; box-shadow: 0 8px 28px rgba(34,48,34,.15); }
.stock-config-editor.compact { max-width: 650px; }
.stock-config-editor .view-head h2 { margin: 0 0 10px; font-size: 22px; }
.stock-config-tabs { display: flex; margin-bottom: 18px; border-bottom: 1px solid #b7c2b3; }
.stock-config-tabs button { flex: 1; padding: 9px; border: 0; background: #f5f6f4; cursor: pointer; }
.stock-config-tabs button.on { background: #3d4f3d; color: #fff; }
.stock-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rayon-columns { display: grid; grid-template-columns: repeat(4,minmax(180px,1fr)); gap: 5px; overflow-x: auto; }
.rayon-columns .stock-config-table { min-width: 190px; }
.margin-levels { display: grid; gap: 8px; margin-top: 14px; }
.margin-levels label { display: flex; align-items: center; gap: 6px; }
.margin-levels input[type=number] { width: 76px; }
.margin-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 3px; background: #40384d; }
.margin-dot.m2 { background:#dc3d54 }.margin-dot.m3 { background:#ef7b45 }.margin-dot.m4 { background:#e6b431 }.margin-dot.m5 { background:#45bf86 }
.formula-editor { max-width: 1040px; }
.formula-line, .fixed-prices { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 10px 0; }
.formula-line input, .fixed-prices input { width: 92px; }
.work-grid { display: grid; grid-template-columns: 80px repeat(6,minmax(65px,1fr)); gap: 5px; align-items: center; margin-top: 12px; }
.work-grid b { text-align: center; font-size: 11px; }
.work-grid input { width: 100%; min-width: 0; }
.compact-setting { display: flex; align-items: center; gap: 16px; margin: 8px 0 14px; }
.compact-setting .bloc { flex: 1; }
.order-grid { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.order-grid th, .order-grid td { padding: 5px 9px; text-align: left; }
.order-grid select { min-width: 170px; }
.label-print-panel { max-width: 980px !important; }
.label-qty { width: 72px; min-height: 28px; padding: 3px 6px; border: 1px solid #b9c3b5; border-radius: 4px; }
.label-print-options { align-items: end; margin-top: 12px; }
.label-printer-note { align-self: center; color: #556055; font-size: 12px; }
.label-print-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-height: 34px; }
.label-print-actions [data-label-message] { margin-right: auto; font-size: 12px; }
@media (max-width: 1050px) { .rayon-columns { grid-template-columns: repeat(2,minmax(220px,1fr)); } .stock-contact-grid { grid-template-columns: 1fr; } }
.import-area { margin-top: 12px; max-width: 900px; }
.import-area textarea { width: 100%; resize: vertical; padding: 8px; border: 1px solid #bbb; border-radius: 4px; font: 12px/1.4 ui-monospace, monospace; }
.import-result ul { margin: 6px 0 0; color: #b3261e; }
.inventory-toolbar { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; max-width: 1180px; }
.inventory-toolbar .add-sm { margin-left: auto; }
.inventory-state { color: #555; font-size: 13px; }
.inventory-lines { max-width: 1180px; overflow-x: auto; }
.inventory-lines .grid { min-width: 760px; }
.inventory-qty { width: 88px; padding: 4px 5px; border: 1px solid #bbb; border-radius: 3px; text-align: right; }
.inventory-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; max-width: 1180px; }
.inventory-empty { max-width: 1180px; margin-top: 12px; }

/* --- Registre documentaire : métadonnées et contrôle d'intégrité ------------------------- */
.document-detail, .avoir-detail { max-width: 1180px; }
.document-state { margin-left: auto; padding: 3px 9px; border-radius: 12px; background: #e7eee5; color: #365336; font-size: 12px; }
.avoir-state-annule { background: #f7dddd; color: #982a2a; }
.avoir-state-solde { background: #e5e8e2; color: #566056; }
.avoir-reste b { color: #b3261e; font-size: 17px; }
.avoir-sale-alert { max-width: 1160px; margin: 5px 0 12px; padding: 8px 11px; border-left: 4px solid #c89b3c; background: #fbf6e8; color: #62511e; font-size: 12px; font-weight: 600; }
.avoir-sale-cancelled { border-color: #c53d36; background: #fae8e7; color: #8d2520; }
.avoir-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.avoir-action { display: grid; gap: 9px; }
.avoir-action > .fld, .avoir-action > .fld input, .avoir-action > .fld select { width: 100%; box-sizing: border-box; }
.avoir-action .valider, .avoir-action .btn-sec { justify-self: end; }
.avoir-action button:disabled, .avoir-correct button:disabled, .avoir-cancel-op button:disabled { opacity: .45; cursor: not-allowed; }
.avoir-journal { overflow-x: auto; }
.avoir-journal .grid { min-width: 850px; }
.avoir-op-corrected { color: #777; text-decoration: line-through; }
.grid tr.journal-avoir td { color: #9f1239; font-weight: 600; }
.avoir-op-corrected .document-state { text-decoration: none; display: inline-block; }
.avoir-correct { display: inline-block; margin-right: 7px; vertical-align: top; }
.avoir-correct summary { color: #315e31; cursor: pointer; text-decoration: underline; }
.avoir-correct form { position: absolute; z-index: 8; width: 235px; padding: 9px; border: 1px solid #b9c3b5; border-radius: 6px; box-shadow: 0 5px 18px #0002; background: #fff; text-decoration: none; }
.avoir-correct .fld { width: 100%; margin-bottom: 6px; }
.avoir-correct input, .avoir-correct select { width: 100%; box-sizing: border-box; }
.avoir-cancel-op { display: inline; }
.btn-danger-mini { padding: 3px 6px; border: 1px solid #d39a96; border-radius: 4px; background: #fae8e7; color: #992c27; cursor: pointer; }
.avoir-danger-zone { justify-content: flex-end; }
.bloc-avoirs .avoir-create .row, .avoir-open-cash .row { align-items: flex-end; }
@media (max-width: 850px) { .avoir-actions-grid { grid-template-columns: 1fr; } }
.document-hash { overflow-wrap: anywhere; font: 11px/1.4 ui-monospace, monospace; }
.document-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.archive-mini { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }
.archive-mini a { color: #315e31; text-decoration: underline; }
.document-integrity .flash-ok, .document-integrity .flash-err { display: inline-block; margin: 5px 0; }
.document-box { margin-top: 16px; max-width: 1180px; }
.document-box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.document-box-head .flash-ok { margin-left: auto; }
.document-toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 8px 0 3px; }
.document-toolbar select, .document-toolbar input[type="file"] { min-height: 29px; max-width: 270px; padding: 4px 6px; border: 1px solid #b9c3b5; border-radius: 4px; background: #fff; font: inherit; font-size: 12px; }
.document-toolbar input[type="file"] { max-width: 300px; }
.document-help, .document-upload-message { min-height: 17px; margin: 3px 0 8px; color: #687268; font-size: 11px; }
.document-upload-message.flash-err { color: #b3261e; }
.document-upload-message.flash-ok { color: #35613a; }
.document-row-actions { white-space: nowrap; }
.document-row-actions a, .document-row-actions button { margin-left: 5px; }
.document-row-actions a { color: #315e31; text-decoration: underline; font-size: 11px; }
.document-box .grid { width: 100%; }
.document-box .grid th, .document-box .grid td { vertical-align: middle; }
.document-box .grid td:nth-child(2) { max-width: 250px; overflow-wrap: anywhere; }
.transmission-note { border-left: 3px solid #c89b3c; padding: 7px 10px; background: #fbf6e8; color: #62511e; font-size: 12px; }
.teletrans-page { max-width: 1180px; }
.teletrans-page .bloc { margin-top: 14px; }
.teletrans-page .view-head { max-width: 1180px; }
.transmission-explain p { margin: 6px 0 10px; color: #556055; font-size: 12px; }
.teletrans-page code { font: 11px ui-monospace, monospace; }
@media (max-width: 900px) {
  .stock-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .stock-grid .w-xs, .stock-grid .w-sm, .stock-grid .w-md, .stock-grid .stock-wide, .stock-help { grid-column: span 1; }
}
/* Dépliant générique des listes (View.expand). Le bouton reste discret : sa colonne entière
   ne sert qu'à ouvrir le détail, jamais à porter une donnée métier. */
.grid th.col-expand, .grid td.col-expand { width: 21px; padding: 0 3px; text-align: center; }
button.row-expand { width: 17px; height: 17px; padding: 0; border: 1px solid #b9c3b5; border-radius: 3px; background: #fff; color: #3d4f3d; font-size: 11px; line-height: 1; cursor: pointer; }
button.row-expand:hover { background: #eef2ee; }
tr.detail-row > td { padding: 0; border-bottom: 2px solid #d8e0d5; background: #fbfcfa; }
tr.detail-row .detail-box { padding: 9px 12px 11px; }
tr.detail-row h4 { margin: 0 0 7px; color: #3d4f3d; font-size: 12px; }
tr.detail-row .detail-grid { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 7px; }
tr.detail-row .detail-grid div { font-size: 12px; }
tr.detail-row .detail-grid span { display: block; color: #687268; font-size: 11px; }
tr.detail-row table { width: 100%; border-collapse: collapse; margin-top: 5px; font-size: 12px; }
tr.detail-row table th { padding: 3px 7px; background: #eef2ee; text-align: left; font-weight: 600; }
tr.detail-row table td { padding: 3px 7px; border-bottom: 1px solid #eef0ec; }
tr.detail-row .detail-empty { color: #888; font-size: 12px; }
/* Gestion de caisse (C7) : sept opérations réelles, chacune dans son bloc, plus l'état de la
   session en tête. La grille se replie en une colonne sur écran étroit. */
.caisse-ops { max-width: 1180px; }
.caisse-ops .view-head { flex-wrap: wrap; }
.caisse-date { color: #556055; font-size: 13px; }
/* `btn-sec` est aussi porté par des <a> : sans ces deux règles, un lien-bouton s'affiche comme
   du texte souligné au milieu de vrais boutons. */
a.btn-sec { display: inline-block; text-decoration: none; line-height: 1.5; }
.caisse-ops .btn-sec { white-space: nowrap; }
.caisse-ops-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
.caisse-ops-grid > .bloc { margin-top: 14px; }
.caisse-ops .bloc > .pilule { white-space: nowrap; }
.caisse-action .row { align-items: flex-end; }
.caisse-action .row:last-child { margin-top: 2px; }
.caisse-summary { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-bottom: 10px; }
.caisse-summary div { font-size: 13px; }
.caisse-summary span { display: block; color: #687268; font-size: 11px; }
.caisse-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.caisse-modes { max-width: 620px; }
.caisse-cloture { border-color: #c89b3c; }
.caisse-ops td, .caisse-ops th { vertical-align: middle; }
.analyse-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.analyse-tabs a { padding: 6px 13px; border: 1px solid #b9c3b5; border-bottom: none; border-radius: 5px 5px 0 0; background: #f2f5f1; color: #315e31; text-decoration: none; font-size: 13px; }
.analyse-tabs a.active { background: #fff; color: #23301f; font-weight: 600; }
.caisse-analyses .totaux-bar { margin: 12px 0 4px; }
.analyse-note { color: #556055; font-size: 12px; margin-left: auto; }
.analyse-modes { font-size: 11px; color: #556055; }
@media (max-width: 980px) { .caisse-ops-grid { grid-template-columns: 1fr; } }
