:root {
    --header: var(--navy);
    --navy: #7CAC5A;
    --navy-dark: #5C8A3E;
    --brand-yellow: #C5CB6A;
    --ink: #2A2F28;
    --muted: #6E7768;
    --line: #DCE3D4;
    --line-strong: #E8EDE2;
    --paper: #ffffff;
    --page: #F5F6F3;
    --stepbar: #EBEEE6;
    --select-hover: #E8EFE0;
    --cream: #FAF8F0;
    --cream-line: #EDE6C8;
    --danger: #9f2d2d;
    --ok: #5C8A3E;
    --warn: #b45309;
    --shadow: 0 1px 2px rgba(28, 31, 26, 0.04), 0 10px 28px rgba(28, 31, 26, 0.06);
}

* { box-sizing: border-box; }

* {
    scrollbar-width: thin;
    scrollbar-color: var(--navy) var(--stepbar);
}

*::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

*::-webkit-scrollbar-track {
    background: var(--stepbar);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: var(--navy);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--navy-dark);
}

[x-cloak] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--page);
    font-size: 16px;
    line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

.topbar {
    background: var(--header);
    color: #1C1F1A;
    min-height: 74px;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    min-width: 230px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    height: 48px;
    width: auto;
    display: block;
    border-radius: 6px;
    flex: 0 0 auto;
}

.brand-copy {
    min-width: 0;
}

.brand h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand p {
    margin: 2px 0 0;
    color: rgba(28, 31, 26, 0.72);
    font-size: 13px;
}

.stepbar {
    background: var(--stepbar);
    border-bottom: 1px solid #c9d7e2;
    padding: 10px 22px;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 1180px;
    margin: 0 auto;
}

.step-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: #3d5568;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13.5px;
    font-weight: 600;
}

.step-btn .n {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(124, 172, 90, 0.14);
    color: var(--navy);
    font-size: 12px;
}

.step-btn.active {
    background: transparent;
    color: var(--navy);
}
.step-btn.active .n {
    background: var(--navy);
    color: #0B0B0B;
}
.step-btn.done .n { background: rgba(124, 172, 90, 0.18); color: var(--navy-dark); }
.step-btn.done { color: var(--navy); }

.top-actions { display: flex; gap: 8px; }

.ghost-light {
    background: transparent;
    color: #1C1F1A;
    border: 1px solid rgba(28, 31, 26, 0.28);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
}

.ghost-light:hover { background: rgba(28, 31, 26, 0.08); }

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 22px 72px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}

.layout > div {
    min-width: 0;
}

.card {
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 22px 24px 20px;
}

.card h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.02em;
    color: var(--navy);
}

.lede {
    margin: 6px 0 18px;
    color: var(--muted);
    font-size: 14.5px;
}

.banner {
    background: #fff4f2;
    color: var(--danger);
    border: 1px solid #f0c9c4;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

.field label, .label {
    font-size: 13px;
    font-weight: 650;
    color: #2f3a28;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    min-height: 34px;
    padding: 5px 10px;
    outline: none;
    line-height: 1.35;
    font-size: 0.8125rem;
}

select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 36px;
    accent-color: var(--navy);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75L6 6.25L10.5 1.75' stroke='%23172F40' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
}

select option {
    background: #fff;
    color: var(--ink);
}

select option:checked,
select option:focus {
    background: linear-gradient(0deg, var(--navy) 0%, var(--navy) 100%);
    background-color: var(--navy);
    color: #0B0B0B;
}

select option:hover {
    background: linear-gradient(0deg, var(--select-hover) 0%, var(--select-hover) 100%);
    background-color: var(--select-hover);
    color: var(--navy);
}

.menu {
    position: relative;
    width: 100%;
}

.menu-trigger,
.datepicker-trigger {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--line);
    background-color: #fff;
    border-radius: 8px;
    padding: 5px 36px 5px 10px;
    text-align: left;
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
}

.menu-trigger {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75L6 6.25L10.5 1.75' stroke='%23172F40' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
}

.menu-trigger.open,
.menu-trigger:focus,
.datepicker-trigger:focus,
.datepicker-trigger[aria-expanded="true"] {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(124, 172, 90, 0.18);
    outline: none;
}

.menu-label {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
}

.menu-label.placeholder { color: #93a3b1; }

.datepicker {
    position: relative;
    width: 100%;
}

.datepicker-trigger {
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    color: var(--ink);
}

.datepicker-trigger .placeholder {
    color: #93a3b1;
}

.datepicker-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: var(--navy);
    opacity: 0.85;
}

.datepicker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    width: min(100%, 292px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(11, 11, 11, 0.14);
    padding: 12px;
}

.datepicker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.datepicker-head strong {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--navy);
}

.datepicker-nav {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--navy);
    font-size: 1.1rem;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.datepicker-nav:hover {
    background: var(--select-hover);
}

.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.datepicker-weekdays span {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
    padding: 4px 0;
}

.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.datepicker-day {
    aspect-ratio: 1;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.datepicker-day:hover:not(:disabled):not(.selected) {
    background: var(--select-hover);
    color: var(--navy);
}

.datepicker-day.today:not(.selected) {
    box-shadow: inset 0 0 0 1px var(--navy);
}

.datepicker-day.selected {
    background: var(--navy);
    color: #0B0B0B;
}

.datepicker-day.empty,
.datepicker-day:disabled {
    cursor: default;
    background: transparent;
    color: transparent;
}

.datepicker-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.datepicker-link {
    border: 0;
    background: transparent;
    color: var(--navy);
    font-size: 0.8125rem;
    font-weight: 650;
    cursor: pointer;
    padding: 4px 2px;
}

.datepicker-link:hover {
    text-decoration: underline;
}

.menu-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(11, 11, 11, 0.12);
    padding: 6px;
}

.menu-list.is-fixed {
    position: fixed;
    right: auto;
    z-index: 100;
}

.menu-option {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    font-weight: 500;
}

.menu-option:hover {
    background: var(--select-hover);
    color: var(--navy);
}

.menu-option.active {
    background: var(--navy);
    color: #0B0B0B;
}

.menu-option.active:hover {
    background: var(--navy-dark);
    color: #fff;
}

textarea { min-height: 72px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(124, 172, 90, 0.18);
}

::placeholder { color: #93a3b1; }

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; appearance: textfield; }

.actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.actions.end { justify-content: flex-end; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 650;
    text-decoration: none;
    background: #fff;
    color: var(--navy);
}

.btn-primary { background: var(--navy); color: #0B0B0B; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-outline { border-color: var(--line); background: #fff; }
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.summary { position: sticky; top: 16px; }

.summary-fab { display: none; }

.summary-modal-body .kicker { display: none; }
.kicker {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.summary h2 { font-size: 18px; margin-top: 6px; }
.summary .who { margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.ref { margin: 0 0 10px; color: var(--navy); font-size: 13px; font-weight: 700; }

.totals { display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.totals .grand {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line-strong);
    align-items: baseline;
}
.totals .grand span { color: var(--muted); }
.totals .grand strong { font-size: 26px; color: var(--navy); letter-spacing: -0.03em; }
.meta { margin: 12px 0; color: var(--muted); font-size: 13px; }
.status { margin: 8px 0 0; text-align: center; font-size: 13px; }
.status.dirty { color: var(--warn); }
.status.saved { color: var(--ok); }

.row-between, .split, .card-head, .area-head, .area-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.count { margin: 0; font-weight: 700; color: var(--navy); }

.area-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.area-card {
    text-align: left;
    display: block;
    width: 100%;
    min-height: 74px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.area-card:hover {
    border-color: var(--navy);
    background: var(--select-hover);
    box-shadow: 0 4px 14px rgba(28, 31, 26, 0.08);
    transform: translateY(-1px);
}

.area-card strong { display: block; font-size: 15px; }
.area-card small { color: var(--muted); }
.area-card.selected {
    border-color: var(--navy);
    background: var(--select-hover);
    box-shadow: inset 0 0 0 1px var(--navy);
}

.area-card.selected:hover {
    background: #E0EAD4;
    transform: none;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 650;
}
.pill.active { background: var(--navy); border-color: var(--navy); color: #0B0B0B; }

.area-head { margin: 8px 0 12px; }
.area-head h3 { margin: 0; font-size: 18px; }

.pricing-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-gutter: stable;
}

.pricing-scroll {
    min-width: 680px;
}

.sheet-table {
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.extra-lines {
    margin-bottom: 12px;
}
.line, .line-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 88px 110px 120px;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
}
.line-head {
    background: #f7f9fb;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.line + .line { border-top: 1px solid #eef2f5; }
.item-name span, .item-name { font-weight: 600; }
.item-name small { display: block; color: #8a7344; font-weight: 600; font-size: 12px; }
.line-total { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.line-total.on { color: var(--ink); font-weight: 700; }
.qty, .unit { text-align: right; min-height: 32px; }
.tick { display: grid; place-items: center; }
.tick input { width: 18px; height: 18px; accent-color: var(--navy); }

.extra-box {
    margin-top: 16px;
    background: var(--cream);
    border: 1px solid var(--cream-line);
    border-radius: 12px;
    padding: 14px;
}
.extra-box h3 { margin: 0 0 4px; font-size: 16px; }
.extra-box .help { margin: 0 0 10px; color: #7c6a45; font-size: 13.5px; }
.empty-extra { margin: 0 0 12px; color: #7c6a45; }
.extra-add {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
}
.extra-add .menu {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: auto;
}
.extra-add .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 34px;
    height: 34px;
    padding-left: 12px;
    padding-right: 12px;
}
.extra-lines .line { padding-left: 0; padding-right: 0; }
.remove {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid #e4d3ae;
    background: #fff;
    color: #7c6a45;
    font-size: 18px;
    line-height: 1;
}

.area-total { margin-top: 16px; }
.area-total strong { font-size: 20px; color: var(--navy); }
.area-total .muted { display: block; color: var(--muted); font-size: 13px; }

.scope {
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--muted);
}
.review-area { margin-top: 18px; }
.review-area h3 { margin: 0 0 8px; font-size: 16px; }
.review-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.review-table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 8px 6px;
    border-bottom: 1px solid var(--line-strong);
}
.review-table td { padding: 9px 6px; border-bottom: 1px solid #f1f4f7; vertical-align: top; }
.review-table th:nth-child(1),
.review-table td:nth-child(1) { width: auto; }
.review-table th:nth-child(2),
.review-table td:nth-child(2) { width: 72px; }
.review-table th:nth-child(3),
.review-table td:nth-child(3) { width: 110px; }
.review-table th:nth-child(4),
.review-table td:nth-child(4) { width: 110px; }
.review-table th.num,
.review-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.subtotal { text-align: right; margin: 8px 0 0; font-weight: 700; }

.pair { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 16px; margin-top: 18px; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.who-block {
    color: var(--muted);
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14.5px;
    line-height: 1.45;
}
.who-block strong {
    color: var(--ink);
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}
.who-block span {
    display: block;
}
.who-block .who-address {
    white-space: pre-line;
}

.deposit-row { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.deposit-row .field { max-width: 220px; }
.deposit-figure { text-align: right; }
.deposit-figure strong { display: block; font-size: 22px; color: var(--navy); }
.stack { display: grid; gap: 10px; margin-top: 16px; }
.invoice-row, .draft-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--line-strong);
}
.invoice-row p, .draft-row p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.notes-clip {
    margin: 4px 0 0;
    color: #526576;
    font-size: 14px;
    max-width: 460px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 11, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    z-index: 20;
}
.modal {
    width: min(760px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 96px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin: 0 -8px;
    padding: 0 8px 2px;
    border-radius: 10px;
}
.modal h2 { margin-bottom: 4px; }

.doc-page { max-width: 880px; }
.doc-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    margin-bottom: 0;
}
.sheet { padding: 36px 40px 28px; }
.quotation-card {
    border-radius: 12px;
    padding: 40px 44px 32px;
}

/* Quotation / invoice sheet — wave banner */
.invoice-sheet {
    --is-banner: var(--navy-dark);
    --is-banner-soft: var(--navy);
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-bottom: 16px solid var(--navy-dark);
    border-radius: 22px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(28, 31, 26, 0.08);
}
/* Table wrapper so thead (wave + NO) repeats on every printed page */
.is-print-wrap {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}
.is-print-wrap > thead,
.is-print-wrap > tbody,
.is-print-wrap > thead > tr,
.is-print-wrap > tbody > tr,
.is-print-wrap > thead > tr > td,
.is-print-wrap > tbody > tr > td {
    border: 0;
    padding: 0;
    vertical-align: top;
}
.is-print-wrap > thead {
    display: table-header-group;
}
.is-banner {
    position: relative;
    z-index: 1;
    background: #fff;
}
.is-banner-wave {
    position: relative;
    color: #fff;
    overflow: hidden;
}
.is-banner-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.is-banner-bg svg {
    display: block;
    width: 100%;
    height: 100%;
}
.is-wave-soft { fill: var(--is-banner-soft); }
.is-wave-main { fill: var(--is-banner); }
.is-banner-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 36px 48px 56px;
}
.is-title {
    margin: 0;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    line-height: 1;
    text-transform: uppercase;
}
.is-banner-logo {
    height: 58px;
    width: auto;
    max-width: min(240px, 42%);
    display: block;
    object-fit: contain;
    object-position: right center;
    flex: 0 0 auto;
    margin-left: auto;
}
.is-number {
    margin: 0 0 18px;
    padding: 6px 48px 4px;
    font-size: 22px;
    font-weight: 700;
    color: #2D2D2D;
    text-align: right;
    white-space: nowrap;
    letter-spacing: 0.02em;
    background: #fff;
}
.is-body {
    padding: 4px 48px 34px;
}
.is-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 22px;
}
.is-party h2 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #2f3338;
}
.is-party p {
    margin: 0 0 4px;
    font-size: 14.5px;
    color: #5a616a;
    line-height: 1.45;
}
.is-party .is-name {
    color: #3a4048;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}
.is-party.is-from {
    text-align: right;
}
.is-party .is-date {
    margin: 6px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.is-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.is-table thead th {
    background: var(--is-banner);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 12px 14px;
    border: none;
}
.is-table thead th.num,
.is-table td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.is-table thead th:nth-child(2),
.is-table td:nth-child(2) { width: 70px; }
.is-table thead th:nth-child(3),
.is-table td:nth-child(3) { width: 110px; }
.is-table thead th:nth-child(4),
.is-table td:nth-child(4) { width: 120px; }
.is-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(92, 138, 62, 0.28);
    color: var(--ink);
    font-size: 14px;
    vertical-align: top;
}
.is-table tr.is-area td {
    font-weight: 700;
    background: #F3F6EF;
    border-bottom-color: transparent;
    padding-top: 14px;
    padding-bottom: 8px;
}
.is-body-totals {
    padding-top: 0;
    padding-bottom: 8px;
}
.is-body-closing {
    padding-top: 8px;
}
.is-totals {
    width: min(340px, 100%);
    margin: 0 0 0 auto;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}
.is-print-wrap > tbody > tr.is-totals-row,
.is-print-wrap > tbody > tr.is-totals-row > td {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}
.is-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 0;
    padding: 12px 16px;
    background: #3d4637;
    color: #fff;
    border-radius: 0 0 4px 4px;
}
.is-subtotal span,
.is-subtotal strong {
    font-size: 14px;
    font-weight: 700;
}
.is-total-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 16px;
    color: var(--muted);
    font-size: 14px;
}
.is-total-row strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.is-total-row.is-grand {
    margin-top: 4px;
    background: var(--navy);
    color: #1C1F1A;
    border-radius: 6px;
    padding: 12px 16px;
}
.is-total-row.is-grand span,
.is-total-row.is-grand strong {
    color: #1C1F1A;
    font-weight: 700;
}
.is-total-row.is-grand strong {
    font-size: 20px;
}
.is-total-row.is-balance strong {
    color: var(--navy-dark);
}
.is-terms {
    margin-top: 22px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}
.is-terms p { margin: 0 0 8px; }
.is-notes { color: var(--ink); }
.is-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-top: 28px;
    padding-top: 8px;
}
.is-pay h3 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}
.is-pay p {
    margin: 0 0 4px;
    font-size: 13.5px;
    color: var(--muted);
}
.is-thanks {
    margin: 0;
    font-family: "Caveat", cursive;
    font-size: 42px;
    line-height: 1;
    color: var(--navy-dark);
    font-weight: 600;
    flex: 0 0 auto;
    align-self: flex-start;
}

.doc-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}
.doc-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}
.doc-logo {
    height: 52px;
    width: auto;
    display: block;
    border-radius: 6px;
    flex: 0 0 auto;
}
.doc-kicker {
    margin: 0;
    letter-spacing: 0.06em;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--navy-dark);
}
.doc-ref {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}
.doc-date {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.party {
    margin: 22px 0 26px;
}
.party strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}
.party span {
    display: block;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.45;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
}
.doc-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #7a8794;
    background: #f3f5f7;
    border-bottom: none;
    padding: 10px 12px;
}
.doc-table thead th:first-child {
    border-radius: 6px 0 0 6px;
}
.doc-table thead th:last-child {
    border-radius: 0 6px 6px 0;
}
.doc-table td {
    padding: 11px 12px;
    vertical-align: top;
    border-bottom: 1px solid #eef1f4;
    color: var(--ink);
    font-size: 14.5px;
}
.doc-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.doc-table .area-row td {
    border-bottom: none;
    padding-top: 18px;
    padding-bottom: 2px;
}
.doc-table .area-row + .item-row td {
    border-top: none;
}
.area-label {
    font-weight: 700 !important;
    color: var(--ink) !important;
    font-size: 15px !important;
    padding-left: 12px !important;
}
.item-desc { font-weight: 500; }
.item-meta { color: var(--muted); font-weight: 400; }
.empty-doc {
    color: var(--muted);
    padding: 18px 12px !important;
}

.totals-block {
    width: min(360px, 100%);
    margin-left: auto;
    margin-top: 22px;
}
.totals-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 16px;
    color: var(--muted);
    font-size: 14.5px;
}
.totals-row span:last-child {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.doc-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 10px;
    padding: 14px 16px;
    border-top: none;
    background: #EEF3E8;
    border-radius: 8px;
}
.doc-total span {
    font-weight: 700;
    color: var(--ink);
    font-size: 15px;
}
.doc-total strong {
    font-size: 30px;
    font-weight: 700;
    color: var(--navy-dark);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.terms {
    margin-top: 28px;
}
.terms h3,
.notes-block h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}
.terms p,
.notes-block p {
    margin: 0;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.5;
}
.notes-block { margin-top: 18px; }

.sample {
    margin-top: 22px;
    margin-bottom: 0;
    background: #f8f1e4;
    border: none;
    color: #6f5d3d;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.45;
}
.pay-note { margin-top: 16px; color: var(--muted); }

.payment-due {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eef1f4;
}
.payment-due h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}
.payment-due .totals-block {
    margin-top: 0;
}
.payment-due .balance-row {
    color: var(--muted);
}
.payment-due .balance-row span:last-child {
    font-weight: 600;
}

@media (max-width: 980px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 12px;
    }
    .brand { min-width: 0; }
    .brand-logo { height: 42px; }
    .topbar .top-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }
    .topbar .top-actions .ghost-light {
        width: auto;
        flex: 1 1 0;
        white-space: nowrap;
    }
    .draft-actions .btn {
        width: 100%;
    }
    .stepbar { padding: 10px 14px; }
    .steps { justify-content: center; }
    .step-btn:not(.active) { display: none; }
    .page { padding: 16px 14px 88px; }
    .layout,
    .form-grid,
    .pair,
    .area-grid {
        grid-template-columns: 1fr;
    }
    .summary-desktop { display: none; }
    .summary-fab {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        right: 16px;
        bottom: 16px;
        z-index: 15;
        border: 0;
        border-radius: 999px;
        background: var(--navy);
        color: #fff;
        padding: 12px 18px;
        box-shadow: 0 10px 28px rgba(11, 11, 11, 0.28);
        font-weight: 700;
    }
    .summary-fab-label {
        font-size: 12px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        opacity: 0.8;
    }
    .summary-fab strong { font-size: 16px; }
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
    .actions .btn,
    .actions a.btn {
        width: 100%;
    }
    .actions span[style] { display: none; }
    .pricing-card .actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .pricing-card .actions .btn,
    .pricing-card .actions a.btn {
        width: auto;
        flex: 1 1 0;
    }
    .line, .line-head { grid-template-columns: 44px minmax(160px, 1fr) 72px 88px 92px; }
    .pricing-scroll {
        min-width: 680px;
    }
    .extra-add {
        flex-wrap: nowrap;
        width: 100%;
    }
    .extra-add .menu {
        max-width: none;
        flex: 1 1 auto;
        min-width: 0;
    }
    .deposit-row { flex-direction: column; align-items: stretch; }
    .deposit-figure { text-align: left; }
    .sheet,
    .quotation-card { padding: 22px 18px; }
    .doc-kicker { font-size: 24px; }
    .doc-total strong { font-size: 24px; }
    .doc-bar {
        flex-direction: column;
    }
    .doc-bar .btn {
        width: 100%;
    }
    .modal-back {
        align-items: flex-end;
        padding: 0;
    }
    .summary-modal {
        width: 100%;
        max-height: min(88dvh, 100%);
        border-radius: 16px 16px 0 0;
        margin: 0;
    }
    .draft-row {
        flex-direction: column;
        align-items: stretch;
    }
    .draft-actions {
        width: 100%;
        flex-direction: column;
    }
}

@media screen and (max-width: 720px) {
    .invoice-sheet { border-radius: 14px; }
    .is-banner-row { padding: 28px 18px 48px; }
    .is-banner-logo { height: 48px; }
    .is-number { padding: 6px 18px 8px; }
    .is-body { padding: 4px 18px 20px; }
    .is-parties { grid-template-columns: 1fr; gap: 18px; }
    .is-party.is-from { text-align: left; }
    .is-title { font-size: 28px; }
    .is-footer { flex-direction: column; align-items: flex-start; }
    .is-thanks { align-self: flex-end; }
}

@page {
    margin: 0;
    size: auto;
}

@media print {
    html,
    body,
    .doc-body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .no-print { display: none !important; }
    .page,
    .doc-page {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .sheet,
    .quotation-card,
    .invoice-sheet {
        box-shadow: none !important;
        border: none !important;
        border-bottom: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        display: block !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .is-print-wrap {
        width: 100% !important;
    }
    .is-print-wrap > thead {
        display: table-header-group !important;
    }
    /* Keep Bill To | Project Name side-by-side in print */
    .is-parties {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 40px !important;
    }
    .is-party.is-from {
        text-align: right !important;
    }
    .is-footer {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
    }
    .is-thanks {
        align-self: flex-start !important;
    }
    /* Keep Sub Total + VAT + Grand total together (own table row) */
    .is-print-wrap > tbody > tr.is-totals-row,
    .is-print-wrap > tbody > tr.is-totals-row > td,
    .is-totals {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-column-break-inside: avoid !important;
    }
    .is-totals {
        display: table !important;
        width: min(340px, 100%) !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    .is-wave-soft,
    .is-wave-main,
    .is-table thead th,
    .is-subtotal,
    .is-total-row.is-grand,
    .is-table tr.is-area td {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .doc-table thead th {
        background: #f3f5f7 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
