/* ZenCaps — documento de faturamento institucional.
   Apenas apresentação: os valores continuam sendo calculados em invoiceMarkup().
   A prévia e a impressão compartilham o HTML, mas possuem regras específicas. */
@media screen {
  .modal-layer .invoice-view-modal .invoice-preview {
    --invoice-ink:#173825;
    --invoice-accent:#07984d;
    --invoice-soft:#f3f9f5;
    --invoice-border:#dceae0;
    background:#fff;
    color:var(--invoice-ink);
    border:1px solid #dce9df;
    border-radius:16px;
    padding:28px 30px 24px;
  }
  .modal-layer .invoice-view-modal .invoice-top {
    padding-bottom:23px;
    border-bottom:3px solid #d3ead9;
    gap:22px;
    align-items:center;
  }
  .modal-layer .invoice-view-modal .invoice-brand {gap:17px;min-width:0}
  .modal-layer .invoice-view-modal .invoice-brand img {
    width:76px;height:76px;object-fit:contain;flex:none;
  }
  .modal-layer .invoice-view-modal .invoice-brand b {
    font-size:30px;line-height:1.08;font-weight:850;letter-spacing:-1.25px;
  }
  .modal-layer .invoice-view-modal .invoice-brand>div>span {
    margin-top:5px;font-size:12.5px;line-height:1.3;color:#52715e;font-weight:600;
  }
  .modal-layer .invoice-view-modal .invoice-number {
    min-width:185px;color:var(--invoice-ink);
  }
  .modal-layer .invoice-view-modal .invoice-number>small:first-child {
    color:#54715d;font-size:10px;font-weight:750;letter-spacing:.065em;
  }
  .modal-layer .invoice-view-modal .invoice-number strong {
    margin-top:5px;font-size:21px;line-height:1.18;letter-spacing:-.55px;
  }
  .modal-layer .invoice-view-modal .invoice-number>small:not(:first-child) {
    font-size:11px;line-height:1.55;color:#667f6b;
  }
  .modal-layer .invoice-view-modal .invoice-status-stamp {
    margin:9px 0 6px;padding:5px 12px;font-size:11px;
  }
  .modal-layer .invoice-view-modal .invoice-meta {
    margin:18px 0 24px;padding:0;border:0;gap:10px;
    grid-template-columns:minmax(0,1.2fr) minmax(0,1.12fr) minmax(0,.88fr);
  }
  .modal-layer .invoice-view-modal .invoice-meta>div {
    padding:15px 14px;background:#f6faf7;
    border:1px solid var(--invoice-border);border-radius:11px;min-width:0;
  }
  .modal-layer .invoice-view-modal .invoice-meta small {
    font-size:10.5px;font-weight:750;letter-spacing:.055em;color:#627b69;
  }
  .modal-layer .invoice-view-modal .invoice-meta b {
    font-size:14px;line-height:1.4;color:var(--invoice-ink);
  }
  .modal-layer .invoice-view-modal .invoice-representative {
    font-size:11.5px;line-height:1.4;color:#53715f;
  }
  .modal-layer .invoice-view-modal .invoice-representative b {
    font-size:11.5px;color:#376047;
  }
  .modal-layer .invoice-view-modal .invoice-section-title {
    margin:23px 0 11px;align-items:center;
  }
  .modal-layer .invoice-view-modal .invoice-section-title h3 {
    font-size:15px;line-height:1.3;letter-spacing:-.15px;color:var(--invoice-ink);
  }
  .modal-layer .invoice-view-modal .invoice-section-title span {
    font-size:11px;color:#64816d;
  }
  .modal-layer .invoice-view-modal .invoice-table {
    border:1px solid #e3eee6;border-radius:9px;
    border-collapse:separate;border-spacing:0;overflow:hidden;
  }
  .modal-layer .invoice-view-modal .invoice-table th {
    background:#e9f5ec;color:#42694f;font-size:10.5px;letter-spacing:.055em;
    font-weight:800;padding:12px 13px;
  }
  .modal-layer .invoice-view-modal .invoice-table td {
    font-size:12px;line-height:1.4;padding:11px 13px;
  }
  .modal-layer .invoice-view-modal .invoice-credit-summary {
    display:grid;gap:6px;max-width:460px;
    margin:16px 0 16px auto;padding:14px 16px;
    background:#f7faf8;border:1px solid #e2ece4;border-radius:11px;
    text-align:right;font-size:11.5px;line-height:1.4;
  }
  .modal-layer .invoice-view-modal .invoice-credit-section {
    margin-top:18px;
  }
  .modal-layer .invoice-view-modal .invoice-credit-section h3 {
    font-size:14px;line-height:1.4;margin:0 0 9px;
  }
  .modal-layer .invoice-view-modal .invoice-financial-summary {
    margin:22px 0 17px;padding:19px 22px;
    background:linear-gradient(125deg,#f0f9f3,#f9fdf9);
    border:1px solid #cfe8d6;border-radius:13px;
  }
  .modal-layer .invoice-view-modal .invoice-financial-summary h3 {
    margin:0 0 14px;font-size:14px;font-weight:800;
  }
  .modal-layer .invoice-view-modal .invoice-financial-breakdown {
    gap:10px 23px;
  }
  .modal-layer .invoice-view-modal .invoice-financial-breakdown>div {
    font-size:12px;line-height:1.45;
  }
  .modal-layer .invoice-view-modal .invoice-total {
    margin-top:17px;padding-top:16px;border-top:2px solid #168c50;gap:12px;
  }
  .modal-layer .invoice-view-modal .invoice-total strong {
    font-size:12px;line-height:1.35;letter-spacing:.02em;
  }
  .modal-layer .invoice-view-modal .invoice-total b {
    font-size:30px;line-height:1.15;letter-spacing:-.6px;color:#058545;
  }
  .modal-layer .invoice-view-modal .payment-box {
    margin-top:18px;padding:20px 22px;
    background:#f4faf6;border:1px solid #d4e9db;
    border-left:4px solid #159553;border-radius:12px;
  }
  .modal-layer .invoice-view-modal .invoice-payment-title {
    display:flex;align-items:center;justify-content:space-between;
    gap:14px;margin-bottom:13px;
    font-size:11px;font-weight:800;letter-spacing:.065em;color:#457454;
  }
  .modal-layer .invoice-view-modal .invoice-payment-title span:last-child {
    color:#71917a;font-size:10px;
  }
  .modal-layer .invoice-view-modal .payment-box b {
    font-size:14px;line-height:1.55;color:#1c412a;
    overflow-wrap:anywhere;
  }
  .modal-layer .invoice-view-modal .payment-box .invoice-payment-note {
    margin:15px 0 0;padding-top:12px;
    border-top:1px solid #d7e8dd;font-size:14px;
    font-weight:750;line-height:1.5;color:#147541;overflow-wrap:anywhere;
  }
  .modal-layer .invoice-view-modal .invoice-order-heading {
    margin-top:25px;
  }
  .modal-layer .invoice-view-modal .detail-table th {
    background:#edf5ef;color:#52715b;font-size:10px;
  }
  .modal-layer .invoice-view-modal .detail-table td {
    font-size:11.25px;line-height:1.5;color:#294635;
  }
  .modal-layer .invoice-view-modal .invoice-document-footer {
    margin-top:23px;padding-top:13px;
    border-top:1px solid #d6e6db;font-size:10.5px;color:#66826e;
  }
}
@media screen and (max-width:740px) {
  .modal-layer .invoice-view-modal .invoice-preview {padding:16px 12px 20px}
  .modal-layer .invoice-view-modal .invoice-top {align-items:flex-start;gap:12px}
  .modal-layer .invoice-view-modal .invoice-brand img {width:50px;height:50px}
  .modal-layer .invoice-view-modal .invoice-brand b {font-size:23px}
  .modal-layer .invoice-view-modal .invoice-number {min-width:0}
  .modal-layer .invoice-view-modal .invoice-number strong {font-size:17px}
  .modal-layer .invoice-view-modal .invoice-meta {grid-template-columns:1fr;gap:7px}
  .modal-layer .invoice-view-modal .invoice-meta>div {padding:10px 12px}
  .modal-layer .invoice-view-modal .invoice-financial-summary {padding:15px}
  .modal-layer .invoice-view-modal .invoice-total b {font-size:25px}
  .modal-layer .invoice-view-modal .payment-box {padding:15px}
  .modal-layer .invoice-view-modal .invoice-payment-title {flex-wrap:wrap}
}

/* PDF A4 / impressão do navegador — mais presença de marca sem inviabilizar
   a paginação da lista longa ou a repetição dos cabeçalhos de tabela. */
@media print {
  #print-root .invoice-preview {
    color:#193525!important;background:#fff!important;
    font-family:Arial,Helvetica,sans-serif;
    font-size:9px;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
  #print-root .invoice-top {
    padding:0 0 14px;
    border-bottom:3px solid #cde6d3;
    align-items:center;gap:17px;
    break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-brand {gap:13px}
  #print-root .invoice-brand img {width:70px;height:70px;object-fit:contain}
  #print-root .invoice-brand b {
    font-size:26px;line-height:1.1;font-weight:800;letter-spacing:-1px;color:#183926;
  }
  #print-root .invoice-brand>div>span {
    font-size:11px;line-height:1.25;margin-top:4px;color:#5a7661;
  }
  #print-root .invoice-number>small:first-child {
    font-size:9px;letter-spacing:.055em;font-weight:700;color:#557360;
  }
  #print-root .invoice-number strong {
    font-size:19px;line-height:1.15;letter-spacing:-.5px;color:#183926;
  }
  #print-root .invoice-number>small:not(:first-child) {
    font-size:9px;line-height:1.4;color:#557360;
  }
  #print-root .invoice-status-stamp {margin:5px 0 4px;padding:3px 9px}
  #print-root .invoice-meta {
    display:grid;grid-template-columns:1.2fr 1.15fr .85fr;
    gap:8px;margin:12px 0 16px;padding:0;
    border:0;break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-meta>div {
    padding:10px 10px 9px;min-width:0;background:#f4f9f5;
    border:1px solid #e1ece3;border-radius:6px;
  }
  #print-root .invoice-meta small {
    font-size:8.5px;font-weight:750;color:#54725d;letter-spacing:.04em;
  }
  #print-root .invoice-meta b {
    font-size:11.5px;line-height:1.35;color:#183926;
  }
  #print-root .invoice-representative {
    font-size:8.7px;line-height:1.35;color:#52735d;
  }
  #print-root .invoice-representative b {font-size:8.7px}
  #print-root .invoice-section-title {margin:14px 0 7px}
  #print-root .invoice-section-title h3 {
    font-size:12px;line-height:1.25;color:#1a3927;
  }
  #print-root .invoice-section-title span {font-size:8.5px}
  #print-root .invoice-table th {
    background:#eaf4ec!important;color:#476b52;
    font-size:9px;padding:8px 7px;letter-spacing:.045em;
  }
  #print-root .invoice-table td {
    padding:7px 7px;font-size:10px;line-height:1.35;
  }
  #print-root .invoice-credit-summary {
    max-width:360px;margin:10px 0 13px auto;
    padding:8px 11px;display:grid;gap:4px;
    text-align:right;background:#f7faf8;
    border:1px solid #e0eae2;border-radius:6px;
    font-size:9px;line-height:1.35;
    break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-credit-section {margin-top:12px}
  #print-root .invoice-credit-section h3 {
    font-size:11.5px;line-height:1.3;margin:0 0 7px;
  }
  #print-root .invoice-financial-summary {
    margin:15px 0 12px;padding:13px 15px;
    border:1px solid #d3e8d8;border-radius:8px;background:#f0f9f3;
    break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-financial-summary h3 {
    font-size:12px;line-height:1.3;margin-bottom:10px;
  }
  #print-root .invoice-financial-breakdown {
    gap:7px 18px;
  }
  #print-root .invoice-financial-breakdown>div {font-size:10px;line-height:1.35}
  #print-root .invoice-total {
    margin:12px 0 0;padding:10px 0 0;
    border-top:2px solid #16844b;
  }
  #print-root .invoice-total strong {font-size:10.5px;letter-spacing:.02em}
  #print-root .invoice-total b {
    font-size:25px;line-height:1.1;color:#08793f;
  }
  #print-root .payment-box {
    margin:12px 0 0;padding:13px 15px;
    border:1px solid #d3e6da;border-left:3px solid #1b9152;
    border-radius:7px;background:#f4faf6;
    break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-payment-title {
    display:flex;align-items:center;justify-content:space-between;
    gap:10px;margin-bottom:8px;color:#466e52;
    font-size:9px;font-weight:800;letter-spacing:.06em;
  }
  #print-root .invoice-payment-title span:last-child {font-size:8.5px;color:#60856b}
  #print-root .payment-box b {
    font-size:11.5px;line-height:1.4;color:#1b3c29;overflow-wrap:anywhere;
  }
  #print-root .payment-box .invoice-payment-note {
    margin:9px 0 0;padding-top:7px;
    border-top:1px solid #d7e6da;
    font-size:11.5px;line-height:1.35;font-weight:700;
    color:#14763f;overflow-wrap:anywhere;
  }
  #print-root .invoice-order-heading {margin-top:15px}
  #print-root .invoice-detail-running-head th {
    background:#e5f2e9!important;color:#2e5c3b;
    font-size:8.5px;line-height:1.4;padding:7px 6px;
    white-space:normal!important;
  }
  #print-root .detail-table thead {display:table-header-group}
  #print-root .detail-table tr {break-inside:avoid;page-break-inside:avoid}
  #print-root .detail-table td {
    font-size:8.5px;line-height:1.32;padding:7px 5px;
  }
  #print-root .invoice-document-footer {font-size:8.5px;color:#657d6b}
}


/* v2 | Reprodução estrutural do mockup aprovado, sem alterar conteúdo financeiro.
   Esta camada vem depois de v1 para corrigir a divergência visual entre
   layout gerado e impressão real. */
@media screen {
  .modal-layer .invoice-view-modal .invoice-preview {
    color:#183526;
    background:#fff;
    padding:18px 20px 22px;
  }
  .modal-layer .invoice-view-modal .invoice-hero,
  .invoice-preview .invoice-hero {
    position:relative;
    isolation:isolate;
    display:flex;
    align-items:center;
    min-height:112px;
    padding:14px 19px 19px;
    overflow:hidden;
    background:#fff;
    border-bottom:3px solid #d4eadb;
  }
  .modal-layer .invoice-view-modal .invoice-hero .invoice-brand {
    position:relative;z-index:2;
    flex:none;align-items:center;gap:15px;
  }
  .modal-layer .invoice-view-modal .invoice-hero .invoice-brand img {
    width:82px;height:82px;object-fit:contain;
  }
  .modal-layer .invoice-view-modal .invoice-hero .invoice-brand b {
    display:block;font-size:38px;letter-spacing:-1.75px;
    line-height:1.05;font-weight:850;color:#232b27;
  }
  .modal-layer .invoice-view-modal .invoice-hero .invoice-brand>div>span {
    display:block;margin-top:3px;
    color:#79857b;font-size:17px;letter-spacing:.025em;font-weight:500;
  }
  .modal-layer .invoice-view-modal .invoice-hero-slogan {
    position:relative;z-index:2;margin-left:28px;padding-left:19px;
    border-left:1px solid #c6dfce;
    font-size:13px;line-height:1.22;color:#66756c;
    max-width:145px;
  }
  .modal-layer .invoice-view-modal .invoice-hero-slogan em {font-weight:650}
  .modal-layer .invoice-view-modal .invoice-hero-art {
    position:absolute;right:-34px;top:-30px;
    width:34%;height:150px;z-index:0;
    border-radius:3% 0 0 100%;
    background:linear-gradient(145deg,#d5efd9 0%,#95d5a6 36%,#0f9c59 100%);
    transform:rotate(-4deg);
    pointer-events:none;
  }
  .modal-layer .invoice-view-modal .invoice-hero-art::after {
    content:"";position:absolute;inset:22px -13px -28px 30%;
    border-radius:10% 0 0 100%;background:linear-gradient(135deg,#6cba80,#007c43);
  }
  .modal-layer .invoice-view-modal .invoice-identification {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(195px,245px);
    margin:14px 0 17px;
    border:1px solid #e0ede4;border-radius:13px;
    background:linear-gradient(115deg,#f0f8f3,#f9fcfa);
    overflow:hidden;gap:0;
  }
  .modal-layer .invoice-view-modal .invoice-meta {
    grid-column:1;grid-row:1;
    display:grid;grid-template-columns:1.26fr 1.18fr .92fr;
    padding:17px 12px;margin:0;gap:0;
    border:0;background:transparent;
    align-items:stretch;
  }
  .modal-layer .invoice-view-modal .invoice-meta-cell {
    display:flex;align-items:flex-start;gap:9px;
    padding:10px 12px;min-width:0;
    background:transparent;border:0;border-radius:0;
    border-right:1px solid #d9e6dd;
  }
  .modal-layer .invoice-view-modal .invoice-meta-cell:last-child{border-right:0}
  .modal-layer .invoice-view-modal .invoice-meta-icon {
    flex:none;color:#09834c;margin-top:3px;
  }
  .modal-layer .invoice-view-modal .invoice-meta-data{min-width:0}
  .modal-layer .invoice-view-modal .invoice-meta small {
    font-size:10px;letter-spacing:.035em;font-weight:750;color:#61776a;
  }
  .modal-layer .invoice-view-modal .invoice-meta b {
    font-size:13px;line-height:1.36;color:#132d20;
  }
  .modal-layer .invoice-view-modal .invoice-representative {
    font-size:11px;margin-top:3px;line-height:1.35;color:#476953;
  }
  .modal-layer .invoice-view-modal .invoice-representative b {font-size:11px}
  .modal-layer .invoice-view-modal .invoice-number {
    grid-column:2;grid-row:1;
    display:flex;flex-direction:column;align-items:flex-end;
    justify-content:center;min-width:0;text-align:right;
    margin:0;padding:12px 17px;
    background:#fff;border-left:1px solid #e1e9e3;
  }
  .modal-layer .invoice-view-modal .invoice-number>small:first-child {
    color:#607264;font-size:10px;line-height:1.3;letter-spacing:0;
  }
  .modal-layer .invoice-view-modal .invoice-number strong {
    font-size:23px;line-height:1.1;letter-spacing:-.45px;
    margin:6px 0;color:#19472e;
  }
  .modal-layer .invoice-view-modal .invoice-number .invoice-status-stamp {
    margin:2px 0 6px;border-radius:7px;font-size:11px;
  }
  .modal-layer .invoice-view-modal .invoice-chapter {
    border:1px solid #dbe9df;
    border-radius:12px;background:#fff;
    padding:17px 19px;margin:14px 0;box-sizing:border-box;
  }
  .modal-layer .invoice-view-modal .invoice-chapter-charges {
    padding-bottom:20px;margin-top:15px;
  }
  .modal-layer .invoice-view-modal .invoice-section-title {
    display:flex;align-items:center;justify-content:space-between;
    margin:1px 0 12px;gap:14px;
  }
  .modal-layer .invoice-view-modal .invoice-section-title h3,
  .modal-layer .invoice-view-modal .invoice-financial-summary h3 {
    display:flex;align-items:center;gap:10px;
    margin:0;font-size:16px;font-weight:800;
    color:#162e22;line-height:1.4;
  }
  .modal-layer .invoice-view-modal .invoice-section-title h3 svg,
  .modal-layer .invoice-view-modal .invoice-financial-summary h3 svg {
    color:#00844a;flex:none;
  }
  .modal-layer .invoice-view-modal .invoice-section-title span {
    font-size:10.5px;letter-spacing:0;
  }
  .modal-layer .invoice-view-modal .invoice-section-title h3 span{
    font-size:inherit;color:inherit;
  }
  .modal-layer .invoice-view-modal .invoice-chapter-charges .invoice-table,
  .modal-layer .invoice-view-modal .invoice-credit-section .invoice-table {
    border:0;border-radius:0;overflow:visible;
    width:100%;border-collapse:collapse;
  }
  .modal-layer .invoice-view-modal .invoice-table th {
    padding:10px 12px;font-size:11px;letter-spacing:.045em;
    background:#e6f3ea;color:#4f705b;
  }
  .modal-layer .invoice-view-modal .invoice-table td {
    padding:11px 12px;font-size:12px;line-height:1.4;
  }
  .modal-layer .invoice-view-modal .invoice-credit-summary {
    display:grid;gap:6px;
    max-width:none;width:55%;margin:14px 0 1px auto;
    border:0;border-left:2px solid #dce8e1;
    border-radius:0;background:transparent;
    padding:4px 0 3px 15px;
    font-size:11.5px;text-align:right;
  }
  .modal-layer .invoice-view-modal .invoice-credit-summary span{
    display:flex;align-items:center;justify-content:flex-end;
    gap:10px;line-height:1.4;
  }
  .modal-layer .invoice-view-modal .invoice-credit-summary b{
    min-width:87px;white-space:nowrap;color:#17432b;
  }
  .modal-layer .invoice-view-modal .invoice-credit-section.invoice-chapter,
  .modal-layer .invoice-view-modal .invoice-credit-section {
    border:1px solid #e0ece4;border-radius:12px;
    padding:16px 19px;margin:14px 0;
  }
  .modal-layer .invoice-view-modal .invoice-credit-section>h3 {
    display:flex;align-items:center;gap:10px;
    margin:0 0 13px;font-size:15px;color:#173b25;
  }
  .modal-layer .invoice-view-modal .invoice-credit-section>h3::before {
    content:"";width:13px;height:13px;background:#03965a;display:block;
    transform:rotate(-35deg);border-radius:3px;flex:none;
  }
  .modal-layer .invoice-view-modal .invoice-financial-summary {
    border:1px solid #d5eadb;border-radius:12px;
    background:linear-gradient(105deg,#ecf8f0,#f8fcf9);
    padding:20px 18px 16px;margin:16px 0;
  }
  .modal-layer .invoice-view-modal .invoice-financial-breakdown {
    display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:8px;margin-top:16px;
  }
  .modal-layer .invoice-view-modal .invoice-financial-breakdown>.invoice-financial-tile {
    display:flex;align-items:center;justify-content:flex-start;
    gap:12px;min-width:0;font-size:11px;padding:10px 12px;
    border-right:1px solid #d3e3d9;
  }
  .modal-layer .invoice-view-modal .invoice-financial-breakdown>.invoice-financial-tile:last-child{
    border-right:0;
  }
  .modal-layer .invoice-view-modal .invoice-financial-icon {
    display:flex;align-items:center;justify-content:center;
    flex:none;width:42px;height:42px;border-radius:9px;
    background:#fff;color:#07844c;
    box-shadow:0 1px 4px #d6e7da;
  }
  .modal-layer .invoice-view-modal .invoice-financial-data {
    display:flex;flex-direction:column;gap:4px;min-width:0;
  }
  .modal-layer .invoice-view-modal .invoice-financial-data span {
    color:#536d5d;font-size:11.5px;
  }
  .modal-layer .invoice-view-modal .invoice-financial-data b {
    color:#152d1e;font-size:16px;white-space:normal;
  }
  .modal-layer .invoice-view-modal .invoice-financial-data .return-negative{
    color:#c63b2e;
  }
  .modal-layer .invoice-view-modal .invoice-total {
    margin:17px 0 0;padding:11px 0 0;
    border-top:2px solid #14854b;
    display:flex;align-items:stretch;gap:12px;
  }
  .modal-layer .invoice-view-modal .invoice-total strong {
    flex:1;display:flex;align-items:center;padding-left:13px;
    background:#e1f3e6;border-radius:8px;
    font-size:13px;font-weight:800;line-height:1.4;
  }
  .modal-layer .invoice-view-modal .invoice-total b {
    display:flex;align-items:center;justify-content:center;
    padding:11px 20px;min-width:185px;
    background:linear-gradient(125deg,#037542,#009958);
    color:#fff;font-size:29px;line-height:1.15;font-weight:850;
    border-radius:8px;white-space:nowrap;
  }
  .modal-layer .invoice-view-modal .payment-box {
    padding:17px 19px;margin:16px 0;
    border:1px solid #dce9df;border-radius:12px;
    background:#fff;
  }
  .modal-layer .invoice-view-modal .invoice-payment-title {
    display:flex;align-items:center;justify-content:flex-start;
    gap:10px;margin:0 0 12px;color:#163c29;font-size:16px;
    font-weight:800;letter-spacing:0;
  }
  .modal-layer .invoice-view-modal .invoice-payment-title svg{
    color:#02894c;
  }
  .modal-layer .invoice-view-modal .invoice-payment-columns {
    display:grid;grid-template-columns:1fr 1.35fr;gap:16px;
  }
  .modal-layer .invoice-view-modal .invoice-payment-bank {
    display:flex;flex-direction:column;align-items:flex-start;
    justify-content:center;gap:4px;padding:7px 12px;
  }
  .modal-layer .invoice-view-modal .invoice-payment-bank b {
    color:#203c2a;font-size:14px;line-height:1.38;
  }
  .modal-layer .invoice-view-modal .invoice-payment-bank span {
    color:#263f2d;font-size:12px;line-height:1.4;
  }
  .modal-layer .invoice-view-modal .invoice-payment-pix {
    display:flex;align-items:center;gap:13px;
    padding:15px 16px;border-radius:10px;
    background:linear-gradient(135deg,#ecf8f0 12%,#d8f1e0);
    border:1px solid #e1efe4;
  }
  .modal-layer .invoice-view-modal .invoice-pix-icon {
    display:flex;align-items:center;justify-content:center;
    flex:none;width:46px;height:46px;border-radius:10px;
    color:#078848;background:white;
  }
  .modal-layer .invoice-view-modal .invoice-pix-copy {
    display:flex;flex-direction:column;gap:4px;min-width:0;
  }
  .modal-layer .invoice-view-modal .invoice-pix-copy strong {
    font-size:12.5px;color:#17432b;
  }
  .modal-layer .invoice-view-modal .invoice-pix-copy>span {
    font-size:11px;line-height:1.4;color:#54725f;
  }
  .modal-layer .invoice-view-modal .invoice-pix-copy .invoice-payment-note {
    padding:0;margin:4px 0 0;
    border:0;font-size:15px;line-height:1.4;
    color:#087942;font-weight:800;
  }
  .modal-layer .invoice-view-modal .invoice-chapter-orders {
    padding:17px 13px 14px;margin:16px 0;
  }
  .modal-layer .invoice-view-modal .invoice-order-heading {
    padding:0 7px;margin:0 0 10px;
  }
  .modal-layer .invoice-view-modal .detail-table {margin-top:0}
  .modal-layer .invoice-view-modal .invoice-detail-running-head{display:table-row}
  .modal-layer .invoice-view-modal .invoice-detail-running-head th {
    background:#e7f4eb;color:#37664a;text-align:left;
    font-size:9.5px;padding:9px;
  }
  .modal-layer .invoice-view-modal .invoice-document-footer{
    margin-top:14px;font-size:10px;
  }
}
@media screen and (max-width:970px){
  .modal-layer .invoice-view-modal .invoice-identification{
    grid-template-columns:1fr;
  }
  .modal-layer .invoice-view-modal .invoice-meta{grid-row:1;grid-column:1}
  .modal-layer .invoice-view-modal .invoice-number{
    grid-row:2;grid-column:1;
    flex-direction:row;flex-wrap:wrap;align-items:center;
    gap:8px;justify-content:flex-start;
    border-left:0;border-top:1px solid #e1e9e3;
    text-align:left;
  }
  .modal-layer .invoice-view-modal .invoice-hero-art{width:26%}
  .modal-layer .invoice-view-modal .invoice-hero-slogan{margin-left:20px}
}
@media screen and (max-width:690px){
  .modal-layer .invoice-view-modal .invoice-preview{padding:12px 9px}
  .modal-layer .invoice-view-modal .invoice-hero{min-height:80px;padding:9px 10px}
  .modal-layer .invoice-view-modal .invoice-hero .invoice-brand img{width:52px;height:52px}
  .modal-layer .invoice-view-modal .invoice-hero .invoice-brand b{font-size:24px}
  .modal-layer .invoice-view-modal .invoice-hero .invoice-brand>div>span{font-size:11px}
  .modal-layer .invoice-view-modal .invoice-hero-slogan{display:none}
  .modal-layer .invoice-view-modal .invoice-hero-art{width:32%;height:110px;right:-22px}
  .modal-layer .invoice-view-modal .invoice-identification{margin:10px 0}
  .modal-layer .invoice-view-modal .invoice-meta{grid-template-columns:1fr;padding:8px}
  .modal-layer .invoice-view-modal .invoice-meta-cell{
    border-right:0;border-bottom:1px solid #d9e6dd;padding:9px;
  }
  .modal-layer .invoice-view-modal .invoice-meta-cell:last-child{border-bottom:0}
  .modal-layer .invoice-view-modal .invoice-number{padding:11px}
  .modal-layer .invoice-view-modal .invoice-chapter{padding:13px 10px}
  .modal-layer .invoice-view-modal .invoice-chapter-charges .invoice-table th,
  .modal-layer .invoice-view-modal .invoice-chapter-charges .invoice-table td{padding:8px 5px;font-size:10px}
  .modal-layer .invoice-view-modal .invoice-credit-summary{
    width:100%;padding:10px 0 0;border-left:0;border-top:1px solid #dce8e1;
  }
  .modal-layer .invoice-view-modal .invoice-financial-breakdown{grid-template-columns:1fr}
  .modal-layer .invoice-view-modal .invoice-financial-breakdown>.invoice-financial-tile{
    border-right:0;border-bottom:1px solid #d3e3d9;
  }
  .modal-layer .invoice-view-modal .invoice-total{flex-direction:column}
  .modal-layer .invoice-view-modal .invoice-total strong{padding:10px}
  .modal-layer .invoice-view-modal .invoice-payment-columns{grid-template-columns:1fr}
  .modal-layer .invoice-view-modal .invoice-payment-bank{padding:0 4px}
}

/* A4: manter o design do mockup com medidas compactas para caber nos 184 mm
   úteis da página e preservar o funcionamento de faturas com muitos pedidos. */
@media print {
  #print-root .invoice-preview {color:#183526!important;background:#fff!important}
  #print-root .invoice-hero {
    position:relative;isolation:isolate;overflow:hidden;
    display:flex;align-items:center;min-height:82px;
    padding:7px 10px 11px;
    border-bottom:3px solid #d1e7d5;
    background:#fff!important;break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-hero .invoice-brand {position:relative;z-index:2;gap:11px;align-items:center}
  #print-root .invoice-hero .invoice-brand img {width:68px;height:68px}
  #print-root .invoice-hero .invoice-brand b {
    display:block;font-size:30px;line-height:1.05;font-weight:850;
    letter-spacing:-1.5px;color:#27342a;
  }
  #print-root .invoice-hero .invoice-brand>div>span{
    font-size:13px;line-height:1.2;margin-top:3px;color:#78837a;
  }
  #print-root .invoice-hero-slogan {
    position:relative;z-index:2;
    margin-left:22px;padding-left:17px;max-width:115px;
    border-left:1px solid #badac5;
    font-size:10.5px;line-height:1.24;color:#65766c;
  }
  #print-root .invoice-hero-slogan em{font-weight:650}
  #print-root .invoice-hero-art {
    position:absolute;right:-22px;top:-19px;
    width:33%;height:125px;z-index:0;
    border-radius:5% 0 0 100%;
    background:linear-gradient(150deg,#def2e0,#8fd3a4 35%,#0e9c5b)!important;
    transform:rotate(-4deg);pointer-events:none;
  }
  #print-root .invoice-hero-art::after {
    content:"";position:absolute;inset:20px -10px -24px 30%;
    border-radius:7% 0 0 100%;
    background:linear-gradient(145deg,#5fbb84,#058949)!important;
  }
  #print-root .invoice-identification {
    display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,185px);
    gap:0;margin:12px 0 10px;background:#f2f9f4;
    border:1px solid #dfece3;border-radius:7px;
    overflow:hidden;
    break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-meta {
    grid-column:1;grid-row:1;
    display:grid;grid-template-columns:1.25fr 1.1fr .86fr;
    gap:0;margin:0;padding:10px 7px;
    align-items:center;background:transparent;
    border:0;
  }
  #print-root .invoice-meta-cell {
    display:flex;align-items:flex-start;gap:6px;
    padding:7px 7px;min-width:0;
    background:transparent;border:0;
    border-right:1px solid #d7e7dc;
  }
  #print-root .invoice-meta-cell:last-child{border-right:0}
  #print-root .invoice-meta-icon{color:#078949;flex:none;margin-top:2px}
  #print-root .invoice-meta-icon svg{width:15px;height:15px}
  #print-root .invoice-meta-data{min-width:0}
  #print-root .invoice-meta small{
    font-size:8px;line-height:1.2;font-weight:700;color:#65776b;
  }
  #print-root .invoice-meta b{
    font-size:9.5px;line-height:1.3;overflow-wrap:anywhere;color:#173321;
  }
  #print-root .invoice-representative{
    font-size:8.5px;line-height:1.3;margin-top:2px;color:#506d5a;
  }
  #print-root .invoice-representative b{font-size:8.5px}
  #print-root .invoice-number {
    grid-column:2;grid-row:1;
    display:flex;flex-direction:column;align-items:flex-end;
    justify-content:center;
    margin:0;padding:10px;
    background:#fff;border-left:1px solid #dfece3;
    text-align:right;min-width:0;
  }
  #print-root .invoice-number>small:first-child{
    color:#607365;font-size:8px;line-height:1.3;
  }
  #print-root .invoice-number strong{
    color:#19472d;font-size:18px;line-height:1.16;margin:3px 0;
  }
  #print-root .invoice-number .invoice-status-stamp{
    margin:3px 0;padding:3px 9px;border-radius:6px;font-size:9px;
  }
  #print-root .invoice-number>small:not(:first-child){
    font-size:8px;line-height:1.3;color:#4f705b;
  }
  #print-root .invoice-chapter {
    border:1px solid #dfe9e2;border-radius:7px;
    padding:10px 12px;margin:11px 0;background:#fff;
    box-sizing:border-box;
  }
  #print-root .invoice-chapter-charges{margin:10px 0 9px}
  #print-root .invoice-section-title {
    display:flex;align-items:center;justify-content:space-between;
    margin:0 0 7px;gap:10px;
  }
  #print-root .invoice-section-title h3,
  #print-root .invoice-financial-summary h3 {
    display:flex;align-items:center;gap:7px;
    font-size:11px;line-height:1.25;font-weight:800;color:#172b20;
  }
  #print-root .invoice-section-title h3 svg,
  #print-root .invoice-financial-summary h3 svg{
    color:#078b51;width:15px;height:15px;flex:none;
  }
  #print-root .invoice-section-title h3 span{font-size:inherit;color:inherit}
  #print-root .invoice-section-title>span{font-size:8px}
  #print-root .invoice-table th{padding:7px 6px;background:#e8f4eb!important;font-size:8.5px}
  #print-root .invoice-table td{padding:6px;font-size:9.5px;line-height:1.28}
  #print-root .invoice-credit-summary {
    display:grid;gap:4px;width:62%;max-width:none;
    margin:9px 0 0 auto;padding:5px 0 0 10px;
    border:0;border-left:1px solid #d9e8de;
    border-radius:0;background:transparent;
    font-size:9px;text-align:right;
    break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-credit-summary span{
    display:flex;align-items:center;justify-content:flex-end;
    gap:9px;line-height:1.25;
  }
  #print-root .invoice-credit-summary b{
    min-width:78px;white-space:nowrap;color:#17452d;
  }
  #print-root .invoice-credit-section {
    border:1px solid #e2ede5;border-radius:7px;
    padding:9px 12px;margin:9px 0;background:#fff;
  }
  #print-root .invoice-credit-section>h3 {
    display:flex;align-items:center;gap:7px;
    margin:0 0 7px;font-size:10.5px;color:#1b3829;
  }
  #print-root .invoice-credit-section>h3::before {
    content:"";width:11px;height:11px;
    transform:rotate(-35deg);border-radius:2px;background:#088c4e;
  }
  #print-root .invoice-financial-summary {
    padding:12px 13px 10px;
    margin:9px 0;
    background:#f0f8f2!important;border:1px solid #d6e9da;border-radius:7px;
  }
  #print-root .invoice-financial-breakdown {
    display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
    gap:5px;margin:9px 0 0;
  }
  #print-root .invoice-financial-breakdown>.invoice-financial-tile{
    display:flex;align-items:center;justify-content:flex-start;
    gap:8px;padding:5px 7px;
    border-right:1px solid #d4e3d9;
  }
  #print-root .invoice-financial-breakdown>.invoice-financial-tile:last-child{border-right:0}
  #print-root .invoice-financial-icon {
    display:flex;align-items:center;justify-content:center;
    flex:none;width:30px;height:30px;border-radius:6px;
    color:#07844b;background:#fff;
  }
  #print-root .invoice-financial-icon svg{width:16px;height:16px}
  #print-root .invoice-financial-data {
    display:flex;flex-direction:column;gap:3px;min-width:0;
  }
  #print-root .invoice-financial-data span{font-size:9px;color:#4e6958}
  #print-root .invoice-financial-data b{
    font-size:12px;line-height:1.3;color:#173122;white-space:nowrap;
  }
  #print-root .invoice-financial-data .return-negative{color:#c13527}
  #print-root .invoice-total {
    display:flex;align-items:stretch;gap:9px;
    margin:9px 0 0;padding:8px 0 0;
    border-top:2px solid #138449;
  }
  #print-root .invoice-total strong {
    display:flex;align-items:center;flex:1;
    border-radius:6px;background:#dff2e5;padding:6px 10px;
    font-size:10px;line-height:1.3;color:#152e20;
  }
  #print-root .invoice-total b {
    display:flex;align-items:center;justify-content:center;
    min-width:145px;padding:9px 13px;
    border-radius:6px;background:#078b4b!important;
    color:#fff!important;font-size:24px;line-height:1.1;white-space:nowrap;
  }
  #print-root .payment-box {
    display:block;padding:10px 12px;margin:9px 0;
    border:1px solid #dfeae1;border-radius:7px;background:#fff!important;
    break-inside:avoid;page-break-inside:avoid;
  }
  #print-root .invoice-payment-title{
    display:flex;align-items:center;justify-content:flex-start;
    gap:7px;margin:0 0 6px;
    font-size:10.5px;font-weight:800;letter-spacing:0;color:#183b2b;
  }
  #print-root .invoice-payment-title svg{
    width:15px;height:15px;color:#098e4e;
  }
  #print-root .invoice-payment-columns{
    display:grid;grid-template-columns:1fr 1.3fr;gap:13px;
  }
  #print-root .invoice-payment-bank{
    display:flex;flex-direction:column;justify-content:center;
    gap:2px;padding:4px 9px;
  }
  #print-root .invoice-payment-bank b{
    font-size:11px;line-height:1.4;color:#1b3826;overflow-wrap:anywhere;
  }
  #print-root .invoice-payment-bank span{
    font-size:9px;line-height:1.3;color:#1e3829;
  }
  #print-root .invoice-payment-pix{
    display:flex;align-items:center;gap:9px;
    padding:9px 11px;border-radius:7px;
    background:#e4f5e9!important;border:1px solid #e1ede4;
  }
  #print-root .invoice-pix-icon{
    display:flex;align-items:center;justify-content:center;
    flex:none;width:33px;height:33px;border-radius:7px;
    background:#fff;color:#07904c;
  }
  #print-root .invoice-pix-icon svg{width:20px;height:20px}
  #print-root .invoice-pix-copy{
    display:flex;flex-direction:column;min-width:0;gap:2px;
  }
  #print-root .invoice-pix-copy strong{font-size:10px;line-height:1.2}
  #print-root .invoice-pix-copy>span{font-size:9px;color:#506e59;line-height:1.3}
  #print-root .invoice-pix-copy .invoice-payment-note{
    font-size:11.5px;line-height:1.3;
    font-weight:800;color:#087941;
    margin:3px 0 0;padding:0;border:0;
  }
  #print-root .invoice-chapter-orders {
    padding:9px 10px 10px;margin:10px 0;
    break-inside:auto!important;page-break-inside:auto!important;
    overflow:visible;
  }
  #print-root .invoice-order-heading{margin:0 0 7px}
  #print-root .detail-table{margin:0;break-inside:auto;page-break-inside:auto}
  #print-root .detail-table thead{display:table-header-group}
  #print-root .detail-table tbody{display:table-row-group}
  #print-root .detail-table tr{break-inside:avoid;page-break-inside:avoid}
  #print-root .invoice-detail-running-head th {
    background:#e5f2e9!important;color:#305f41;
    font-size:8px;text-align:left;padding:6px 5px;
  }
  #print-root .detail-table td{font-size:8.2px;line-height:1.28;padding:6px 4px}
  #print-root .invoice-document-footer{font-size:8px}
}
