*{box-sizing:border-box}body{margin:0;background:#faf7f9;color:#332630;font:16px system-ui}header{background:#561034;color:white;padding:24px 5%;display:flex;justify-content:space-between}header b{font-size:28px}small{font-size:12px;letter-spacing:2px}main{max-width:1100px;margin:30px auto;padding:20px}nav,.row{display:flex;gap:12px;flex-wrap:wrap}button,a,input,select{font:inherit;padding:12px;border:1px solid #d6c9d0;border-radius:8px}button{cursor:pointer;background:#561034;color:white}button:disabled{opacity:.5}input,select{background:white;max-width:100%}label{display:grid;gap:6px;margin:16px 0}form,.card,article{background:white;border-radius:14px;padding:24px;margin:18px 0;border:1px solid #e6dce2}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px}.card b{display:block;font-size:28px;margin-top:12px}table{width:100%;border-collapse:collapse;background:white}td,th{text-align:left;padding:14px;border-bottom:1px solid #e6dce2}.scroll{overflow:auto}#message{position:sticky;bottom:0;background:#f3e7ee;padding:16px;margin:0}#message:empty{display:none}h1{font-size:30px}h2{font-size:21px}p{line-height:1.6}.muted{color:#6d6068}a{display:inline-block;color:#561034;text-decoration:none}@media(max-width:600px){header{padding:18px}header span{font-size:12px}main{margin:0;padding:14px}nav button{padding:9px;font-size:14px}.row>*{width:100%}}

.product-search{min-width:0;max-width:100%}.product-matches>div{display:grid;gap:4px;max-height:12rem;overflow:auto}.product-matches button{text-align:left;white-space:normal}.product-search label{margin-bottom:4px}.item label,.item select{min-width:0;max-width:100%}dialog{width:min(92vw,28rem);border:0;border-radius:12px}dialog form{margin:0;padding:12px}
.product-search{position:relative;align-self:flex-start;width:min(100%,26rem)}
.product-search label{margin-bottom:0}
.product-matches:not([hidden]){position:absolute;z-index:5;top:100%;inset-inline:0;background:white;border:1px solid #b39da9;border-radius:0 0 8px 8px;box-shadow:0 5px 12px #34132624;overflow:hidden}
.product-search:has(.product-matches:not([hidden])) input{border-bottom-left-radius:0;border-bottom-right-radius:0}
.product-matches>span{display:block;padding:6px 12px;font-size:.85rem}
.product-matches>div{gap:0;max-height:min(30dvh,14rem);overscroll-behavior:contain}
.product-matches button{background:white;color:#332630;border:0;border-top:1px solid #e6dce2;border-radius:0;min-height:44px}
.product-matches button:focus,.product-matches button:hover{background:#f3e7ee}
#manual-quote[hidden]{display:none}

.registration-forms{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,19rem),1fr));gap:16px}
.registration-forms form{margin:0}
.registration-forms h2{margin-top:0}
.registration-catalog{margin-top:20px}
.registration-catalog summary{padding:14px;background:white;border:1px solid #e6dce2;border-radius:8px;cursor:pointer}

.statement-preview{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;max-height:55vh;overflow:auto}

.receipt-item{margin:16px 0;padding:12px;border:1px solid #d6c9d0;border-radius:8px;min-width:0}
.receipt-item legend{font-weight:600;max-width:100%;overflow-wrap:anywhere}
.receipt-options{display:flex;flex-wrap:wrap;gap:8px 24px}
.receipt-options label{display:flex;align-items:center;gap:8px;margin:4px 0;min-height:44px;cursor:pointer}
.receipt-options input{width:20px;height:20px;accent-color:#561034}
.receipt-quantity[hidden]{display:none}

.item label[hidden]{display:none}

.price-history{flex-basis:100%}.price-history:empty{display:none}.price-history p{margin:6px 0}.price-alert{background:#fff2ce;color:#613d00;border-left:4px solid #b57810;padding:9px 12px}.price-history summary{cursor:pointer}

.receipt-item [data-issue-fields][hidden]{display:none}.check-toggle{display:flex;align-items:center;gap:8px}

header{align-items:center;gap:16px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:18px}
.brand img{width:145px;height:auto;display:block}
.brand small{border-left:1px solid #ad8399;padding-left:16px}
#user{overflow-wrap:anywhere}

#weekly-report { display:none }
@media print {
  body:has(#weekly-report) { background:white; color:#22171d; font-size:10pt }
  body:has(#weekly-report) > :not(header):not(#weekly-report),
  body:has(#weekly-report) #user { display:none }
  body:has(#weekly-report) header { background:white; color:#561034; padding:0 0 12pt }
  body:has(#weekly-report) .brand img { background:#561034; padding:6pt; print-color-adjust:exact }
  #weekly-report { display:block }
  #weekly-report .scroll { overflow:visible }
  #weekly-report h1 { font-size:18pt; color:#561034 }
  #weekly-report td, #weekly-report th { padding:6pt 4pt; overflow-wrap:anywhere }
  #weekly-report td:last-child { text-align:right; white-space:nowrap }
  #weekly-report tr { break-inside:avoid }
  #weekly-report .subtotal { font-weight:bold; color:#561034 }
}

#share-quote[hidden] { display:none }

/* Os campos de entrada compartilham uma linha; as ações auxiliares ficam abaixo. */
#lines .item {display:grid;grid-template-columns:minmax(10rem,3fr) repeat(3,minmax(0,1fr));align-items:end;gap:6px 8px;margin:12px 0 6px}
#lines .item[data-grouped="true"] {grid-template-columns:minmax(10rem,2.5fr) repeat(5,minmax(0,1fr))}
#lines .item .product-search,#lines .item label {width:100%;min-width:0;margin:0}
#lines .item label {font-size:.85rem;gap:4px}
#lines .item input,#lines .item select {width:100%;min-width:0;padding:7px 5px;font-size:.9rem}
#lines .item output,#lines .item [data-repeat] {grid-column:1/-1}
#lines .item output:empty {display:none}
#lines .item [hidden] {display:none}
#lines [data-find-last] {padding:5px 8px;font-size:.82rem}
@media(max-width:700px){
  #lines .item,#lines .item[data-grouped="true"] {grid-template-columns:repeat(2,minmax(0,1fr))}
  #lines .product-search {grid-column:1/-1}
}
button[aria-pressed="true"]{outline:2px solid currentColor;outline-offset:2px;font-weight:700}
.rq-tabs{margin-bottom:1rem}.rq-grid{display:grid;grid-template-columns:minmax(14rem,1fr) minmax(0,2fr);gap:1rem;align-items:start}
.rq-list,.rq-detail{padding:1rem;border:1px solid #e4dae0;border-radius:12px;background:white;min-width:0}
.rq-list details{margin:.8rem 0}.rq-orders{display:grid;gap:.5rem}.rq-order{display:grid;gap:.25rem;width:100%;background:#faf7f9;color:#4a1934;text-align:left;border:1px solid #ded0d9}.rq-order[aria-pressed=true]{background:#f3e3ef}
.rq-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem;align-items:center}.rq-item strong,.rq-form{grid-column:1/-1}.rq-item dl{display:flex;flex-wrap:wrap;gap:1rem;margin:0}.rq-item dd{margin:0;font-weight:600}.rq-item dt{font-size:.8rem}.rq-form{background:#faf4f8}.rq-form p:empty{display:none}.rq-back{display:none}
@media(max-width:740px){.rq-grid{display:block}.rq-grid:not(.rq-open) .rq-detail,.rq-grid.rq-open .rq-list{display:none}.rq-back{display:inline-block}.rq-item dl{gap:.6rem}}
.work-create{margin:.5rem 0 1rem}.work-create>summary{display:inline-block;cursor:pointer;padding:.65rem 1rem;background:#551538;color:white;border-radius:.5rem;font-weight:600}
.work-facts{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin:1rem 0}.work-facts dd{text-align:right;margin:0}.work-card{text-align:left;color:#4b2036;cursor:pointer}.work-total{font-weight:650}.work-period fieldset{margin-bottom:.5rem}
