/* Panel Moffyns v2: sistema de diseño propio (no usa web.css).
   Paleta: tinta casi negra + vino del logo + grises fríos; un color por estado del pedido. Claro y oscuro. */
:root {
  color-scheme: light;
  --bg: #f3f4f7; --bg-2: #e9ebf0;
  --sup: #ffffff; --sup-2: #f8f9fb; --sup-3: #f0f2f5;
  --borde: #e3e6eb; --borde-2: #d3d8e0;
  --texto: #0f1218; --texto-2: #4a5263; --texto-3: #858c9b;
  --marca: #b4233c; --marca-2: #8f1a2f; --marca-suave: #fcebee; --marca-anillo: rgba(180, 35, 60, .2);
  --tinta: #0c0e13; --tinta-2: #151821; --tinta-3: #1e222d; --tinta-borde: rgba(255, 255, 255, .07);
  --tinta-texto: #e8eaf0; --tinta-texto-2: #8b92a3;
  --sombra-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sombra-2: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px -4px rgba(16, 24, 40, .1);
  --sombra-3: 0 24px 48px -12px rgba(16, 24, 40, .28), 0 8px 16px -8px rgba(16, 24, 40, .12);
  --radio: 12px; --radio-l: 16px; --radio-xl: 20px;
  --anim: cubic-bezier(.2, .8, .2, 1);
  --rose: #e11d48; --rose-bg: #ffe4ea; --rose-tx: #be123c;
  --amber: #d97706; --amber-bg: #fef3c7; --amber-tx: #92400e;
  --violet: #7c3aed; --violet-bg: #ede9fe; --violet-tx: #5b21b6;
  --blue: #2563eb; --blue-bg: #dbeafe; --blue-tx: #1d4ed8;
  --cyan: #0891b2; --cyan-bg: #cffafe; --cyan-tx: #0e7490;
  --teal: #0d9488; --teal-bg: #ccfbf1; --teal-tx: #0f766e;
  --green: #16a34a; --green-bg: #dcfce7; --green-tx: #15803d;
  --slate: #64748b; --slate-bg: #eef1f5; --slate-tx: #475569;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    color-scheme: dark;
    --bg: #0a0c10; --bg-2: #0f1218;
    --sup: #13161d; --sup-2: #181c24; --sup-3: #1f242e;
    --borde: #242a35; --borde-2: #323a48;
    --texto: #eef0f4; --texto-2: #a9b0bd; --texto-3: #6f7787;
    --marca: #e4405c; --marca-2: #c22a47; --marca-suave: rgba(228, 64, 92, .13); --marca-anillo: rgba(228, 64, 92, .3);
    --tinta: #07080b; --tinta-2: #0f1117; --tinta-3: #181b23;
    --sombra-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sombra-2: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px -6px rgba(0, 0, 0, .55);
    --sombra-3: 0 24px 48px -12px rgba(0, 0, 0, .75);
    --rose-bg: rgba(225, 29, 72, .16); --rose-tx: #fb7190;
    --amber-bg: rgba(217, 119, 6, .17); --amber-tx: #fbbf24;
    --violet-bg: rgba(124, 58, 237, .2); --violet-tx: #b69cff;
    --blue-bg: rgba(37, 99, 235, .2); --blue-tx: #8db4ff;
    --cyan-bg: rgba(8, 145, 178, .2); --cyan-tx: #5fd4ee;
    --teal-bg: rgba(13, 148, 136, .2); --teal-tx: #4fd8c7;
    --green-bg: rgba(22, 163, 74, .18); --green-tx: #5ee08d;
    --slate-bg: rgba(100, 116, 139, .2); --slate-tx: #a8b3c4;
  }
}
:root[data-tema="oscuro"] {
  color-scheme: dark;
  --bg: #0a0c10; --bg-2: #0f1218;
  --sup: #13161d; --sup-2: #181c24; --sup-3: #1f242e;
  --borde: #242a35; --borde-2: #323a48;
  --texto: #eef0f4; --texto-2: #a9b0bd; --texto-3: #6f7787;
  --marca: #e4405c; --marca-2: #c22a47; --marca-suave: rgba(228, 64, 92, .13); --marca-anillo: rgba(228, 64, 92, .3);
  --tinta: #07080b; --tinta-2: #0f1117; --tinta-3: #181b23;
  --sombra-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sombra-2: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px -6px rgba(0, 0, 0, .55);
  --sombra-3: 0 24px 48px -12px rgba(0, 0, 0, .75);
  --rose-bg: rgba(225, 29, 72, .16); --rose-tx: #fb7190;
  --amber-bg: rgba(217, 119, 6, .17); --amber-tx: #fbbf24;
  --violet-bg: rgba(124, 58, 237, .2); --violet-tx: #b69cff;
  --blue-bg: rgba(37, 99, 235, .2); --blue-tx: #8db4ff;
  --cyan-bg: rgba(8, 145, 178, .2); --cyan-tx: #5fd4ee;
  --teal-bg: rgba(13, 148, 136, .2); --teal-tx: #4fd8c7;
  --green-bg: rgba(22, 163, 74, .18); --green-tx: #5ee08d;
  --slate-bg: rgba(100, 116, 139, .2); --slate-tx: #a8b3c4;
}
/* series de los gráficos: una por gráfico, validadas con validate_palette.js (claro y oscuro) */
:root { --s-vino: #b4233c; --s-azul: #257de0; --s-naranja: #f47230; --s-violeta: #6a4ce2; --g-linea: #eceef2; --g-base: #c9ced6; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) { --s-vino: #e4405c; --s-azul: #338ced; --s-naranja: #e76624; --s-violeta: #9887ef; --g-linea: #232833; --g-base: #3a4150; } }
:root[data-tema="oscuro"] { --s-vino: #e4405c; --s-azul: #338ced; --s-naranja: #e76624; --s-violeta: #9887ef; --g-linea: #232833; --g-base: #3a4150; }
.c-rose { --c: var(--rose); --c-bg: var(--rose-bg); --c-tx: var(--rose-tx); }
.c-amber { --c: var(--amber); --c-bg: var(--amber-bg); --c-tx: var(--amber-tx); }
.c-violet { --c: var(--violet); --c-bg: var(--violet-bg); --c-tx: var(--violet-tx); }
.c-blue { --c: var(--blue); --c-bg: var(--blue-bg); --c-tx: var(--blue-tx); }
.c-cyan { --c: var(--cyan); --c-bg: var(--cyan-bg); --c-tx: var(--cyan-tx); }
.c-teal { --c: var(--teal); --c-bg: var(--teal-bg); --c-tx: var(--teal-tx); }
.c-green { --c: var(--green); --c-bg: var(--green-bg); --c-tx: var(--green-tx); }
.c-slate { --c: var(--slate); --c-bg: var(--slate-bg); --c-tx: var(--slate-tx); }
.c-marca { --c: var(--marca); --c-bg: var(--marca-suave); --c-tx: var(--marca); }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--texto);
  font: 14px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background .3s;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }
::selection { background: var(--marca-anillo); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tenue { color: var(--texto-3); }
.chico { font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.entrar { animation: aparecer .35s ease; }
.separador { height: 1px; background: var(--borde); margin: 18px 0; }
* { scrollbar-width: thin; scrollbar-color: var(--borde-2) transparent; }

/* ---------------------------------------------------------------- botones y controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  position: relative; user-select: none; background: var(--sup-3);
  transition: transform .15s var(--anim), box-shadow .2s, background .2s, border-color .2s, color .2s, filter .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { cursor: default; opacity: .65; }
.btn-primario {
  background: var(--marca); background: linear-gradient(180deg, color-mix(in srgb, var(--marca) 88%, #fff), var(--marca-2)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(16, 24, 40, .12), 0 8px 18px -8px var(--marca);
}
.btn-primario:hover:not(:disabled) { filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(16, 24, 40, .12), 0 14px 26px -10px var(--marca); }
.btn-exito { background: #16a34a; background: linear-gradient(180deg, #22b45a, #15803d); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 18px -8px #16a34a; }
.btn-exito:hover:not(:disabled) { filter: brightness(1.07); }
.btn-sec { background: var(--sup); border-color: var(--borde-2); color: var(--texto); box-shadow: var(--sombra-1); }
.btn-sec:hover:not(:disabled) { background: var(--sup-2); border-color: var(--texto-3); }
.btn-fantasma { background: transparent; color: var(--texto-2); }
.btn-fantasma:hover { background: var(--sup-3); color: var(--texto); }
.btn-peligro { background: transparent; color: var(--rose-tx); border-color: var(--rose-bg); }
.btn-peligro:hover:not(:disabled) { background: var(--rose-bg); }
.btn-peligro-lleno { background: #dc2626; background: linear-gradient(180deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 8px 18px -8px #dc2626; }
.btn-wa { background: #22c35e; color: #fff; box-shadow: 0 6px 14px -8px #16a34a; }
.btn-wa:hover { background: #1eb455; }
.btn-grande { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-bloque { width: 100%; }
.btn.cargando { color: transparent !important; pointer-events: none; }
.btn.cargando::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: girar .7s linear infinite;
}
.btn-sec.cargando::after, .btn-fantasma.cargando::after, .btn-peligro.cargando::after { border-color: var(--borde-2); border-top-color: var(--texto); }
.btn-icono {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; flex: none; padding: 0;
  border: 1px solid var(--borde); background: var(--sup); color: var(--texto-2); text-decoration: none; transition: .2s var(--anim);
}
.btn-icono:hover:not(:disabled) { color: var(--texto); border-color: var(--borde-2); background: var(--sup-2); }
.btn-icono:active:not(:disabled) { transform: scale(.94); }
.btn-icono:disabled { opacity: .35; cursor: default; }
.btn-icono.chico { width: 28px; height: 28px; border-radius: 8px; }
.btn-icono.chico .ico { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px dashed var(--borde-2); background: transparent; color: var(--texto-2); font-size: 13px; font-weight: 500;
  white-space: nowrap; transition: .2s var(--anim);
}
.chip-btn .ico { width: 14px; height: 14px; }
.chip-btn:hover { border-style: solid; border-color: var(--marca); color: var(--marca); background: var(--marca-suave); }

.input, .buscador input, .select-mini select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--borde-2);
  background: var(--sup); color: var(--texto); font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .buscador input:focus, .select-mini select:focus { border-color: var(--marca); box-shadow: 0 0 0 4px var(--marca-anillo); }
.input::placeholder, .buscador input::placeholder { color: var(--texto-3); }
.input:disabled { background: var(--sup-3); color: var(--texto-2); }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo .etq { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.campo .ayuda { font-size: 12px; color: var(--texto-3); }
.buscador { position: relative; min-width: 0; }
.buscador > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--texto-3); width: 17px; height: 17px; pointer-events: none; }
.buscador input { padding-left: 38px; background: var(--sup); }
.vista-cab-der .buscador { width: 320px; }
.input-dolar { position: relative; }
.input-dolar > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--texto-3); font-weight: 600; pointer-events: none; }
.input-dolar .input { padding-left: 26px; font-variant-numeric: tabular-nums; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--texto-2); font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-pista { width: 38px; height: 22px; border-radius: 999px; background: var(--borde-2); position: relative; flex: none; transition: background .25s var(--anim); }
.switch-bola { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--anim); }
.switch input:checked + .switch-pista { background: var(--green); }
.switch.rojo input:checked + .switch-pista { background: var(--rose); }
.switch input:checked + .switch-pista .switch-bola { transform: translateX(16px); }
.switch input:focus-visible + .switch-pista { outline: 2px solid var(--marca); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--sup-3); border: 1px solid var(--borde); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--texto-2); white-space: nowrap; transition: .2s var(--anim); }
.seg button:hover { color: var(--texto); }
.seg button.activa { background: var(--sup); color: var(--texto); box-shadow: var(--sombra-2); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; flex: none;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--c-bg, var(--slate-bg)); color: var(--c-tx, var(--slate-tx));
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--slate)); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rose); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 0 rgba(225, 29, 72, .5); animation: llamado 2s infinite;
}
.badge:empty { display: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--marca), #6d28d9);
}
.avatar.grande { width: 46px; height: 46px; font-size: 16px; background: var(--c-bg); color: var(--c-tx); }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--slate); flex: none; position: relative; }
.punto.ok { background: #22c55e; }
.punto.ok::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: onda 2.2s infinite; }
.punto.mal { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }

.card { background: var(--sup); border: 1px solid var(--borde); border-radius: var(--radio-l); padding: 18px; box-shadow: var(--sombra-1); }
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-cab h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--texto-3); }

/* ---------------------------------------------------------------- marco */
.lateral {
  position: fixed; inset: 0 auto 0 0; width: 252px; z-index: 30; display: flex; flex-direction: column; padding: 18px 14px 16px;
  background: var(--tinta); color: var(--tinta-texto); border-right: 1px solid var(--tinta-borde); overflow: hidden;
}
.lateral::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 45% at 0% 0%, rgba(180, 35, 60, .28), transparent 65%); }
.lat-marca { display: flex; align-items: center; gap: 12px; padding: 4px 6px 22px; position: relative; }
.lat-marca img { width: 42px; height: 42px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .07), 0 8px 18px -6px rgba(0, 0, 0, .7); }
.lat-marca b { display: block; font-size: 16px; letter-spacing: -.01em; }
.lat-marca small { color: var(--tinta-texto-2); font-size: 12px; }
.lat-titulo { position: relative; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--tinta-texto-2); padding: 6px 12px; font-weight: 600; }
.lat-nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 0;
  background: transparent; color: var(--tinta-texto-2); font-weight: 500; text-align: left; transition: background .2s, color .2s;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--tinta-texto); }
.nav-item.activa { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.activa::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #e4405c; box-shadow: 0 0 14px #e4405c; }
.nav-item .badge { margin-left: auto; }
.lat-pie { position: relative; margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.a2-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--tinta-2); border: 1px solid var(--tinta-borde); }
.a2-card b { display: block; font-size: 13px; font-weight: 600; }
.a2-card small { color: var(--tinta-texto-2); font-size: 12px; }
.lat-ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lat-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border-radius: 10px;
  border: 1px solid var(--tinta-borde); background: transparent; color: var(--tinta-texto-2); font-size: 12px; font-weight: 500; transition: .2s;
}
.lat-btn .ico { width: 16px; height: 16px; }
.lat-btn:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.lat-btn[data-sonido]:not(.activo) { color: #fbbf24; border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .07); }
.lat-usuario { display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; border-top: 1px solid var(--tinta-borde); }
.lat-usuario b { display: block; font-size: 13px; text-transform: capitalize; }
.lat-usuario small { color: var(--tinta-texto-2); font-size: 12px; }
.lat-usuario .btn-icono { margin-left: auto; background: transparent; border-color: transparent; color: var(--tinta-texto-2); }
.lat-usuario .btn-icono:hover { background: rgba(255, 255, 255, .07); color: #fff; border-color: transparent; }
.principal { margin-left: 252px; min-height: 100vh; min-height: 100dvh; }
.vista { --pad: 36px; padding: 30px var(--pad) 56px; max-width: 1480px; margin: 0 auto; }
.barra-movil, .tabbar { display: none; }

.vista-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.vista-cab h1 { font-size: 28px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; }
.vista-cab .sub { color: var(--texto-2); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vista-cab .sep { color: var(--texto-3); }
.vista-cab-der { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vivo { display: inline-flex; align-items: center; gap: 7px; color: var(--green-tx); font-weight: 600; }
.vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; }
.vivo i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: onda 2.2s infinite; }
.vivo.caido { color: var(--amber-tx); }
.vivo.caido i { background: var(--amber); }
.vivo.caido i::after { display: none; }

.vacio {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 20px;
  color: var(--texto-3); border: 1.5px dashed var(--borde-2); border-radius: var(--radio-l);
}
.vacio-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--sup-3); color: var(--texto-2); margin-bottom: 6px; }
.vacio b { color: var(--texto); font-size: 15px; }
.esq {
  pointer-events: none; border-color: transparent !important; box-shadow: none !important;
  background: linear-gradient(90deg, var(--sup-3) 25%, var(--sup-2) 50%, var(--sup-3) 75%) !important; background-size: 200% 100% !important;
  animation: brillo 1.3s infinite linear;
}
.kpi.esq { height: 74px; }
.ped.esq { height: 112px; }
.prod.esq { height: 300px; }

/* ---------------------------------------------------------------- pedidos */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 4px;
  padding: 14px 14px 13px 16px; border-radius: var(--radio-l); background: var(--sup); border: 1px solid var(--borde); box-shadow: var(--sombra-1);
  text-align: left; color: var(--texto); transition: transform .25s var(--anim), box-shadow .25s, border-color .25s;
}
.kpi-ico { grid-column: 2; grid-row: 1; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--c-bg); color: var(--c); }
.kpi-ico .ico { width: 17px; height: 17px; }
.kpi-num { grid-column: 1; grid-row: 1; justify-self: start; font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; transform-origin: left center; }
.kpi-txt { grid-column: 1 / -1; grid-row: 2; font-size: 12.5px; color: var(--texto-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.kpi:hover { transform: translateY(-2px); box-shadow: var(--sombra-2); border-color: var(--borde-2); }
.kpi.activa { border-color: var(--c); box-shadow: 0 0 0 3px var(--c-bg), var(--sombra-2); }
.kpi.alerta .kpi-ico { animation: llamado-c 1.8s infinite; }
.kpi.alerta::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.kpi-num.cambio { animation: bump .6s var(--anim); }
.kpi-hoy { background: radial-gradient(120% 140% at 100% 0%, rgba(180, 35, 60, .6), transparent 55%), linear-gradient(135deg, #1b1e28, #0c0e13); border-color: transparent; color: #fff; }
.kpi-hoy .kpi-ico { background: rgba(255, 255, 255, .09); color: #fff; }
.kpi-hoy .kpi-txt { color: rgba(255, 255, 255, .66); }
.kpi-hoy .kpi-num { font-size: 22px; }

.md { display: grid; grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); gap: 20px; align-items: start; }
.lista-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lista { display: flex; flex-direction: column; gap: 10px; }
.lista > *, .det-cuerpo > * { flex-shrink: 0; }
.lista-grupo { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--texto-3); margin: 8px 2px 0; }
.lista-grupo:first-child { margin-top: 0; }
.lista-grupo .n { margin-left: auto; background: var(--sup-3); color: var(--texto-2); border-radius: 999px; padding: 1px 8px; font-size: 11px; letter-spacing: 0; }
.punto-c { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.animar > * { animation: subir .45s var(--anim) backwards; }
.animar > :nth-child(2) { animation-delay: .03s; } .animar > :nth-child(3) { animation-delay: .06s; } .animar > :nth-child(4) { animation-delay: .09s; }
.animar > :nth-child(5) { animation-delay: .12s; } .animar > :nth-child(6) { animation-delay: .15s; } .animar > :nth-child(n+7) { animation-delay: .18s; }
.ped {
  position: relative; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 14px 18px; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--borde); background: var(--sup); box-shadow: var(--sombra-1); color: var(--texto);
  transition: transform .2s var(--anim), box-shadow .2s, border-color .2s;
}
.ped::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.ped:hover { transform: translateY(-1px); box-shadow: var(--sombra-2); border-color: var(--borde-2); }
.ped.sel { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-anillo), var(--sombra-2); }
.ped.recien { animation: entra-brilla 1.8s var(--anim); }
.ped-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ped-num { font-weight: 700; color: var(--texto-3); font-variant-numeric: tabular-nums; }
.ped-nombre { font-weight: 650; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ped-items { color: var(--texto-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ped-pie { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--texto-3); }
.meta { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.meta .ico { width: 14px; height: 14px; }
.ped-total { margin-left: auto; font-weight: 700; color: var(--texto); font-size: 15px; font-variant-numeric: tabular-nums; }
.ped-total.tentativo { color: var(--texto-2); font-weight: 600; }
.tiempo.t-warn { color: var(--amber-tx); font-weight: 600; }
.tiempo.t-crit { color: var(--rose-tx); font-weight: 700; }
.tiempo.t-crit .ico { animation: latido 1.2s infinite; }

.detalle-col { min-width: 0; }
@media (min-width: 1024px) {
  .md { align-items: stretch; min-height: 0; }
  .lista-col { min-height: 0; }
  .lista { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3px 6px 16px 3px; margin: -3px -6px 0 -3px; }
  .detalle-col { min-height: 0; display: flex; flex-direction: column; }
  .detalle-col > * { flex: 1; min-height: 0; }
}
.detalle-velo { display: none; }
.det { display: flex; flex-direction: column; max-height: 100%; background: var(--sup); border: 1px solid var(--borde); border-radius: var(--radio-xl); box-shadow: var(--sombra-2); overflow: hidden; }
.det-cab { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--borde); background: var(--sup); }
.det-cab .volver { display: none; }
.det-tit { flex: 1; min-width: 0; }
.det-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.det-fila h2 { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.det-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--texto-2); font-size: 13px; }
.det-sub span { display: inline-flex; align-items: center; gap: 6px; }
.det-sub .ico { width: 14px; height: 14px; color: var(--texto-3); }
.det-cab-acc { display: flex; gap: 6px; }
.det-cuerpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; background: var(--sup-2); }
.det-cuerpo .card { padding: 16px; }
.det-pie { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--borde); background: var(--sup); flex-wrap: wrap; }
.det-pie-sec, .det-pie-prim { display: flex; gap: 8px; flex-wrap: wrap; }
.det-pie-prim { margin-left: auto; }
.det-vacio {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 64px 24px; min-height: 360px;
  border: 1.5px dashed var(--borde-2); border-radius: var(--radio-xl); color: var(--texto-3);
}
.det-vacio-ilu { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; margin-bottom: 10px; color: var(--marca); background: linear-gradient(135deg, var(--marca-suave), var(--sup-3)); }
.det-vacio-ilu .ico { width: 34px; height: 34px; stroke-width: 1.6; }
.det-vacio b { color: var(--texto); font-size: 16px; }
.det-vacio span { max-width: 290px; }

.pasos { list-style: none; margin: 0; padding: 16px 10px 14px; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--sup); border: 1px solid var(--borde); border-radius: var(--radio-l); }
.pasos li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--texto-3); font-weight: 600; text-align: center; }
.pasos li + li::before { content: ''; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--borde); }
.pasos li.hecho::before, .pasos li.actual::before { background: var(--marca); }
.paso-c {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sup-3); border: 2px solid var(--borde); color: var(--texto-3); font-size: 12px; font-weight: 700; transition: .3s var(--anim);
}
.paso-c .ico { width: 14px; height: 14px; stroke-width: 3; }
.pasos .hecho, .pasos .actual { color: var(--texto); }
.hecho .paso-c { background: var(--marca); border-color: var(--marca); color: #fff; }
.actual .paso-c { background: var(--sup); border-color: var(--marca); color: var(--marca); animation: pulso-anillo 2s infinite; }

.cliente { display: flex; align-items: center; gap: 12px; }
.cliente-datos { min-width: 0; }
.cliente-datos b { display: block; font-size: 16px; }
.acciones-cliente { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.acciones-cliente .btn { height: 36px; padding: 0 12px; font-size: 13px; }
.acciones-cliente .ico { width: 16px; height: 16px; }
.direccion { display: flex; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--sup-2); border: 1px solid var(--borde); }
.direccion > .ico { color: var(--marca); margin-top: 2px; }
.direccion small { display: block; color: var(--texto-3); margin-top: 2px; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-top: 12px; font-size: 13.5px; }
.callout > .ico { margin-top: 1px; }
.callout b { display: block; }
.callout.amarillo { background: var(--amber-bg); color: var(--amber-tx); }
.callout.rojo { background: var(--rose-bg); color: var(--rose-tx); margin-top: 0; }

.items { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--borde); align-items: start; }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item-cant { min-width: 34px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--sup-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; transition: .2s; }
.item-nombre { font-weight: 600; transition: color .2s; }
.item-det { font-size: 13px; color: var(--texto-2); margin-top: 2px; }
.item-nota { font-size: 13px; color: var(--amber-tx); font-style: italic; margin-top: 2px; }
.item-cod { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11.5px; color: var(--texto-3); margin-top: 4px; }
.item-der { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.item-precio { font-weight: 700; font-variant-numeric: tabular-nums; }
.item.no-hay .item-nombre, .item.no-hay .item-det, .item.no-hay .item-precio { text-decoration: line-through; color: var(--texto-3); }
.item.no-hay .item-cant { background: var(--rose-bg); color: var(--rose-tx); }
.toggle-nohay { position: relative; display: inline-flex; cursor: pointer; }
.toggle-nohay input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-nohay span {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--borde-2); font-size: 12px; font-weight: 600; color: var(--texto-2); transition: .2s var(--anim); user-select: none;
}
.toggle-nohay span::before { content: ''; width: 11px; height: 11px; border-radius: 4px; border: 1.5px solid currentColor; transition: .2s; }
.toggle-nohay:hover span { border-color: var(--rose); color: var(--rose-tx); }
.toggle-nohay input:checked + span { background: var(--rose); border-color: var(--rose); color: #fff; }
.toggle-nohay input:checked + span::before { background: #fff; border-color: #fff; }
.toggle-nohay input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 2px; }

.cargo { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.cargo .input { height: 38px; }
.cargo .input-dolar .input { text-align: right; }
.totales { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--borde-2); display: flex; flex-direction: column; gap: 6px; }
.tot-fila { display: flex; justify-content: space-between; gap: 10px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.tot-fila.total { color: var(--texto); font-size: 21px; font-weight: 750; letter-spacing: -.01em; margin-top: 4px; }
.tot-fila.bs { font-size: 13px; align-items: baseline; }
.tot-fila.bs span:last-child { font-weight: 700; color: var(--texto); font-size: 15px; }
.tot-nota { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texto-3); margin-top: 4px; }
.tot-nota .ico { width: 14px; height: 14px; }

.pago-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dato-et { display: block; font-size: 12px; color: var(--texto-3); font-weight: 500; }
.dato-val { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 2px; min-width: 0; }
.mono.grande { font-size: 17px; letter-spacing: .03em; }
.comprobante {
  position: relative; display: block; width: 100%; margin-top: 14px; padding: 0; border: 1px solid var(--borde); border-radius: 12px;
  overflow: hidden; background: var(--sup-3); cursor: zoom-in;
}
.comprobante img { width: 100%; height: 240px; object-fit: cover; object-position: top; transition: transform .5s var(--anim); }
.comprobante:hover img { transform: scale(1.03); }
.comp-zoom {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 11px; border-radius: 999px;
  background: rgba(12, 14, 19, .78); color: #fff; font-size: 12px; font-weight: 600; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.comp-zoom .ico { width: 14px; height: 14px; }
.archivo { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--borde-2); text-decoration: none; font-weight: 600; }
.msg-enviado { padding: 12px; border-radius: 12px; background: var(--sup-2); border: 1px solid var(--borde); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 24px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--borde); }
.timeline li:last-child::before { display: none; }
.tl-punto { position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--c-bg); }
.timeline b { display: block; font-size: 13.5px; font-weight: 600; }
.timeline small { color: var(--texto-3); font-size: 12px; }

/* ---------------------------------------------------------------- estadísticas */
.v-est { transition: opacity .25s; }
.v-est.recargando .stats, .v-est.recargando .graficos { opacity: .45; pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radio-l);
  background: var(--sup); border: 1px solid var(--borde); box-shadow: var(--sombra-1); animation: subir .45s var(--anim) backwards;
}
.stat::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--c-bg); opacity: .7; pointer-events: none; }
.stat:nth-child(2) { animation-delay: .05s; } .stat:nth-child(3) { animation-delay: .1s; } .stat:nth-child(4) { animation-delay: .15s; }
.stat-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.stat-etq { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--c-bg); color: var(--c); }
.stat-ico .ico { width: 17px; height: 17px; }
.stat-valor { font-size: 27px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; position: relative; z-index: 1; }
.stat-sub { font-size: 12.5px; color: var(--texto-3); position: relative; z-index: 1; }
.delta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 5px; font-size: 12.5px; color: var(--texto-3); margin-top: 4px; position: relative; z-index: 1; }
.delta b { white-space: nowrap; }
.delta .ico { width: 15px; height: 15px; }
.delta.sube b, .delta.sube .ico { color: var(--green-tx); }
.delta.baja b, .delta.baja .ico { color: var(--rose-tx); }
.delta.neutro { font-style: italic; }
.stat-error { flex-direction: row; align-items: center; gap: 12px; grid-column: span 3; color: var(--amber-tx); background: var(--amber-bg); border-color: transparent; }
.stat-error b { display: block; color: var(--texto); }
.stat-error span { color: var(--texto-2); font-size: 13px; }
.stat.esq { height: 128px; }
.graficos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grafico {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px 18px 16px; border-radius: var(--radio-l);
  background: var(--sup); border: 1px solid var(--borde); box-shadow: var(--sombra-1); animation: subir .5s var(--anim) backwards;
}
.grafico:nth-child(2) { animation-delay: .06s; } .grafico:nth-child(3) { animation-delay: .12s; } .grafico:nth-child(4) { animation-delay: .18s; } .grafico:nth-child(5) { animation-delay: .24s; }
.grafico.ancho { grid-column: 1 / -1; }
.grafico.esq { height: 320px; }
.graf-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.graf-cab h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.graf-cab p { color: var(--texto-3); font-size: 12.5px; margin-top: 2px; }
.graf-cuerpo { flex: 1; min-width: 0; }
.graf-tabla { display: none; max-height: 300px; overflow: auto; }
.grafico.ver-tabla .graf-cuerpo { display: none; }
.grafico.ver-tabla .graf-tabla { display: block; }
.grafico.ver-tabla .graf-cab .btn-icono { color: var(--marca); border-color: var(--marca); background: var(--marca-suave); }
.graf-tabla table { width: 100%; border-collapse: collapse; font-size: 13px; }
.graf-tabla th { text-align: left; font-weight: 600; color: var(--texto-3); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--borde); position: sticky; top: 0; background: var(--sup); }
.graf-tabla td { padding: 7px 8px; border-bottom: 1px solid var(--borde); font-variant-numeric: tabular-nums; }
.graf-tabla td:not(:first-child), .graf-tabla th:not(:first-child) { text-align: right; }
.graf-vacio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; text-align: center; color: var(--texto-3); padding: 20px; border: 1.5px dashed var(--borde); border-radius: 12px; }
.graf-vacio .ico { width: 26px; height: 26px; color: var(--borde-2); }
.graf-vacio span { max-width: 360px; }
.nota-est { display: flex; align-items: center; gap: 8px; color: var(--texto-3); font-size: 12.5px; margin-top: 16px; }
.nota-est .ico { width: 15px; height: 15px; }

/* columnas */
.col-graf { --alto: 210px; }
.col-area { position: relative; height: var(--alto); margin-left: 44px; }
.col-grid { position: absolute; inset: 0; pointer-events: none; }
.col-linea { position: absolute; left: 0; right: 0; height: 1px; background: var(--g-linea); }
.col-linea.base { background: var(--g-base); }
.col-linea span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--texto-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-barras { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.col-banda { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; border-radius: 6px; }
.col-banda:hover, .col-banda:focus-visible { background: color-mix(in srgb, var(--serie) 7%, transparent); }
.col-barra {
  position: relative; width: min(24px, 62%); min-height: 2px; background: var(--serie); border-radius: 4px 4px 0 0;
  transform-origin: bottom; animation: crecer .7s var(--anim) backwards; transition: filter .2s;
}
.col-barra.cero { min-height: 0; }
.col-banda:hover .col-barra, .col-banda:focus-visible .col-barra { filter: brightness(1.12) saturate(1.1); }
.col-valor { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--texto); white-space: nowrap; }
.col-ejes { display: flex; margin: 8px 0 0 44px; }
.col-ejes span { flex: 1; text-align: center; font-size: 11px; color: var(--texto-3); white-space: nowrap; overflow: visible; min-width: 0; }
.tip {
  position: absolute; z-index: 5; transform: translate(-50%, 4px); pointer-events: none; opacity: 0; transition: opacity .15s, transform .2s var(--anim);
  display: flex; flex-direction: column; gap: 1px; padding: 8px 11px; border-radius: 10px; background: #14171f; color: #fff; white-space: nowrap;
  box-shadow: var(--sombra-3); border: 1px solid rgba(255, 255, 255, .08);
}
.tip.visible { opacity: 1; transform: translate(-50%, 0); }
.tip b { font-size: 14px; }
.tip span { font-size: 12px; color: rgba(255, 255, 255, .7); }

/* barras horizontales ordenadas */
.hb { display: flex; flex-direction: column; gap: 4px; }
.hb-fila { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 6px; border-radius: 8px; outline: none; transition: background .2s; }
.hb-fila:hover, .hb-fila:focus-visible { background: var(--sup-2); }
.hb-nombre { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-pista { position: relative; height: 12px; border-left: 1px solid var(--g-base); }
.hb-barra { position: absolute; left: 0; top: 0; bottom: 0; background: var(--serie); border-radius: 0 4px 4px 0; transform-origin: left; animation: crecer-h .7s var(--anim) backwards; transition: filter .2s; }
.hb-fila:hover .hb-barra { filter: brightness(1.12) saturate(1.1); }
.hb-valor { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* barra segmentada (pedidos de la web por estado) */
.web-graf { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 28px; align-items: start; }
.seg-barra { display: flex; gap: 2px; height: 28px; }
.seg-parte {
  display: flex; align-items: center; padding-left: 8px; min-width: 6px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 4px; white-space: nowrap; overflow: hidden; animation: crecer-h .7s var(--anim) backwards; transform-origin: left;
}
.leyenda { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.leyenda li { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--texto-2); }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.leyenda b { color: var(--texto); font-variant-numeric: tabular-nums; }
.reparto-cab { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--texto-2); margin-bottom: 10px; }
.reparto-cab span { display: inline-flex; align-items: center; gap: 6px; }
.reparto-cab .ico { width: 15px; height: 15px; }
.reparto-barra { display: flex; gap: 2px; height: 8px; }
.reparto-barra span { background: var(--c); border-radius: 999px; min-width: 6px; animation: crecer-h .7s var(--anim) backwards; transform-origin: left; }

/* ---------------------------------------------------------------- menú */
/* barra fija con el buscador: siempre visible al bajar */
.menu-pegajoso {
  position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 calc(var(--pad) * -1) 20px; padding: 12px var(--pad);
  background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--borde);
}
.menu-pegajoso .buscador { width: 340px; }
.menu-filtros { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 0; }
.solo-movil { display: none !important; }
.menu-resumen { color: var(--texto-3); font-size: 13px; margin-left: auto; }
.menu-resumen b { color: var(--texto); font-variant-numeric: tabular-nums; }
.menu-chips { display: none; }
.menu-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.menu-indice { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 112px); overflow-y: auto; padding: 0 4px 8px 0; }
.indice-tit { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--texto-3); font-weight: 700; padding: 0 10px 8px; }
.indice-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--texto-2); font-weight: 500; font-size: 13.5px; transition: .2s; }
.indice-item:hover { background: var(--sup); color: var(--texto); box-shadow: var(--sombra-1); }
.indice-item .emoji { width: 22px; text-align: center; }
.indice-nombre { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.indice-item .n { font-size: 11.5px; color: var(--texto-3); font-variant-numeric: tabular-nums; }
.indice-item.apagado { opacity: .5; }
.menu-contenido { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.v-menu > .prod-grid { margin-top: 8px; }
.grupo { background: var(--sup); border: 1px solid var(--borde); border-radius: var(--radio-xl); padding: 18px; box-shadow: var(--sombra-1); scroll-margin-top: 92px; }
.grupo.apagado { background: var(--sup-2); }
.grupo.apagado .prod-grid { opacity: .6; }
.grupo.movido { animation: resaltar 1.3s var(--anim); }
.grupo-cab { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.grupo-emoji { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--sup-3); flex: none; }
.grupo-tit { flex: 1; min-width: 180px; }
.grupo-tit h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.grupo-tit small { color: var(--texto-3); font-size: 12.5px; }
.grupo-acc { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-grupo { display: flex; gap: 4px; }
.grupo-vacio { padding: 4px 2px; }
.select-mini { position: relative; display: inline-flex; align-items: center; }
.select-mini > .ico { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--texto-3); pointer-events: none; }
.select-mini select {
  height: 36px; width: auto; padding: 0 30px 0 32px; font-size: 13px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858c9b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.prod {
  display: flex; flex-direction: column; border: 1px solid var(--borde); border-radius: 16px; overflow: hidden; background: var(--sup);
  transition: transform .25s var(--anim), box-shadow .25s, border-color .25s, opacity .25s;
}
.prod:hover { transform: translateY(-2px); box-shadow: var(--sombra-2); border-color: var(--borde-2); }
.prod-foto { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 30% 20%, var(--sup), var(--sup-3) 70%); }
.prod-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--anim), filter .3s; }
.prod:hover .prod-foto img { transform: scale(1.05); }
.prod-emoji { font-size: 46px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .14)); transition: transform .4s var(--anim); }
.prod:hover .prod-emoji { transform: scale(1.08) rotate(-4deg); }
.prod-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge-foto { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: aparecer .25s; }
.badge-foto.rojo { background: rgba(225, 29, 72, .92); }
.badge-foto.gris { background: rgba(51, 65, 85, .86); }
.foto-btn {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 0;
  background: rgba(12, 14, 19, .74); color: #fff; font-size: 12px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(6px); transition: .25s var(--anim);
}
.foto-btn .ico { width: 15px; height: 15px; }
.prod:hover .foto-btn, .foto-btn:focus-visible { opacity: 1; transform: none; }
.subiendo-capa { position: absolute; inset: 0; display: none; place-items: center; background: color-mix(in srgb, var(--sup) 70%, transparent); }
.prod.subiendo .subiendo-capa { display: grid; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--borde-2); border-top-color: var(--marca); animation: girar .7s linear infinite; }
.prod.agotado .prod-foto img, .prod.agotado .prod-emoji { filter: grayscale(1); opacity: .55; }
.prod.apagado { opacity: .6; }
.prod.apagado:hover { opacity: 1; }
.prod-cuerpo { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.prod-nombre { font-weight: 650; line-height: 1.3; }
.prod-desc { font-size: 12.5px; color: var(--texto-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-desc.vacia { color: var(--texto-3); font-style: italic; }
.prod-precios { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.precio-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border-radius: 8px; background: var(--sup-3); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.precio-chip small { font-weight: 500; color: var(--texto-3); font-size: 11px; }
.precio-chip.fuera { background: transparent; box-shadow: inset 0 0 0 1px var(--borde-2); color: var(--texto-3); font-weight: 600; }
.precio-chip.vacio { color: var(--amber-tx); background: var(--amber-bg); font-weight: 600; }
.prod-cod { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11px; color: var(--texto-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-pie { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 14px 12px; border-top: 1px solid var(--borde); background: var(--sup-2); }
.prod-acc { margin-left: auto; display: flex; gap: 6px; }
.prod-acc .btn-icono { width: 32px; height: 32px; }
.prod-acc .ico { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- ajustes */
.aj-layout { display: grid; grid-template-columns: 220px minmax(0, 780px); gap: 28px; align-items: start; }
.aj-indice { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.aj-indice a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--texto-2); text-decoration: none; font-weight: 500; transition: .2s; }
.aj-indice a:hover { background: var(--sup); color: var(--texto); box-shadow: var(--sombra-1); }
.aj-indice .ico { width: 16px; height: 16px; }
.aj-contenido { display: flex; flex-direction: column; gap: 18px; padding-bottom: 90px; min-width: 0; }
.aj-sec { scroll-margin-top: 20px; padding: 22px; }
.aj-sec-cab { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.aj-sec-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--c-bg); color: var(--c); flex: none; }
.aj-sec-cab h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.aj-sec-cab p { color: var(--texto-2); font-size: 13.5px; margin-top: 2px; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.campos .ancho { grid-column: 1 / -1; }
.fila-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 12px; background: var(--sup-2); border: 1px solid var(--borde); margin-bottom: 14px; }
.fila-switch:last-child { margin-bottom: 0; }
.fila-switch b { display: block; }
.fila-switch small { color: var(--texto-3); font-size: 12.5px; }
.pm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: start; }
.pm-et { font-size: 12px; color: var(--texto-3); margin-bottom: 8px; font-weight: 600; }
.pm-preview {
  position: relative; overflow: hidden; border-radius: 18px; padding: 18px; color: #fff; display: flex; flex-direction: column; gap: 8px;
  background: radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .2), transparent 50%), linear-gradient(135deg, #b4233c, #4d0d1c);
  box-shadow: 0 22px 40px -20px #b4233c;
}
.pm-preview::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -70px; bottom: -90px; border: 28px solid rgba(255, 255, 255, .07); }
.pm-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; opacity: .85; font-weight: 700; }
.pm-banco { font-size: 17px; font-weight: 700; margin: 8px 0 4px; line-height: 1.25; }
.pm-fila { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.pm-fila span { opacity: .72; }
.pm-fila b { font-variant-numeric: tabular-nums; text-align: right; }
.pm-fila.monto { margin-top: 6px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .25); font-size: 14px; }
.tamanos { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-toggle { position: relative; cursor: pointer; }
.chip-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-toggle span { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--borde-2); font-weight: 600; color: var(--texto-2); transition: .2s var(--anim); user-select: none; }
.chip-toggle .ico { width: 15px; height: 15px; opacity: 0; margin-left: -4px; width: 0; transition: .2s var(--anim); }
.chip-toggle input:checked + span { background: var(--green-bg); border-color: var(--green); color: var(--green-tx); }
.chip-toggle input:checked + span .ico { opacity: 1; width: 15px; margin-left: 0; stroke-width: 3; }
.chip-toggle input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 2px; }
.a2-estado { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--green-bg); }
.a2-estado.mal { background: var(--rose-bg); }
.a2-estado b { display: block; }
.a2-estado small { color: var(--texto-2); }
.datos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.dato-caja { padding: 12px 14px; border-radius: 12px; background: var(--sup-2); border: 1px solid var(--borde); }
.dato-caja .dato-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tablas-det { margin-top: 14px; }
.tablas-det summary { cursor: pointer; color: var(--texto-2); font-weight: 600; font-size: 13px; padding: 4px 0; }
.tablas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.tabla-it { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 8px 12px; border-radius: 10px; background: var(--sup-2); border: 1px solid var(--borde); }
.tabla-it span:first-child { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 600; }
.tabla-it span:last-child { color: var(--texto-3); }
.cuenta-fila { display: flex; align-items: center; gap: 12px; padding: 4px 0 18px; }
.cuenta-fila b { display: block; text-transform: capitalize; }
.cuenta-fila small { color: var(--texto-3); }
.cuenta-fila .btn { margin-left: auto; }
.barra-guardar {
  position: fixed; z-index: 50; bottom: 24px; left: 252px; right: 0; margin: 0 auto; width: fit-content; max-width: calc(100% - 284px);
  display: flex; align-items: center; gap: 18px; padding: 10px 10px 10px 18px; border-radius: 16px; background: #14171f; color: #fff;
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--sombra-3);
  transform: translateY(160%); opacity: 0; pointer-events: none; transition: transform .45s var(--anim), opacity .3s;
}
.barra-guardar.visible { transform: none; opacity: 1; pointer-events: auto; }
.bg-txt { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; }
.bg-txt .ico { color: #fbbf24; }
.bg-acc { display: flex; gap: 6px; }
.barra-guardar .btn-fantasma { color: rgba(255, 255, 255, .75); }
.barra-guardar .btn-fantasma:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------------------------------------------------------------- entrada */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.login-hero { position: relative; overflow: hidden; isolation: isolate; background: #0c0e13; color: #fff; display: flex; align-items: center; padding: 56px 64px; }
.blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); animation: flotar 16s ease-in-out infinite alternate; }
.b1 { width: 480px; height: 480px; background: #b4233c; top: -140px; left: -120px; opacity: .75; }
.b2 { width: 400px; height: 400px; background: #6d28d9; bottom: -160px; right: -100px; opacity: .45; animation-delay: -6s; }
.b3 { width: 260px; height: 260px; background: #f59e0b; top: 48%; left: 58%; opacity: .2; animation-delay: -10s; }
.login-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero-contenido { max-width: 470px; animation: subir .7s var(--anim) backwards; }
.hero-logo { width: 88px; height: 88px; border-radius: 50%; background: #fff; margin-bottom: 30px; box-shadow: 0 0 0 6px rgba(255, 255, 255, .08), 0 22px 44px -12px rgba(0, 0, 0, .7); }
.login-hero h1 { font-size: 42px; line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.login-hero p { color: rgba(255, 255, 255, .72); font-size: 16.5px; margin-top: 14px; max-width: 400px; }
.hero-lista { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-direction: column; gap: 14px; }
.hero-lista li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .88); }
.hero-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.login-lado { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; animation: subir .6s var(--anim) .1s backwards; }
.login-card h2 { font-size: 28px; letter-spacing: -.025em; font-weight: 750; }
.login-card .sub { color: var(--texto-2); margin-top: 4px; }
.input-ico { position: relative; }
.input-ico > .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--texto-3); pointer-events: none; }
.input-ico .input { padding-left: 40px; padding-right: 44px; height: 48px; font-size: 15px; }
.ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--texto-3); display: grid; place-items: center; }
.ojo:hover { color: var(--texto); background: var(--sup-3); }
.login-error { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--rose-bg); color: var(--rose-tx); font-size: 13.5px; font-weight: 500; animation: aparecer .25s; }
.login-pie { color: var(--texto-3); font-size: 12px; }
.sacudir { animation: sacudir .42s; }

/* ---------------------------------------------------------------- capas flotantes */
.modal-velo { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(8, 10, 14, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: aparecer .2s ease; }
.modal { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 20px; background: var(--sup); border: 1px solid var(--borde); box-shadow: var(--sombra-3); animation: modal-in .32s var(--anim); }
.modal h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal-texto { color: var(--texto-2); margin-top: -6px; }
.modal-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--marca-suave); color: var(--marca); }
.modal-ico.peligro { background: var(--rose-bg); color: var(--rose); }
.modal-pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal-velo.saliendo { animation: desaparecer .22s ease forwards; }
.modal-velo.saliendo .modal { animation: modal-out .22s ease forwards; }
.lightbox { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; background: rgba(5, 6, 9, .9); cursor: zoom-out; animation: aparecer .2s; }
.lightbox img { max-width: min(92vw, 900px); max-height: 80vh; border-radius: 12px; background: #fff; box-shadow: 0 30px 60px rgba(0, 0, 0, .6); animation: modal-in .3s var(--anim); }
.lb-acc { display: flex; gap: 8px; }
.lb-cerrar { color: rgba(255, 255, 255, .8); }
.lb-cerrar:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.lightbox.saliendo { animation: desaparecer .2s forwards; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast-item {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 400px; padding: 12px 16px; border-radius: 12px;
  background: #14171f; color: #fff; font-weight: 500; font-size: 13.5px; border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--sombra-3);
  animation: toast-in .38s var(--anim);
}
.toast-item .ico { color: #4ade80; }
.toast-item.mal .ico { color: #f87171; }
.toast-item.info .ico { color: #fbbf24; }
.toast-item.saliendo { animation: toast-out .32s ease forwards; }

/* ---------------------------------------------------------------- tablet y teléfono */
@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vista { --pad: 26px; padding: 26px var(--pad) 48px; }
}
@media (max-width: 1023px) {
  :root { --barra-movil: calc(59px + env(safe-area-inset-top)); }
  body { font-size: 15px; }
  .input, .buscador input, .select-mini select, textarea.input { font-size: 16px; }
  .lateral { display: none; }
  .principal { margin-left: 0; }
  .vista { --pad: 16px; padding: 14px var(--pad) calc(100px + env(safe-area-inset-bottom)); }
  .barra-movil {
    display: flex; position: sticky; top: 0; z-index: 25; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--bg); background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--borde);
  }
  .barra-movil img { width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--borde); }
  .bm-titulo { flex: 1; min-width: 0; line-height: 1.2; }
  .bm-titulo b { display: block; font-size: 17px; letter-spacing: -.01em; }
  .bm-titulo small { color: var(--texto-3); font-size: 12px; }
  .bm-a2 { width: 9px; height: 9px; border-radius: 50%; background: var(--slate); margin-right: 4px; }
  .bm-a2.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
  .bm-a2.mal { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
  .barra-movil .btn-icono { width: 38px; height: 38px; }
  .barra-movil .btn-icono.apagado { color: var(--amber-tx); background: var(--amber-bg); border-color: transparent; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: var(--sup); background: color-mix(in srgb, var(--sup) 88%, transparent); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--borde); transition: transform .35s var(--anim);
  }
  .tab-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: transparent; color: var(--texto-3); font-size: 11.5px; font-weight: 600; transition: color .2s; }
  .tab-ico { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background .3s var(--anim); }
  .tab-item.activa { color: var(--marca); }
  .tab-item.activa .tab-ico { background: var(--marca-suave); }
  .tab-ico .badge { position: absolute; top: -5px; right: 6px; }

  .vista-cab { margin-bottom: 14px; }
  .vista-cab h1 { display: none; }
  .vista-cab .sub { margin-top: 0; font-size: 13.5px; }
  .vista-cab-der, .vista-cab-der .buscador { width: 100%; }
  .vista-cab-der .seg { width: 100%; }
  .seg button { flex: 1; }
  .kpis {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px 16px; padding: 2px 16px 6px; scrollbar-width: none;
  }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 auto; min-width: 150px; scroll-snap-align: start; padding: 12px 12px 11px 14px; }
  .kpi-ico { width: 32px; height: 32px; }
  .kpi-num { font-size: 22px; }
  .md { grid-template-columns: 1fr; }
  .detalle-col {
    position: fixed; inset: 0; z-index: 60; top: 0; transform: translateX(104%); visibility: hidden;
    transition: transform .4s var(--anim), visibility 0s linear .4s;
  }
  body.detalle-abierto .detalle-col { transform: none; visibility: visible; transition: transform .4s var(--anim), visibility 0s; }
  body.detalle-abierto { overflow: hidden; }
  body.detalle-abierto .tabbar { transform: translateY(110%); }
  .det { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .det-cab { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); align-items: center; }
  .det-cab .volver { display: inline-grid; }
  .det-fila h2 { font-size: 19px; }
  .det-sub { gap: 4px 12px; font-size: 12.5px; }
  .det-cuerpo { padding: 14px; }
  .det-pie { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .det-pie-prim { width: 100%; order: -1; margin-left: 0; }
  .det-pie-prim .btn, .det-pie-sec .btn { flex: 1; }
  .det-pie-sec { width: 100%; }
  .det-vacio { display: none; }
  .pasos { padding: 14px 4px 12px; }
  .pasos li { font-size: 10.5px; }

  .menu-layout { grid-template-columns: 1fr; }
  .menu-indice { display: none; }
  .solo-movil { display: flex !important; }
  .solo-escritorio { display: none !important; }
  .menu-filtros.solo-movil { margin-bottom: 12px; }
  .menu-filtros .seg { width: 100%; }
  .menu-resumen { width: 100%; margin-left: 0; }
  .menu-pegajoso { top: var(--barra-movil); flex-direction: column; align-items: stretch; gap: 10px; padding: 10px var(--pad); margin-bottom: 14px; }
  .menu-pegajoso .buscador { width: 100%; }
  .menu-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 2px; }
  /* en Pedidos, el buscador queda fijo debajo de la barra de arriba */
  .lista-col > .buscador {
    position: sticky; top: var(--barra-movil); z-index: 6; margin: -8px calc(var(--pad) * -1) 0; padding: 8px var(--pad);
    background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  }
  .menu-chips::-webkit-scrollbar { display: none; }
  .menu-chips .chip-btn { flex: none; border-style: solid; background: var(--sup); color: var(--texto); }
  .menu-chips .chip-btn.apagado { opacity: .55; }
  .grupo { padding: 14px; border-radius: 18px; scroll-margin-top: calc(var(--barra-movil) + 120px); }
  .grupo-cab { gap: 12px; }
  .grupo-acc { width: 100%; justify-content: space-between; row-gap: 10px; }
  .grupo-acc .select-mini { order: 3; width: 100%; }
  .grupo-acc .select-mini select { width: 100%; }
  .solo-escritorio { display: none; }
  .prod-grid { grid-template-columns: 1fr; gap: 10px; }
  .prod { flex-direction: row; flex-wrap: wrap; }
  .prod-foto { width: 104px; aspect-ratio: auto; min-height: 104px; flex: none; }
  .prod-cuerpo { flex: 1; padding: 10px 12px; }
  .prod-pie { width: 100%; }
  .prod-emoji { font-size: 36px; }
  .prod-badges { top: 6px; left: 6px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .badge-foto { font-size: 10px; padding: 2px 7px; }
  .foto-btn { opacity: 1; transform: none; width: 30px; height: 30px; padding: 0; justify-content: center; right: 6px; bottom: 6px; }
  .foto-btn span { display: none; }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px 12px; }
  .stat-etq { font-size: 12px; }
  .stat-ico { width: 28px; height: 28px; border-radius: 8px; flex: none; }
  .stat-ico .ico { width: 15px; height: 15px; }
  .stat-valor { font-size: 19px; }
  .stat-sub, .delta { font-size: 11.5px; }
  .stat-error { grid-column: 1 / -1; }
  .graficos { grid-template-columns: 1fr; }
  .grafico { padding: 16px 14px 14px; }
  .col-graf { --alto: 180px; }
  .web-graf { grid-template-columns: 1fr; gap: 20px; }
  .hb-fila { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .hb-nombre { grid-column: 1 / -1; }
  .aj-layout { grid-template-columns: 1fr; }
  .aj-indice { display: none; }
  .aj-sec { padding: 18px; }
  .campos, .pm-wrap { grid-template-columns: 1fr; }
  .datos-grid { grid-template-columns: 1fr 1fr; }
  .barra-guardar { left: 12px; right: 12px; width: auto; max-width: none; bottom: calc(84px + env(safe-area-inset-bottom)); gap: 10px; padding: 10px 10px 10px 14px; }
  .bg-txt { font-size: 13px; }
  .cuenta-fila { flex-wrap: wrap; }
  #toasts { left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); align-items: center; }
  body.detalle-abierto #toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .detalle-col { left: auto; width: min(620px, 94vw); }
  .det { box-shadow: var(--sombra-3); }
  .detalle-velo {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 10, 14, .45); opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  body.detalle-abierto .detalle-velo { opacity: 1; pointer-events: auto; }
  .prod-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-hero { padding: 36px 24px 34px; padding-top: calc(36px + env(safe-area-inset-top)); }
  .hero-lista { display: none; }
  .login-hero h1 { font-size: 28px; }
  .login-hero p { font-size: 15px; }
  .hero-logo { width: 64px; height: 64px; margin-bottom: 18px; }
  .login-lado { justify-content: flex-start; padding-top: 30px; }
}
@media (max-width: 640px) {
  .modal-velo { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation: hoja-in .38s var(--anim); }
  .modal-pie .btn { flex: 1; height: 46px; }
  .pago-grid { grid-template-columns: 1fr 1fr; }
  .cargo { grid-template-columns: minmax(0, 1fr) 110px auto; }
}

/* ---------------------------------------------------------------- animaciones */
@keyframes aparecer { from { opacity: 0; } }
@keyframes crecer { from { transform: scaleY(0); } }
@keyframes crecer-h { from { transform: scaleX(0); } }
@keyframes desaparecer { to { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes onda { from { transform: scale(1); opacity: .55; } to { transform: scale(2.8); opacity: 0; } }
@keyframes llamado { 0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(225, 29, 72, 0); } }
@keyframes llamado-c { 0% { box-shadow: 0 0 0 0 var(--c); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.28); color: var(--c); } 100% { transform: scale(1); } }
@keyframes entra-brilla {
  0% { opacity: 0; transform: translateY(-10px) scale(.98); box-shadow: 0 0 0 0 var(--marca-anillo); }
  30% { opacity: 1; transform: none; box-shadow: 0 0 0 6px var(--marca-anillo); }
  100% { box-shadow: var(--sombra-1); }
}
@keyframes pulso-anillo { 0%, 100% { box-shadow: 0 0 0 4px var(--marca-anillo); } 50% { box-shadow: 0 0 0 8px transparent; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes hoja-in { from { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(28px); } }
@keyframes sacudir { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes flotar { to { transform: translate(50px, 36px) scale(1.12); } }
@keyframes resaltar { 0% { box-shadow: 0 0 0 0 var(--marca-anillo); } 30% { box-shadow: 0 0 0 6px var(--marca-anillo); } 100% { box-shadow: var(--sombra-1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
