/* Encabezado único del área del negocio · v2.10.40-h2 */
:root{--header-blue:var(--blue,#0b69c7);--header-navy:var(--navy,#14243a);--header-card:var(--card,#fff);--header-line:var(--line,#d9e2ec);--header-muted:var(--muted,#637188)}
:root[data-theme="ocean"]{--header-blue:#287f9f;--header-navy:#173742;--header-card:#fbfeff;--header-line:#d2e5e9;--header-muted:#607a82}
:root[data-theme="sage"]{--header-blue:#4f8068;--header-navy:#253b31;--header-card:#fcfefd;--header-line:#d7e5db;--header-muted:#687a6f}
:root[data-theme="violet"]{--header-blue:#7564a8;--header-navy:#312b47;--header-card:#fdfcff;--header-line:#dfd9eb;--header-muted:#756f83}
:root[data-theme="sand"]{--header-blue:#a06f42;--header-navy:#453529;--header-card:#fffdf9;--header-line:#e8dccb;--header-muted:#7b7064}
:root[data-theme="slate"]{--header-blue:#5d7084;--header-navy:#27333e;--header-card:#fcfdfe;--header-line:#d8e0e6;--header-muted:#697782}
.global-app-header{position:fixed;z-index:30;inset:0 0 auto;height:calc(58px + env(safe-area-inset-top));padding-top:env(safe-area-inset-top);background:var(--header-card);border-bottom:1px solid var(--header-line);color:var(--header-navy);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
.global-header-inner{position:relative;width:min(100%,1120px);height:58px;margin:auto;padding:0 12px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.global-header-identity{display:flex;align-items:center;min-width:0}
.global-header-brand{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;grid-template-rows:auto!important;align-items:center!important;gap:9px!important;min-width:0;padding:2px 5px!important;border:0;background:transparent;color:inherit;text-decoration:none;font-size:18px;font-weight:850}
.global-header-brand .mini-logo{grid-column:1!important;grid-row:1!important;width:36px;height:36px;border-radius:50%;object-fit:contain;flex:0 0 auto}
.global-header-brand .global-business-name{grid-column:2!important;grid-row:1!important;min-width:0;max-width:48vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.05;text-align:left}
.global-app-header .connection-indicators{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-auto-flow:row!important;align-items:center!important;justify-items:start!important;gap:2px!important;margin:0!important;min-width:0;max-width:46vw}
.global-app-header .connection-status{display:inline-flex!important;align-items:center!important;gap:4px!important;margin:0!important;transform:none!important;min-width:0!important;max-width:100%!important;color:var(--header-muted)!important;font-size:9px!important;line-height:1.1!important;font-weight:400!important;white-space:nowrap!important;text-decoration:none}
.global-app-header .connection-status-dot{width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:#d99a19;box-shadow:0 0 0 2px rgb(217 154 25/.1)}
.global-app-header .connection-status.online .connection-status-dot{background:#17a66b;box-shadow:0 0 0 2px rgb(23 166 107/.1)}
.global-app-header .connection-status.offline .connection-status-dot{background:#d94b4b;box-shadow:0 0 0 2px rgb(217 75 75/.1)}
.global-app-header .connection-status.syncing .connection-status-dot{background:var(--header-blue);animation:global-header-pulse 1s infinite alternate}
.global-app-header .offline-ready-status{cursor:pointer}
.global-header-actions{display:flex;align-items:center;gap:5px;flex:0 0 auto}
.global-header-actions .icon-btn{box-sizing:border-box;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:12px;background:transparent;color:var(--header-navy);text-decoration:none}
.global-header-actions .icon-btn:hover,.global-header-actions .icon-btn:focus-visible{background:color-mix(in srgb,var(--header-blue) 9%,transparent);outline:0}
.global-header-actions .icon-btn:active{transform:scale(.96)}
.global-header-actions svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.global-app-header .hidden{display:none!important}
body.test-mode .global-app-header{box-shadow:inset 0 -3px 0 #e3a400}
@keyframes global-header-pulse{to{opacity:.4}}
/* Las páginas independientes colocan sus herramientas debajo del encabezado. */
.inventory-body .inventory-shell{padding-top:calc(72px + env(safe-area-inset-top))}
body>.global-app-header~main.wrap{margin-top:calc(82px + env(safe-area-inset-top))}

/* Versión de la aplicación: debe ser secundaria y discreta. Se mantiene en CSS externo porque la CSP bloquea estilos inline. */
.global-app-header .global-header-brand .global-business-copy{grid-column:2!important;grid-row:1!important;display:block!important;min-width:0!important;line-height:1!important}
.global-app-header .global-header-brand .global-version-break{display:none!important}
.global-app-header .global-header-brand .global-business-copy .global-business-name{display:block!important;position:static!important;max-width:48vw!important;line-height:1.05!important}
.global-app-header .global-header-brand .global-business-copy .global-app-version{display:block!important;position:static!important;margin:0!important;padding:0!important;font-size:10px!important;line-height:.95!important;font-weight:400!important;color:var(--header-muted,#637188)!important;opacity:.72!important;white-space:nowrap!important}
@media(min-width:700px){.global-header-inner{padding-inline:18px}.inventory-body .inventory-shell{padding-top:calc(78px + env(safe-area-inset-top))}}
@media(max-width:560px){.global-header-inner{height:58px;padding-inline:8px}.global-header-brand{gap:7px!important;padding-inline:2px!important}.global-header-brand .mini-logo{width:32px;height:32px}.global-header-brand .global-business-name{font-size:16px;max-width:31vw}.global-app-header .connection-indicators{gap:2px!important;max-width:46vw}.global-app-header .connection-status{font-size:8px!important}.global-header-actions{gap:0}.global-header-actions .icon-btn{width:38px;height:40px}}
@media(max-width:390px){.global-app-header .connection-indicators{max-width:44vw}.global-app-header .connection-status{font-size:7.5px!important}.global-header-actions .icon-btn{width:35px}}
@media(prefers-reduced-motion:reduce){.global-app-header *{animation:none!important;transition:none!important}}
