/* Compact return editors: scoped to the ERP dialogs, with native scrolling. */
#modal.editor:has(#return-form){width:min(1120px,calc(100vw - 32px));max-width:1120px;padding:18px}
#modal.editor:has(#refund-form){width:min(660px,calc(100vw - 32px));max-width:660px;padding:18px}
#modal .return-dialog-heading{padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid #b7c9da}
#modal .return-dialog-heading h2{font-size:21px;line-height:1.25;margin:0 0 5px}
#modal .return-dialog-heading p{margin:0;font-size:12px;line-height:1.45;color:#526a80}
#return-form,#refund-form{margin:0;min-width:0}
#refund-fields{border:0;margin:0;padding:0;min-width:0}
#return-form .return-refund-method{margin-top:10px;border:1px solid #b7c9da;border-radius:7px;padding:10px;background:#fff}
#return-form .return-refund-method p{font-size:12px;line-height:1.4;margin:6px 0 0}
#refund-form #cash-session-field{margin-top:10px;padding-top:10px;border-top:1px solid #b7c9da}
#refund-form .pos-readonly{padding:8px 10px;border:1px solid #b7c9da;border-radius:6px;background:#fff;margin-top:4px}
#refund-form #cash-session-hint{font-size:12px;line-height:1.4}
#return-form .return-sections{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:12px;border:0;padding:0;margin:0;min-width:0}
#return-form .return-section,#refund-form .return-section{min-width:0;padding:12px;border:1px solid #a8bed2;border-left:3px solid #638bae;border-radius:9px;background:#f7fafc}
#return-form .return-invoice-section,#return-form .return-products-section{grid-column:1/-1}
#return-form .return-section h3,#refund-form .return-section h3{font-size:14px;line-height:1.3;margin:0 0 9px;color:#244966}
#return-form .return-section-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:9px}
#return-form .return-section-heading h3{margin:0}
#return-form .return-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
#return-form .return-invoice-picker{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px}
#return-form .return-pagination{display:flex;align-items:center;gap:7px;min-width:0;padding-bottom:1px}
#return-form .return-pagination span{font-size:11px;white-space:nowrap;color:#526a80}
#return-form .return-two-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#return-form .field,#refund-form .field{min-width:0;margin:0}
#return-form label,#refund-form label{font-size:12px;line-height:1.4;margin:0}
#return-form input:not([type=checkbox]),#return-form select,#return-form textarea,#refund-form input:not([type=checkbox]),#refund-form select,#refund-form textarea{width:100%;min-width:0;max-width:100%;min-height:36px;padding:8px 10px;border:1px solid #8daecb;border-radius:6px;background:#fff;font-size:13px;line-height:1.35;margin-top:4px}
#return-form input:focus-visible,#return-form select:focus-visible,#return-form textarea:focus-visible,#refund-form input:focus-visible,#refund-form select:focus-visible{outline:2px solid #0063dc;outline-offset:1px;border-color:#0063dc}
#return-form #return-search{margin-top:0}
#return-form #f-reason{min-height:66px;resize:vertical}
#return-form .checkline,#refund-form .checkline{display:flex;gap:8px;align-items:flex-start;margin:9px 0 0;padding:0}
#return-form .checkline input,#refund-form .checkline input{margin-top:2px;flex:0 0 auto}
#return-form .return-receiving-section>.field:not(.checkline){margin-top:10px}
#return-form .return-search-results{margin:8px 0;padding:7px 10px;background:#edf4fa;border:0;border-left:2px solid #9fb9d0;border-radius:4px}
#return-form .return-search-results p,#return-form .return-search-results small{font-size:12px;line-height:1.4}
#return-form #return-customer-current{margin-top:5px}
#return-form #return-customer-current strong{font-size:13px}
#return-form #return-customer-current small{margin-top:2px}
#return-form #return-customer-choices{gap:5px;max-height:180px;margin-top:7px}
#return-form .return-customer-choice{padding:8px 10px;border:1px solid #a8bed2;background:#fff;border-radius:6px}
#return-form #return-invoice-info{font-size:11px;line-height:1.5;margin:8px 0 0;color:#526a80;overflow-wrap:anywhere}
#return-form #return-invoice-info:empty{display:none}
#return-form .return-product-list{min-width:0;max-height:250px;overflow-y:auto;border:1px solid #b5c9db;border-radius:7px;background:#fff}
#return-form .return-product-list:empty:before{content:'Selecciona una factura para ver los productos pendientes.';display:block;padding:12px;color:#61788d;font-size:12px}
#return-form .return-product-row{display:grid;grid-template-columns:minmax(0,1fr) 100px;align-items:center;gap:14px;padding:9px 11px;margin:0;border-bottom:1px solid #d2deea}
#return-form .return-product-row:last-child{border-bottom:0}
#return-form .return-product-row:focus-within{background:#eef6fd;box-shadow:inset 3px 0 #0063dc}
#return-form .return-product-row .erp-product-label{min-width:0;gap:10px}
#return-form .return-product-row .erp-product-thumb{width:40px;height:40px;flex-basis:40px;border-color:#b7c9da}
#return-form .return-product-row .erp-product-copy{min-width:0;overflow-wrap:anywhere}
#return-form .return-product-row strong{display:block;font-size:12px;font-weight:600;line-height:1.4}
#return-form .return-product-row small{display:block;font-size:11px;line-height:1.4;color:#61788d;margin-top:3px}
#return-form .return-product-quantity>span{display:block;font-size:11px;color:#526a80}
#return-form .return-product-quantity input{text-align:center;margin-top:3px}
#return-form .notice,#refund-form .notice{font-size:12px;line-height:1.45;margin:8px 0;padding:8px 10px;border:1px solid #b7c9da;border-radius:6px}
#return-form .return-guidance{margin-top:12px;border-top:1px solid #c4d4e2;padding-top:10px}
#return-form .return-guidance summary{font-size:12px;font-weight:600;color:#315a7b;cursor:pointer}
#return-form .return-guidance p{font-size:12px;line-height:1.5;color:#526a80;margin:8px 0 0}
#return-form .return-actions,#refund-form .return-actions{gap:8px;align-items:center;margin:12px 0 0;padding:10px 0 18px;bottom:-18px;border-top:1px solid #b7c9da;z-index:2}
#return-form .btn,#refund-form .btn{min-height:36px;padding:8px 12px;font-size:13px;line-height:1.4}
#return-form .tiny-btn,#refund-form .tiny-btn{padding:6px 9px;min-height:30px;font-size:12px;line-height:1.4;border:1px solid #aec3d6}
#return-form .error-text,#refund-form .error-text{margin:8px 0;font-size:12px}
#return-form .error-text:empty,#refund-form .error-text:empty{display:none}
#refund-form .return-section>.field+ .field{margin-top:10px}
#refund-form .refund-confirmation{padding:10px 12px;margin:12px 0;background:#edf4fa;border:1px solid #a8bed2;border-radius:7px}
#modal .refund-amount{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:5px}
#modal .refund-amount strong{font-size:20px;color:#244966}
#return-form [hidden],#refund-form [hidden]{display:none!important}
@media(max-width:760px){
 #return-form .return-sections{grid-template-columns:minmax(0,1fr)}
 #return-form .return-invoice-picker{grid-template-columns:minmax(0,1fr)}
 #return-form .return-pagination{justify-content:space-between}
 #return-form .return-product-list{max-height:none}
}
@media(max-width:520px){
 #modal.editor:has(#return-form),#modal.editor:has(#refund-form){width:calc(100vw - 16px);max-width:calc(100vw - 16px);padding:12px;max-height:calc(100dvh - 16px)}
 #modal .return-dialog-heading h2{font-size:18px}
 #return-form .return-section,#refund-form .return-section{padding:10px;border-radius:7px}
 #return-form input:not([type=checkbox]),#return-form select,#return-form textarea,#refund-form input:not([type=checkbox]),#refund-form select{font-size:16px}
 #return-form .return-actions,#refund-form .return-actions{bottom:-12px;padding-bottom:12px}
 #return-form .return-two-columns{grid-template-columns:minmax(0,1fr)}
 #return-form .return-product-row{grid-template-columns:minmax(0,1fr) 72px;gap:8px;padding:9px 8px}
 #return-form .return-product-row .erp-product-thumb{width:32px;height:32px;flex-basis:32px}
 #return-form .return-product-row .erp-product-label{gap:7px}
 #return-form .return-product-quantity input{padding:8px 5px}
 #return-form .return-section-heading{align-items:flex-start;gap:8px}
 #return-form .return-section-heading .tiny-btn{width:100%;text-align:left}
 #return-form .return-actions{display:grid;grid-template-columns:1fr;gap:7px}
 #return-form .return-actions>.btn{flex:none;width:100%;min-height:38px}
 #return-form #return-close{justify-self:start;width:auto;min-height:32px}
 #refund-form .return-actions{flex-wrap:wrap}
 #refund-form .return-actions>.btn{flex:1 1 auto}
}

