/* SIFAMAC+/QUINCA+ v117 — interface de gestion étendue */

/* =========================
   VENTE / CAISSE — format compact proche du catalogue Produits
   ========================= */
.sale-product-grid{
  grid-template-columns:repeat(auto-fill,minmax(178px,1fr))!important;
  gap:7px!important;
  align-items:stretch!important;
}
.sale-product-card-v117{
  min-height:0!important;
  padding:6px!important;
  border:1px solid #dfe7ef!important;
  border-radius:7px!important;
  background:#fff!important;
  box-shadow:0 3px 10px rgba(26,54,88,.035)!important;
  display:flex!important;
  flex-direction:column!important;
  gap:5px!important;
  overflow:hidden!important;
}
.sale-product-card-v117:hover{
  transform:none!important;
  border-color:#aac6e7!important;
  box-shadow:0 4px 12px rgba(26,54,88,.07)!important;
}
.sale-v117-main{
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  gap:7px;
  align-items:center;
  min-width:0;
}
.sale-v117-thumb{
  width:38px;
  height:38px;
  border-radius:5px;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:#f3f6f9;
}
.sale-v117-thumb img,
.sale-v117-img{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  display:block!important;
  background:#fff;
}
.sale-v117-thumb .product-placeholder{
  min-height:38px!important;
  font-size:20px!important;
}
.sale-v117-info{min-width:0}
.sale-v117-info strong{
  display:block;
  color:#142941;
  font-size:9.7px;
  line-height:1.18;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sale-v117-info small{
  display:block;
  color:#7c8da0;
  font-size:7.8px;
  line-height:1.15;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sale-v117-info div{
  margin-top:3px;
  font-size:8.2px;
  line-height:1.15;
  color:#536980;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sale-v117-info b{
  color:#142941;
  font-size:9px;
}
.sale-v117-controls{
  display:grid;
  grid-template-columns:minmax(48px,.72fr) minmax(48px,.72fr) minmax(62px,1fr);
  gap:4px;
  align-items:end;
}
.sale-v117-controls.sale-v117-one{
  grid-template-columns:minmax(56px,.8fr) minmax(72px,1fr);
}
.sale-v117-controls label{
  margin:0!important;
  min-width:0;
}
.sale-v117-controls label span{
  display:block;
  margin:0 0 2px;
  color:#6e8095;
  font-size:7px;
  line-height:1;
  font-weight:850;
}
.sale-v117-controls .input{
  height:27px!important;
  min-height:27px!important;
  padding:3px 4px!important;
  border-radius:5px!important;
  font-size:9px!important;
  text-align:center;
}
.sale-v117-controls .btn{
  height:27px!important;
  min-height:27px!important;
  padding:0 7px!important;
  border-radius:5px!important;
  font-size:8px!important;
}
.cart-line-v117{
  grid-template-columns:minmax(62px,.8fr) minmax(62px,.8fr) minmax(72px,.9fr) minmax(90px,1.15fr)!important;
}
.cart-line-v117.cart-line-no-ml-v88{
  grid-template-columns:minmax(62px,.8fr) minmax(72px,.9fr) minmax(90px,1.15fr)!important;
}

/* Net à payer en lettres — reçu */
.receipt-amount-words-v117{
  margin:7px 0 10px;
  padding:7px 8px;
  border:1px solid #777;
  background:#fafafa;
  color:#111;
  font-size:8.5px;
  line-height:1.35;
  font-style:italic;
}
.receipt-amount-words-v117 strong{
  font-style:normal;
  font-weight:900;
}

/* =========================
   FILTRES / KPI
   ========================= */
.filter-suite-v117{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  align-items:end;
  padding:12px;
  margin-bottom:12px;
}
.filter-suite-3-v117{grid-template-columns:repeat(3,minmax(0,1fr))}
.filter-suite-4-v117{grid-template-columns:repeat(4,minmax(0,1fr))}
.filter-suite-v117 label{
  display:block;
  margin:0 0 4px;
  color:var(--muted);
  font-size:9px;
  font-weight:850;
}
.filter-suite-v117 .input{
  margin:0;
  min-height:36px;
}
.pro-kpis-v117{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

/* =========================
   STOCK — rubriques figées
   ========================= */
.stock-table-wrap-v113{
  max-height:calc(100vh - 285px)!important;
  overflow:auto!important;
  position:relative;
}
.stock-table-v113{
  border-collapse:separate!important;
  border-spacing:0!important;
}
.stock-table-v113 thead th{
  position:sticky!important;
  top:0!important;
  z-index:6!important;
  background:#edf2f7!important;
  box-shadow:0 1px 0 #dce5ee,0 2px 4px rgba(20,42,70,.05);
}
body.dark-ui .stock-table-v113 thead th{
  background:#17304a!important;
}

/* =========================
   STATISTIQUES PRODUITS
   ========================= */
.stats-filter-v117{
  grid-template-columns:repeat(5,minmax(0,1fr));
}
.stats-chart-v117{
  display:grid;
  grid-template-columns:minmax(220px,340px) minmax(260px,1fr);
  gap:24px;
  align-items:center;
  padding:10px 0;
}
.stats-chart-v117 svg{
  width:min(320px,100%);
  height:auto;
  margin:auto;
  overflow:visible;
}
.stats-legend-v117{
  display:grid;
  gap:6px;
}
.stats-legend-item-v117{
  display:grid;
  grid-template-columns:10px minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  padding:5px 0;
  border-bottom:1px solid var(--line);
  font-size:9px;
}
.stats-legend-item-v117>span{
  width:10px;
  height:10px;
  border-radius:50%;
}
.stats-legend-item-v117 strong{
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.stats-legend-item-v117 em{
  font-style:normal;
  color:var(--muted);
  white-space:nowrap;
}

/* =========================
   IMPRESSION
   ========================= */
@media print{
  .receipt-amount-words-v117{
    background:#fff!important;
    border:1px solid #000!important;
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .stats-chart-v117{
    display:grid!important;
    grid-template-columns:42% 58%!important;
    gap:14px!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  .stats-chart-v117 svg{
    width:250px!important;
    max-width:100%!important;
  }
  .stats-legend-item-v117{
    border-bottom:1px solid #ddd!important;
  }
}

@media(max-width:1050px){
  .stats-filter-v117{grid-template-columns:repeat(3,minmax(0,1fr))}
  .filter-suite-4-v117{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pro-kpis-v117{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .sale-product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .filter-suite-v117,
  .filter-suite-3-v117,
  .filter-suite-4-v117,
  .stats-filter-v117{
    grid-template-columns:1fr!important;
  }
  .stats-chart-v117{
    grid-template-columns:1fr;
  }
  .pro-kpis-v117{grid-template-columns:1fr}
  .stock-table-wrap-v113{max-height:65vh!important}
}
