/* EDM Estadísticas — estilos fieles a la referencia */

.edm-stats {
  --edm-primary: #8f006e;
  --edm-ink: #1F1014;
  --edm-muted: #6b7280;
}

/* Filtro de años */
.edm-stats-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.edm-stats-chip {
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #f3f4f6;
  color: var(--edm-muted);
  transition: all .2s ease;
}
.edm-stats-chip:hover { background: #e5e7eb; }
.edm-stats-chip.is-active { background: var(--edm-primary); color: #fff; }
.edm-stats-chip:active { transform: scale(.97); }

/* Tarjetas */
.edm-stats-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}
.edm-stats-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: #2a2a2a;
  margin: 0 0 24px;
}
.edm-stats-canvas-wrap { position: relative; height: 340px; }
.edm-stats-grid .edm-stats-canvas-wrap { height: 300px; }

.edm-stats-grid {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 24px;
  margin-bottom: 24px;
}
.edm-stats-grid .edm-stats-card { margin-bottom: 0; }
.edm-stats-grid .edm-stats-card h3 { font-size: 14px; }

/* Tabla */
.edm-stats-table-card { padding: 0; overflow: hidden; }
.edm-stats-table-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 32px 16px;
}
.edm-stats-table-head h3 { margin: 0; }
.edm-stats-hint { color: var(--edm-muted); font-size: 14px; margin: 4px 0 0; }
.edm-stats .edm-stats-csv {
  border: 1px solid var(--edm-primary) !important;
  background: rgba(0,0,0,0) !important;
  color: var(--edm-primary) !important;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none !important;
  transition: all .2s ease;
}
.edm-stats .edm-stats-csv:hover { background: var(--edm-primary) !important; color: #fff !important; }

.edm-stats-table-scroll { overflow-x: auto; }
.edm-stats-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.edm-stats-table th { padding: 16px; border-top: 1px solid #f1f1f1; }
.edm-stats-th-left {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af;
}
.edm-stats-th-num { text-align: right; }
.edm-stats .edm-stats-sort {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0;
  border-radius: 0 !important;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af !important;
  transition: color .2s ease;
}
.edm-stats .edm-stats-sort:hover { color: #374151 !important; }
.edm-stats .edm-stats-sort.is-active { color: var(--edm-primary) !important; }

.edm-stats-table td { padding: 16px; }
.edm-stats-zebra { background: rgba(249,250,251,0.5); }
.edm-stats-strong { font-weight: 700; color: var(--edm-ink); }
.edm-stats-muted { color: var(--edm-muted); }
.edm-stats-num {
  text-align: right;
  font-family: 'Consolas', monospace;
  color: var(--edm-muted);
}
.edm-stats-var { font-size: 12px; font-weight: 700; }
.edm-stats-var.edm-up { color: #059669; }
.edm-stats-var.edm-down { color: #e11d48; }

/* Responsive */
@media (max-width: 1024px) {
  .edm-stats-grid { grid-template-columns: 1fr; }
  .edm-stats-card { padding: 24px; }
  .edm-stats-table-head { padding: 24px 20px 12px; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767px) {
  .edm-stats-canvas-wrap, .edm-stats-grid .edm-stats-canvas-wrap { height: 280px; }
  .edm-stats-card { padding: 18px; border-radius: 18px; }
  .edm-stats-card h3 { font-size: 15px; }
}
