/* ===== Presupuesto imprimible ===== */
.doc{--ink:#141414;--gris:#6b6b6b;--linea:#d9d9d9;background:#fff;color:var(--ink);width:210mm;max-width:100%;min-height:297mm;margin:0 auto;padding:14mm 15mm 16mm;font:400 9.5pt/1.45 var(--fb),Arial,sans-serif;box-shadow:none;font-variant-numeric:tabular-nums}
.doc h1,.doc h2,.doc h3{font-family:var(--ft),var(--fb),sans-serif;color:#000;margin:0}
.doc p{margin:0}
.doc table{width:100%;border-collapse:collapse}
.doc th,.doc td{padding:0;border:0;text-align:left;vertical-align:top;font-size:inherit;color:inherit;background:none;font-family:inherit;text-transform:none;letter-spacing:normal;font-weight:400;white-space:normal}
.doc .n{text-align:right;white-space:nowrap}.doc .c{text-align:center}
.doc .falta{color:#b36b00;border-bottom:1px dotted #FD9800;font-style:normal}
.d-hd{display:flex;justify-content:space-between;align-items:flex-end;gap:10mm;padding-bottom:4mm;border-bottom:1.5pt solid #000}
.d-logo{height:15mm;display:block;margin-bottom:4mm}
.d-datos{font-size:8.5pt;line-height:1.5;color:#333}
.d-datos b{color:#000;font-weight:700}
.d-tit{text-align:right;min-width:58mm}
.d-tit h1{font-size:19pt;font-weight:600;letter-spacing:-.01em;line-height:1;margin-bottom:3mm}
.doc .d-meta{width:auto;margin-left:auto;font-size:9pt}
.doc .d-meta th{color:var(--gris);font-weight:400;padding:.6mm 4mm .6mm 0;text-align:right}
.doc .d-meta td{font-weight:700;text-align:right;padding:.6mm 0}
.d-partes{display:grid;grid-template-columns:1fr 1fr;gap:10mm;margin:5mm 0 0}
.d-partes h3,.d-sec h2{font-size:8pt;font-weight:600;text-transform:uppercase;letter-spacing:.09em}
.d-partes h3{padding-bottom:1.5mm;margin-bottom:1.5mm;border-bottom:.5pt solid var(--linea)}
.doc .d-kv th{width:24mm;color:var(--gris);font-weight:400;padding:.5mm 0}
.doc .d-kv td{padding:.5mm 0}
.d-sec{margin-top:3.6mm}
.d-sec h2{display:flex;align-items:baseline;gap:2.5mm;margin-bottom:2.5mm}
.d-sec h2 i{font-style:normal;color:var(--gris);font-weight:400}
.doc .d-items thead th{font-size:7.5pt;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--gris);padding:0 2mm 1.8mm;border-bottom:1pt solid #000}
.doc .d-items td{padding:1.4mm 2mm;border-bottom:.5pt solid var(--linea)}
.doc .d-items th:first-child,.doc .d-items td:first-child{padding-left:0;width:9mm}
.doc .d-items th:last-child,.doc .d-items td:last-child{padding-right:0}
.doc .d-items td:nth-child(3){width:12mm}.doc .d-items td:nth-child(4){width:12mm}.doc .d-items td:nth-child(5),.doc .d-items td:nth-child(6){width:28mm}
.d-totwrap{display:flex;justify-content:space-between;align-items:flex-start;gap:8mm;margin-top:3mm;break-inside:avoid}
.d-letras{flex:1;font-size:8.5pt;color:#444;padding-top:1.5mm}
.d-letras::first-letter{text-transform:uppercase}
.doc .d-tot{width:72mm;flex:none}
.doc .d-tot th{font-weight:400;color:#333;padding:1.2mm 3mm}
.doc .d-tot td{text-align:right;padding:1.2mm 3mm;white-space:nowrap}
.doc .d-tot tr.g th,.doc .d-tot tr.g td{background:#000;color:#fff;font:600 11pt var(--ft),sans-serif;padding:2.4mm 3mm;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.doc .d-tot tr.g td{color:#0FFFBE}
.doc .d-pago{width:100%}
.doc .d-pago td{padding:1.2mm 0;border-bottom:.5pt solid var(--linea)}
.doc .d-pago td.n{padding-left:12mm;font-weight:700}
.d-nota{font-size:8.5pt;color:var(--gris);margin-top:2mm}
.d-2col{display:grid;grid-template-columns:1fr 1fr;gap:10mm}
.doc ul{margin:0;padding:0;list-style:none}
.doc li{position:relative;padding-left:4mm;margin-bottom:1.2mm;font-size:8.8pt}
.doc li::before{content:"";position:absolute;left:0;top:.62em;width:1.6mm;height:.5mm;background:#000}
.d-firmas{display:grid;grid-template-columns:1fr 1fr;gap:16mm;margin-top:3mm;break-inside:avoid}
.d-firmas .lin{border-top:.75pt solid #000;margin-bottom:1.8mm}
.d-firmas b{display:block;font-size:9pt}
.d-firmas span{font-size:8pt;color:var(--gris)}
.d-partes,.d-items tr,.d-2col>div,.d-pagosec,.d-alc{break-inside:avoid}
.d-sec h2{break-after:avoid}
.d-items thead{display:table-header-group}
@media screen and (max-width:820px){.doc{width:auto;min-height:0;padding:8mm 6mm}.d-hd,.d-totwrap{flex-direction:column;align-items:stretch}.d-tit{text-align:left}.d-meta{margin-left:0}.d-partes,.d-2col{grid-template-columns:1fr;gap:5mm}.d-tot{width:100%}.d-pago{min-width:0;width:100%}.doc .d-items{font-size:8pt}.doc .d-items thead th{font-size:6.5pt;letter-spacing:.02em}.doc .d-items td,.doc .d-items th{padding-left:.8mm;padding-right:.8mm}.doc .d-items td:nth-child(n+3){width:auto}.doc .d-items th:first-child,.doc .d-items td:first-child{width:5mm}.doc .d-items td:nth-child(2){overflow-wrap:anywhere}}
@media print{
  @page{size:A4;margin:13mm 15mm 14mm}
  html,body{background:#fff}
  .no-print,.top,.tabs,.toast{display:none!important}
  main{padding:0;margin:0;max-width:none}
  .doc{width:auto;min-height:0;padding:0;box-shadow:none}
}
/* firma */
.d-fimg{height:13mm;display:flex;align-items:flex-end;justify-content:flex-start}
.d-fimg img{max-height:13mm;max-width:62mm;display:block}
.d-firmas .d-fdat{display:block;line-height:1.45}
.d-felec{margin-top:2.5mm;font-size:7.2pt;color:var(--gris);border-top:.5pt solid var(--linea);padding-top:1.4mm;break-inside:avoid}
/* versión firmada: un poco más compacta para que entre la firma en la misma hoja */
.doc.firmado .d-logo{height:12mm;margin-bottom:2.5mm}
.doc.firmado .d-hd{padding-bottom:3mm}
.doc.firmado .d-partes{margin-top:4mm}
.doc.firmado .d-sec{margin-top:2.3mm}
.doc.firmado .d-items td{padding-top:1.1mm;padding-bottom:1.1mm}
.doc.firmado li{margin-bottom:.8mm}
.doc.firmado .d-firmas{margin-top:2mm}

/* ===== Presupuesto: release B (sobrio) ===== */
.doc{box-shadow:none;border:1px solid #d9d9d9;font-variant-numeric:tabular-nums lining-nums}
.d-tit h1{font-family:"Barlow Condensed",var(--ft),sans-serif;font-weight:600;font-size:22pt;letter-spacing:0;text-transform:uppercase}
.d-partes h3,.d-sec h2,.doc .d-items thead th{font-family:"Barlow Condensed",var(--ft),sans-serif;letter-spacing:.08em}
.doc .d-tot tr.g th,.doc .d-tot tr.g td{font-family:"Barlow Condensed",var(--ft),sans-serif;font-size:12.5pt}
.doc .d-tot tr.g td{color:#fff}
.doc .falta{color:#7A5600;border-bottom-color:#E0A100}
/* En pantalla nada baja de 13 px; el papel conserva la escala de impresión */
@media screen{
  .doc{font-size:10pt}
  .d-datos,.d-letras,.d-nota,.doc li,.d-firmas span,.d-felec,.doc .d-meta,.d-firmas b,.d-partes h3,.d-sec h2,.doc .d-items thead th,.doc th,.doc td{font-size:9.75pt}
  .d-tit h1{font-size:24pt}
}
@media screen and (max-width:820px){
  .doc .d-items td:nth-child(3),.doc .d-items td:nth-child(4),.doc .d-items td:nth-child(5),.doc .d-items td:nth-child(6){width:auto}
  .doc .d-items th,.doc .d-items td{padding-left:1mm;padding-right:1mm}
  .doc .d-items th:first-child,.doc .d-items td:first-child{width:6mm}
  .doc .d-items thead th{letter-spacing:.02em}
}
@media screen and (max-width:420px){
  .doc{padding-left:12px!important;padding-right:12px!important}
  .doc .d-items{width:100%}
}
@media screen and (max-width:380px){
  .doc{padding-left:8px!important;padding-right:8px!important;margin-left:-8px!important;margin-right:-8px!important}
  .doc .d-items thead th{letter-spacing:0}
  .doc .d-items th,.doc .d-items td{padding-left:.5mm;padding-right:.5mm}
}

.d-logo{max-width:62mm;object-fit:contain;object-position:left center}
