:root {
    --black: #0a0a0a;
    --graphite: #252525;
    --muted: #77736f;
    --line: #dedbd7;
    --soft: #f4f2f0;
    --paper: #ffffff;
    --page-bg: #e9e7e4;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    color: var(--graphite);
    font-family: Arial, Helvetica, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

body { min-height: 100vh; }

.toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(10, 10, 10, 0.93);
    backdrop-filter: blur(8px);
}

.toolbar button,
.toolbar .btn {
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    padding: 10px 18px;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-transform: initial;
}

.toolbar button:hover,
.toolbar .btn:hover {
    background-color: rgba(255,255,255,.25);
    color: #fff;
}

.toolbar button.secondary {
    background: transparent;
    color: #fff;
}

#proposal-root {
    display: grid;
    justify-content: center;
    padding: 18px 0 30px;
}

.offer-page {
    width: 210mm;
    min-height: 297mm;
    background: var(--paper);
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.brand-bar {
    min-height: 30mm;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 11mm 12mm 8mm;
    background: var(--black);
    color: #fff;
}

.brand-logo {
    font-size: 34px;
    line-height: .95;
    font-weight: 800;
    letter-spacing: -2px;
}

.brand-subtitle {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.2;
    color: rgba(255,255,255,.92);
}

.document-caption {
    align-self: flex-start;
    color: rgba(255,255,255,.72);
    font-size: 10px;
    line-height: 1.35;
    letter-spacing: .08em;
    text-align: right;
    text-transform: uppercase;
}

.page-body {
    padding: 8mm 10mm 8mm;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 48mm;
    gap: 7mm;
    align-items: stretch;
    padding-bottom: 5mm;
    border-bottom: 1px solid var(--line);
}

h1 {
    margin: 0;
    color: var(--black);
    font-size: 21px;
    line-height: 1.05;
    letter-spacing: -.35px;
}

.lead {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.offer-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    margin-top: 13px;
    font-size: 11px;
    line-height: 1.35;
}

.offer-meta b { color: var(--black); }

.qr-card {
    display: flex;
    justify-content: flex-end;
}

.qr-visual {
    width: 29mm;
    height: 29mm;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px dashed #bbb5b0;
    background: #fff;
    color: #918b86;
    font-size: 8px;
    line-height: 1.15;
    text-align: center;
    background-image: url("img/qr.svg");
    background-size: cover ;
}

.qr-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.qr-copy strong {
    display: block;
    margin-bottom: 4px;
    color: var(--black);
    font-size: 10px;
    line-height: 1.1;
    text-transform: uppercase;
}

.qr-copy span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.3;
    word-break: break-word;
}

.table-wrap { padding-top: 6mm; }

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 7px;
}

.section-heading-note-only {
    justify-content: flex-end;
}

.section-title {
    margin: 0;
    color: var(--black);
    font-size: 12px;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.section-note {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.25;
    text-align: right;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

thead { display: table-header-group; }
tr { break-inside: avoid; page-break-inside: avoid; }

th, td {
    padding: 6px 5px;
    border: 1px solid var(--line);
    vertical-align: middle;
    font-size: 9px;
    line-height: 1.25;
    word-break: break-word;
}

th {
    background: var(--soft);
    color: #504b47;
    font-weight: 700;
    text-align: left;
}

td { color: var(--black); }
.center { text-align: center; }
.num { text-align: right; white-space: nowrap; }

.product-thumb {
    width: 18mm;
    height: 18mm;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;

}

.product-thumb img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.product-name {
    color: var(--black);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
}

.product-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.35;
}

.product-link {
    display: inline-block;
    margin-top: 3px;
    color: var(--graphite);
    font-size: 8px;
    line-height: 1.25;
    text-decoration: underline;
    word-break: break-all;
}

.summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68mm;
    gap: 7mm;
    align-items: start;
    padding-top: 7mm;
}

.summary-note {
    padding: 9px 10px;
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.summary-note strong { color: var(--black); }

.totals {
    border: 1px solid var(--line);
    background: #fff;
}

.totals-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    border-bottom: 1px solid var(--line);
    color: #4b4743;
    font-size: 10px;
    line-height: 1.25;
}

.totals-line:last-child { border-bottom: 0; }

.totals-line strong {
    color: var(--black);
    white-space: nowrap;
}

.totals-line.grand-total {
    padding: 10px 9px;
    background: var(--black);
    color: rgba(255,255,255,.75);
    font-size: 11px;
    text-transform: uppercase;
}

.totals-line.grand-total strong {
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

.bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68mm;
    gap: 7mm;
    align-items: stretch;
    padding-top: 7mm;
}

.contact-box,
.conditions-box {
    border: 1px solid var(--line);
    background: #fff;
}

.box-title {
    margin: 0;
    padding: 8px 9px;
    background: var(--black);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.contacts {
    display: grid;
    grid-template-columns: 40mm 1fr;
    margin: 0;
}

.contacts dt,
.contacts dd {
    min-height: 21px;
    margin: 0;
    padding: 5px 7px;
    border-bottom: 1px solid var(--line);
    font-size: 9px;
    line-height: 1.3;
}

.contacts dt {
    background: var(--soft);
    color: #5a544f;
    font-weight: 700;
}

.contacts dd {
    color: var(--black);
    word-break: break-word;
}

.contacts dt:last-of-type,
.contacts dd:last-of-type { border-bottom: 0; }

.conditions {
    margin: 0;
    padding: 9px 10px 10px 25px;
    color: #5a544f;
    font-size: 9px;
    line-height: 1.45;
}

.conditions li + li { margin-top: 4px; }

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 5mm;
    color: #928c87;
    font-size: 9px;
    line-height: 1.3;
}

/* @media (max-width: 900px) {
#proposal-root { display: block; padding: 0; }
.offer-page { width: 100%; min-height: auto; box-shadow: none; }
.page-body { padding: 20px 14px; }
.intro-grid, .summary-row, .bottom-grid { grid-template-columns: 1fr; }
.qr-card { max-width: 320px; }
.table-wrap { overflow-x: auto; }
table { min-width: 840px; }
} */

@media print {
    html, body { background: #fff; }
    .toolbar { display: none !important; }
    #proposal-root { display: block; padding: 0; }
    .offer-page {
        width: 210mm;
        min-height: 297mm;
        box-shadow: none;
    }
    .brand-bar,
    .intro-grid,
    .summary-row,
    .bottom-grid,
    .page-footer { break-inside: avoid; page-break-inside: avoid; }

}

@page {
    size: A4 portrait;
    margin: 0;
}
