/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* PAGE */
body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
}

/* INVOICE CONTAINER (A4 SAFE) */
.invoice {
    width: 100%;
    max-width: 794px; /* A4 width */
    background: #ffffff;
    margin: 20px auto;
    padding: 20px;
    border: 2px solid #000;
}

/* HEADER */
.header {
    text-align: center;
    margin-bottom: 18px;
}

.header h1 {
    color: maroon;
    font-size: 26px;
    margin-bottom: 6px;
}

.header p {
    font-size: 14px;
    line-height: 1.4;
}

/* OWNER + MOBILE */
.owner-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.owner-static {
    flex: 1;
}

.owner-name {
    font-weight: bold;
}

.owner-qualification {
    font-size: 14px;
    margin-bottom: 6px;
}

/* MOBILE */
.mobile {
    text-align: right;
}

.mobile label {
    font-weight: bold;
    display: block;
}

.mobile input {
    width: 170px;
    padding: 5px;
    font-size: 14px;
    margin-top: 4px;
}

/* CUSTOMER DETAILS */
.customer-details {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.customer-details div {
    flex: 1;
}

.customer-details label {
    font-weight: bold;
    font-size: 14px;
}

.customer-details input {
    width: 100%;
    padding: 6px;
    font-size: 14px;
    margin-top: 4px;
    border: 1px solid #000;
}

/* TABLE */
#invoiceTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
}

#invoiceTable th,
#invoiceTable td {
    border: 1px solid #000;
    padding: 6px;
    text-align: center;
    font-size: 14px;
    word-wrap: break-word;
}

#invoiceTable th {
    background: #eaeaea;
    font-weight: bold;
}

/* TABLE INPUTS */
#invoiceTable input {
    width: 100%;
    border: none;
    outline: none;
    text-align: center;
    font-size: 14px;
    background: transparent;
}

/* BUTTONS */
button {
    margin-top: 15px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
}

.no-print {
    background: #2c7be5;
    color: white;
    border: none;
    border-radius: 4px;
}

/* TOTAL */
.total {
    margin-top: 20px;
    text-align: right;
    font-size: 18px;
    font-weight: bold;
}

/* DOWNLOAD */
.download {
    display: block;
    margin: 20px auto 0;
    background: maroon;
    color: white;
    border: none;
    padding: 10px 22px;
    font-size: 16px;
    border-radius: 5px;
}

/* TERMS & CONDITIONS */
.terms {
    margin-top: 25px;
    padding-top: 12px;
    border-top: 1px solid #000;
    font-size: 14px;
}

.terms h3 {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: bold;
    text-decoration: underline;
}

.terms ul {
    padding-left: 18px;
}

.terms li {
    margin-bottom: 6px;
    line-height: 1.4;
}

/* PRINT & PDF FIX */
@media print {
    body {
        background: none;
    }

    .invoice {
        margin: 0 auto;
        border: 2px solid #000;
    }

    .no-print {
        display: none;
    }

    input {
        border: none !important;
        outline: none !important;
    }

    .terms {
        background: none;
    }

    @page {
        size: A4;
        margin: 12mm;
    }
}
.header-left {
    width: 80px;   /* reduced */
}

.header-left img {
    width: 100px;   /* reduced logo size */
    height: auto;
}
.header {
    position: relative;   /* IMPORTANT */
}

.header-right {
    position: absolute;
    top: 10px;            /* adjust vertically */
    right: 15px;          /* adjust horizontally */
}

.header-right img {
    width: 55px;          /* image size */
    height: auto;
}

.terms textarea {
    width: 98%;
    min-height: 50px;
    font-size: 15px;
    padding: 6px;
    resize: vertical;
    border: 1px solid #000;
    box-sizing: border-box;
}

.terms li {
    margin-bottom: 8px;
}
