.invoice { max-width: 190mm; margin: 0 auto; line-height: 1.4; }
.invoice-brand {
    background: radial-gradient(ellipse at 90% 186%, #e5b638 0 48%, transparent 49%),
        radial-gradient(ellipse at 88% 203%, #fff1a6 0 53%, transparent 54%),
        linear-gradient(112deg,#35043e 22%,#a60069 100%);
    border-bottom: 2mm solid #e5b638; border-radius: 4mm 4mm 0 0;
    color: #fff; padding: 5mm 6mm;
}
.invoice-brand .wordmark { color: #ffdf76; font-family: "Noto Serif Bengali", serif; }
.invoice-brand p { margin: .15em 0; overflow-wrap: anywhere; }
.invoice-title { text-align: center; margin: .55em 0; color: #35043e; font-size: 1.4em; }
.invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .5em; margin: 0 0 .65em; }
.invoice-meta > div { background: #f9edf4; padding: .5em .65em; border-radius: .4em; overflow-wrap: anywhere; }
.invoice-items th { background: #35043e; color: #fff; }
.invoice-items td:last-child, .invoice-items th:last-child { text-align: right; white-space: nowrap; }
.invoice-items td { vertical-align: top; overflow-wrap: anywhere; }
.invoice-items small { display: block; }
.invoice-summary { display: flex; align-items: start; gap: 1em; margin-top: .6em; }
.invoice-scan { text-align: center; flex: 0 0 auto; }
.qr-code { width: 32mm; }
.qr-code svg, .barcode svg { width: 100%; height: auto; display: block; }
.invoice-money { margin: 0 0 0 auto; min-width: min(60mm,100%); background: #fdf3fa; border-radius: .4em; }
.invoice-money div { display: flex; justify-content: space-between; gap: .6em; padding: .35em .6em; }
.invoice-money dd { margin: 0; text-align: right; font-weight: 700; }
.invoice-money .grand-total { background: #35043e; color: #ffdf76; }
.invoice h2 { margin: .6em 0 .2em; font-size: 1.05em; }
.print-actions { display: flex; flex-wrap: wrap; gap: .65em; align-items: center; justify-content: center; margin-top: 1em; }
.print-actions a { padding: .45em .65em; }
.print-actions a[aria-current] { background: #fff0d0; border-radius: .4em; font-weight: 700; }
.invoice-58,.invoice-80 { color: #000; font-size: 9pt; }
.invoice-58 { max-width: 48mm; }
.invoice-80 { max-width: 72mm; }
:is(.invoice-58,.invoice-80) :is(.invoice-brand,.invoice-meta > div,th,.invoice-money,.grand-total) {
    background: #fff; color: #000; border-color: #000; border-radius: 0;
}
:is(.invoice-58,.invoice-80) .invoice-brand { padding: 1mm 0; border-bottom-width: 1px; }
:is(.invoice-58,.invoice-80) .wordmark { color: #000; text-shadow: none; font-size: 11pt; }
:is(.invoice-58,.invoice-80) :is(.invoice-meta,.invoice-summary) { display: block; }
:is(.invoice-58,.invoice-80) :is(td,th) { padding: 1mm .45mm; font-size: 8pt; }
:is(.invoice-58,.invoice-80) .invoice-money { min-width: 0; margin-top: 1mm; }
:is(.invoice-58,.invoice-80) .qr-code { margin: auto; width: 30mm; }
.inventory-label { color: #000; background: #fff; max-width: 96mm; margin: 0 auto; padding: 2mm; text-align: center; overflow-wrap: anywhere; font-size: 10pt; line-height: 1.2; }
.inventory-label .barcode { margin: 1mm auto; width: 100%; min-height: 9mm; }
.inventory-label svg { height: 12mm; }
@page invoice-a4 { size: A4 portrait; margin: 10mm; }
@page invoice-roll { size: auto; margin: 0; }
@media print {
    .invoice-a4 { page: invoice-a4; font-size: 9pt; }
    .invoice-58,.invoice-80,.inventory-label { page: invoice-roll; }
    .invoice-brand,.invoice-items th,.grand-total { print-color-adjust: exact; }
    .invoice-summary,.inventory-label { break-inside: avoid; }
    .invoice thead { display: table-header-group; }
    .invoice tr { break-inside: avoid; }
    .invoice table { table-layout: auto; }
    .invoice-items th:last-child { width: 20%; }
    article .qr-code svg, article .barcode svg { print-color-adjust: exact; }
}
.invoice-a4 .invoice-title {
    width:fit-content; margin:.5em auto; padding:.18em 1.25em; border-radius:2em;
    background:#35043e; color:#ffdf76; border:1px solid #e5b638;
}
.invoice-items-a4 { font-size:.88em; }
.invoice-items-a4 :is(th,td) { padding:.45em .4em; }
.invoice-items-a4 th:last-child { width:auto; }
.invoice-items-a4 :is(th,td):nth-child(n+4) { text-align:right; overflow-wrap:anywhere; }
.invoice-items-a4 td:last-child { white-space:normal; }
.invoice-words { padding:.4em .6em; border:1px solid #ead69b; border-radius:.4em; background:#fff3d3; overflow-wrap:anywhere; }
.invoice-words strong { margin-inline-end:.4em; }
.invoice-foot { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,1fr); gap:1em; margin-top:1em; align-items:end; }
.invoice-foot p { margin:0; }
.signature-line { border-top:1px solid #754568; text-align:center; padding-top:.4em; }
:is(.invoice-58,.invoice-80) .invoice-words { padding:0; border:0; background:none; }
@media print {
    .invoice-a4 .invoice-items-a4 { font-size:8pt; }
    .invoice-foot,.invoice-words { break-inside:avoid; }
}
.invoice-item-scroll { overflow-x:auto; }
@media screen and (max-width: 680px) {
    .invoice-items-a4 { min-width:36rem; }
}
@media print {
    .invoice-item-scroll { overflow:visible; }
}
@media screen and (max-width: 480px) {
    .invoice-a4 .invoice-summary { display:grid; grid-template-columns:minmax(0,1fr); }
    .invoice-a4 .invoice-money { width:100%; min-width:0; }
    .invoice-a4 .invoice-scan .qr-code { margin-inline:auto; }
    .invoice-foot { grid-template-columns:minmax(0,1fr); }
    .signature-line { justify-self:end; min-width:7rem; }
}
