:root {
  color-scheme: light;
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  --ink:#25211d; --muted:#665e55; --line:#e3dbcf; --paper:#fff; --bg:#f6f3ee;
  --accent:#f8b75b; --deep:#2b221b; --green:#25613f; --alert:#922f23;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
.recovery-channel{border:0;padding:0;margin:0;min-inline-size:0}
body{margin:0;background:var(--bg);color:var(--ink)}
.top{display:flex;align-items:center;justify-content:space-between;gap:22px;flex-wrap:wrap;padding:16px max(24px,calc((100% - 1320px)/2));background:var(--deep);color:white}
.brand{display:flex;align-items:center;gap:12px;font-weight:650;white-space:nowrap}
.brand b{font-size:18px;background:var(--accent);color:var(--deep);padding:9px 10px;border-radius:7px;letter-spacing:.05em}
small{display:block;color:var(--muted);font-size:.82em}
.brand small{color:#ddc9b8}
nav,.actions,.inline{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
nav button{background:transparent;color:#f0e8df;border-color:transparent}
nav button[aria-current="page"]{background:#4a3828;color:#ffd290;border-color:#705338}
nav .exit-button{border-color:#87694e;color:#ffddad}
main{max-width:1370px;margin:auto;padding:32px 24px 66px}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(25px,3vw,38px);letter-spacing:-.035em}
h2{font-size:20px;letter-spacing:-.015em}
h3{font-size:16px}
p{color:var(--muted);margin-top:6px}
.hero,.panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap}
.hero{margin-bottom:22px}
.panel{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:18px;margin:0 0 16px}
.panel-head{margin-bottom:14px}
.stack{display:grid;gap:13px}
.fields,.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:12px}
label{display:grid;align-content:start;gap:5px;color:var(--muted);font-size:13px;font-weight:600}
label.check{display:flex;align-items:center}
input,select,textarea{font:inherit;color:var(--ink);min-width:0;width:100%;border:1px solid #cbbfb0;border-radius:7px;background:#fffdf9;padding:7px 9px}
input[type=checkbox]{width:auto}
input[type=file]{max-width:325px}
.password-field{display:grid;align-content:start;gap:5px}
.password-input{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
.password-input input::-ms-reveal{display:none}
.password-input button{min-width:5.25rem;padding-inline:8px;font-size:13px}
.recovery-link{justify-self:start}
#send-recovery{align-self:end}
#one-time-code{font:14px monospace}
textarea{resize:vertical;min-height:66px}
:focus-visible{outline:3px solid #a46627;outline-offset:2px}
button,.button{display:inline-block;font:inherit;font-weight:650;cursor:pointer;border:1px solid #cbbfb0;border-radius:7px;background:#fff;color:var(--ink);padding:7px 12px;text-decoration:none}
button:hover,.button:hover{filter:brightness(.96)}
button.primary,.button.primary{background:var(--accent);border-color:#dc9e49;color:#2d2112}
button.danger{color:var(--alert);border-color:#dcb8af}
button:disabled{cursor:not-allowed;opacity:.55}
.scroll{overflow:auto;max-height:64vh;border:1px solid var(--line);border-radius:8px}
table{border-collapse:separate;border-spacing:0;width:100%;text-align:left}
th,td{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
thead th{position:sticky;top:0;background:#f2ebe1;z-index:1;font-size:13px}
tbody tr:last-child td,tfoot tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fdfaef}
.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.empty{text-align:center;padding:30px 16px;color:var(--muted)}
.materials{min-width:1080px}
.estimate-table{min-width:960px}
.estimate-table .paint-cell{min-width:155px}
.estimate-table .sale-factor-cell{min-width:145px}
.estimate-item-scope{display:block;width:auto;max-width:100%;margin:.2rem 0;font-size:.82rem}
.line-filters{margin-bottom:12px;gap:8px}
.line-filter{position:relative;font-size:13px}
.line-filter summary{cursor:pointer;border:1px solid #cbbfb0;border-radius:7px;padding:6px 9px;background:#fffdf9;font-weight:650}
.line-filter summary span{margin-left:6px;color:var(--green)}
.line-filter-menu{position:absolute;z-index:4;top:calc(100% + 4px);inset-inline-start:0;width:min(290px,78vw);padding:10px;
  border:1px solid #cbbfb0;border-radius:8px;background:white;box-shadow:0 4px 14px #2b221b25}
.line-filter-menu .actions{margin:8px 0;gap:5px}
.line-filter-menu button,.line-bulk button{font-size:13px}
.line-filter-options{max-height:235px;overflow:auto;padding-inline:3px}
.line-filter-options label{padding:5px 0;overflow-wrap:anywhere}
.line-bulk{background:#f8f4eb;border-radius:7px;padding:6px 9px}
.extra-factor{display:flex;align-items:end;gap:6px}
.extra-factor label{flex:1}
.extra-factor button{font-size:13px}
.composition-intro{margin:0 0 14px}
.margin-fields{margin-top:12px}
.fork-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,410px),1fr));gap:14px}
.fork-item{border:1px solid var(--line);border-radius:9px;padding:14px}
.fork-title{font-size:15px;color:var(--ink);margin-bottom:10px}
.fork-item .fields{margin-bottom:12px}
.fork-item h3{margin:12px 0 7px}
.fork-item .fork-head{align-items:center;gap:8px;margin-bottom:8px}
.fork-item .fork-head h3{margin:0;overflow-wrap:anywhere}
.fork-identification{margin-top:10px}
.fork-preview{background:#f3f8f1;border-radius:7px;padding:7px 9px;color:var(--green);font-weight:650}
.fork-memory{margin:10px 0}
.fork-memory div{display:flex;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);padding:4px 0}
.fork-memory dd{margin:0;font-weight:650;text-align:right}
.fork-prices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,120px),1fr));gap:8px;margin-top:12px}
.fork-prices .metric{padding:8px;background:#f3f8f1}
.fork-prices .metric strong{font-size:16px;white-space:normal}
.fork-prices .metric:nth-child(2){border-color:#a1b79f;color:var(--green)}
.material-identity{min-width:215px}
.material-unit{min-width:117px}
.supplier-cell{min-width:128px}
.best-quote{min-width:115px;font-variant-numeric:tabular-nums;background:#f3f8f1}
.applied-quote{min-width:155px}
.best-quote strong{white-space:nowrap}
.applied-quote small{margin-top:4px}
#supplier-dialog{width:min(475px,calc(100% - 24px))}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
td .inputs{display:grid;gap:5px}
td .inputs input{padding:5px 7px}
.quote-best{color:var(--green);font-weight:700}
.strong{color:var(--green)}
.warn{color:var(--alert)}
.metrics{margin-bottom:16px}
.metric{background:white;border:1px solid var(--line);border-radius:10px;padding:13px 15px}
.metric strong{display:block;font-size:21px;margin-top:3px;white-space:nowrap}
.budget-metrics{grid-template-columns:repeat(auto-fit,minmax(min(100%,176px),1fr))}
.budget-metrics .metric strong{font-size:clamp(16px,1.65vw,21px)}
.budget-summary:not([open])>summary,.budget-summary .budget-metrics{margin-bottom:0}
.budget-summary:not([open]) .budget-summary-hide,.budget-summary[open] .budget-summary-show{display:none}
.index-target-input{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-top:12px}
.index-target-preview{border-top:1px solid var(--line);margin-top:12px;padding-top:10px;gap:6px;justify-items:start}
details>summary{cursor:pointer;font-weight:700;margin-bottom:8px}
dialog{width:min(870px,calc(100% - 24px));max-height:90vh;overflow:auto;border:1px solid var(--line);border-radius:12px;padding:24px;color:var(--ink);box-shadow:0 16px 64px #0004}
dialog::backdrop{background:#2b221b99}
dialog section{margin:12px 0}
.form-type-control{grid-column:1/-1;display:grid;gap:6px}
.form-type-control .actions button{font-size:13px;padding:4px 9px}
.form-type-control [role=status]{font-size:13px}
.component{display:grid;grid-template-columns:minmax(180px,2fr) minmax(120px,1fr) auto;gap:8px;align-items:end;margin-top:8px}
#notice{position:fixed;bottom:20px;right:20px;max-width:min(520px,calc(100% - 40px));z-index:10;background:var(--deep);color:#fff;padding:12px 16px;border-radius:8px;box-shadow:0 4px 20px #0003}
.actions.end{justify-content:flex-end;margin-top:12px}
.subtotal,.total{font-weight:700;background:#f6efe3}
.cost-subrow td:first-child{padding-left:25px}
.cost-breakdown{margin:8px 0 12px;max-height:none}
.freight-planning{max-height:300px;margin-top:10px}
.freight-planning input[type=checkbox]{width:auto}
.freight-planning input[type=number]{min-width:100px}
.terms{white-space:pre-wrap}
.proposal{max-width:850px;margin:auto}
.proposal h1{margin:24px 0 10px}
.proposal h2{margin:20px 0 8px}
.proposal .byline{color:var(--muted);font-weight:700;letter-spacing:.04em}
.proposal-revision-changes h3{break-after:avoid}
.proposal-revision-changes p{white-space:pre-line;overflow-wrap:anywhere}
#proposal-editor[open]>*+*{margin-top:12px}
.proposal-clause-editor{display:grid;gap:14px}
.proposal-editor-clause{padding-top:12px;border-top:1px solid var(--line)}
.proposal-editor-clause summary small{display:inline;margin-inline-start:6px;font-weight:400}
.proposal-editor-clause textarea{line-height:1.45}
.proposal-editor-clause button{margin-top:6px}
.proposal-clause-actions{justify-content:flex-start;margin:5px 0 10px}
.proposal-scope-preview{margin-top:10px;padding:6px 10px;border-left:3px solid var(--line)}
.proposal-clause-title{font-size:15px;color:var(--ink)}
.proposal-editor-clause h4{margin:0}
.proposal-additional-information{min-height:165px;line-height:1.5}
.proposal-standard-section h3{margin:12px 0 4px}
.proposal-standard-section ul{padding-left:1.4em;margin:6px 0 10px}
.proposal-standard-section li+li{margin-top:4px}
.proposal [data-proposal-clause="items"] h3{margin:14px 0 6px;break-after:avoid}
.proposal-floor-subtotal{background:#f7f4ed}
.proposal-sections-subtotal{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:9px 10px;margin:14px 0}
.proposal-grand-total{font-size:20px;margin-top:12px;padding:3px 5px;color:var(--ink)}
.proposal-figure-editor{border:1px solid var(--line);border-radius:8px;padding:12px;display:grid;gap:10px;justify-items:start}
.proposal-figure-editor>.fields,.proposal-figure-editor>label{width:100%}
.proposal-thumbnail{max-width:160px;max-height:115px;object-fit:contain}
.proposal-cover{position:relative;aspect-ratio:210/297;margin:16px auto 26px;width:min(100%,640px);overflow:hidden}
.proposal-cover>img{width:100%;height:100%;display:block;object-fit:cover}
.proposal-cover>div{position:absolute;inset:10% 9% auto;text-align:center;color:#fff;text-shadow:0 1px 4px #20140f}
.proposal .proposal-cover h1{margin:0;font-size:clamp(15px,4vw,34px)}
.proposal-cover p{color:inherit;font-size:clamp(12px,2.1vw,19px);overflow-wrap:anywhere}
.proposal-unit-price{white-space:nowrap}
.proposal-item-reference{overflow-wrap:anywhere}
.proposal-item-scope{display:block;font-weight:700;color:var(--ink)}
.proposal-contact{font-style:italic;line-height:1.45;margin-top:8px;overflow-wrap:anywhere;break-inside:avoid}
.proposal-contact a{color:#075ea9;text-decoration:underline}
.proposal-illustration{margin:8px 0 14px;break-inside:avoid}
.proposal-illustration img{display:block;max-width:100%;width:auto;max-height:135mm;object-fit:contain;margin:0 auto 8px}
.proposal-signatures{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:36px;break-inside:avoid}
.proposal-signatures div{border-top:1px solid currentColor;text-align:center;padding-top:5px}
@media(max-width:780px){.line-filters>.actions{position:relative}.line-filter{position:static}}
@media(max-width:640px){.top{padding:14px 16px}main{padding:22px 16px 50px}nav button{padding:6px 8px}.component{grid-template-columns:1fr}.panel{padding:12px}}
@page{size:A4 portrait;margin:14mm}
@page sls-cover{size:A4 portrait;margin:0}
@media print{
  body{background:#fff;font-size:11pt}
  #top,#notice,.no-print{display:none!important}
  body.proposal-pending #content{display:none!important}
  body.proposal-pending::before{content:"Emissão bloqueada: esta revisão precisa ser aprovada no ERP.";display:block}
  main{padding:0}
  .proposal{max-width:none}
  .proposal-cover{page:sls-cover;break-after:page;aspect-ratio:auto;width:210mm;height:296.7mm;margin:0}
  .proposal .proposal-cover h1{font-size:28pt}
  .proposal-cover p{font-size:15pt}
  thead{display:table-header-group}
  thead th{position:static}
  .proposal [data-proposal-delimitation] tfoot{display:table-row-group}
.proposal [data-proposal-floor] .proposal-line:has(+.proposal-floor-subtotal){break-after:avoid-page}
  .proposal [data-proposal-floor]:last-of-type .proposal-floor-subtotal{break-after:avoid-page}
  tr{break-inside:avoid}
  h2{break-after:avoid}
  .proposal-standard-section h3{break-after:avoid}
  .proposal-illustration:has(+ table),.proposal-illustration + table thead{break-after:avoid-page}
  .proposal-illustration + table{break-before:avoid-page}
  .proposal-standard-section li{break-inside:avoid}
  .total{break-inside:avoid;break-after:auto}
}
