/* DSA CRM v12.8 — garde-fou final pour la saisie comptable.
   Ce fichier est volontairement chargé en dernier : les anciennes couches
   v11 ne peuvent plus remettre le résultat à droite ni superposer les champs. */

#mandat-section-vente .v1146-finance-card,
#mandat-section-vente .v1146-finance-card *{
  box-sizing:border-box;
}

#mandat-section-vente .v1146-finance-card{
  width:100%;
  min-width:0;
  overflow:hidden;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",Inter,"DM Sans",Arial,sans-serif!important;
  font-weight:400;
}

#mandat-section-vente .v1146-finance-card>header{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:12px!important;
  min-height:60px!important;
  padding:14px 18px!important;
}
#mandat-section-vente .v1146-finance-card>header>div{display:flex;align-items:center;gap:10px;min-width:0}
#mandat-section-vente .v1146-finance-card>header h4{margin:0!important;font-size:15px!important;font-weight:650!important;line-height:1.25!important;letter-spacing:-.015em!important}
#mandat-section-vente .v1146-finance-card>header p{margin:0!important;font-size:10px!important;font-weight:400!important;line-height:1.35!important;color:var(--ink3)!important}
#mandat-section-vente .v1146-finance-card .v1192-flow{display:none!important}

/* Un seul flux vertical : note, recettes, coûts, résultat final, sauvegarde. */
#mandat-section-vente .v1146-finance-workspace{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-areas:"note" "revenue" "cost" "result" "save"!important;
  align-items:stretch!important;
  width:100%!important;
  min-width:0!important;
  overflow:visible!important;
  background:rgba(255,255,255,.30)!important;
}
#mandat-section-vente .v1146-finance-workspace>.v1192-finance-note{grid-area:note!important}
#mandat-section-vente .v1146-finance-workspace>section:nth-of-type(1){grid-area:revenue!important}
#mandat-section-vente .v1146-finance-workspace>section:nth-of-type(2){grid-area:cost!important}
#mandat-section-vente .v1146-finance-workspace>section:nth-of-type(3){grid-area:result!important}
#mandat-section-vente .v1146-finance-workspace>footer.v1176-autosave{grid-area:save!important}
#mandat-section-vente .v1146-finance-workspace>section{
  position:static!important;
  inset:auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  padding:17px 18px!important;
  border:0!important;
  background:transparent!important;
  overflow:visible!important;
}
#mandat-section-vente .v1146-finance-workspace>section:nth-of-type(n+2){border-top:1px solid rgba(24,32,43,.08)!important}

#mandat-section-vente .v1192-finance-note{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  min-width:0!important;
  margin:14px 18px 0!important;
  padding:9px 11px!important;
  font-size:9.5px!important;
  font-weight:400!important;
}
#mandat-section-vente .v1192-finance-note strong{flex:0 0 auto;font-weight:650!important}

#mandat-section-vente .v1146-section-title{
  display:flex!important;
  align-items:baseline!important;
  justify-content:space-between!important;
  gap:16px!important;
  min-width:0!important;
  margin:0 0 11px!important;
}
#mandat-section-vente .v1146-section-title strong{font-size:13px!important;font-weight:650!important;line-height:1.3!important;letter-spacing:-.01em!important}
#mandat-section-vente .v1146-section-title small{display:block!important;max-width:520px!important;font-size:9.5px!important;font-weight:400!important;line-height:1.35!important;text-align:right!important;color:var(--ink3)!important}

/* Deux cartes par ligne, sans positionnement implicite ni débordement. */
#mandat-section-vente .v1146-finance-card .v1146-fields{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  align-items:stretch!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
}
#mandat-section-vente .v1146-finance-card .v1146-field{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(112px,132px)!important;
  grid-template-rows:auto auto!important;
  align-items:center!important;
  column-gap:12px!important;
  row-gap:2px!important;
  grid-column:auto!important;
  grid-row:auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:70px!important;
  margin:0!important;
  padding:10px 11px!important;
  overflow:hidden!important;
}
#mandat-section-vente .v1146-finance-card .v1146-field[data-finance-field="otherRevenueTtc"]{grid-column:1/-1!important;max-width:calc(50% - 5px)}
#mandat-section-vente .v1146-finance-card .v1146-field>span{
  display:block!important;
  grid-column:1!important;
  grid-row:1!important;
  align-self:end!important;
  min-width:0!important;
  margin:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  color:var(--ink)!important;
  font-size:10px!important;
  font-weight:620!important;
  line-height:1.3!important;
}
#mandat-section-vente .v1146-finance-card .v1146-field>small{
  display:block!important;
  grid-column:1!important;
  grid-row:2!important;
  align-self:start!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  color:var(--ink3)!important;
  font-size:8.5px!important;
  font-weight:400!important;
  line-height:1.3!important;
}
#mandat-section-vente .v1146-finance-card .v1146-field>div{
  display:flex!important;
  grid-column:2!important;
  grid-row:1/3!important;
  align-self:center!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  position:relative!important;
}
#mandat-section-vente .v1146-finance-card .v1146-field input{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  height:40px!important;
  margin:0!important;
  padding:0 32px 0 11px!important;
  font-family:inherit!important;
  font-size:13px!important;
  font-weight:620!important;
  line-height:40px!important;
}
#mandat-section-vente .v1146-finance-card .v1146-field em{
  position:absolute!important;
  right:11px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  margin:0!important;
  font-size:11px!important;
  font-weight:500!important;
}

/* Le choix de garantie occupe sa propre ligne et ne peut jamais traverser la colonne Résultat. */
#mandat-section-vente .v1146-finance-card .v1175-warranty-picker{
  display:grid!important;
  grid-template-columns:minmax(200px,.7fr) minmax(300px,1.3fr)!important;
  grid-template-rows:auto auto!important;
  align-items:center!important;
  gap:3px 14px!important;
  grid-column:1/-1!important;
  width:100%!important;
  min-width:0!important;
  min-height:68px!important;
  margin:0!important;
  padding:10px 11px!important;
  overflow:hidden!important;
}
#mandat-section-vente .v1146-finance-card .v1175-warranty-picker>span{grid-column:1!important;grid-row:1/3!important;margin:0!important;font-size:10px!important;font-weight:620!important;line-height:1.3!important}
#mandat-section-vente .v1146-finance-card .v1175-warranty-picker select,
#mandat-section-vente .v1146-finance-card .v1175-warranty-picker input{grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important;height:40px!important;margin:0!important;font-family:inherit!important;font-size:11.5px!important;font-weight:520!important}
#mandat-section-vente .v1146-finance-card .v1175-warranty-picker>em{grid-column:2!important;grid-row:2!important;margin:0!important;font-size:8.5px!important;font-weight:500!important;line-height:1.3!important;color:#347b50!important}

/* Les chiffres définitifs restent toujours en bas et sur toute la largeur. */
#mandat-section-vente .v1146-calculation{
  position:static!important;
  width:100%!important;
  min-width:0!important;
  background:linear-gradient(145deg,rgba(246,251,248,.92),rgba(248,251,255,.88))!important;
}
#mandat-section-vente .v1146-calculation #v1146-results{width:100%!important;min-width:0!important}
#mandat-section-vente .v1146-calculation .v1184-profit{
  display:grid!important;
  grid-template-columns:minmax(260px,.85fr) minmax(0,2fr)!important;
  align-items:stretch!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
}
#mandat-section-vente .v1146-calculation .v1184-profit>header{
  display:grid!important;
  align-content:center!important;
  min-width:0!important;
  min-height:108px!important;
  margin:0!important;
  padding:16px 18px!important;
}
#mandat-section-vente .v1146-calculation .v1184-profit>header span{font-size:8.5px!important;font-weight:650!important}
#mandat-section-vente .v1146-calculation .v1184-profit>header strong{font-size:28px!important;font-weight:700!important;line-height:1.1!important}
#mandat-section-vente .v1146-calculation .v1184-profit>header small{font-size:9px!important;font-weight:400!important;line-height:1.35!important}
#mandat-section-vente .v1146-calculation .v1184-profit-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
  min-width:0!important;
}
#mandat-section-vente .v1146-calculation .v1184-profit-grid>div{display:grid!important;align-content:center!important;min-width:0!important;min-height:108px!important;margin:0!important;padding:11px!important}
#mandat-section-vente .v1146-calculation .v1184-profit-grid span{font-size:8px!important;font-weight:500!important}
#mandat-section-vente .v1146-calculation .v1184-profit-grid strong{font-size:12.5px!important;font-weight:650!important;white-space:nowrap!important}
#mandat-section-vente .v1146-calculation .v1184-profit details{grid-column:1/-1!important;font-size:9px!important;font-weight:400!important}

#mandat-section-vente .v1146-finance-workspace>footer.v1176-autosave{
  position:static!important;
  width:100%!important;
  min-width:0!important;
  min-height:52px!important;
  margin:0!important;
  padding:10px 18px!important;
}

@media(max-width:1100px){
  #mandat-section-vente .v1146-calculation .v1184-profit{grid-template-columns:1fr!important}
  #mandat-section-vente .v1146-calculation .v1184-profit-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #mandat-section-vente .v1146-calculation .v1184-profit-grid>div{min-height:68px!important}
}

@media(max-width:760px){
  #mandat-section-vente .v1146-finance-card>header{align-items:flex-start!important;flex-direction:column!important;gap:4px!important}
  #mandat-section-vente .v1146-section-title{align-items:flex-start!important;flex-direction:column!important;gap:3px!important}
  #mandat-section-vente .v1146-section-title small{text-align:left!important}
  #mandat-section-vente .v1146-finance-card .v1146-fields{grid-template-columns:1fr!important}
  #mandat-section-vente .v1146-finance-card .v1146-field[data-finance-field="otherRevenueTtc"]{grid-column:auto!important;max-width:none!important}
  #mandat-section-vente .v1146-finance-card .v1175-warranty-picker{grid-template-columns:1fr!important;grid-template-rows:auto auto auto!important}
  #mandat-section-vente .v1146-finance-card .v1175-warranty-picker>span,
  #mandat-section-vente .v1146-finance-card .v1175-warranty-picker select,
  #mandat-section-vente .v1146-finance-card .v1175-warranty-picker input,
  #mandat-section-vente .v1146-finance-card .v1175-warranty-picker>em{grid-column:1!important;grid-row:auto!important}
}

@media(max-width:500px){
  #mandat-section-vente .v1146-finance-card .v1146-field{grid-template-columns:1fr!important;grid-template-rows:auto auto auto!important}
  #mandat-section-vente .v1146-finance-card .v1146-field>div{grid-column:1!important;grid-row:3!important;margin-top:6px!important}
  #mandat-section-vente .v1146-calculation .v1184-profit-grid{grid-template-columns:1fr!important}
}
