/* Invoice Preview Container (A4 Proportions) */
.invoice-container {
    background: white;
    width: 210mm;
    min-height: 296mm;
    max-height: 296.5mm;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 20mm;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    font-size: 10pt;
    line-height: 1.4;
    position: relative;
    display: flex;
    flex-direction: column;
}
.invoice-document {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.inv-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.inv-company-info h1 {
    margin: 0 0 5px 0;
    font-size: 20pt;
    color: var(--primary-color);
}
.inv-company-info p { margin: 2px 0; font-size: 9pt; }
.inv-title h2 {
    font-size: 24pt;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-align: right;
}

/* Meta Section */
.inv-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}
.inv-meta-left h3 { margin: 0 0 5px 0; font-size: 12pt; color: var(--primary-color); }
.inv-meta-left p { margin: 2px 0; }
.meta-table { width: 100%; border-collapse: collapse; }
.meta-table td { padding: 3px 0; }
.meta-table td:first-child { color: #555; }

/* Items Table */
.inv-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.inv-items-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    font-size: 10pt;
    text-align: left;
    border: 1px solid var(--primary-color);
}
.inv-items-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}
.inv-items-table th[style*="text-align: right"],
.inv-items-table td:nth-child(n+3) { /* apply right align to numbers */
    text-align: right;
}

/* Summary Section */
.inv-summary-section {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.inv-payment-info { width: 50%; }
.inv-payment-info h3 { font-size: 11pt; color: var(--primary-color); margin: 0 0 8px 0; }
.inv-payment-info p { margin: 3px 0; }
.inv-qr-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.inv-qr-container img { max-width: 100px; display: block; }
.inv-qr-container canvas { max-width: 100px; display: block; }

.inv-totals {
    width: 40%;
}
.inv-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}
.inv-grand-total {
    font-size: 14pt;
    font-weight: bold;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    border-bottom: none;
    padding-top: 10px;
    margin-top: 5px;
}

/* Footer */
.inv-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
}
.inv-terms { width: 60%; font-size: 8pt; color: #555; }
.inv-signatures {
    width: 40%;
    display: flex;
    justify-content: space-between;
    text-align: center;
}
.inv-seal-placeholder {
    width: 100px;
    height: 100px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border-radius: 50%;
}
.inv-auth-sign { padding-top: 10px; }
