:root {
  --lila-main: #8b5cf6;
  --lila-soft: #ede9fe;
  --lima-main: #7CFF00;

  --bg-main: #f9fafb;
  --text-main: #0f172a;
  --text-muted: #64748b;

  --green: #16a34a;
  --red: #dc2626;

  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);

  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
}

.dashboard {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* HEADER */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
}

.dashboard-header .badge-product {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lila-main);
  background: var(--lila-soft);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  display: inline-block;
  margin-top: 0.35rem;
}

.dashboard-header .period {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.kpi-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.kpi-card .kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.kpi-card .kpi-delta {
  font-size: 0.85rem;
  font-weight: 600;
}

.kpi-delta.positive {
  color: var(--green);
}

.kpi-delta.negative {
  color: var(--red);
}

/* CHARTS ROW */
.charts-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.chart-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.chart-card .chart-wrap {
  position: relative;
  height: 260px;
}

/* TABLE */
.table-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  overflow-x: auto;
}

.table-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

table.risk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.risk-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #eef0f3;
}

table.risk-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.risk-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.risk-pill.alto {
  background: #fee2e2;
  color: #b91c1c;
}

.risk-pill.medio {
  background: #fef3c7;
  color: #92400e;
}

.risk-pill.bajo {
  background: #dcfce7;
  color: #166534;
}

.dashboard-footer {
  margin-top: 2.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}
