* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: #f3f6fb;
  color: #111827;
}

.dashboard {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 34px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.etiqueta {
  margin: 0 0 8px;
  color: #2563eb;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 12px;
}

.etiqueta.clara {
  color: #bfdbfe;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -1.2px;
}

.descripcion {
  max-width: 780px;
  color: #64748b;
  font-size: 16px;
  line-height: 1.55;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #047857;
  padding: 13px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
  font-weight: 800;
  white-space: nowrap;
}

.hero-badge span {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.filtros {
  background: radial-gradient(circle at top left, #2563eb, #111827 62%);
  color: #ffffff;
  border-radius: 28px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22);
}

.filtros h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.4px;
}

.filtros p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.5;
}

.formulario-filtros {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.campo label {
  display: block;
  margin-bottom: 8px;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.campo input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
}

.formulario-filtros button {
  height: 50px;
  border: none;
  border-radius: 14px;
  padding: 0 24px;
  background: #f59e0b;
  color: #111827;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.25);
}

.formulario-filtros button:hover {
  background: #fbbf24;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi {
  min-height: 178px;
  border-radius: 26px;
  padding: 22px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.12);
}

.kpi::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  right: -70px;
  bottom: -70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.kpi-top span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 23px;
}

.kpi-top small {
  font-weight: 800;
  opacity: 0.84;
  text-align: right;
}

.kpi p {
  margin: 0 0 8px;
  font-weight: 800;
  opacity: 0.88;
  position: relative;
  z-index: 1;
}

.kpi h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.8px;
  position: relative;
  z-index: 1;
  word-break: break-word;
}

.kpi strong {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  z-index: 1;
}

.kpi-azul {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.kpi-verde {
  background: linear-gradient(135deg, #047857, #10b981);
}

.kpi-morado {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}

.kpi-naranja {
  background: linear-gradient(135deg, #c2410c, #f97316);
}

.kpi-gris {
  background: linear-gradient(135deg, #334155, #64748b);
}

.kpi-negro {
  background: linear-gradient(135deg, #020617, #1e293b);
}

.impacto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.impacto-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.impacto-card::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  right: -65px;
  top: -65px;
  background: #eff6ff;
  border-radius: 50%;
}

.impacto-card.actual {
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.impacto-card p {
  margin: 0 0 10px;
  color: #64748b;
  font-weight: 900;
}

.impacto-card h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.8px;
}

.impacto-card span {
  display: block;
  margin-top: 10px;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.impacto-card strong,
.impacto-card small {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.impacto-card small {
  background: #f8fafc;
  color: #334155;
  margin-left: 6px;
}

.positivo {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.negativo {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.neutral {
  background: #e5e7eb !important;
  color: #374151 !important;
}

.nuevo {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

.resumen-gerencial {
  background: #ffffff;
  border-radius: 28px;
  padding: 26px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
}

.panel-titulo {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-titulo h2,
.panel-titulo h3 {
  margin: 0;
  letter-spacing: -0.4px;
}

.resumen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.resumen-grid article {
  background: #f8fafc;
  border-radius: 22px;
  padding: 20px;
  border: 1px solid #e5e7eb;
}

.resumen-grid h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.resumen-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.resumen-grid li {
  padding: 11px 0;
  border-bottom: 1px solid #e5e7eb;
  color: #334155;
  line-height: 1.45;
}

.resumen-grid li:last-child {
  border-bottom: none;
}

.tiendas-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.tienda-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

.tienda-card p {
  margin: 0 0 10px;
  color: #64748b;
  font-weight: 900;
}

.tienda-card h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -0.4px;
}

.tienda-card span {
  display: block;
  margin-top: 12px;
  color: #2563eb;
  font-weight: 900;
}

.grid-graficos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.panel {
  background: #ffffff;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

.panel.grande {
  min-height: 500px;
}

.grafico-contenedor {
  position: relative;
  height: 405px;
}

.grafico-contenedor.mediano {
  height: 375px;
}

.tabla-panel {
  margin-top: 24px;
}

.tabla-contenedor {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1350px;
}

thead {
  background: #f8fafc;
}

th {
  text-align: left;
  padding: 14px 13px;
  color: #475569;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 15px 13px;
  border-top: 1px solid #e5e7eb;
  color: #1f2937;
  font-size: 14px;
  white-space: nowrap;
}

td span {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

@media (max-width: 1320px) {
  .kpis {
    grid-template-columns: repeat(3, 1fr);
  }

  .tiendas-top {
    grid-template-columns: repeat(2, 1fr);
  }

  .filtros {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard {
    padding: 20px;
  }

  .hero {
    flex-direction: column;
  }

  h1 {
    font-size: 32px;
  }

  .formulario-filtros {
    grid-template-columns: 1fr;
  }

  .kpis,
  .impacto,
  .resumen-grid,
  .tiendas-top,
  .grid-graficos {
    grid-template-columns: 1fr;
  }

  .grafico-contenedor {
    height: 340px;
  }

  .grafico-contenedor.mediano {
    height: 320px;
  }
}
