/* ============================================
   PAYGUARD — Cash-Flow Agent Styles
   Dark theme, matches the rest of the site.
   ============================================ */

.agent-dashboard {
  padding: 120px 0 80px;
  background: var(--bg-dark);
  min-height: 100vh;
}

.agent-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.agent-header {
  text-align: center;
  margin-bottom: 36px;
}

.agent-header h1 {
  font-size: 2.5rem;
  margin: 14px 0 10px;
}

.agent-header p {
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Pipeline ── */
.pipeline {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  min-width: 96px;
  transition: all 0.3s ease;
}

.pipeline-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.pipeline-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pipeline-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pipeline-step.active {
  background: rgba(79, 70, 229, 0.18);
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  transform: translateY(-2px);
}
.pipeline-step.active .pipeline-icon,
.pipeline-step.active .pipeline-name {
  color: var(--primary-light);
}

.pipeline-step.completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
}
.pipeline-step.completed .pipeline-icon {
  color: var(--success);
}
.pipeline-step.completed .pipeline-name {
  color: #6ee7b7;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Dashboard grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

/* ── Panels ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

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

.panel-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}
.panel-header h3 i {
  color: var(--primary-light);
}

/* ── Panel totals ── */
.panel-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.total-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.total-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}

.total-value {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.total-in  { color: #6ee7b7; }
.total-out { color: #fca5a5; }
.total-net { color: var(--text-primary); }

/* ── Table ── */
.table-responsive {
  overflow-x: auto;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
}

.tx-table th,
.tx-table td {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.tx-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.tx-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tx-table .empty-state td {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 10px;
  font-style: italic;
}

.amount-in  { color: #6ee7b7; font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-out { color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }

.cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--primary-light);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-completed { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.status-pending   { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }

/* ── Status indicator ── */
.status-indicator {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  margin-left: auto;
}
.status-indicator.active {
  background: rgba(79, 70, 229, 0.2);
  border-color: rgba(79, 70, 229, 0.5);
  color: var(--primary-light);
  animation: pulse 1.6s infinite;
}

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

/* ── Agent console ── */
.agent-console {
  background: #0b0f1d;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  height: 320px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.84rem;
  color: #a6accd;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.4);
}

.log-entry {
  margin-bottom: 8px;
  line-height: 1.45;
  opacity: 0;
  animation: fadeIn 0.35s forwards;
}
.log-entry.info    { color: #89ddff; }
.log-entry.warn    { color: #ffcb6b; }
.log-entry.alert   { color: #f07178; font-weight: 700; }
.log-entry.success { color: #c3e88d; }

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ── Agent results ── */
.agent-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.4s ease;
}

.agent-results.hidden { display: none; }

.result-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .result-kpis { grid-template-columns: 1fr; }
}

/* Recommendations */
.result-recommendations {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.rec-item i {
  font-size: 1rem;
  margin-top: 2px;
}

.rec-item strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.rec-item p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.rec-ok     { border-color: rgba(16, 185, 129, 0.35); }
.rec-ok i   { color: var(--success); }
.rec-info   { border-color: rgba(6, 182, 212, 0.35); }
.rec-info i { color: var(--accent); }
.rec-warn   { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.06); }
.rec-warn i { color: var(--warning); }
.rec-danger { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.07); }
.rec-danger i { color: var(--danger); }

/* Flag alert */
.result-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  animation: slideUp 0.4s ease;
}
.result-alert i { font-size: 1.15rem; margin-top: 2px; }
.result-alert strong { display: block; margin-bottom: 2px; }
.result-alert p { font-size: 0.85rem; line-height: 1.5; }

.alert-ok {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}
.alert-ok i, .alert-ok strong { color: #6ee7b7; }
.alert-ok p { color: var(--text-secondary); }

.alert-warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.alert-warn i, .alert-warn strong { color: #fbbf24; }
.alert-warn p { color: var(--text-secondary); }

.alert-danger {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.09);
}
.alert-danger i, .alert-danger strong { color: #f87171; }
.alert-danger p { color: var(--text-secondary); }

/* Rerun button */
.btn-block {
  width: 100%;
  justify-content: center;
}

/* ── Footnote ── */
.agent-footnote {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
}
.agent-footnote i {
  color: var(--primary-light);
  font-size: 1.1rem;
  margin-top: 2px;
}

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