:root {
  color-scheme: light;
  --navy: #152031;
  --ink: #172338;
  --muted: #526072;
  --border: #dce2e9;
  --base: #f3f5f8;
  --gold: #faeaa5;
  --orange: #e69733;
  --accent: #7b460a;
  --danger: #a52828;
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.45;
  color: var(--ink);
  background: var(--base);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #397ac0; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; top: -100px; left: 12px; z-index: 5; background: white; padding: 10px; }
.skip:focus { top: 12px; }
.wrap { width: min(1200px, calc(100% - 56px)); margin: 0 auto; }
.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid var(--orange); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 24px; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--gold); text-decoration: none; }
.monogram { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #d8bb71; border-radius: 7px; font: 700 26px Georgia, serif; }
.wordmark { display: grid; gap: 2px; font: 800 .92rem Montserrat, sans-serif; letter-spacing: .16em; line-height: 1.1; }
.wordmark small { font-size: .66rem; letter-spacing: .22em; color: #f3f1e8; }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-size: .88rem; color: #e3e8ef; text-decoration: none; font-weight: 600; }
nav a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 5px; }
.hero { padding: 31px 0 24px; }
h1, h2, h3 { font-family: Montserrat, system-ui, sans-serif; margin: 0; line-height: 1.16; }
h1 { font-size: clamp(1.75rem, 4vw, 2.45rem); letter-spacing: -.045em; }
h2 { font-size: 1.21rem; letter-spacing: -.024em; }
h3 { font-size: .97rem; }
p { margin: 0; color: var(--muted); }
.hero p, .card-head p { margin-top: 7px; }
.workspace { display: grid; grid-template-columns: 1.12fr 1fr; gap: 18px; align-items: start; }
.card { min-width: 0; background: white; border: 1px solid var(--border); border-radius: 13px; padding: 21px; box-shadow: 0 2px 4px #18263b07; scroll-margin-top: 14px; }
.card-head { margin-bottom: 16px; }
.card-head p { font-size: .9rem; }
.switch { display: flex; gap: 3px; background: #eef1f5; border-radius: 8px; padding: 4px; margin-bottom: 13px; }
.switch button { flex: 1; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 6px; padding: 7px 4px; font-size: .88rem; font-weight: 700; }
.switch button[aria-pressed="true"] { border-color: var(--border); background: white; color: var(--ink); box-shadow: 0 1px 2px #17233812; }
.note { padding: 9px 11px; background: #fffaeb; border: 1px solid #f2e2b5; border-radius: 7px; color: #674615; font-size: .85rem; margin-bottom: 11px; }
.note strong { color: #563605; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: 8px 6px; border-bottom: 1px solid #e8ecf0; text-align: left; }
thead th { color: var(--muted); font-weight: 700; background: #f5f7fa; font-size: .82rem; }
tbody th { font-weight: 600; }
td.money, th.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.use-cell { width: 1%; padding-left: 9px; }
.use { color: var(--accent); background: #fff8ea; border: 1px solid #eed9af; border-radius: 5px; padding: 3px 7px; font-weight: 700; font-size: .81rem; }
.use:hover, .outline:hover { background: #ffefd2; }
.row-note { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 3px; }
.details { margin-top: 12px; padding-top: 11px; border-top: 1px solid #e8ecf0; }
.details summary { cursor: pointer; font-size: .875rem; font-weight: 700; color: var(--ink); }
.details p, .details li { font-size: .875rem; margin: 8px 0; color: var(--muted); }
.details ul { margin: 8px 0 0; padding-left: 19px; }
.field { display: block; min-width: 0; font-size: .875rem; font-weight: 700; }
.field input, .field select, textarea { display: block; width: 100%; border: 1px solid #cbd3de; border-radius: 7px; padding: 8px 9px; margin-top: 5px; min-height: 41px; color: var(--ink); background: #fff; font-weight: 500; }
.field input { font-size: 1rem; }
.field input::placeholder, textarea::placeholder { color: #687587; opacity: 1; }
.field select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #506072 50%), linear-gradient(135deg, #506072 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
.field span.optional { color: var(--muted); font-size: .79rem; font-weight: 400; }
.piece { background: #f6f8fa; border: 1px solid #e3e8ee; border-radius: 8px; padding: 9px; margin-bottom: 8px; }
.piece-top { display: grid; grid-template-columns: minmax(0, .75fr) minmax(104px, 1fr) 28px; gap: 8px; align-items: end; }
.piece-name { grid-column: 2 / -1; }
.piece-top .optional { font-size: .76rem; }
.remove { display: grid; place-items: center; height: 41px; border: 0; background: transparent; color: #536175; font-size: 1.55rem; border-radius: 5px; padding: 0; }
.remove:hover { background: #ebe1e1; color: #842727; }
.line-result { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .82rem; padding-top: 7px; }
.line-price { color: var(--ink); white-space: nowrap; }
.line-result.invalid .line-rate { color: var(--danger); }
.btn { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 6px; border-radius: 7px; padding: 7px 12px; font-size: .88rem; font-weight: 700; }
.outline { background: #fffaf0; color: var(--accent); border: 1px solid #ecd7ae; }
.add { margin: 1px 0 11px; }
.calc-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #eedbb6; background: #fff7e6; border-radius: 8px; padding: 10px 12px; }
.calc-total span, .quote-total span { display: block; font-weight: 700; font-size: .89rem; }
.calc-total small { display: block; color: #6a5635; font-size: .81rem; margin-top: 2px; }
output { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.27rem; }
.form-error { color: var(--danger); font-size: .85rem; margin: 0 0 8px; }
.quote { margin-top: 18px; }
.quote-grid { display: grid; grid-template-columns: 1fr 1.12fr; gap: 21px; }
.quote-fields > * + * { margin-top: 11px; }
.customer-fields, .amount-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.product-field { min-width: 0; }
#produto-manual-campo { margin-top: 9px; }
.amount-fields:not(:has(> :not([hidden]))) { display: none; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 700; }
.check-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.field-note { font-size: .84rem; }
.quote-total { color: #fff; background: var(--navy); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 13px; border-radius: 7px; }
.quote-total output { color: var(--gold); }
textarea { min-height: 175px; resize: vertical; color: var(--ink); background: #f8fafc; line-height: 1.5; font-size: .91rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
.primary { color: #251503; background: var(--orange); border: 1px solid #c77c1d; }
.primary:hover:not(:disabled) { background: #f1ad56; }
.primary:disabled { color: #526072; background: #e8edf3; border-color: #dce2e9; }
#status-copia { color: #315e40; font-size: .85rem; }
footer { color: var(--muted); padding: 17px 0 24px; font-size: .82rem; }
@media (max-width: 880px) {
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { flex-wrap: wrap; gap: 12px; padding: 12px 0; }
  nav { gap: 14px; flex-wrap: wrap; }
  .hero { padding: 21px 0 17px; }
  .card { padding: 13px; }
  .quote-grid { grid-template-columns: 1fr; gap: 16px; }
  th, td { padding-inline: 4px; }
}
@media (max-width: 365px) {
  .customer-fields { grid-template-columns: 1fr; }
  .amount-fields { grid-template-columns: 1fr; }
  .piece-code, .piece-name { grid-column: 1 / -1; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[aria-invalid="true"] { border-color: #be5555 !important; }
#porto-autorizacao-campo { margin-top: 9px; }
.sku-status, #conexao-orcamento, #status-envio { margin-top: 7px; }
#alerta-distancia { width: min(450px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 12px; padding: 22px; color: var(--ink); }
#alerta-distancia::backdrop { background: #152031a6; }
#alerta-distancia p { margin: 12px 0; }
#alerta-distancia .actions { justify-content: end; }
#desconto-admin .amount-fields, #desconto-codigo-campo { margin-top: 9px; }
.quote-breakdown { margin-bottom: 0; padding: 0 3px; font-size: .875rem; }
.quote-breakdown div { display: flex; justify-content: space-between; gap: 8px; padding-block: 3px; }
.quote-breakdown dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: 8px; align-items: center; font-size: .875rem; }
.service-line strong { white-space: nowrap; }

.mode-switch { max-width: 550px; margin-bottom: 18px; }
.proposal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 18px; align-items: start; }
.proposal-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.proposal-wide { grid-column: 1 / -1; }
.proposal-fields textarea { min-height: 78px; background: white; }
.proposal-prices { min-width: 0; margin: 15px 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.proposal-prices legend { padding-inline: 5px; font-size: .875rem; font-weight: 700; }
.proposal-item { display: grid; grid-template-columns: minmax(48px, .7fr) minmax(64px, 1fr) minmax(98px, 1fr) 28px; gap: 8px; align-items: end; margin-bottom: 10px; }
.proposal-item-name { grid-column: 1 / -1; }
#proposta-status { margin-top: 8px; }
.proposal-paper { padding: 25px; overflow-wrap: anywhere; }
.proposal-paper-heading { border-bottom: 2px solid var(--orange); padding-bottom: 12px; }
.proposal-paper-heading h2 { margin: 5px 0; font-size: 1.5rem; }
.proposal-brand { color: var(--accent); font-size: .875rem; font-weight: 800; letter-spacing: .1em; }
.proposal-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 16px 0; }
.proposal-meta dt { font-size: .78rem; color: var(--muted); font-weight: 700; }
.proposal-meta dd { margin: 2px 0 0; font-size: .875rem; }
.proposal-paper h3 { margin: 15px 0 5px; }
.proposal-paragraph { white-space: pre-wrap; font-size: .9rem; }
.proposal-investment th:nth-child(n+3), .proposal-investment .money { text-align: right; }
.proposal-grand-total { margin-top: 11px; text-align: right; font-weight: 800; color: var(--ink); }
@media (max-width: 880px) {
  .proposal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 385px) {
  .proposal-fields { grid-template-columns: 1fr; }
  .proposal-prices { padding: 8px; }
  .proposal-item { grid-template-columns: minmax(45px, .5fr) minmax(55px, .7fr) minmax(82px, 1fr) 21px; gap: 5px; }
  .proposal-paper { padding: 14px; }
}
@media print {
  @page { size: A4; margin: 15mm; }
  body.printing-proposal { background: white; }
  .printing-proposal > :not(main),
  .printing-proposal main > :not(#propostas),
  .printing-proposal .proposal-layout > :not(#proposta-previa) { display: none !important; }
  .printing-proposal main { width: auto; margin: 0; }
  .printing-proposal .proposal-layout { display: block; }
  .printing-proposal .proposal-paper { padding: 0; border: 0; box-shadow: none; }
  .printing-proposal h2, .printing-proposal h3, .printing-proposal .proposal-paper-heading { break-after: avoid; }
  .printing-proposal tr, .printing-proposal .proposal-meta > div { break-inside: avoid; }
  .printing-proposal .proposal-grand-total { break-before: avoid; }
}

.proposal-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.proposal-options { position: relative; flex: 0 0 auto; }
.proposal-options summary { cursor: pointer; color: var(--accent); font-size: .875rem; font-weight: 600; }
.proposal-options-list { position: absolute; z-index: 2; inset: auto 0 auto auto; min-width: 185px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: white; box-shadow: 0 5px 15px #15203118; }
.proposal-options-list button { display: block; width: 100%; padding: 8px; border: 0; border-radius: 4px; background: white; text-align: left; font: inherit; font-size: .875rem; color: var(--ink); white-space: nowrap; }
.proposal-options-list button:hover { background: #fbf8ed; }
#proposta-cliente-manual { margin-top: 9px; }
#proposta-arquivo { border: 1px solid var(--border); border-radius: 12px; width: min(540px, calc(100% - 28px)); padding: 18px; color: var(--ink); }
#proposta-arquivo::backdrop { background: #152031a6; }
.dialog-heading, #proposta-arquivo-lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#proposta-arquivo-lista { list-style: none; margin: 8px 0; padding: 0; max-height: 55vh; overflow: auto; }
#proposta-arquivo-lista li { border-bottom: 1px solid var(--border); padding: 8px 0; }
.proposal-cover { display: grid; justify-items: center; text-align: center; border: 1px solid #dccda8; border-radius: 8px; background: #fbf8ed; color: var(--ink); padding: 14px; margin-bottom: 18px; }
.proposal-cover h2 { margin: 5px 0; }
.proposal-cover-client { font-weight: 600; }
.proposal-cover-number { margin-top: 4px; }
.proposal-logo { display: block; width: min(145px, 100%); height: auto; object-fit: contain; }
.proposal-paper-heading { border-bottom-color: #b39858; }
@media print {
  .printing-proposal .proposal-cover {
    box-sizing: border-box;
    min-height: 250mm;
    margin: 0;
    padding: 8mm 7mm;
    align-content: center;
    border: 1px solid #b39858;
    border-radius: 0;
    break-after: page;
  }
  .printing-proposal .proposal-logo { width: min(166mm, 94%); }
  .printing-proposal .proposal-cover h2 { font-size: 30pt; margin: 1.5mm 0 4mm; }
  .printing-proposal .proposal-cover-client { font-size: 16pt; }
  .printing-proposal .proposal-cover-number { margin-top: 3mm; }
  .printing-proposal .proposal-paper-heading { padding-bottom: 4mm; }
  .printing-proposal .proposal-meta { border-bottom: 1px solid #dccda8; padding-bottom: 4mm; margin-bottom: 6mm; }
  .printing-proposal .proposal-grand-total { border-top: 1px solid #b39858; padding-top: 3mm; }
}

.proposal-pricing { margin: 16px 0; }
.proposal-pricing .proposal-prices { margin: 10px 0; }
.proposal-item output[data-item-total] { display: flex; align-items: center; min-height: 41px; margin-top: 5px; font-size: .92rem; overflow-wrap: anywhere; }
.proposal-block-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 10px 0 0; border-top: 1px solid var(--border); padding-top: 8px; font-size: .875rem; }
.proposal-block-total output { font-size: 1rem; color: var(--ink); }
.proposal-investment caption { text-align: left; font-weight: 700; padding: 7px 0 3px; }
.proposal-investment tfoot { font-weight: 700; }
@media (max-width: 480px) {
  .proposal-item { grid-template-columns: minmax(45px, .6fr) minmax(88px, 1fr) minmax(80px, .9fr) 23px; gap: 5px; }
}
