/* Cantidades con unidades separadas y revisión móvil de todas las vistas. */
.cg-quantities{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0;font-size:12px;line-height:1.5}
.cg-quantities>span{display:inline-flex;align-items:center;gap:7px;padding:6px 9px;border-radius:8px;max-width:100%;overflow-wrap:anywhere}
.cg-juice-quantity{color:#186c70;background:#edf8f8;border:1px solid #c9e7e6}
.cg-pulp-quantity{color:#6e43a4;background:#f5effd;border:1px solid #dfd0f4}
.cg-qty-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cg-qty-cards article{padding:18px;background:#fff;border:1px solid #dce8e7;border-top:3px solid #3c999b;border-radius:12px;min-width:0}
.cg-qty-cards .cg-pulp-card{border-color:#e4d8f3;border-top-color:#9970cc}
.cg-qty-cards article>span{display:block;font-size:12px;color:#637384}
.cg-qty-cards strong{display:block;font-size:26px;color:#264456;margin:7px 0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.cg-qty-cards .cg-pulp-card strong{color:#6e43a4}
.cg-qty-cards small{font-size:11px;color:#64748b;font-weight:400}
.cg-qty-note{font-size:11px;line-height:1.65;color:#6b788b;margin:9px 0 20px;overflow-wrap:anywhere}
.cg-qty-switch{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 16px}
.cg-qty-switch button{border:1px solid #dbe3ec;border-radius:9px;background:#fff;color:#506077;padding:9px 12px;font:inherit;font-size:12px;min-height:44px;cursor:pointer}
.cg-qty-switch button[aria-pressed=true]{background:#edf8f8;border-color:#91c9cd;color:#155d68}
.cg-qty-switch button[data-quantity=pulpas][aria-pressed=true],.cg-qty-switch button[data-quantity=pulps][aria-pressed=true]{background:#f5effd;border-color:#b99bdc;color:#6e43a4}
.cg-kpi-pulpas strong,.cg-kpi-pulpas .metric-icon{color:#7850ad!important}
.cg-kpi-pulpas{border-top:3px solid #9c78ce!important}
body[data-cg-view=dashboard] .kpis{grid-template-columns:repeat(5,minmax(0,1fr))}
.cg-rank-secondary{display:block;font-size:11px;font-weight:400;color:#718098;margin-top:3px;line-height:1.5}
.cg-quantity-value{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
body[data-cg-view=dashboard] #cargaDias svg{width:100%;height:auto;display:block}
body[data-cg-view=dashboard] #cargaDias .chart-pulp{fill:#9872c7}
body[data-cg-view=dashboard] .seller-table td:nth-child(4){color:#7650a4}
body[data-cg-view=ventas] .cgv2-bar .cg-pulp-bar{background:linear-gradient(#b99adf,#8154ba)}
body[data-cg-view=ventas] .cgv2-bar .cg-juice-bar{background:linear-gradient(#64b7b8,#247b83)}
body[data-cg-view=ventas] .cgv2-kpis .cg-pulp-card strong{color:#7850ad!important}
body[data-cg-view=ventas] .cgv2-bars{height:170px;padding-top:25px}
body[data-cg-view=ventas] .cgv2-bars .cgv2-bar{line-height:1.4}
body[data-cg-view=oficina] .office-grid .product-summary .cg-quantities{margin-bottom:0}
body[data-cg-view=chofer] #cgRutaCantidades{margin-bottom:18px}
body[data-cg-view=produccion] #cgProduccionCantidades{margin-top:16px}
body[data-cg-view=produccion] .cg-p4-product-line .cg-pulp-tag{display:inline-block;color:#7548a9;background:#f5effd;border:1px solid #dfd0f4;border-radius:6px;padding:3px 7px}
 body[data-cg-view=produccion].cg-prod-v4 .cg-quantities{font-size:12px}
body[data-cg-view=direccion] .goal-card[data-family=pulpa] .goal-bar i{background:linear-gradient(90deg,#8659bb,#b895dd)}
body[data-cg-view=direccion] .goal-card[data-family=pulpa] .metric-label{color:#7850ad}
body[data-cg-view] :is(input,select,textarea,button,a,summary):focus-visible{outline:3px solid #f58220;outline-offset:3px}
body[data-cg-view] :is(.cg-qty-switch button,.cg-phone-table button){touch-action:manipulation}
@media screen and (max-width:1100px){
 body[data-cg-view=dashboard] .kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-cg-view=dashboard] .kpi:last-child{grid-column:span 2}
}
@media screen and (max-width:780px){
 body[data-cg-view] :is(main,.workspace,.wrap,.grid,.card,.panel,.form-main,section,article,form,fieldset,dialog,.dialog-body){min-width:0;max-width:100%}
 body[data-cg-view] :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]){font-size:16px!important;min-height:44px;min-width:0;max-width:100%}
 body[data-cg-view] input[type=range]{min-height:44px;width:100%;touch-action:pan-y}
 body[data-cg-view] :is(button,summary){min-height:44px;white-space:normal;overflow-wrap:anywhere}
 body[data-cg-view] :is(.cg-view-tools,.cg-mobile-tools,.head-actions,.heading-actions,.card-actions,.report-actions){flex-wrap:wrap;max-width:100%;gap:8px}
 body[data-cg-view] :is(h1,h2,h3,p,.folio,.cliente,.office-folio,.cg-user-name,.cg-qty-note){overflow-wrap:anywhere}
 body[data-cg-view] :is(.cg-push-tools,.cg-view-tools)>*{min-width:0;max-width:100%}
 body[data-cg-view] dialog{max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;overscroll-behavior:contain}
 body[data-cg-view] :is(.cg-direct-dialog,.cg-confirm-card){max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;overflow-y:auto;overscroll-behavior:contain}
 body[data-cg-view] :is(.dialog-head,.dialog-heading,.cg-p4-drawer-head,.mr-head){gap:10px}
 body[data-cg-view] :is(.dialog-head,.dialog-heading,.cg-p4-drawer-head,.mr-head)>div{min-width:0;flex:1}
 body[data-cg-view] :is(.dialog-head,.dialog-heading,.cg-p4-drawer-head,.mr-head)>button{min-width:44px;min-height:44px;flex:none}
 body[data-cg-view] .cg-qty-cards{gap:9px}
 body[data-cg-view] .cg-qty-cards article{padding:14px}
 body[data-cg-view] .cg-qty-cards strong{font-size:24px}
 body[data-cg-view] .cg-quantities{font-size:12px;gap:6px}
 body[data-cg-view] .cg-phone-table{width:100%!important;min-width:0!important;display:block;table-layout:auto}
 body[data-cg-view] .cg-phone-table thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
 body[data-cg-view] .cg-phone-table tbody{display:grid;width:100%;gap:12px}
 body[data-cg-view] .cg-phone-table tbody tr{display:block;width:100%;border:1px solid #dde5ed;border-radius:12px;padding:12px;min-width:0}
 body[data-cg-view] .cg-phone-table tbody td{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:12px;text-align:left!important;border:0!important;padding:9px 0!important;width:100%;min-width:0!important;max-width:none!important;white-space:normal!important;overflow-wrap:anywhere;font-size:13px}
 body[data-cg-view] .cg-phone-table td::before{content:attr(data-cg-label);font-size:11px;color:#748296;grid-column:1;grid-row:1;line-height:1.5}
 body[data-cg-view] .cg-phone-table td>*{grid-column:2;min-width:0;max-width:100%;white-space:normal!important}
 body[data-cg-view] .cg-phone-table td[colspan]{display:block;text-align:center!important}
 body[data-cg-view] .cg-phone-table td[colspan]::before{content:none}
 body[data-cg-view=ventas] :is(.cart-item>div,.cart-product,.cart-meta){min-width:0;overflow-wrap:anywhere}
 body[data-cg-view=ventas] .cart-item .remove{min-width:44px;min-height:44px;flex:none}
 body[data-cg-view=ventas] .cart-total{white-space:normal;line-height:1.6;overflow-wrap:anywhere}
 body[data-cg-view=ventas] .cgv2-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body[data-cg-view=ventas] .cgv2-kpis>.cgv2-card:last-child{grid-column:1/-1}
 body[data-cg-view=ventas] .cgv2-client{grid-template-columns:minmax(0,1fr) auto!important}
 body[data-cg-view=ventas] .cgv2-client>b{max-width:120px;white-space:normal!important;text-align:right}
 body[data-cg-view=ventas] #cgMisReportes .mr-filters{grid-template-columns:minmax(0,1fr)}
 body[data-cg-view=ventas] #cgMisReportes .mr-filters>*{grid-column:1/-1}
 body[data-cg-view=ventas] #cgMisReportes .mr-table{max-height:none;overflow:visible;border:0}
 body[data-cg-view=ventas] #cgMisReportes .mr-head{position:sticky;top:-16px;background:#fff;padding:12px 0;z-index:2}
 body[data-cg-view=produccion] .cg-p4-controls{grid-template-columns:minmax(0,1fr)!important}
 body[data-cg-view=produccion] .cg-p4-rounds{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 body[data-cg-view=produccion] .cg-p4-rounds button{padding:8px 5px!important;min-width:0}
 body[data-cg-view=produccion] .cg-p4-detail-grid{grid-template-columns:minmax(0,1fr)!important}
 body[data-cg-view=produccion] .cg-report-panel{min-width:0;max-width:100%}
 body[data-cg-view=produccion] .cg-report-panel input{width:100%;min-width:0}
 body[data-cg-view=oficina] .kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body[data-cg-view=oficina] :is(.filters-top,.filters-bottom){grid-template-columns:minmax(0,1fr)!important}
 body[data-cg-view=oficina] :is(.filters-top,.filters-bottom)>*{grid-column:1/-1!important}
 body[data-cg-view=oficina] :is(.office-main,.office-grid,.office-card){min-width:0;max-width:100%}
 body[data-cg-view=oficina] .office-grid{grid-template-columns:minmax(0,1fr)!important}
 body[data-cg-view=oficina] :is(.office-heading,.report-head,.list-heading,.order-info,.card-top){flex-wrap:wrap;gap:10px}
 body[data-cg-view=oficina] .office-heading .heading-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
 body[data-cg-view=oficina] .document-action button{width:100%}
 body[data-cg-view=oficina] .report-scroll{overflow:visible;max-height:none}
 body[data-cg-view=oficina] .dialog-heading{position:sticky;top:0;background:white;z-index:2}
 body[data-cg-view=oficina] .dialog-footer button{width:100%;white-space:normal}
 body[data-cg-view=chofer] .route{align-items:stretch;gap:10px}
 body[data-cg-view=chofer] .route>label{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:1 1 180px}
 body[data-cg-view=chofer] .route>button{flex:1 1 130px}
 body[data-cg-view=chofer] .actions>button{min-height:48px}
 body[data-cg-view=dashboard] .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-cg-view=dashboard] .kpi:last-child{grid-column:1/-1}
 body[data-cg-view=dashboard] .kpis .kpi{min-width:0;padding:17px}
 body[data-cg-view=dashboard] .kpis strong{font-size:28px}
 body[data-cg-view=dashboard] .rank-value{max-width:100%;line-height:1.6}
 body[data-cg-view=dashboard] :is(.orders-table,.seller-table) td::before{grid-row:1}
 body[data-cg-view=direccion] .dir-header nav{width:100%;margin-left:0;gap:8px}
 body[data-cg-view=direccion] .dir-header nav a{min-height:44px;max-width:100%;white-space:normal}
 body[data-cg-view=direccion] .meta-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-cg-view=direccion] .meta-kpis article:last-child{grid-column:1/-1}
 body[data-cg-view=direccion] .meta-filtros,body[data-cg-view=direccion] .form-grid{grid-template-columns:minmax(0,1fr)}
 body[data-cg-view=direccion] .dir-tabs{flex-wrap:wrap}
 body[data-cg-view=direccion] .dir-tabs button{flex:1;min-width:0}
 body[data-cg-view=clientes] :is(.fields,.form-layout,.list-controls){grid-template-columns:minmax(0,1fr)!important}
 body[data-cg-view=clientes] .fields>*{grid-column:1/-1!important}
 body[data-cg-view=clientes] aside{position:static}
 body[data-cg-view=clientes] .save-bar button{width:100%;min-height:48px}
 body[data-cg-view=login] .login-card{width:100%;min-width:0;max-width:460px}
 body[data-cg-view=tutorial] .course-nav nav{grid-template-columns:repeat(4,minmax(0,1fr))}
 body[data-cg-view=tutorial] .course-nav .lesson-nav-button{min-width:44px;min-height:44px}
 body[data-cg-view=tutorial] .lesson-nav-button .lesson-number{width:32px;height:32px}
 body[data-cg-view=tutorial] :is(.lesson-area,.course-nav,.review,.demo-body){min-width:0}
 body[data-cg-view=analisis] .rail{position:static;inset:auto;width:100%;flex-direction:row;justify-content:space-between;align-items:center;gap:8px;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));border-right:0;border-bottom:1px solid #17364c}
 body[data-cg-view=analisis] .rail .brand{margin:0;flex:none;width:28px}
 body[data-cg-view=analisis] .rail nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:0;min-width:0;flex:1;width:auto}
 body[data-cg-view=analisis] .rail nav a{min-width:44px;min-height:44px}
 body[data-cg-view=analisis] .railfoot{display:none}
 body[data-cg-view=analisis] main{margin-left:0;padding:18px max(12px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));width:100%;max-width:100%}
 body[data-cg-view=analisis] .masthead{flex-direction:column;align-items:stretch;gap:15px}
 body[data-cg-view=analisis] .tabs{width:100%}
 body[data-cg-view=analisis] .tabs button{flex:1;padding:10px 7px}
 body[data-cg-view=analisis] .head-actions{width:100%}
 body[data-cg-view=analisis] .exportbutton{flex:1;min-height:44px}
 body[data-cg-view=analisis] :is(.tabs,.head-actions,.panel-head,.surface-meta,.surface-legend,.lab-status,.legend,.table-controls){flex-wrap:wrap;max-width:100%;gap:8px}
 body[data-cg-view=analisis] :is(.iconbutton,.tabs button,.segments button,.cluster-controls button){min-height:44px!important;min-width:44px!important}
 body[data-cg-view=analisis] .surface-actions{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));width:100%;gap:7px}
 body[data-cg-view=analisis] .surface-actions select{grid-column:1/-1;width:100%;min-height:44px}
 body[data-cg-view=analisis] .surface-actions .iconbutton{width:100%;padding:7px}
 body[data-cg-view=analisis] .surface-actions svg{width:18px;height:18px}
 body[data-cg-view=analisis] .segments{flex-wrap:wrap}
 body[data-cg-view=analisis] .segments button{padding:8px 10px;flex:1}
 body[data-cg-view=analisis] .dategroup{display:grid;grid-template-columns:minmax(0,1fr);width:100%;min-width:0;gap:8px}
 body[data-cg-view=analisis] .dategroup>span{display:none}
 body[data-cg-view=analisis] .dategroup input{width:100%;min-width:0;max-width:100%;font-size:16px;padding:10px}
 body[data-cg-view=analisis] .toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
 body[data-cg-view=analisis] .toolbar>*{grid-column:1/-1}
 body[data-cg-view=analisis] .selectgroup{margin-left:0;display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
 body[data-cg-view=analisis] .selectgroup select{max-width:100%;width:100%}
 body[data-cg-view=analisis] .freshness{margin-left:0;flex-wrap:wrap;line-height:1.6}
 body[data-cg-view=analisis] .scene-wrap{height:355px;touch-action:pan-y}
 body[data-cg-view=analisis] #space{touch-action:pan-y}
 body[data-cg-view=analisis] .surface:fullscreen #space{touch-action:none}
 body[data-cg-view=analisis] .kpi-value{white-space:normal;overflow-wrap:anywhere;line-height:1.2}
 body[data-cg-view=analisis] .kpi-meta{flex-wrap:wrap;line-height:1.5}
 body[data-cg-view=analisis] .table-scroll{overflow:visible}
 body[data-cg-view=analisis] .cg-phone-table td::before{color:#99aec4}
 body[data-cg-view=analisis] .cg-phone-table tbody tr{background:#0b2132;border-color:#223e54}
 body[data-cg-view=analisis] .cg-phone-table td{color:#d4e3f0}
 body[data-cg-view=analisis] .cg-phone-table button{max-width:100%;font-size:13px}
 body[data-cg-view=analisis] :is(#priceDialog,#clusterDialog){padding:16px;width:calc(100vw - 24px)}
 body[data-cg-view=analisis] #priceDialog .panel-head,body[data-cg-view=analisis] #clusterDialog .panel-head{flex-wrap:nowrap;align-items:flex-start}
 body[data-cg-view=analisis] #priceBody .table-scroll{max-width:100%}
 body[data-cg-view=analisis] .scene-tip{max-width:calc(100% - 16px);overflow-wrap:anywhere;white-space:normal}
}
@media screen and (max-width:360px){
 body[data-cg-view] .cg-qty-cards strong{font-size:21px}
 body[data-cg-view=analisis] .kpis{grid-template-columns:minmax(0,1fr)}
 body[data-cg-view=analisis] .kpis>*{grid-column:1/-1}
 body[data-cg-view=produccion] .cg-p4-rounds{grid-template-columns:minmax(0,1fr)}
 body[data-cg-view=oficina] .heading-actions{grid-template-columns:minmax(0,1fr)!important}
 body[data-cg-view=dashboard] .attention-metrics{grid-template-columns:minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){
 body[data-cg-view] *,body[data-cg-view] *::before,body[data-cg-view] *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
@media print{
 .cg-qty-switch{display:none!important}
 .cg-quantities>span{color:#222;background:white;border-color:#aaa}
}
