/* Dashboard Styles */
/* DASHBOARD STYLES                             */
/* ============================================ */

/* Dashboard Stats Row */
.dashboard-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

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

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

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

.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dash-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(196, 244, 0, 0.15);
  border-color: var(--accent);
}

.dash-stat-card:hover::before {
  opacity: 1;
}

.dash-stat-card[data-color="purple"]::before { background: linear-gradient(90deg, #c4f400, #9bc700); }
.dash-stat-card[data-color="blue"]::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.dash-stat-card[data-color="green"]::before { background: linear-gradient(90deg, #10b981, #059669); }
.dash-stat-card[data-color="orange"]::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.dash-stat-card[data-color="gray"]::before { background: linear-gradient(90deg, #64748b, #94a3b8); }

.dash-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-stat-card[data-color="purple"] .dash-stat-icon {
  background: linear-gradient(135deg, rgba(196, 244, 0, 0.25), rgba(155, 199, 0, 0.15));
  color: #9bc700;
}
.dash-stat-card[data-color="blue"] .dash-stat-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.1));
  color: #3b82f6;
}
.dash-stat-card[data-color="green"] .dash-stat-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
  color: #10b981;
}
.dash-stat-card[data-color="orange"] .dash-stat-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.1));
  color: #f59e0b;
}
.dash-stat-card[data-color="gray"] .dash-stat-icon {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.2), rgba(148, 163, 184, 0.1));
  color: #64748b;
}

.dash-stat-icon svg {
  width: 28px;
  height: 28px;
}

.dash-stat-content {
  flex: 1;
  min-width: 0;
}

.dash-stat-value {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.dash-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-stat-trend {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.dash-stat-trend.up {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.dash-stat-trend.down {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

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

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

/* Dashboard Cards */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.dash-card:hover {
  box-shadow: 0 8px 32px rgba(196, 244, 0, 0.1);
}

.dash-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-subtle);
}

.dash-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.dash-card-badge {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 500;
}

.dash-card-badge.live {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.dash-card-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.dash-card-link:hover {
  color: var(--accent-hover);
}

.dash-card-body {
  padding: 16px;
}

/* Card Grid Placement */
.priority-chart { grid-column: span 4; }
.types-chart { grid-column: span 4; }
.pipeline-card { grid-column: span 4; }
.severity-chart { grid-column: span 3; }
.team-workload-card { grid-column: span 5; }
.modules-chart { grid-column: span 4; }
.phases-card { grid-column: span 4; }
.activity-card { grid-column: span 8; }

@media (max-width: 1200px) {
  .priority-chart { grid-column: span 3; }
  .types-chart { grid-column: span 3; }
  .pipeline-card { grid-column: span 6; }
  .severity-chart { grid-column: span 3; }
  .team-workload-card { grid-column: span 3; }
  .modules-chart { grid-column: span 3; }
  .phases-card { grid-column: span 3; }
  .activity-card { grid-column: span 6; }
}

@media (max-width: 768px) {
  .priority-chart,
  .types-chart,
  .pipeline-card,
  .severity-chart,
  .team-workload-card,
  .modules-chart,
  .phases-card,
  .activity-card {
    grid-column: span 1;
  }
}

/* Donut Chart */
.donut-chart-container {
  display: flex;
  align-items: center;
  gap: 32px;
}

@media (max-width: 500px) {
  .donut-chart-container {
    flex-direction: column;
  }
}

.donut-chart {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-ring {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 3;
}

.donut-segment {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease;
}

.donut-segment.p0 { stroke: #dc2626; }
.donut-segment.p1 { stroke: #ea580c; }
.donut-segment.p2 { stroke: #f59e0b; }
.donut-segment.p3 { stroke: #10b981; }

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.donut-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.legend-color.p0 { background: #dc2626; }
.legend-color.p1 { background: #ea580c; }
.legend-color.p2 { background: #f59e0b; }
.legend-color.p3 { background: #10b981; }

.legend-label {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.bar-icon {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.bar-icon.bug { background: #dc2626; }
.bar-icon.feature { background: #7c3aed; }
.bar-icon.enhancement { background: #2563eb; }
.bar-icon.chore { background: #64748b; }

.bar-track {
  flex: 1;
  height: 12px;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill.bug { background: linear-gradient(90deg, #dc2626, #ef4444); }
.bar-fill.feature { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.bar-fill.enhancement { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.bar-fill.chore { background: linear-gradient(90deg, #64748b, #94a3b8); }

.bar-value {
  width: 32px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

/* Pipeline Stages */
.pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pipeline-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.pipeline-stage:hover {
  background: var(--accent-bg);
}

.pipeline-stage-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.pipeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pipeline-dot.assigned { background: #64748b; }
.pipeline-dot.in_progress { background: #3b82f6; }
.pipeline-dot.dev { background: #4a90d9; }
.pipeline-dot.testing { background: #f59e0b; }
.pipeline-dot.qa_cleared { background: #10b981; }
.pipeline-dot.pr_raised { background: #ec4899; }
.pipeline-dot.deployed { background: #059669; }

.pipeline-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pipeline-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  min-width: 28px;
  text-align: right;
}

.pipeline-bar {
  width: 60px;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.pipeline-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  width: 0%;
}

.pipeline-bar-fill.assigned { background: #64748b; }
.pipeline-bar-fill.in_progress { background: #3b82f6; }
.pipeline-bar-fill.dev { background: #4a90d9; }
.pipeline-bar-fill.testing { background: #f59e0b; }
.pipeline-bar-fill.qa_cleared { background: #10b981; }
.pipeline-bar-fill.pr_raised { background: #ec4899; }
.pipeline-bar-fill.deployed { background: #059669; }

/* Severity Grid */
.severity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.severity-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-input);
  border-radius: 16px;
  transition: all 0.2s ease;
}

.severity-item:hover {
  transform: translateY(-2px);
}

.severity-ring {
  position: relative;
  width: 64px;
  height: 64px;
}

.severity-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.severity-ring-bg {
  fill: none;
  stroke: var(--bg-secondary);
  stroke-width: 4;
}

.severity-ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 88;
  stroke-dashoffset: 88;
  transition: stroke-dashoffset 0.8s ease;
}

.severity-item.critical .severity-ring-fill { stroke: #dc2626; }
.severity-item.high .severity-ring-fill { stroke: #ea580c; }
.severity-item.medium .severity-ring-fill { stroke: #f59e0b; }
.severity-item.low .severity-ring-fill { stroke: #10b981; }

.severity-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.severity-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Team Workload */
.team-workload-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.workload-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-input);
  border-radius: 14px;
  transition: all 0.2s ease;
}

.workload-item:hover {
  background: var(--accent-bg);
}

.workload-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.workload-info {
  flex: 1;
  min-width: 0;
}

.workload-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.workload-role {
  font-size: 12px;
  color: var(--text-muted);
}

.workload-bar-container {
  width: 100px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.workload-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  background: var(--accent);
}

.workload-bar-fill.high { background: #ef4444; }
.workload-bar-fill.medium { background: #f59e0b; }

.workload-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  min-width: 40px;
  text-align: right;
}

.workload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  color: var(--text-muted);
  text-align: center;
}

.workload-empty svg {
  opacity: 0.5;
}

/* Modules Treemap */
.modules-treemap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 160px;
}

.treemap-item {
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: default;
}

.treemap-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.treemap-item .module-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.treemap-item .module-count {
  font-size: 20px;
  font-weight: 800;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.treemap-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Phases List */
.phases-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.phase-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.phase-info {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 160px;
  flex-shrink: 0;
}

.phase-number {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gradient-1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.phase-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.phase-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.phase-progress-bar {
  flex: 1;
  height: 10px;
  background: var(--bg-input);
  border-radius: 5px;
  overflow: hidden;
}

.phase-progress-fill {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 5px;
  transition: width 0.8s ease;
  width: 0%;
}

.phase-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  min-width: 36px;
  text-align: right;
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

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

.activity-item:hover {
  background: var(--gradient-subtle);
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.created {
  background: rgba(196, 244, 0, 0.15);
  color: #9bc700;
}

.activity-icon.assigned {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.activity-icon.updated {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.activity-icon.deployed {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.activity-icon svg {
  width: 18px;
  height: 18px;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

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

.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.activity-text .ticket-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  color: var(--text-muted);
  text-align: center;
}

.activity-empty svg {
  opacity: 0.5;
}
