@page {
    size: A4;
    margin: 8mm;
}

body {
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: #000;
}

.a4-invoice {
    width: 100%;
}

/* HEADER */
.header-table {
    border-bottom: 2px solid #000;
    margin-bottom: 6px;
}

.company-logo {
    height: auto;
    max-height: 70px;
    object-fit: contain;
}
.logo-cell {
    text-align: left;
    vertical-align: top;
}

.company-details h2 {
    margin: 0;
    font-size: 18px;
}

.company-details div {
    font-size: 11px;
}

.invoice-box {
    border: 1px solid #000;
    padding: 6px;
    text-align: center;
}

.invoice-title {
    font-size: 14px;
    font-weight: bold;
}

.original-text {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 4px;
}

/* CUSTOMER */
.customer-table {
    border: 1px solid #000;
    margin: 6px 0;
}

.customer-table td {
    padding: 6px;
    font-size: 11px;
}

/* ITEM TABLE */
.item-table {
    width: 100%;
    border-collapse: collapse;
}

.item-table th,
.item-table td {
    border: 1px solid #000;
    padding: 4px;
    font-size: 10.5px;
}

.item-table th {
    background: #f2f2f2;
    text-align: center;
}

/* TOTALS & HSN */
.totals-table {
    margin-top: 8px;
}

.hsn-table,
.grand-table {
    width: 100%;
    border-collapse: collapse;
}

.hsn-table th,
.hsn-table td,
.grand-table td {
    border: 1px solid #000;
    padding: 4px;
    font-size: 10.5px;
}

.hsn-table th {
    background: #f2f2f2;
    text-align: center;
}

.grand-total td {
    font-weight: bold;
    font-size: 12px;
}

/* AMOUNT IN WORDS */
.amount-words {
    margin-top: 6px;
    border: 1px solid #000;
    padding: 4px;
    font-size: 11px;
}

/* BANK + QR */
.bank-table {
    margin-top: 6px;
    border: 1px solid #000;
}

.bank-table td {
    padding: 6px;
    font-size: 11px;
}

.qr-box {
    text-align: center;
}

.qr-text {
    font-size: 9px;
}

/* TERMS */
.terms {
    margin-top: 6px;
    border: 1px solid #000;
    padding: 6px;
    font-size: 10.5px;
}

/* FOOTER */
.footer-table {
    margin-top: 10px;
    border-top: 1px solid #000;
}

.footer-table td {
    padding-top: 10px;
    font-size: 11px;
}

.sign-box {
    text-align: right;
}

/* ALIGNMENT HELPERS */
.r { text-align: right; }
.c { text-align: center; }

@media print {

    body * {
        visibility: hidden;
    }

    #invoicePreview, 
    #invoicePreview * {
        visibility: visible;
    }

    #invoicePreview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

}

@media print {
    .sidebar,
    .header,
    .topbar,
    .invoice-toolbar {
        display: none !important;
    }
}
