/* Documentos operativos y fiscales: lienzo claro independiente del tema del portal. */
body.portal-integral .billing-document.invoice-layout,
body.portal-integral .order-print-sheet,
body.portal-integral .blu-delivery-note{
  color-scheme:light;
  background:#fff;
  color:#243e4c;
}

@media screen{
  body.portal-integral .billing-document.invoice-layout{
    width:min(100%,210mm);
    margin:0 auto;
    padding:10mm 12mm;
    border:1px solid #d8e1e4;
    box-shadow:0 12px 34px rgba(4,35,47,.14);
  }
}

@page{size:A4 portrait;margin:12mm}

@media print{
  html,body{
    margin:0!important;
    background:#fff!important;
    color-scheme:light!important;
    print-color-adjust:exact;
    -webkit-print-color-adjust:exact;
  }

  body.portal-integral .billing-document.invoice-layout,
  body.portal-integral #orderPrintSheet.order-print-sheet,
  body.portal-integral #bluDeliveryNote.blu-delivery-note{
    position:static!important;
    inset:auto!important;
    display:block!important;
    width:100%!important;
    max-width:none!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    box-shadow:none!important;
    background:#fff!important;
    color:#243e4c!important;
    font-family:Arial,Helvetica,sans-serif!important;
  }

  /* El tema oscuro asigna color a celdas y textos. Este reinicio evita
     contenido blanco sobre papel blanco en cualquier navegador. */
  body.portal-integral .billing-document.invoice-layout *,
  body.portal-integral #orderPrintSheet.order-print-sheet *,
  body.portal-integral #bluDeliveryNote.blu-delivery-note *{
    color:#243e4c!important;
    text-shadow:none!important;
  }

  body.portal-integral .invoice-layout table,
  body.portal-integral .order-print-sheet table,
  body.portal-integral .blu-delivery-note table{
    width:100%!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
    background:#fff!important;
  }

  body.portal-integral .invoice-layout th,
  body.portal-integral .order-print-sheet th,
  body.portal-integral .blu-delivery-note th{
    background:#eaf4f7!important;
    color:#024873!important;
    border-bottom:1px solid #8fb3bd!important;
    font-weight:700!important;
  }

  body.portal-integral .invoice-layout td,
  body.portal-integral .order-print-sheet td,
  body.portal-integral .blu-delivery-note td{
    background:#fff!important;
    color:#243e4c!important;
    border-bottom:1px solid #d6e2e6!important;
    overflow-wrap:anywhere;
  }

  body.portal-integral .invoice-layout tbody tr:nth-child(even) td,
  body.portal-integral .order-print-sheet tbody tr:nth-child(even) td,
  body.portal-integral .blu-delivery-note tbody tr:nth-child(even) td{
    background:#f7fafb!important;
  }

  body.portal-integral .invoice-layout .invoice-head,
  body.portal-integral .order-print-sheet .order-print-head,
  body.portal-integral .blu-delivery-note .blu-note-head{
    background:#fff!important;
    border-bottom:2px solid #0388a6!important;
  }

  body.portal-integral .invoice-layout h2,
  body.portal-integral .order-print-sheet h1,
  body.portal-integral .blu-delivery-note h1,
  body.portal-integral .invoice-layout .invoice-issuer strong,
  body.portal-integral .order-print-sheet .order-print-brand strong,
  body.portal-integral .blu-delivery-note .blu-note-brand strong{
    color:#024873!important;
  }

  body.portal-integral .invoice-layout .invoice-caption,
  body.portal-integral .invoice-layout .invoice-footer,
  body.portal-integral .invoice-layout .invoice-warning,
  body.portal-integral .order-print-sheet .order-print-brand span,
  body.portal-integral .order-print-sheet .order-print-meta span,
  body.portal-integral .order-print-sheet .order-print-caption,
  body.portal-integral .blu-delivery-note .blu-note-brand span,
  body.portal-integral .blu-delivery-note .blu-note-client>span,
  body.portal-integral .blu-delivery-note .blu-note-caption{
    color:#607580!important;
  }

  body.portal-integral .invoice-layout .invoice-meta,
  body.portal-integral .invoice-layout .invoice-totals .grand,
  body.portal-integral .order-print-sheet .order-print-meta>div,
  body.portal-integral .blu-delivery-note .blu-note-client{
    background:#eef7fa!important;
  }

  body.portal-integral .invoice-layout .invoice-notes,
  body.portal-integral .order-print-sheet .order-print-notes{
    background:#f5f9fa!important;
    color:#243e4c!important;
  }

  body.portal-integral .invoice-layout th:nth-child(1){width:13%}
  body.portal-integral .invoice-layout th:nth-child(2){width:45%}
  body.portal-integral .invoice-layout th:nth-child(3){width:10%}
  body.portal-integral .invoice-layout th:nth-child(4){width:15%}
  body.portal-integral .invoice-layout th:nth-child(5){width:17%}

  body.portal-integral .order-print-sheet th:nth-child(1){width:16%}
  body.portal-integral .order-print-sheet th:nth-child(2){width:54%}
  body.portal-integral .order-print-sheet th:nth-child(3),
  body.portal-integral .order-print-sheet th:nth-child(4){width:15%}

  body.portal-integral .blu-delivery-note th:nth-child(1){width:14%}
  body.portal-integral .blu-delivery-note th:nth-child(2){width:42%}
  body.portal-integral .blu-delivery-note th:nth-child(3){width:12%}
  body.portal-integral .blu-delivery-note th:nth-child(4),
  body.portal-integral .blu-delivery-note th:nth-child(5){width:16%}

  body.portal-integral .invoice-layout tr,
  body.portal-integral .order-print-sheet tr,
  body.portal-integral .blu-delivery-note tr,
  body.portal-integral .invoice-layout .invoice-totals,
  body.portal-integral .order-print-sheet .order-print-totals,
  body.portal-integral .blu-delivery-note .blu-note-total{
    break-inside:avoid;
    page-break-inside:avoid;
  }
}

@media screen and (max-width:700px){
  body.portal-integral .billing-document.invoice-layout{
    padding:16px;
    border-radius:10px;
    box-shadow:none;
  }
}
