*{box-sizing:border-box}body{margin:0;background:#f3f1fa;color:#211839;font:16px/1.5 system-ui,sans-serif}header{background:#32116e;color:#fff;padding:16px max(20px,calc((100vw - 1280px)/2));display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}a{color:inherit}.brand{display:flex;align-items:center;gap:12px;font-size:24px;font-weight:800;text-decoration:none}.brand img{width:52px;height:52px;object-fit:contain;background:white;border-radius:10px}main{max-width:1320px;margin:auto;padding:24px}h1{font-size:clamp(28px,4vw,40px);margin:4px 0 12px}h2{font-size:24px;margin:0 0 16px}h3{font-size:20px}.eyebrow{font-weight:800;color:#7a40cb;letter-spacing:.07em}.card{border:1px solid #dfd8ec;background:#fff;border-radius:18px;padding:24px;margin-bottom:22px}.login{max-width:500px;margin:6vh auto}.login form{display:grid;gap:16px;margin-bottom:20px}label{display:grid;gap:6px;font-weight:600}input,select,textarea,button{font:inherit;border:1px solid #bdb0d4;border-radius:10px;padding:11px 13px;max-width:100%;min-width:0}textarea{min-height:80px}button{color:white;background:#401884;border-color:#401884;font-weight:750;cursor:pointer}button:disabled{opacity:.6;cursor:wait}.secondary{background:white;color:#401884;border:1px solid #bdb0d4}.confirm{background:#087a4a;border-color:#087a4a}.page-title,.section-head,.actions{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.page-title{margin-bottom:20px}.section-head h2{margin-bottom:0}.section-head{margin-bottom:16px}.filters{display:flex;gap:14px;flex-wrap:wrap;align-items:end}.filters label:first-child{flex:1;min-width:200px}.filters .check{display:flex;align-items:center;padding:10px 0;font-size:14px}.badge{background:#ede4ff;border-radius:10px;padding:8px 12px;color:#401884}.muted{color:#655b74;font-size:14px}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:16px}.order-card{border:1px solid #dfd8ec;border-radius:14px;padding:18px;overflow-wrap:anywhere}.order-card h3{margin:0 0 8px}.order-card .amount{font-size:26px;font-weight:800;color:#401884;margin:12px 0}.order-card .actions{justify-content:flex-start}.inbox{border-top:5px solid #8443ed}.pending{border-top:5px solid #ff9900}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin:18px 0}.metric{padding:18px;background:#f3eefc;border-radius:12px}.metric strong{display:block;font-size:27px;color:#401884}.metric span{font-size:14px}.table-scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:14px}th,td{padding:13px;border-bottom:1px solid #ddd4ec;text-align:left;vertical-align:top}th{background:#f1ebfb;white-space:nowrap}td{min-width:120px}td button{padding:8px 10px}.state{font-size:14px;font-weight:700}.edit-form{display:grid;grid-template-columns:1fr 1fr;gap:16px}.wide{grid-column:1/-1}dialog{width:min(900px,94vw);max-height:92vh;border:0;border-radius:18px;padding:26px;color:inherit}dialog::backdrop{background:#1b0d3b99}#order-detail{margin:20px 0;padding:18px;background:#f7f4fd;border-radius:12px;overflow-wrap:anywhere}.manual-products{display:grid;gap:10px;max-height:360px;overflow:auto}.manual-product{display:grid;grid-template-columns:1fr 100px;align-items:center;gap:12px;border-bottom:1px solid #e6dfef;padding:8px 0}.manual-product label{font-weight:500}.manual-product input{width:100%}[hidden]{display:none!important}p[role=alert]{color:#a51c32}#seller-result{white-space:pre-line;font-weight:700}fieldset{border:1px solid #d8cceb;border-radius:12px;display:grid;gap:12px}@media(max-width:600px){main{padding:14px}.card{padding:18px}.edit-form{grid-template-columns:1fr}.wide{grid-column:auto}dialog{padding:18px}.filters{display:grid}.filters label:first-child{min-width:0}.stats{grid-template-columns:1fr 1fr}.metric{padding:12px}.metric strong{font-size:23px}}

.catalog-return{display:flex;align-items:center;justify-content:center;width:100%;min-height:52px;padding:13px 18px;border:2px solid #7a40cb;border-radius:10px;background:#f1e8ff;color:#401884;font-weight:750;text-decoration:none;text-align:center}.catalog-return:hover{background:#e5d4ff}.catalog-return:focus-visible{outline:3px solid #401884;outline-offset:3px}

#order-detail,.order-panel{min-width:0}

.discount-preview{font-size:22px;font-weight:800;color:#401884;background:#f0e5ff;padding:18px;border-radius:12px}.volume-details{white-space:pre-line;padding:14px;border-left:4px solid #8644dc;background:#f0e7fc}
.danger{background:#a51c32;border-color:#a51c32;color:white}.quote-details{margin:0;padding:18px}.quote-details legend{font-weight:800}.edit-product-row{display:grid;grid-template-columns:minmax(0,1fr) 110px auto;gap:12px;align-items:end;padding:14px 0;border-bottom:1px solid #dfd8ec}.edit-product-row select{width:100%}#delete-form{display:grid;gap:18px}#delete-form .check{display:flex;align-items:center}#delete-dialog{max-width:600px}#delete-description{font-weight:800;font-size:1.15rem}@media(max-width:600px){.edit-product-row{grid-template-columns:1fr 100px}.edit-product-row>label:first-child{grid-column:1/-1}}

.seller-email-panel{display:grid;gap:14px;padding:20px;background:#f1e8ff;border:1px solid #bba1df;border-top:4px solid #7a40cb;border-radius:12px;min-width:0}.seller-email-panel h3,.seller-email-panel p{margin:0}.seller-email-panel h3{color:#401884}.seller-email-panel input{width:100%;background:white}.seller-email-panel .quote-actions{justify-content:flex-start}.seller-email-panel #seller-email-status:empty{display:none}.seller-email-panel #seller-email-status{font-weight:650;overflow-wrap:anywhere}@media(max-width:600px){.seller-email-panel{padding:16px}.seller-email-panel .quote-actions{display:grid;grid-template-columns:1fr}.seller-email-panel .quote-actions button{width:100%}}

/* El editor y el PDF comparten el mismo formulario y los mismos datos. */
.order-tabs{display:flex;gap:8px;margin:0 0 20px;border-bottom:1px solid #d8cceb;padding-bottom:10px}
.order-tabs [role=tab]{background:#fff;color:#401884;border-color:#bdb0d4;flex:1;min-height:48px}
.order-tabs [aria-selected=true]{background:#401884;color:#fff;border-color:#401884}
.order-tabs [role=tab]:focus-visible{outline:3px solid #a77ce5;outline-offset:3px}
.order-panel.edit-form{grid-template-columns:repeat(2,minmax(0,1fr))}
.products-editor-block{min-width:0}.products-editor-block h3{margin:0 0 14px}
.quote-items-box{border:1px solid #d8cceb;border-radius:12px;overflow:hidden;margin:0 0 14px;min-width:0}
.quote-items-editor{table-layout:fixed;width:100%;min-width:0;font-size:14px}
.quote-items-editor th,.quote-items-editor td{min-width:0;padding:12px 9px;white-space:normal;overflow-wrap:anywhere;vertical-align:top}
.quote-items-editor thead th{font-size:13px;line-height:1.35;background:#ede4ff;color:#401884}
.quote-items-editor .edit-product-row{display:table-row;border-bottom:1px solid #dfd8ec}
.quote-items-editor .edit-product-row input,.quote-items-editor .edit-product-row select,.quote-items-editor .edit-product-row textarea{width:100%;font-size:14px;padding:10px 8px;border-radius:8px}
.quote-items-editor select{overflow:hidden;text-overflow:ellipsis}
.quote-items-editor .custom-description-field{margin-top:9px;font-size:12px;color:#655b74;font-weight:600}
.quote-items-editor .custom-description-field textarea{min-height:68px;color:#211839;font-weight:500}
.quote-items-editor .edit-remove-cell button{font-size:12px;padding:10px 7px}
.quote-items-editor output{display:block;font-variant-numeric:tabular-nums;font-weight:750;padding:11px 2px}
.quote-items-editor .edit-total-cell{background:#f8f5fc;color:#401884}
.quote-items-editor .edit-total-cell output{font-size:16px}
.quote-items-editor tfoot th,.quote-items-editor tfoot td{background:#f1e8ff;border:0;vertical-align:middle}
.quote-items-editor tfoot output{font-size:17px;color:#401884;padding:0}
.line-price-note{display:block;color:#087a4a;font-size:11px;line-height:1.3;margin-top:5px}
.editor-sr-only,.editor-cell-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.email-configuration{border-radius:8px;padding:10px 12px;font-size:14px;background:#fff}
.email-configuration[data-state=pending]{border-left:4px solid #b96d09;color:#70420c;background:#fff6e8}
.email-configuration[data-state=configured]{border-left:4px solid #087a4a;color:#0b5e3c}
.order-footer{justify-content:flex-start}
@media(max-width:700px){
 .order-panel.edit-form{grid-template-columns:minmax(0,1fr)}
 .order-tabs [role=tab]{padding:10px 7px;font-size:14px}
 .quote-details{padding:13px}
 .quote-items-editor,.quote-items-editor tbody,.quote-items-editor tfoot{display:block;width:100%}
 .quote-items-editor colgroup,.quote-items-editor thead{display:none}
 .quote-items-editor .edit-product-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;padding:13px}
 .quote-items-editor .edit-product-row td{display:block;border:0;padding:0}
 .quote-items-editor .edit-description-cell,.quote-items-editor .edit-remove-cell{grid-column:1/-1}
 .quote-items-editor .edit-remove-cell{text-align:right}
 .quote-items-editor .edit-total-cell{border-radius:8px;padding:0 6px}
 .quote-items-editor .editor-cell-label{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;white-space:normal;display:block;font-size:11px;font-weight:700;line-height:1.35;min-height:30px;padding:0 0 5px}
 .quote-items-editor tfoot tr{display:flex;justify-content:space-between;gap:12px;background:#f1e8ff}
 .quote-items-editor tfoot th,.quote-items-editor tfoot td{display:block;padding:12px;flex:1}
 .quote-items-editor tfoot td{text-align:right}
 .order-footer{display:grid;grid-template-columns:minmax(0,1fr)}
}

/* Respaldo de cotizaciones y mensajes de diagnóstico completos. */
#seller-whatsapp{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:12px;padding:12px 18px;background:#147d4d;color:white;text-decoration:none;font:inherit;font-weight:700;min-height:44px}#seller-whatsapp[aria-disabled="true"]{opacity:.65;pointer-events:none}#seller-email-status,#email-configuration{white-space:pre-line;overflow-wrap:anywhere}

.shipping-reminder{padding:12px 14px;border-left:4px solid #b97600;border-radius:9px;background:#fff7e9;color:#714309}
#shipping-help{font-weight:400;color:#6c647a}
.prefactura-pricing-note{padding:12px;border-radius:8px;background:#faf5e8}
