/* ============================================================
   MG Mars · Business Intelligence — Estilos
   ============================================================ */

:root {
  color-scheme: light;

  /* Superficies y tinta */
  --page: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --ink: #101828;
  --ink-2: #51586a;
  --ink-3: #8a90a0;
  --hairline: #e5e8ef;
  --grid: #edeff4;
  --baseline: #c9cdd8;
  --border: rgba(16, 24, 40, 0.08);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px -12px rgba(16, 24, 40, 0.12);

  /* Marca */
  --brand-navy: #101a3c;
  --brand-navy-2: #1b2a5e;
  --brand-grad: linear-gradient(100deg, #2a78d6 0%, #6d43c8 38%, #c4319b 72%, #f39c1f 100%);

  /* Series (validadas para superficie clara) */
  --series-1: #2a78d6;
  --series-1-track: #dcE9f9;
  --series-2: #008300;
  --series-3: #e87ba4;
  --series-4: #eda100;
  --accent-soft: rgba(42, 120, 214, 0.10);

  /* Estado */
  --good: #006300;
  --good-bg: rgba(12, 163, 12, 0.10);
  --bad: #b42318;
  --bad-bg: rgba(208, 59, 59, 0.10);

  /* Acentos de marca (decorativos, no codifican datos) */
  --acento-azul: #2a78d6;
  --acento-violeta: #6d43c8;
  --acento-magenta: #c4319b;
  --acento-naranja: #eb6834;
  --acento-ambar: #e8930c;

  --radius: 16px;
  --radius-sm: 10px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c111e;
  --surface: #161d2e;
  --surface-2: #1c2438;
  --ink: #f4f6fb;
  --ink-2: #b9c0d0;
  --ink-3: #7e8598;
  --hairline: #262f45;
  --grid: #222b40;
  --baseline: #39435c;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -14px rgba(0, 0, 0, 0.6);

  --brand-navy: #0b1330;
  --brand-navy-2: #14204a;

  --series-1: #3987e5;
  --series-1-track: #24365a;
  --series-2: #008300;
  --series-3: #d55181;
  --series-4: #c98500;
  --accent-soft: rgba(57, 135, 229, 0.16);

  --good: #0ca30c;
  --good-bg: rgba(12, 163, 12, 0.16);
  --bad: #ef6a6a;
  --bad-bg: rgba(239, 106, 106, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Fondo con lavado de marca, muy sutil */
body {
  background-image:
    radial-gradient(900px 420px at 12% -80px, rgba(109, 67, 200, 0.07), transparent 68%),
    radial-gradient(900px 420px at 88% -80px, rgba(196, 49, 155, 0.06), transparent 68%);
  background-repeat: no-repeat;
}
:root[data-theme="dark"] body {
  background-image:
    radial-gradient(900px 420px at 12% -80px, rgba(109, 67, 200, 0.16), transparent 68%),
    radial-gradient(900px 420px at 88% -80px, rgba(196, 49, 155, 0.12), transparent 68%);
}

/* ---------------- Encabezado ---------------- */

.encabezado {
  /* Degradado invertido: violeta luminoso a la izquierda (realza el logo
     y el título) → índigo profundo a la derecha. */
  background: linear-gradient(100deg, #8a2bb8 0%, #6d24a8 22%, #46208f 48%, #241660 76%, #151038 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.encabezado::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 5px;
  background: var(--brand-grad);
}

.encabezado::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(360px 200px at 140px 50%, rgba(246, 196, 83, 0.35), transparent 70%),
    radial-gradient(460px 300px at 96% 130%, rgba(42, 120, 214, 0.35), transparent 70%);
  pointer-events: none;
}

.encabezado-contenido {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}

/* Placa blanca detrás del logo: garantiza contraste sobre cualquier fondo */
.logo {
  flex: none;
  display: flex;
  align-items: center;
  background: #ffffff;
  padding: 5px 16px;
  border-radius: 16px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(255, 255, 255, 0.18);
}

.logo img {
  height: 74px;
  width: auto;
  display: block;
}

.titulos { flex: 1; min-width: 0; }

.titulos h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.titulos p {
  margin: 3px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.insignia {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  word-spacing: 0.22em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  color: #ffe9b3;
  background: linear-gradient(100deg, rgba(232, 160, 0, 0.28), rgba(196, 49, 155, 0.30));
  border: 1px solid rgba(246, 196, 83, 0.45);
  white-space: nowrap;
}

.boton-tema {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(246, 196, 83, 0.4);
  background: rgba(255, 255, 255, 0.10);
  color: #ffe9b3;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}
.boton-tema:hover { background: rgba(255, 255, 255, 0.20); }
.boton-tema svg { width: 18px; height: 18px; }

/* ---------------- Contenedor ---------------- */

.contenedor {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px 36px;
}

/* ---------------- Filtros ---------------- */

.filtros {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 2px 14px;
}

.filtro { display: flex; flex-direction: column; gap: 5px; }

.filtro label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  word-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.filtro select {
  appearance: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 9px 34px 9px 12px;
  min-width: 150px;
  cursor: pointer;
  box-shadow: var(--shadow);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a90a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filtro select:focus-visible {
  outline: 2px solid var(--series-1);
  outline-offset: 1px;
}

.chip-corte {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
}

.chip-corte .punto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--series-1);
  flex: none;
}
.chip-corte .punto.en-curso {
  background: var(--good);
  box-shadow: 0 0 0 4px var(--good-bg);
}

/* ---------------- Rejilla ---------------- */

.rejilla {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.tarjeta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.25s ease;
}

.tarjeta:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 14px 34px -12px rgba(76, 56, 156, 0.22);
}
:root[data-theme="dark"] .tarjeta:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 16px 38px -14px rgba(0, 0, 0, 0.7);
}

/* KPI (fila superior) */
.kpi { grid-column: span 12; }

.fila-kpi {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.kpi-tile { display: flex; flex-direction: column; gap: 6px; position: relative; }

.fila-kpi .tarjeta { padding: 13px 16px 15px; }

/* Cuerpo compacto: valor a la izquierda, tendencia a la derecha */
.kpi-cuerpo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.kpi-izq { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-sparkline { flex: none; width: 96px; }

.kpi-etiqueta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  word-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 7px;
}

.kpi-etiqueta .icono {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--series-1);
  flex: none;
}
.kpi-etiqueta .icono svg { width: 15px; height: 15px; }

.kpi-valor {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.kpi-valor.heroe { font-size: 38px; letter-spacing: -1px; }

/* Acento por tarjeta KPI: filo superior degradado + chip de icono tintado.
   Es cromo de interfaz (decorativo); los colores de datos no cambian. */
.kpi-tile { --acento: var(--acento-azul); overflow: hidden; }
.kpi-tile.acento-azul    { --acento: var(--acento-azul); }
.kpi-tile.acento-violeta { --acento: var(--acento-violeta); }
.kpi-tile.acento-magenta { --acento: var(--acento-magenta); }
.kpi-tile.acento-naranja { --acento: var(--acento-naranja); }
.kpi-tile.acento-ambar   { --acento: var(--acento-ambar); }

.kpi-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--acento), color-mix(in oklab, var(--acento) 35%, transparent));
}

.kpi-tile .icono {
  background: color-mix(in oklab, var(--acento) 12%, transparent) !important;
  color: var(--acento) !important;
}

.kpi-tile .mini-meter { background: color-mix(in oklab, var(--acento) 16%, transparent); }
.kpi-tile .mini-meter > span { background: var(--acento); }

.kpi-sub {
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kpi-sub:empty { display: none; }

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.delta.sube { color: var(--good); background: var(--good-bg); }
.delta.baja { color: var(--bad);  background: var(--bad-bg); }
.delta svg { width: 10px; height: 10px; }


/* Mini-meter (avance del calendario) */
.mini-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--series-1-track);
  overflow: hidden;
  margin-top: 6px;
}
.mini-meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--series-1);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tarjetas de gráficas */
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.tarjeta-cabecera {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.tarjeta-cabecera h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

/* Subrayado degradado bajo el título de cada tarjeta (eco de la lámina original) */
.tarjeta-cabecera h2::after {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  margin-top: 5px;
  background: var(--brand-grad);
}

.tarjeta-cabecera .sub {
  font-size: 12.5px;
  color: var(--ink-3);
}

.tarjeta-cabecera .acciones { margin-left: auto; display: flex; gap: 6px; }

.boton-alterna {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}
.boton-alterna:hover { color: var(--ink); }
.boton-alterna[aria-pressed="true"] {
  color: var(--series-1);
  border-color: var(--series-1);
  background: var(--accent-soft);
}

/* Leyenda */
.leyenda {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 6px 0 2px;
  flex-wrap: wrap;
}
.leyenda .clave { display: inline-flex; align-items: center; gap: 6px; }
.leyenda .muestra {
  width: 12px; height: 12px; border-radius: 3px; flex: none;
}
.leyenda .muestra.linea { height: 3px; border-radius: 2px; width: 14px; }

/* Meters por división */
.meters { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }

.meter { display: flex; flex-direction: column; gap: 6px; }

.meter-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.meter-marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.meter-nombre { font-size: 14.5px; font-weight: 700; color: var(--ink); }

/* Logotipo de marca en círculo pequeño */
.logo-marca {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}
.meter-valor { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.meter-pista {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--series-1-track);
  overflow: hidden;
}
.meter-pista > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--series-1);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.meter-pista .meta-marca {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--baseline);
}

/* Gráfica SVG genérica */
.lienzo { width: 100%; display: block; margin-top: 8px; }
.lienzo text { font-family: var(--font); }

svg .tick-y, svg .tick-x { font-size: 11px; fill: var(--ink-3); }
svg .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
svg .baseline { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }

svg .barra { transition: opacity 0.12s ease; cursor: pointer; }
svg .barra.apagada { opacity: 0.45; }

svg .etiqueta-directa {
  font-size: 11px;
  font-weight: 700;
  fill: var(--ink-2);
}

/* Donut */
.donut-envoltura {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}
.donut-centro-num { font-family: var(--font-display); font-size: 22px; font-weight: 700; fill: var(--ink); }
.donut-centro-txt { font-size: 10.5px; fill: var(--ink-3); font-weight: 600; letter-spacing: 0.4px; }

.donut-leyenda { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.donut-leyenda .fila {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.donut-leyenda .muestra { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-leyenda .nombre { color: var(--ink-2); flex: 1; }
.donut-leyenda .num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-leyenda .pct { color: var(--ink-3); font-size: 12px; width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

/* Tabla (Círculo de Honor y vista tabla) */
.tabla { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tabla th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  word-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
}
.tabla td {
  padding: 9px 10px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--grid);
  color: var(--ink-2);
}
.tabla tr:last-child td { border-bottom: none; }
.tabla td.num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); text-align: right; }
.tabla th.num { text-align: right; }

.pos {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--ink-2);
}
/* Medallas oro / plata / bronce (top 3) */
.medalla {
  width: 30px;
  height: 37px;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(16, 24, 40, 0.22));
}

.nombre-persona { font-weight: 600; color: var(--ink); }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
}

/* Barra de avance dentro de la tabla */
.avance-celda { display: flex; align-items: center; gap: 10px; justify-content: flex-end; white-space: nowrap; }
.avance-mini {
  width: 74px; height: 6px; border-radius: 999px;
  background: var(--series-1-track); overflow: hidden; flex: none;
}
.avance-mini > span { display: block; height: 100%; background: var(--series-1); border-radius: 999px; }

/* Reconocimiento */
.reconocimiento {
  position: relative;
  overflow: hidden;
  background: var(--brand-navy);
  color: #fff;
  border: none;
}
.reconocimiento::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(420px 200px at 110% -20%, rgba(196, 49, 155, 0.5), transparent 65%),
    radial-gradient(380px 220px at -10% 120%, rgba(42, 120, 214, 0.55), transparent 65%);
  pointer-events: none;
}
.reconocimiento > * { position: relative; }
.reconocimiento .kpi-etiqueta { color: rgba(255, 255, 255, 0.65); }
.reconocimiento .kpi-etiqueta .icono { background: rgba(255, 255, 255, 0.14); color: #f6c453; }
.reconocimiento h3 { margin: 6px 0 2px; font-family: var(--font-display); font-size: 21px; font-weight: 700; }
.reconocimiento::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--brand-grad);
}
.reconocimiento p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.75); }

/* Noticias */
.noticias { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.noticia {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--grid);
}
.noticia:last-child { border-bottom: none; }
.noticia .punto-noticia {
  margin-top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--series-1); flex: none;
}
.noticia h4 { margin: 0 0 2px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.noticia p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 6px 24px -6px rgba(16, 24, 40, 0.25);
  padding: 9px 12px;
  font-size: 12.5px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  max-width: 240px;
}
.tooltip.visible { opacity: 1; transform: translateY(0); }
.tooltip .tt-titulo { font-weight: 700; margin-bottom: 5px; color: var(--ink); }
.tooltip .tt-fila { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.tooltip .tt-clave { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tooltip .tt-valor { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip .tt-nombre { color: var(--ink-2); }

/* Pie */
.pie {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  word-spacing: 0.1em;
  color: var(--ink-3);
}

/* Transición de refresco: conserva el marco, atenúa */
.refrescando .tarjeta { opacity: 0.55; transition: opacity 0.15s ease; }

/* ---------------- Animaciones de entrada (carga del tablero) ---------------- */

@keyframes entradaSuave {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes entradaEncabezado {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.encabezado-contenido { animation: entradaEncabezado 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.filtros { animation: entradaSuave 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s backwards; }

/* Cascada: primero los KPI, luego las tarjetas grandes */
.fila-kpi .tarjeta:nth-child(1) { animation: entradaSuave 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s backwards; }
.fila-kpi .tarjeta:nth-child(2) { animation: entradaSuave 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.18s backwards; }
.fila-kpi .tarjeta:nth-child(3) { animation: entradaSuave 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.24s backwards; }
.fila-kpi .tarjeta:nth-child(4) { animation: entradaSuave 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.30s backwards; }
.fila-kpi .tarjeta:nth-child(5) { animation: entradaSuave 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.36s backwards; }

.rejilla > .tarjeta:nth-of-type(1) { animation: entradaSuave 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.42s backwards; }
.rejilla > .tarjeta:nth-of-type(2) { animation: entradaSuave 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.50s backwards; }
.rejilla > .tarjeta:nth-of-type(3) { animation: entradaSuave 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.58s backwards; }
.rejilla > .tarjeta:nth-of-type(4) { animation: entradaSuave 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.66s backwards; }
.rejilla > div.col-4 .tarjeta:nth-child(1) { animation: entradaSuave 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.74s backwards; }
.rejilla > div.col-4 .tarjeta:nth-child(2) { animation: entradaSuave 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.82s backwards; }
.pie { animation: entradaSuave 0.6s ease 0.85s backwards; }

@media (prefers-reduced-motion: reduce) {
  .encabezado-contenido, .filtros, .fila-kpi .tarjeta, .rejilla > .tarjeta,
  .rejilla > div.col-4 .tarjeta, .pie { animation: none; }
  .tarjeta, .meter-pista > span, .mini-meter > span { transition: none; }
}

/* ---------------- Responsivo ---------------- */

@media (max-width: 1100px) {
  .fila-kpi { grid-template-columns: repeat(2, 1fr); }
  .col-8, .col-7, .col-5, .col-4, .col-3 { grid-column: span 12; }
  .chip-corte { margin-left: 0; }
}

@media (max-width: 560px) {
  .fila-kpi { grid-template-columns: 1fr; }
  .contenedor { padding: 16px 14px 40px; }
  .encabezado-contenido { padding: 16px 14px; }
}
