/* =================================
   DASHBOARD.CSS — Stats, activity, pipeline
   DeloneTech Design System v2
   ================================= */

/* =================================
   Stats grid
   ================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.125rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient sweep */
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0.4;
  pointer-events: none;
  border-radius: inherit;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.stat-card:has(.stat-icon-accent),
.stat-card:has(.stat-icon-primary) { border-top: 2px solid var(--accent); }
.stat-card:has(.stat-icon-success)  { border-top: 2px solid var(--color-success); }
.stat-card:has(.stat-icon-warning)  { border-top: 2px solid var(--color-warning); }
.stat-card:has(.stat-icon-danger)   { border-top: 2px solid var(--color-error); }
.stat-card:has(.stat-icon-info)     { border-top: 2px solid var(--color-info); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.stat-icon svg { width: 17px; height: 17px; stroke: var(--text-secondary); }

.stat-icon-accent,
.stat-icon-primary { background: var(--accent-muted-mid); border-color: rgba(212,118,44,0.3); }
.stat-icon-accent svg,
.stat-icon-primary svg { stroke: var(--accent); }
.stat-icon-success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.25); }
.stat-icon-success svg { stroke: var(--color-success); }
.stat-icon-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); }
.stat-icon-warning svg { stroke: var(--color-warning); }
.stat-icon-danger  { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); }
.stat-icon-danger svg  { stroke: var(--color-error); }
.stat-icon-info    { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.25); }
.stat-icon-info svg    { stroke: #60a5fa; }

.stat-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.stat-value {
  font-size: clamp(1.1rem, 2vw, 1.625rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

/* =================================
   Dashboard grid
   ================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

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

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

/* =================================
   Activity feed
   ================================= */
.activity-feed { list-style: none; padding: 0; margin: 0; }

.activity-item {
  display: flex;
  gap: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 7px;
  box-shadow: 0 0 6px rgba(212,118,44,0.4);
}

.activity-content { flex: 1; }

.activity-text {
  font-size: 0.845rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 0.15rem;
}

/* =================================
   Pipeline board
   ================================= */
.pipeline-wrapper { overflow-x: auto; padding-bottom: 0.5rem; }

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 0.875rem;
}

.pipeline-col {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.pipeline-col-header {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

.pipeline-col-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.pipeline-col-count {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
}

.pipeline-cards {
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 80px;
}

.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.15s;
}

.pipeline-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.pipeline-card-name {
  font-size: 0.845rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.18rem;
  text-decoration: none;
  display: block;
  transition: color var(--transition);
}

.pipeline-card-name:hover { color: var(--accent); text-decoration: none; }

.pipeline-card-company {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.3rem;
}

.pipeline-card-value {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--color-success);
}

/* Column accent top borders */
.pipeline-col-nuevo      .pipeline-col-header { border-top: 2px solid #3b82f6; }
.pipeline-col-contactado .pipeline-col-header { border-top: 2px solid var(--accent); }
.pipeline-col-propuesta  .pipeline-col-header { border-top: 2px solid var(--color-warning); }
.pipeline-col-ganado     .pipeline-col-header { border-top: 2px solid var(--color-success); }
.pipeline-col-perdido    .pipeline-col-header { border-top: 2px solid var(--color-error); }

/* =================================
   Module quick-access cards
   ================================= */
.module-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.875rem;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none !important;
  box-shadow: var(--shadow-sm);
}

.module-card:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  box-shadow: var(--accent-glow-sm), var(--shadow-md);
  transform: translateY(-2px);
}

.module-card-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  transition: all 0.2s;
}

.module-card:hover .module-card-icon {
  background: var(--accent-muted-mid);
  border-color: rgba(212,118,44,0.3);
}

.module-card-icon svg { width: 19px; height: 19px; stroke: var(--accent); }

.module-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.module-card-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.35;
}
