/* ============================================================
   dashboard.css - KPIs, charts, ranking, actividad (~150 lin)
   Mobile-first: KPIs 2 columnas, charts stacked
   ============================================================ */

/* === KPI Grid === */
.kpi-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}

.kpi-card {
  background: var(--brand-surface); border-radius: 10px;
  padding: 14px; border: 1px solid var(--brand-border);
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

.kpi-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; margin-bottom: 8px;
}
.kpi-icon.green { background: rgba(147,193,31,0.15); color: var(--brand-accent); }
.kpi-icon.blue { background: rgba(14,165,233,0.15); color: var(--brand-info); }
.kpi-icon.amber { background: rgba(245,158,11,0.15); color: var(--brand-warning); }
.kpi-icon.red { background: rgba(220,38,38,0.15); color: var(--brand-error); }
.kpi-icon.teal { background: rgba(1,70,81,0.15); color: var(--brand-secondary); }
.kpi-icon.lime { background: rgba(206,244,49,0.2); color: var(--brand-primary); }

.kpi-label {
  font-size: 0.65rem; color: var(--brand-text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.3px; margin-bottom: 4px;
}
.kpi-value {
  font-size: 1.15rem; font-weight: 700;
  color: var(--brand-text); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* === Charts === */
.chart-bar-group {
  display: flex; gap: 6px; height: 160px; padding: 0 4px;
}
.chart-col { flex: 1; text-align: center; display: flex; flex-direction: column; }
.chart-col-bar { flex: 1; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%; background: var(--brand-accent);
  border-radius: 4px 4px 0 0; position: relative;
  transition: background 0.2s; min-height: 4px;
}
.chart-bar:hover { background: var(--brand-highlight); }
.chart-bar-value {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; font-weight: 600; color: var(--brand-text); white-space: nowrap;
}
.chart-bar-label {
  font-size: 0.65rem; color: var(--brand-text-muted); margin-top: 6px; padding: 2px 0;
}

/* === Ranking === */
.rank-list { list-style: none; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--brand-border);
}
.rank-item:last-child { border-bottom: none; }
.rank-number {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  background: var(--brand-accent); color: var(--brand-primary); flex-shrink: 0;
}
.rank-name { flex: 1; font-size: 0.8rem; font-weight: 500; line-height: 1.3; }
.rank-value { font-size: 0.8rem; font-weight: 600; color: var(--brand-accent); flex-shrink: 0; }

/* === Actividad === */
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--brand-border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.activity-dot.pedido { background: var(--brand-accent); }
.activity-dot.pago { background: var(--brand-success); }
.activity-dot.despacho { background: var(--brand-info); }
.activity-dot.stock { background: var(--brand-warning); }
.activity-dot.compra { background: var(--brand-secondary); }
.activity-text { font-size: 0.8rem; color: var(--brand-text); }
.activity-time { font-size: 0.7rem; color: var(--brand-text-muted); margin-top: 2px; }

/* === Desktop === */
@media (min-width: 769px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
  .kpi-card { padding: 20px; border-radius: 12px; }
  .kpi-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .kpi-label { font-size: 0.75rem; }
  .kpi-value { font-size: 1.65rem; }
  .chart-bar-group { height: 200px; gap: 10px; }
  .chart-bar-value { font-size: 0.7rem; }
  .chart-bar-label { font-size: 0.75rem; }
  .rank-name { font-size: 0.875rem; }
  .activity-text { font-size: 0.875rem; }
}

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