/* Toro Negro · Vista nueva (ERP) — cascaron.js
   Marco tipo ERP: barra superior oscura con la marca, lo que se está mirando, buscador y usuario;
   menú lateral claro por áreas; área de trabajo más compacta con ruta de ubicación y pestañas.
   Todo cuelga de .app.cx, así que la vista de siempre no cambia. Usa los mismos tokens de styles.css. */
.app.cx { --cx-top: 52px; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: var(--cx-top) minmax(0, 1fr); min-height: 100vh; }

/* ---------- Barra superior ---------- */
.cx-top { grid-column: 1 / -1; position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: var(--sp-3); height: var(--cx-top);
  padding: 0 var(--sp-4); padding-top: env(safe-area-inset-top); box-sizing: content-box; background: var(--side); color: var(--side-ink); border-bottom: 2px solid var(--accent-strong); }
.cx-marca { display: flex; align-items: center; gap: var(--sp-2); color: inherit; text-decoration: none; margin-right: var(--sp-3); }
.cx-marca img { width: 28px; height: 28px; object-fit: contain; }
.cx-marca b { font-family: var(--f-display); font-size: var(--fs-xl); letter-spacing: .06em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.cx-marca small { font-size: var(--fs-2xs); letter-spacing: .14em; color: var(--side-muted); border: 1px solid var(--side-line); border-radius: var(--r-sm); padding: 1px 5px; }
.cx-alc { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border: 1px solid var(--side-line); border-radius: var(--r-sm); font-size: var(--fs-sm); white-space: nowrap; }
.cx-alc span { color: var(--side-muted); font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; }
.cx-alc b { font-weight: 600; text-transform: capitalize; }
.cx-esp { flex: 1; }
.cx-buscar { position: relative; flex: 0 1 260px; min-width: 0; color: var(--side-muted); }
.cx-buscar svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.cx-buscar input { width: 100%; box-sizing: border-box; height: 34px; border: 1px solid var(--side-line); border-radius: var(--r-sm); background: var(--side-hover); color: var(--side-ink); padding: 0 10px 0 32px; font: inherit; font-size: var(--fs-sm); }
.cx-buscar input::placeholder { color: var(--side-muted); }
.cx-buscar input:focus-visible, .cx-top button:focus-visible, .cx-marca:focus-visible { outline: 2px solid var(--focus-side); outline-offset: 1px; }
.cx-buscar ul { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 240px; margin: 0; padding: var(--sp-1); list-style: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
.cx-buscar li button { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 7px 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.cx-buscar li button:hover, .cx-buscar li button:focus-visible { background: var(--surface2); }
.cx-buscar li small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.cx-ico { all: unset; cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--side-ink); }
.cx-ico:hover { background: var(--side-hover); }
.cx-ico .badge, .cx-nav .badge, .cx-tabs .badge { background: var(--accent-bright); color: #fff; border-radius: var(--r-pill); font-size: var(--fs-2xs); padding: 0 6px; line-height: 17px; font-weight: 600; }
.cx-ico .badge { position: absolute; top: 0; right: -2px; }
.cx-menu { display: none; }
.cx-user { position: relative; }
.cx-yo { all: unset; cursor: pointer; display: flex; align-items: center; gap: var(--sp-2); padding: 4px 6px; border-radius: var(--r-sm); }
.cx-yo:hover { background: var(--side-hover); }
.cx-av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-strong); color: #fff; display: grid; place-items: center; font-family: var(--f-display); font-size: var(--fs-lg); font-weight: 600; }
.cx-yo-t { display: flex; flex-direction: column; line-height: 1.15; font-size: var(--fs-sm); max-width: 170px; }
.cx-yo-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-yo-t small { color: var(--side-muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-user-m { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: var(--sp-1); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
.cx-user.abierto .cx-user-m { display: flex; flex-direction: column; }
.cx-user-m button { all: unset; cursor: pointer; padding: 9px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.cx-user-m button:hover, .cx-user-m button:focus-visible { background: var(--surface2); }

/* ---------- Menú lateral por áreas ---------- */
.app.cx .side { background: var(--surface); color: var(--ink); border-right: 1px solid var(--line); padding: var(--sp-3) var(--sp-2); gap: var(--sp-3);
  position: sticky; top: calc(var(--cx-top) + env(safe-area-inset-top)); height: calc(100vh - var(--cx-top) - env(safe-area-inset-top)); z-index: 30; }
.cx-nav { display: flex; flex-direction: column; gap: 2px; }
.cx-nav button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-md); color: var(--ink); }
.cx-nav button:hover { background: var(--surface2); }
.cx-nav button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cx-ar { font-weight: 500; }
.cx-ar svg { flex: none; color: var(--muted); }
.cx-ar > span:first-of-type { flex: 1; min-width: 0; }
.cx-ar > i { flex: none; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.cx-ar[aria-expanded="true"] > i { transform: rotate(45deg); }
.cx-ar.aqui { color: var(--accent); font-weight: 600; }
.cx-ar.aqui svg { color: var(--accent); }
.cx-secs { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 18px; padding-left: 10px; border-left: 1px solid var(--line); }
.cx-secs button { font-size: var(--fs-sm); padding: 6px 10px; color: var(--muted); justify-content: space-between; }
.cx-secs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cx-pend { margin: auto 0 0; padding: var(--sp-2) 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Área de trabajo ---------- */
.app.cx .main { padding: var(--sp-4) var(--sp-5) 64px; gap: var(--sp-4); }
.app.cx .ph h1 { font-size: var(--fs-d2); }
.cx-migas { color: var(--muted); font-size: var(--fs-xs); letter-spacing: .02em; margin-bottom: calc(var(--sp-3) * -1); }
.cx-migas span { margin: 0 2px; opacity: .6; }
.cx-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.cx-tabs button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.cx-tabs button:hover { color: var(--ink); }
.cx-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.cx-tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ---------- Tablero nuevo ---------- */
.cx-vista { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; }
.cx-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.cx-seg button { all: unset; cursor: pointer; padding: 7px 13px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.cx-seg button + button { border-left: 1px solid var(--line); }
.cx-seg button.on { background: var(--accent); color: var(--accent-ink); }
.cx-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cx-sel, .cx-fijo { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 0 6px 0 10px; font-size: var(--fs-sm); min-height: 34px; }
.cx-sel span, .cx-fijo { color: var(--muted); } .cx-fijo { padding-right: 10px; border-style: dashed; background: none; } .cx-fijo b { color: var(--ink); font-weight: 600; }
.cx-sel select { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ink); padding: 6px 2px; }
.cx-h { margin: 0 0 var(--sp-3); } .cx-h small { font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 400; color: var(--muted); margin-left: var(--sp-2); }
button.cx-kpi { all: unset; box-sizing: border-box; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 13px 15px var(--sp-3); display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; transition: border-color .15s, transform .15s; }
button.cx-kpi:hover { border-color: var(--ink); transform: translateY(-1px); }
button.cx-kpi:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cx-kpi .l { display: flex; justify-content: space-between; gap: 6px; } .cx-kpi .l i { font-style: normal; letter-spacing: 0; text-transform: none; }
.cx-kpi .cx-ver { font-size: var(--fs-xs); color: var(--accent); font-weight: 600; margin-top: 4px; }
.cx-kpi.cx-pendiente .v { color: var(--accent); } .cx-kpi.cx-pendiente::before { background: var(--accent); }
.cx-biz { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: var(--r-lg); padding: var(--sp-4); }
button.cx-biz { cursor: pointer; transition: border-color .15s, transform .15s; }
button.cx-biz:hover { border-color: var(--accent); transform: translateY(-2px); }
button.cx-biz:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cx-biz.nd { border-top-color: var(--line); background: var(--surface2); }
.cx-biz header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); }
.cx-biz h3 { margin: 0; font-size: var(--fs-d1); text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.cx-biz p { margin: 0; }
.cx-v { font-family: var(--f-display); font-size: var(--fs-d3); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.cx-fila { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-xs); flex-wrap: wrap; }
.cx-mini { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto; gap: 4px var(--sp-2); align-items: center; font-size: var(--fs-sm); }
.cx-mini b { font-variant-numeric: tabular-nums; }
.cx-biz footer { display: flex; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.cx-go { color: var(--accent); font-weight: 600; }
.cx-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--line); min-width: 60px; }
.cx-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--muted); }
.cx-bar.good > i { background: var(--good); } .cx-bar.warn > i { background: var(--warn); } .cx-bar.bad > i { background: var(--bad); }
.cx-bar > u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.cx-n { font-size: var(--fs-d1); }
td .cx-bar { margin-left: auto; max-width: 170px; }

/* ---------- Celular: el menú es un panel que se abre con ☰ ---------- */
@media (max-width: 860px) {
  .app.cx { grid-template-columns: minmax(0, 1fr); }
  .cx-top { gap: var(--sp-2); padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .cx-menu { display: inline-flex; width: 42px; height: 42px; }
  .cx-marca { margin-right: 0; } .cx-marca small, .cx-alc, .cx-yo-t { display: none; }
  .cx-buscar { flex: 1 1 auto; }
  .cx-buscar ul { position: fixed; left: var(--sp-2); right: var(--sp-2); top: calc(var(--cx-top) + env(safe-area-inset-top) + 4px); }
  .app.cx .side { position: fixed; left: 0; bottom: 0; width: min(300px, 86vw); height: auto; padding: var(--sp-3) var(--sp-2) calc(var(--sp-3) + env(safe-area-inset-bottom)); transform: translateX(-102%); transition: transform .18s ease; box-shadow: none; overflow-y: auto; }
  .app.cx .side.abierta { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  .cx-nav button { padding: 11px 12px; font-size: var(--fs-lg); }
  .cx-secs button { font-size: var(--fs-md); padding: 10px 12px; }
  .app.cx .main { padding: var(--sp-3) var(--sp-4) calc(48px + env(safe-area-inset-bottom)); }
  .cx-tabs { margin: 0 calc(var(--sp-4) * -1); padding: 0 var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) { .app.cx .side, .cx-ar > i { transition: none; } }

/* ---------- Inicio del vendedor (inicio_vendedor.js) ---------- */
.vh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.vh-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.vh-card > h3 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.vh-card > .btn { align-self: flex-start; }
.vh-num { font: 600 var(--fs-d2)/1 var(--f-display); font-variant-numeric: tabular-nums; }
.vh-num.vh-venta { font-size: var(--fs-d3); }
.vh-lista { display: flex; flex-direction: column; }
.vh-fila { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-md); min-height: 44px; }
.vh-fila > span:first-child { flex: 1; min-width: 0; }
.vh-fila small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.vh-fila > i { color: var(--muted); font-style: normal; font-size: var(--fs-lg); }
button.vh-fila { cursor: pointer; width: 100%; }
button.vh-fila:hover { background: var(--surface2); }
button.vh-fila:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.vh-acts { display: contents; }
.vh-clis { display: flex; flex-direction: column; max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.vh-clis > button { all: unset; box-sizing: border-box; cursor: pointer; padding: 10px var(--sp-3); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--sp-3); align-items: baseline; }
.vh-clis > button:first-child { border-top: 0; }
.vh-clis > button[hidden] { display: none; }
.vh-clis > button:hover, .vh-clis > button:focus-visible { background: var(--surface2); }
.vh-clis small { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.vh-nav, .vh-fab { display: none; }
@media (max-width: 860px) {
  .vh-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .vh-acts { display: none; }
  .app.vh .menu-btn { display: none; }
  .app.vh .main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .vh-nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(30, 20, 18, .06); }
  .vh-nav button { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; min-height: 56px; font-size: var(--fs-2xs); color: var(--muted); }
  .vh-nav button.on { color: var(--accent); font-weight: 600; }
  .vh-nav button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .vh-nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--accent-bright); color: #fff; border-radius: var(--r-pill); font-size: var(--fs-2xs); padding: 0 6px; line-height: 16px; font-weight: 600; }
  .vh-fab { display: block; position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 46; }
  .vh-mas-b { all: unset; box-sizing: border-box; cursor: pointer; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 400 32px/1 var(--f-body); box-shadow: 0 6px 16px rgba(179, 23, 30, .4); }
  .vh-mas-b > span { transition: transform .15s; }
  .vh-mas.abierto .vh-mas-b > span { transform: rotate(45deg); }
  .vh-mas-b:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
  .vh-hoja { display: none; position: absolute; right: 0; bottom: 64px; width: min(260px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop); flex-direction: column; }
  .vh-mas.abierto .vh-hoja { display: flex; }
  .vh-hoja button { all: unset; box-sizing: border-box; cursor: pointer; padding: 12px; border-radius: var(--r); font-size: var(--fs-lg); font-weight: 500; }
  .vh-hoja button:hover, .vh-hoja button:focus-visible { background: var(--surface2); }
  .app.vh ~ .toast, body:has(.app.vh) .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ---------- Inicio de los demás roles (cascaron.js, V.inicioRol) ---------- */
.cx-abrir { margin-top: var(--sp-2); }
.cx-h .badge { background: var(--accent-bright); color: #fff; border-radius: var(--r-pill); font: 600 var(--fs-2xs)/18px var(--f-body); padding: 0 7px; vertical-align: middle; letter-spacing: 0; }
.cx-turnos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-2) var(--sp-4); margin: var(--sp-2) 0; }
.cx-turnos span { display: flex; flex-direction: column; font-size: var(--fs-md); }
.cx-turnos small { color: var(--muted); font-size: var(--fs-xs); }

/* Selector de sucursal de la barra superior: manda en toda la app */
.cx-alc-sel select { all: unset; cursor: pointer; font: inherit; font-weight: 600; color: inherit; padding-right: 14px; background: no-repeat right center / 9px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239C948D' stroke-width='1.6'/%3E%3C/svg%3E"); }
.cx-alc-sel select option { color: #1D1B1A; background: #fff; }
.cx-alc-sel:focus-within { outline: 2px solid var(--focus-side); outline-offset: 2px; }

/* ---------- Lenguaje visual cercano a Defontana (nov 2026) ----------
   La organización ya trabaja en Defontana: barra superior blanca, menú en acordeón con la opción activa en tono suave
   y una línea de color, pestañas y botones redondeados, y encabezados de tabla con fondo suave. Se mantienen los
   colores y las letras de Toro Negro. body.cx-on lo pone cascaron.js mientras el marco está activo. */
.app.cx { --cx-top: 56px; grid-template-columns: 248px minmax(0, 1fr); }
.cx-top { --side: var(--surface); --side-ink: var(--ink); --side-muted: var(--muted); --side-hover: var(--surface2); --side-line: var(--line); --focus-side: var(--accent);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 4px rgba(30, 20, 18, .06); }
.cx-marca small { color: var(--accent); border-color: currentColor; }
.cx-alc, .cx-buscar input { border-radius: var(--r-pill); }
.cx-alc { padding: 6px 14px; }
.cx-nav { gap: 4px; }
.cx-nav .cx-ar { min-height: 46px; padding: 0 12px; border-radius: var(--r); color: var(--muted); font-weight: 600; }
.cx-nav .cx-ar.aqui, .cx-nav .cx-ar[aria-expanded="true"] { color: var(--accent); }
.cx-nav .cx-ar[aria-expanded="true"] svg { color: var(--accent); }
.cx-nav .cx-ar[aria-expanded="true"] > i { border-color: var(--accent); }
.cx-secs { margin: 0 0 6px 22px; padding-left: 0; border-left: 0; gap: 2px; }
.cx-nav .cx-secs button { min-height: 40px; padding: 0 12px 0 14px; border-radius: var(--r); border-left: 3px solid transparent; color: var(--ink); }
.cx-nav .cx-secs button.on { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }
.cx-tabs { gap: var(--sp-2); border-bottom: 0; padding: 2px 0 4px; }
.cx-tabs button { padding: 6px 16px; margin-bottom: 0; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); }
.cx-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cx-tabs button.on .badge { background: var(--accent-ink); color: var(--accent); }
.cx-seg { border-radius: var(--r-pill); }
body.cx-on th:not(.tu-area) { background: var(--accent-soft); color: var(--ink); font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0; text-transform: none; padding: 10px var(--sp-2); border-bottom: 0; }
body.cx-on thead tr:first-child th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
body.cx-on thead tr:first-child th:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
body.cx-on td { padding-top: 9px; padding-bottom: 9px; }
body.cx-on .btn:not(.xl) { border-radius: var(--r-pill); padding: 6px 16px; }
body.cx-on .btn.sm:not(.xl) { padding: 2px 11px; }
body.cx-on .ph .acts .btn:not(.pri):not(.ok):not(.no):not(:disabled) { border-color: var(--accent); color: var(--accent); }
body.cx-on .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 860px) { .app.cx { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Tablero personalizable y tarjetas de análisis (panel.js) ---------- */
.pn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.pn-b { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.pn-b.full { grid-column: 1 / -1; }
.pn-b > .card, .pn-b > .pn-inerte > .card { height: 100%; }
.pn-ed .pn-b { border: 1px dashed var(--muted); border-radius: var(--r-lg); padding: var(--sp-2); background: var(--surface2); }
.pn-barra { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-sm); }
.pn-barra > span, .pn-kb { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.pn-inerte { pointer-events: none; opacity: .8; min-width: 0; }
.pn-k { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.pn-k .pn-inerte > * { width: 100%; height: 100%; }
.pn-kpis-ed { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pn-ocultas { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-2) 0 var(--sp-3); }
.pn-fil { margin-left: auto; display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; }
.pn-fil select { font: inherit; font-size: var(--fs-xs); font-family: var(--f-body); font-weight: 500; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); padding: 3px 8px; max-width: 100%; }
.pn-datos { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); margin: var(--sp-2) 0; }
.pn-datos span { display: flex; flex-direction: column; }
.pn-datos small { color: var(--muted); font-size: var(--fs-xs); }
.pn-datos b { font: 600 var(--fs-d1)/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.pn-titular { margin: 0 0 var(--sp-3); font-size: var(--fs-md); }
.pn-titular b { font: 600 var(--fs-d2)/1 var(--f-display); color: var(--accent); }
tr.pn-corte td { border-bottom: 2px solid var(--accent); }
.pn-h4 { margin: var(--sp-3) 0 var(--sp-1); font: 600 var(--fs-xs) var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pn-lista { list-style: none; margin: 0; padding: 0; }
.pn-lista li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: 7px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.pn-lista small { display: block; color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 1100px) { .pn-grid { grid-template-columns: minmax(0, 1fr); } }
.pn-nw { white-space: nowrap; }
.pn-mini { height: 3px; border-radius: 2px; background: var(--surface2); margin-top: 3px; min-width: 40px; }
.pn-mini > i { display: block; height: 100%; border-radius: 2px; background: var(--accent); opacity: .7; }
.pn-lista b small { display: inline; font-weight: 400; margin-left: 4px; }

/* Margen real junto a la venta de cada canal en la tarjeta de sucursal */
.cx-mini b { text-align: right; white-space: nowrap; }
.cx-mg { display: inline-block; min-width: 54px; margin-left: 8px; text-align: right; font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 600; }
.cx-fila .cx-mg { min-width: 0; margin-left: 0; font-size: inherit; }
