/* Ganadería de Carne — UX-CARNE 1.0 (inteligencia ejecutiva) */

#pg-carne.carne-ux1-on #carne-hub-ux {
  margin-bottom: 10px;
}

/* —— Hero (tono cálido / carne) —— */
#pg-carne .carne-hub-xhero {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  padding: 18px 16px 14px;
  border-radius: 14px;
  border: 1px solid #57534e;
  background:
    linear-gradient(155deg, rgba(28, 20, 16, 0.88) 0%, rgba(41, 37, 36, 0.82) 38%, rgba(68, 64, 60, 0.78) 100%),
    var(--piel-carne-xhero-visual, url('../icons/carne-hub-xhero-brahman.png?v=20260520carneXhero')) center center / cover no-repeat;
  color: #fafaf9;
  box-shadow:
    0 14px 36px rgba(28, 20, 16, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#pg-carne .carne-hub-xhero__glow {
  position: absolute;
  inset: -45% -25% auto -25%;
  height: 75%;
  background: radial-gradient(ellipse at 45% 0%, rgba(251, 191, 36, 0.14) 0%, transparent 68%);
  pointer-events: none;
}

#pg-carne .carne-hub-xhero__radial {
  position: absolute;
  inset: auto -35% -55% -35%;
  height: 88%;
  background: radial-gradient(ellipse at 50% 100%, rgba(214, 211, 209, 0.2) 0%, transparent 62%);
  pointer-events: none;
}

#pg-carne .carne-hub-xhero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

#pg-carne .carne-hub-xhero__kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

#pg-carne .carne-hub-xhero__plan--subtle {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  opacity: 0.75;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

#pg-carne .carne-hub-xhero__intro {
  margin-bottom: 12px;
}

#pg-carne .carne-hub-xhero__brand {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.15;
}

#pg-carne .carne-hub-xhero__tagline {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #d6d3d1;
}

#pg-carne .carne-hub-xhero__core {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 12px;
}

#pg-carne .carne-hub-xhero__score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 132px;
  flex-shrink: 0;
  text-align: center;
}

#pg-carne .carne-hub-xhero__ring-wrap {
  position: relative;
  width: 124px;
  height: 124px;
}

#pg-carne .carne-hub-xhero__ring-halo {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 68%);
  pointer-events: none;
}

#pg-carne .carne-hub-xhero__ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

#pg-carne .carne-hub-xhero__ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 9;
}

#pg-carne .carne-hub-xhero__ring-fill {
  fill: none;
  stroke: #fde68a;
  stroke-width: 9;
  stroke-linecap: round;
}

#pg-carne .carne-hub-xhero__score {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#pg-carne .carne-hub-xhero__score-num {
  font-size: 42px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pg-carne .carne-hub-xhero__score-max {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.78;
}

#pg-carne .carne-hub-xhero__level {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#pg-carne .carne-hub-xhero__level--diamante { color: #e0f2fe; }
#pg-carne .carne-hub-xhero__level--oro { color: #fef3c7; }
#pg-carne .carne-hub-xhero__level--plata { color: #f5f5f4; }
#pg-carne .carne-hub-xhero__level--base { color: #fecaca; }

#pg-carne .carne-hub-xhero__trend {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 800;
}
#pg-carne .carne-hub-xhero__trend--up { color: #bbf7d0; }
#pg-carne .carne-hub-xhero__trend--down { color: #fecaca; }

#pg-carne .carne-hub-xhero__story {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#pg-carne .carne-hub-xhero__story-lbl {
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}

#pg-carne .carne-hub-xhero__story-val {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

#pg-carne .carne-hub-xhero__benefit {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #e7e5e4;
}

#pg-carne .carne-hub-xhero__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

@media (min-width: 520px) {
  #pg-carne .carne-hub-xhero__kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

#pg-carne .carne-hub-xhero__kpi {
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#pg-carne .carne-hub-xhero__kpi-lbl {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.78;
  margin-bottom: 2px;
}

#pg-carne .carne-hub-xhero__kpi-val {
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pg-carne .carne-hub-xhero__acts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#pg-carne .carne-hub-xhero__btn {
  min-height: 40px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

#pg-carne .carne-hub-xhero__btn-ico {
  display: none;
  flex-shrink: 0;
  line-height: 0;
}

#pg-carne .carne-hub-xhero__btn-ico img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

#pg-carne .carne-hub-xhero__btn-tit {
  display: block;
  line-height: 1.2;
}

#pg-carne .carne-hub-xhero__btn--pri {
  background: linear-gradient(180deg, #fafaf9 0%, #d6d3d1 100%);
  color: #1c1917;
  border-color: #e7e5e4;
}

#pg-carne .carne-hub-xhero__btn--sec {
  background: rgba(255, 255, 255, 0.08);
  color: #fafaf9;
  border-color: rgba(255, 255, 255, 0.22);
}

/* Móvil: recuadros tipo Tools (3 columnas, icono + título) */
@media (max-width: 767px) {
  #pg-carne .carne-hub-xhero__acts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 10px 14px;
    margin-top: 2px;
  }

  #pg-carne .carne-hub-xhero__btn {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-height: 84px;
    padding: 10px 6px;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), 0 1px 2px rgba(15, 23, 42, .08);
  }

  #pg-carne .carne-hub-xhero__btn-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
  }

  #pg-carne .carne-hub-xhero__btn-ico img {
    width: 30px;
    height: 30px;
  }

  #pg-carne .carne-hub-xhero__btn-tit {
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    word-break: break-word;
  }

  #pg-carne .carne-hub-xhero__btn--pri,
  #pg-carne .carne-hub-xhero__btn--sec {
    background: var(--gris-100, #f1f5f9);
    color: var(--texto-base, #334155);
    border: var(--manto-serio-panel-borde, 1px solid #cbd5e1);
  }

  #pg-carne .carne-hub-xhero__btn:active {
    transform: scale(.985);
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  #pg-carne .carne-hub-xhero__btn {
    min-height: 88px;
    padding: 11px 8px;
  }

  #pg-carne .carne-hub-xhero__btn-tit {
    font-size: 11px;
  }
}

@media (min-width: 768px) {
  #pg-carne .carne-hub-xhero__acts {
    grid-template-columns: 1.2fr 1fr 1fr;
    padding: 0;
  }

  #pg-carne .carne-hub-xhero__btn {
    flex-direction: row;
    min-height: 40px;
    padding: 0 12px;
  }
}

/* Insights */
#pg-carne .carne-hub-insights-preview {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--gris-0, #fff);
  border: var(--manto-serio-panel-borde, 1px solid #cbd5e1);
}

#pg-carne .carne-hub-insights-preview__tit {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
  color: var(--texto-fuerte, #0f172a);
}

#pg-carne .carne-hub-insights-preview__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#pg-carne .carne-hub-insight-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid #94a3b8;
  background: var(--gris-50, #f8fafc);
  text-align: left;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
}

#pg-carne .carne-hub-insight-preview--alta { border-left-color: #b91c1c; background: #fef2f2; }
#pg-carne .carne-hub-insight-preview--media { border-left-color: #d97706; background: #fffbeb; }
#pg-carne .carne-hub-insight-preview--info { border-left-color: #64748b; }

#pg-carne .carne-hub-insight-preview__tipo {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--texto-suave, #64748b);
}

#pg-carne .carne-hub-insight-preview__txt {
  font-size: 12px;
  font-weight: 600;
  color: var(--texto-base, #334155);
  line-height: 1.35;
}

/* Launchpad */
#pg-carne .carne-hub-launchpad {
  margin-bottom: 10px;
}

#pg-carne .carne-hub-group {
  margin-bottom: 8px;
  border-radius: 12px;
  border: var(--manto-serio-panel-borde, 1px solid #cbd5e1);
  background: var(--gris-0, #fff);
  overflow: hidden;
}

#pg-carne .carne-hub-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: var(--gris-100, #f1f5f9);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

#pg-carne .carne-hub-group__tit {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: var(--texto-fuerte, #0f172a);
}

#pg-carne .carne-hub-group__sub {
  display: block;
  font-size: 11px;
  color: var(--texto-suave, #64748b);
  margin-top: 2px;
}

#pg-carne .carne-hub-group__chev::after {
  content: '▾';
  font-size: 12px;
  color: var(--texto-suave, #64748b);
}

#pg-carne .carne-hub-group__head[aria-expanded='false'] + .carne-hub-group__body {
  display: none;
}

#pg-carne .carne-hub-pg-grid-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

@media (min-width: 560px) {
  #pg-carne .carne-hub-pg-grid-inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  #pg-carne .carne-hub-group[data-carne-group='operar'] .carne-hub-pg-grid-inner,
  #pg-carne .carne-hub-group[data-carne-group='lotes'] .carne-hub-pg-grid-inner,
  #pg-carne .carne-hub-group[data-carne-group='reportes'] .carne-hub-pg-grid-inner {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #pg-carne .carne-hub-group[data-carne-group='operar'] .carne-hub-pg-tile,
  #pg-carne .carne-hub-group[data-carne-group='lotes'] .carne-hub-pg-tile,
  #pg-carne .carne-hub-group[data-carne-group='reportes'] .carne-hub-pg-tile {
    min-height: 96px;
    padding: 9px 10px;
  }
}

#pg-carne .carne-hub-pg-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--gris-300, #cbd5e1);
  background: var(--gris-50, #f8fafc);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  min-height: 108px;
}

#pg-carne .carne-hub-pg-tile__ico img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

#pg-carne .carne-hub-pg-tile__tit {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--texto-fuerte, #0f172a);
  line-height: 1.25;
}

#pg-carne .carne-hub-pg-tile__desc {
  display: block;
  font-size: 10px;
  color: var(--texto-suave, #64748b);
  line-height: 1.35;
  flex: 1;
}

#pg-carne .carne-hub-pg-tile__cta {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--texto-base, #334155);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Análisis profundo colapsable */
#pg-carne .carne-hub-deep-wrap {
  margin-top: 4px;
}

#pg-carne .carne-hub-deep-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--gris-300, #cbd5e1);
  background: var(--gris-100, #f1f5f9);
  color: var(--texto-base, #334155);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

#pg-carne.carne-hub-deep-collapsed #carne-hub-deep-panel,
#pg-carne.carne-hub-deep-collapsed #carne-hub-deep-panel[hidden] {
  display: none !important;
}

/* Motion */
@keyframes carne-hub-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#pg-carne .carne-hub-xhero--anim .carne-hub-xhero__intro,
#pg-carne .carne-hub-xhero--anim .carne-hub-xhero__core,
#pg-carne .carne-hub-xhero--anim .carne-hub-xhero__acts {
  animation: carne-hub-fade-up 0.5s ease both;
}

#pg-carne .carne-hub-xhero__kpis--anim .carne-hub-xhero__kpi {
  animation: carne-hub-fade-up 0.42s ease both;
}

#pg-carne .carne-hub-xhero__kpis--anim .carne-hub-xhero__kpi:nth-child(1) { animation-delay: 0.08s; }
#pg-carne .carne-hub-xhero__kpis--anim .carne-hub-xhero__kpi:nth-child(2) { animation-delay: 0.14s; }
#pg-carne .carne-hub-xhero__kpis--anim .carne-hub-xhero__kpi:nth-child(3) { animation-delay: 0.2s; }
#pg-carne .carne-hub-xhero__kpis--anim .carne-hub-xhero__kpi:nth-child(4) { animation-delay: 0.26s; }

#pg-carne .carne-hub-insights-preview--anim .carne-hub-insight-preview {
  animation: carne-hub-fade-up 0.4s ease both;
}

#pg-carne .carne-hub-insights-preview--anim .carne-hub-insight-preview:nth-child(2) { animation-delay: 0.1s; }
#pg-carne .carne-hub-insights-preview--anim .carne-hub-insight-preview:nth-child(3) { animation-delay: 0.2s; }

@media (max-width: 380px) {
  #pg-carne .carne-hub-xhero__core {
    flex-direction: column;
    align-items: stretch;
  }
  #pg-carne .carne-hub-xhero__score-col {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pg-carne .carne-hub-xhero--anim * {
    animation: none !important;
  }
}
