/* =========================================================
   TaskPulse Dashboard Styles - Metrics, Charts & Live Feed
   ========================================================= */

/* --- Metrics Grid --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--metric-glow, rgba(0, 242, 254, 0.15)) 0%, transparent 70%);
  pointer-events: none;
}

.metric-card.cyan { --metric-glow: rgba(0, 242, 254, 0.2); border-left: 4px solid var(--accent-cyan); }
.metric-card.yellow { --metric-glow: rgba(245, 158, 11, 0.2); border-left: 4px solid var(--accent-yellow); }
.metric-card.green { --metric-glow: rgba(16, 185, 129, 0.2); border-left: 4px solid var(--accent-green); }
.metric-card.red { --metric-glow: rgba(239, 68, 68, 0.2); border-left: 4px solid var(--accent-red); }

.metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.metric-card.cyan .metric-icon { background: rgba(0, 242, 254, 0.12); color: var(--accent-cyan); }
.metric-card.yellow .metric-icon { background: rgba(245, 158, 11, 0.12); color: var(--accent-yellow); }
.metric-card.green .metric-icon { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.metric-card.red .metric-icon { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }

.metric-details {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.metric-number {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

/* --- Charts Grid --- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
}

.chart-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-header i {
  color: var(--accent-cyan);
}

.chart-canvas-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Dashboard Widgets & Live Feed --- */
.dashboard-widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  backdrop-filter: blur(8px);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
}

.widget-header h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.badge-live {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notification-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.notif-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  transition: background 0.2s;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-item:hover {
  background: rgba(30, 41, 59, 0.8);
}

.notif-item-content h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-item-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.notif-recipients-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notif-email-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notif-item-time {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty-feed {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Helpers */
.mt-4 { margin-top: 24px; }
.text-cyan { color: var(--accent-cyan); }
.text-red { color: var(--accent-red); }

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