/* billing applications/assets/css/print-invoice.css */
/* Pixel-Perfect Invoice & Quotation Print/PDF Stylesheet matching sample formats */

.invoice-preview-wrapper {
    background-color: #525659;
    padding: 30px 10px;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.invoice-action-toolbar {
    width: 100%;
    max-width: 800px;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.invoice-sheet {
    background: #FFFFFF;
    width: 210mm;
    min-height: 297mm;
    padding: 15mm 15mm;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    color: #111111;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.35;
    position: relative;
}

/* Header Section */
.inv-header {
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.inv-company-name {
    font-size: 18pt;
    font-weight: 800;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.inv-company-meta {
    font-size: 9.5pt;
    color: #333333;
    line-height: 1.35;
}

.inv-title-box {
    text-align: right;
}

.inv-title {
    font-size: 18pt;
    font-weight: 800;
    text-transform: uppercase;
    color: #000000;
    letter-spacing: 1px;
}

.inv-doc-number {
    font-size: 11pt;
    font-weight: 700;
    margin-top: 4px;
}

.inv-doc-date {
    font-size: 10pt;
    color: #333333;
}

/* Bill / Estimate Info Grid */
.inv-parties-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    border: 1px solid #000000;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 9.5pt;
}

.inv-party-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 9pt;
    color: #555555;
    margin-bottom: 4px;
    border-bottom: 1px solid #EEEEEE;
    padding-bottom: 2px;
}

.inv-party-name {
    font-size: 11pt;
    font-weight: 700;
    color: #000000;
    margin-bottom: 2px;
}

/* Items Table */
.inv-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
    font-size: 9.5pt;
}

.inv-table th {
    background-color: #F3F4F6;
    color: #000000;
    font-weight: 700;
    border: 1px solid #000000;
    padding: 7px 8px;
    text-transform: uppercase;
    font-size: 8.5pt;
}

.inv-table td {
    border: 1px solid #000000;
    padding: 8px 8px;
    vertical-align: top;
}

.inv-item-name {
    font-weight: 700;
    font-size: 10.5pt;
    color: #000000;
    margin-bottom: 4px;
}

.inv-item-specs {
    font-size: 8.5pt;
    color: #444444;
    white-space: pre-line;
    line-height: 1.3;
}

/* Totals and Calculation */
.inv-summary-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    margin-bottom: 14px;
}

.inv-words-box {
    border: 1px solid #000000;
    padding: 8px 10px;
    font-size: 9pt;
}

.inv-words-title {
    font-weight: 700;
    font-size: 8.5pt;
    text-transform: uppercase;
    color: #555555;
    margin-bottom: 3px;
}

.inv-words-content {
    font-weight: 600;
    color: #000000;
    font-style: italic;
}

.inv-calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
}

.inv-calc-table td {
    padding: 4px 8px;
    border: 1px solid #000000;
}

.inv-calc-table tr.grand-total td {
    font-weight: 800;
    font-size: 11pt;
    background-color: #F3F4F6;
}

/* Footer Section: Bank & Signatures */
.inv-footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    border-top: 1px solid #000000;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 9pt;
}

.inv-bank-box {
    border: 1px solid #999999;
    padding: 8px 10px;
    background: #FAFAFA;
}

.inv-bank-title {
    font-weight: 700;
    font-size: 8.5pt;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.inv-terms-box {
    margin-top: 10px;
    font-size: 8.5pt;
    color: #444444;
}

.inv-sign-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    text-align: right;
    padding: 4px 6px;
}

.inv-for-company {
    font-weight: 700;
    font-size: 9.5pt;
}

.inv-sign-image {
    max-height: 60px;
    max-width: 160px;
    margin: 8px 0;
    object-fit: contain;
}

.inv-sign-placeholder {
    height: 50px;
}

.inv-sign-label {
    border-top: 1px dashed #333333;
    padding-top: 4px;
    font-size: 8.5pt;
    font-weight: 600;
    text-align: right;
    display: inline-block;
    width: 170px;
}

/* Print Specific Rules */
@media print {
    body {
        background-color: #FFFFFF !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-header,
    .app-footer,
    .invoice-action-toolbar,
    .no-print {
        display: none !important;
    }

    .invoice-preview-wrapper {
        background: transparent !important;
        padding: 0 !important;
    }

    .invoice-sheet {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        min-height: auto !important;
        padding: 5mm 5mm !important;
        page-break-after: avoid;
    }

    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}
