/*
 * T147 (ADR-0133) · La hoja de la factura, diseño 1A «Clara con acento violeta» (lienzo «Facturas estellés — 5 diseños»,
 * elegido por Fran el 18/11/2026). La misma hoja en la app (vista e «Imprimir o guardar en PDF») y en el PDF que genera
 * el servicio con Edge (correo, portal del cliente, Abria): un solo diseño.
 * Letras del diseño, incluidas: Inter y Syne (SIL Open Font License 1.1, autorizadas por Fran el 19/11/2026; licencias en
 * fonts/OFL-*.txt). Con un nombre propio («Fabria Inter», «Fabria Syne») para no depender de las que haya instaladas.
 */
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 400; font-display: block; src: url("fonts/inter-latin-ext-400.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 400; font-display: block; src: url("fonts/inter-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 500; font-display: block; src: url("fonts/inter-latin-ext-500.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 500; font-display: block; src: url("fonts/inter-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 600; font-display: block; src: url("fonts/inter-latin-ext-600.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 600; font-display: block; src: url("fonts/inter-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 700; font-display: block; src: url("fonts/inter-latin-ext-700.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Fabria Inter"; font-style: normal; font-weight: 700; font-display: block; src: url("fonts/inter-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fabria Syne"; font-style: normal; font-weight: 700; font-display: block; src: url("fonts/syne-latin-ext-700.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Fabria Syne"; font-style: normal; font-weight: 700; font-display: block; src: url("fonts/syne-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* La hoja: siempre papel blanco, también con el tema oscuro. 794 px = A4 a 96 ppp. */
.inv-1a { --iv: #6a4bdc; --iv-ink: #3a2591; --iv-tint: #efeafe; --iv-soft: #f6f3ff; --iv-line: #e8e3f8; --ink: #16151d; --ink-2: #4a4858; --ink-3: #625f72;
  position: relative; width: 100%; max-width: 794px; min-height: 1123px; margin: 0 auto; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: var(--ink); font-family: "Fabria Inter", "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums;
  border-radius: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / 12%), 0 18px 40px -24px rgb(0 0 0 / 35%); }
.inv-1a p, .inv-1a h1, .inv-1a dl, .inv-1a dd, .inv-1a figure { margin: 0; }
.inv-strip { height: 8px; flex: none; background: var(--iv); }
.inv-body { position: relative; flex: 1; min-height: 0; padding: 46px 64px 42px; display: flex; flex-direction: column; gap: 24px; }
.inv-watermark { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); font-size: 110px; font-weight: 800; letter-spacing: .08em; color: var(--iv); opacity: .07; pointer-events: none; user-select: none; white-space: nowrap; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
.inv-issuer { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.inv-wordmark { display: flex; align-items: baseline; font-family: "Fabria Syne", "Syne", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; font-weight: 700; font-size: 50px; letter-spacing: -.03em; line-height: 1; padding-top: 10px; color: var(--ink); }
.inv-e { position: relative; display: inline-block; }
.inv-e svg { position: absolute; left: 50%; top: -9px; width: 19px; height: 19px; transform: translateX(-22%); }
.inv-small { font-size: 12px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.inv-small strong { color: var(--ink); font-weight: 600; }
.inv-qr { width: 170px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.inv-qr figcaption { font-size: 12px; line-height: 1.35; text-align: center; color: var(--ink-2); }
.inv-qr figcaption strong { color: var(--ink); letter-spacing: .04em; }
/* El código a 31 mm (VeriFactu: 30–40 mm). Su margen blanco (4 módulos, unos 11 px) es la propia hoja: 26 px a los lados,
   46 px arriba y unos 13 px hasta la primera letra de la leyenda. */
.inv-qr-svg { width: 31mm; height: 31mm; display: block; }
.inv-title { display: flex; flex-direction: column; gap: 16px; }
.inv-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--iv); padding-bottom: 12px; }
.inv-title h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.inv-code { padding: 6px 14px; border-radius: 999px; background: var(--iv-tint); color: var(--iv-ink); font-size: 16px; font-weight: 700; white-space: nowrap; }
.inv-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.inv-meta span, .inv-label { display: block; font-size: 12px; color: var(--ink-3); }
.inv-meta strong { font-weight: 600; }
.inv-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.inv-parties p { margin-top: 2px; line-height: 1.6; overflow-wrap: anywhere; }
.inv-parties p strong { font-size: 15px; font-weight: 600; }
.inv-notes { white-space: pre-wrap; color: var(--ink-2); }
.inv-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-lines thead tr { background: var(--iv-tint); }
.inv-lines th { text-align: right; font-size: 12px; font-weight: 600; color: var(--iv-ink); padding: 10px 0 10px 8px; white-space: nowrap; }
.inv-lines th:first-child { text-align: left; padding: 10px 16px 10px 12px; }
.inv-lines th:last-child, .inv-lines td:last-child { padding-right: 12px; }
.inv-lines td { text-align: right; vertical-align: top; padding: 12px 0 12px 8px; border-bottom: 1px solid var(--iv-line); white-space: nowrap; }
.inv-lines td:first-child { text-align: left; padding: 12px 16px 12px 12px; white-space: normal; overflow-wrap: anywhere; }
.inv-lines td strong { font-weight: 600; }
/* Anchos del diseño 1A (con el margen): Cant. 50 px, Precio 110 px, IVA 64 px (solo con varios tipos) e Importe 132 px. */
.inv-lines .inv-c-qty { width: 42px; }
.inv-lines .inv-c-price { width: 102px; }
.inv-lines .inv-c-vat { width: 56px; }
.inv-lines .inv-c-amount { width: 112px; }
.inv-lines td span { color: var(--ink-2); }
.inv-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.inv-totals > * { width: 320px; }
.inv-totals dl { padding: 0 20px; display: grid; gap: 8px; box-sizing: border-box; }
.inv-total-row { display: flex; justify-content: space-between; gap: 24px; }
.inv-total-row dt { color: var(--ink-2); }
.inv-rectifies { margin: -8px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--iv-soft); color: var(--ink-2); font-size: 12.5px; }
.inv-irpf { padding: 8px 20px 0; display: grid; gap: 8px; box-sizing: border-box; border-top: 1px solid var(--iv-line); }
.inv-total { box-sizing: border-box; background: var(--iv); color: #fff; border-radius: 16px; padding: 16px 20px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.inv-total span { font-size: 14px; font-weight: 600; }
.inv-total strong { font-size: 28px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.inv-pay { margin-top: auto; background: var(--iv-soft); border-radius: 14px; padding: 16px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.inv-pay span { display: block; font-size: 12px; color: #5d5578; }
.inv-pay strong { font-weight: 600; overflow-wrap: anywhere; }
.inv-foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-top: 1px solid var(--iv-line); padding-top: 14px; font-size: 12px; color: var(--ink-3); }
.inv-fabria { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.inv-fabria strong { color: var(--ink); font-weight: 600; }
/* Vista previa estrecha (móvil o panel lateral): la misma hoja, más compacta. */
@container (max-width: 640px) {
  .inv-1a { min-height: 0; font-size: 12px; }
  .inv-body { padding: 26px 20px 22px; gap: 18px; }
  .inv-head { flex-direction: column-reverse; gap: 16px; }
  .inv-qr { flex-direction: row; width: auto; align-items: center; gap: 12px; }
  .inv-qr figcaption { text-align: left; }
  .inv-wordmark { font-size: 38px; }
  .inv-title h1 { font-size: 24px; }
  .inv-code { font-size: 14px; }
  .inv-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-parties { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .inv-lines .inv-c-vat { display: none; }
  .inv-lines :is(.inv-c-qty, .inv-c-price, .inv-c-amount) { width: auto; }
  .inv-lines td, .inv-lines th { padding-left: 8px; }
  .inv-lines td:first-child, .inv-lines th:first-child { padding-left: 8px; padding-right: 8px; }
  .inv-totals > * { width: 100%; }
  .inv-total strong { font-size: 22px; }
  .inv-pay { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; margin-top: 8px; }
  .inv-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .inv-watermark { font-size: 64px; }
}
/* Muy estrecha (teléfono): cada concepto ocupa todo el ancho y sus cifras van debajo, con su nombre («Cant.», «Precio»,
   «Importe»); la cabecera queda solo para lectores de pantalla. Al imprimir y en el PDF no aplica (hoja A4 completa). */
@container (max-width: 480px) {
  .inv-lines, .inv-lines tbody { display: block; }
  .inv-lines thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .inv-lines tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 10px 8px; border-bottom: 1px solid var(--iv-line); }
  .inv-lines td, .inv-lines td:first-child, .inv-lines td:last-child { display: block; width: auto; padding: 0; border: 0; text-align: left; }
  .inv-lines td:first-child { flex: 1 0 100%; padding-bottom: 4px; }
  .inv-lines .inv-c-vat { display: block; }
  .inv-lines td[data-label]::before { content: attr(data-label) " "; font-size: 11px; font-weight: 400; color: var(--ink-3); }
  .inv-lines .inv-c-amount { margin-left: auto; font-weight: 600; }
}
