* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #f1f5f9;
    padding: 20px;
}

/* =========================
   MAIN
========================= */

.main-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* =========================
   FORM
========================= */

.form-section {
    width: 350px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    position: sticky;
    top: 20px;
}

.form-section h2,
.form-section h3 {
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 10px;
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    background: black;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
}

#downloadPdfBtn{
    background: gray;
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* =========================
   PREVIEW
========================= */

.preview-section {
    flex: 1;
    overflow: auto;
}

/* =========================
   INVOICE
========================= */

.invoice {
    width: 210mm;
    min-height: 297mm;
    background: white;
    margin: auto;
    padding: 15px;
    border: 2px solid #000;
}

/* Top */

.invoice-top {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
}

/* Company */

.company-section {
    display: flex;
    border-bottom: 2px solid #000;
    padding: 15px 0;
}

.logo-box {
    width: 120px;
    height: 120px;
    /* border: 2px solid #000; */
    margin-right: 20px;
    overflow: hidden;
}

.logo-box2{
    position: relative;
    right: -210px;
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.company-details {
    flex: 1;
    text-align: center;
}

.company-details h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.company-details p {
    margin-bottom: 6px;
}

/* Invoice Info */

.invoice-info {
    border-bottom: 2px solid #000;
    padding: 15px 0;
}

.info-row {
    display: flex;
    gap: 30px;
    margin-bottom: 8px;
}

/* Billing */

.billing-section {
    display: flex;
    border-bottom: 2px solid #000;
}

.billing-box {
    width: 50%;
    padding: 15px;
    min-height: 150px;
}

.billing-box:first-child {
    border-right: 2px solid #000;
}

.billing-box h3 {
    margin-bottom: 10px;
}

/* Table */

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
    border: 1px solid #000;
    padding: 10px;
    text-align: center;
}

.invoice-table th {
    background: #f3f4f6;
}

/* Total */

.total-section {
    border: 2px solid #000;
    border-top: none;
    padding: 15px;
    text-align: right;
}

/* Footer */

.footer-section {
    display: flex;
    border: 2px solid #000;
    border-top: none;
    min-height: 200px;
}

.terms-box,
.signature-box {
    width: 50%;
    padding: 15px;
}

.terms-box {
    border-right: 2px solid #000;
}

.signature-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* =========================
   PRINT
========================= */

@media print {

    body {
        background: white;
        padding: 0;
    }

    .form-section {
        display: none;
    }

    .invoice {
        border: none;
        width: 100%;
        min-height: auto;
    }

}

/* =========================
   MOBILE RESPONSIVE
========================= */

@media (max-width: 1100px) {

    .main-container {
        flex-direction: column;
    }

    .form-section {
        width: 100%;
        position: static;
    }

    .preview-section {
        width: 100%;
        overflow-x: auto;
    }

    .invoice {
        width: 1000px;
        min-width: 1000px;
    }

    .logo-box2 {
        left: 310px;
    }

}

/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 768pxx) {

    body {
        padding: 10px;
    }

    .form-row {
        flex-direction: column;
    }

    .company-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .logo-box {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .billing-section {
        flex-direction: column;
    }

    .billing-box {
        width: 100%;
    }

    .billing-box:first-child {
        border-right: none;
        border-bottom: 2px solid #000;
    }

    .footer-section {
        flex-direction: column;
    }

    .terms-box,
    .signature-box {
        width: 100%;
    }

    .terms-box {
        border-right: none;
        border-bottom: 2px solid #000;
    }

    .btn-group {
        flex-direction: column;
    }

}

/* =========================
   GST SUMMARY
========================= */

.gst-summary {

    border: 2px solid #000;
    border-top: none;
    padding: 15px;

}

.gst-row {

    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #999;

}

.gst-row:last-child {
    border-bottom: none;
}

.grand-total-row {

    font-size: 20px;
    font-weight: bold;

}

/* =========================
   AMOUNT WORDS
========================= */

.amount-words {

    border: 2px solid #000;
    border-top: none;
    padding: 15px;

}

.amount-words p {

    margin-top: 10px;
    font-size: 18px;

}