
/* =========================================================
   V374 — Sharp A4 Quote Template
   Đồng bộ /quote-preview và /q/:code
   ========================================================= */

:root{
  --v374-green:#0f5d39;
  --v374-green-2:#0a6b3c;
  --v374-green-soft:#f4faf6;
  --v374-green-line:#bfd4c7;
  --v374-ink:#18231d;
  --v374-muted:#66736b;
  --v374-red:#c82424;
  --v374-gold:#a66d1f;
}

/* Paper */
.v372-paper{
  width:1120px!important;
  max-width:100%!important;
  background:#fff!important;
  border:1px solid #9fb8a9!important;
  box-shadow:0 10px 28px rgba(20,42,30,.08)!important;
  color:var(--v374-ink)!important;
  font-family:Arial,"Helvetica Neue",Helvetica,sans-serif!important;
  -webkit-font-smoothing:antialiased!important;
  text-rendering:geometricPrecision!important;
}

/* Header */
.v372-header{
  grid-template-columns:1.15fr .72fr .40fr!important;
  gap:20px!important;
  padding:20px 22px 18px!important;
  border-top:4px solid var(--v374-green)!important;
  border-bottom:1px solid var(--v374-green-line)!important;
  background:#fff!important;
}
.v372-company{
  gap:15px!important;
  align-items:flex-start!important;
}
.v372-company img,
.v372-logo-fallback{
  width:118px!important;
  height:86px!important;
  object-fit:contain!important;
}
.v372-logo-fallback{
  color:var(--v374-green)!important;
  font-size:25px!important;
  font-weight:900!important;
  letter-spacing:.02em!important;
}
.v372-company h2{
  margin:0!important;
  font-size:18px!important;
  line-height:1.2!important;
  font-weight:900!important;
  color:var(--v374-green)!important;
  letter-spacing:-.01em!important;
}
.v372-company p{
  margin-top:4px!important;
  font-size:9.3px!important;
  line-height:1.42!important;
  color:#253128!important;
}
.v372-title{
  align-self:start!important;
}
.v372-title h1{
  margin:0!important;
  font-size:38px!important;
  line-height:.98!important;
  font-weight:950!important;
  letter-spacing:.025em!important;
  color:var(--v374-green)!important;
}
.v372-title>p{
  margin-top:10px!important;
  font-size:12.5px!important;
  color:#313c35!important;
}
.v372-title>p strong{
  color:var(--v374-red)!important;
  font-size:14px!important;
  font-weight:900!important;
}
.v372-date{
  width:max-content!important;
  margin:9px auto 7px!important;
  padding:5px 14px!important;
  border:1px solid #96baa5!important;
  border-radius:999px!important;
  background:#f9fcfa!important;
  color:#26372d!important;
  font-size:9.8px!important;
  font-weight:850!important;
}
.v372-title small{
  font-size:9.5px!important;
  font-weight:700!important;
  color:#3e4b43!important;
}

/* QR box - visually cleaner even before a real QR is wired */
.v372-qr{
  gap:6px!important;
}
.v372-qr-box{
  width:92px!important;
  height:92px!important;
  border:1px solid #8cac99!important;
  border-radius:6px!important;
  background:
    linear-gradient(90deg,#fff 25%,#eef5f0 25%,#eef5f0 50%,#fff 50%,#fff 75%,#eef5f0 75%),
    linear-gradient(#fff 25%,#eef5f0 25%,#eef5f0 50%,#fff 50%,#fff 75%,#eef5f0 75%)!important;
  background-size:16px 16px!important;
  color:var(--v374-green)!important;
  font-size:16px!important;
  font-weight:900!important;
}
.v372-qr strong{
  font-size:8.8px!important;
  color:#26352d!important;
}
.v372-qr small{
  padding:4px 7px!important;
  border-radius:999px!important;
  background:var(--v374-green)!important;
  color:#fff!important;
  font-size:7.2px!important;
}

/* Customer + notes */
.v372-info{
  grid-template-columns:1fr 1fr!important;
  border-top:0!important;
  border-bottom:1px solid var(--v374-green-line)!important;
  background:#fff!important;
}
.v372-info>div{
  padding:14px 17px 15px!important;
}
.v372-info>div+div{
  border-left:1px solid var(--v374-green-line)!important;
}
.v372-info h3{
  display:inline-flex!important;
  align-items:center!important;
  margin-bottom:9px!important;
  padding:5px 10px!important;
  border-radius:4px!important;
  background:var(--v374-green)!important;
  color:#fff!important;
  font-size:9.8px!important;
  font-weight:900!important;
  letter-spacing:.02em!important;
}
.v372-info p{
  grid-template-columns:128px 1fr!important;
  gap:8px!important;
  margin-top:5px!important;
  font-size:9.4px!important;
  line-height:1.48!important;
  color:#28332d!important;
}
.v372-info p b{
  font-weight:850!important;
  color:#18231d!important;
}

/* Product table */
.v372-table{
  width:100%!important;
  border-collapse:collapse!important;
  table-layout:auto!important;
  font-size:9.35px!important;
}
.v372-table th{
  padding:8px 7px!important;
  border-right:1px solid rgba(255,255,255,.28)!important;
  background:var(--v374-green)!important;
  color:#fff!important;
  text-align:center!important;
  font-size:8.8px!important;
  font-weight:900!important;
  letter-spacing:.025em!important;
  white-space:nowrap!important;
}
.v372-table th:last-child{border-right:0!important}
.v372-table td{
  padding:9px 7px!important;
  border-right:1px solid #e0e8e3!important;
  border-bottom:1px solid #dbe4de!important;
  background:#fff!important;
  color:#202a24!important;
  vertical-align:middle!important;
}
.v372-table td:last-child{border-right:0!important}
.v372-table tbody tr:nth-child(even) td{
  background:#fbfdfc!important;
}
.v372-table td:nth-child(1),
.v372-table td:nth-child(4),
.v372-table td:nth-child(5){
  text-align:center!important;
}
.v372-table td:nth-child(6),
.v372-table td:nth-child(7){
  text-align:right!important;
  white-space:nowrap!important;
  font-variant-numeric:tabular-nums!important;
}
.v372-table td:nth-child(7){
  font-weight:900!important;
  color:var(--v374-green)!important;
}
.v372-table .empty{
  padding:28px!important;
  color:#748179!important;
}

/* Summary */
.v372-summary{
  grid-template-columns:1fr 470px!important;
  gap:16px!important;
  padding:14px 18px!important;
  border-top:0!important;
}
.v372-thankyou{
  align-self:stretch!important;
  padding:14px!important;
  border:1px solid #d7e3db!important;
  border-radius:8px!important;
  background:#fbfdfb!important;
}
.v372-thankyou strong{
  font-size:10.5px!important;
  font-weight:900!important;
  color:var(--v374-green)!important;
}
.v372-thankyou p{
  max-width:500px!important;
  margin-top:6px!important;
  font-size:9.35px!important;
  line-height:1.52!important;
  color:#58645d!important;
}
.v372-total{
  border:1px solid #b8cbbf!important;
  border-radius:7px!important;
  overflow:hidden!important;
}
.v372-total>div{
  display:flex!important;
  justify-content:space-between!important;
  align-items:center!important;
  gap:12px!important;
  padding:9px 12px!important;
  border-bottom:1px solid #dce6df!important;
  font-size:9.8px!important;
}
.v372-total>div:last-child{border-bottom:0!important}
.v372-total>div b{
  font-size:11px!important;
  font-weight:900!important;
  font-variant-numeric:tabular-nums!important;
}
.v372-total .grand{
  background:var(--v374-green)!important;
  color:#fff!important;
  font-size:12.5px!important;
  font-weight:900!important;
}
.v372-total .grand b{
  font-size:19px!important;
  color:#fff!important;
}

/* Footer cards */
.v372-footer{
  grid-template-columns:1fr 1fr 1.15fr!important;
  border-top:1px solid var(--v374-green-line)!important;
}
.v372-footer>div{
  min-height:132px!important;
  padding:14px 16px!important;
  background:#fff!important;
}
.v372-footer>div+div{
  border-left:1px solid var(--v374-green-line)!important;
}
.v372-footer h4{
  margin-bottom:9px!important;
  font-size:9.6px!important;
  font-weight:900!important;
  color:var(--v374-green)!important;
}
.v372-footer p{
  margin-top:5px!important;
  font-size:9px!important;
  line-height:1.48!important;
  color:#303d35!important;
}
.v372-sign{
  text-align:center!important;
}
.v372-sign strong{
  margin-top:10px!important;
  font-size:9.4px!important;
  font-weight:850!important;
}

/* Bottom contact strip from settings */
.v374-contact-strip{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:10px!important;
  padding:10px 18px!important;
  border-top:1px solid #d7e2db!important;
  background:#fff!important;
  font-size:8.9px!important;
  color:#243229!important;
}
.v374-contact-strip span:nth-child(2){text-align:center!important}
.v374-contact-strip span:nth-child(3){text-align:right!important}
.v374-brand-footer{
  padding:7px 16px!important;
  background:var(--v374-green)!important;
  color:#fff!important;
  text-align:center!important;
  font-size:9px!important;
  font-weight:850!important;
  letter-spacing:.02em!important;
}

/* Toolbars */
.v372-preview-actions,
.v373-public-toolbar{
  max-width:1120px!important;
}
.v373-public-page,
.v372-preview-page{
  background:#eef2ef!important;
}

/* Print: preserve corporate colors and sharpness */
@media print{
  *{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }
  @page{
    size:A4 portrait;
    margin:6mm;
  }
  .v372-paper{
    width:100%!important;
    max-width:none!important;
    border:1px solid #7f9f8d!important;
    box-shadow:none!important;
  }
  .v372-header{
    padding:12px 14px 10px!important;
  }
  .v372-company img,
  .v372-logo-fallback{
    width:82px!important;
    height:62px!important;
  }
  .v372-title h1{
    font-size:29px!important;
  }
  .v372-info>div{
    padding:9px 11px!important;
  }
  .v372-table th{
    padding:6px 5px!important;
    font-size:7.7px!important;
  }
  .v372-table td{
    padding:6px 5px!important;
    font-size:8.3px!important;
  }
  .v372-summary{
    padding:9px 11px!important;
  }
  .v372-footer>div{
    min-height:100px!important;
    padding:9px 11px!important;
  }
  .v374-contact-strip{
    padding:7px 12px!important;
  }
}

/* Mobile remains readable; preview can scroll horizontally rather than crush A4 */
@media(max-width:900px){
  .v372-paper{
    width:760px!important;
    max-width:none!important;
  }
  .v372-header{
    grid-template-columns:1fr!important;
  }
  .v372-title{
    text-align:left!important;
  }
  .v372-date{
    margin-left:0!important;
  }
  .v372-qr{
    justify-items:start!important;
  }
  .v372-info{
    grid-template-columns:1fr!important;
  }
  .v372-info>div+div{
    border-left:0!important;
    border-top:1px solid var(--v374-green-line)!important;
  }
  .v372-summary{
    grid-template-columns:1fr!important;
  }
  .v372-footer{
    grid-template-columns:1fr!important;
  }
  .v372-footer>div+div{
    border-left:0!important;
    border-top:1px solid var(--v374-green-line)!important;
  }
  .v374-contact-strip{
    grid-template-columns:1fr!important;
  }
  .v374-contact-strip span{
    text-align:left!important;
  }
}
