/**
 * Estilos Principales - Ficheros 93
 * Enfoque Mobile-First, Diseño Limpio, Moderno y Pedagógico
 */

:root {
  /* Paleta Base y Tipografía */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-contrast: #ffffff;
  
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  
  /* Temáticas por Asignatura */
  --espanol-accent: #ea580c;
  --espanol-bg: #fff7ed;
  --espanol-border: #fed7aa;
  
  --mate-accent: #2563eb;
  --mate-bg: #eff6ff;
  --mate-border: #bfdbfe;
  
  /* Estados e Interacciones */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --highlight: #fef08a;
  
  /* Radios y Sombras */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04), 0 0 1px rgba(15, 23, 42, 0.08);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #090d16;
  --surface: #131b2e;
  --surface-alt: #1e293b;
  --border: #243048;
  --border-focus: #6366f1;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --primary-soft: rgba(79, 70, 229, 0.18);
  --espanol-bg: rgba(234, 88, 12, 0.15);
  --espanol-border: rgba(234, 88, 12, 0.3);
  --mate-bg: rgba(37, 99, 235, 0.15);
  --mate-border: rgba(37, 99, 235, 0.3);
  --highlight: #854d0e;
  
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;
}

/* ==========================================================
   CABECERA Y HERO
   ========================================================== */
.site-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  color: #ffffff;
  padding: 24px 16px 48px;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.header-top {
  max-width: 1240px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: block;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-logo-img {
  transform: scale(1.08) rotate(-2deg);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brand-info h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-info span {
  font-size: 0.78rem;
  color: #c7d2fe;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-head {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-head:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.btn-admin-nav:hover {
  background: #ffffff;
  color: var(--primary);
  border-color: #ffffff;
}

.hero-content {
  max-width: 1240px;
  margin: 0 auto;
}

.hero-content h2 {
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-content p {
  margin: 0;
  font-size: 0.95rem;
  color: #c7d2fe;
  max-width: 680px;
}

/* ==========================================================
   PANEL DE FILTROS (MOBILE-FIRST)
   ========================================================== */
.container {
  max-width: 1240px;
  margin: -32px auto 0;
  padding: 0 16px;
}

/* ==========================================================
   BARRA DE PROGRESO DE COMPLETITUD DEL CATÁLOGO EN TIEMPO REAL
   ========================================================== */
.progress-section {
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
}

.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.progress-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

[data-theme="dark"] .progress-card:hover {
  border-color: #475569;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.progress-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.progress-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

[data-theme="dark"] .progress-badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.progress-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.progress-subtitle {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-percentage-wrap {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.progress-percentage-number {
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .progress-percentage-number {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-percentage-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Track principal de la barra */
.progress-track {
  height: 14px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--border);
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%);
  transition: width 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.4);
}

.progress-fill.is-complete {
  background: linear-gradient(90deg, #10b981 0%, #059669 50%, #f59e0b 100%);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6);
}

.progress-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.progress-meta-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 260px;
}

.btn-toggle-breakdown {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-toggle-breakdown:hover {
  background: var(--border);
  color: var(--primary-hover);
  transform: translateY(-1px);
}

.chevron-breakdown {
  transition: transform 0.25s ease;
}

.btn-toggle-breakdown.active .chevron-breakdown {
  transform: rotate(180deg);
}

/* Desglose Detallado */
.progress-breakdown {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  animation: fadeIn 0.25s ease;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.breakdown-col {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.breakdown-col-full {
  grid-column: 1 / -1;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

[data-theme="dark"] .breakdown-col-full {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

.breakdown-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.breakdown-item-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.breakdown-item-track {
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.breakdown-item-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.7s ease;
}

.highlight-track {
  height: 8px;
}

.highlight-fill {
  background: linear-gradient(90deg, #10b981, #059669);
}

@media (max-width: 640px) {
  .progress-card {
    padding: 16px;
  }
  .progress-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .progress-percentage-wrap {
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }
  .progress-percentage-number {
    font-size: 1.8rem;
  }
  .progress-footer-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-toggle-breakdown {
    justify-content: center;
    width: 100%;
  }
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  margin-bottom: 24px;
  position: relative;
  z-index: 10;
}

/* Selector Prominente de Grados Escolares (Visual Portal) */
.grade-portal-wrap {
  margin-bottom: 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.grade-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.grade-portal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.grade-portal-title svg {
  color: var(--primary);
}

.grade-portal-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.grade-cards-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.grade-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  position: relative;
  user-select: none;
}

.grade-card-btn:hover {
  border-color: var(--primary);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.grade-card-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transform: translateY(-2px);
}

.grade-card-icon {
  font-size: 1.25rem;
  margin-bottom: 4px;
  line-height: 1;
}

.grade-card-num {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
}

.grade-card-btn.active .grade-card-num {
  color: #ffffff;
}

.grade-card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.grade-card-btn.active .grade-card-sub {
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 900px) {
  .grade-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .grade-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .grade-card-btn {
    padding: 8px 4px;
  }
  .grade-card-icon {
    font-size: 1.05rem;
    margin-bottom: 2px;
  }
  .grade-card-num {
    font-size: 0.95rem;
  }
  .grade-card-sub {
    font-size: 0.68rem;
  }
}

/* Selector Prominente de Asignaturas y Colecciones */
.subject-portal-wrap {
  margin-bottom: 20px;
}

.subject-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.subject-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  position: relative;
  user-select: none;
}

.subject-card-btn:hover {
  border-color: var(--primary);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.subject-card-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transform: translateY(-2px);
}

/* Variantes temáticas al estar activo / hover */
.subject-card-btn.subject-card-espanol:hover {
  border-color: var(--espanol-accent);
}
.subject-card-btn.subject-card-espanol.active {
  background: var(--espanol-accent);
  border-color: var(--espanol-accent);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.38);
}

.subject-card-btn.subject-card-mate:hover {
  border-color: var(--mate-accent);
}
.subject-card-btn.subject-card-mate.active {
  background: var(--mate-accent);
  border-color: var(--mate-accent);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
}

.subject-card-btn.subject-card-fav:hover {
  border-color: #f59e0b;
}
.subject-card-btn.subject-card-fav.active {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.38);
}

.subject-card-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
  line-height: 1;
}

.subject-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
}

.subject-card-btn.active .subject-card-name {
  color: #ffffff;
}

.subject-card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.subject-card-btn.active .subject-card-sub {
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
  .subject-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .subject-card-btn {
    padding: 10px 4px;
  }
  .subject-card-icon {
    font-size: 1.15rem;
  }
  .subject-card-name {
    font-size: 0.95rem;
  }
  .subject-card-sub {
    font-size: 0.68rem;
  }
}

/* Fila de Chips Rápidos (Grado y Asignatura) */
.quick-chips-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.chip-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 6px;
}

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

.chip-btn {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.chip-btn:hover {
  background: var(--border);
  color: var(--text-main);
}

.chip-btn.active {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.chip-btn.chip-espanol.active {
  background: var(--espanol-accent);
  border-color: var(--espanol-accent);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.chip-btn.chip-mate.active {
  background: var(--mate-accent);
  border-color: var(--mate-accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.chip-btn.chip-fav.active {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Inputs de búsqueda y selector de eje */
.search-inputs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .search-inputs-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

.input-field {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field svg.icon-search {
  position: absolute;
  left: 14px;
  color: var(--text-light);
  pointer-events: none;
}

.input-field input {
  width: 100%;
  height: 44px;
  padding: 8px 36px 8px 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
}

.input-field input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.select-filtro-eje {
  width: 100%;
  height: 44px;
  padding: 8px 36px 8px 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.select-filtro-eje:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.select-filtro-eje.has-value {
  border-color: var(--primary);
  background-color: rgba(79, 70, 229, 0.04);
  color: var(--primary);
  font-weight: 700;
}

[data-theme="dark"] .select-filtro-eje {
  background-color: var(--surface-alt);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

[data-theme="dark"] .select-filtro-eje.has-value {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.btn-clear-input {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  line-height: 1;
  display: none;
  border-radius: var(--radius-sm);
}

.btn-clear-input.visible {
  display: block;
}

/* Barra inferior de estado y acciones de filtro */
.filter-footer-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
  .filter-footer-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.results-counter {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-filter-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-filter-action:hover {
  background: var(--border);
}

/* ==========================================================
   GRILLA DE FICHAS (CARDS GRID)
   ========================================================== */
.fichas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .fichas-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1200px) {
  .fichas-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Contenedor de Carga Progresiva / Infinite Scroll */
.load-more-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  margin-top: 10px;
  background: var(--surface-alt);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  gap: 12px;
  text-align: center;
}

.load-more-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.load-more-info strong {
  color: var(--text-main);
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
  transition: all 0.2s ease;
}

.btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.38);
  background: var(--primary-dark, #4338ca);
}

.btn-load-more svg {
  transition: transform 0.2s ease;
}

.btn-load-more:hover svg {
  transform: translateY(2px);
}

.scroll-sentinel {
  height: 2px;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}

.all-loaded-container {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  margin-top: 10px;
}

.all-loaded-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.all-loaded-badge svg {
  color: #10b981;
}

.card-ficha {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  cursor: pointer;
}

.card-ficha:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

[data-theme="dark"] .card-ficha:hover {
  border-color: #3b4d71;
}

.card-header-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.badge-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-grado {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .badge-grado {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.badge-asig-espanol {
  background: var(--espanol-bg);
  color: var(--espanol-accent);
  border: 1px solid var(--espanol-border);
}

.badge-asig-mate {
  background: var(--mate-bg);
  color: var(--mate-accent);
  border: 1px solid var(--mate-border);
}

.badge-num {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-eje {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.eje-dot-usuario {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
  vertical-align: middle;
}

.badge-eje:hover {
  transform: translateY(-1px);
  filter: brightness(0.94);
  border-color: var(--primary);
}

[data-theme="dark"] .badge-eje {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}

.card-tools-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-card-tool {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-card-tool:hover {
  background: var(--surface-alt);
  color: var(--primary);
  border-color: var(--border-focus);
}

.btn-card-tool.fav-active {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Imagen de la Ficha */
.card-image-box {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  max-height: 220px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-image-box:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-sm);
}

.card-image-box img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* Caja de Material */
.material-container {
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.card-espanol .material-container {
  border-left-color: var(--espanol-accent);
  background: var(--espanol-bg);
}

.card-mate .material-container {
  border-left-color: var(--mate-accent);
  background: var(--mate-bg);
}

.material-tag-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.proposito-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.proposito-text strong {
  color: var(--text-main);
  font-weight: 700;
}

/* Botón Destacado para abrir Modal de Ficha Completa */
.card-footer-cta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-ver-ficha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--surface-alt);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-espanol .btn-ver-ficha {
  color: var(--espanol-accent);
}

.card-espanol:hover .btn-ver-ficha,
.card-espanol .btn-ver-ficha:hover {
  background: var(--espanol-accent);
  color: #ffffff;
  border-color: var(--espanol-accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(194, 65, 12, 0.25);
}

.card-mate .btn-ver-ficha {
  color: var(--mate-accent);
}

.card-mate:hover .btn-ver-ficha,
.card-mate .btn-ver-ficha:hover {
  background: var(--mate-accent);
  color: #ffffff;
  border-color: var(--mate-accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

/* ==========================================================
   ACORDEÓN Y PASOS SECUENCIALES INTERACTIVOS
   ========================================================== */
.card-details {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
}

.card-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 0;
  user-select: none;
}

.card-summary::-webkit-details-marker {
  display: none;
}

.summary-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pill-step-count {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.summary-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.card-details[open] .summary-chevron {
  transform: rotate(180deg);
}

/* Contenedor del Timeline */
.sequence-timeline-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
}

.timeline-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.step-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  cursor: pointer;
}

.step-node:last-child {
  padding-bottom: 0;
}

/* Línea conectora */
.step-node:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0px;
  width: 2px;
  background-color: var(--border);
  transition: background-color 0.2s ease;
}

.step-badge-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.15);
}

.step-node:hover .step-badge-indicator {
  background: var(--primary-soft);
  transform: scale(1.08);
}

.step-body-text {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-main);
  padding-top: 2px;
  transition: var(--transition);
}

/* Estado completado (done) */
.step-node.done .step-badge-indicator {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.step-node.done:not(:last-child)::before {
  background-color: #86efac;
}

.step-node.done .step-body-text {
  color: var(--text-light);
  text-decoration: line-through;
  text-decoration-color: #94a3b8;
}

.sequence-plain-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-line;
  margin: 0;
}

/* ==========================================================
   RESALTADO DE BÚSQUEDA Y ESTADOS VACÍOS
   ========================================================== */
mark {
  background-color: var(--highlight);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.empty-results-box {
  grid-column: 1 / -1;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-results-box h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--text-main);
}

.skeleton-loading-card {
  height: 240px;
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
}

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

/* ==========================================================
   TOAST NOTIFICACIONES
   ========================================================== */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   MODAL DE FICHA COMPLETA PARA EL USUARIO
   ========================================================== */
.modal-ficha-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-ficha-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-ficha-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-ficha-overlay.active .modal-ficha-dialog {
  transform: scale(1) translateY(0);
}

@keyframes modalStaticBounce {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}

.modal-static-shake {
  animation: modalStaticBounce 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-ficha-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-ficha-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.btn-modal-close-icon {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-modal-close-icon:hover {
  background: var(--border);
  color: var(--text-main);
  transform: scale(1.05);
}

.modal-ficha-body {
  padding: 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-image-wrap {
  text-align: center;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border);
}

.modal-image-wrap img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.modal-section-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.modal-section-card.material-box-highlight {
  border-left: 5px solid var(--primary);
}

.card-espanol-modal .modal-section-card.material-box-highlight {
  border-left-color: var(--espanol-accent);
  background: var(--espanol-bg);
}

.card-mate-modal .modal-section-card.material-box-highlight {
  border-left-color: var(--mate-accent);
  background: var(--mate-bg);
}

.modal-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.modal-proposito-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

.modal-material-content {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-main);
  white-space: pre-line;
}

.modal-ficha-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-footer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-modal-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-tool:hover {
  background: var(--border);
  color: var(--primary);
}

.btn-modal-tool.fav-active {
  color: #d97706;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.btn-modal-close-main {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-close-main:hover {
  background: var(--border);
}

@media (max-width: 640px) {
  .modal-ficha-dialog {
    max-height: 96vh;
    border-radius: var(--radius-md);
  }
  .modal-ficha-header, .modal-ficha-body, .modal-ficha-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .modal-ficha-title {
    font-size: 1.15rem;
  }
  .modal-footer-tools {
    width: 100%;
    justify-content: space-between;
  }
  .btn-modal-close-main {
    width: 100%;
  }
}

/* ==========================================================
   BOTONES DE RECURSOS DIGITALES (JUEGO, GENERADOR, HÍBRIDO)
   ========================================================== */
.card-resources-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

.btn-resource {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-resource-juego {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.btn-resource-juego:hover {
  background: #e9d5ff;
  transform: translateY(-1px);
}

.btn-resource-generador {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.btn-resource-generador:hover {
  background: #d1fae5;
  transform: translateY(-1px);
}

.btn-resource-hibrido {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.btn-resource-hibrido:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-resource-juego {
  background: rgba(126, 34, 206, 0.2);
  color: #d8b4fe;
  border-color: rgba(126, 34, 206, 0.4);
}

[data-theme="dark"] .btn-resource-generador {
  background: rgba(4, 120, 87, 0.2);
  color: #6ee7b7;
  border-color: rgba(4, 120, 87, 0.4);
}

[data-theme="dark"] .btn-resource-hibrido {
  background: rgba(29, 78, 216, 0.2);
  color: #93c5fd;
  border-color: rgba(29, 78, 216, 0.4);
}

/* ==========================================================
   ESTILOS VISOR PDF GOOGLE DRIVE (TARJETA Y MODALES)
   ========================================================== */
.btn-card-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-card-pdf:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.card-image-box {
  position: relative;
}

.badge-drive-thumb {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.btn-modal-tool-pdf {
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

.btn-modal-tool-pdf:hover {
  background: #fee2e2 !important;
}

.modal-pdf-card {
  border-top: 2px solid #ef4444 !important;
}

.modal-pdf-bar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-pdf-inline-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-pdf-inline-tool:hover {
  background: var(--surface-alt);
  color: var(--primary);
  border-color: var(--primary);
}

.pdf-embed-wrapper {
  width: 100%;
  height: 480px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f1f5f9;
  position: relative;
}

.pdf-embed-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pdf-embed-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 4px;
}

.pdf-embed-hint a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 700;
}

.pdf-embed-hint-sub {
  font-size: 0.74rem;
  opacity: 0.85;
}

/* Modal Pantalla Completa Visor PDF */
.modal-pdf-overlay {
  z-index: 1200;
}

.modal-pdf-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 1150px;
  width: 96%;
  height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-pdf-overlay.active .modal-pdf-dialog {
  transform: scale(1) translateY(0);
}

.modal-pdf-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.modal-pdf-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.badge-pdf-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 999px;
  border: 1px solid #fca5a5;
  white-space: nowrap;
}

.modal-pdf-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-pdf-header-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pdf-header-action:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.modal-pdf-viewer-body {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  background: #323639;
  overflow: hidden;
}

.modal-pdf-viewer-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Modo oscuro */
[data-theme="dark"] .btn-card-pdf {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .btn-card-pdf:hover {
  background: #ef4444;
  color: #ffffff;
}

[data-theme="dark"] .pdf-embed-wrapper {
  background: #0f172a;
}

[data-theme="dark"] .badge-pdf-tag {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

@media (max-width: 640px) {
  .modal-pdf-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }
  .modal-pdf-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .pdf-embed-wrapper {
    height: 360px;
  }
  .modal-pdf-dialog {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }
}

/* ==========================================================
   PIE DE PÁGINA DEL SITIO (DOCENTE DIGITAL MX)
   ========================================================== */
.site-footer {
  margin-top: 60px;
  padding: 40px 16px 48px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  transition: background-color 0.2s, border-color 0.2s;
}

.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

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

.footer-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.footer-brand-text {
  display: flex;
  flex-direction: column;
}

.footer-brand-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.footer-brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-credits {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 768px) {
  .footer-credits {
    text-align: right;
  }
}

.footer-author {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-main);
}

.footer-author strong {
  color: var(--primary);
  font-weight: 800;
}

.footer-copy {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

[data-theme="dark"] .site-footer {
  background: #0f172a;
  border-top-color: #1e293b;
}

[data-theme="dark"] .footer-author strong {
  color: #818cf8;
}

/* Enlace discreto a administración en pie de página */
.footer-admin-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.footer-admin-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

[data-theme="dark"] .footer-admin-link:hover {
  color: #818cf8;
}

/* ==========================================================
   MODAL ACERCA DE... (DOCENTE DIGITAL MX & SEP CRÉDITOS)
   ========================================================== */
.modal-acerca-dialog {
  max-width: 680px;
  width: 100%;
}

.modal-acerca-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.modal-acerca-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-acerca-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(99, 102, 241, 0.22));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .modal-acerca-icon-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(129, 140, 248, 0.3));
  color: #a5b4fc;
}

.modal-acerca-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-acerca-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: calc(88vh - 140px);
}

.modal-acerca-card {
  margin-bottom: 0;
}

.acerca-section-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.modal-acerca-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
}

.acerca-tips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}

@media (min-width: 640px) {
  .acerca-tips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.acerca-tip-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

.acerca-tip-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.acerca-tip-content strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.acerca-tip-content p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.creditos-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.credito-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.credito-card.sep-card {
  background: rgba(13, 148, 136, 0.05);
  border-left: 4px solid #0d9488;
}

.credito-card.ddmx-card {
  background: rgba(79, 70, 229, 0.05);
  border-left: 4px solid #4f46e5;
}

[data-theme="dark"] .credito-card.sep-card {
  background: rgba(13, 148, 136, 0.12);
  border-left-color: #14b8a6;
}

[data-theme="dark"] .credito-card.ddmx-card {
  background: rgba(79, 70, 229, 0.12);
  border-left-color: #6366f1;
}

.credito-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.credito-org {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.credito-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
}

.sep-badge {
  background: rgba(13, 148, 136, 0.14);
  color: #0f766e;
}

.ddmx-badge {
  background: rgba(79, 70, 229, 0.14);
  color: #4338ca;
}

[data-theme="dark"] .sep-badge {
  background: rgba(20, 184, 166, 0.22);
  color: #5eead4;
}

[data-theme="dark"] .ddmx-badge {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

.credito-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.credito-desc strong {
  color: var(--text-main);
}

.modal-acerca-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
  gap: 12px;
}

.modal-acerca-footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================
   MODAL DE AVISO AL ABRIR RECURSO DIGITAL
   ========================================================== */
.modal-aviso-recurso-dialog {
  max-width: 520px;
  width: 100%;
}

.modal-aviso-recurso-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.modal-aviso-recurso-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-aviso-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(99, 102, 241, 0.22));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .modal-aviso-icon-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(129, 140, 248, 0.3));
}

.modal-aviso-recurso-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-aviso-recurso-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
}

.modal-aviso-card {
  margin-bottom: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.modal-aviso-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.modal-aviso-card-icon {
  font-size: 1.35rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.modal-aviso-card-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-aviso-card-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.modal-aviso-card-feedback {
  background: rgba(79, 70, 229, 0.05);
  border-color: rgba(79, 70, 229, 0.22);
}

[data-theme="dark"] .modal-aviso-card-feedback {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
}

.modal-aviso-email-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.modal-aviso-email-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary);
  color: #fff !important;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.modal-aviso-email-link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-copiar-correo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-copiar-correo:hover {
  background: var(--surface-alt);
}

.modal-aviso-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 4px;
  user-select: none;
}

.modal-aviso-checkbox-label input {
  cursor: pointer;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.modal-aviso-recurso-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.btn-confirmar-abrir-recurso {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-confirmar-abrir-recurso:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.38);
}

/* ==========================================================
   PORTAL DE VINCULACIÓN CURRICULAR NEM 2022 / CONTENIDOS & PDA
   ========================================================== */
.nem-portal-wrap {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.9));
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .nem-portal-wrap {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-color: #334155;
}

.nem-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}

.nem-portal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nem-badge-tag {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nem-title-text {
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--text-main);
}

.btn-toggle-nem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-nem:hover {
  background: var(--surface-alt);
}

.chevron-nem {
  transition: transform 0.25s ease;
}

.btn-toggle-nem.active .chevron-nem {
  transform: rotate(180deg);
}

.nem-portal-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nem-step-block {
  margin-top: 12px;
}

.nem-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.nem-chip-btn {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nem-chip-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.nem-chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.nem-chip-btn.nem-chip-lenguajes.active {
  background: #e11d48;
  border-color: #e11d48;
}

.nem-chip-btn.nem-chip-saberes.active {
  background: #2563eb;
  border-color: #2563eb;
}

.nem-chip-btn.nem-chip-etica.active {
  background: #16a34a;
  border-color: #16a34a;
}

.nem-chip-btn.nem-chip-humano.active {
  background: #ea580c;
  border-color: #ea580c;
}

.nem-select-wrap {
  width: 100%;
}

.nem-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nem-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Lista de tarjetas de PDA */
.nem-pdas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.nem-pda-card {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nem-pda-card:hover {
  border-color: var(--primary);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nem-pda-card.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
  box-shadow: 0 0 0 2px var(--primary);
}

[data-theme="dark"] .nem-pda-card.active {
  background: rgba(99, 102, 241, 0.12);
}

.pda-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pda-meta-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  color: #fff;
}

.pda-match-count {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
}

.pda-card-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-main);
}

/* Banner de PDA Activo */
.nem-pda-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(79, 70, 229, 0.28);
  border-radius: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.banner-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.badge-nem-active {
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-nem-grado {
  background: #0ea5e9;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-nem-match {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-main);
}

.banner-pda-texto {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
}

.btn-clear-nem-pda {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-clear-nem-pda:hover {
  background: #fecaca;
}

[data-theme="dark"] .btn-clear-nem-pda {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
}

/* Insignia de Afinidad en Tarjetas de Fichas */
.badge-afinidad-ia {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  letter-spacing: 0.2px;
}

/* PDAs dentro del Modal de Detalle de Ficha */
.modal-pdas-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.modal-pda-item {
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-pda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-pda-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-pda-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ==========================================================
   REDES SOCIALES OFICIALES (HEADER, FOOTER Y MODAL ACERCA DE)
   ========================================================== */
.header-social-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-divider-v {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

.btn-social-head {
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.btn-social-head:hover {
  transform: translateY(-2px) scale(1.08);
}

.btn-social-yt:hover {
  background: #ff0000 !important;
  border-color: #ff0000 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.45);
}

.btn-social-tt:hover {
  background: #000000 !important;
  border-color: #25f4ee !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 244, 238, 0.35);
}

.btn-social-fb:hover {
  background: #1877f2 !important;
  border-color: #1877f2 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.45);
}

.btn-social-ig:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) !important;
  border-color: #dc2743 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.45);
}

@media (max-width: 640px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
  }

  .brand {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }

  .brand-logo-img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .brand-info {
    flex: 1;
    min-width: 0;
  }

  .brand-info h1 {
    font-size: 1.35rem;
    white-space: nowrap;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0 0 3px;
  }

  .brand-info span {
    display: block;
    font-size: 0.76rem;
    color: #c7d2fe;
    line-height: 1.3;
    white-space: normal;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .header-social-links {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .header-divider-v {
    display: block;
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 4px;
  }

  .btn-icon-head {
    width: 38px;
    height: 38px;
  }
}

/* Redes en el Footer */
.footer-social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 12px;
}

.footer-social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-social-btn:hover {
  transform: translateY(-3px) scale(1.1);
  color: #ffffff;
}

.footer-social-yt:hover {
  background: #ff0000;
  border-color: #ff0000;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.35);
}

.footer-social-tt:hover {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.footer-social-fb:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

.footer-social-ig:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  border-color: #dc2743;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.35);
}

/* Redes en Modal Acerca De */
.modal-acerca-redes {
  margin-top: 18px;
}

.modal-acerca-redes-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.modal-acerca-redes-desc strong {
  color: var(--text-main);
}

.modal-social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 580px) {
  .modal-social-grid {
    grid-template-columns: 1fr;
  }
}

.social-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.social-card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.social-card-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  transition: transform 0.25s;
}

.social-card-item:hover .social-card-icon-box {
  transform: scale(1.1) rotate(-3deg);
}

.social-card-yt .social-card-icon-box {
  background: #ff0000;
}
.social-card-yt:hover {
  border-color: rgba(255, 0, 0, 0.4);
  background: rgba(255, 0, 0, 0.03);
}

.social-card-tt .social-card-icon-box {
  background: #000000;
}
.social-card-tt:hover {
  border-color: rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.03);
}
[data-theme="dark"] .social-card-tt .social-card-icon-box {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.social-card-fb .social-card-icon-box {
  background: #1877f2;
}
.social-card-fb:hover {
  border-color: rgba(24, 119, 242, 0.4);
  background: rgba(24, 119, 242, 0.03);
}

.social-card-ig .social-card-icon-box {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.social-card-ig:hover {
  border-color: rgba(220, 39, 67, 0.4);
  background: rgba(220, 39, 67, 0.03);
}

.social-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.social-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.social-card-handle {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.social-card-btn {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all 0.2s;
}

[data-theme="dark"] .social-card-btn {
  background: rgba(129, 140, 248, 0.15);
  color: #a5b4fc;
}

.social-card-item:hover .social-card-btn {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="dark"] .social-card-item:hover .social-card-btn {
  background: #6366f1;
  color: #ffffff;
}
