/* Invoice Generator Styles */
.invoice-generator-page {
    padding: 2rem 0;
}

.invoice-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-top: 2rem;
}

.invoice-wrapper {
    background: var(--white);
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Invoice Header */
.invoice-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 0;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.logo-placeholder {
    flex-shrink: 0;
}

.logo-box {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.logo-box:hover {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

.logo-box span {
    color: #999;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem;
    pointer-events: none;
}

.logo-box img {
    border-radius: 4px;
}

.invoice-title-section {
    flex: 1;
}

.invoice-title {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: right;
    margin-left: auto;
}

/* Invoice Top Container - Meta Fields */
.invoice-top-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 0.5rem;
    justify-content: center;
    align-items: flex-start;
}

.invoice-top-container .field-container {
    display: flex;
    flex: 0 1 280px;
    margin-bottom: 10px;
}

.invoice-top-container .compact-label {
    flex: 0 0 120px;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-right: none;
    padding: 8px 12px;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    font-size: 13px;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.invoice-top-container .value-box {
    flex: 1;
    background: #ffffff;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    font-size: 13px;
    outline: none;
    color: #212529;
    width: 100%;
}

.invoice-top-container .input-field:focus {
    border-color: #007bff;
    z-index: 1;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.select-style {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* Old Invoice Meta Section (deprecated) */
.invoice-meta-section {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
}

.invoice-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-field {
    flex: 1;
    min-width: 150px;
}

.meta-field label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.meta-field input,
.meta-field select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.meta-field input:focus,
.meta-field select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Billing Section */
.billing-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.billed-from h3,
.billed-to h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

/* Invoice Table Wrapper - Professional Grid Table */
.invoice-table-wrapper {
    width: 100%;
    margin: 20px auto;
    font-family: 'Inter', sans-serif;
}

.pro-table-header {
    display: grid;
    grid-template-columns: 40px 1fr 70px 100px 100px 40px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
}

.h-col {
    padding: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-align: center;
}

.pro-table-row {
    display: grid;
    grid-template-columns: 40px 1fr 70px 100px 100px 40px;
    border: 1px solid #e2e8f0;
    border-top: none;
    background: #fff;
}

.d-col {
    border-right: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-col:last-child {
    border-right: none;
}

.sl-box {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.desc-box {
    justify-content: flex-start;
}

/* Input fields */
.slim-textarea,
.slim-input {
    width: 100%;
    border: none;
    padding: 10px;
    font-size: 13px;
    outline: none;
    background: transparent;
    text-align: center;
    font-family: inherit;
}

.slim-textarea {
    text-align: left;
    resize: none;
    overflow: hidden;
    line-height: 1.4;
}

.slim-textarea:focus,
.slim-input:focus {
    background-color: transparent;
}

.total-box {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.trash-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.trash-btn:hover {
    color: #ef4444;
}

.add-item-link {
    margin-top: 10px;
    background: none;
    border: none;
    color: #d90429;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    display: block;
    transition: color 0.2s;
}

.add-item-link:hover {
    color: #a00320;
}

/* Number input arrows removal */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Old Items Section (deprecated) */
.items-section {
    margin-bottom: 2rem;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.items-table thead {
    background-color: #f5f5f5;
}

.items-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.col-sl {
    width: 50px;
    text-align: center;
}

.col-desc {
    width: auto;
}

.col-qty,
.col-price,
.col-total {
    width: 120px;
}

.col-action {
    width: 60px;
    text-align: center;
}

.item-description,
.item-qty,
.item-price {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 0;
    font-size: 13px;
    background: transparent;
    outline: none;
    font-family: inherit;
    text-align: center;
}

.item-description {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    overflow: visible;
    min-height: auto;
    resize: none;
    text-align: left;
    padding: 10px;
}

.item-description:focus,
.item-qty:focus,
.item-price:focus {
    outline: none;
    border-color: transparent;
    background: transparent;
}

.item-total {
    font-weight: 600;
    color: var(--text-color);
}

.delete-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s;
}

.delete-item:hover {
    transform: scale(1.2);
}

.add-item-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.add-item-btn:hover {
    color: #c82333;
}

.add-item-btn span {
    font-size: 1.2rem;
}

/* Invoice Bottom Section */
.invoice-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.left-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.payment-details,
.additional-notes {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.payment-details h3,
.additional-notes h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Payment Fields Grid */
.payment-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    flex: 1;
}

.payment-field {
    display: flex;
    flex-direction: column;
}

.payment-field label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.35rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.payment-field input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    background: var(--white);
    font-family: inherit;
    transition: all 0.3s;
}

.payment-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.payment-details .form-group,
.additional-notes .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.additional-notes textarea {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
    resize: vertical;
}

.additional-notes textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.additional-notes {
    min-height: auto;
}

.additional-notes textarea {
    min-height: 150px;
    resize: vertical;
}

/* Invoice Summary */
/* Grand Total Section Styles */
.grid-layout {
    font-family: 'Inter', -apple-system, sans-serif;
    width: 480px;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    margin: 20px auto;
}

.field-container {
    display: flex;
    margin-bottom: 8px;
}

/* Label Box Design */
.label-box {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-right: none;
    padding: 10px 15px;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* Value/Input Box Design */
.value-box {
    width: 130px;
    background: #ffffff;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    font-size: 15px;
    text-align: right;
    outline: none;
    color: #212529;
}

/* Focus effect for inputs */
.input-field:focus {
    border-color: #80bdff;
    z-index: 1;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.15);
}

.read-only {
    background-color: #e9ecef;
    color: #6c757d;
}

.total-row .label-box, .total-row .total-value {
    background-color: #f1f3f5;
    border-color: #adb5bd;
    font-weight: 700;
    font-size: 16px;
}

.highlight {
    background-color: #fff9db;
}

.spacer {
    height: 15px;
}

/* Red Balance Section */
.balance-footer {
    background: #e63946;
    color: white;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(230, 57, 70, 0.3);
}

.due-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.due-number {
    font-size: 26px;
    font-weight: 800;
}

/* Chrome/Safari arrows removal */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
}

/* Bank Details Section */
.bank-section {
    font-family: 'Inter', sans-serif;
    width: 550px;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    margin: 20px auto;
}

.section-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    font-weight: 700;
    border-left: 4px solid #007bff;
    padding-left: 10px;
}

.compact-label {
    flex: 0 0 150px;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-right: none;
    padding: 12px 15px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.wide-input {
    flex: 1;
    background: #ffffff;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    font-size: 14px;
    outline: none;
    color: #212529;
    transition: all 0.2s;
}

.wide-input:focus {
    border-color: #007bff;
    z-index: 1;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Billing Container - Billed From/To Section */
.billing-container {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    justify-content: center;
    padding: 0 20px 10px 20px;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

.billing-container .billing-card.grid-layout {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #dee2e6;
    margin: 0;
}

.section-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.red-text {
    color: #d90429;
}

.billing-container .field-container {
    display: flex;
    margin-bottom: 8px;
    align-items: stretch;
}

.billing-container .compact-label {
    flex: 0 0 140px;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-right: none;
    padding: 10px 15px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    font-size: 13px;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.billing-container .value-box {
    flex: 1;
    background: #ffffff;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    font-size: 14px;
    outline: none;
    color: #212529;
    resize: none;
    overflow: hidden;
    min-height: 40px;
    display: block;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
}

.billing-container .input-field:focus {
    border-color: #d90429;
    z-index: 1;
    box-shadow: 0 0 0 3px rgba(217, 4, 41, 0.1);
}

/* Invoice Footer Note */
.invoice-footer-note {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #666;
}

/* Action Buttons */
.invoice-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.invoice-actions button {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-save-draft {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-save-draft:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-send-invoice {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-send-invoice:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-print {
    background-color: #28a745;
    color: var(--white);
}

.btn-print:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-download-pdf {
    background-color: #17a2b8;
    color: var(--white);
}

.btn-download-pdf:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* SEO Article Section Spacing */
.seo-article {
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .invoice-header {
        flex-direction: column;
    }

    .logo-box {
        width: 100px;
        height: 100px;
    }

    .invoice-title {
        font-size: 2rem;
    }

    .billing-section {
        grid-template-columns: 1fr;
    }

    .invoice-bottom {
        grid-template-columns: 1fr;
    }

    .invoice-meta-section {
        flex-direction: column;
    }

    .invoice-meta {
        flex-direction: column;
    }

    .meta-field {
        min-width: 100%;
    }

    .additional-notes {
        min-height: auto;
    }

    .invoice-summary {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .invoice-container {
        padding: 1rem;
    }

    .invoice-wrapper {
        padding: 1rem;
    }

    .invoice-title {
        font-size: 1.5rem;
    }

    .items-table {
        font-size: 0.85rem;
    }

    .items-table th,
    .items-table td {
        padding: 0.5rem 0.25rem;
    }

    .col-qty,
    .col-price,
    .col-total {
        width: 80px;
    }

    .invoice-actions {
        flex-direction: column;
    }

    .invoice-actions button {
        width: 100%;
        justify-content: center;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0.35in;
    }

    .main-header,
    .main-footer,
    .invoice-actions,
    .page-header,
    .seo-article,
    article {
        display: none !important;
    }

    html,
    body {
        background: white;
        margin: 0;
        padding: 0;
        height: auto;
    }

    .invoice-wrapper {
        box-shadow: none;
        padding: 0;
        page-break-inside: avoid;
        max-width: 100%;
        background: white;
    }

    .invoice-container {
        box-shadow: none;
        padding: 0;
        margin: 0;
        max-width: 100%;
        border-radius: 0;
        background: white;
    }

    /* Header */
    .invoice-header {
        display: flex;
        gap: 1rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 3px solid var(--primary-color);
        page-break-inside: avoid;
    }

    .logo-placeholder {
        flex-shrink: 0;
    }

    .logo-box {
        width: 80px;
        height: 80px;
        border: 2px dashed #ccc;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white;
        border-radius: 4px;
        font-size: 0.65rem;
        color: #0066cc;
        text-align: center;
        padding: 0.3rem;
    }

    .invoice-title-section {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .invoice-title {
        font-size: 3rem;
        margin: 0;
        text-align: right;
        color: var(--primary-color);
        font-weight: 700;
        line-height: 1;
    }

    /* Meta Section */
    .invoice-top-container {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        padding: 8px;
        margin-bottom: 0.8rem;
    }

    .invoice-top-container .field-container {
        display: flex;
        flex: 0 1 240px;
        margin-bottom: 6px;
    }

    .invoice-top-container .compact-label {
        flex: 0 0 80px;
        background: #f8f9fa;
        border: 1px solid #ced4da;
        border-right: none;
        padding: 6px 8px;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
        font-size: 0.6rem;
        color: #495057;
        font-weight: 600;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    .invoice-top-container .value-box {
        flex: 1;
        background: #ffffff;
        border: 1px solid #ced4da;
        padding: 6px 8px;
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
        font-size: 0.6rem;
        outline: none;
        color: #212529;
        width: 100%;
    }

    .invoice-meta-section {
        display: flex;
        gap: 0.6rem;
        flex-wrap: wrap;
        margin-bottom: 0.6rem;
        padding-top: 0;
        page-break-inside: avoid;
    }

    .meta-field {
        flex: 1;
        min-width: 130px;
    }

    .meta-field label {
        font-size: 0.7rem;
        margin-bottom: 0.15rem;
        display: block;
        color: #666;
        font-weight: 500;
    }

    .meta-field input,
    .meta-field select {
        width: 100%;
        padding: 0.3rem;
        font-size: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 2px;
        background: white;
    }

    /* Billing Section */
    .billing-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 0.6rem;
        page-break-inside: avoid;
    }

    .billed-from,
    .billed-to {
        page-break-inside: avoid;
    }

    .billed-from h3,
    .billed-to h3 {
        font-size: 0.7rem;
        margin-bottom: 0.3rem;
        padding-bottom: 0.2rem;
        border-bottom: 2px solid var(--primary-color);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: var(--primary-color);
    }

    .form-group {
        margin-bottom: 0.25rem;
    }

    .form-group input,
    .form-group textarea {
        width: 100%;
        padding: 0.3rem;
        font-size: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 2px;
        background: white;
        line-height: 1.2;
    }

    /* Items Table */
    .items-section {
        margin-bottom: 0.6rem;
        page-break-inside: avoid;
    }

    .items-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.75rem;
    }

    .items-table thead {
        background-color: #f5f5f5;
    }

    .items-table th {
        padding: 0.3rem 0.4rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.7rem;
        border-bottom: 1px solid #ddd;
        text-transform: uppercase;
        letter-spacing: 0.2px;
        line-height: 1.2;
    }

    .items-table td {
        padding: 0.25rem 0.4rem;
        border-bottom: 1px solid #eee;
    }

    .item-description,
    .item-qty,
    .item-price {
        padding: 10px;
        font-size: 13px;
        border: none;
        border-radius: 0;
        background: transparent;
        width: 100%;
        box-sizing: border-box;
        line-height: 1.4;
        outline: none;
        font-family: inherit;
        text-align: center;
    }

    .item-total {
        font-weight: 600;
    }

    .delete-item,
    .add-item-btn {
        display: none;
    }

    /* Invoice Bottom */
    .invoice-bottom {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        margin-bottom: 0.3rem;
        page-break-inside: auto;
        align-items: stretch;
    }

    .left-section {
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        min-height: 200px;
    }

    .payment-details,
    .additional-notes {
        page-break-inside: avoid;
        padding: 0.4rem;
        background: white;
        border: 1px solid #ddd;
        border-radius: 2px;
        min-height: auto;
    }

    .payment-details h3,
    .additional-notes h3 {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
        padding-bottom: 0.15rem;
        border-bottom: 2px solid var(--primary-color);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: var(--primary-color);
    }

    .payment-fields {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .payment-field {
        display: flex;
        flex-direction: column;
    }

    .payment-field label {
        font-size: 0.55rem;
        margin-bottom: 0.08rem;
        font-weight: 600;
        text-transform: uppercase;
        color: #333;
    }

    .payment-field input {
        padding: 0.2rem;
        font-size: 0.65rem;
        border: 1px solid #ddd;
        border-radius: 2px;
        background: white;
        line-height: 1.1;
    }

    .additional-notes textarea {
        font-size: 0.65rem;
        padding: 0.25rem;
        line-height: 1.1;
        min-height: 50px;
        max-height: 60px;
        resize: none;
    }

    .right-section {
        page-break-inside: avoid;
    }

    /* Grand Total Section - Print */
    .grid-layout {
        width: 100%;
        max-width: 380px;
        padding: 15px;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        border: 1px solid #e0e0e0;
        margin: 10px auto;
    }

    .field-container {
        margin-bottom: 6px;
    }

    .label-box {
        padding: 8px 10px;
        font-size: 0.65rem;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    .value-box {
        width: 90px;
        padding: 8px 10px;
        font-size: 0.7rem;
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }

    .total-row .label-box, .total-row .total-value {
        font-size: 0.75rem;
    }

    .spacer {
        height: 10px;
    }

    .balance-footer {
        padding: 12px;
        margin-top: 15px;
        border-radius: 6px;
    }

    .due-tag {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }

    .due-number {
        font-size: 1.1rem;
        font-weight: 800;
    }

    /* Bank Details Section - Print */
    .bank-section {
        width: 100%;
        max-width: 380px;
        padding: 15px;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        border: 1px solid #e0e0e0;
        margin: 15px auto;
    }

    .section-title {
        margin: 0 0 12px 0;
        font-size: 0.85rem;
        color: #333;
        font-weight: 700;
        border-left: 3px solid #007bff;
        padding-left: 8px;
    }

    .field-container {
        margin-bottom: 6px;
    }

    .compact-label {
        flex: 0 0 90px;
        background: #f8f9fa;
        border: 1px solid #ced4da;
        border-right: none;
        padding: 8px 10px;
        border-top-left-radius: 6px;
        border-bottom-left-radius: 6px;
        font-size: 0.65rem;
        color: #495057;
        font-weight: 600;
    }

    .wide-input {
        flex: 1;
        background: #ffffff;
        border: 1px solid #ced4da;
        padding: 8px 10px;
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
        font-size: 0.65rem;
        color: #212529;
    }

    /* Invoice Table - Print */
    .invoice-table-wrapper {
        width: 100%;
        max-width: 850px;
        margin: 20px auto;
        font-family: 'Inter', sans-serif;
        page-break-inside: avoid;
    }

    .pro-table-header {
        display: grid;
        grid-template-columns: 40px 1fr 70px 100px 100px 40px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-bottom: 2px solid #cbd5e1;
        page-break-inside: avoid;
    }

    .h-col {
        padding: 10px;
        font-size: 11px;
        font-weight: 700;
        color: #475569;
        text-align: center;
    }

    .pro-table-row {
        display: grid;
        grid-template-columns: 40px 1fr 70px 100px 100px 40px;
        border: 1px solid #e2e8f0;
        border-top: none;
        background: #fff;
        page-break-inside: avoid;
    }

    .d-col {
        border-right: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 0;
    }

    .d-col:last-child {
        border-right: none;
    }

    .sl-box {
        font-size: 13px;
        font-weight: 600;
        color: #64748b;
    }

    .desc-box {
        justify-content: flex-start;
        padding-left: 15px;
    }

    .slim-textarea,
    .slim-input {
        width: 100%;
        border: none;
        padding: 10px;
        font-size: 13px;
        outline: none;
        background: transparent;
        text-align: center;
        font-family: inherit;
    }

    .slim-textarea {
        text-align: left;
        resize: none;
        overflow: hidden;
        line-height: 1.4;
    }

    .total-box {
        font-weight: 600;
        font-size: 13px;
        color: #1e293b;
    }

    .trash-btn {
        background: none;
        border: none;
        color: #94a3b8;
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.2s;
    }

    .trash-btn:hover {
        color: #ef4444;
    }

    .trash-btn svg {
        width: 14px;
        height: 14px;
    }

    .add-item-link {
        margin-top: 10px;
        background: none;
        border: none;
        color: #d90429;
        font-weight: 700;
        font-size: 13px;
        cursor: pointer;
        padding: 0;
        display: block;
        transition: color 0.2s;
    }

    .add-item-link:hover {
        color: #a00320;
    }

    /* Billing Container - Print */
    .billing-container {
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
        page-break-inside: avoid;
    }

    .billing-container .billing-card.grid-layout {
        width: 100%;
        max-width: 350px;
        padding: 12px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.03);
        border: 1px solid #dee2e6;
        margin: 0;
    }

    .section-header {
        font-size: 0.7rem;
        font-weight: 700;
        margin-bottom: 10px;
        letter-spacing: 0.3px;
    }

    .billing-container .field-container {
        display: flex;
        margin-bottom: 5px;
        align-items: stretch;
    }

    .billing-container .compact-label {
        flex: 0 0 80px;
        background: #f8f9fa;
        border: 1px solid #ced4da;
        border-right: none;
        padding: 6px 8px;
        border-top-left-radius: 6px;
        border-bottom-left-radius: 6px;
        font-size: 0.6rem;
        color: #495057;
        font-weight: 600;
        display: flex;
        align-items: center;
    }

    .billing-container .value-box {
        flex: 1;
        background: #ffffff;
        border: 1px solid #ced4da;
        padding: 6px 8px;
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
        font-size: 0.6rem;
        outline: none;
        color: #212529;
        resize: none;
        overflow: hidden;
        min-height: 28px;
        display: block;
        line-height: 1.3;
    }
        color: #5a6c7d;
        border: none;
        display: flex;
        align-items: center;
        line-height: 1.2;
        letter-spacing: 0.15px;
    }

    .summary-row span:last-child {
        background: transparent;
        padding: 0;
        font-weight: 600;
        font-size: 0.65rem;
        color: #2c3e50;
        border: none;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        line-height: 1.2;
        letter-spacing: -0.2px;
    }

    .summary-row .summary-input-group {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
        background: transparent;
        border: none;
        width: auto;
        margin-left: auto;
    }

    .summary-input-group input {
        width: 50px;
        padding: 0.3rem 0.4rem;
        font-size: 0.6rem;
        border: 1px solid #dde4eb;
        border-radius: 3px;
        background: #ffffff;
        line-height: 1.1;
        flex-shrink: 0;
    }

    .summary-input-group span {
        font-weight: 600;
        font-size: 0.65rem;
        color: #2c3e50;
        margin-left: 0;
        letter-spacing: -0.2px;
        min-width: 60px;
        text-align: right;
    }

    .summary-input-group input {
        width: 40px;
        padding: 0.25rem 0.3rem;
        font-size: 0.6rem;
        border: 1px solid #dde4eb;
        border-radius: 3px;
        background: white;
        line-height: 1.1;
        flex-shrink: 0;
    }

    .summary-input-group span {
        font-weight: 600;
        font-size: 0.65rem;
        color: #2c3e50;
        margin-left: 0;
        letter-spacing: -0.2px;
    }
        padding: 0.4rem;
        font-weight: 700;
        font-size: 0.75rem;
        color: #1a1a1a;
        border-bottom: 1px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        line-height: 1.2;
    }

    .summary-row:has(.summary-input-group) span:first-child {
        display: flex;
        align-items: center;
    }

    .summary-row:has(.summary-input-group) span:last-child {
        padding: 0.3rem 0.4rem;
    }

    .summary-input-group {
        display: flex;
        align-items: center;
        gap: 0.3rem;
        width: auto;
    }

    .summary-input-group input {
        width: 40px;
        padding: 0.2rem 0.3rem;
        font-size: 0.6rem;
        border: 1px solid #dde4eb;
        border-radius: 2px;
        background: white;
        line-height: 1.1;
    }

    .summary-input-group span {
        font-weight: 600;
        font-size: 0.65rem;
        color: #2c3e50;
        min-width: 50px;
        text-align: right;
    }

    .summary-divider {
        height: 1px;
        background: #dde4eb;
        margin: 0;
        border: none;
    }

    .balance-due {
        font-size: 0.65rem;
        font-weight: 700;
        color: var(--white) !important;
        margin-top: 0;
        padding: 0.8rem 0.8rem !important;
        background: linear-gradient(135deg, var(--primary-color) 0%, #e63946 100%) !important;
        border: none !important;
        border-radius: 4px;
        box-shadow: 0 1px 4px rgba(220, 53, 69, 0.12) !important;
        text-align: center;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        line-height: 1.2;
    }

    .balance-due span:first-child {
        display: block;
        font-size: 0.55rem;
        color: rgba(255, 255, 255, 0.95) !important;
        font-weight: 600;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }

    .balance-due span:last-child {
        color: var(--white) !important;
        font-size: 0.85rem;
        font-weight: 900;
    }

    /* Footer Note */
    .invoice-footer-note {
        text-align: center;
        padding: 0.3rem 0;
        border-top: 1px solid #ddd;
        margin-top: 0.4rem;
        font-size: 0.65rem;
        color: #666;
        page-break-inside: avoid;
        line-height: 1.2;
    }
}
