/* A4 Print Styles for GST Tax Invoice */
.a4-invoice-container {
    display: none;
    width: 100%;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 11px;
    color: #1a1a1a;
    background: #fff;
    padding: 0;
}

@page {
    size: A4;
    margin: 15mm;
}

@media print {
    html, body {
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 0;
        background: #fff;
    }

    #app-shell,
    #sidebar,
    #header,
    #main-content,
    .modal-overlay,
    .toast,
    #toast-container {
        display: none !important;
        visibility: hidden !important;
    }

    .a4-invoice-container {
        display: block !important;
        width: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .a4-invoice-wrapper {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .no-print {
        display: none !important;
    }

    @page {
        size: A4;
        margin: 15mm;
    }
}

.a4-invoice-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    background: #fff;
}

.a4-invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 15px;
    border-bottom: 2px solid #1a1a1a;
    margin-bottom: 20px;
}

.a4-company-info {
    max-width: 55%;
}

.a4-company-name {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.a4-company-address {
    font-size: 11px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 4px;
}

.a4-company-contact {
    font-size: 11px;
    color: #444;
}

.a4-gstin {
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 6px;
}

.a4-invoice-title {
    text-align: right;
}

.a4-invoice-title h1 {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    letter-spacing: 1px;
}

.a4-invoice-meta {
    font-size: 11px;
    color: #444;
    line-height: 1.6;
}

.a4-invoice-meta strong {
    color: #1a1a1a;
}

.a4-invoice-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.a4-bill-to, .a4-ship-to {
    width: 48%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.a4-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
}

.a4-customer-name {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.a4-customer-detail {
    font-size: 11px;
    color: #444;
    line-height: 1.5;
}

.a4-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.a4-items-table thead {
    background: #1a1a1a;
    color: #fff;
}

.a4-items-table th {
    padding: 10px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    border: 1px solid #1a1a1a;
}

.a4-items-table th:first-child {
    text-align: center;
    width: 45px;
}

.a4-items-table th:nth-child(2) {
    text-align: left;
}

.a4-items-table td {
    padding: 8px;
    font-size: 11px;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

.a4-items-table td:first-child {
    text-align: center;
}

.a4-items-table td:nth-child(2) {
    text-align: left;
}

.a4-items-table .a4-text-right {
    text-align: right !important;
}

.a4-items-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.a4-summary-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
}

.a4-summary-table {
    width: 280px;
    border-collapse: collapse;
}

.a4-summary-table tr {
    border-bottom: 1px solid #dee2e6;
}

.a4-summary-table td {
    padding: 6px 10px;
    font-size: 11px;
}

.a4-summary-table .a4-label {
    color: #444;
    text-align: left;
}

.a4-summary-table .a4-value {
    text-align: right;
    font-weight: 600;
    color: #1a1a1a;
}

.a4-summary-table .a4-total-row {
    background: #1a1a1a;
    color: #fff;
}

.a4-summary-table .a4-total-row td {
    font-size: 14px;
    font-weight: 800;
    padding: 10px;
    border: none;
}

.a4-tax-breakdown {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.a4-tax-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    padding: 3px 0;
    color: #444;
}

.a4-tax-row span:last-child {
    font-weight: 600;
    color: #1a1a1a;
}

.a4-grand-total {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
    padding: 12px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 4px;
    text-align: right;
}

.a4-grand-total span:last-child {
    font-size: 18px;
    margin-left: 15px;
}

.a4-bank-details {
    margin-bottom: 25px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.a4-bank-details h4 {
    font-size: 11px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    text-transform: uppercase;
}

.a4-bank-details p {
    font-size: 10px;
    color: #444;
    margin: 2px 0;
    line-height: 1.4;
}

.a4-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    margin-top: 30px;
}

.a4-terms {
    max-width: 55%;
}

.a4-terms h4 {
    font-size: 10px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    text-transform: uppercase;
}

.a4-terms ul {
    margin: 0;
    padding-left: 16px;
    font-size: 10px;
    color: #666;
    line-height: 1.6;
}

.a4-signatory {
    text-align: right;
    min-width: 180px;
}

.a4-signatory-line {
    width: 180px;
    border-top: 1px solid #1a1a1a;
    margin-bottom: 6px;
    margin-left: auto;
}

.a4-signatory-label {
    font-size: 10px;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
}

.a4-signatory-date {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
}

.a4-payment-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.a4-payment-status.paid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.a4-payment-status.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
