/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #111;
  background: #fafafa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
.hero, .cta-section, .footer { flex-shrink: 0; }
.main { flex: 1 0 auto; width: 100%; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: 0; color: inherit; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

:root {
  --azul: #004aad;
  --azul-dark: #003a8c;
  --azul-light: #0a5fcc;
  --blanco: #ffffff;
  --gris-bg: #fafafa;
  --gris-card: #ffffff;
  --gris-borde: #e8eaef;
  --gris-borde-hover: #c5cbd6;
  --gris-texto: #4a4f5a;
  --gris-suave: #6b7280;
  --negro: #111;
  --radio: 14px;
  --radio-sm: 10px;
  --sombra: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,74,173,.06);
  --sombra-hover: 0 4px 12px rgba(0,0,0,.06), 0 16px 40px rgba(0,74,173,.15);
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ============ HERO ============ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #004aad 0%, #003285 100%);
  color: #fff;
  padding: 72px 0 96px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.12), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255,255,255,.08), transparent 50%);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }
.logo {
  height: 56px;
  width: auto;
  margin: 0 auto 32px;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,.15));
}
.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 44px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* SEARCH */
.search-wrap {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.search-wrap input {
  width: 100%;
  height: 64px;
  padding: 0 56px 0 60px;
  background: #fff;
  border-radius: 999px;
  border: 0;
  font-size: 1.05rem;
  color: #111;
  box-shadow: 0 10px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
  outline: none;
  transition: box-shadow .2s, transform .2s;
}
.search-wrap input::placeholder { color: #9ba1ad; }
.search-wrap input:focus {
  box-shadow: 0 12px 48px rgba(0,0,0,.25), 0 0 0 4px rgba(255,255,255,.25);
}
.search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  color: var(--azul);
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #eef0f4;
  color: #6b7280;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.search-clear:hover { background: #dfe2e8; color: #111; }

/* ============ MAIN ============ */
.main { padding: 40px 24px 80px; }

/* FILTROS (chips) */
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 4px;
}
.chip {
  padding: 9px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--gris-borde);
  color: var(--gris-texto);
  font-size: .92rem;
  font-weight: 500;
  transition: all .15s;
}
.chip:hover {
  border-color: var(--azul);
  color: var(--azul);
}
.chip.activo {
  background: var(--azul);
  color: #fff;
  border-color: var(--azul);
}

.resultados-meta {
  color: var(--gris-suave);
  font-size: .9rem;
  margin-bottom: 18px;
  font-weight: 500;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--gris-card);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--azul);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-hover);
  border-color: transparent;
}
.card:hover::before { transform: scaleX(1); }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radio-sm);
  background: rgba(0,74,173,.08);
  color: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.card-icon svg { width: 22px; height: 22px; }

.card-seccion {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--azul);
  background: rgba(0,74,173,.08);
  padding: 4px 10px;
  border-radius: 6px;
  align-self: flex-start;
}
.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--negro);
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.card-desc {
  font-size: .92rem;
  color: var(--gris-texto);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--azul);
  font-size: .88rem;
  font-weight: 600;
}
.card-footer svg { width: 16px; height: 16px; }

/* MINIATURA DE VIDEO (portada automatica YouTube/Vimeo) */
.card-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radio-sm);
  overflow: hidden;
  background: #eef1f4;
  margin-bottom: 4px;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 50%;
  pointer-events: none;
}
.card-thumb-play svg { width: 22px; height: 22px; margin-left: 2px; }

/* ---- ETIQUETAS DESTACADAS: NUEVO / TENDENCIA ---- */
.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.card-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.badge-nuevo {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,.45);
}
.badge-trend {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-light) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,74,173,.45);
}

/* Halo alrededor de la tarjeta destacada (se ve en la rejilla). */
/* Nuevo = aro verde · Top = aro azul */
.card.card-is-nuevo {
  border-color: #059669;
  box-shadow: 0 0 0 4px rgba(5,150,105,.15), 0 10px 28px rgba(5,150,105,.25);
}
.card.card-is-top {
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(0,74,173,.15), 0 10px 28px rgba(0,74,173,.25);
}
.card.card-is-nuevo:hover { box-shadow: 0 0 0 4px rgba(5,150,105,.20), var(--sombra-hover); }
.card.card-is-top:hover { box-shadow: 0 0 0 4px rgba(0,74,173,.20), var(--sombra-hover); }

/* VACIO */
.vacio {
  padding: 80px 24px;
  text-align: center;
  color: var(--gris-suave);
}
.vacio svg { width: 48px; height: 48px; margin: 0 auto 18px; opacity: .35; }
.vacio p { font-size: 1.2rem; font-weight: 600; color: var(--negro); margin-bottom: 6px; }
.vacio small { font-size: .95rem; }

/* ============ CTA ============ */
.cta-section {
  padding: 56px 24px 84px;
  text-align: center;
}
.cta-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 52px 44px 56px;
  background:
    radial-gradient(120% 150% at 50% 0%, rgba(0,74,173,.07) 0%, rgba(0,74,173,0) 62%),
    var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,.03), 0 24px 64px rgba(0,74,173,.09);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cta-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--azul);
  background: rgba(0,74,173,.08);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.cta-headline {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--negro);
  margin: 0;
}
.cta-text {
  font-size: 1.05rem;
  color: var(--gris-texto);
  max-width: 440px;
  margin: 12px 0 30px;
  line-height: 1.5;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #004aad 0%, #0a5fcc 50%, #004aad 100%);
  background-size: 200% 200%;
  color: #fff;
  padding: 22px 52px;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 36px rgba(0,74,173,.4), 0 3px 8px rgba(0,74,173,.2);
  text-align: center;
  max-width: 100%;
  position: relative;
  isolation: isolate;
  animation: ctaFloat 2.4s ease-in-out infinite, ctaGradient 4s ease-in-out infinite;
  transition: background .2s, box-shadow .25s, transform .15s;
  z-index: 1;
}
.cta-btn::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(10,95,204,.55) 0%, rgba(0,74,173,.25) 40%, transparent 70%);
  z-index: -1;
  animation: ctaGlow 2.4s ease-in-out infinite;
  filter: blur(8px);
}
.cta-btn .cta-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  animation: ctaArrow 1.4s ease-in-out infinite;
}
.cta-btn:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 22px 50px rgba(0,74,173,.55), 0 6px 14px rgba(0,74,173,.25);
}
.cta-btn:hover::before { animation-play-state: paused; opacity: 1; }
.cta-btn:hover .cta-arrow { animation-play-state: paused; transform: translateX(4px); }
.cta-btn:active { transform: translateY(-2px) scale(1.01); }

@keyframes ctaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes ctaGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes ctaGlow {
  0%, 100% { opacity: .45; transform: scale(1); }
  50% { opacity: .85; transform: scale(1.12); }
}
@keyframes ctaArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* CTA dentro del modal */
.modal-cta-wrap {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gris-borde);
  text-align: center;
}
.cta-btn.cta-modal {
  padding: 16px 38px;
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .cta-btn,
  .cta-btn::after { animation: none; }
}

@media (max-width: 640px) {
  .cta-section { padding: 28px 16px 64px; }
  .cta-wrap { padding: 38px 22px 40px; border-radius: 22px; }
  .cta-text { font-size: 1rem; }
  .cta-btn { padding: 16px 28px; font-size: 1rem; width: 100%; }
}

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--gris-borde);
  padding: 28px 0;
  background: #fff;
  color: var(--gris-suave);
  font-size: .88rem;
}
.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.footer-credit {
  color: var(--gris-suave);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s;
}
.footer-credit:hover { color: var(--azul); }

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .15s ease;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,20,35,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
  animation: scaleIn .2s ease;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #f3f4f7;
  color: #4a4f5a;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: #e3e6ec; }
.modal-seccion {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--azul);
  background: rgba(0,74,173,.08);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--negro);
  line-height: 1.25;
}
.modal-desc {
  color: var(--gris-texto);
  margin-bottom: 24px;
  font-size: .98rem;
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-primary, .btn-ghost {
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex: 1;
  min-width: 130px;
}
.btn-primary {
  background: var(--azul);
  color: #fff;
}
.btn-primary:hover { background: var(--azul-dark); transform: translateY(-1px); }
.btn-ghost {
  background: #f3f4f7;
  color: var(--negro);
  border: 1px solid var(--gris-borde);
}
.btn-ghost:hover { background: #e8eaef; }
.btn-primary[hidden], .btn-ghost[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ============ RESPONSIVE ============ */

/* Laptop / pantalla pequeña */
@media (max-width: 1024px) {
  .container { max-width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* Tablet */
@media (max-width: 900px) {
  .hero { padding: 60px 0 80px; }
  .hero-title { font-size: clamp(2.2rem, 5vw, 3rem); }
  .hero-sub { margin-bottom: 34px; }
  .main { padding: 32px 24px 64px; }
  .modal { padding: 16px; }
}

/* Móvil grande */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .hero { padding: 48px 0 64px; }
  .logo { height: 44px; margin-bottom: 22px; }
  .hero-title { font-size: 2.2rem; line-height: 1.1; }
  .hero-sub { font-size: 1rem; margin-bottom: 26px; padding: 0 8px; }
  .search-wrap input { height: 56px; font-size: 1rem; padding: 0 50px 0 52px; }
  .search-wrap input:focus { box-shadow: 0 8px 28px rgba(0,0,0,.18), 0 0 0 3px rgba(255,255,255,.2); }
  .search-icon { left: 20px; width: 20px; height: 20px; }
  .search-clear { right: 14px; width: 28px; height: 28px; }
  .main { padding: 28px 0 56px; }
  .filtros { gap: 8px; margin-bottom: 22px; }
  .chip { padding: 8px 14px; font-size: .88rem; }
  .resultados-meta { padding: 0 4px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 20px; }
  .card-title { font-size: 1.05rem; }
  .card-desc { -webkit-line-clamp: 4; }
  .vacio { padding: 56px 16px; }
  .modal { padding: 0; align-items: stretch; }
  .modal-card,
  .modal-card.modal-card-wide,
  .modal-card.modal-card-full {
    border-radius: 0;
    padding: 56px 18px 22px;
    max-width: 100%;
    max-height: 100vh;
    width: 100%;
    overflow-y: auto;
  }
  .modal-close { top: 12px; right: 12px; }
  .modal-title { font-size: 1.25rem; }
  .modal-actions { flex-direction: column; gap: 8px; }
  .modal-actions .btn-primary,
  .modal-actions .btn-ghost { width: 100%; flex: 1 1 auto; min-width: 0; }
  .footer { padding: 22px 0; font-size: .82rem; }
}

/* Móvil mediano */
@media (max-width: 480px) {
  .hero { padding: 42px 0 56px; }
  .hero-title { font-size: 2rem; }
  .hero-sub { font-size: .96rem; margin-bottom: 22px; }
  .logo { height: 40px; margin-bottom: 18px; }
  .search-wrap input { height: 54px; padding: 0 48px 0 50px; }
}

/* Móvil pequeño (iPhone SE, etc.) */
@media (max-width: 380px) {
  .container { padding: 0 16px; }
  .hero { padding: 38px 0 52px; }
  .hero-title { font-size: 1.85rem; }
  .hero-sub { font-size: .92rem; padding: 0 4px; }
  .logo { height: 36px; }
  .search-wrap input { height: 50px; font-size: .94rem; padding: 0 44px 0 44px; }
  .search-icon { left: 14px; }
  .card { padding: 18px; }
  .chip { padding: 7px 12px; font-size: .84rem; }
}

/* ============ ADMIN ============ */
.admin-body {
  background: #f4f6fa;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
}

/* LOGIN */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #004aad 0%, #003285 100%);
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 44px 36px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  text-align: center;
}
.login-card img {
  height: 40px;
  margin: 0 auto 24px;
  filter: brightness(0) saturate(100%) invert(20%) sepia(89%) saturate(2410%) hue-rotate(207deg) brightness(95%) contrast(102%);
}
.login-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #111;
}
.login-card p {
  color: #6b7280;
  font-size: .92rem;
  margin-bottom: 28px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  height: 50px;
  padding: 0 18px;
  border: 1.5px solid #e8eaef;
  border-radius: 10px;
  font-size: .98rem;
  outline: none;
  transition: border-color .15s;
}
.login-form input:focus { border-color: #004aad; }
.login-form button {
  height: 50px;
  background: #004aad;
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: .98rem;
  margin-top: 6px;
  transition: background .15s;
}
.login-form button:hover { background: #003a8c; }
.login-error {
  background: #fee;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: 12px;
}
.login-volver {
  display: inline-block;
  margin-top: 18px;
  color: #6b7280;
  font-size: .88rem;
}
.login-volver:hover { color: #004aad; }

/* ADMIN HEADER */
.admin-header {
  background: #fff;
  border-bottom: 1px solid #e8eaef;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1rem;
  color: #111;
}
.admin-brand img { height: 28px; }
.admin-actions { display: flex; gap: 10px; }
.admin-logout {
  padding: 8px 14px;
  background: #f3f4f7;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: #4a4f5a;
  transition: background .15s;
}
.admin-logout:hover { background: #e3e6ec; }
.btn-add {
  padding: 8px 16px;
  background: #004aad;
  color: #fff;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.btn-add:hover { background: #003a8c; }

/* ADMIN LAYOUT */
.admin-main { padding: 40px 0 80px; }
.admin-titulo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: #111;
}
.admin-subtitulo { color: #6b7280; margin-bottom: 32px; }

/* FORM */
.admin-panel {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  border: 1px solid #e8eaef;
  margin-bottom: 28px;
}
.admin-panel h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: #111;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.form-grid input[type="text"],
.form-grid input[type="url"],
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e8eaef;
  border-radius: 8px;
  font-size: .94rem;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
  background: #fff;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus { border-color: #004aad; }
.form-grid textarea { resize: vertical; min-height: 80px; }
.form-grid input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed #c5cbd6;
  border-radius: 8px;
  background: #fafafa;
  font-size: .9rem;
}
.form-help {
  font-size: .8rem;
  color: #6b7280;
  margin-top: 4px;
}
.form-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
}
.btn-guardar {
  background: #004aad;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s;
}
.btn-guardar:hover { background: #003a8c; }
.btn-cancelar {
  background: #f3f4f7;
  color: #4a4f5a;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .95rem;
}
.btn-cancelar:hover { background: #e3e6ec; }

/* FLASH MESSAGES */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: .92rem;
  font-weight: 500;
}
.flash-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* TABLE / LIST */
.recursos-lista {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8eaef;
  overflow: hidden;
}
.recurso-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid #f0f2f6;
  transition: background .15s;
}
.recurso-row:last-child { border-bottom: 0; }
.recurso-row:hover { background: #fafbfd; }
.recurso-icon {
  width: 40px; height: 40px;
  background: rgba(0,74,173,.08);
  color: #004aad;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recurso-icon svg { width: 20px; height: 20px; }
.recurso-info { min-width: 0; }
.recurso-titulo {
  font-weight: 600;
  color: #111;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recurso-meta {
  font-size: .82rem;
  color: #6b7280;
  display: flex;
  gap: 10px;
  align-items: center;
}
.recurso-tag {
  background: rgba(0,74,173,.08);
  color: #004aad;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.recurso-acciones { display: flex; gap: 6px; }
.btn-mini {
  padding: 7px 12px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  background: #f3f4f7;
  color: #4a4f5a;
  border: 0;
}
.btn-mini:hover { background: #e3e6ec; }
.btn-mini.danger { color: #b91c1c; }
.btn-mini.danger:hover { background: #fee2e2; color: #991b1b; }

.lista-vacia {
  padding: 56px 24px;
  text-align: center;
  color: #6b7280;
}
.lista-vacia p { font-weight: 600; color: #111; margin-bottom: 4px; }

@media (max-width: 640px) {
  .admin-header { padding: 14px 0; }
  .admin-header-inner { gap: 12px; }
  .admin-brand span { font-size: .92rem; }
  .admin-brand img { height: 24px; }
  .admin-logout { padding: 6px 10px; font-size: .8rem; }
  .admin-main { padding: 28px 0 56px; }
  .admin-titulo { font-size: 1.4rem; }
  .admin-panel { padding: 20px 18px; }
  .admin-panel h2 { font-size: 1rem; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-actions { flex-direction: column; gap: 8px; }
  .form-actions button { width: 100%; }
  .recurso-row { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; }
  .recurso-acciones { justify-content: flex-end; flex-wrap: wrap; }
  .cat-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cat-info { flex-wrap: wrap; }
  .login-card { padding: 32px 24px 28px; }
  .login-card h1 { font-size: 1.2rem; }
}

/* ============ TIPOS DE CONTENIDO ============ */

/* Card por tipo: pinta borde superior según tipo */
.card.tipo-pdf::before    { background: #004aad; }
.card.tipo-texto::before  { background: #6b46c1; }
.card.tipo-video::before  { background: #dc2626; }
.card.tipo-link::before   { background: #059669; }

/* Iconos del admin por tipo */
.recurso-icon.tipo-pdf    { background: rgba(0,74,173,.08);  color: #004aad; }
.recurso-icon.tipo-texto  { background: rgba(107,70,193,.1); color: #6b46c1; }
.recurso-icon.tipo-video  { background: rgba(220,38,38,.1);  color: #dc2626; }
.recurso-icon.tipo-link   { background: rgba(5,150,105,.1);  color: #059669; }

/* Tag de tipo en categorías */
.cat-tipo-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cat-tipo-tag.tipo-pdf    { background: rgba(0,74,173,.08);  color: #004aad; }
.cat-tipo-tag.tipo-texto  { background: rgba(107,70,193,.1); color: #6b46c1; }
.cat-tipo-tag.tipo-video  { background: rgba(220,38,38,.1);  color: #dc2626; }
.cat-tipo-tag.tipo-link   { background: rgba(5,150,105,.1);  color: #059669; }

/* Lista de categorías en admin */
.cats-lista { margin-top: 22px; border-top: 1px solid #f0f2f6; padding-top: 18px; }
.cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f5f6f9;
  gap: 12px;
}
.cat-row:last-child { border-bottom: 0; }
.cat-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cat-nombre { font-weight: 600; color: #111; }
.cat-count { font-size: .82rem; color: #6b7280; }
.lista-mini { color: #6b7280; font-size: .9rem; padding: 8px 0; }

/* Modal extra (vídeo embed, PDF, texto) */
.modal-extra { margin-bottom: 20px; }
.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.pdf-wrap {
  width: 100%;
  height: 70vh;
  min-height: 400px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f7;
  border: 1px solid var(--gris-borde);
}
.pdf-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.texto-block {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: .92rem;
  background: #f7f8fb;
  border: 1px solid #e8eaef;
  border-radius: 10px;
  padding: 16px 18px;
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #1a1a1a;
  line-height: 1.55;
}

/* Tamaños de modal */
.modal-card { max-width: 540px; }
.modal-card.modal-card-wide { max-width: 820px; }
.modal-card.modal-card-full {
  max-width: 1100px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

@media (max-width: 900px) {
  .pdf-wrap { height: 65vh; min-height: 360px; }
  .modal-card.modal-card-full { max-height: calc(100vh - 32px); }
}
@media (max-width: 640px) {
  .video-wrap { border-radius: 8px; }
  .pdf-wrap { height: 60vh; min-height: 320px; border-radius: 8px; }
  .texto-block { font-size: .88rem; padding: 14px; }
}

/* ============================================================
   REDISEÑO VISUAL v5 — logos, banners, redes
   ============================================================ */

/* ---- CINTA DE LOGOS EN EL HERO ---- */
.hero-logos {
  position: relative;
  margin-top: 40px;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.hero-logos-track {
  display: flex;
  width: max-content;
  gap: 14px;
  animation: heroMarquee 48s linear infinite;
}
.hero-logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px;
}
.hero-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
@keyframes heroMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-logos-track { animation: none; flex-wrap: wrap; justify-content: center; }
  .hero-logos { -webkit-mask-image: none; mask-image: none; }
}

/* ---- LAYOUT CON COLUMNA LATERAL ---- */
.layout { display: block; }
.layout.con-aside { display: grid; grid-template-columns: 1fr; gap: 28px; }
.aside-col { display: flex; flex-direction: column; gap: 20px; }
.aside-col[hidden] { display: none; }
@media (min-width: 1024px) {
  .layout.con-aside { grid-template-columns: minmax(0, 1fr) 300px; }
  .aside-col { position: sticky; top: 24px; align-self: start; }
}

/* ---- BANNERS (arriba / abajo / lateral) ---- */
.banner-slot:empty { display: none; }
.banner-slot-top { margin: 0 0 28px; display: flex; flex-direction: column; gap: 16px; }
.banner-slot-bottom { margin: 36px 0 0; display: flex; flex-direction: column; gap: 16px; }

.banner-link {
  position: relative;
  display: block;
  border-radius: var(--radio);
  overflow: hidden;
  border: 1px solid var(--gris-borde);
  background: #fff;
  box-shadow: var(--sombra);
  transition: transform .2s, box-shadow .2s;
}
a.banner-link:hover { transform: translateY(-2px); box-shadow: var(--sombra-hover); }
.banner-link img { width: 100%; height: auto; display: block; }

/* Franja horizontal: relación 4:1 aprox., recorta con cariño si no encaja */
.banner-h .banner-link {
  max-width: 100%;
}
.banner-h .banner-link img {
  width: 100%;
  aspect-ratio: 4 / 1;
  object-fit: cover;
}

/* Lateral: 300x600 (media página) */
.banner-side .banner-link img {
  width: 100%;
  aspect-ratio: 1 / 2;
  object-fit: cover;
}

.banner-badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  background: rgba(17,20,30,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
}

/* Tarjeta promocionada dentro del grid */
.card-banner {
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.card-banner .card-banner-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f4f7;
}
.card-banner .card-banner-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-banner .card-title { padding: 16px 18px; }
.banner-badge-card { top: 10px; left: 10px; }
.card-banner::before { display: none; }

/* ---- LOGO EN LA TARJETA ---- */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}
.card-top .card-seccion { align-self: center; margin: 0; }
.card-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--gris-borde);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  transition: transform .2s, box-shadow .2s;
}
.card:hover .card-logo { transform: scale(1.06); box-shadow: 0 6px 18px rgba(0,74,173,.16); }
.card-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
/* Si no hay logo (o falla la carga): cuadrado de marca con inicial */
.card-logo.card-logo-fallback {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-light) 100%);
  border-color: transparent;
}
.card-logo.card-logo-fallback::after {
  content: '';
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(255,255,255,.9);
}

/* ---- MODAL: CABECERA CON LOGO ---- */
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.modal-logo {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--gris-borde);
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
}
.modal-logo[hidden] { display: none; }
.modal-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.modal-head-text { min-width: 0; }
.modal-head .modal-seccion { margin-bottom: 6px; }
.modal-head .modal-title { margin-bottom: 0; }

/* ---- FOOTER: REDES SOCIALES ---- */
.footer-inner { gap: 18px; flex-wrap: wrap; }
.footer-social { display: flex; align-items: center; gap: 10px; }
.social-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform .15s, box-shadow .2s, filter .15s;
}
.social-btn svg { width: 21px; height: 21px; }
.social-btn:hover { transform: translateY(-2px) scale(1.05); }
.social-ig { background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5); }
.social-ig:hover { box-shadow: 0 8px 22px rgba(214,41,118,.4); }
.social-wa { background: #25D366; }
.social-wa:hover { box-shadow: 0 8px 22px rgba(37,211,102,.4); }

/* ---- RESPONSIVE del rediseño ---- */
@media (max-width: 1023px) {
  /* En tablet/móvil la columna lateral pasa debajo del contenido pero sigue visible */
  .layout.con-aside { grid-template-columns: 1fr; }
  .aside-col { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .banner-side { max-width: 320px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .hero-logos { margin-top: 30px; }
  .hero-logo { width: 44px; height: 44px; border-radius: 12px; padding: 9px; }
  .card-logo { width: 46px; height: 46px; border-radius: 12px; padding: 8px; }
  .modal-logo { width: 48px; height: 48px; }
  .banner-slot-top { margin-bottom: 20px; }
  .banner-slot-bottom { margin-top: 24px; }
  .footer-inner { flex-direction: column; gap: 14px; }
}

/* ============================================================
   ADMIN v5 — buscador de logos, banners, modal de logo
   ============================================================ */
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: #374151; }
.check-inline input { width: 18px; height: 18px; }

/* Buscador de logos */
.logo-picker { border: 1.5px solid #e8eaef; border-radius: 10px; padding: 12px; background: #fafbfd; }
.lp-bar { display: flex; gap: 8px; align-items: center; }
.lp-search {
  flex: 1; height: 42px; padding: 0 14px;
  border: 1.5px solid #e8eaef; border-radius: 8px; font-size: .94rem; outline: none; background: #fff;
}
.lp-search:focus { border-color: #004aad; }
.lp-clear {
  height: 42px; padding: 0 14px; border-radius: 8px; background: #f3f4f7; color: #4a4f5a;
  font-size: .85rem; font-weight: 600; flex-shrink: 0;
}
.lp-clear:hover { background: #e3e6ec; }
.lp-preview {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  padding: 10px 12px; background: #fff; border: 1px solid #e8eaef; border-radius: 8px;
}
.lp-preview img { width: 40px; height: 40px; object-fit: contain; }
.lp-preview span { font-weight: 600; color: #111; font-size: .9rem; }
.lp-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; margin-top: 12px;
}
.lp-results:empty { margin-top: 0; }
.lp-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border: 1px solid #e8eaef; border-radius: 8px; background: #fff;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.lp-item:hover { border-color: #004aad; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,74,173,.12); }
.lp-thumb { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
.lp-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lp-name {
  font-size: .68rem; color: #6b7280; text-align: center; line-height: 1.2;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lp-empty, .lp-loading { grid-column: 1 / -1; color: #6b7280; font-size: .85rem; padding: 6px 2px; }

/* Logo en la lista de recursos del admin */
.recurso-logo {
  width: 40px; height: 40px; flex-shrink: 0;
  background: #fff; border: 1px solid #e8eaef; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 7px;
}
.recurso-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Subida de banner: miniaturas con × + botón "+ Añadir imagen" */
.banner-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.banner-thumbs:empty { display: none; }
.bu-thumb { position: relative; width: 130px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid #e8eaef; background: #f3f4f7; }
.bu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bu-x {
  position: absolute; top: 5px; right: 5px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(17,20,30,.72); color: #fff;
  font-size: 1.15rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.bu-x:hover { background: #b91c1c; }

/* Recorte visual del banner: recuadro arrastrable sobre la imagen */
.bu-crop { position: relative; display: inline-block; vertical-align: top; }
.bu-stage { position: relative; border-radius: 10px; overflow: hidden; background: #f3f4f7; border: 1px solid #e8eaef; }
.bu-img { position: absolute; left: 0; top: 0; max-width: none; display: block; -webkit-user-drag: none; user-select: none; }
.bu-box {
  position: absolute; box-sizing: border-box;
  border: 2px solid #004aad;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.42);
  cursor: move; touch-action: none;
}
.bu-box::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 33.33% 33.33%; pointer-events: none; opacity: .55;
}
.bu-crop .bu-x { z-index: 4; }
.btn-add-img {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px; border: 1.5px dashed #c5cbd6; border-radius: 10px;
  background: #fafafa; color: #004aad; font-weight: 600; font-size: .92rem;
  transition: border-color .15s, background .15s;
}
.btn-add-img:hover { border-color: #004aad; background: #f0f5ff; }
/* compat: preview antiguo */
.banner-preview { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.banner-preview img { max-width: 160px; max-height: 110px; border-radius: 10px; border: 1px solid #e8eaef; object-fit: cover; }

/* Aviso flotante (toast) — no obliga a subir al inicio */
.flash {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 400; min-width: 240px; max-width: 92vw; text-align: center;
  box-shadow: 0 14px 36px rgba(0,0,0,.2);
  transition: opacity .4s ease, transform .4s ease;
}
.flash.flash-hide { opacity: 0; transform: translateX(-50%) translateY(-14px); }

/* Barra de acceso rápido del admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.admin-nav a {
  padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid #e8eaef;
  font-size: .85rem; font-weight: 600; color: #4a4f5a;
  transition: border-color .15s, color .15s, background .15s;
}
.admin-nav a:hover { border-color: #004aad; color: #004aad; background: #f0f5ff; }

/* Campos dentro del modal de editar */
.logo-modal .form-grid { margin-bottom: 4px; }
.logo-modal textarea { min-height: 70px; }

/* ============================================================
   v6 — responsive fino, accesibilidad y pulido (auditoría)
   ============================================================ */

/* Selección de texto con color de marca */
::selection { background: rgba(0,74,173,.18); color: var(--negro); }

/* Foco accesible (solo teclado) */
.chip:focus-visible, .tool-chip:focus-visible, .card:focus-visible,
.search-clear:focus-visible, .modal-close:focus-visible,
.btn-primary:focus-visible, .btn-ghost:focus-visible, .cta-btn:focus-visible,
.social-btn:focus-visible, .banner-link:focus-visible, .btn-mini:focus-visible,
.btn-guardar:focus-visible, .btn-add-img:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(0,74,173,.35);
}
.card:focus-visible { box-shadow: 0 0 0 3px rgba(0,74,173,.35), var(--sombra-hover); }
.search-wrap input:focus-visible { box-shadow: 0 12px 48px rgba(0,0,0,.25), 0 0 0 4px rgba(255,255,255,.55); }
.login-form input:focus, .form-grid input:focus, .form-grid select:focus,
.form-grid textarea:focus, .lp-search:focus { box-shadow: 0 0 0 3px rgba(0,74,173,.2); }

/* Contraste AA */
.search-wrap input::placeholder { color: #7c828e; }
.resultados-meta, .footer { color: #5b616e; }

/* Señal de tipo siempre visible en la tarjeta + punto de color */
.card.tipo-pdf { --tipo: #004aad; } .card.tipo-texto { --tipo: #6b46c1; }
.card.tipo-video { --tipo: #dc2626; } .card.tipo-link { --tipo: #059669; }
.card::before { transform: scaleX(1); opacity: .3; transition: opacity .25s, height .25s; }
.card:hover::before { opacity: 1; height: 4px; }
.card-seccion::before, .modal-card .modal-seccion::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--tipo, var(--azul)); margin-right: 6px; vertical-align: middle;
}
.modal-card.tipo-pdf { --tipo: #004aad; } .modal-card.tipo-texto { --tipo: #6b46c1; }
.modal-card.tipo-video { --tipo: #dc2626; } .modal-card.tipo-link { --tipo: #059669; }

/* Cinta de logos del hero: pausa al pasar el ratón */
.hero-logos:hover .hero-logos-track { animation-play-state: paused; }
.hero-logo { transition: transform .2s ease, box-shadow .2s ease; }
.hero-logos:hover .hero-logo:hover { transform: translateY(-3px) scale(1.08); box-shadow: 0 10px 26px rgba(0,0,0,.22); }

/* Feedback "press" al pulsar */
.chip:active, .tool-chip:active { transform: scale(.96); }
.card:active { transform: translateY(-1px) scale(.995); }
.btn-primary:active, .btn-ghost:active, .btn-guardar:active, .btn-add-img:active, .btn-mini:active { transform: translateY(1px); }
.modal-close:active { transform: scale(.9); }

/* En táctil no dejar estados hover "pegados" */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--sombra); border-color: var(--gris-borde); }
  .card:hover .card-logo { transform: none; }
  a.banner-link:hover .banner-cta { background: #fff; color: var(--azul); }
  .tool-chip:hover, .chip:hover { box-shadow: none; }
}

/* Reduced-motion completo */
@media (prefers-reduced-motion: reduce) {
  .cta-btn, .cta-btn::before, .cta-btn .cta-arrow { animation: none !important; }
  .hero-logos-track { animation: none; }
  .card, .banner-link, .social-btn, .hero-logo, .bc-slide { transition: none; }
}

/* Skeleton de carga */
.skeleton-card {
  background: var(--gris-card); border: 1px solid var(--gris-borde);
  border-radius: var(--radio); padding: 24px;
  display: flex; flex-direction: column; gap: 14px; min-height: 180px;
}
.sk-line { border-radius: 8px; background: #eef0f4; position: relative; overflow: hidden; }
.sk-logo { width: 48px; height: 48px; border-radius: 13px; }
.sk-badge { width: 84px; height: 16px; }
.sk-title { width: 70%; height: 18px; }
.sk-text { width: 100%; height: 12px; }
.sk-text.short { width: 55%; }
.sk-line::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: skShimmer 1.3s infinite;
}
@keyframes skShimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk-line::after { animation: none; } }

/* ---------- RESPONSIVE: FRONTEND ---------- */
@media (max-width: 1023px) {
  /* banner lateral en fila: formato apaisado, no torre */
  .aside-col { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .banner-side { max-width: 320px; flex: 1 1 240px; }
  .banner-side .banner-carousel, .banner-side .banner-link img { aspect-ratio: 16 / 9; }
}
@media (min-width: 1024px) {
  .aside-col { max-height: calc(100vh - 48px); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
  .banner-h .banner-carousel, .banner-h .banner-link img { aspect-ratio: 3 / 1; }
  .chip { min-height: 40px; display: inline-flex; align-items: center; padding: 9px 16px; }
  .tool-chip { min-height: 40px; padding: 7px 14px 7px 9px; }
  .search-clear { width: 34px; height: 34px; right: 12px; font-size: 1.3rem; }
}
@media (max-width: 480px) {
  .card-top { flex-wrap: wrap; gap: 8px; }
  .card-logos { flex-shrink: 0; }
  .card-seccion { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modal-head { flex-wrap: wrap; gap: 10px; }
  .modal-logo { flex-wrap: wrap; }
  .modal-logo-item { width: 44px; height: 44px; padding: 8px; }
}
@media (max-width: 380px) { .chip { padding: 8px 13px; } }

/* ---------- RESPONSIVE: ADMIN ---------- */
/* Toast por debajo del header sticky */
.flash { top: 76px; }
@media (max-width: 640px) {
  .flash { top: 68px; min-width: 0; width: calc(100% - 24px); max-width: calc(100% - 24px); left: 12px; right: 12px; transform: none; font-size: .86rem; padding: 11px 14px; }
  .flash.flash-hide { transform: translateY(-14px); }
}
/* admin-nav: una fila con scroll en móvil */
@media (max-width: 640px) {
  .admin-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -18px 24px; padding: 0 18px 4px; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a { flex-shrink: 0; }
}
/* buscador de logos: apilar en móvil */
@media (max-width: 560px) {
  .lp-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .lp-search { width: 100%; }
  .lp-clear { width: 100%; height: 40px; }
}
/* acciones de recurso y de banner: a lo ancho y alineadas en móvil */
@media (max-width: 640px) {
  .recurso-acciones { width: 100%; justify-content: stretch; gap: 8px; }
  .recurso-acciones form { display: flex; flex: 1; margin: 0; }
  .recurso-acciones > .btn-mini, .recurso-acciones > a.btn-mini { flex: 1; }
  .recurso-acciones .btn-mini { width: 100%; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 10px; font-size: .85rem; }
  .banner-admin-url { max-width: 100%; }
}
@media (max-width: 400px) {
  .bu-thumb { width: calc(50% - 5px); height: auto; aspect-ratio: 130 / 84; }
  .btn-add-img { width: 100%; justify-content: center; }
}
/* Modal de editar a pantalla completa en móvil (con barra dinámica) */
@media (max-width: 640px) {
  .logo-modal { padding: 0; align-items: stretch; }
  .logo-modal-card {
    border-radius: 0; max-width: 100%; width: 100%;
    max-height: 100dvh; min-height: 100dvh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .logo-modal .modal-close { top: 12px; right: 12px; }
  .logo-modal .admin-panel-h2 { padding-right: 44px; }
  .logo-modal .form-actions { flex-direction: column; gap: 8px; }
  .logo-modal .form-actions .btn-guardar, .logo-modal .form-actions .btn-cancelar { width: 100%; }
}

/* Preview de banner: el thumb adopta la proporción real de la ubicación */
.banner-thumbs.ar-arriba .bu-thumb, .banner-thumbs.ar-abajo .bu-thumb { width: 220px; height: 55px; aspect-ratio: auto; }
.banner-thumbs.ar-lateral .bu-thumb { width: 116px; height: 140px; aspect-ratio: auto; }
.banner-thumbs.ar-tarjeta .bu-thumb { width: 130px; height: 98px; aspect-ratio: auto; }

/* Lista de banners en el admin */
.banner-admin-list { margin-top: 22px; border-top: 1px solid #f0f2f6; padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.banner-admin-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 12px 14px; border: 1px solid #eef0f4; border-radius: 10px; background: #fff;
}
.banner-admin-thumb {
  width: 96px; height: 56px; border-radius: 8px; overflow: hidden; background: #f3f4f7;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.banner-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.banner-admin-info { min-width: 0; }
.banner-admin-top { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.banner-estado { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.banner-estado.on { background: #ecfdf5; color: #047857; }
.banner-estado.off { background: #f3f4f7; color: #6b7280; }
.banner-admin-titulo { font-weight: 600; color: #111; font-size: .92rem; }
.banner-admin-url { font-size: .78rem; color: #6b7280; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.banner-admin-url:hover { color: #004aad; }

/* Modal cambiar logo */
.logo-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.logo-modal[hidden] { display: none; }
.logo-modal-backdrop { position: absolute; inset: 0; background: rgba(15,20,35,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.logo-modal-card {
  position: relative; background: #fff; border-radius: 16px; padding: 28px 26px 24px;
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.admin-panel-h2 { font-size: 1.2rem; font-weight: 800; color: #111; margin-bottom: 4px; }

@media (max-width: 640px) {
  .banner-admin-row { grid-template-columns: 1fr; }
  .banner-admin-thumb { width: 100%; height: 120px; }
  .lp-results { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* ============================================================
   v5.1 — logos múltiples por tarjeta + filtro por herramienta
   ============================================================ */

/* Cluster de logos en la tarjeta */
.card-logos { display: flex; align-items: center; gap: 7px; }
.card-logos .card-logo { width: 48px; height: 48px; padding: 8px; margin: 0; }
.card-logos .card-logo:nth-child(n+2) { width: 44px; height: 44px; }

/* Filtro por herramienta (chips con logo) */
.filtros-tool {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 2px 0 24px;
  padding-bottom: 4px;
}
.filtros-tool[hidden] { display: none; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px 6px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--gris-borde);
  color: var(--gris-texto);
  font-size: .84rem; font-weight: 600;
  transition: border-color .15s, color .15s, box-shadow .2s, background .15s;
}
.tool-chip img { width: 20px; height: 20px; object-fit: contain; }
.tool-chip span { line-height: 1; }
.tool-chip:hover { border-color: var(--azul); color: var(--azul); }
.tool-chip.activo {
  border-color: var(--azul);
  background: rgba(0,74,173,.06);
  color: var(--azul);
  box-shadow: 0 2px 10px rgba(0,74,173,.12);
}
.tool-chip-all { padding: 6px 15px; }

/* Modal con varios logos */
.modal-logo { display: flex; gap: 8px; padding: 0; border: 0; background: none; width: auto; height: auto; }
.modal-logo-item {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 14px; background: #fff; border: 1px solid var(--gris-borde);
  display: flex; align-items: center; justify-content: center; padding: 10px;
}
.modal-logo-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

@media (max-width: 640px) {
  .card-logos .card-logo { width: 44px; height: 44px; }
  .card-logos .card-logo:nth-child(n+2) { width: 40px; height: 40px; }
  .modal-logo-item { width: 48px; height: 48px; }
}

/* Chips de logos elegidos (admin, selección múltiple) */
.lp-chosen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lp-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px; background: #fff; border: 1px solid #e8eaef; border-radius: 999px; }
.lp-chip img { width: 24px; height: 24px; object-fit: contain; }
.lp-chip b { font-size: .82rem; font-weight: 600; color: #111; }
.lp-chip-x { width: 22px; height: 22px; border-radius: 50%; background: #f3f4f7; color: #6b7280; font-size: 1.05rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.lp-chip-x:hover { background: #fee2e2; color: #b91c1c; }

/* Varias miniaturas de logo en la lista de recursos del admin */
.recurso-logo.recurso-logos { width: auto; min-width: 40px; gap: 4px; padding: 6px 8px; }
.recurso-logos img { width: 26px; height: 26px; object-fit: contain; }

/* CTA del banner: barra limpia DEBAJO de la imagen (no la tapa) */
.banner-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px;
  background: #fff;
  color: var(--azul);
  font-weight: 700; font-size: .98rem; letter-spacing: -0.01em;
  border-top: 1px solid var(--gris-borde);
  text-align: center;
  transition: background .15s, color .15s;
}
.banner-cta svg { width: 17px; height: 17px; flex-shrink: 0; transition: transform .15s; }
a.banner-link:hover .banner-cta { background: var(--azul); color: #fff; }
a.banner-link:hover .banner-cta svg { transform: translateX(3px); }
.banner-card-cta { justify-content: center; color: var(--azul); padding: 14px 16px; margin-top: 0; }
@media (max-width: 640px) {
  .banner-cta { font-size: .9rem; padding: 12px 14px; }
}

/* Carrusel de banner (varias imágenes que rotan solas) */
.banner-carousel { position: relative; width: 100%; overflow: hidden; }
.banner-h .banner-carousel { aspect-ratio: 4 / 1; }
.banner-side .banner-carousel { aspect-ratio: 1 / 2; }
.card-banner-img { position: relative; }
.card-banner-img .banner-carousel { width: 100%; height: 100%; aspect-ratio: auto; }
.banner-carousel .bc-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0; transition: opacity .6s ease;
}
.banner-carousel .bc-slide.activo { opacity: 1; }

/* Refuerzos finales (deben ir los últimos por orden de fuente) */
@media (max-width: 1023px) {
  /* banner lateral apaisado en tablet/móvil (no torre) */
  .banner-side .banner-carousel { aspect-ratio: 16 / 9; }
}
@media (hover: none) {
  /* en táctil, el CTA del banner no se queda invertido tras tocar */
  a.banner-link:hover .banner-cta { background: #fff; color: var(--azul); }
}


/* Realce "IA" en el subtítulo (juego confIAnza) */
.hero-sub .ia-hl {
  font-weight: 800;
  font-style: normal;
  color: #fff;
  letter-spacing: .3px;
}

/* ===== Banner lateral integrado en el grid (v7) ===== */
/* dense: las tarjetas rellenan el hueco que deja el banner alto, sin blancos.
   grid-auto-rows da un alto mínimo a cada fila para que el banner (span 2) no se
   colapse aunque las tarjetas vecinas sean cortas. */
.grid.grid-dense { grid-auto-flow: row dense; grid-auto-rows: minmax(190px, auto); }

.card.card-side-banner {
  grid-column: -2 / -1;   /* siempre la última columna, sea 3 o 2 */
  grid-row: span 2;       /* alto de 2 tarjetas */
  align-self: stretch;    /* RELLENA el alto de los 2 bloques vecinos: sin hueco en blanco */
  padding: 0;
  gap: 0;                 /* imagen pegada al CTA, sin franja de fondo */
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card.card-side-banner::before { display: none; }
/* La imagen RELLENA todo el alto de la tarjeta (= alto de 2 bloques), sin hueco.
   Con object-fit:cover llena la caja sin franjas; el recortador genera la
   imagen ya a esta misma proporción para que no recorte nada. */
.card-side-banner .side-banner-img {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #fff;
  overflow: hidden;
}
/* Fondo desenfocado (copia de la imagen) que rellena los lados con elegancia */
.card-side-banner .side-banner-img .sb-bg {
  position: absolute; inset: 0; z-index: 0;
  background-position: center; background-size: cover;
  filter: blur(24px) brightness(.92);
  transform: scale(1.2);
}
.card-side-banner .side-banner-img .banner-carousel {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  aspect-ratio: auto;
}
/* La imagen del lateral LLENA la caja (sin franjas). Como el recortador la genera
   a la proporción del hueco, no se pierde nada relevante. */
.card-side-banner .side-banner-img .bc-slide { object-fit: cover; }
.card-side-banner .banner-card-cta { flex: 0 0 auto; position: relative; z-index: 2; }

/* Lados alternos: el 1º a la derecha, el 2º a la izquierda, etc. */
.card-side-banner.side-right { grid-column: -2 / -1; }
.card-side-banner.side-left  { grid-column: 1 / 2; }

/* En móvil (1 columna) el lateral ocupa el ancho completo con su misma
   proporción vertical 3:4 (no recorta la imagen recomendada) */
@media (max-width: 640px) {
  .grid.grid-dense { grid-auto-rows: auto; }
  .card.card-side-banner { grid-column: 1 / -1; grid-row: auto; }
  .card-side-banner .side-banner-img { flex: none; aspect-ratio: 9 / 16; }
}

/* ============================================================
   PESTAÑAS DEL ADMIN — una sección a la vez (Dashboard, Recursos…)
   ============================================================ */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.admin-tab {
  padding: 10px 18px; border-radius: 999px; background: #fff; border: 1.5px solid var(--gris-borde);
  color: var(--gris-texto); font-size: .92rem; font-weight: 600; transition: all .15s; cursor: pointer;
}
.admin-tab:hover { border-color: var(--azul); color: var(--azul); }
.admin-tab.activo { background: var(--azul); border-color: var(--azul); color: #fff; box-shadow: 0 4px 14px rgba(0,74,173,.25); }
.admin-panel[data-tab] { display: none; }
.admin-panel[data-tab].tab-activa { display: block; }
@media (max-width: 640px) {
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -18px 22px; padding: 0 18px 6px; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab { flex-shrink: 0; }
}

/* ============================================================
   DASHBOARD DE TRÁFICO (admin) — tarjetas, gráfico de barras, top
   ============================================================ */
.dash-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(34,197,94,.55); animation: noticiasPulse 2.2s infinite; }
.dash-live { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; padding: 2px 8px; border-radius: 999px; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-top-area { display: grid; grid-template-columns: minmax(130px, 190px) 1fr; gap: 12px; margin-bottom: 16px; align-items: stretch; }
.dash-paises { background: #f7f9fc; border: 1px solid #e8eaef; border-radius: 12px; padding: 14px 16px; min-width: 0; }
.dash-paises-list { margin-top: 8px; }
.pais-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .88rem; }
.pais-flag { font-size: 1.15rem; flex-shrink: 0; width: 24px; text-align: center; line-height: 1; }
.pais-nom { flex-shrink: 0; min-width: 84px; max-width: 130px; color: #4a4f5a; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pais-bar { flex: 1 1 auto; height: 7px; background: #e8eaef; border-radius: 4px; overflow: hidden; min-width: 24px; }
.pais-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #0a5fcc, #004aad); border-radius: 4px; }
.pais-n { flex-shrink: 0; color: #111; font-weight: 600; font-size: .8rem; min-width: 62px; text-align: right; }
@media (max-width: 560px) { .dash-top-area { grid-template-columns: 1fr; } }
.dash-disp { background: #f7f9fc; border: 1px solid #e8eaef; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.dash-disp-body { margin-top: 10px; }
.disp-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #e8eaef; }
.disp-seg { display: block; height: 100%; }
.disp-movil { background: linear-gradient(90deg, #0a5fcc, #004aad); }
.disp-pc { background: #9db8e0; }
.disp-legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: .85rem; color: #4a4f5a; }
.disp-item b { color: #111; font-weight: 700; }
.dash-cards-2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: 4px; }
.dash-period { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.dash-btn { padding: 9px 16px; border-radius: 999px; background: #fff; border: 1.5px solid var(--gris-borde);
  color: var(--gris-texto); font-size: .9rem; font-weight: 600; transition: all .15s; }
.dash-btn:hover { border-color: var(--azul); color: var(--azul); }
.dash-btn.activo { background: var(--azul); border-color: var(--azul); color: #fff; }
.dash-card { background: #f7f9fc; border: 1px solid #e8eaef; border-radius: 12px; padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 4px; }
.dash-card-live { background: linear-gradient(135deg, rgba(0,74,173,.06), rgba(10,95,204,.1)); border-color: rgba(0,74,173,.18); }
.dash-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: #111; line-height: 1; }
.dash-card-live .dash-num { color: var(--azul); }
.dash-lbl { font-size: .8rem; color: #6b7280; font-weight: 600; }
.dash-chart-wrap { margin-top: 6px; position: relative; }
.dash-chart-title { font-size: .82rem; font-weight: 700; color: #4a4f5a; margin-bottom: 10px; }
.dash-tip { position: absolute; transform: translate(-50%, -100%); background: #111; color: #fff;
  font-size: .74rem; font-weight: 600; padding: 6px 9px; border-radius: 7px; pointer-events: none;
  white-space: nowrap; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.dash-bar { cursor: default; }
.dash-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.dash-bar { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.dash-bar > span { width: 100%; max-width: 26px; min-height: 2px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #0a5fcc, #004aad); transition: height .4s ease; }
.dash-bar:hover > span { background: linear-gradient(180deg, #0a5fcc, #0a5fcc); }
.dash-bar > i { font-size: .62rem; color: #9ba1ad; font-style: normal; white-space: nowrap; }
.dash-top { margin-top: 20px; }
.dash-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f0f2f6; font-size: .9rem; }
.dash-top-row:last-child { border-bottom: 0; }
.dash-top-row b { color: #111; flex-shrink: 0; }
.dash-top-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dash-top-img { width: 52px; height: 38px; flex-shrink: 0; border-radius: 8px; object-fit: contain;
  background: #f1f3f5; border: 1px solid #e8eaef; padding: 3px; }
.dash-top-img-ph { background: #eef1f4; padding: 0; }
.dash-top-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4a4f5a; }
.dash-top-txt a { color: var(--azul); text-decoration: none; font-weight: 600; }
.dash-top-txt a:hover { text-decoration: underline; }
.dash-tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 24px; }
.dash-top-per { font-weight: 600; color: #9ba1ad; font-size: .76rem; }
.dash-top-list { margin-top: 6px; }
.dash-top-empty { font-size: .85rem; color: #9ba1ad; padding: 12px 0; }
.dash-nota { font-size: .78rem; color: #9ba1ad; margin-top: 16px; line-height: 1.5; }
@media (max-width: 640px) { .dash-num { font-size: 1.6rem; } .dash-chart { height: 96px; } }

/* ===== Visibilidad del banner por dispositivo (se elige en el admin) =====
   .solo-escritorio → no se ve en móvil · .solo-movil → no se ve en ordenador.
   Hecho con media query: se ajusta solo al cambiar el tamaño de la ventana. */
@media (max-width: 640px) { .solo-escritorio { display: none !important; } }
@media (min-width: 641px) { .solo-movil { display: none !important; } }

/* ============================================================
   PANEL DE NOTICIAS — "Novedades IA" (dinámico, se actualiza solo)
   ============================================================ */
.noticias { margin: 0 0 30px; }
.noticias[hidden] { display: none; }
.noticias-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.noticias-titulo {
  font-size: 1.18rem; font-weight: 800; letter-spacing: -0.02em; color: var(--negro);
  display: flex; align-items: center; gap: 9px;
}
.noticias-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(34,197,94,.55); animation: noticiasPulse 2.2s infinite;
}
@keyframes noticiasPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@media (prefers-reduced-motion: reduce) { .noticias-dot { animation: none; } }
.noticias-meta { font-size: .82rem; color: var(--gris-suave); font-weight: 500; white-space: nowrap; }

.noticias-track {
  display: flex; gap: 14px; overflow-x: auto;
  padding: 4px 2px 12px; margin: 0 -2px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: #d6dae2 transparent;
}
.noticias-track::-webkit-scrollbar { height: 8px; }
.noticias-track::-webkit-scrollbar-track { background: transparent; }
.noticias-track::-webkit-scrollbar-thumb { background: #d6dae2; border-radius: 99px; }
.noticias-track::-webkit-scrollbar-thumb:hover { background: #c5cbd6; }

.noticia-card {
  flex: 0 0 272px; width: 272px; scroll-snap-align: start;
  background: var(--gris-card); border: 1px solid var(--gris-borde); border-radius: var(--radio);
  padding: 0; text-align: left; cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .2s, border-color .2s;
}
.noticia-card:hover { transform: translateY(-3px); box-shadow: var(--sombra-hover); border-color: transparent; }
.noticia-card:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0,74,173,.35), var(--sombra-hover); }

/* Imagen de portada */
.noticia-card-img { display: block; width: 100%; aspect-ratio: 16 / 9; background: #eef0f4; overflow: hidden; }
.noticia-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.noticia-card:hover .noticia-card-img img { transform: scale(1.04); }
.noticia-card-img.sinimg { background: linear-gradient(135deg, var(--azul) 0%, var(--azul-light) 100%); }
.noticia-card-img.sinimg img { display: none; }

.noticia-card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 15px; flex: 1; }
.noticia-tag {
  align-self: flex-start; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--azul); background: rgba(0,74,173,.08); padding: 3px 9px; border-radius: 6px;
}
.noticia-card-titulo {
  font-size: .98rem; font-weight: 700; color: var(--negro); line-height: 1.32; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.noticia-card-fuente { margin-top: auto; font-size: .78rem; color: var(--gris-suave); font-weight: 600; }

/* Imagen y fuente dentro del modal de noticia */
.noticia-img-modal { width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 14px; background: #eef0f4; }
.noticia-img-modal img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.noticia-fuente-modal { font-size: .86rem; color: var(--gris-suave); font-weight: 600; margin-bottom: 2px; }

@media (max-width: 640px) {
  .noticia-card { flex-basis: 82%; width: 82%; }
  .noticias-titulo { font-size: 1.06rem; }
}

/* ============================================================
   POP-UP "guárdate la web" (acceso directo) — primera visita
   ============================================================ */
.acceso-directo {
  position: fixed; z-index: 300; right: 22px; bottom: 22px; width: 344px; max-width: calc(100vw - 28px);
  background: #fff; border: 1px solid var(--gris-borde); border-radius: 16px; padding: 20px 20px 18px;
  box-shadow: 0 22px 60px rgba(0,0,0,.24);
  transform: translateY(24px); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.acceso-directo.show { transform: translateY(0); opacity: 1; }
.acceso-directo .ad-x {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  background: #f3f4f7; color: #6b7280; font-size: 1.3rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.acceso-directo .ad-x:hover { background: #e3e6ec; color: #111; }
.ad-titulo { font-size: 1.12rem; font-weight: 800; color: var(--negro); letter-spacing: -.02em; margin-bottom: 6px; padding-right: 28px; }
.ad-texto { font-size: .92rem; color: var(--gris-texto); line-height: 1.5; margin-bottom: 16px; }
.ad-texto b { color: var(--azul); }
.ad-acciones { display: flex; gap: 8px; }
.ad-btn { flex: 1; height: 44px; border-radius: 10px; font-weight: 700; font-size: .92rem; transition: all .15s; cursor: pointer; }
.ad-btn-primary { background: var(--azul); color: #fff; }
.ad-btn-primary:hover { background: var(--azul-dark); }
.ad-btn-ghost { background: #f3f4f7; color: var(--gris-texto); }
.ad-btn-ghost:hover { background: #e8eaef; }
@media (max-width: 640px) {
  .acceso-directo { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

/* ============================================================
   EMBUDO — CTA sticky + modal de segmentación
   ============================================================ */

/* --- CTA sticky (mismo embudo, aparece al hacer scroll) --- */
.cta-sticky {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 160%);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #004aad, #0a5fcc);
  color: #fff;
  border: none;
  padding: 15px 28px;
  border-radius: 999px;
  font: 700 1rem/1 'Inter', system-ui, sans-serif;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,74,173,.42), 0 3px 8px rgba(0,74,173,.25);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.2,.8,.25,1), opacity .3s ease, box-shadow .2s ease;
}
.cta-sticky.is-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.cta-sticky svg { width: 17px; height: 17px; flex-shrink: 0; }
.cta-sticky:hover { box-shadow: 0 16px 40px rgba(0,74,173,.55); }
@media (max-width: 640px) {
  .cta-sticky { left: 12px; right: 12px; bottom: 12px; transform: translateY(180%); justify-content: center; }
  .cta-sticky.is-visible { transform: translateY(0); }
}

/* --- Modal de segmentación --- */
.seg {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.seg.is-open { opacity: 1; pointer-events: auto; }
.seg__backdrop {
  position: absolute; inset: 0;
  background: rgba(8,20,45,.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.seg__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 26px;
  padding: 42px 36px 30px;
  box-shadow: 0 40px 100px rgba(0,30,80,.4);
  transform: translateY(16px) scale(.97);
  transition: transform .3s cubic-bezier(.2,.8,.25,1);
  font-family: 'Inter', system-ui, sans-serif;
}
.seg.is-open .seg__card { transform: translateY(0) scale(1); }
.seg__x {
  position: absolute; top: 16px; right: 18px;
  width: 34px; height: 34px;
  border: none; background: #f1f3f8; color: #9098a6;
  border-radius: 50%; font-size: 22px; line-height: 1;
  cursor: pointer; transition: background .15s, color .15s; z-index: 2;
}
.seg__x:hover { background: #e6e9f2; color: #111; }
.seg__progress { display: flex; gap: 7px; justify-content: center; margin-bottom: 26px; }
.seg__dot { width: 28px; height: 5px; border-radius: 999px; background: #e8eaef; transition: background .3s ease; }
.seg__dot.is-active { background: var(--azul); }
.seg__step { display: none; }
.seg__step.is-active { display: block; animation: segIn .35s ease; }
@keyframes segIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.seg__title { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; color: var(--negro); margin: 0 0 6px; text-align: center; }
.seg__sub { font-size: .98rem; color: var(--gris-texto); text-align: center; margin: 0 0 24px; line-height: 1.45; }
.seg__opts { display: flex; flex-direction: column; gap: 12px; }
.seg__opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left; width: 100%;
  padding: 16px 20px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 16px; background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
  font-family: inherit;
}
.seg__opt:hover { border-color: var(--azul); background: rgba(0,74,173,.03); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,74,173,.1); }
.seg__opt.is-sel { border-color: var(--azul); background: rgba(0,74,173,.06); }
.seg__opt-t { font-size: 1.05rem; font-weight: 700; color: var(--negro); }
.seg__opt-d { font-size: .85rem; color: var(--gris-suave); }
.seg__field { margin-bottom: 12px; }
.seg__input {
  width: 100%; padding: 15px 18px;
  border: 1.5px solid var(--gris-borde); border-radius: 14px;
  font-size: 1.05rem; font-family: inherit; color: var(--negro);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.seg__input::placeholder { color: #9aa0ab; }
.seg__input:focus { border-color: var(--azul); box-shadow: 0 0 0 4px rgba(0,74,173,.13); }
.seg__submit {
  margin-top: 6px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 17px 24px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #004aad, #0a5fcc); color: #fff;
  font: 700 1.08rem/1 'Inter', system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,74,173,.32);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.seg__submit:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.seg__submit.is-ready:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0,74,173,.45); }
.seg__submit svg { width: 18px; height: 18px; }
.seg__submit.is-loading { opacity: .8; cursor: wait; }
.seg__hint { font-size: .85rem; color: var(--gris-suave); text-align: center; margin: 12px 0 0; transition: opacity .2s; }
.seg__back { display: block; margin: 18px auto 0; background: none; border: none; color: var(--gris-suave); font-size: .9rem; font-weight: 500; cursor: pointer; font-family: inherit; }
.seg__back:hover { color: var(--negro); }

/* Paso 4: acceso concedido + botón único de destino */
.seg__step--final { text-align: center; }
.seg__check {
  width: 64px; height: 64px; margin: 4px auto 18px;
  border-radius: 50%;
  background: rgba(5,150,105,.12); color: #059669;
  display: flex; align-items: center; justify-content: center;
  animation: segPop .4s cubic-bezier(.34,1.5,.64,1);
}
.seg__check svg { width: 30px; height: 30px; }
@keyframes segPop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.seg__go { text-decoration: none; margin-top: 10px; }
.seg__go:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0,74,173,.45); }
.seg__alt { margin: 14px 0 0; font-size: .92rem; color: var(--gris-suave); text-align: center; }
.seg__alt a { color: var(--azul); font-weight: 600; text-decoration: none; }
.seg__alt a:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .seg__card { padding: 36px 22px 24px; border-radius: 20px; }
  .seg__title { font-size: 1.35rem; }
}
