/* ─── Stats Dashboard Premium (v1.61) ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: rgba(20, 20, 35, 0.45);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--border-color);
  transition: all 0.4s ease;
}

.stat-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover::after {
  height: 6px;
  box-shadow: 0 -4px 12px var(--primary-glow);
}

.stat-card.primary::after { background: var(--grad-primary); }
.stat-card.success::after { background: var(--success-color); box-shadow: 0 -4px 12px rgba(16, 185, 129, 0.4); }
.stat-card.danger::after { background: var(--danger-color); box-shadow: 0 -4px 12px rgba(239, 68, 68, 0.4); }
.stat-card.warning::after { background: var(--warning-color); box-shadow: 0 -4px 12px rgba(245, 158, 11, 0.4); }

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.table-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-premium {
  width: 100%;
  border-collapse: collapse;
}

.table-premium th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table-premium td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.table-premium tr:last-child td {
  border-bottom: none;
}

.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 700;
}

/* ─── Re-Aprendizaje ───────────────────────────────────────────────────────── */
.reaprendizaje-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

@media (max-width: 768px) {
    .reaprendizaje-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
  /* Tabla de evaluación premium */
  .table-premium {
    page-break-inside: auto;
    border: 1px solid #e5e7eb !important;
    width: 100% !important;
    border-collapse: collapse !important;
  }
  .table-premium tr { page-break-inside: avoid; page-break-after: auto; }
  .table-premium th {
    background: #f3f4f6 !important;
    color: #374151 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
  }
  .table-premium td, .table-premium th { padding: 0.75rem !important; border: 1px solid #e5e7eb !important; }

  /* Stats horizontales */
  .stats-grid {
    display: flex !important;
    gap: 1rem !important;
    margin-bottom: 2rem !important;
    page-break-inside: avoid;
  }
  .stat-card {
    border: 1px solid #e5e7eb !important;
    background: white !important;
    page-break-inside: avoid;
    flex: 1 1 0 !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    text-align: center !important;
  }
  .stat-card::after { display: none !important; }
  .stat-card { color: #111827 !important; background: white !important; }
  .stat-value { color: #111827 !important; font-size: 1.5rem !important; }
  .stat-label { color: #6b7280 !important; font-size: 0.75rem !important; }
}

/* ─── Selector de Temarios Premium ─────────────────────────────────────────── */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.dash-select {
    appearance: none;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 0 2.5rem 0 1rem;
    height: 45px;
    min-width: 200px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

.dash-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.dash-select:focus {
    border-color: var(--primary-color);
}

.select-wrapper::after {
    content: '\f078'; /* FontAwesome chevron o lucide simulado */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.8rem;
}
