/* Dashboard-specific styles. Inherits theme tokens from theme.css. */
/* Nav link/btn styles live in theme.css — dashboard only adds active state. */

.nav-link-active {
  color: var(--accent);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--accent);
  color: white !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-cta:hover {
  background: #ff6060;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 77, 77, 0.3);
}

/* ===== DASHBOARD LAYOUT ===== */
.dash {
  padding: 100px 24px 80px;
  min-height: 100vh;
}

.dash-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  animation: dashFadeIn 0.5s ease both;
}

.dash-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.dash-subtitle {
  color: var(--fg-muted);
  font-size: 16px;
}

.dash-live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-text {
  color: #22c55e;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.dash-time {
  color: var(--fg-dim);
}

/* ===== REFRESH INDICATOR ===== */
.dash-refresh {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--fg-dim);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.dash-refresh.is-visible {
  opacity: 1;
}

.dash-refresh .spinner-sm {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== SECTION HEADING ===== */
.section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--fg);
}

/* ===== REVENUE ===== */
.revenue-section {
  margin-bottom: 48px;
  animation: dashFadeIn 0.5s ease 0.1s both;
}

.revenue-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.revenue-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s ease;
}

.revenue-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.revenue-card-hero {
  border-color: rgba(255, 215, 0, 0.2);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--gold-muted) 100%);
}

.revenue-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  margin-bottom: 8px;
}

.revenue-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--gold);
  transition: all 0.4s ease;
}

.revenue-card-hero .revenue-amount {
  font-size: 40px;
}

/* Revenue feed */
.revenue-feed {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.revenue-feed::-webkit-scrollbar {
  height: 4px;
}

.revenue-feed::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.rev-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  animation: slideIn 0.3s ease both;
}

.rev-item:nth-child(1) { animation-delay: 0s; }
.rev-item:nth-child(2) { animation-delay: 0.05s; }
.rev-item:nth-child(3) { animation-delay: 0.1s; }
.rev-item:nth-child(4) { animation-delay: 0.15s; }
.rev-item:nth-child(5) { animation-delay: 0.2s; }

.rev-item-amount {
  color: #22c55e;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.rev-item-source {
  color: var(--fg-muted);
  font-weight: 500;
}

.rev-item-desc {
  color: var(--fg-dim);
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rev-item-time {
  color: var(--fg-dim);
  font-size: 11px;
}

/* ===== AGENT GRID ===== */
.agents-section {
  margin-bottom: 48px;
  animation: dashFadeIn 0.5s ease 0.2s both;
}

.agent-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.agent-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: cardAppear 0.4s ease both;
}

.agent-status-card:nth-child(1) { animation-delay: 0s; }
.agent-status-card:nth-child(2) { animation-delay: 0.05s; }
.agent-status-card:nth-child(3) { animation-delay: 0.1s; }
.agent-status-card:nth-child(4) { animation-delay: 0.15s; }
.agent-status-card:nth-child(5) { animation-delay: 0.2s; }
.agent-status-card:nth-child(6) { animation-delay: 0.25s; }
.agent-status-card:nth-child(7) { animation-delay: 0.3s; }

.agent-status-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 77, 77, 0.15);
  transform: translateY(-2px);
}

.agent-status-card.is-active {
  border-color: rgba(34, 197, 94, 0.3);
}

.agent-status-card.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #22c55e, rgba(34, 197, 94, 0.2), transparent);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.agent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.agent-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-emoji {
  font-size: 24px;
}

.agent-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.badge-idle {
  background: rgba(139, 146, 168, 0.12);
  color: var(--fg-muted);
}

.agent-role-text {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.agent-activity {
  font-size: 12px;
  color: var(--fg-dim);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border);
}

.agent-activity.is-active {
  border-left-color: #22c55e;
  color: var(--fg-muted);
}

.agent-stack-tag {
  margin-top: 10px;
  font-size: 11px;
  color: var(--fg-dim);
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 100px;
  display: inline-block;
}

/* ===== TASK LIST ===== */
.tasks-section {
  margin-bottom: 48px;
  animation: dashFadeIn 0.5s ease 0.3s both;
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tasks-header .section-heading {
  margin-bottom: 0;
}

.task-stats {
  display: flex;
  gap: 16px;
}

.task-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-muted);
}

.task-stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-active { background: #22c55e; }
.dot-queued { background: var(--gold); }
.dot-completed { background: var(--fg-dim); }

.task-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--fg);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  animation: slideIn 0.3s ease both;
}

.task-row:nth-child(1) { animation-delay: 0s; }
.task-row:nth-child(2) { animation-delay: 0.04s; }
.task-row:nth-child(3) { animation-delay: 0.08s; }
.task-row:nth-child(4) { animation-delay: 0.12s; }
.task-row:nth-child(5) { animation-delay: 0.16s; }
.task-row:nth-child(6) { animation-delay: 0.2s; }

.task-row:hover {
  background: var(--bg-card-hover);
}

.task-row.is-active {
  border-left: 3px solid #22c55e;
}

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

.task-status-in_progress { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
.task-status-queued { background: var(--gold); }
.task-status-completed { background: var(--fg-dim); }

.task-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.task-agent {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.task-priority {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}

.priority-high {
  background: rgba(255, 77, 77, 0.12);
  color: var(--accent);
}

.priority-medium {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold);
}

.priority-low {
  background: rgba(139, 146, 168, 0.1);
  color: var(--fg-muted);
}

.task-time {
  font-size: 11px;
  color: var(--fg-dim);
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-agent {
  height: 160px;
  border-radius: var(--radius);
}

.skeleton-task {
  height: 52px;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== ERROR STATE ===== */
.dash-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--fg-muted);
  text-align: center;
  gap: 12px;
}

.dash-error-icon {
  font-size: 32px;
  opacity: 0.5;
}

.dash-error-text {
  font-size: 14px;
}

.dash-error-retry {
  margin-top: 8px;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.dash-error-retry:hover {
  background: var(--bg-card-hover);
  color: var(--fg);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--fg-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 15px;
  line-height: 1.6;
}

/* ===== DASH ANIMATIONS ===== */
@keyframes dashFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardAppear {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .dash {
    padding: 90px 16px 60px;
  }

  .dash-header {
    flex-direction: column;
    gap: 16px;
  }

  .dash-title {
    font-size: 28px;
  }

  .revenue-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .revenue-amount {
    font-size: 24px;
  }

  .revenue-card-hero .revenue-amount {
    font-size: 28px;
  }

  .agent-status-grid {
    grid-template-columns: 1fr;
  }

  .task-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .task-agent {
    order: 5;
    width: 100%;
  }

  .tasks-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dash-refresh {
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .revenue-cards {
    grid-template-columns: 1fr;
  }
}
