

.pm-box {
    background: #fff;
	margin-left:5px;
    box-shadow: 0 0 10px #000;
}

.pm-header, .pm-footer {
    padding: 8px;
    background: #f1f1f1;
    font-weight: bold;
}

.pm-toggle {
    padding: 2px 5px;
    text-align: center;
}

.pm-body {
    padding: 0;
}

.pm-close {
    float: right;
    cursor: pointer;
}

/* Width Modes */
.paper-thermal { width: 72mm; }
.paper-a4 { width: 210mm; }

/* ================================
   THERMAL MODAL PRINT FIX
   ================================ */
@media print {

    @page {
        size: 72mm auto;
        margin: 0;
    }


    /* Hide everything */
	body.print-modal-active * {
			visibility: hidden !important;
    }
    body.print-modal-active #printModal,
    body.print-modal-active #printModal * {
        visibility: visible !important;
    }

    /* Show only modal */
    #printModal,
    #printModal * {
        visibility: visible !important;
    }

    /* IMPORTANT: remove flex centering */
    #printModal {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;

        width: 72mm !important;
        height: auto !important;

        display: block !important;
        margin: 0 !important;
        padding: 0 !important;

        background: none !important;
    }

    /* Modal box should not center */
    #printModalBox {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;

        width: 72mm !important;
        height: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    /* Hide UI controls */
    .modal-header,
    .modal-footer,
    .modal-toggle,
    .pm-close {
        display: none !important;
    }

    /* Body must print fully */
    .pm-body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Ensure invoice starts from top */
    .thermal-invoice {
        margin: 0 !important;
        padding: 0 !important;
        width: 72mm !important;
    }
}




.thermal-invoice {
    width: 72mm;          /* actual printable width */
    margin-left: -10px;      /* NO CENTERING */
    padding-right: 10mm;
    box-sizing: border-box;
    font-family: monospace;
}



#upiQR {
    display: block;
    margin: 6px auto;
    max-width: 80mm;
    text-align: center;
}

#upiQR canvas {
    margin: 0 auto;
}
#upiQR img {
    display: block;
    margin: 0 auto;
    width: 85px !important;
    height: 85px !important;
}

.th-title {
    font-weight: bold;
    font-size: 12px;
    margin: 3px 0;
}

.th-items td:first-child {
    width: 45mm;              /* fixed width for item column */
    max-width: 45mm;
    word-wrap: break-word;
	font-size: 11px;
    font-weight: bold;
    white-space: normal;
}

.th-items td:nth-child(2) {  /* Qty */
    width: 8mm;
    text-align: right;
	font-size: 11px;
    font-weight: bold;
	padding-left:5px;
	padding-right:5px;
}

.th-items td:nth-child(3) {  /* Rate */
    width: 9mm;
    text-align: right;
	font-size: 11px;
    font-weight: bold;
	padding-left:5px;
	padding-right:5px;
}

.th-items td:nth-child(4) {  /* Amount */
    width: 10mm;
    text-align: right;
	font-size: 11px;
    font-weight: bold;
	padding-left:5px;
	padding-right:5px;
}


.th-items th:first-child { width: 45mm; }
.th-items th:nth-child(2) { width: 8mm; }
.th-items th:nth-child(3) { width: 9mm; }
.th-items th:nth-child(4) { width: 10mm; }


.th-center {
    text-align: center;
    width: 100%;
}
.th-left { text-align: left; }

.th-company {
    font-size: 17px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.th-small {
    font-size: 13px;
    font-weight: bold;
}

.th-logo {
    max-width: 40mm;
    max-height: 20mm;
    margin-bottom: 4px;
}

hr {
    border: none;
    border-top: 1px dashed #000;
    margin: 4px 0;
}


.th-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 4px;
}

.th-items th {
    border-bottom: 1px solid #000;
    padding: 2px 0;
    font-size: 10px;
}

.th-items td {
    padding: 2px 0;
    vertical-align: top;
}

.th-hsn {
    font-size: 8px;
    color: #333;
}

.th-sep {
    border-top: 1px dashed #000;
    margin: 6px 0;
}

.th-items, .th-totals {
    width: 100%;
    border-collapse: collapse;
}

.c-item { width: 45%; text-align: left; }
.c-qty  { width: 15%; text-align: right; }
.c-rate { width: 20%; text-align: right; }
.c-amt  { width: 20%; text-align: right; }

.th-desc {
    font-size: 8px;
    color: #444;
    line-height: 1.2;
}

.th-totals td {
    padding: 2px 0;
    font-size: 10px;
    font-weight: bold;
}

.th-grand td {
    border-top: 1px solid #000;
    font-size: 12px;
    font-weight: bold;
    font-weight: bold;
}

.th-totals td:last-child { text-align: right; }

#barcode{
    display: block;
    margin: 6px auto;
    max-width: 45mm;
    text-align: center;
}
