:root {
  --primary: #123a63;
  --primary-light: #2f8fd1;
  --accent: #4fb3f0;
  --bg: #eef3f8;
  --card-bg: #ffffff;
  --text: #1f2d3d;
  --muted: #6b7c93;
  --border: #dde5ee;
  --danger: #c0392b;
  --ok-bg: #e5f6ea;
  --ok-text: #1e7a3c;
  --warn-bg: #fdf1e2;
  --warn-text: #9a6a12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.muted-inline { display: block; font-size: 11px; color: var(--muted); }

/* ControlNet: barra de progreso fija (desktop + móvil) */
@keyframes cnTopProgress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}
.cn-page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1200;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}
.cn-page-loader.loading {
  background: rgba(15, 47, 82, 0.08);
}
.cn-page-loader.loading::after {
  content: "";
  display: block;
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #7fe0c0, #4fb3f0, transparent);
  animation: cnTopProgress 1.1s infinite ease-in-out;
}
.cn-btn.is-busy,
.cd-btn.is-busy,
button.is-busy {
  cursor: wait;
  opacity: 0.85;
}

/* ---------- Login: hero a pantalla completa + panel deslizante ---------- */
@keyframes loginFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loginPulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .55; } 50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } }
@keyframes loginDot { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.login-hero-body { margin: 0; background: #071a2f; overflow-x: hidden; }

.login-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.login-grid-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.login-particles { position: absolute; inset: 0; z-index: 2; }
.login-pulse-glow {
  position: absolute;
  width: 46vw; height: 46vw; max-width: 520px; max-height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47,143,209,0.16) 0%, rgba(127,224,192,0.08) 35%, transparent 70%);
  top: 34%; left: 50%;
  animation: loginPulse 3s ease-in-out infinite;
  z-index: 3;
  pointer-events: none;
}

.login-hero-topbar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px;
}
.login-hero-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 14.5px; }
.login-hero-logo { width: 38px; height: 38px; object-fit: contain; }

.btn-ejecutivo {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(47,143,209,0.45);
  color: #fff;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.btn-ejecutivo:hover { background: rgba(47,143,209,0.18); border-color: #7fe0c0; box-shadow: 0 0 18px rgba(127,224,192,0.18); }

.login-hero-content {
  position: relative; z-index: 4;
  min-height: calc(100vh - 76px);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center;
  padding: 0 20px 8vh;
}
.login-hero-eyebrow {
  font-size: 12px; letter-spacing: 4px; text-transform: uppercase;
  color: #7fe0c0; margin-bottom: 14px;
  opacity: 0; animation: loginFadeUp 1s .5s forwards;
}
.login-hero-title {
  font-size: clamp(26px, 4vw, 44px); font-weight: 700; color: #fff;
  margin: 0 0 16px; line-height: 1.22;
  text-shadow: 0 0 40px rgba(47,143,209,0.45);
  opacity: 0; animation: loginFadeUp 1s .8s forwards;
}
.gradient-text {
  background: linear-gradient(90deg, #2f8fd1, #7fe0c0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-hero-text {
  font-size: 14.5px; color: rgba(255,255,255,0.62); max-width: 540px; line-height: 1.6;
  margin: 0 0 26px;
  opacity: 0; animation: loginFadeUp 1s 1.1s forwards;
}

.login-error-box {
  background: rgba(253,236,234,0.95); border: 1px solid #f5c6c0; color: #a5372b;
  padding: 10px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 18px; max-width: 460px;
}

.btn-ingresar-hero {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  background: var(--primary-light); border: none; border-radius: 8px;
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .3px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(47,143,209,0.35);
  transition: all .25s;
  opacity: 0; animation: loginFadeUp 1s 1.4s forwards;
}
.btn-ingresar-hero:hover { background: var(--primary); box-shadow: 0 8px 22px rgba(18,58,99,0.4); text-decoration: none; }
.security-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #7fe0c0; display: inline-block; animation: loginDot 1.6s ease-in-out infinite; }

@media (max-width: 460px) {
  .login-hero-text { display: none; }
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.mobile-topbar { display: none; }
.mobile-menu-btn {
  display: none;
  background: none; border: none; color: #fff; font-size: 22px;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}
.mobile-nav-backdrop { display: none; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary), #0c2745);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 20px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.brand-mark { width: 44px; height: 44px; object-fit: contain; }
.brand-text { font-size: 14px; line-height: 1.2; }
.brand-text strong { display: block; font-size: 17px; }
.brand-module-badge {
  display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 999px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25);
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #bfe3ff;
}

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; flex: 1; }
.nav-link {
  color: #d8e6f5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-link:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,0.16); color: #fff; font-weight: 600; }
.nav-icon { font-size: 13px; opacity: 0.8; }
.nav-soon { margin-top: 10px; padding: 10px 12px; font-size: 12px; color: #7d9cc0; }

/* Segundo bloque de nav (enlace cruzado a otras apps) -- no debe heredar el
   flex:1/margin-top de .nav principal, que existe para empujar el footer. */
.nav-apps { flex: none; margin-top: 4px; }
.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700;
  color: rgba(255,255,255,0.4); margin: 14px 12px 4px;
}

.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: #9db8d6; text-transform: capitalize; }
.logout-link { font-size: 12.5px; color: #f3b0a7; }

.content { flex: 1; padding: 28px 34px; max-width: 100%; overflow-x: auto; }

.page-header { margin-bottom: 20px; }
.page-header h1 { margin: 0 0 4px; font-size: 22px; }
.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--primary-light); margin-bottom: 3px;
}

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.flash-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.flash-info { background: #eaf2fd; color: #1c5aa8; border: 1px solid #bcd7f5; }

/* ---------- Dashboard ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: 12px; padding: 18px 20px; border: 1px solid var(--border); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); margin: 6px 0 4px; }
.stat-value-sm { font-size: 20px; }
.stat-sub { font-size: 12px; color: var(--muted); }

.coverage-row { display: flex; gap: 6px; margin-top: 4px; }
.coverage-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok-text);
}

.panel-card { background: var(--card-bg); border-radius: 12px; padding: 20px; border: 1px solid var(--border); margin-bottom: 20px; }
.panel-card h2 { margin: 0 0 8px; font-size: 15px; }

/* ---------- Grafico de lineas (dashboard) ---------- */
.chart-card { padding: 20px 22px 16px; }
.chart-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.chart-header h2 { margin: 0; font-size: 15px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { font-size: 12.5px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.chart-wrap { position: relative; margin-top: 10px; }
.volumen-chart { width: 100%; height: 260px; display: block; }
.volumen-chart text { font-family: 'Segoe UI', Arial, sans-serif; }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0c2745;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  z-index: 2;
  min-width: 130px;
}
.chart-tooltip-title { font-weight: 700; margin-bottom: 4px; }
.chart-tooltip-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary-light);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0 0;
}
.link-btn:hover { text-decoration: underline; }

.btn {
  display: inline-block;
  margin-top: 10px;
  padding: 9px 16px;
  background: var(--primary);
  color: #fff !important;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.btn:hover { background: var(--primary-light); text-decoration: none; }

.btn-outline {
  background: #fff;
  color: var(--primary) !important;
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: #eef5fc; }

/* ---------- Filtros / tabla ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filters select, .filters input[type="text"] {
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.35;
  background: #fff;
}
.filters input[type="text"] { flex: 1; min-width: 220px; }

.dias-picker { position: relative; display: flex; }
.dias-picker-btn {
  box-sizing: border-box;
  height: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.35;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dias-picker-btn:hover { border-color: var(--primary-light); }

.dias-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(18,58,99,0.16);
  padding: 12px;
  width: 260px;
}
.dias-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dia-pill { position: relative; }
.dia-pill input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dia-pill span {
  display: flex; align-items: center; justify-content: center;
  height: 30px; border-radius: 6px;
  font-size: 12px; color: var(--text);
  background: #f4f7fa;
}
.dia-pill input:checked + span { background: var(--primary); color: #fff; font-weight: 600; }
.dia-pill input:hover + span { box-shadow: 0 0 0 2px rgba(47,143,209,0.25); }

.dias-picker-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.dias-picker-actions .btn { padding: 7px 14px; font-size: 12.5px; }

.table-wrap { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; overflow-x: auto; }
/* [2026-09-16, pedido de Jordan] Lineas punteadas en vez de solidas entre
   filas, y cada fila en una sola linea (sin wrap) -- antes una celda con
   texto largo hacia crecer la fila a varias lineas y las tablas se veian
   "despeinadas". Con white-space: nowrap + text-overflow: ellipsis, la
   celda se recorta con "..." y el ancho real se ve haciendo scroll
   horizontal (.table-wrap ya tiene overflow-x: auto) en vez de estirar la
   fila hacia abajo. */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; table-layout: auto; }
.data-table th {
  background: #f6f9fc;
  text-align: left;
  padding: 9px 12px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 1px dashed var(--border);
  border-right: 1px dashed var(--border);
  white-space: nowrap;
}
.data-table th:last-child { border-right: none; }
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px dashed var(--border);
  border-right: 1px dashed var(--border);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td:last-child { border-right: none; }
.data-table tr:hover td { background: #fafcfe; }
.empty-row { text-align: center; color: var(--muted); padding: 30px !important; white-space: normal; }

.pendientes-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pendiente-chip {
  display: inline-block; background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid rgba(154,106,18,0.25); border-radius: 6px;
  padding: 3px 8px; font-size: 11.5px; font-weight: 600;
}

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }

.dl-link { font-weight: 600; }

.pagination { display: flex; gap: 4px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.page-link {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
  color: #0f2f52;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.page-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.page-link.active {
  background: #0f2f52;
  color: #fff;
  border-color: #0f2f52;
  box-shadow: 0 2px 8px rgba(15, 47, 82, 0.18);
}
.page-link:hover:not(.active) {
  text-decoration: none;
  border-color: #1f6fb8;
  background: #f3f8fd;
  color: #0f2f52;
}
.page-link.page-nav {
  min-width: 36px;
  padding: 0;
  color: #1f6fb8;
  border-color: #c5dff7;
  background: #f0f7fc;
}
.page-link.page-nav:hover { background: #e3f0fa; border-color: #1f6fb8; }
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: var(--muted);
  font-weight: 700;
  user-select: none;
}

/* Multi-select compartido ControlNet */
details.cn-msel { position: relative; }
details.cn-msel > summary.cn-control,
details.cn-msel > summary.cd-control {
  list-style: none;
  cursor: pointer;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}
details.cn-msel > summary::-webkit-details-marker { display: none; }
details.cn-msel > summary.cn-control::after,
details.cn-msel > summary.cd-control::after {
  content: "▾";
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}
details.cn-msel[open] > summary.cn-control,
details.cn-msel[open] > summary.cd-control {
  border-color: #1f6fb8;
  box-shadow: 0 0 0 3px rgba(31, 111, 184, 0.15);
}
.cn-msel-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cn-msel-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 260px;
  width: max(100%, 260px);
  max-width: min(340px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #e3eaf2;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 47, 82, 0.16);
  overflow: hidden;
}
.cn-msel-panel.is-right { left: auto; right: 0; }
.cn-msel-search-wrap { padding: 10px 12px 0; }
.cn-msel-search {
  width: 100%;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid #e3eaf2;
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}
.cn-msel-search:focus {
  outline: none;
  border-color: #1f6fb8;
  box-shadow: 0 0 0 3px rgba(31, 111, 184, 0.15);
}
.cn-msel-all {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f8fc;
  font-size: 13px;
  font-weight: 600;
  color: #0f2f52;
  cursor: pointer;
}
.cn-msel-all input,
.cn-msel-item input {
  width: 16px;
  height: 16px;
  accent-color: #0f2f52;
  flex-shrink: 0;
}
.cn-msel-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #6b7c93;
  font-variant-numeric: tabular-nums;
}
.cn-msel-list {
  max-height: 220px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 4px 8px 8px;
}
.cn-msel-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #0f2f52;
  font-weight: 500;
}
.cn-msel-item:hover { background: #f0f5fb; }
.cn-msel-item[hidden] { display: none !important; }
.cn-msel-item-label {
  min-width: 0;
  word-break: break-word;
  line-height: 1.35;
}
.cn-msel-empty {
  padding: 18px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.cn-msel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 12px;
  border-top: 1px solid #e3eaf2;
  background: #fafcfe;
}
.cn-msel-clear,
.cn-msel-ok {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #e3eaf2;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #0f2f52;
}
.cn-msel-clear:hover { background: #f5f8fc; }
.cn-msel-ok {
  background: #0f2f52;
  color: #fff;
  border-color: #0f2f52;
}
.cn-msel-ok:hover { background: #163a63; color: #fff; }

.cn-btn-excel {
  background: #1e6b42 !important;
  color: #fff !important;
  border-color: #1e6b42 !important;
  gap: 8px;
}
.cn-btn-excel:hover { background: #1a5c38 !important; color: #fff !important; text-decoration: none; }
.cn-btn-excel svg { flex-shrink: 0; }

/* Acciones de filtro siempre en fila propia → evita juntar input + Filtrar */
.cn-filtros > .cn-acciones,
.cd-filtros > .cd-acciones {
  grid-column: 1 / -1;
  gap: 10px;
  padding-top: 2px;
}

/* ---------- Distributor Backup ---------- */
.distrib-categoria { margin-bottom: 26px; }
.distrib-categoria-titulo { font-size: 14px; margin: 0 0 10px; color: var(--primary); }
.distrib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.distrib-card {
  display: block; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; color: var(--text) !important;
}
.distrib-card:hover { border-color: var(--primary-light); text-decoration: none; box-shadow: 0 6px 16px rgba(18,58,99,0.08); }
.distrib-card-nombre { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.distrib-card-nota { font-size: 11px; color: var(--warn-text); margin-top: 6px; }

.distrib-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.distrib-tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--text) !important; font-size: 13px;
}
.distrib-tab:hover { text-decoration: none; border-color: var(--primary-light); }
.distrib-tab.active { background: var(--primary); border-color: var(--primary); color: #fff !important; font-weight: 600; }

.distrib-export { display: flex; gap: 10px; margin-top: 14px; }

.filters input[type="date"] {
  box-sizing: border-box; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 13.5px; background: #fff;
}
.filters label.muted-inline { display: flex; flex-direction: column; gap: 4px; font-size: 11px; }

/* [2026-09-16, pedido de Jordan] Buscador de reportes en la pantalla de
   catalogo -- filtra las tarjetas en el navegador (sin recargar la pagina)
   y oculta la barra de categorias mientras se busca. */
.distrib-buscador-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.distrib-buscador {
  flex: 1; max-width: 420px; box-sizing: border-box; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 999px; font-family: inherit;
  font-size: 13.5px; background: #fff;
}
.distrib-buscador:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(47,143,209,0.15); }

/* Chips de acceso rapido a cada categoria (salta con #ancla, sin JS de scroll). */
.distrib-categorias-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.distrib-categoria-chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--primary) !important; font-size: 12.5px; font-weight: 600;
}
.distrib-categoria-chip:hover { background: #eef5fc; text-decoration: none; border-color: var(--primary-light); }

/* [2026-09-16, pedido de Jordan] El bloque de filtro de fecha dentro de cada
   reporte pasa de un <form> "suelto" a una tarjeta con su propio fondo,
   borde e icono, para que se note que es un bloque de accion aparte de la
   tabla -- mismo patron visual que .table-wrap / .stat-card del resto del
   panel. Los "Desde"/"Hasta" y el boton "Filtrar" quedan alineados al pie,
   en vez de flotar sueltos arriba de la tabla. */
.distrib-filtros {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 18px;
}
.distrib-filtros-campo { display: flex; flex-direction: column; gap: 5px; }
.distrib-filtros-campo label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted);
}
.distrib-filtros-campo input[type="date"] {
  box-sizing: border-box; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 13.5px; background: #fff; min-width: 150px;
}
.distrib-filtros-acciones { display: flex; gap: 8px; }
.distrib-filtros-sinfecha {
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px;
}

@media (max-width: 780px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 500;
    background: linear-gradient(180deg, var(--primary), #0c2745);
    color: #fff; padding: 10px 14px;
  }
  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
  .mobile-topbar-logo { width: 26px; height: 26px; object-fit: contain; }

  .mobile-nav-backdrop.show {
    display: block; position: fixed; inset: 0;
    background: rgba(7, 26, 47, 0.5);
    z-index: 900;
  }

  .app-shell { display: block; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 250px; max-width: 82vw;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 950;
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.35);
  }

  .brand { border-bottom: 1px solid rgba(255,255,255,0.15); padding: 0 4px 20px; }
  .nav { flex-direction: column; margin-top: 18px; }
  .nav-apps { flex-direction: column; }
  .nav-soon { display: block; }
  .sidebar-footer { display: block; }

  .content { padding: 18px; }
}

/* AutoFilter — tablas ControlNet (cn-tabla.js) */
.cn-banner-parcial {
  background: #fdf3de;
  border: 1px solid #e8c96a;
  color: #7a5a10;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.45;
}
.cn-banner-sv {
  padding: 0;
  overflow: hidden;
}
.cn-banner-sv > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
.cn-banner-sv > summary::-webkit-details-marker {
  display: none;
}
.cn-banner-sv .cn-banner-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(166, 108, 5, 0.12);
  color: #a66c05;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.cn-banner-sv .cn-banner-sum {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cn-banner-sv .cn-banner-sum strong {
  font-size: 13px;
  font-weight: 800;
  color: #6b4a0a;
}
.cn-banner-sv .cn-banner-sum span {
  font-size: 11.5px;
  color: #8a6a28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cn-banner-sv .cn-banner-chev {
  color: #a66c05;
  font-size: 12px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.cn-banner-sv[open] .cn-banner-chev {
  transform: rotate(180deg);
}
.cn-banner-sv .cn-banner-detalle {
  margin: 0;
  padding: 0 14px 12px 50px;
  font-size: 12px;
  line-height: 1.45;
  color: #7a5a10;
}
.cn-banner-sv .cn-banner-detalle li {
  margin: 0 0 4px;
}
.cn-t thead th.cn-filterable,
.cd-t thead th.cn-filterable {
  padding-right: 26px;
}
.cn-filter-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cn-filter-ico {
  display: block;
  width: 10px;
  height: 10px;
  background: currentColor;
  opacity: 0.95;
  clip-path: polygon(0 0, 100% 0, 58% 55%, 58% 100%, 42% 100%, 42% 55%);
}
.cn-filter-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,.16);
}
.cn-filter-on .cn-filter-btn {
  opacity: 1;
  background: #3d8fd4;
}
.cn-filter-menu {
  position: fixed;
  z-index: 10000;
  background: #fff;
  color: #1a2332;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15,47,82,.22), 0 2px 6px rgba(15,47,82,.08);
  padding: 0;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  font-size: 13px;
  box-sizing: border-box;
  overflow: hidden;
  font-family: inherit;
}
.cn-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid #eef1f4;
  background: #f8fafc;
}
.cn-filter-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f2f52;
  letter-spacing: 0.02em;
}
.cn-filter-x {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #5b6b7c;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.cn-filter-x:hover { background: #eef1f4; color: #0f2f52; }
.cn-filter-sort {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 12px 0;
}
.cn-filter-sort-btn {
  height: 34px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
  color: #0f2f52;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cn-filter-sort-btn:hover {
  background: #f0f5fb;
  border-color: #1f6fb8;
  color: #1f6fb8;
}
.cn-filter-search-wrap { padding: 10px 12px 0; }
.cn-filter-search {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  color: #1a2332;
  background: #fff;
  outline: none;
}
.cn-filter-search:focus {
  border-color: #1f6fb8;
  box-shadow: 0 0 0 3px rgba(31,111,184,.15);
}
.cn-filter-all {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f8fc;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f2f52;
}
.cn-filter-all input,
.cn-filter-item input {
  width: 15px;
  height: 15px;
  accent-color: #0f2f52;
  flex-shrink: 0;
  cursor: pointer;
}
.cn-filter-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #5b6b7c;
  background: #fff;
  border: 1px solid #e3eaf2;
  border-radius: 999px;
  padding: 1px 8px;
}
.cn-filter-list {
  max-height: 220px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 4px 8px 8px;
}
.cn-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  color: #1a2332;
  font-weight: 500;
}
.cn-filter-item:hover { background: #f0f5fb; }
.cn-filter-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cn-filter-empty {
  padding: 18px 10px;
  text-align: center;
  color: #5b6b7c;
  font-size: 12.5px;
}
.cn-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #eef1f4;
  background: #fafbfc;
}
.cn-filter-apply,
.cn-filter-clear {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #d7e0ea;
  background: #fff;
  color: #0f2f52;
}
.cn-filter-clear:hover { background: #f5f8fc; }
.cn-filter-apply {
  background: #0f2f52;
  border-color: #0f2f52;
  color: #fff;
}
.cn-filter-apply:hover { background: #163a63; }

/* ==========================================================================
   REPORTES CONTROLNET — INTERFAZ MÓVIL NATIVA (is-cn-mobile-app)
   ========================================================================== */

/* Elementos exclusivos de móvil ocultos en escritorio */
.cn-bottom-nav,
.cn-reports-sheet,
.cn-sheet-backdrop,
.cn-mobile-filter-bar,
.cn-fullscreen-btn,
.cn-auto-tabla-head {
  display: none;
}

/* Catálogo de reportes mejorado (escritorio + móvil) */
.cn-catalog-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 16px !important;
  border-radius: 14px !important;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cn-catalog-ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #eef6ff 0%, #e3effc 100%);
  border: 1px solid #d4e4f7;
  color: #1f6fb8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cn-catalog-ico svg {
  width: 20px;
  height: 20px;
}
.cn-catalog-body {
  flex: 1;
  min-width: 0;
}
.cn-catalog-card .distrib-card-nombre {
  margin-bottom: 0;
  font-size: 14px;
  color: #0f2f52;
}
.cn-catalog-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a8be;
  flex-shrink: 0;
}

/* Soporte táctil en gráfico de barras de Corte Diario */
.cd-barra.cd-barra-active .cd-tip {
  display: block !important;
}

@media (max-width: 780px) {
  body.is-cn-mobile-app {
    -webkit-tap-highlight-color: transparent;
    background: #eef3f9;
    overscroll-behavior-y: none;
  }

  body.is-cn-mobile-app.cn-has-fullscreen {
    overflow: hidden;
  }

  /* ---- 1. App Bar Superior Contextual ---- */
  body.is-cn-mobile-app .mobile-topbar.cn-appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 800;
    min-height: 54px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    background: linear-gradient(180deg, #0f2f52 0%, #0b233e 100%);
    box-shadow: 0 2px 12px rgba(7, 26, 47, 0.22);
  }
  .cn-appbar-back,
  .cn-appbar-action {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    text-decoration: none !important;
    transition: transform 0.12s ease, background 0.15s ease;
  }
  .cn-appbar-back:active,
  .cn-appbar-action:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.22);
  }
  .cn-appbar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .cn-appbar-title-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .cn-appbar-subtitle {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #7fe0c0;
    line-height: 1.1;
  }
  .cn-appbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
  }

  /* Barra de carga superior tipo app nativa */
  @keyframes cnTopProgress {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
  }
  .cn-top-loader {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
  }
  .cn-top-loader.loading {
    background: rgba(127, 224, 192, 0.22);
  }
  .cn-top-loader.loading::after {
    content: "";
    display: block;
    width: 65%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #7fe0c0, #4fb3f0, transparent);
    animation: cnTopProgress 1.1s infinite ease-in-out;
  }

  /* ---- 2. Contenedor Principal y Bottom Tab Bar ---- */
  body.is-cn-mobile-app .content {
    padding: 12px 12px calc(82px + env(safe-area-inset-bottom, 0px));
  }

  body.is-cn-mobile-app .cn-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 850;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #d7e2ee;
    box-shadow: 0 -4px 20px rgba(15, 47, 82, 0.08);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .cn-bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    border: none;
    background: none;
    color: #64778d !important;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: color 0.15s ease, transform 0.12s ease, background 0.15s ease;
  }
  .cn-bnav-item:active {
    transform: scale(0.92);
    background: #f0f6fc;
  }
  .cn-bnav-item.active {
    color: #0f2f52 !important;
    font-weight: 700;
  }
  .cn-bnav-item.active svg {
    stroke: #1f6fb8;
    stroke-width: 2.3;
  }

  /* ---- 3. Bottom Sheet Selector Rápido de Reportes ---- */
  body.is-cn-mobile-app .cn-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 26, 47, 0.52);
    z-index: 980;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  body.is-cn-mobile-app .cn-sheet-backdrop.show {
    opacity: 1;
  }
  body.is-cn-mobile-app .cn-sheet-backdrop[hidden] {
    display: none !important;
  }
  body.is-cn-mobile-app .cn-reports-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 990;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 36px rgba(7, 26, 47, 0.28);
    max-height: 82dvh;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    transform: translateY(100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.is-cn-mobile-app .cn-reports-sheet.open {
    transform: translateY(0);
  }
  body.is-cn-mobile-app .cn-reports-sheet[hidden] {
    display: none !important;
  }
  .cn-sheet-pill {
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: #cbd5e1;
    margin: 10px auto 4px;
    flex-shrink: 0;
  }
  .cn-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px 12px;
    border-bottom: 1px solid #eef2f7;
  }
  .cn-sheet-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f2f52;
  }
  .cn-sheet-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #475569;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .cn-sheet-list {
    overflow-y: auto;
    padding: 8px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .cn-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #1e293b !important;
    text-decoration: none !important;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .cn-sheet-item:active {
    background: #eff6ff;
    transform: scale(0.98);
  }
  .cn-sheet-item.active {
    background: #f0f7ff;
    border: 1px solid #cbe0f8;
  }
  .cn-sheet-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef6ff;
    color: #1f6fb8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .cn-sheet-ico svg {
    width: 18px;
    height: 18px;
  }
  .cn-sheet-txt {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .cn-sheet-txt strong {
    font-size: 13.5px;
    color: #0f2f52;
  }
  .cn-sheet-check {
    color: #1f6fb8;
    font-size: 14px;
    font-weight: 700;
  }

  /* ---- 4. Catálogo Móvil Nativo (reportes_controlnet.html) ---- */
  body.is-cn-mobile-app .cn-catalog-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body.is-cn-mobile-app .cn-catalog-card:active {
    transform: scale(0.98);
    background: #f5f9ff;
  }

  /* ---- 5. Cabeceras Compactas de Reporte (.cn-head / .cd-head) ---- */
  body.is-cn-mobile-app .cn-eyebrow,
  body.is-cn-mobile-app .cd-eyebrow {
    display: none;
  }
  body.is-cn-mobile-app .cn-head,
  body.is-cn-mobile-app .cd-head {
    gap: 8px;
    margin-bottom: 12px;
  }
  body.is-cn-mobile-app .cn-head h1,
  body.is-cn-mobile-app .cd-head h1,
  body.is-cn-mobile-app .page-header h1 {
    font-size: 19px;
    line-height: 1.25;
    margin: 0 0 4px;
  }
  body.is-cn-mobile-app .cn-sub,
  body.is-cn-mobile-app .cd-sub {
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body.is-cn-mobile-app .cn-stamp,
  body.is-cn-mobile-app .cd-stamp {
    font-size: 11px;
    padding: 4px 10px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* ---- 6. Barra de Filtros Colapsable y Formulario Táctil ---- */
  body.is-cn-mobile-app .cn-mobile-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }
  .cn-mobile-filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border: 1px solid #d7e2ee;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 6px rgba(15, 47, 82, 0.05);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: #0f2f52;
    touch-action: manipulation;
  }
  .cn-mobile-filter-toggle:active {
    transform: scale(0.99);
    background: #f8fbff;
  }
  .cn-mft-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .cn-mft-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #eef5fc;
    color: #1f6fb8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .cn-mft-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .cn-mft-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7c93;
  }
  .cn-mft-summary {
    font-size: 13px;
    font-weight: 700;
    color: #0f2f52;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cn-mft-action {
    font-size: 12px;
    font-weight: 700;
    color: #1f6fb8;
    background: #eef5fc;
    padding: 5px 10px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .cn-mobile-quick-search {
    width: 100%;
  }
  .cn-mobile-quick-input {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    border: 1px solid #d7e2ee;
    border-radius: 11px;
    background: #fff;
    padding: 0 14px;
    font: inherit;
    font-size: 16px; /* Evita auto-zoom en iOS */
    color: #1f2d3d;
    box-shadow: 0 1px 3px rgba(15, 47, 82, 0.04);
    outline: none;
  }
  .cn-mobile-quick-input:focus {
    border-color: #1f6fb8;
    box-shadow: 0 0 0 3px rgba(31, 111, 184, 0.15);
  }

  body.is-cn-mobile-app .cn-filtros.cn-filtros-collapsed,
  body.is-cn-mobile-app .cd-filtros.cn-filtros-collapsed {
    display: none !important;
  }

  body.is-cn-mobile-app .cn-filtros,
  body.is-cn-mobile-app .cd-filtros {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 14px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
  }
  body.is-cn-mobile-app .cn-campo,
  body.is-cn-mobile-app .cd-campo {
    min-width: 0 !important;
  }
  /* Los campos de búsqueda o selectores largos ocupan las 2 columnas */
  body.is-cn-mobile-app .cn-campo:has([data-cn-search]),
  body.is-cn-mobile-app .cn-campo:has(#gbBuscar),
  body.is-cn-mobile-app .cn-campo-buscar,
  body.is-cn-mobile-app .cn-acciones,
  body.is-cn-mobile-app .cd-acciones {
    grid-column: 1 / -1 !important;
  }
  body.is-cn-mobile-app .cn-control,
  body.is-cn-mobile-app .cd-control {
    height: 44px !important;
    font-size: 16px !important; /* Evita zoom en iOS Safari */
    border-radius: 10px !important;
  }
  body.is-cn-mobile-app .cn-acciones,
  body.is-cn-mobile-app .cd-acciones {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 2px;
  }
  body.is-cn-mobile-app .cn-btn,
  body.is-cn-mobile-app .cd-btn {
    height: 42px !important;
    flex: 1 1 auto;
    justify-content: center;
    font-size: 13.5px !important;
    border-radius: 10px !important;
  }
  body.is-cn-mobile-app .cd-opciones label {
    min-height: 40px;
    font-size: 14px;
  }

  /* ---- 7. KPIs Adaptados y Carruseles Táctiles ---- */
  /* Stock por Zonal: 6 KPIs en grilla 2x3 limpia sin desbordar */
  body.is-cn-mobile-app .cn-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }
  body.is-cn-mobile-app .cn-kpi {
    padding: 12px 14px !important;
  }
  body.is-cn-mobile-app .cn-kpi .val {
    font-size: 18px !important;
  }

  /* Márgenes y Corte Diario: Carrusel horizontal nativo (scroll-snap) */
  body.is-cn-mobile-app .cn-kpis-margen,
  body.is-cn-mobile-app .cd-kpis {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px !important;
    padding-bottom: 6px;
    margin-bottom: 14px !important;
  }
  body.is-cn-mobile-app .cn-kpi-bloque,
  body.is-cn-mobile-app .cd-kpi {
    flex: 0 0 80%;
    max-width: 270px;
    scroll-snap-align: start;
    padding: 14px 16px !important;
  }
  body.is-cn-mobile-app .cn-kpi-bloque .margen,
  body.is-cn-mobile-app .cd-kpi-val {
    font-size: 22px !important;
  }

  /* ---- 8. Tablas Matriciales, Columnas Sticky y Pantalla Completa ---- */
  body.is-cn-mobile-app .cn-seccion-titulo {
    display: none; /* El título ya se integra en la cabecera de la tarjeta */
  }
  body.is-cn-mobile-app .cn-auto-tabla-head {
    display: flex !important;
  }
  body.is-cn-mobile-app .cn-tabla-head,
  body.is-cn-mobile-app .cd-tabla-head {
    padding: 12px 14px !important;
    gap: 8px !important;
  }
  body.is-cn-mobile-app .cn-tabla-head h3,
  body.is-cn-mobile-app .cd-tabla-head h3 {
    font-size: 14px !important;
  }
  body.is-cn-mobile-app .cn-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #d0ddeb;
    background: #f4f8fc;
    color: #0f2f52;
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
  }
  body.is-cn-mobile-app .cn-fullscreen-btn:active {
    background: #e2eefb;
    transform: scale(0.95);
  }

  /* Modo Pantalla Completa para cualquier tabla de reporte */
  body.is-cn-mobile-app .cn-card-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 960 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    background: #fff !important;
  }
  body.is-cn-mobile-app .cn-card-fullscreen .cn-tabla-head,
  body.is-cn-mobile-app .cn-card-fullscreen .cd-tabla-head {
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    background: #0f2f52 !important;
    color: #fff !important;
  }
  body.is-cn-mobile-app .cn-card-fullscreen .cn-tabla-head h3,
  body.is-cn-mobile-app .cn-card-fullscreen .cd-tabla-head h3,
  body.is-cn-mobile-app .cn-card-fullscreen .cn-tabla-head .resumen,
  body.is-cn-mobile-app .cn-card-fullscreen .cn-tabla-acciones .muted {
    color: #fff !important;
  }
  body.is-cn-mobile-app .cn-card-fullscreen .cn-scroll,
  body.is-cn-mobile-app .cn-card-fullscreen .cd-scroll {
    flex: 1 !important;
    max-height: none !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body.is-cn-mobile-app .cn-scroll,
  body.is-cn-mobile-app .cd-scroll {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* Primera columna fija en todas las tablas .cn-t en móvil */
  body.is-cn-mobile-app .cn-t th.zonal-col,
  body.is-cn-mobile-app .cn-t td.zonal-col,
  body.is-cn-mobile-app .cn-t th.pv-col:first-child,
  body.is-cn-mobile-app .cn-t td.pv-col:first-child,
  body.is-cn-mobile-app .cn-t th.empresa-col:first-child,
  body.is-cn-mobile-app .cn-t td.empresa-col:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 2px 0 6px rgba(15, 47, 82, 0.06);
  }
  body.is-cn-mobile-app .cn-t thead th.zonal-col,
  body.is-cn-mobile-app .cn-t thead th.pv-col:first-child,
  body.is-cn-mobile-app .cn-t thead th.empresa-col:first-child {
    z-index: 4;
  }

  /* Compactar doble columna sticky en Conciliación y Ventas Vendedor x Día */
  body.is-cn-mobile-app .cn-t th.zonal-col,
  body.is-cn-mobile-app .cn-t td.zonal-col {
    min-width: 78px !important;
    max-width: 110px;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  body.is-cn-mobile-app .cn-t th.concepto-col,
  body.is-cn-mobile-app .cn-t td.concepto-col,
  body.is-cn-mobile-app .cn-t th.vend-col,
  body.is-cn-mobile-app .cn-t td.vend-col {
    left: 78px !important;
    min-width: 112px !important;
    max-width: 135px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 2px 0 6px rgba(15, 47, 82, 0.07);
  }
  body.is-cn-mobile-app .cd-t th:first-child,
  body.is-cn-mobile-app .cd-t td:first-child {
    min-width: 105px !important;
    max-width: 125px;
    box-shadow: 2px 0 6px rgba(15, 47, 82, 0.07);
  }

  /* Botón de filtro de columna más fácil de tocar en móvil */
  body.is-cn-mobile-app .cn-filter-btn {
    width: 24px;
    height: 24px;
  }

  /* ---- 9. AutoFilter de Columnas como Bottom Sheet Nativo ---- */
  .cn-filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 26, 47, 0.52);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .cn-filter-backdrop.show {
    opacity: 1;
  }
  .cn-filter-backdrop[hidden] {
    display: none !important;
  }

  .cn-filter-menu.cn-filter-mobile-sheet {
    border-radius: 20px 20px 0 0 !important;
    border: none !important;
    box-shadow: 0 -10px 36px rgba(7, 26, 47, 0.3) !important;
    max-height: 82dvh !important;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: env(safe-area-inset-bottom, 8px) !important;
    transform: translateY(100%);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .cn-filter-menu.cn-filter-mobile-sheet.cn-sheet-open {
    transform: translateY(0);
  }
  .cn-filter-menu.cn-filter-mobile-sheet[hidden] {
    display: none !important;
  }
  .cn-filter-menu.cn-filter-mobile-sheet::before {
    content: "";
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: #cbd5e1;
    margin: 10px auto 2px;
    flex-shrink: 0;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-head {
    padding: 8px 16px 10px;
    background: #fff;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-title {
    font-size: 14px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-sort {
    padding: 10px 16px 0;
    gap: 8px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-sort-btn {
    height: 40px;
    font-size: 13px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-search-wrap {
    padding: 10px 16px 0;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-search {
    height: 42px;
    font-size: 16px;
    border-radius: 10px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-all {
    margin: 10px 16px 0;
    padding: 10px 12px;
    font-size: 13.5px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-list {
    flex: 1;
    max-height: 42dvh;
    padding: 6px 12px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-item {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13.5px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-all input,
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-item input {
    width: 18px;
    height: 18px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-actions {
    padding: 12px 16px;
    gap: 10px;
  }
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-apply,
  .cn-filter-menu.cn-filter-mobile-sheet .cn-filter-clear {
    flex: 1;
    height: 42px;
    font-size: 14px;
    border-radius: 10px;
  }
}

/* ==========================================================================
   STOCK Y VENTAS — ANÁLISIS COMERCIAL Y LOGÍSTICO (KPIs, ALERTAS, LENTES, 360°)
   ========================================================================== */

.cn-th-mob,
.cn-mob-prod,
.cn-mob-hint,
.cn-sku-backdrop,
.cn-sku-sheet,
.cn-lens-seg,
.cn-zonal-cards {
  display: none;
}

/* Tarjetas de producto (móvil / lentes focalizados) */
.cn-sku-card {
  background: #fff;
  border: 1px solid #e3eaf2;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(15, 47, 82, 0.05);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.cn-sku-card:active {
  transform: scale(0.985);
  background: #f5f9ff;
  border-color: #c5d8ef;
}
.cn-sku-card-warn {
  border-color: #f3c6c3;
  background: linear-gradient(180deg, #fffafa 0%, #ffffff 100%);
}
.cn-sku-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cn-sku-card-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cn-sku-card-title strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f2f52;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}
.cn-sku-card-meta {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: #64778d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cn-sku-card-sub {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.cn-sku-card-cod {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.cn-pill-short { display: none; }
.cn-sku-card-metrics {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cn-sku-card-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e3eaf2;
  font-size: 11px;
  font-weight: 700;
  color: #1f6fb8;
  text-align: center;
}
.cn-sku-card-range {
  font-size: 12px !important;
}
.cn-ley-short {
  display: none;
}
.cn-sv-filters-label {
  display: none;
}
/* No usar display:contents: en Chromium deja cajas fantasma que inflan el scroll del documento. */
.cn-lens-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cn-sort-field {
  display: none;
  position: relative;
}
.cn-sku-card-metric {
  background: #f8fafd;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cn-sku-card-metric span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #64778d;
}
.cn-sku-card-metric strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f2f52;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.cn-sku-card-metric strong.cn-bajo-costo {
  color: #b23b33;
}
.cn-sku-card-metric-risk {
  border-color: #f3c6c3;
  background: #fffafa;
}
.cn-sku-card-pill-wrap {
  display: flex;
  align-items: center;
}
.cn-sku-card-pill-wrap .cn-pill {
  min-width: 0;
  font-size: 10px;
  padding: 2px 8px;
}

/* 1. Resumen Ejecutivo Superior (Total General KPIs) */
.cn-sv-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.cn-sv-kpi {
  background: #fff;
  border: 1px solid #e3eaf2;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 2px rgba(15, 47, 82, 0.04);
}
.cn-sv-kpi-warn {
  border-color: #f3c6c3;
  background: linear-gradient(180deg, #fffafa 0%, #ffffff 100%);
}
.cn-sv-kpi-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64778d;
}
.cn-sv-kpi-val {
  font-size: 19px;
  font-weight: 800;
  color: #0f2f52;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.cn-sv-kpi-val small {
  font-size: 12px;
  font-weight: 600;
  color: #64778d;
}
.cn-val-teal {
  color: #0b7a54 !important;
}
/* Selección de fila estilo Gran Base / Excel: banda continua + barra izquierda.
   Único fuente de verdad para todas las tablas .cn-t (no redefinir en templates). */
.cn-t tbody tr.fila-dato {
  cursor: cell;
}
.cn-t tbody tr.cn-fila-seleccionada td {
  background: #cfe2f3 !important;
  box-shadow: none !important;
  outline: none !important;
}
.cn-t tbody tr.cn-fila-seleccionada td:first-child {
  box-shadow: inset 3px 0 0 #1f6fb8 !important;
}
.cn-t tbody tr.cn-fila-seleccionada td.cn-bajo-costo {
  background: #f8d4d1 !important;
}
.cn-t tbody tr.cn-fila-seleccionada:hover td {
  background: #b8d4ef !important;
}
.cn-t tbody tr.cn-fila-seleccionada:hover td.cn-bajo-costo {
  background: #f8d4d1 !important;
}
/* Misma selección en tablas de Corte (.cd-t) */
.cd-t tbody tr.fila-dato {
  cursor: cell;
}
.cd-t tbody tr.cn-fila-seleccionada td {
  background: #cfe2f3 !important;
  box-shadow: none !important;
  outline: none !important;
}
.cd-t tbody tr.cn-fila-seleccionada td:first-child {
  box-shadow: inset 3px 0 0 #1f6fb8 !important;
}
.cd-t tbody tr.cn-fila-seleccionada:hover td {
  background: #b8d4ef !important;
}

.cn-val-rose {
  color: #b23b33 !important;
}
.cn-sv-kpi-sub {
  font-size: 11.5px;
  color: #6b7c93;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 2. Barra de Chips de Alerta Comercial / Logística y Controles */
.cn-sv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cn-alert-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cn-alert-chip {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d7e2ee;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 47, 82, 0.03);
}
.cn-alert-chip:hover {
  border-color: #94b8d7;
  background: #f8fbff;
}
.cn-alert-chip.is-active {
  background: #0f2f52;
  border-color: #0f2f52;
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 47, 82, 0.2);
}
.cn-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cn-chip-risk .cn-chip-dot { background: #e11d48; }
.cn-chip-danger .cn-chip-dot { background: #b23b33; box-shadow: 0 0 0 2px #fdeceb; }
.cn-chip-warn .cn-chip-dot { background: #d97706; }
.cn-chip-neutral .cn-chip-dot { background: #64748b; }

.cn-chip-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-variant-numeric: tabular-nums;
}
.cn-alert-chip.is-active .cn-chip-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.cn-lens-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cn-zonal-collapse-all {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid #d7e2ee;
  background: #fff;
  color: #0f2f52;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.cn-zonal-collapse-all:hover {
  background: #f4f8fc;
}

/* 3. Acordeón de Tarjetas por Zonal */
.cn-tabla-head[data-zonal-toggle] {
  cursor: pointer;
  user-select: none;
}
.cn-th-zonal-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.cn-zonal-chevron {
  display: inline-flex;
  align-items: center;
  color: #64778d;
  transition: transform 0.2s ease;
}
.cn-tabla-card.is-collapsed .cn-zonal-chevron {
  transform: rotate(-90deg);
}
.cn-tabla-card.is-collapsed .cn-scroll,
.cn-tabla-card.is-collapsed .cn-zonal-cards {
  display: none !important;
}

/* 4. Vista Móvil Analítica (<= 780px) */
@media (max-width: 780px) {
  body.is-cn-mobile-app .cn-sv-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  body.is-cn-mobile-app .cn-sv-kpi {
    padding: 10px 12px;
  }
  body.is-cn-mobile-app .cn-sv-kpi-val {
    font-size: 16.5px;
  }

  /* Toolbar móvil: filtros + lentes en columna */
  body.is-cn-mobile-app .cn-sv-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  body.is-cn-mobile-app .cn-sv-filters-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }
  body.is-cn-mobile-app .cn-sv-filters-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #64778d;
  }
  body.is-cn-mobile-app .cn-alert-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin: 0;
  }
  body.is-cn-mobile-app .cn-alert-chip {
    height: 34px;
    flex-shrink: 0;
  }

  /* Lentes: grilla 2×2 + fila de acciones (siempre cabe) */
  body.is-cn-mobile-app .cn-lens-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  body.is-cn-mobile-app .cn-lens-seg {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    background: #dbe6f2;
    padding: 3px;
    border-radius: 11px;
    gap: 3px;
    overflow: visible;
  }
  body.is-cn-mobile-app .cn-lens-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }
  body.is-cn-mobile-app .cn-sort-field {
    display: block;
    min-width: 0;
  }
  body.is-cn-mobile-app .cn-sort-select {
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    border: 1px solid #d7e2ee;
    border-radius: 9px;
    background: #fff;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #0f2f52;
  }
  .cn-lens-btn {
    height: 38px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #334e68;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    min-width: 0;
    width: 100%;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
  }
  .cn-lens-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cn-lens-btn svg {
    flex-shrink: 0;
  }
  .cn-lens-btn.is-active {
    background: #fff;
    color: #0f2f52;
    box-shadow: 0 1px 4px rgba(15, 47, 82, 0.14);
  }

  body.is-cn-mobile-app .cn-zonal-collapse-all {
    justify-content: center;
    height: 36px;
    flex-shrink: 0;
  }

  body.is-cn-mobile-app .cn-leyenda {
    gap: 8px 12px;
    font-size: 11px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e3eaf2;
    border-radius: 10px;
  }
  body.is-cn-mobile-app .cn-leyenda .cn-leyenda-desk {
    display: none !important;
  }
  body.is-cn-mobile-app .cn-leyenda .cn-ley-full {
    display: none;
  }
  body.is-cn-mobile-app .cn-leyenda .cn-ley-short {
    display: inline;
  }
  body.is-cn-mobile-app .cn-mob-hint {
    display: inline-block;
    width: 100%;
    font-weight: 600;
    color: #1f6fb8;
    margin-top: 2px;
    font-size: 11px;
  }
  body.is-cn-mobile-app .cn-banner-sv .cn-banner-sum span {
    white-space: normal;
  }

  .cn-mp-modelo {
    font-size: 12px;
    font-weight: 800;
    color: #0f2f52;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .cn-mp-alert-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b23b33;
    flex-shrink: 0;
  }
  .cn-mp-meta {
    font-size: 10.5px;
    font-weight: 500;
    color: #64778d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Lentes focalizados: tarjetas en lugar de tabla */
  body.is-cn-mobile-app .cn-wrap:not([data-cn-lens="todas"]) [data-zonal-card] > .cn-scroll {
    display: none !important;
  }
  body.is-cn-mobile-app .cn-wrap:not([data-cn-lens="todas"]) [data-zonal-card]:not(.is-collapsed) > .cn-zonal-cards {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px 10px;
  }
  body.is-cn-mobile-app .cn-sku-card {
    padding: 8px 10px;
    border-radius: 10px;
    content-visibility: auto;
    contain-intrinsic-size: auto 72px;
  }
  body.is-cn-mobile-app .cn-sku-card-head {
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
  }
  body.is-cn-mobile-app .cn-sku-card-title strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.is-cn-mobile-app .cn-sku-card .cn-mp-alert-dot {
    display: inline-block;
    margin-right: 4px;
    vertical-align: 1px;
  }
  body.is-cn-mobile-app .cn-sku-card .cn-pill {
    min-width: 0;
    padding: 2px 6px;
    font-size: 9px;
    line-height: 1.2;
    flex-shrink: 0;
    white-space: nowrap;
  }
  body.is-cn-mobile-app .cn-sku-card .cn-pill-full { display: none; }
  body.is-cn-mobile-app .cn-sku-card .cn-pill-short { display: inline; }
  body.is-cn-mobile-app .cn-sku-card-foot { display: none; }
  body.is-cn-mobile-app .cn-wrap:not([data-cn-lens="todas"]) .cn-fullscreen-btn {
    display: none !important;
  }
  body.is-cn-mobile-app .cn-wrap:not([data-cn-lens="todas"]) .cn-sv-total-general {
    display: none !important;
  }

  /* Resumen de una línea: tres cifras del lente activo */
  body.is-cn-mobile-app .cn-wrap[data-cn-lens="ejecutivo"] [data-lens-metrics="ejecutivo"],
  body.is-cn-mobile-app .cn-wrap[data-cn-lens="comercial"] [data-lens-metrics="comercial"],
  body.is-cn-mobile-app .cn-wrap[data-cn-lens="logistico"] [data-lens-metrics="logistico"] {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0;
  }
  body.is-cn-mobile-app .cn-sku-card-metric {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
  body.is-cn-mobile-app .cn-sku-card-metric + .cn-sku-card-metric {
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #e3eaf2;
  }
  body.is-cn-mobile-app .cn-sku-card-metric span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
  }
  body.is-cn-mobile-app .cn-sku-card-metric strong {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.is-cn-mobile-app .cn-sku-card-metric-risk {
    background: transparent;
    border-color: transparent;
  }

  /* ---- 5. Bottom Sheet Ficha 360° de Producto (#cnSkuSheet) ---- */
  body.is-cn-mobile-app .cn-sku-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 26, 47, 0.55);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.is-cn-mobile-app .cn-sku-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  body.is-cn-mobile-app .cn-sku-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 995;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(7, 26, 47, 0.32);
    max-height: 86dvh;
    padding-bottom: env(safe-area-inset-bottom, 14px);
    transform: translateY(105%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.is-cn-mobile-app .cn-sku-sheet.is-open {
    transform: translateY(0);
  }
  .cn-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: #cbd5e1;
    margin: 10px auto 4px;
    flex-shrink: 0;
  }
  .cn-sku-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 18px 12px;
    border-bottom: 1px solid #eef2f7;
  }
  .cn-sku-title-wrap {
    flex: 1;
    min-width: 0;
  }
  .cn-sku-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }
  .cn-sku-tipo {
    font-size: 11px;
    font-weight: 700;
    color: #64778d;
    text-transform: uppercase;
  }
  .cn-sku-head h3 {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 800;
    color: #0f2f52;
    line-height: 1.25;
  }
  .cn-sku-head p {
    margin: 0;
    font-size: 12px;
    color: #64778d;
  }
  .cn-sku-body {
    overflow-y: auto;
    padding: 14px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
  }
  .cn-sku-insight {
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 12.5px;
    line-height: 1.45;
  }
  .cn-sku-insight.is-warn {
    background: #fdeceb;
    border: 1px solid #f5c2be;
    color: #8c261f;
  }
  .cn-sku-insight.is-ok {
    background: #e3f8f0;
    border: 1px solid #b4ebd6;
    color: #095c3f;
  }
  .cn-sku-section {
    background: #f8fafd;
    border: 1px solid #e3eaf2;
    border-radius: 13px;
    padding: 12px;
  }
  .cn-sku-section h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #0f2f52;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .cn-sku-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .cn-sku-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cn-sku-metric {
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .cn-sku-metric span {
    font-size: 10.5px;
    font-weight: 700;
    color: #64778d;
    text-transform: uppercase;
  }
  .cn-sku-metric strong {
    font-size: 15px;
    font-weight: 800;
    color: #0f2f52;
    font-variant-numeric: tabular-nums;
  }
  .cn-sku-metric small {
    font-size: 11px;
    color: #64778d;
  }
  .cn-sku-aging-title {
    font-size: 11px;
    font-weight: 700;
    color: #64778d;
    margin: 10px 0 6px;
  }
  .cn-sku-aging-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }
  .cn-aging-pill {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0.55;
  }
  .cn-aging-pill.has-val {
    opacity: 1;
    border-width: 1.5px;
  }
  .cn-aging-pill.has-val.is-ok { border-color: #0b7a54; background: #f0fdf8; }
  .cn-aging-pill.has-val.is-mid { border-color: #1f6fb8; background: #f0f7ff; }
  .cn-aging-pill.has-val.is-warn { border-color: #d97706; background: #fffbeb; }
  .cn-aging-pill.has-val.is-risk { border-color: #b23b33; background: #fdeceb; }
  .cn-ag-lbl {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
  }
  .cn-ag-val {
    font-size: 12.5px;
    font-weight: 800;
    color: #0f2f52;
  }
}


