/* =====================================================================
   Dictamen presupuestal · hoja imprimible (carta / A4)
   ===================================================================== */
@page { size: letter; margin: 14mm 14mm 16mm; }

.print-body { background: #E9EEF3; margin: 0; padding: 24px; font-family: 'Montserrat', system-ui, sans-serif; color: #15212F; }
.print-toolbar { max-width: 820px; margin: 0 auto 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet { max-width: 820px; margin: 0 auto; background: #fff; padding: 34px 38px 30px; border-radius: 8px; box-shadow: 0 10px 30px -12px rgba(21,33,47,.25); position: relative; }

.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 16px; border-bottom: 2px solid #15212F; }
.d-brand { display: flex; align-items: center; gap: 12px; }
.d-brand .brand-mark { width: 44px; height: 44px; }
.d-brand .brand-mark img { width: 100%; height: 100%; display: block; }
.d-company { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: #5F7488; }
.d-title { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; color: #15212F; line-height: 1.1; }
.d-subtitle { font-size: 11.5px; color: #6B7D8F; font-weight: 400; margin-top: 3px; }
.d-folio { text-align: right; }
.d-folio .lbl { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #8296A9; font-weight: 700; }
.d-folio .val { font-size: 20px; font-weight: 800; letter-spacing: .02em; color: #15212F; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-folio .date { font-size: 11.5px; color: #3F4D5C; margin-top: 2px; }

.d-band { margin: 18px 0; border-radius: 14px; padding: 18px 22px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-band.green { background: #1F8A5B; }
.d-band.red { background: #C8353A; }
.d-band.cancel { background: #5F7488; }
.d-band .b-eyebrow { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; opacity: .9; }
.d-band .b-title { font-size: 26px; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.05; margin-top: 4px; }
.d-band .b-sub { font-size: 12px; opacity: .95; margin-top: 6px; font-weight: 400; }
.d-band .b-mark { width: 62px; height: 62px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.d-band .b-mark svg { width: 34px; height: 34px; }

.d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 22px; margin: 16px 0; }
.d-grid .f { min-width: 0; }
.d-grid .f .l { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: #8296A9; font-weight: 700; margin-bottom: 2px; }
.d-grid .f .v { font-size: 13px; font-weight: 600; color: #15212F; word-break: break-word; }
.d-grid .f.span-2 { grid-column: span 2; }
.d-grid .f.span-3 { grid-column: span 3; }
.d-grid .f .v.big { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }

.d-section { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: #D98918; margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; }
.d-section::after { content: ''; flex: 1; height: 1px; background: #DDE4EB; }

.d-check { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid #DDE4EB; border-radius: 12px; overflow: hidden; }
.d-check .c { padding: 10px 12px; border-right: 1px solid #DDE4EB; }
.d-check .c:last-child { border-right: 0; }
.d-check .c .l { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #8296A9; font-weight: 700; }
.d-check .c .v { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: #15212F; margin-top: 3px; }
.d-check .c.hl { background: #15212F; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.d-check .c.hl .l { color: #B4C1CE; }
.d-check .c.hl .v { color: #fff; }
.d-check .c.ok .v { color: #187249; }
.d-check .c.bad .v { color: #A82B2F; }

.d-items { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 4px; }
.d-items th { text-align: left; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #5F7488; padding: 6px 8px; border-bottom: 1px solid #DDE4EB; }
.d-items td { padding: 6px 8px; border-bottom: 1px solid #EDF1F5; }
.d-items .n { text-align: right; font-variant-numeric: tabular-nums; }
.d-items tr.tot td { font-weight: 800; border-top: 2px solid #15212F; border-bottom: 0; }

.d-note { font-size: 10.5px; color: #3F4D5C; line-height: 1.5; background: #F5F7FA; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.d-foot { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: end; margin-top: 26px; padding-top: 16px; border-top: 1px solid #DDE4EB; }
.d-sign .line { width: 240px; border-top: 1.5px solid #15212F; margin-top: 34px; padding-top: 6px; }
.d-sign .n { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.d-sign .t { font-size: 11px; color: #5F7488; }
.d-sign .s { font-size: 10px; color: #8296A9; margin-top: 2px; }
.d-verify { display: flex; align-items: center; gap: 12px; text-align: left; }
.d-verify .qr { width: 86px; height: 86px; padding: 4px; border: 1px solid #DDE4EB; border-radius: 8px; background: #fff; }
.d-verify .qr canvas, .d-verify .qr img { width: 100%; height: 100%; display: block; }
.d-verify .txt { font-size: 10px; color: #5F7488; line-height: 1.45; max-width: 220px; }
.d-verify .txt strong { display: block; font-size: 10.5px; color: #15212F; letter-spacing: .04em; word-break: break-all; }
.d-meta { font-size: 9.5px; color: #8296A9; margin-top: 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.d-stamp { width: 104px; height: 104px; align-self: center; margin-right: 6px; border-radius: 50%; border: 3px solid; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; line-height: 1.3; transform: rotate(-12deg); opacity: .9; padding: 10px; }
.d-stamp.green { color: #1F8A5B; border-color: #1F8A5B; }
.d-stamp.red { color: #C8353A; border-color: #C8353A; }
.d-stamp.cancel { color: #5F7488; border-color: #5F7488; }

@media print {
  .print-body { background: #fff; padding: 0; }
  .print-toolbar, .no-print { display: none !important; }
  .sheet { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
}
@media (max-width: 640px) {
  .sheet { padding: 22px 16px; }
  .d-grid { grid-template-columns: 1fr 1fr; }
  .d-grid .f.span-2, .d-grid .f.span-3 { grid-column: span 2; }
  .d-check { grid-template-columns: 1fr 1fr; }
  .d-check .c { border-bottom: 1px solid #DDE4EB; }
  .d-stamp { display: none; }
  .d-foot { grid-template-columns: 1fr; }
}
