:root {
  --navy: #0C2340;
  --navy-2: #17325a;
  --coral: #E56A54;
  --blue: #307FE2;
  --teal: #279989;

  --surface-a: #eef1f6;
  --surface-b: #e6eaf1;
  --shadow-hi: rgba(255, 255, 255, .85);
  --shadow-lo: rgba(28, 60, 110, .16);
  --ink: #0c2340;
  --text: #243252;
  --muted: #5c6a86;
  --muted-2: #7a87a1;
  --border: #e6e9f2;

  --radius-lg: 22px;
  --radius-md: 14px;
}

/* Competencia reutiliza EXACTAMENTE el mismo sistema "soft UI" claro de
   Kadora (mismas tarjetas, mismo relieve, mismo aire) — lo único que
   cambia es qué color domina el mesh de fondo y la sombra: aquí el
   navy de marca pesa más que el azul/teal de la vista principal. */
body.competencia-active {
  --surface-a: #f2f4f9;
  --surface-b: #dde3ec;
  --shadow-hi: rgba(255, 255, 255, .35);
  --shadow-lo: rgba(12, 35, 64, .30);
  --ink: #0c2340;
  --text: #243252;
  --muted: #5c6a86;
  --muted-2: #7a87a1;
  --border: #dbe0ea;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 650px at 15% 90%, rgba(48, 127, 226, .22), transparent 70%),
    radial-gradient(800px 650px at 100% 55%, rgba(39, 153, 137, .18), transparent 68%),
    #f7f9fc;
  background-attachment: fixed, fixed, fixed;
  transition: background 0.3s ease;
}

/* Competencia: el degradado de los tres colores de marca cubre toda la
   pantalla en diagonal — las tarjetas claras flotan encima con relieve
   real, mucho contraste con el fondo. */
body.competencia-active {
  background: linear-gradient(160deg, #798696 0%, #88c7be 50%, #f1ada1 100%);
  background-attachment: fixed;
}

/* ---------- Header ---------- */

.topbar {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 16px 0;
  position: sticky;
  top: 12px;
  z-index: 10;
  max-width: 1180px;
  margin: 12px auto 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 10px 14px 26px -10px rgba(12, 35, 64, .55);
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--blue);
  transition: background 0.25s ease;
}

body.competencia-active .topbar::after {
  background: var(--coral);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 16px; }

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.brand-text p {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 16px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 7px 14px;
  border-radius: 999px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f2b705;
  animation: pulse 1.6s infinite;
}

.sync-dot.ok { background: #35d08c; animation: none; }
.sync-dot.err { background: #ef5757; animation: none; }

.sync-status.comp-accent {
  background: rgba(229, 106, 84, 0.16);
  border-color: rgba(229, 106, 84, 0.4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 7px 14px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.nav-link:hover { background: rgba(255,255,255,0.1); }

.view-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 4px;
  border-radius: 999px;
}

.view-tab {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.view-tab:hover { color: #fff; }

.view-tab.active {
  background: #fff;
  color: var(--navy);
}

.view-tab.active[data-view="competencia"] {
  color: var(--coral);
}

/* ---------- Layout ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 10px;
}

/* ---------- Week bar ---------- */

.week-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.week-bar .select {
  font-weight: 700;
  color: var(--navy);
  min-width: 220px;
}

.btn-export {
  border: none;
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: -4px -4px 9px var(--shadow-hi), 5px 5px 12px var(--shadow-lo);
  transition: box-shadow 0.15s ease;
}

.btn-export:first-of-type { margin-left: auto; }

.btn-export:active {
  box-shadow: inset -2px -2px 5px var(--shadow-hi), inset 3px 3px 7px var(--shadow-lo);
}

/* ---------- Competencia: pestañas de ciudad ---------- */

.city-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.city-tab {
  border: none;
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  padding: 10px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  box-shadow: -4px -4px 9px var(--shadow-hi), 5px 5px 12px var(--shadow-lo);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.city-tab:hover:not(.disabled) { transform: translateY(-1px); }

.city-tab.active {
  background: linear-gradient(150deg, color-mix(in srgb, var(--coral) 75%, white), var(--coral));
  color: #fff;
  box-shadow: -2px -2px 5px rgba(255, 255, 255, .2) inset, 4px 6px 14px -3px rgba(229, 106, 84, .55);
}

.city-tab.disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

/* ---------- KPIs ---------- */

.kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-value.up { color: var(--teal); }
.kpi-value.down { color: var(--coral); }

.kpi-card {
  position: relative;
  flex: 1 1 190px;
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  border-radius: var(--radius-lg);
  padding: 16px 18px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: -6px -6px 13px var(--shadow-hi), 8px 8px 18px var(--shadow-lo);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: -8px -8px 16px var(--shadow-hi), 10px 10px 22px var(--shadow-lo);
}

.orb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: -3px -3px 6px rgba(255, 255, 255, .5), 4px 5px 9px rgba(12, 35, 64, .28);
}

.orb--navy  { background: radial-gradient(circle at 32% 28%, #6f8fc7, #0C2340 60%, #060f1f 100%); }
.orb--blue  { background: radial-gradient(circle at 32% 28%, #6fb0ff, #307FE2 55%, #1b4f96 100%); }
.orb--teal  { background: radial-gradient(circle at 32% 28%, #5fd8c4, #279989 55%, #17564c 100%); }
.orb--coral { background: radial-gradient(circle at 32% 28%, #ff9d87, #E56A54 55%, #a8412c 100%); }

/* Competencia: las esferas emiten resplandor propio además del volumen. */
body.competencia-active .orb--navy  { box-shadow: 0 0 18px -2px rgba(111, 143, 199, .7); }
body.competencia-active .orb--blue  { box-shadow: 0 0 18px -2px rgba(48, 127, 226, .75); }
body.competencia-active .orb--teal  { box-shadow: 0 0 18px -2px rgba(39, 153, 137, .75); }
body.competencia-active .orb--coral { box-shadow: 0 0 18px -2px rgba(229, 106, 84, .75); }

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  display: block;
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
}

/* ---------- Trend chart ---------- */

.trend-card {
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  border-radius: var(--radius-lg);
  padding: 20px 20px 10px;
  box-shadow: -6px -6px 13px var(--shadow-hi), 8px 8px 18px var(--shadow-lo);
  margin-bottom: 28px;
}

.trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.trend-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.trend-select {
  min-width: 220px;
}

.trend-chart-wrap {
  position: relative;
}

.trend-chart {
  display: block;
  width: 100%;
  height: 200px;
  cursor: crosshair;
}

.trend-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: -4px -4px 9px var(--shadow-hi), 6px 8px 16px var(--shadow-lo);
  transform: translateY(-100%);
  z-index: 2;
}

.trend-tooltip-value {
  font-weight: 700;
}

.trend-tooltip-value div + div {
  margin-top: 2px;
}

.bar-mark {
  transition: opacity 0.12s ease;
  cursor: pointer;
}

.bar-mark:hover {
  opacity: 0.82;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.trend-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.trend-legend-swatch {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.trend-tooltip-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

/* ---------- Controls ---------- */

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: none;
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: -4px -4px 9px var(--shadow-hi), 5px 5px 12px var(--shadow-lo);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, var(--muted));
}

.chip:hover { transform: translateY(-1px); }

.chip.active {
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent, var(--blue)) 70%, white), var(--accent, var(--blue)));
  color: #fff;
  box-shadow: -2px -2px 5px rgba(255, 255, 255, .25) inset, 4px 6px 14px -3px color-mix(in srgb, var(--accent, var(--blue)) 55%, transparent);
}

.chip.active .dot { background: #fff; }

.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.group-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.group-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-b);
  box-shadow: inset 2px 2px 4px var(--shadow-lo), inset -1px -1px 2px var(--shadow-hi);
  position: relative;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.group-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, .3);
  transition: left 0.15s ease;
}

.group-toggle input[type="checkbox"]:checked {
  background: linear-gradient(150deg, #6fb0ff, var(--blue));
}

.group-toggle input[type="checkbox"]:checked::after { left: 16px; }

.group-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.select, .search {
  border: none;
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  box-shadow: -4px -4px 9px var(--shadow-hi), 5px 5px 12px var(--shadow-lo);
}

.search { min-width: 240px; }

.select:focus, .search:focus {
  outline: none;
  box-shadow: -4px -4px 9px var(--shadow-hi), 5px 5px 12px var(--shadow-lo), 0 0 0 2px var(--blue);
}

/* ---------- Competencia: tarifas ---------- */

.pricing-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.pricing-card {
  --accent: var(--teal);
  position: relative;
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
  box-shadow: -6px -6px 13px var(--shadow-hi), 8px 8px 18px var(--shadow-lo);
}

.pricing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pricing-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.pricing-updated {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.pricing-row {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.pricing-row:first-of-type {
  border-top: none;
}

.pricing-room {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 5px;
}

.pricing-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pricing-tier {
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--ink);
  background: var(--surface-b);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}

.pricing-tier b {
  font-weight: 700;
}

.pricing-tier small {
  color: var(--muted);
  font-weight: 600;
  margin-left: 3px;
}

/* ---------- Cards grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding-bottom: 20px;
}

.card {
  --accent: var(--muted);
  position: relative;
  background: linear-gradient(160deg, var(--surface-a), var(--surface-b));
  border-radius: var(--radius-lg);
  padding: 18px 16px 16px;
  box-shadow: -6px -6px 13px var(--shadow-hi), 8px 8px 20px var(--shadow-lo);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: -8px -8px 16px var(--shadow-hi), 10px 10px 24px var(--shadow-lo);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-top-right {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--accent, var(--muted)) 20%, var(--surface-a));
  color: var(--accent, var(--muted));
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
}

.dup-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-b);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-icon { flex-shrink: 0; }

.ad-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.leads-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: color-mix(in srgb, var(--accent, var(--blue)) 14%, var(--surface-a));
  padding: 5px 9px;
  border-radius: 8px;
  white-space: nowrap;
}

.leads-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, var(--blue));
  margin-right: 2px;
}

.leads-stat-value {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.leads-stat-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-2);
  margin-right: 3px;
}

.leads-stat-dot {
  color: var(--muted-2);
  margin: 0 1px;
}

.leads-stat-source {
  font-size: 9.5px;
  font-weight: 600;
  font-style: italic;
  color: var(--muted-2);
  margin-left: 3px;
  padding-left: 6px;
  border-left: 1px solid color-mix(in srgb, var(--accent, var(--blue)) 30%, var(--border));
}

.new-badge {
  font-size: 11px;
  font-weight: 800;
  color: #0a1526;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  background: linear-gradient(160deg, #5fd8c4, var(--teal));
  box-shadow: -2px -2px 4px rgba(255, 255, 255, .3) inset, 2px 4px 9px -2px rgba(39, 153, 137, .5);
}

.baja-badge {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  background: linear-gradient(160deg, #ff9d87, var(--coral));
  box-shadow: -2px -2px 4px rgba(255, 255, 255, .3) inset, 2px 4px 9px -2px rgba(229, 106, 84, .5);
}

body.competencia-active .new-badge {
  box-shadow: 0 0 14px -1px rgba(39, 153, 137, .8);
}
body.competencia-active .baja-badge {
  box-shadow: 0 0 14px -1px rgba(229, 106, 84, .8);
}

.card.is-baja {
  opacity: 0.72;
}

.group-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-b);
  padding: 4px 9px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.group-link:hover { filter: brightness(0.95); }
.group-link.disabled { color: var(--muted); pointer-events: none; opacity: 0.6; }

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  box-shadow: inset 0 0 0 1px rgba(12, 35, 64, .06);
}

.card-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-text.expanded { -webkit-line-clamp: unset; }


.card-more {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-dates { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.card-dates strong { color: var(--text); }

.card-link {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--navy) 60%, var(--blue)), var(--navy));
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 3px 5px 11px -3px rgba(12, 35, 64, .5);
  transition: filter 0.15s ease;
}
.card-link:hover { filter: brightness(1.08); }
.card-link.disabled { background: var(--surface-b); color: var(--muted); box-shadow: none; pointer-events: none; }

/* ---------- Empty / footer ---------- */

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 14px;
}

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 24px 40px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* El footer y el estado vacío son el único texto que queda directo sobre
   el fondo (todo lo demás vive dentro de una tarjeta clara) — con el
   degradado de marca de fondo necesitan su propio tono claro. */
body.competencia-active .footer,
body.competencia-active .empty-state {
  color: rgba(255, 255, 255, .65);
}

body.competencia-active .footer .link-btn {
  color: #fff;
}

.link-btn {
  background: none;
  border: none;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  font-size: 12.5px;
  padding: 0;
  text-decoration: underline;
}

/* ---------- Skeleton loading ---------- */

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #eef1f8 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}

.skeleton-badge {
  width: 92px;
  height: 22px;
  border-radius: 8px;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
}

.skeleton-line {
  height: 12px;
  width: 100%;
}

.skeleton-line.short { width: 88%; }
.skeleton-line.shorter { width: 58%; }

.skeleton-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.skeleton-pill {
  height: 30px;
  width: 88px;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .kpi-card { flex-basis: calc(33.333% - 11px); }
}

@media (max-width: 900px) {
  .kpi-card { flex-basis: calc(50% - 8px); }
}

@media (max-width: 600px) {
  .kpis { gap: 10px; }
  .kpi-card { flex-basis: calc(50% - 5px); padding: 14px 16px 16px; }
  .kpi-value { font-size: 22px; }
  .controls { flex-direction: column; align-items: stretch; }
  .controls-right { justify-content: space-between; }
  .search { min-width: 0; flex: 1; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- Impresión / exportar a PDF ---------- */

@media print {
  .sync-status,
  .btn-export,
  .controls-right,
  .card-more,
  .footer {
    display: none !important;
  }

  :root, body.competencia-active {
    --surface-a: #ffffff;
    --surface-b: #ffffff;
    --shadow-hi: transparent;
    --shadow-lo: transparent;
    --ink: #0c2340;
    --text: #243252;
    --muted: #5c6a86;
    --muted-2: #7a87a1;
    --border: #e6e9f2;
  }

  body, body.competencia-active { background: #fff; }
  .topbar { position: static; box-shadow: none; margin: 0 auto 16px; }
  .trend-tooltip { display: none !important; }
  .card, .kpi-card, .pricing-card, .city-tab, .chip, .trend-card, .orb {
    box-shadow: none !important;
    border: 1px solid var(--border);
    break-inside: avoid;
  }
  .card-text { -webkit-line-clamp: unset !important; }
}
