@media (max-width:800px){
header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}header>div:first-child{display:flex;align-items:center;min-height:36px}header h1{margin:0;display:flex;align-items:center}.header-actions{align-items:center}.header-settings,.notification-button{display:grid!important;place-items:center;padding:0!important;line-height:1}.header-settings svg,.notification-button svg{display:block;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.notification-button:before{content:none!important}
.catalog-section-tabs{grid-template-columns:1fr 1fr!important}.catalog-section-tabs button{position:relative;display:flex!important;align-items:center;justify-content:center;min-height:50px;padding:7px 38px 7px 9px!important;text-align:center!important}.catalog-section-tabs button span{position:absolute;inset-inline:0;padding:0 36px 0 8px!important;width:auto;text-align:center;line-height:1.1}.catalog-section-tabs button strong{position:absolute;right:8px;top:50%;transform:translateY(-50%);margin:0}
select,.filter-grid select,.inventory-toolbar select,.report-filters select,.purchase-toolbar select,dialog select,.checkout select{height:34px!important;min-height:34px!important;padding:4px 30px 4px 9px!important;border-radius:7px!important;font-size:13px!important;line-height:1.15!important}
/* Aprovecha el ancho: pares lógicos en dos columnas. */
.filter-grid,.inventory-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}.filter-grid label,.inventory-toolbar label{gap:2px!important;min-width:0}.filter-grid>button:last-child{grid-column:1/-1}.inventory-toolbar>.search-wrap,.inventory-toolbar>.compact{grid-column:1/-1;width:100%}
.report-filters>div{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px!important}.report-filters .quick-ranges,.report-filters button[type="submit"]{grid-column:1/-1}.report-filters label{min-width:0}
.purchase-toolbar,.purchase-toolbar>div{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px!important;width:100%}.purchase-toolbar .search-wrap,.purchase-toolbar>button{grid-column:1/-1;width:100%}
.product-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}.product-actions>*{width:100%!important;min-height:34px!important}.product-actions #new-product{grid-column:1/-1}.toolbar{gap:6px!important}.toolbar .search-wrap{width:100%}
.product-filters,.report-filters{padding:7px!important}.catalog-page-size{min-height:34px!important;height:34px;padding:0 8px}.catalog-page-size select{width:auto;height:30px!important;min-height:30px!important;padding:2px 20px 2px 5px!important;font-size:11px!important}.discount-row select,.line-discount select,.global-discount-row select{min-height:28px!important;height:28px!important;padding:2px 4px!important;font-size:12px!important}
/* Sistema completo: misma escala visual para entrada de datos y desplegables. */
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]){height:34px!important;min-height:34px!important;padding:4px 9px!important}textarea{height:auto!important;min-height:62px!important}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea{font-size:13px!important}.filter-grid input,.filter-grid select,.inventory-toolbar input,.inventory-toolbar select,.report-filters input,.report-filters select,.purchase-toolbar input,.purchase-toolbar select{width:100%!important;height:34px!important;min-height:34px!important;padding:4px 9px!important;line-height:1.15!important}.search-wrap input{height:auto!important;min-height:0!important;border:0!important;padding:0!important;font-size:14px!important}
button,.button{text-align:center}.toolbar button,.toolbar .button,.product-actions button,.product-actions .button{display:flex!important;align-items:center;justify-content:center}.catalog-page-size{justify-content:center!important}
/* Formularios y KPI usan el ancho horizontal en todo el sistema. */
.form-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}.form-grid>.span2,.form-grid>.section-label,.span2{grid-column:1/-1!important}.summary-cards,#inventory-cards,.customer-kpis,.quotation-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}.checkout-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}.checkout-fields>label:last-child:nth-child(odd){grid-column:1/-1}
/* Barras de filtros genéricas de Historial, Clientes y Cotizaciones. */
.toolbar>div:not(.product-actions),.quotation-toolbar,.customer-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%}.toolbar>div>.search-wrap,.quotation-toolbar>.search-wrap,.customer-toolbar>.search-wrap{grid-column:1/-1}.toolbar>div>button:only-child{grid-column:1/-1}

/* Compras: indicadores y filtros realmente compactos. */
.purchase-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;margin-bottom:8px!important}.purchase-kpi{min-height:74px;padding:10px 12px!important}.purchase-kpi small{font-size:10px}.purchase-kpi strong{font-size:18px!important;margin-top:2px!important}.purchase-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;margin-bottom:9px!important}.purchase-toolbar>div{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(105px,32%)!important;gap:6px!important}.purchase-toolbar .search-wrap{grid-column:auto!important;width:100%!important;min-width:0}.purchase-toolbar select{width:100%!important;min-width:0}.purchase-toolbar>button{grid-column:1/-1!important;min-height:38px!important}

/* Historial: búsqueda + exportación en una fila y ventas como fichas. */
#view-history>.toolbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:6px!important}#view-history>.toolbar .search-wrap{width:100%!important;min-width:0;height:40px!important;min-height:40px!important}#view-history>.toolbar>.button{width:auto!important;min-width:108px;height:40px!important;min-height:40px!important;padding-inline:10px!important;display:flex;align-items:center;justify-content:center;font-size:11px!important}
#view-history>.table-panel{overflow:visible!important}#view-history>.table-panel table{min-width:0!important;width:100%}#view-history>.table-panel thead{display:none}#view-history>.table-panel tbody{display:grid;gap:7px;padding:7px}#view-history>.table-panel tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 10px;padding:10px;border:1px solid var(--line);border-radius:9px;background:#fff}#view-history>.table-panel tbody td{min-width:0;padding:0;border:0;font-size:11px;overflow-wrap:break-word}#view-history>.table-panel tbody td:before{display:block;margin-bottom:2px;color:var(--muted);font-size:8px;font-weight:750;text-transform:uppercase}#view-history>.table-panel tbody td:nth-child(1){grid-column:1/-1}#view-history>.table-panel tbody td:nth-child(9){grid-column:1/-1;display:flex;flex-wrap:wrap;gap:5px;padding-top:6px;border-top:1px solid var(--line)}#view-history>.table-panel tbody td:nth-child(1):before{content:'Venta'}#view-history>.table-panel tbody td:nth-child(2):before{content:'Fecha'}#view-history>.table-panel tbody td:nth-child(3):before{content:'Documento'}#view-history>.table-panel tbody td:nth-child(4):before{content:'Pago'}#view-history>.table-panel tbody td:nth-child(5):before{content:'Subtotal'}#view-history>.table-panel tbody td:nth-child(6):before{content:'Descuento'}#view-history>.table-panel tbody td:nth-child(7):before{content:'Total'}#view-history>.table-panel tbody td:nth-child(8):before{content:'Utilidad'}#view-history>.table-panel tbody td[colspan]{grid-column:1/-1!important;display:block!important;border:0!important}#view-history .empty-report{padding:24px 8px}
}@media(max-width:380px){.catalog-section-tabs button span{padding:0 34px 0 6px!important;font-size:11px!important}select,.filter-grid select,.inventory-toolbar select,.report-filters select{font-size:12px!important}}
