:root{color-scheme:light;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{margin:0;font-size:14px}img{max-width:100%}[hidden]{display:none!important}

/* Layout: barra lateral turquesa con el logo Lomoro en PC, barra inferior en el celular. Turquesa estructura, coral marca lo que importa (el arco del logo). */
:root {
  --bg: #F1F8F8; --surface: #FFFFFF; --sunk: #E9F4F4; --ink: #0C2B2B; --muted: #4F6F6E; --line: #D2E5E4;
  --accent: #01807E; --accent-ink: #FFFFFF; --accent-soft: #DDF1F0;
  --frost: #DDF1F0; --frost-ink: #015F5D;
  --side-bg: #019795; --side-bg2: #01807E; --side-ink: #FFFFFF; --side-active: #FFFFFF; --side-active-ink: #01807E; --cream: #FF594B;
  --coral: #FF594B; --coral-soft: #FFE5E2;
  --ok: #1D7A4E; --ok-soft: #DDF1E6; --warn: #9A6410; --warn-soft: #FBEFD6; --bad: #C0392B; --bad-soft: #F9DEDB;
  --shadow: 0 1px 2px rgba(1,128,126,.07), 0 6px 18px rgba(1,128,126,.08);
  --f-display: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --nav-w: 232px; --tab-h: 62px; --ease: cubic-bezier(.22,1,.36,1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #061A1B; --surface: #0B2829; --sunk: #082122; --ink: #E3F2F1; --muted: #8FB5B3; --line: #17393A;
  --accent: #3CCAC6; --accent-ink: #022322; --accent-soft: #0F3A3A;
  --frost: #0F3A3A; --frost-ink: #A8E3E0;
  --side-bg: #01605E; --side-bg2: #017E7B; --side-ink: #F2FBFA; --side-active: #F2FBFA; --side-active-ink: #015F5D; --cream: #FF6B5D;
  --coral: #FF6B5D; --coral-soft: #3D1E1A;
  --ok: #5BC48F; --ok-soft: #12301F; --warn: #E4B04F; --warn-soft: #33270F; --bad: #F07A6E; --bad-soft: #3A1714;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.28); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #061A1B; --surface: #0B2829; --sunk: #082122; --ink: #E3F2F1; --muted: #8FB5B3; --line: #17393A;
  --accent: #3CCAC6; --accent-ink: #022322; --accent-soft: #0F3A3A;
  --frost: #0F3A3A; --frost-ink: #A8E3E0;
  --side-bg: #01605E; --side-bg2: #017E7B; --side-ink: #F2FBFA; --side-active: #F2FBFA; --side-active-ink: #015F5D; --cream: #FF6B5D;
  --coral: #FF6B5D; --coral-soft: #3D1E1A;
  --ok: #5BC48F; --ok-soft: #12301F; --warn: #E4B04F; --warn-soft: #33270F; --bad: #F07A6E; --bad-soft: #3A1714;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.28); color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45 }
button, input, select, textarea { font: inherit; color: inherit }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: -.01em; margin: 0; text-wrap: balance; line-height: 1.1 }
h1 { font-size: 30px } h2 { font-size: 22px } h3 { font-size: 18px }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums }
.muted { color: var(--muted) }
.eyebrow { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: .2em; font-size: 11px; color: var(--muted) }

/* Shell */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh }
.side { position: sticky; top: 0; height: 100vh; background: linear-gradient(175deg, var(--side-bg) 0%, var(--side-bg) 55%, var(--side-bg2) 100%); color: var(--side-ink); overflow: hidden; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px }
.brand { padding: 0 6px 18px; position: relative; z-index: 1 }
.logo { position: relative; width: 100%; aspect-ratio: 496 / 220 }
.logo img { position: absolute; inset: 0; width: 100%; height: 100% }
.side .logo:hover .arc { animation: arcSweep .9s var(--ease) }
.bsub { margin-top: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.12) }
.bsub b { font-family: var(--f-display); font-weight: 700; font-size: 14px; display: block; line-height: 1.2 }
.bsub small { display: block; font-size: 12px; opacity: .85; margin-top: 2px; line-height: 1.3 }
.side::after { content: ""; position: absolute; left: -40%; right: -40%; bottom: -120px; height: 220px; border-radius: 50%; border-top: 10px solid var(--coral); opacity: .9; pointer-events: none }
.side::before { content: ""; position: absolute; left: -30%; right: -30%; bottom: -150px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none }
.mbrand { display: none; width: 100%; align-items: center; gap: 10px }
.mbrand .logo { width: 92px; flex: none; background: var(--side-bg); border-radius: 8px; padding: 0 }
.mbrand span { font-size: 12.5px; color: var(--muted); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.side a { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; opacity: .78; font-weight: 700 }
.side a:hover { opacity: 1; background: rgba(255,255,255,.13) }
.side a[aria-current="page"] { opacity: 1; background: var(--side-active); color: var(--side-active-ink); box-shadow: inset 4px 0 0 var(--coral) }
.side a { transition: background .2s, opacity .2s, transform .2s var(--ease) }
.side a:active { transform: scale(.97) }
.side a .cnt { margin-left: auto; font-family: var(--f-mono); font-size: 12px; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px }
.side .foot { margin-top: auto; padding-bottom: 6px; font-size: 12px; opacity: .85; padding: 0 10px; position: relative; z-index: 1 }
.side .foot .status { color: inherit }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }

.main { min-width: 0; display: flex; flex-direction: column }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line);
  padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg) }
.top h1 { margin-right: auto }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px }
.who select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); max-width: 190px }
.view { padding-block: 18px 28px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; max-width: 1240px; width: 100% }

.tabs { display: none }
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr) }
  .side { display: none }
  .mbrand { display: flex; align-items: center; gap: 6px }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px) }
  .tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tab-h); color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 700; position: relative }
  .tabs a[aria-current="page"] { color: var(--accent) }
  .tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 4px; border-radius: 0 0 99px 99px; background: var(--coral); animation: tabIn .35s var(--ease) }
  .tabs a .cnt { position: absolute; top: 6px; left: calc(50% + 6px); font-family: var(--f-mono); font-size: 10px; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 5px }
  .view { padding-bottom: calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)) }
  h1 { font-size: 26px }
}

/* Blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); min-width: 0 }
.card > h2, .card > header { margin-bottom: 12px }
.card > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.card > header h2 { margin-right: auto }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 18px; align-items: start }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px }
.kpi .v { font-family: var(--f-display); font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1.05; font-variant-numeric: tabular-nums }
.kpi.alert { background: var(--bad-soft); border-color: transparent }
.kpi .v { overflow-wrap: anywhere }
.kpi.alert .v { color: var(--bad) }

.btn { color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; text-decoration: none; min-height: 42px }
.btn:hover { border-color: var(--muted) }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.btn { transition: transform .15s var(--ease), filter .15s, border-color .15s }
.btn:active:not(:disabled) { transform: scale(.96) }
.btn.coral { background: var(--coral); color: #fff; border-color: var(--coral) }
.btn.primary:hover { filter: brightness(1.06) }
.btn.ghost { background: transparent; border-color: transparent }
.btn.danger { color: var(--bad) }
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: 13.5px }
.btn.big { min-height: 52px; font-size: 16.5px; padding: 12px 20px }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 160px }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--muted) }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=month], select, textarea { width: 100%; padding: 10px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); min-height: 42px }
textarea { resize: vertical; min-height: 110px; line-height: 1.5 }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent }

.seg { display: inline-flex; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 7px; font-weight: 700; cursor: pointer; color: var(--muted) }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow) }

.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px }
table { width: 100%; border-collapse: collapse; font-size: 14.5px }
th { text-align: left; font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; font-size: 12px; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle }
tr:last-child td { border-bottom: 0 }
td.r, th.r { text-align: right }
tr.click { cursor: pointer }
tr.click:hover td { background: var(--sunk) }
.pname { font-weight: 700 }
.psub { font-size: 12.5px; color: var(--muted) }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 2px 9px; font-size: 12.5px; font-weight: 700; white-space: nowrap }
.pill.ok { background: var(--ok-soft); color: var(--ok) }
.pill.warn { background: var(--warn-soft); color: var(--warn) }
.pill.bad { background: var(--bad-soft); color: var(--bad) }
.pill.info { background: var(--frost); color: var(--frost-ink) }
.pill.acc { background: var(--accent-soft); color: var(--accent) }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor }

.stockbar { height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; width: 90px; border: 1px solid var(--line) }
.stockbar > i { display: block; height: 100% }

.alertband { display: flex; gap: 12px; align-items: flex-start; background: var(--bad-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px }
.alertband svg { color: var(--bad); margin-top: 2px }
.alertband b { color: var(--bad) }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px }

.list { display: flex; flex-direction: column }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line) }
.li:last-child { border-bottom: 0 }
.li .grow { flex: 1; min-width: 0 }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 12px }
.empty b { display: block; color: var(--ink); font-family: var(--f-display); font-size: 19px; margin-bottom: 4px }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--sunk) }
.stepper button { width: 38px; height: 38px; border: 0; background: transparent; font-size: 20px; cursor: pointer; font-weight: 700 }
.stepper input { width: 52px; text-align: center; border: 0; background: transparent; min-height: 38px; padding: 0; font-family: var(--f-mono) }
.stepper input:focus { outline: none }

.cartbar { position: sticky; bottom: 0; z-index: 10 }
@media (max-width: 820px) { .cartbar { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)) } }
.cartbar .card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--side-bg); color: var(--side-ink); border: 0 }
.cartbar .btn.primary { background: var(--side-active); color: var(--side-active-ink); border-color: var(--side-active) }
.cartbar .card { box-shadow: 0 10px 30px rgba(1,96,94,.35); position: relative; overflow: hidden }
.cartbar .card::before { content: ""; position: absolute; left: 10%; right: 10%; top: -22px; height: 34px; border-radius: 50%; border-bottom: 4px solid var(--coral) }
.bump { animation: bump .45s var(--ease) }
.cartbar .card .muted { color: inherit; opacity: .7 }

.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: var(--sunk); cursor: pointer }
.drop:hover, .drop.over { border-color: var(--accent) }
.drop img { max-height: 260px; border-radius: 8px; border: 1px solid var(--line) }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block }
@keyframes spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s } }

/* Nota de pedido / hoja de carga look */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 18px; font-size: 14px }
.doc .dh { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 3px solid var(--side-bg); padding-bottom: 10px; margin-bottom: 10px }
.doc .letter { font-family: var(--f-display); font-size: 34px; border: 2px solid var(--ink); width: 46px; height: 46px; display: grid; place-items: center; line-height: 1 }
.doc .tot { display: flex; justify-content: flex-end; gap: 16px; border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 8px; font-weight: 700; font-size: 16px }

.pick td:first-child { width: 40px }
.pick input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--ok) }
.pick tr.done td { color: var(--muted); text-decoration: line-through }
.progress { height: 10px; background: var(--sunk); border-radius: 99px; overflow: hidden; border: 1px solid var(--line) }
.progress > i { display: block; height: 100%; background: var(--ok) }

/* Modal + toasts */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8,16,22,.55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) }
@media (min-width: 700px) { .scrim { align-items: center } }
.modal { background: var(--bg); border-radius: 14px; width: min(640px, 100%); max-height: calc(100% - 20px); overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35) }
.modal header { display: flex; align-items: center; gap: 10px }
.modal header h2 { margin-right: auto }
.toasts { position: fixed; z-index: 80; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)) }
@media (max-width: 820px) { .toasts { bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)) } }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 10px; font-weight: 700; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start }
.toast.bad { background: var(--bad); color: #fff }
.toast.warn { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn) }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted) }
.status .dot.live { background: var(--ok) }
.status .dot.off { background: var(--bad) }
#stAlert:empty { display: none }
.top h1 a { color: var(--muted) }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr } .kpi:last-child:nth-child(odd) { grid-column: 1 / -1 } .hide-sm { display: none } }
/* Animaciones */
@keyframes rise { from { opacity: .001; transform: translateY(12px) } to { opacity: 1; transform: none } }
@keyframes arcSweep { 0% { clip-path: inset(0 100% 0 0) } 100% { clip-path: inset(0 0 0 0) } }
@keyframes tabIn { from { transform: scaleX(0) } to { transform: scaleX(1) } }
@keyframes bump { 0% { transform: scale(1) } 35% { transform: scale(1.08) } 100% { transform: scale(1) } }
@keyframes flashUp { 0% { background: var(--ok-soft) } 100% { background: transparent } }
@keyframes flashDown { 0% { background: var(--coral-soft) } 100% { background: transparent } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent) } 50% { box-shadow: 0 0 0 5px transparent } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96) } to { opacity: 1; transform: none } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(40px) } to { opacity: 1; transform: none } }
@keyframes drive { 0% { transform: translateX(-140px) } 60% { transform: translateX(10px) } 100% { transform: translateX(0) } }
.view > * { animation: rise .5s var(--ease) both }
.view > *:nth-child(2) { animation-delay: .05s } .view > *:nth-child(3) { animation-delay: .1s } .view > *:nth-child(4) { animation-delay: .15s } .view > *:nth-child(5) { animation-delay: .2s }
.kpi { animation: rise .5s var(--ease) both; transition: transform .2s var(--ease) }
.kpi:nth-child(2) { animation-delay: .06s } .kpi:nth-child(3) { animation-delay: .12s } .kpi:nth-child(4) { animation-delay: .18s } .kpi:nth-child(5) { animation-delay: .24s }
.kpi:hover { transform: translateY(-2px) }
tr.flash-up td { animation: flashUp 1.6s ease-out }
tr.flash-down td { animation: flashDown 1.6s ease-out }
.pill.bad .dot, .status .dot.live { animation: pulse 1.8s infinite }
.toast { animation: toastIn .4s var(--ease) both; position: relative; overflow: hidden }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--coral); animation: tbar var(--t, 3.8s) linear forwards }
@keyframes tbar { from { width: 100% } to { width: 0 } }
.scrim { animation: rise .2s ease both }
.modal { animation: sheetIn .35s var(--ease) both }
.progress > i, .stockbar > i { transition: width .6s var(--ease) }
.pick tr td { transition: color .3s }
.truck { display: inline-block; animation: drive 1.1s var(--ease) both; color: var(--accent) }
.stepper button { transition: transform .12s }
.stepper button:active { transform: scale(.85) }
/* Splash de apertura */
.splash { position: fixed; inset: 0; z-index: 100; background: var(--side-bg); display: grid; place-items: center; animation: splashOut .55s var(--ease) 1.5s forwards }
.splash .logo { width: min(340px, 70vw) }
.splash .arc { animation: arcSweep .8s var(--ease) .15s both }
.splash .word { animation: rise .7s var(--ease) .45s both }
@keyframes splashOut { to { transform: translateY(-100%); visibility: hidden } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
  .splash { display: none }
}
.hint { font-size: 13px; color: var(--muted); background: var(--frost); color: var(--frost-ink); border-radius: 10px; padding: 10px 12px }

/* Acceso */
.gate { min-height: 100vh; display: grid; place-items: center; background: var(--side-bg); color: var(--side-ink); padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); position: relative; overflow: hidden }
.gate::after { content: ""; position: absolute; left: -20%; right: -20%; bottom: -220px; height: 380px; border-radius: 50%; border-top: 14px solid var(--coral); pointer-events: none }
.gate-in { width: min(820px, 100%); display: flex; flex-direction: column; gap: 22px; align-items: center; position: relative; z-index: 1 }
.gate .logo { width: min(300px, 72vw) }
.gate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; width: 100% }
.gcard { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.18); animation: rise .5s var(--ease) both }
.gcard:nth-child(2) { animation-delay: .08s }
.gcard .gico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent) }
.gcard.seller .gico { background: var(--coral-soft); color: var(--coral) }
.gcard p { margin: 0; color: var(--muted) }
.gcard .field { flex: none }
.gform { display: flex; flex-direction: column; gap: 10px }
.mbody > .field, .gform .field { flex: none }
.lock { background: var(--side-bg); z-index: 95 }
.gate-cards { align-items: start }
#pnAlert:empty { display: none }
.gate .who-line { font-size: 13.5px; opacity: .9; text-align: center }

/* Sincronización */
.sync { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px }
.sync.ok { background: var(--ok-soft); color: var(--ok) }
.sync.pend { background: var(--warn-soft); color: var(--warn) }
.sync.off { background: var(--coral-soft); color: var(--bad) }
.sync .grow { flex: 1 }
.netdot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px }
.netdot.on { background: var(--ok-soft); color: var(--ok) }
.netdot.off { background: var(--coral-soft); color: var(--bad) }
.netdot.pend { background: var(--warn-soft); color: var(--warn) }

/* Panel en vivo */
.sellers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 14px }
.scard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); min-width: 0 }
.scard .top-row { display: flex; align-items: center; gap: 10px }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; background: var(--accent-soft); color: var(--accent); flex: none; position: relative }
.avatar.live::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); animation: pulse 1.8s infinite; color: var(--ok) }
.mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center }
.mini div { background: var(--sunk); border-radius: 9px; padding: 6px 4px }
.mini b { display: block; font-family: var(--f-display); font-size: 18px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums }
.mini span { font-size: 11px; color: var(--muted); font-weight: 700 }
.tl { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; padding-left: 12px; max-height: 210px; overflow: auto }
.tl .ev { position: relative; padding: 4px 0; font-size: 13.5px }
.tl .ev::before { content: ""; position: absolute; left: -18px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent) }
.tl .ev.pedido::before { background: var(--accent) }
.tl .ev.nope::before { border-color: var(--coral) }
.where { font-size: 13px; background: var(--frost); color: var(--frost-ink); border-radius: 9px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.where a { color: inherit; font-weight: 700 }

/* Gráficos */
.vbars { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding-top: 18px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); background-size: 100% calc(100% - 18px); background-position: bottom; background-repeat: no-repeat }
.vbars .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; position: relative }
.vbars .col i { display: block; width: 100%; max-width: 34px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; transition: height .6s var(--ease), background .15s }
.vbars .col:hover i, .vbars .col.hl i { background: var(--coral) }
.vlabels { display: flex; gap: 3px; margin-top: 4px }
.vlabels span { flex: 1; min-width: 0; text-align: center; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden }
.hbars { display: flex; flex-direction: column; gap: 8px }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700 }
.hbar .trk { height: 14px; background: var(--sunk); border-radius: 0 4px 4px 0; overflow: hidden }
.hbar .trk i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; transition: width .6s var(--ease) }
.hbar:hover .trk i { background: var(--coral) }
.hbar .val { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap }
#tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; max-width: 240px; box-shadow: var(--shadow) }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start }

/* Sugerencias */
.sug { border-left: 4px solid var(--line); padding: 10px 12px; border-radius: 0 10px 10px 0; background: var(--sunk); display: flex; flex-direction: column; gap: 6px }
.sug.unread { border-left-color: var(--coral); background: var(--coral-soft) }
.sug .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.sug .reply { font-size: 13.5px; background: var(--surface); border-radius: 8px; padding: 6px 10px }

/* Cliente en ruta */
.client { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line) }
.client:last-child { border-bottom: 0 }
.client .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-family: var(--f-display); background: var(--sunk); color: var(--muted); flex: none; font-size: 13px }
.client.done .n { background: var(--accent); color: var(--accent-ink) }
.client.nope .n { background: var(--coral-soft); color: var(--coral) }
.client .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px }
.timer { font-family: var(--f-display); font-weight: 800; font-size: 34px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1 }
.modebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--frost); color: var(--frost-ink); font-weight: 700 }
.modebar.sim { background: var(--warn-soft); color: var(--warn) }
.sumline { display: flex; justify-content: space-between; gap: 10px; font-size: 14px }
.sumline.big { font-size: 20px; font-weight: 800; font-family: var(--f-display) }
.factura .fhead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; border-bottom: 3px solid var(--side-bg); padding-bottom: 10px; margin-bottom: 10px }
.fletra { border: 2px solid var(--ink); width: 64px; text-align: center; padding: 4px 0; font-family: var(--f-display); line-height: 1 }
.fletra span { font-size: 36px; font-weight: 800; display: block }
.fletra small { font-size: 10px; font-weight: 700 }
.fcli { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px }
.ftot { margin-left: auto; width: min(100%, 360px); display: flex; flex-direction: column; gap: 4px; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 8px }
.fcae { display: flex; gap: 16px; align-items: center; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; flex-wrap: wrap }
.fcae img { background: #fff; padding: 4px; border-radius: 4px }
@media (max-width: 560px) { .factura .fhead { grid-template-columns: 1fr auto } .factura .fhead > div:last-child { grid-column: 1 / -1; text-align: left !important } .fcli { grid-template-columns: 1fr } }
.role-chip { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--coral); color: #fff }
.side .role-chip { align-self: flex-start; margin: 0 10px 10px }
