/* Métricas — assets/turis-metricas.css
   Usa los tokens del Sistema (--glass, --text, --orange…), así claro y oscuro salen solos.
   Vidrio donde el contenido flota (tarjetas, indicadores); tablas largas sobre vidrio más
   opaco para que se lean. Un solo acento (naranja). Sin halos ni brillos animados. */

#s-metricas, #s-contable { --mt-gap: 14px; }
.mt-wrap { display: flex; flex-direction: column; gap: var(--mt-gap); padding-bottom: 40px; container-type: inline-size; }
.mt-wrap > header + .mt-tabs { margin-top: -4px; }

/* ── Encabezado ─────────────────────────────────────────────── */
.mt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mt-title { font-size: 24px; font-weight: 700; letter-spacing: -.6px; line-height: 1.1; }
.mt-sub { font-size: 13px; color: var(--text2); margin-top: 6px; }
.mt-sub b { color: var(--text); font-weight: 600; }
.mt-ctrls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.mt-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--glass-bd); box-shadow: var(--glass-inset);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.mt-seg button { border: 0; background: transparent; color: var(--text2); font: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.mt-seg button:hover { color: var(--text); }
.mt-seg button.on { background: var(--bg2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--border); }
[data-theme="dark"] .mt-seg button.on { background: rgba(255,255,255,.1); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }

.mt-sel { appearance: none; -webkit-appearance: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--text);
  padding: 7px 28px 7px 11px; border-radius: 9px; border: 1px solid var(--glass-bd); cursor: pointer; max-width: 170px;
  background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23888' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  box-shadow: var(--glass-inset); }
.mt-sel.on { border-color: var(--orange); color: var(--orange-deep); }
.mt-btn { font: inherit; font-size: 12px; font-weight: 600; color: var(--text2); background: transparent; border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mt-btn:hover { color: var(--text); border-color: var(--border2); }
.mt-btn svg { flex-shrink: 0; }

.mt-owner { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text3); cursor: pointer; user-select: none; }
.mt-owner input { accent-color: var(--orange); width: 14px; height: 14px; cursor: pointer; }

/* ── Pestañas ───────────────────────────────────────────────── */
.mt-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.mt-tabs::-webkit-scrollbar { display: none; }
.mt-tab { border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text2);
  padding: 12px 16px 13px; cursor: pointer; position: relative; white-space: nowrap; transition: color .15s; }
.mt-tab:hover { color: var(--text); }
.mt-tab.on { color: var(--text); }
.mt-tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--orange); }

/* ── Vidrio ─────────────────────────────────────────────────── */
.mt-card { position: relative; border-radius: 14px; padding: 18px 20px;
  background: linear-gradient(168deg, rgba(255,255,255,.5), rgba(255,255,255,0) 44%), var(--glass);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-bd);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -14px rgba(0,0,0,.26), var(--glass-inset); min-width: 0; }
.mt-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: 14px 14px 0 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85) 22%, rgba(255,255,255,.85) 78%, transparent); }
[data-theme="dark"] .mt-card { background: linear-gradient(168deg, rgba(255,255,255,.06), rgba(255,255,255,0) 44%), var(--glass);
  border-color: rgba(255,255,255,.08); box-shadow: 0 4px 24px rgba(0,0,0,.32), var(--glass-inset); }
[data-theme="dark"] .mt-card::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,.13) 22%, rgba(255,255,255,.13) 78%, transparent); }
/* Tablas largas: vidrio casi opaco (el blur detrás de muchas filas se lee mal y en Chromium parpadea). */
.mt-card.solid { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-solid); }
.mt-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
/* Para decidir: una línea por aviso, título y detalle. Sin íconos ni colores de alarma. */
.mt-dec { display: flex; flex-direction: column; }
.mt-dec-r { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; border-top: 1px solid var(--border); }
.mt-dec-r:first-child { border-top: 0; padding-top: 2px; }
.mt-dec-r b { font-size: 13.5px; font-weight: 700; color: var(--text); }
.mt-dec-r span { font-size: 12.5px; color: var(--text2); line-height: 1.5; }
/* Encabezado con selector (Anticipación por …): el selector baja de línea si no entra. */
.mt-h-seg { flex-wrap: wrap; align-items: center; }
.mt-h-seg .mt-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.mt-card-t { font-size: 14px; font-weight: 700; letter-spacing: -.15px; display: flex; align-items: center; gap: 6px; }
.mt-card-s { font-size: 11.5px; color: var(--text3); }
.mt-grid2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--mt-gap); }
.mt-col { display: flex; flex-direction: column; gap: var(--mt-gap); min-width: 0; }
.mt-grid2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--mt-gap); }

/* ── Indicadores ────────────────────────────────────────────── */
.mt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: stretch; }
.mt-kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.mt-kpi.hero { grid-column: span 2; }
.mt-kpi-l { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.mt-kpi-v { font-size: 21px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-kpi.hero .mt-kpi-v { font-size: 27px; letter-spacing: -1px; }
.mt-kpi-v.neg { color: var(--red); }
.mt-kpi-foot { display: flex; flex-direction: column-reverse; gap: 6px; margin-top: auto; padding-top: 4px; }
.mt-kpi.hero .mt-kpi-foot { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mt-kpi-foot .mt-spark { width: 100%; }
.mt-kpi.hero .mt-kpi-foot .mt-spark { width: 42%; max-width: 200px; }
.mt-cmp { display: flex; flex-direction: column; gap: 1px; font-size: 11px; color: var(--text3); min-width: 0; margin-top: 2px; }
.mt-cmp span { white-space: nowrap; }
.mt-up { color: var(--green); font-weight: 700; }
.mt-down { color: var(--red); font-weight: 700; }
.mt-flat { color: var(--text3); font-weight: 700; }
.mt-spark { flex-shrink: 0; overflow: visible; }
.mt-spark path.l { fill: none; stroke: var(--orange); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mt-spark path.a { fill: color-mix(in srgb, var(--orange) 14%, transparent); stroke: none; }
.mt-spark circle { fill: var(--orange); }
.mt-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--text2);
  padding: 2px 7px; border-radius: 99px; background: var(--bg3); border: 1px solid var(--border); white-space: nowrap; }

/* "¿qué es?" de cada número */
.mt-q { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border2); background: transparent; color: var(--text3);
  font: 700 9.5px/13px 'Geist', sans-serif; cursor: help; padding: 0; text-transform: none; letter-spacing: 0; flex-shrink: 0; }
.mt-q:hover, .mt-q:focus-visible { color: var(--orange-deep); border-color: var(--orange); outline: none; }
.mt-pop { position: fixed; z-index: 9999; max-width: 290px; padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.5;
  color: var(--text); background: var(--glass-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); pointer-events: none; opacity: 0; transform: translateY(3px);
  transition: opacity .12s, transform .12s; }
.mt-pop.on { opacity: 1; transform: none; }
.mt-pop b { display: block; margin-bottom: 3px; font-size: 12px; }

/* ── Cascada ────────────────────────────────────────────────── */
.mt-cas { display: flex; flex-direction: column; }
.mt-cas-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.mt-cas-r:last-child { border-bottom: 0; }
.mt-cas-r .n { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.mt-cas-r .b { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--bg3); overflow: hidden; }
.mt-cas-r .b i { display: block; height: 100%; border-radius: 99px; background: color-mix(in srgb, var(--text3) 45%, transparent); }
.mt-cas-r.menos .n { color: var(--text2); }
.mt-cas-r.mas .n { color: var(--green); }
.mt-cas-r.tot { border-bottom: 0; border-top: 1px solid var(--border2); margin-top: 2px; padding-top: 11px; font-weight: 700; }
.mt-cas-r.tot .n { font-size: 17px; font-weight: 700; color: var(--text); }
.mt-cas-r.tot .b i { background: var(--orange); }
.mt-cas-r.res .n { font-size: 15px; }
.mt-nota { font-size: 11.5px; color: var(--text3); line-height: 1.5; margin-top: 8px; }
.mt-nota b { color: var(--text2); }

/* ── Proyección y caja ──────────────────────────────────────── */
.mt-proy-v { font-size: 26px; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.mt-bar { height: 8px; border-radius: 99px; background: var(--bg3); overflow: hidden; margin: 10px 0 6px; position: relative; }
.mt-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--orange); }
.mt-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--text3); }
.mt-lin { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text2); padding: 9px 0; border-top: 1px solid var(--border); }
.mt-lin:first-of-type { border-top: 0; }
.mt-lin b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── Gráficos ───────────────────────────────────────────────── */
.mt-chart { width: 100%; height: 220px; display: block; overflow: visible; }
.mt-chx { display: grid; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--text3); text-align: center; }
.mt-chx span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-chx span.cur { color: var(--text); }
.mt-chart .bar { fill: color-mix(in srgb, var(--orange) 26%, transparent); transition: fill .12s; }
.mt-chart .bar.cur { fill: var(--orange); }
.mt-chart g.col:hover .bar { fill: color-mix(in srgb, var(--orange) 60%, transparent); }
.mt-chart g.col:hover .bar.cur { fill: var(--orange-deep); }
.mt-chart .ln { fill: none; stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; opacity: .75; }
.mt-chart .dot { fill: var(--bg2); stroke: var(--text); stroke-width: 1.6; opacity: .85; }
.mt-chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mt-chart text { fill: var(--text3); font: 600 10.5px 'Geist', sans-serif; }
.mt-chart .hit { fill: transparent; cursor: default; }
.mt-leg { display: flex; gap: 14px; font-size: 11.5px; color: var(--text2); }
.mt-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--orange); }
.mt-leg i.l { height: 2px; border-radius: 2px; background: var(--text); vertical-align: 2px; width: 12px; }
.mt-read { margin-top: 8px; font-size: 12px; color: var(--text2); min-height: 18px; font-variant-numeric: tabular-nums; }
.mt-read b { color: var(--text); }

/* ── Tablas ─────────────────────────────────────────────────── */
.mt-tw { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.mt-t { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mt-t th { background: transparent; position: static; text-align: right; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3);
  padding: 0 12px 11px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.mt-t th:first-child, .mt-t td:first-child { text-align: left; padding-left: 0; }
.mt-t td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mt-t tr:last-child td { border-bottom: 0; }
.mt-t tbody tr { transition: background .12s; }
.mt-t tbody tr.clic { cursor: pointer; }
.mt-t tbody tr.clic:hover { background: color-mix(in srgb, var(--orange) 6%, transparent); }
.mt-t td.nom { font-weight: 600; color: var(--text); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.mt-t td.dim { color: var(--text3); }
.mt-t tfoot td { font-weight: 700; border-top: 1px solid var(--border2); border-bottom: 0; }
.mt-share { display: inline-block; width: 64px; height: 5px; border-radius: 99px; background: var(--bg3); vertical-align: middle; overflow: hidden; }
.mt-share i { display: block; height: 100%; border-radius: 99px; background: var(--orange); }
.mt-pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.mt-pill.g { color: var(--green); background: var(--green-bg); }
.mt-pill.a { color: var(--amber); background: var(--amber-bg); }
.mt-pill.r { color: var(--red); background: var(--red-bg); }
.mt-pill.n { color: var(--text2); background: var(--bg3); }

.mt-av { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  font-size: 11px; font-weight: 800; color: #fff; margin-right: 9px; vertical-align: middle; }
.mt-who { display: inline-flex; align-items: center; }

/* Barras horizontales (anticipación, países, canales) */
.mt-hb { display: flex; flex-direction: column; gap: 12px; }
.mt-hb-r { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.mt-hb-r .l { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-hb-r .t { height: 8px; border-radius: 99px; background: var(--bg3); overflow: hidden; }
.mt-hb-r .t i { display: block; height: 100%; border-radius: 99px; background: var(--orange); }
.mt-hb-r .v { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 42px; text-align: right; }

/* ── Ficha del vendedor ─────────────────────────────────────── */
.mt-ficha-h { display: flex; align-items: center; gap: 12px; }
.mt-ficha-h .mt-av { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; margin: 0; }
.mt-ficha-n { font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.mt-back { margin-left: auto; }

.mt-vacio { padding: 26px 8px; text-align: center; color: var(--text3); font-size: 13px; }
.mt-vacio b { display: block; color: var(--text2); font-size: 14px; margin-bottom: 4px; }
.mt-cargando { opacity: .55; transition: opacity .15s; }

/* ── Ancho ──────────────────────────────────────────────────── */
@container (max-width: 860px) {
  .mt-grid2, .mt-grid2e { grid-template-columns: minmax(0, 1fr); }
  .mt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 520px) {
  .mt-head { align-items: stretch; }
  .mt-ctrls { width: 100%; }
  .mt-seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .mt-sel { flex: 1 1 40%; max-width: none; }
  .mt-kpi-v { font-size: 19px; }
  .mt-kpi.hero .mt-kpi-v { font-size: 26px; }
  .mt-card { padding: 16px; }
  .mt-tw { margin: 0 -16px; padding: 0 16px; }
  #s-metricas, #s-contable { --mt-gap: 14px; }
  .mt-hb-r { grid-template-columns: 86px minmax(0, 1fr) auto; }
  .mt-t .opt { display: none; }
}

/* Pantallas clásicas metidas dentro de Métricas (Liquidación, Operación, detalle de Insights). */
.mt-embed > .filters { display: none !important; }
.mt-embed .card { border-radius: 16px; min-width: 0; }
.mt-embed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--mt-gap); }
.mt-embed-grid > .card { margin: 0 !important; }
.mt-embed-col { display: flex; flex-direction: column; gap: var(--mt-gap); }
.mt-embed-col > .card { margin: 0 !important; }
.mt-subseg { align-self: flex-start; }
@container (max-width: 860px) { .mt-embed-grid { grid-template-columns: minmax(0, 1fr); } }
.mt-embed-col > #insRitmoCard { padding: 20px 24px; }

/* Cabecera igual a la del Contable clásico: pestañas y fechas en una misma línea. */
.cn-header { border-bottom: 1px solid var(--border); }
@container (max-width: 1000px) { .cn-header { flex-wrap: wrap; row-gap: 6px; } }
.cn-period { align-self: center; padding-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.cn-header .cn-badge { margin-left: 4px; }
.mt-filtros { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: -4px; }
.mt-filtros .mt-card-s { margin-left: 4px; }
.mt-kpi.hero { grid-row: span 1; }

/* Negocio: los 6 indicadores en una sola fila (el principal, un poco más ancho). */
.mt-kpis.mt-kpis-6 { grid-template-columns: minmax(0, 1.7fr) repeat(5, minmax(0, 1fr)); }
.mt-kpis.mt-kpis-6 .mt-kpi.hero { grid-column: auto; }
.mt-kpis.mt-kpis-6 .mt-kpi.hero .mt-kpi-foot { flex-direction: column-reverse; align-items: stretch; }
.mt-kpis.mt-kpis-6 .mt-kpi.hero .mt-kpi-foot .mt-spark { width: 100%; max-width: none; }
@container (max-width: 1050px) { .mt-kpis.mt-kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 560px) { .mt-kpis.mt-kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mt-kpis.mt-kpis-6 .mt-kpi.hero { grid-column: 1 / -1; } }
.mt-liq-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ── Mini gráfico de 12 meses (indicadores y tablas) ─────────── oct-2026
   Barras por mes: gris los meses de referencia, naranja el período elegido, punteada la
   proyección del mes en curso y una línea punteada en el promedio. */
.mt-mini { margin-top: auto; padding-top: 12px; }
.mt-mini-c { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 600; color: var(--text3); margin-bottom: 5px; white-space: nowrap; }
.mt-mini-c span:last-child { overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.mt-mini-c i { display: inline-block; width: 10px; border-top: 1.5px dashed var(--text3); vertical-align: 3px; margin-right: 4px; opacity: .8; }
.mt-mini-b { position: relative; height: 34px; display: grid; gap: 3px; border-bottom: 1px solid var(--border2); }
.mt-kpi.hero .mt-mini-b { height: 44px; }
.mt-mini-b > em { position: absolute; left: -2px; right: -2px; height: 0; border-top: 1.5px dashed var(--text3); opacity: .55; pointer-events: none; z-index: 2; }
.mt-mini-b .col { position: relative; cursor: default; }
.mt-mini-b .col i { position: absolute; left: 0; right: 0; min-height: 1.5px; border-radius: 2.5px 2.5px 0 0; }
.mt-mini-b .col i.v { background: color-mix(in srgb, var(--text3) 30%, transparent); transition: background .12s; }
.mt-mini-b .col i.v.neg { background: color-mix(in srgb, var(--red) 45%, transparent); border-radius: 0 0 2.5px 2.5px; }
.mt-mini-b .col.cur i.v { background: var(--orange); }
.mt-mini-b .col.cur i.v.neg { background: var(--red); }
.mt-mini-b .col i.g { border: 1.5px dashed color-mix(in srgb, var(--orange) 75%, transparent); border-bottom: 0; background: color-mix(in srgb, var(--orange) 7%, transparent); }
.mt-mini-b .col:hover i.v { background: color-mix(in srgb, var(--text3) 55%, transparent); }
.mt-mini-b .col.cur:hover i.v { background: var(--orange-deep); }
.mt-mini-x { display: grid; gap: 3px; margin-top: 4px; font-size: 9px; font-weight: 600; color: var(--text3); text-align: center; line-height: 1; }
.mt-mini-x .cur { color: var(--text); font-weight: 800; }
/* En una tabla: solo las barras, chicas. */
.mt-mini.c { padding: 0; margin: 0; width: 96px; display: inline-block; vertical-align: middle; }
.mt-mini.c .mt-mini-b { height: 22px; gap: 2px; }
.mt-mini.c .mt-mini-b > em { display: none; }
.mt-t td.mt-tmini { padding-top: 6px; padding-bottom: 6px; }
.mt-pop.tip { max-width: 320px; padding: 7px 10px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Gráfico grande: eje de valores a la izquierda ────────────── */
.mt-chw { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.mt-chy { position: relative; height: 220px; min-width: 44px; font-size: 10.5px; font-weight: 600; color: var(--text3); font-variant-numeric: tabular-nums; }
.mt-chy span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; line-height: 1; }
.mt-chp { min-width: 0; }
.mt-chart .grid.cero { stroke: var(--border2); }
.mt-chart .bar.neg { fill: color-mix(in srgb, var(--red) 40%, transparent); }
.mt-chart .bar.cur.neg { fill: var(--red); }
.mt-chart .ghost { fill: color-mix(in srgb, var(--orange) 8%, transparent); stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.mt-leg i.g { background: transparent; border: 1.5px dashed var(--orange); width: 8px; height: 8px; }

/* Proyección: lo facturado (lleno) dentro de lo proyectado (claro). */
.mt-bar b { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: color-mix(in srgb, var(--orange) 22%, transparent); }
.mt-bar i { z-index: 1; }
.mt-bar em { z-index: 2; }
.mt-lin b small { font-size: 11px; margin-left: 6px; }
.mt-lin b small b { font-size: 11px; }
.mt-lin b small .mt-up { color: var(--green); } .mt-lin b small .mt-down { color: var(--red); } .mt-lin b small .mt-flat { color: var(--text3); }

/* Cascada: el % de cada renglón sobre lo facturado. */
.mt-cas-r > span:first-child em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text3); margin-left: 8px; font-variant-numeric: tabular-nums; }
.mt-cas-r.res.neg .n { color: var(--red); }

/* Filtros con el desplegable del sistema. */
.mt-dd > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mt-filtros .tf-dd-btn { max-width: 210px; }
.mt-filtros .tf-dd-btn .tf-dd-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-filtros .tf-dd-btn.con-valor { border-color: rgba(245,166,35,.45); color: var(--orange-deep); }
@container (max-width: 520px) { .mt-filtros .mt-dd { flex: 1 1 40%; } .mt-filtros .tf-dd-btn { width: 100%; max-width: none; justify-content: space-between; } }
.mt-mas { margin-top: 12px; }
.mt-lin small.dim { color: var(--text3); font-weight: 600; }
/* ── Evolución mensual (el gráfico del Home) ─────────────────── */
.mt-lin-h { flex-wrap: wrap; align-items: center; }
.mt-lin-modos { flex-wrap: wrap; }
.mt-lin-modos button { padding: 5px 9px; font-size: 11.5px; }
.mt-lin-cv { position: relative; height: 270px; }
@container (max-width: 520px) { .mt-lin-cv { height: 220px; } .mt-lin-modos { width: 100%; flex-wrap: nowrap; } }
/* Proyección: resultado y punto de equilibrio */
.mt-eq { margin-top: 4px; border-top: 1px solid var(--border); }
.mt-eq .mt-lin:first-child { border-top: 0; }
.mt-bar-eq { height: 6px; margin: 2px 0 4px; }
.mt-bar-eq i { background: var(--green); }
/* Clientes */
.mt-kpis.mt-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 860px) { .mt-kpis.mt-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mt-ccs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mt-cc { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 11px; background: var(--bg3); min-width: 0; }
.mt-cc span { font-size: 11px; font-weight: 600; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.mt-cc b { font-size: 18px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="dark"] .mt-cc { background: rgba(255,255,255,.04); }
@container (max-width: 860px) { .mt-ccs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mt-hb-r .v .dim { color: var(--text3); font-weight: 600; margin-right: 6px; }

/* ══ Rediseño 16-oct-2026 (aprobado por el dueño; artifact "Métricas · rediseño") ══════════
   Tarjetas KPI sin gráficos: el número manda y las comparaciones van en una línea. Una sola
   tarjeta principal por pestaña. Un acento (ámbar); gris cálido para lo demás. */
.mt-kpi { padding: 16px 18px 15px; gap: 6px; }
.mt-kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap; min-width: 0; }
.mt-kpi-row .mt-kpi-v { min-width: 0; }
.mt-kpi-v { font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.mt-kpi.hero .mt-kpi-v { font-size: 34px; letter-spacing: -.035em; line-height: 1.1; }
.mt-kpi-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-bottom: 4px; font-size: 12px; color: var(--text3); white-space: nowrap; }
.mt-kpi-meta b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.mt-kpi-meta .mt-up, .mt-kpi-meta .mt-down, .mt-kpi-meta .mt-flat { font-size: 11px; margin-left: 4px; }
.mt-cmp { flex-direction: row; flex-wrap: wrap; gap: 3px 12px; margin-top: auto; padding-top: 4px; font-size: 11.5px; }
.mt-up, .mt-down, .mt-flat { font-weight: 650; }
.mt-kpi.hero { background: radial-gradient(120% 150% at 0% 0%, color-mix(in srgb, var(--orange) 9%, transparent), transparent 55%),
  linear-gradient(168deg, rgba(255,255,255,.5), rgba(255,255,255,0) 44%), var(--glass); }
[data-theme="dark"] .mt-kpi.hero { background: radial-gradient(120% 150% at 0% 0%, rgba(245,166,35,.10), transparent 55%),
  linear-gradient(168deg, rgba(255,255,255,.06), rgba(255,255,255,0) 44%), var(--glass); }
.mt-kpis.mt-kpis-5 { grid-template-columns: minmax(0, 1.75fr) repeat(4, minmax(0, 1fr)); }
.mt-kpis.mt-kpis-4h { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
.mt-kpis.mt-kpis-3x { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt-kpis .mt-kpi.hero { grid-column: auto; }
@container (max-width: 1100px) {
  .mt-kpis.mt-kpis-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mt-kpis.mt-kpis-5 .mt-kpi.hero { grid-column: 1 / -1; }
  .mt-kpis.mt-kpis-4h { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mt-kpis.mt-kpis-4h .mt-kpi.hero { grid-column: 1 / -1; }
}
@container (max-width: 640px) {
  .mt-kpis.mt-kpis-5, .mt-kpis.mt-kpis-4h, .mt-kpis.mt-kpis-3x, .mt-kpis.mt-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-kpis .mt-kpi.hero { grid-column: 1 / -1; }
  .mt-kpi.hero .mt-kpi-v { font-size: 28px; }
  .mt-kpi-meta { align-items: flex-start; }
}

/* Proyección: lo facturado dentro de lo proyectado, con el punto de equilibrio marcado. */
.mt-bar { height: 10px; margin: 14px 0 8px; overflow: visible; }
.mt-bar i, .mt-bar b { border-radius: 99px; }
.mt-bar i { background: linear-gradient(90deg, var(--orange), var(--orange-deep)); }
.mt-bar.con-eq { margin-bottom: 26px; }
.mt-bar em.eq { top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); opacity: .8; }
.mt-bar em.eq span { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--text2); white-space: nowrap; font-style: normal; }
.mt-proy-v { font-size: 30px; letter-spacing: -.03em; font-weight: 650; }

/* Cascada: barras a escala, solo lo que queda en ámbar. */
.mt-cas-r .b { height: 6px; background: color-mix(in srgb, var(--text3) 12%, transparent); }
.mt-cas-r .b i { background: color-mix(in srgb, var(--text3) 38%, transparent); }
.mt-cas-r.tot .b i { background: linear-gradient(90deg, var(--orange), var(--orange-deep)); }

/* Gráficos de barras: gris cálido, ámbar el que importa (el período, la semana actual, el pico). */
.mt-chart .bar { fill: color-mix(in srgb, var(--text3) 26%, transparent); }
.mt-chart g.col:hover .bar { fill: color-mix(in srgb, var(--text3) 45%, transparent); }
.mt-chart .bar.cur { fill: var(--orange); }
.mt-chart g.col:hover .bar.cur { fill: var(--orange-deep); }
.mt-chart .ln { stroke: var(--text); opacity: .55; stroke-dasharray: 6 5; }
.mt-leg { align-items: center; flex-wrap: wrap; }
.mt-leg i.l { background: none; border-top: 2px dashed var(--text); opacity: .6; height: 0; }

/* Barra dentro de una celda: ordena la tabla de un vistazo. */
.mt-inbar { display: inline-block; width: 56px; height: 5px; margin-right: 10px; border-radius: 99px; vertical-align: middle; overflow: hidden;
  background: color-mix(in srgb, var(--text3) 14%, transparent); }
.mt-inbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--orange-deep)); }
@container (max-width: 520px) { .mt-inbar { display: none; } }

/* Píldoras: color solo en los extremos. */
.mt-pill { min-width: 42px; text-align: center; padding: 2px 8px; }

/* Tablas: un poco más de aire y el encabezado más quieto. */
.mt-t td { padding-top: 11px; padding-bottom: 11px; }
.mt-t th { padding-bottom: 10px; }
.mt-t tbody tr.clic:hover { background: color-mix(in srgb, var(--text3) 7%, transparent); }

/* Barras horizontales: la más grande en ámbar, el resto en gris cálido. */
.mt-hb-r .t { background: color-mix(in srgb, var(--text3) 12%, transparent); }
.mt-hb-r .t i { background: color-mix(in srgb, var(--text3) 40%, transparent); }
.mt-hb-r.top .t i { background: linear-gradient(90deg, var(--orange), var(--orange-deep)); }

/* Las tarjetas clásicas (Operación, Destinos) con el mismo vidrio que el resto. */
.mt-embed .card { border-radius: 14px !important; padding: 18px 20px;
  background: linear-gradient(168deg, rgba(255,255,255,.5), rgba(255,255,255,0) 44%), var(--glass) !important;
  border: 1px solid var(--glass-bd) !important; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -14px rgba(0,0,0,.26), var(--glass-inset) !important;
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); }
[data-theme="dark"] .mt-embed .card { background: linear-gradient(168deg, rgba(255,255,255,.06), rgba(255,255,255,0) 44%), var(--glass) !important;
  border-color: rgba(255,255,255,.08) !important; box-shadow: 0 4px 24px rgba(0,0,0,.32), var(--glass-inset) !important; }
/* Operación: las tarjetas de IA y WhatsApp con las piezas del Sistema (sus botones de días
   como el segmentado de vidrio y el ícono neutro, en vez de naranja y verde llenos). */
.mt-embed .card-title > span:first-child[style*="border-radius:9px"] { background: var(--bg3) !important; color: var(--text2) !important; box-shadow: inset 0 0 0 1px var(--border) !important; }
.mt-embed button[onclick^="_waSetDias"], .mt-embed button[onclick^="_iaSetDias"] { background: transparent !important; border: 1px solid transparent !important; color: var(--text3) !important; }
.mt-embed button[onclick^="_iaSetDias"][aria-pressed="true"], .mt-embed button[onclick^="_waSetDias"][style*="background:var(--green)"] {
  background: var(--seg-on-bg) !important; border-color: var(--seg-on-bd) !important; box-shadow: var(--seg-on-sh) !important; color: var(--seg-on-c) !important; }
