/* Stockeo · estilos de la app (CSS puro) */
:root {
  --bg: #f6f7f6;
  --bg-2: #eff1ef;
  --surface: #ffffff;
  --ink: #0b0c0c;
  --ink-2: #33383a;
  --muted: #676d6c;
  --faint: #9ba19f;
  --line: #e4e7e4;
  --line-2: #eef0ee;
  --hover: #f3f4f3;
  --accent: #2d6bff;
  --accent-ink: #1f55d6;
  --accent-soft: #edf2ff;
  --accent-line: #c9d8ff;
  --ok: #2f7a52;
  --ok-soft: #eaf4ee;
  --ok-line: #c8e2d2;
  --warn: #9a640f;
  --warn-soft: #fbf3e3;
  --warn-line: #f0dcb2;
  --bad: #b93a32;
  --bad-soft: #fcefed;
  --bad-line: #f2cdc9;
  --ch-l: #2d6bff;
  --ch-ml: #e8a317;
  --ch-tn: #0f9d8a;
  --wa: #1f9d55;
  --r: 8px;
  --r-lg: 10px;
  --sh-1: 0 1px 2px rgba(11, 12, 12, .04);
  --sh-2: 0 1px 2px rgba(11, 12, 12, .05), 0 6px 20px -6px rgba(11, 12, 12, .1);
  --sh-3: 0 2px 6px rgba(11, 12, 12, .06), 0 24px 60px -12px rgba(11, 12, 12, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sb-w: 244px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 var(--sans); letter-spacing: -.006em;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body.lock { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; letter-spacing: -.02em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd {
  font: 500 11px/1 var(--sans); color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: 2px 5px; min-width: 18px; text-align: center; display: inline-block;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: #d6e2ff; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 200; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.view { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 32px 120px; outline: none; }
.view.enter > *:not(.savebar) { animation: rise .42s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; }
.view.enter > *:nth-child(3) { animation-delay: .08s; }
.view.enter > *:nth-child(4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px;
  padding: 14px 12px; border-right: 1px solid var(--line); background: var(--bg); z-index: 40;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 650; font-size: 15.5px; letter-spacing: -.03em; }
.sb-close { display: none; }

.sucursal { position: relative; }
.suc-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 7px 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-1);
  transition: border-color .15s, box-shadow .15s;
}
.suc-btn:hover { border-color: #d3d7d3; }
.suc-avatar { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(140deg, #ffd66e, #f0a43a); color: #5b3a06; font: 700 11px/28px var(--sans); text-align: center; flex: none; }
.suc-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.suc-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suc-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suc-chev { color: var(--faint); width: 14px; height: 14px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 11.5px; font-weight: 500; color: var(--faint); padding: 6px 10px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 13.5px; transition: background .12s, color .12s;
}
.nav-item .ic { color: var(--muted); transition: color .12s; }
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.nav-item[aria-current="page"] .ic { color: var(--accent); }
.nav-txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count { font: 600 11px/18px var(--mono); min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; text-align: center; }
.nav-count.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.nav-count:empty, .nav-count[data-zero] { display: none; }
.nav-count.pulse { animation: pulse 1.6s var(--ease) 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(45, 107, 255, .55); transform: scale(1); } 30% { transform: scale(1.15); } 100% { box-shadow: 0 0 0 10px rgba(45, 107, 255, 0); transform: scale(1); } }
.nav-kbd { display: none; gap: 2px; }
.nav-kbd kbd { font-size: 10px; padding: 1px 4px; min-width: 15px; }
.nav-item:hover .nav-kbd { display: inline-flex; }
.nav-item:hover .nav-count { display: none; }

.sb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sb-help {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 0; background: none; border-radius: 7px;
  color: var(--muted); font-size: 13px; font-weight: 500; text-align: left;
}
.sb-help span { flex: 1; }
.sb-help:hover { background: var(--bg-2); color: var(--ink); }
.sync-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 8px 10px; border-top: 1px solid var(--line); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2fae6b; position: relative; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid #2fae6b; opacity: 0; animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.8); opacity: 0; } }

/* menus */
.menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 5px; animation: pop .16s var(--ease);
}
.menu[hidden] { display: none; }
.menu-right { left: auto; right: 0; width: 260px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 9px; border: 0; background: none; border-radius: 6px;
  text-align: left; font-size: 13px; color: var(--ink-2);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.menu-item .ic { color: var(--muted); }
.menu-item .mi-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-item .mi-sub { font-size: 12px; color: var(--muted); }
.menu-item .mi-check { color: var(--accent); visibility: hidden; }
.menu-item[aria-checked="true"] .mi-check { visibility: visible; }
.menu-head { padding: 8px 9px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.menu-head span { color: var(--muted); font-size: 12px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 32px;
  background: rgba(246, 247, 246, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.tb-menu { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; min-width: 0; }
.crumb-root { color: var(--muted); white-space: nowrap; }
.crumb-sep { color: var(--faint); width: 14px; height: 14px; }
.crumb-cur { font-weight: 600; white-space: nowrap; }
.tb-search {
  margin-left: auto; display: flex; align-items: center; gap: 9px; width: min(380px, 34vw); height: 34px; padding: 0 6px 0 11px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); color: var(--faint); text-align: left;
  box-shadow: var(--sh-1); transition: border-color .15s, box-shadow .15s;
}
.tb-search:hover { border-color: #d0d4d0; box-shadow: var(--sh-2); }
.tb-search-txt { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { position: relative; display: flex; align-items: center; gap: 12px; }
.tb-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 0 4px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #1b1d1e, #3c4245); color: #fff;
  font: 600 12px/32px var(--sans); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line); transition: box-shadow .15s;
}
.avatar:hover { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent-line); }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 7px; color: var(--ink-2); }
.icon-btn:hover { background: var(--bg-2); }

/* ---------- primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r);
  font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: var(--sh-1);
  transition: background .12s, border-color .12s, transform .08s, box-shadow .12s, opacity .12s;
}
.btn:hover { background: var(--hover); border-color: #d3d7d3; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 15px; height: 15px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, var(--sh-1); }
.btn.primary:hover { background: #26292a; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-line); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.is-done { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); box-shadow: none; }

.input, .select select {
  height: 34px; padding: 0 11px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r);
  font-size: 13.5px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; box-shadow: var(--sh-1);
}
.input:hover, .select select:hover { border-color: #d3d7d3; }
.input:focus, .select select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 107, 255, .16); }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(185, 58, 50, .14); }
.input.mono { font-family: var(--mono); }
.select { position: relative; display: inline-flex; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; }
.select .ic { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 14px; height: 14px; }

.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; background: none; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background .12s, color .12s, box-shadow .12s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.seg .cnt { font: 500 11px/1 var(--mono); color: var(--faint); }
.seg button[aria-pressed="true"] .cnt, .seg button[aria-selected="true"] .cnt { color: var(--muted); }
.seg .sw { width: 8px; height: 8px; border-radius: 2px; }

.switch {
  position: relative; width: 36px; height: 21px; border-radius: 11px; border: 0; background: #d5d9d6; padding: 0; flex: none;
  transition: background .2s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(15px); }
.switch.wa[aria-checked="true"] { background: var(--wa); }

.cb {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 1.5px solid #c4c9c5; border-radius: 4.5px;
  background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; vertical-align: middle;
  transition: background .12s, border-color .12s;
}
.cb:hover { border-color: var(--muted); }
.cb:checked, .cb:indeterminate { background: var(--accent); border-color: var(--accent); }
.cb:checked::after { content: ""; width: 8px; height: 4.5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.cb:indeterminate::after { content: ""; width: 8px; height: 2px; background: #fff; border-radius: 1px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500;
  white-space: nowrap; background: var(--bg-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.badge .ic { width: 12px; height: 12px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.badge.bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-line); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; min-height: 44px; flex-wrap: wrap; }
.card-h h2 { font-size: 14px; letter-spacing: -.01em; }
.card-h .sub { font-size: 12.5px; color: var(--muted); }
.card-h .spacer { flex: 1; }
.card-b { padding: 14px 16px 16px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn .ic { width: 13px; height: 13px; }

/* view header */
.vh { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.vh h1 { font-size: 22px; letter-spacing: -.03em; line-height: 1.2; }
.vh .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.vh-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* skeleton */
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, #eceeec 0%, #f5f6f5 40%, #eceeec 80%); background-size: 300% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.sk-grid { display: grid; gap: 14px; }
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* empty state */
.empty { text-align: center; padding: 48px 20px 56px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--muted); margin-bottom: 6px; }
.empty-ic .ic { width: 20px; height: 20px; }
.empty h3 { font-size: 15px; }
.empty p { color: var(--muted); max-width: 340px; font-size: 13px; }
.empty .btn { margin-top: 8px; }

/* ---------- resumen ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kpi-hint { font-size: 11.5px; color: var(--faint); }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.kpi-val { font: 600 24px/1.15 var(--mono); letter-spacing: -.045em; white-space: nowrap; }
.kpi-val small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: -.02em; }
.kpi-val.bump { animation: bump .7s var(--ease); }
@keyframes bump { 0% { color: var(--accent); transform: translateY(-2px); } 100% { color: var(--ink); transform: none; } }
.kpi-foot { overflow: hidden; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.spark { width: 88px; height: 32px; flex: none; overflow: visible; }
.delta { display: inline-flex; align-items: center; gap: 2px; font: 500 11.5px/1 var(--mono); padding: 3px 5px; border-radius: 5px; letter-spacing: -.02em; }
.delta .ic { width: 11px; height: 11px; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--bg-2); color: var(--muted); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.grid-half { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }

.chart-card { display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; flex-wrap: wrap; }
.chart-total { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.chart-total b { font: 600 20px/1.2 var(--mono); letter-spacing: -.04em; }
.chart-ctrl { display: flex; gap: 8px; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 12px 0; }
.lg {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 9px 0 7px; border-radius: 6px; border: 1px solid transparent;
  background: none; font-size: 12.5px; color: var(--ink-2); transition: background .12s, opacity .15s;
}
.lg:hover { background: var(--bg); }
.lg .sw { width: 10px; height: 10px; border-radius: 3px; }
.lg .lg-v { font: 500 11.5px var(--mono); color: var(--muted); }
.lg[aria-pressed="false"] { opacity: .45; }
.lg[aria-pressed="false"] .sw { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--faint); }
.chart-wrap { position: relative; padding: 4px 12px 10px 4px; flex: 1; min-height: 240px; }
.chart-wrap svg { display: block; width: 100%; overflow: visible; }
.chart-wrap svg:focus-visible { outline-offset: 4px; }
.chart-wrap .grid line { stroke: var(--line-2); }
.chart-wrap .axis text, .mini-chart text { font: 500 10.5px var(--mono); fill: var(--faint); letter-spacing: -.02em; }
.chart-wrap .axis text.today { fill: var(--ink); font-weight: 600; }
.chart-wrap .day { transition: opacity .15s; }
.chart-wrap.hovering .day { opacity: .38; }
.chart-wrap.hovering .day.on { opacity: 1; }
.ctip {
  position: fixed; z-index: 120; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 9px 11px; font-size: 12px;
  box-shadow: var(--sh-3); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; min-width: 170px;
}
.ctip.show { opacity: 1; transform: none; }
.ctip .tt-h { font-weight: 600; margin-bottom: 6px; color: #fff; }
.ctip .tt-r { display: flex; align-items: center; gap: 8px; color: #c9cecc; line-height: 1.7; }
.ctip .tt-r i { width: 8px; height: 8px; border-radius: 2px; }
.ctip .tt-r b { margin-left: auto; font: 500 11.5px var(--mono); color: #fff; }
.ctip .tt-t { border-top: 1px solid #2c3031; margin-top: 5px; padding-top: 5px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th, .data-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { font-weight: 500; color: var(--muted); font-size: 12px; }
.data-table td { font-family: var(--mono); letter-spacing: -.02em; }
.data-table td:first-child { font-family: var(--sans); }
.table-scroll { overflow-x: auto; max-height: 260px; padding: 0 12px 12px; }

/* attention */
.att { display: flex; flex-direction: column; }
.att-group { padding: 10px 16px 4px; font-size: 11.5px; font-weight: 500; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.att-row { display: flex; align-items: center; gap: 11px; padding: 8px 16px; border-top: 1px solid transparent; transition: background .12s; }
.att-row:hover { background: #fafbfa; }
.att-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.att-ic .ic { width: 15px; height: 15px; }
.att-ic.bad { background: var(--bad-soft); color: var(--bad); }
.att-ic.warn { background: var(--warn-soft); color: var(--warn); }
.att-ic.acc { background: var(--accent-soft); color: var(--accent-ink); }
.att-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-name { border: 0; background: none; padding: 0; text-align: left; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.att-name:hover { color: var(--accent-ink); }
.att-sub { font-size: 12px; color: var(--muted); }
.att-foot { padding: 10px 16px 14px; margin-top: auto; }

/* activity */
.feed { padding: 6px 16px 14px; }
.feed li { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.feed li:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 36px; bottom: -6px; width: 1px; background: var(--line); }
.feed .f-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--muted); flex: none; position: relative; }
.feed .f-ic .ic { width: 14px; height: 14px; }
.feed .f-ic.wa { color: var(--wa); background: #eaf6ef; border-color: #cbe7d6; }
.feed .f-ic.order { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.feed .f-txt { font-size: 13px; color: var(--ink-2); padding-top: 4px; min-width: 0; }
.feed .f-txt b { font-weight: 600; color: var(--ink); }
.feed time { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.feed li.fresh { animation: fresh 1.4s var(--ease); }
@keyframes fresh { 0% { background: var(--accent-soft); } 100% { background: transparent; } }

.top-list { padding: 6px 16px 14px; display: flex; flex-direction: column; gap: 2px; }
.top-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 110px 52px; align-items: center; gap: 10px; padding: 7px 0; border: 0; background: none; text-align: left; border-radius: 6px; }
.top-row:hover .top-name { color: var(--accent-ink); }
.top-rank { font: 500 11.5px var(--mono); color: var(--faint); }
.top-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.top-bar i { display: block; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; }
.top-val { font: 500 12px var(--mono); text-align: right; color: var(--ink-2); }

/* ---------- productos ---------- */
.table-card { position: relative; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 59px; }
.search-field { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 340px; }
.search-field > .ic { position: absolute; left: 10px; color: var(--faint); pointer-events: none; }
.search-field .input { padding-left: 32px; padding-right: 34px; }
.search-field kbd { position: absolute; right: 8px; }
.search-field input::-webkit-search-cancel-button { display: none; }
.toolbar .select select { width: auto; min-width: 190px; }
.toolbar .tb-count { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.bulkbar {
  position: absolute; left: 0; right: 0; top: 0; min-height: 59px; display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: var(--surface); border-bottom: 1px solid var(--accent-line); border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 3;
  box-shadow: inset 0 -2px 0 var(--accent-soft); transform: translateY(-6px); opacity: 0; visibility: hidden;
  transition: transform .2s var(--ease), opacity .18s, visibility 0s .2s; flex-wrap: wrap;
}
.bulkbar.show { transform: none; opacity: 1; visibility: visible; transition: transform .2s var(--ease), opacity .18s; }
.bulk-n { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; margin-right: 6px; }
.bulk-n b { font-family: var(--mono); background: var(--accent); color: #fff; border-radius: 6px; padding: 2px 7px; font-size: 12px; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; background: #fafbfa; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 0 12px; height: 36px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1;
}
.tbl th.num { text-align: right; }
.th-btn { border: 0; background: none; padding: 4px 0; display: inline-flex; align-items: center; gap: 4px; color: inherit; font-weight: 500; font-size: 12px; }
.th-btn:hover { color: var(--ink); }
.th-btn .ic { width: 12px; height: 12px; opacity: 0; transition: opacity .12s, transform .15s; }
.th-btn:hover .ic { opacity: .5; }
th[aria-sort] .th-btn { color: var(--ink); }
th[aria-sort] .th-btn .ic { opacity: 1; color: var(--accent); }
th[aria-sort="descending"] .th-btn .ic { transform: rotate(180deg); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .1s; outline: none; }
.tbl tbody tr:hover { background: #fafbfa; }
.tbl tbody tr:focus-visible { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.tbl tbody tr.is-sel { background: #f4f7ff; }
.tbl tbody tr.is-open { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.tbl tbody tr.flash td { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 30% { background: #fff6dc; } 100% { background: transparent; } }
.tbl tbody tr:last-child td { border-bottom: 0; }
.c-check { width: 40px; padding-right: 0 !important; }
.c-sku { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pname { font-weight: 500; color: var(--ink); line-height: 1.3; }
.psub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.stale { display: inline-flex; align-items: center; gap: 3px; color: var(--warn); font-size: 11.5px; }
.stale .ic { width: 12px; height: 12px; }
.cat-tag { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.stock-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stock-top { display: flex; align-items: center; gap: 6px; }
.stock-total { font: 600 13px var(--mono); letter-spacing: -.02em; }
.chp-row { display: flex; gap: 3px; }
.chp { display: inline-flex; align-items: center; gap: 3px; font: 500 10.5px/1 var(--mono); color: var(--muted); background: var(--bg); padding: 3px 5px 3px 4px; border-radius: 4px; letter-spacing: -.03em; }
.chp i { width: 6px; height: 6px; border-radius: 2px; }
.chp.zero { color: var(--faint); }
.chp.zero i { opacity: .35; }
.c-money { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; letter-spacing: -.02em; }
.price-btn {
  border: 1px solid transparent; background: none; border-radius: 6px; padding: 4px 6px; margin: -4px -6px; display: inline-flex; align-items: center; gap: 6px;
  font: 500 12.5px var(--mono); letter-spacing: -.02em; color: var(--ink); white-space: nowrap;
}
.price-btn .ic { width: 12px; height: 12px; color: var(--faint); opacity: 0; transition: opacity .12s; }
.price-btn:hover { border-color: var(--line); background: var(--surface); }
tr:hover .price-btn .ic, .price-btn:focus-visible .ic { opacity: 1; }
.price-edit { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; position: relative; }
.price-edit .input { width: 118px; height: 30px; text-align: right; font-family: var(--mono); font-size: 12.5px; }
.price-edit .err { font-size: 11.5px; color: var(--bad); white-space: nowrap; }
.price-edit .hint { font-size: 11px; color: var(--faint); white-space: nowrap; }
.margin { font: 500 12.5px var(--mono); letter-spacing: -.02em; }
.margin.low { color: var(--warn); }
.margin.neg { color: var(--bad); }
.dl { font-size: 0; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(11, 12, 12, .28); z-index: 70; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.scrim.show { opacity: 1; visibility: visible; transition: opacity .25s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); z-index: 80; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--sh-3); transform: translateX(104%); visibility: hidden; transition: transform .34s var(--ease), visibility 0s .34s;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; visibility: visible; transition: transform .34s var(--ease); }
.dw-top { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dw-top .mono { font-size: 12px; color: var(--muted); margin-right: auto; padding-left: 4px; }
.dw-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 22px; overscroll-behavior: contain; }
.dw-title h2 { font-size: 19px; letter-spacing: -.025em; line-height: 1.25; }
.dw-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.dw-sec h3 { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.dw-sec h3 .spacer { flex: 1; }
.dw-sec h3 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.price-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .field .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .err { font-size: 11.5px; color: var(--bad); }
.field-help { font-size: 12px; color: var(--muted); }
.money-input { position: relative; }
.money-input span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font: 500 12.5px var(--mono); pointer-events: none; }
.money-input .input { padding-left: 24px; font-family: var(--mono); font-size: 13px; }
.margin-box { height: 34px; border-radius: var(--r); background: var(--bg); border: 1px dashed var(--line); display: flex; align-items: center; padding: 0 10px; font: 600 13px var(--mono); }
.suggest { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.suggest b { font-family: var(--mono); color: var(--ink); font-weight: 500; }
.ch-edit { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ch-edit-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.ch-edit-row:last-child { border-bottom: 0; background: #fafbfa; }
.ch-edit-row .ch-name { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.ch-dot { width: 8px; height: 8px; border-radius: 2.5px; flex: none; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.stepper button { width: 28px; height: 28px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.stepper button:hover { background: var(--hover); color: var(--ink); }
.stepper button .ic { width: 13px; height: 13px; }
.stepper input { width: 52px; height: 28px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: 500 13px var(--mono); outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper input:focus { background: var(--accent-soft); }
.dist { display: flex; height: 6px; gap: 2px; border-radius: 3px; overflow: hidden; margin-top: 10px; background: var(--bg-2); }
.dist i { display: block; height: 100%; transition: flex-grow .35s var(--ease); min-width: 0; }
.mini-chart { position: relative; }
.mini-chart svg { display: block; width: 100%; height: 120px; overflow: visible; }
.movs { display: flex; flex-direction: column; }
.mov { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.mov:last-child { border-bottom: 0; }
.mov-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.mov-ic .ic { width: 13px; height: 13px; }
.mov-t { color: var(--ink-2); min-width: 0; }
.mov-t small { display: block; color: var(--faint); font-size: 11.5px; }
.mov-q { font: 600 12.5px var(--mono); }
.mov-q.pos { color: var(--ok); }
.mov-q.neg { color: var(--ink-2); }
.dw-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfa; }
.dw-foot .dirty { margin-right: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .2s; }
.dw-foot .dirty.show { opacity: 1; }
.dw-foot .dirty i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* modal / overlay */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(11, 12, 12, .32); display: flex; align-items: flex-start; justify-content: center;
  padding: 13vh 12px 24px; opacity: 0; visibility: hidden; transition: opacity .18s, visibility 0s .18s;
}
.overlay.show { opacity: 1; visibility: visible; transition: opacity .18s; }
.overlay.show > * { animation: dlg .22s var(--ease); }
@keyframes dlg { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal { width: min(480px, 100%); background: var(--surface); border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--sh-3); overflow: hidden; }
.modal-b { padding: 18px 20px 4px; }
.modal h2 { font-size: 16px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-f { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); margin-top: 16px; background: #fafbfa; }
.modal-f .msg { margin-right: auto; font-size: 12px; color: var(--bad); }
.pct-row { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pct-input { position: relative; width: 120px; }
.pct-input .input { font: 600 18px var(--mono); height: 42px; padding-right: 30px; text-align: right; }
.pct-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 500 15px var(--mono); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font: 500 12px var(--mono); color: var(--ink-2); }
.chip:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.bp-list { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r); max-height: 220px; overflow-y: auto; }
.bp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; align-items: center; }
.bp-row:last-child { border-bottom: 0; }
.bp-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-row .v { font: 500 12px var(--mono); white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.bp-row .v s { color: var(--faint); }
.bp-row.bad { background: var(--bad-soft); }
.bp-row.bad .v b { color: var(--bad); }

/* palette */
.palette { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.pal-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.pal-search > .ic { color: var(--muted); width: 18px; height: 18px; }
.pal-search input { flex: 1; height: 52px; border: 0; outline: none; font-size: 15px; background: none; min-width: 0; }
.pal-list { overflow-y: auto; padding: 6px; flex: 1; }
.pal-group { font-size: 11.5px; color: var(--faint); font-weight: 500; padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 11px; padding: 0 10px; height: 40px; border-radius: 7px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.pal-item .ic { color: var(--muted); }
.pal-item .pi-meta { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--faint); white-space: nowrap; }
.pal-item .pi-meta .mono { font-size: 11.5px; }
.pal-item .pi-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pal-item mark { background: none; color: var(--accent-ink); font-weight: 600; }
.pal-item[aria-selected="true"] { background: var(--hover); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.pal-item[aria-selected="true"] .ic { color: var(--ink); }
.pal-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.pal-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); background: #fafbfa; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pal-foot span { display: inline-flex; gap: 4px; align-items: center; }

/* toasts */
.toasts { position: fixed; top: 14px; right: 14px; z-index: 150; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; padding: 12px 12px 12px 13px; background: var(--ink); color: #fff;
  border-radius: 10px; box-shadow: var(--sh-3); font-size: 13px; animation: tin .38s var(--ease) both; position: relative; overflow: hidden;
}
.toast.out { animation: tout .28s var(--ease) both; }
@keyframes tin { from { opacity: 0; transform: translateX(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes tout { to { opacity: 0; transform: translateX(24px); } }
.toast .t-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; background: #26292a; color: #c9cecc; }
.toast .t-ic .ic { width: 14px; height: 14px; }
.toast.ok .t-ic { background: #17321f; color: #6fd39a; }
.toast.warn .t-ic { background: #3a2a10; color: #f2c46b; }
.toast.order .t-ic { background: #16234a; color: #8fb0ff; }
.toast.wa .t-ic { background: #12341f; color: #5fdc8f; }
.toast .t-body { flex: 1; min-width: 0; padding-top: 2px; }
.toast .t-title { font-weight: 500; line-height: 1.35; }
.toast .t-title b { font-weight: 600; }
.toast .t-sub { color: #a3a9a7; font-size: 12px; margin-top: 2px; }
.toast .t-act { border: 0; background: #2a2e2f; color: #fff; height: 26px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; flex: none; display: inline-flex; align-items: center; gap: 5px; }
.toast .t-act:hover { background: #3a3f40; }
.toast .t-act .ic { width: 12px; height: 12px; }
.toast .t-x { border: 0; background: none; color: #7d8381; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; flex: none; }
.toast .t-x:hover { color: #fff; background: #26292a; }
.toast .t-x .ic { width: 13px; height: 13px; }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .22); transform-origin: left; animation: tbar linear forwards; }
.toast:hover .t-bar { animation-play-state: paused; }
@keyframes tbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- proveedores ---------- */
.prov-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.drop {
  margin: 14px 16px 16px; border: 1.5px dashed #cfd4d0; border-radius: 12px; background: repeating-linear-gradient(135deg, #fbfcfb 0 10px, #f8f9f8 10px 20px);
  padding: 34px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); display: grid; place-items: center; color: var(--accent); margin-bottom: 4px; }
.drop-ic .ic { width: 22px; height: 22px; }
.drop h3 { font-size: 15px; }
.drop p { color: var(--muted); font-size: 13px; max-width: 400px; }
.drop .btn { margin-top: 8px; }
.presets { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.presets-l { font-size: 12px; color: var(--muted); }
.preset {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.preset:hover { border-color: var(--accent-line); box-shadow: var(--sh-2); transform: translateY(-1px); }
.preset .f-ic { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.f-ic.pdf { background: #fcefed; color: #b93a32; }
.f-ic.sheet { background: #eaf4ee; color: #2f7a52; }
.f-ic.image { background: #f1edff; color: #6a4fd6; }
.preset .p-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.preset .p-name { font: 500 12.5px var(--mono); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset .p-sub { font-size: 12px; color: var(--muted); }
.preset .p-go { color: var(--faint); }
.preset:hover .p-go { color: var(--accent); }
.sup-list { padding: 4px 0 6px; }
.sup { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13px; }
.sup + .sup { border-top: 1px solid var(--line-2); }
.sup-av { width: 28px; height: 28px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font: 600 10.5px var(--sans); color: var(--ink-2); flex: none; }
.sup .s-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sup .s-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup .s-sub { font-size: 12px; color: var(--muted); }

.parse { padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.parse-file { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.parse-file .f-ic { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; }
.parse-file .f-ic .ic { width: 20px; height: 20px; }
.parse-file b { font: 500 13.5px var(--mono); letter-spacing: -.02em; display: block; word-break: break-all; }
.parse-file span { font-size: 12px; color: var(--muted); }
.steps { display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; align-items: center; gap: 11px; padding: 7px 0; font-size: 13px; color: var(--faint); transition: color .2s; }
.step .s-ic { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; transition: all .25s var(--ease); }
.step .s-ic .ic { width: 12px; height: 12px; opacity: 0; color: #fff; }
.step.run { color: var(--ink); }
.step.run .s-ic { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.done { color: var(--ink-2); }
.step.done .s-ic { background: var(--ink); border-color: var(--ink); }
.step.done .s-ic .ic { opacity: 1; }
.step small { margin-left: auto; font: 500 11.5px var(--mono); color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 4px; background: var(--bg-2); border-radius: 2px; overflow: hidden; margin-top: 16px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width .5s var(--ease); }
.ticker {
  background: #0d0f10; color: #9aa3a0; border-radius: 10px; padding: 12px 14px; font: 400 11.5px/1.75 var(--mono); height: 268px; overflow: hidden;
  position: relative; letter-spacing: -.02em;
}
.ticker::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40px; background: linear-gradient(#0d0f10, rgba(13, 15, 16, 0)); z-index: 1; }
.ticker-h { display: flex; justify-content: space-between; color: #5f6866; margin-bottom: 6px; position: relative; z-index: 2; }
.ticker-lines { position: absolute; left: 14px; right: 14px; bottom: 12px; }
.tl { display: flex; gap: 10px; white-space: nowrap; animation: tl .3s var(--ease); }
.tl .d { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tl .p { color: #e8ece9; }
.tl.hit .d { color: #8fb0ff; }
.tl.hit .p { color: #8fb0ff; }
@keyframes tl { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.caret { display: inline-block; width: 7px; height: 13px; background: #8fb0ff; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.diff-sum { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.stat-pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.stat-pill b { font: 600 12.5px var(--mono); }
.diff-opts { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.diff .tbl tbody tr { cursor: default; }
.diff .tbl td { padding: 9px 12px; }
.var { display: inline-flex; align-items: center; gap: 2px; font: 600 12px var(--mono); padding: 3px 6px; border-radius: 5px; letter-spacing: -.02em; }
.var .ic { width: 11px; height: 11px; }
.var.up { background: var(--warn-soft); color: var(--warn); }
.var.up.hi { background: var(--bad-soft); color: var(--bad); }
.var.down { background: var(--ok-soft); color: var(--ok); }
.arrow-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.arrow-cell s { color: var(--faint); text-decoration-thickness: 1px; }
.arrow-cell .ic { width: 12px; height: 12px; color: var(--faint); }
.row-acts { display: inline-flex; gap: 4px; justify-content: flex-end; }
.diff tr.is-applied td { background: #f6fbf8; }
.diff tr.is-rejected td { color: var(--faint); }
.diff tr.is-rejected .pname, .diff tr.is-rejected .mono { text-decoration: line-through; color: var(--faint); }
.diff tr.is-applied, .diff tr.is-rejected { animation: none; }
.diff-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfa; border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
.diff-foot .note { margin-right: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.notfound { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.done-banner { display: flex; align-items: center; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--ok-soft), var(--surface)); border-radius: var(--r-lg) var(--r-lg) 0 0; flex-wrap: wrap; }
.done-banner .d-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; animation: pop .4s var(--ease); }
.done-banner .d-ic .ic { width: 18px; height: 18px; }
.done-banner h3 { font-size: 14.5px; }
.done-banner p { font-size: 12.5px; color: var(--muted); }
.done-banner .btn { margin-left: auto; }

/* ---------- pedidos ---------- */
.ord-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ord-tools .spacer { flex: 1; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 200px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px 10px; font-size: 13px; font-weight: 600; }
.col-h .cnt { font: 500 11.5px var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.col-h .st { width: 10px; height: 10px; border-radius: 50%; border: 2px solid; }
.col-h .st.nuevo { border-color: var(--accent); }
.col-h .st.prep { border-color: #c48a1b; border-right-color: transparent; }
.col-h .st.desp { border-color: var(--ok); background: var(--ok); }
.col-list { display: flex; flex-direction: column; gap: 8px; }
.col-empty { padding: 26px 10px; text-align: center; color: var(--faint); font-size: 12.5px; border: 1px dashed var(--line); border-radius: 9px; }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px 12px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, border-color .15s; }
.order:hover { box-shadow: var(--sh-2); }
.order.is-new { animation: newOrder 2.4s var(--ease); border-color: var(--accent-line); }
@keyframes newOrder { 0% { transform: translateY(-8px) scale(.98); opacity: 0; box-shadow: 0 0 0 0 rgba(45, 107, 255, .5); } 15% { transform: none; opacity: 1; } 40% { box-shadow: 0 0 0 6px rgba(45, 107, 255, .12); } 100% { box-shadow: var(--sh-1); } }
.o-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.o-id { font: 500 12px var(--mono); color: var(--ink-2); }
.o-head time { margin-left: auto; color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.ch-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); padding: 2px 7px 2px 6px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.ch-tag i { width: 7px; height: 7px; border-radius: 2px; }
.o-cust { font-weight: 600; font-size: 13.5px; }
.o-items { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--ink-2); }
.o-items li { display: flex; gap: 6px; }
.o-items .q { font: 500 12px var(--mono); color: var(--muted); flex: none; min-width: 22px; }
.o-items .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.o-foot .ship { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-foot .ship .ic { width: 13px; height: 13px; }
.o-foot b { font: 600 13px var(--mono); color: var(--ink); letter-spacing: -.02em; }
.order .btn { width: 100%; }
.o-done { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); font-weight: 500; }
.o-done .ic { width: 14px; height: 14px; }
.flow { display: flex; align-items: center; gap: 4px; }
.flow i { height: 3px; flex: 1; border-radius: 2px; background: var(--line); }
.flow i.on { background: var(--ink); }

/* ---------- canales ---------- */
.ch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ch-card { display: flex; flex-direction: column; transition: opacity .2s; }
.ch-card.off .ch-body, .ch-card.off .ch-stats { opacity: .55; }
.ch-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.ch-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 700 13px var(--sans); color: #fff; flex: none; letter-spacing: -.02em; }
.ch-logo.ml { background: #ffe14d; color: #2b2a26; }
.ch-logo.tn { background: #0d1b3e; color: #fff; }
.ch-logo.l { background: var(--ink); }
.ch-title { flex: 1; min-width: 0; }
.ch-title h3 { font-size: 14.5px; }
.ch-title p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-body { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.ch-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ch-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 14px; }
.ch-stats div { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ch-stats div + div { border-left: 1px solid var(--line); }
.ch-stats span { font-size: 11.5px; color: var(--muted); }
.ch-stats b { font: 600 14px var(--mono); letter-spacing: -.03em; }
.ch-sync { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.ch-sync-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ch-sync-row .btn { margin-left: auto; }
.ch-sync .progress { margin-top: 0; height: 3px; opacity: 0; transition: opacity .2s; }
.ch-sync.syncing .progress { opacity: 1; }
.ch-sync.syncing .btn .ic { animation: spin 1s linear infinite; }
.rules { display: flex; flex-direction: column; }
.rule { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--line-2); }
.rule:first-child { border-top: 0; }
.rule .r-txt { flex: 1; min-width: 0; }
.rule .r-txt b { font-weight: 500; font-size: 13px; display: block; }
.rule .r-txt span { font-size: 12px; color: var(--muted); }
.rule .input { width: 96px; text-align: right; font-family: var(--mono); }
.unit-input { position: relative; }
.unit-input span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 500 12px var(--mono); pointer-events: none; }
.unit-input .input { padding-right: 30px; }
.log { padding: 4px 16px 12px; font-size: 12.5px; }
.log li { display: grid; grid-template-columns: 76px 14px minmax(0, 1fr); gap: 10px; padding: 7px 0; align-items: center; border-bottom: 1px solid var(--line-2); }
.log li:last-child { border-bottom: 0; }
.log time { font: 500 11.5px var(--mono); color: var(--faint); }
.log .ch-dot { width: 8px; height: 8px; }
.log span { color: var(--ink-2); min-width: 0; }

/* ---------- ajustes ---------- */
.set-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.set-sec { margin-bottom: 14px; }
.set-sec > .card-h { padding-bottom: 2px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.set-sec .set-row:first-of-type { border-top: 0; }
.set-row .s-l b { font-weight: 500; font-size: 13.5px; display: block; }
.set-row .s-l span { font-size: 12.5px; color: var(--muted); }
.set-row .s-c { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.set-row .s-c .input { max-width: 220px; }
.range { -webkit-appearance: none; appearance: none; width: 130px; height: 4px; background: var(--line); border-radius: 2px; outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--ink); cursor: pointer; box-shadow: var(--sh-1); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--ink); cursor: pointer; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(45, 107, 255, .25); }
.preview-line { margin: 0 16px 14px; padding: 10px 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preview-line b { font-family: var(--mono); color: var(--ink); font-weight: 500; }
.set-row.disabled .s-l, .set-row.disabled .s-c { opacity: .45; pointer-events: none; }
.radio-list { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.radio { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.radio input { accent-color: var(--accent); margin: 0; }
.savebar {
  position: fixed; right: 18px; top: 68px; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--ink); color: #fff;
  border-radius: 10px; box-shadow: var(--sh-3); font-size: 13px; transform: translateY(-12px); opacity: 0; visibility: hidden;
  transition: transform .25s var(--ease), opacity .2s, visibility 0s .25s;
}
.savebar.show { transform: none; opacity: 1; visibility: visible; transition: transform .25s var(--ease), opacity .2s; }
.savebar .btn.ghost { color: #c9cecc; }
.savebar .btn.ghost:hover { background: #26292a; color: #fff; }
.savebar .btn.accent { box-shadow: none; }

.phone { position: sticky; top: 76px; background: #0b0c0c; border-radius: 30px; padding: 10px; box-shadow: var(--sh-3); }
.phone-in { background: #efe7dc; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; height: 560px;
  background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1.2px); background-size: 14px 14px; }
.wa-head { background: #0f5c4c; color: #fff; display: flex; align-items: center; gap: 10px; padding: 26px 14px 11px; }
.wa-av { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.wa-av svg { width: 22px; height: 22px; color: var(--ink); }
.wa-head b { display: block; font-size: 14px; font-weight: 600; }
.wa-head span { font-size: 11.5px; color: #b9d7cf; }
.wa-chat { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.wa-day { align-self: center; font-size: 11px; background: #e1f2fa; color: #4f6470; padding: 4px 10px; border-radius: 7px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.bub { max-width: 86%; background: #fff; border-radius: 9px 9px 9px 2px; padding: 7px 9px 5px; font-size: 13px; line-height: 1.4; color: #111b21; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); animation: bub .35s var(--ease) both; white-space: pre-line; }
.bub.me { align-self: flex-end; background: #d9fdd3; border-radius: 9px 9px 2px 9px; }
.bub .bt { display: block; text-align: right; font-size: 10.5px; color: #667781; margin-top: 2px; }
.bub .quick { display: flex; gap: 6px; margin-top: 8px; border-top: 1px solid #eef0f1; padding-top: 6px; }
.bub .quick span { flex: 1; text-align: center; color: #027eb5; font-size: 12.5px; font-weight: 500; }
@keyframes bub { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.typing { align-self: flex-start; background: #fff; border-radius: 9px; padding: 10px 12px; display: flex; gap: 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa5ab; animation: typ 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typ { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.wa-input { display: flex; align-items: center; gap: 8px; padding: 8px 10px 12px; }
.wa-input div { flex: 1; background: #fff; border-radius: 18px; height: 36px; display: flex; align-items: center; padding: 0 14px; color: #8696a0; font-size: 13px; }
.wa-input span { width: 36px; height: 36px; border-radius: 50%; background: #0f5c4c; display: grid; place-items: center; color: #fff; }
.phone-cap { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .set-wrap { grid-template-columns: minmax(0, 1fr); }
  .phone { position: relative; top: 0; max-width: 360px; margin: 0 auto; }
  .ch-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto; transform: translateX(-102%); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s .3s; box-shadow: var(--sh-3); z-index: 90; overflow-y: auto;
  }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform .3s var(--ease); }
  body.nav-open .scrim { opacity: 1; visibility: visible; transition: opacity .25s; z-index: 85; }
  .sb-close { display: inline-grid; }
  .tb-menu { display: inline-grid; margin-left: -6px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .view { padding: 20px 16px 120px; }
  .crumb-root, .crumb-sep { display: none; }
  .tb-search { width: auto; flex: 0 1 260px; }
  .prov-grid { grid-template-columns: minmax(0, 1fr); }
  .parse { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .col { min-height: 0; }
  .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-kbd { display: none !important; }
  .nav-item:hover .nav-count { display: inline-block; }
}
@media (max-width: 760px) {
  .grid-half { grid-template-columns: minmax(0, 1fr); }
  .tb-live { display: none; }
  /* tabla de productos como tarjetas */
  .products .tbl thead { display: none; }
  .products .tbl, .products .tbl tbody { display: block; }
  .products .tbl tbody tr {
    display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "c n n" "c s st" "c p m";
    gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  }
  .products .tbl td { padding: 0; border: 0; }
  .products .tbl td.c-check { grid-area: c; width: auto; padding-top: 2px; }
  .products .tbl td.c-sku { grid-area: s; align-self: center; }
  .products .tbl td.c-name { grid-area: n; }
  .products .tbl td.c-cat { display: none; }
  .products .tbl td.c-stock { grid-area: st; }
  .products .tbl td.c-cost { display: none; }
  .products .tbl td.c-price { grid-area: p; text-align: left; }
  .products .tbl td.c-margin { grid-area: m; }
  .products .tbl td.c-margin::before { content: "Margen "; font-size: 11.5px; color: var(--faint); font-family: var(--sans); }
  .products .price-btn { margin: 0; padding: 4px 7px; border-color: var(--line); }
  .products .price-btn .ic { opacity: 1; }
  .toolbar .select, .toolbar .select select { width: 100%; }
  .search-field { max-width: none; flex-basis: 100%; }
  .search-field kbd { display: none; }
  .toolbar .seg { overflow-x: auto; max-width: 100%; }
  .toolbar .tb-count { display: none; }
  .price-grid { grid-template-columns: 1fr 1fr; }
  .price-grid .field:last-child { grid-column: 1 / -1; }
  .set-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .set-row .s-c { justify-content: flex-start; }
  .radio-list { align-items: flex-start; }
  .diff .tbl .c-hide { display: none; }
  .vh h1 { font-size: 20px; }
  .savebar { left: 12px; right: 12px; top: 64px; }
  .savebar span { flex: 1; }
}
@media (max-width: 560px) {
  .tb-search { flex: 0 0 auto; width: 36px; height: 34px; padding: 0; justify-content: center; margin-left: auto; }
  .tb-search-txt, .tb-search kbd { display: none; }
  .kpis { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-val { font-size: 19px; }
  .kpi-val small { font-size: 12px; }
  .spark { width: 56px; height: 26px; }
  .kpi-foot .kpi-cmp { display: none; }
  .vh-actions { width: 100%; }
  .vh-actions .btn { flex: 1; }
  .ord-tools .seg { width: 100%; overflow-x: auto; }
  .chart-head { padding: 12px 12px 4px; }
  .top-row { grid-template-columns: 18px minmax(0, 1fr) 70px 44px; }
  .ch-stats div { padding: 9px 10px; }
  .toasts { top: 8px; right: 8px; left: 8px; width: auto; }
  .dw-foot { padding-bottom: 66px; flex-wrap: wrap; }
  .dw-foot .dirty { flex-basis: 100%; }
  .dw-body { padding: 16px 16px 24px; }
}

/* ---------- demo de Nodo (?demo=1): el WhatsApp del dueño lo muestra la página de afuera ---------- */
.is-demo .set-wrap { grid-template-columns: minmax(0, 1fr); }
.is-demo .set-wrap > aside { display: none; }
