:root {
    --bg: #f5f7fb;
    --paper: #ffffff;
    --border: #e6eaf2;
    --text: #0f172a;
    --muted: #64748b;
    --ink: #111827;
    --green: #22c55e;
    --dark: #0b1220;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.wrap {
    margin: 24px auto;
    padding: 0 50px;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    align-items: start;
}

.paper {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.paperInner {
    padding: 18px 18px 22px 18px;
}

.side .sideCard {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.topRow {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

#logo {
    display: none;
}

.logoDrop {
    display: inline-block;
    cursor: pointer;
}

.logoArea {
    width: 220px;
}

.logoPreview {
    width: 160px;
    height: 64px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    background: #f8fafc;
}

.logoIcon {
    font-size: 16px;
}

.logoText {
    font-size: 12px;
}

.metaArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-top: 4px;
}

.metaLine {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metaLabel {
    color: var(--muted);
    font-size: 12px;
}

.metaLine input {
    width: 140px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 12px;
    outline: none;
    background: #fff;
}

.titleRow {
    margin-top: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.titleBig {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.invNo {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.invNoLabel {
    font-size: 12px;
    color: var(--muted);
}

.invNo input {
    width: 160px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 9px;
    font-size: 13px;
    outline: none;
}

.billGrid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.billHead {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #111827;
}

.billBlock input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #e7edf6;
    padding: 8px 0;
    outline: none;
    font-size: 12px;
    color: #0f172a;
}

.billBlock input::placeholder {
    color: #9aa8bc;
}

.tableWrap {
    margin-top: 14px;
}

.tableHead {
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 40px 1fr 70px 90px 110px 110px;
    padding: 10px 10px;
    font-size: 12px;
    font-weight: 700;
}

.rows .row {
    display: grid;
    grid-template-columns: 40px 1fr 70px 90px 110px 110px;
    padding: 12px 10px;
    border-bottom: 1px solid #eef2f7;
    align-items: start;
}

.tdN {
    color: #64748b;
    font-size: 12px;
    padding-top: 6px;
}

.tdItem input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    outline: none;
    padding: 6px 0;
    font-size: 12px;
}

.itDesc {
    color: #475569;
}

.tdQty input,
.tdPrice input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    outline: none;
    padding: 6px 0;
    font-size: 12px;
    text-align: right;
}

.tdAmt {
    text-align: right;
    padding-top: 6px;
    font-size: 12px;
}

.amtLine {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.xBtn {
    border: 0;
    background: transparent;
    color: #ef4444;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.addLine {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: #16a34a;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0;
}

.bottomGrid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 18px;
    margin-top: 14px;
}

.blockTitle {
    font-size: 12px;
    font-weight: 800;
    margin: 6px 0;
}

.notesTerms textarea {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    outline: none;
    padding: 8px 0;
    min-height: 56px;
    resize: vertical;
    font-size: 12px;
}

.summaryBox {
    border-left: 0;
    padding-top: 6px;
}

.sumRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 12px;
}

.sumStrong {
    font-weight: 800;
}

.sumDivider {
    height: 12px;
}

.sumDue {
    margin-top: 10px;
    background: #f1f5f9;
    border: 1px solid #e6eaf2;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 10px 10px;
    font-size: 12px;
}

.inlineRight {
    display: flex;
    align-items: center;
    gap: 10px;
}

.miniInput {
    width: 70px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 7px;
    font-size: 12px;
    text-align: right;
    outline: none;
    background: #fff;
}

.sideLabel {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 8px;
}

.sideSection {
    margin-bottom: 14px;
}

.side select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    outline: none;
    background: #fff;
}

.checks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chk {
    font-size: 12px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.downloadBtn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 12px 12px;
    background: #22c55e;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.sideHint {
    margin-top: 10px;
    font-size: 12px;
    color: #ef4444;
    min-height: 18px;
}

/* assets/style.css */
/* Only add these parts if not already present in your CSS */

.miniSelect {
    border: 1px solid var(--border, #e6eaf2);
    border-radius: 6px;
    padding: 6px 7px;
    font-size: 12px;
    outline: none;
    background: #fff;
}

.miniInput {
    border: 1px solid var(--border, #e6eaf2);
    border-radius: 6px;
    padding: 6px 7px;
    font-size: 12px;
    width: 90px;
    outline: none;
}

.inlineRight {
    display: flex;
    align-items: center;
    gap: 8px;
}

.amtLine {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.xBtn {
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}


@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .metaArea {
        align-items: flex-start;
    }

    .titleRow {
        flex-direction: column;
        align-items: flex-start;
    }

    .billGrid {
        grid-template-columns: 1fr;
    }

    .bottomGrid {
        grid-template-columns: 1fr;
    }

    .tableHead, .rows .row {
        grid-template-columns: 34px 1fr 60px 80px 110px 100px;
    }
}