/* Capa visual compartida: no altera rutas, datos ni lógica de negocio. */
:root{--mobile-gutter:12px;--touch-size:44px}html{-webkit-text-size-adjust:100%}img{max-width:100%;height:auto}button,input,select,textarea{max-width:100%}.table-wrap,.sheet-scroll,.compat{overscroll-behavior-inline:contain}
header nav{flex-wrap:wrap}header .menu-toggle{display:none}
@media(min-width:701px){header.nav-ready nav{display:flex}}
@media(max-width:700px){body main{width:calc(100% - (var(--mobile-gutter) * 2));max-width:100%;margin-top:24px}main,form,.workbook,.inventory-view,.detail-view,.products,.product-row,.type-box,.fields,.form,.layout,.content,.side,.sheet-top,.workbook-head,.workbook-actions,.sheet-controls,label{min-width:0}body header h1{font-size:clamp(1.4rem,7vw,1.7rem);line-height:1.2;overflow-wrap:anywhere}header.nav-ready{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:14px}header.nav-ready h1,header.nav-ready p{grid-column:1}header.nav-ready .menu-toggle{display:block;grid-column:2;grid-row:1 / span 2;align-self:center;width:44px;height:44px}header.nav-ready nav{display:none;grid-column:1 / -1;margin-top:16px}header.nav-ready nav.is-open{display:flex}header.nav-ready nav a{display:flex;align-items:center;width:100%;min-height:44px;padding:10px 12px}.parts-search-bar{margin-top:14px}.parts-search-bar input,input,select,textarea{width:100%;min-width:0;font-size:16px}input[type="checkbox"],input[type="radio"]{width:auto;max-width:none}input[type="hidden"]{display:none}button,.button,.add,.save,.cancel,.confirm,.pay,.remove{min-height:var(--touch-size)}.remove{min-width:var(--touch-size)}.content-head,.workbook-head,.view-head,.section-heading,.results-head,.sheet-top,.sheet-actions,.savebar{align-items:flex-start;flex-direction:column}.content-head,.workbook-head,.view-head{gap:12px}.content-head>.button,.workbook-head>.button,.view-head>.button,.savebar>button{width:100%;text-align:center}.workbook-actions,.sheet-controls{display:grid;grid-template-columns:1fr;gap:8px;width:100%}.workbook-actions .button,.sheet-controls .button{width:100%;text-align:center}.cards{grid-template-columns:minmax(0,1fr);padding:16px}.sheet-group{margin-inline:16px}.card,.section,.history,.search-card,.results,.detail{padding:16px}.fields,.form,.grid{grid-template-columns:minmax(0,1fr)}.wide,.full{grid-column:auto}.top,.detail-head,.heading{align-items:flex-start;flex-direction:column}.links,.modal-actions{align-items:stretch;flex-direction:column;width:100%}.links .button,.modal-actions .cancel,.modal-actions .confirm{width:100%;text-align:center}.type-box{flex-wrap:wrap;gap:8px;align-items:stretch}.type-option{flex:1 1 132px;min-width:0}.type-box .doc-number{flex:1 0 100%;margin-left:0;text-align:left}.product-head{display:none}.product-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.product-row>*{min-width:0}.product-row input:nth-child(3){grid-column:1/-1}.line-total{text-align:left}.products{padding:13px}.tax-mode{flex-wrap:wrap;gap:10px}.tax-mode label{min-width:0}.table-wrap,.compat,.card:has(table),.section:has(table),.detail:has(table){max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}table{min-width:540px}.modal{padding:12px;align-items:end}.modal-box{width:100%;max-height:calc(100vh - 24px);overflow-y:auto;padding:18px}.tabs{padding-inline:8px;max-width:100%;overscroll-behavior-inline:contain}.tab{min-height:44px}.sheet{padding:16px}.detail-content{grid-template-columns:1fr;padding:18px}.detail-image{max-width:280px}.summary,.metrics{grid-template-columns:1fr}.filter{align-items:flex-start;flex-direction:column}.switch{max-width:100%;overflow-x:auto}.switch a{white-space:nowrap}.results,.detail{padding:16px}}
@media(min-width:601px) and (max-width:1024px){body main{width:calc(100% - 40px)}.filters{grid-template-columns:repeat(3,minmax(0,1fr))}.layout{grid-template-columns:230px minmax(0,1fr)}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.fields,.form{grid-template-columns:repeat(2,minmax(0,1fr))}.full,.wide{grid-column:1/-1}}
@media(max-width:375px){body main{width:calc(100% - 20px)}.card,.section,.history,.search-card,.results,.detail{padding:14px}.type-box{flex-wrap:wrap}.type-option{width:100%;border-radius:7px!important;border-left:1px solid #bac5d8!important}.type-option+ .type-option{margin-top:6px}.product-row{grid-template-columns:1fr}.product-row input:nth-child(3){grid-column:auto}.button,.add,.save,.cancel,.confirm{width:100%}}
