/* ========================================
   ADMIN ACTIONS DASHBOARD
   Ops-style detail view for action tracking
   ======================================== */

/* Status hero banner */
.action-hero {
  border-radius: 12px;
  padding: 1.5rem 2rem;
  color: white;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-hero.is-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.action-hero.is-queued {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.action-hero.is-running {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.action-hero.is-done {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.action-hero.is-failed {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.action-hero.is-cancelled {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

[data-theme="dark"] .action-hero.is-pending {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

[data-theme="dark"] .action-hero.is-queued {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

[data-theme="dark"] .action-hero.is-running {
  background: linear-gradient(135deg, #4c5fd5 0%, #5e3d8a 100%);
}

[data-theme="dark"] .action-hero.is-done {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

[data-theme="dark"] .action-hero.is-failed {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

[data-theme="dark"] .action-hero.is-cancelled {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.action-hero-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.action-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.action-hero-text h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
}

.action-hero-text p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.action-hero-text code {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.action-hero-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.action-hero-actions .button {
  --bulma-duration: 0ms;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.action-hero-actions .button:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Detail card */
.action-detail-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .action-detail-card {
  background: #1f2937;
  border-color: #374151;
}

.action-detail-card-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f3f4f6;
}

[data-theme="dark"] .action-detail-card-header {
  border-color: #374151;
}

.action-detail-card-header-title {
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .action-detail-card-header-title {
  color: #f3f4f6;
}

.action-detail-card-header-title .icon {
  color: #6b7280;
}

[data-theme="dark"] .action-detail-card-header-title .icon {
  color: #9ca3af;
}

.action-detail-card-body {
  padding: 1.25rem;
}

.action-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.action-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.action-detail-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  font-weight: 500;
}

[data-theme="dark"] .action-detail-label {
  color: #6b7280;
}

.action-detail-value {
  color: #374151;
}

[data-theme="dark"] .action-detail-value {
  color: #d1d5db;
}

.action-detail-value code {
  background: #f3f4f6;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

[data-theme="dark"] .action-detail-value code {
  background: #374151;
}

.action-detail-value a {
  font-weight: 500;
}

/* Dispatch method badge */
.action-dispatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.action-dispatch-badge.is-http-agent {
  background: #ecfeff;
  color: #0891b2;
}

.action-dispatch-badge.is-sidekiq {
  background: #fce7f3;
  color: #be185d;
}

[data-theme="dark"] .action-dispatch-badge.is-http-agent {
  background: #164e63;
  color: #22d3ee;
}

[data-theme="dark"] .action-dispatch-badge.is-sidekiq {
  background: #831843;
  color: #f9a8d4;
}

/* Card footer for timestamps */
.action-detail-card-footer {
  padding: 0.625rem 1.25rem;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
  display: flex;
  gap: 1.5rem;
  color: #6b7280;
}

[data-theme="dark"] .action-detail-card-footer {
  border-color: #374151;
  background: #1a1f2e;
  color: #6b7280;
}

/* Error panel */
.action-error-panel {
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

[data-theme="dark"] .action-error-panel {
  background: #450a0a;
  border-color: #7f1d1d;
}

.action-error-panel .error-icon {
  color: #dc2626;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

[data-theme="dark"] .action-error-panel .error-icon {
  color: #f87171;
}

.action-error-panel .error-message {
  color: #991b1b;
  word-break: break-word;
}

[data-theme="dark"] .action-error-panel .error-message {
  color: #fca5a5;
}

/* JSON payload card */
.action-payload-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .action-payload-card {
  background: #1f2937;
  border-color: #374151;
}

.action-payload-card-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #1f2937;
}

[data-theme="dark"] .action-payload-card-header {
  border-color: #374151;
  color: #f3f4f6;
}

.action-payload-card-header .icon {
  color: #6b7280;
}

[data-theme="dark"] .action-payload-card-header .icon {
  color: #9ca3af;
}

.action-payload-card-body {
  padding: 0;
}

.action-payload-card-body pre {
  margin: 0;
  padding: 1rem 1.25rem;
  border-radius: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========================================
   INDEX PAGE - Stats & Table
   ======================================== */

/* Stats pill row */
.action-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.action-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: white;
  text-decoration: none;
}

.action-stat-pill:hover {
  border-color: #d1d5db;
}

[data-theme="dark"] .action-stat-pill {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .action-stat-pill:hover {
  border-color: #4b5563;
}

.action-stat-pill .stat-count {
  font-weight: 700;
}

.action-stat-pill .stat-label {
  color: #6b7280;
  font-weight: 500;
}

[data-theme="dark"] .action-stat-pill .stat-label {
  color: #9ca3af;
}


/* Pill color variants */
.action-stat-pill.is-total .stat-count, .action-stat-pill.is-total .fas { color: #3b82f6; }
.action-stat-pill.is-pending .stat-count, .action-stat-pill.is-pending .fas { color: #64748b; }
.action-stat-pill.is-queued .stat-count, .action-stat-pill.is-queued .fas { color: #3b82f6; }
.action-stat-pill.is-running .stat-count, .action-stat-pill.is-running .fas { color: #7c3aed; }
.action-stat-pill.is-done .stat-count, .action-stat-pill.is-done .fas { color: #10b981; }
.action-stat-pill.is-failed .stat-count, .action-stat-pill.is-failed .fas { color: #ef4444; }
.action-stat-pill.is-cancelled .stat-count, .action-stat-pill.is-cancelled .fas { color: #6b7280; }
.action-stat-pill.is-on-hold .stat-count, .action-stat-pill.is-on-hold .fas { color: #ef4444; }
.action-stat-pill.is-open .stat-count, .action-stat-pill.is-open .fas { color: #10b981; }
.action-stat-pill.is-unassigned .stat-count, .action-stat-pill.is-unassigned .fas { color: #6b7280; }
.action-stat-pill.is-my-tickets .stat-count, .action-stat-pill.is-my-tickets .fas { color: #7c3aed; }

[data-theme="dark"] .action-stat-pill.is-total .stat-count, [data-theme="dark"] .action-stat-pill.is-total .fas { color: #60a5fa; }
[data-theme="dark"] .action-stat-pill.is-pending .stat-count, [data-theme="dark"] .action-stat-pill.is-pending .fas { color: #94a3b8; }
[data-theme="dark"] .action-stat-pill.is-queued .stat-count, [data-theme="dark"] .action-stat-pill.is-queued .fas { color: #60a5fa; }
[data-theme="dark"] .action-stat-pill.is-running .stat-count, [data-theme="dark"] .action-stat-pill.is-running .fas { color: #c4b5fd; }
[data-theme="dark"] .action-stat-pill.is-done .stat-count, [data-theme="dark"] .action-stat-pill.is-done .fas { color: #34d399; }
[data-theme="dark"] .action-stat-pill.is-failed .stat-count, [data-theme="dark"] .action-stat-pill.is-failed .fas { color: #f87171; }
[data-theme="dark"] .action-stat-pill.is-cancelled .stat-count, [data-theme="dark"] .action-stat-pill.is-cancelled .fas { color: #9ca3af; }
[data-theme="dark"] .action-stat-pill.is-on-hold .stat-count, [data-theme="dark"] .action-stat-pill.is-on-hold .fas { color: #f87171; }
[data-theme="dark"] .action-stat-pill.is-open .stat-count, [data-theme="dark"] .action-stat-pill.is-open .fas { color: #34d399; }
[data-theme="dark"] .action-stat-pill.is-unassigned .stat-count, [data-theme="dark"] .action-stat-pill.is-unassigned .fas { color: #9ca3af; }
[data-theme="dark"] .action-stat-pill.is-my-tickets .stat-count, [data-theme="dark"] .action-stat-pill.is-my-tickets .fas { color: #c4b5fd; }

/* Active pill (selected filter) */
.action-stat-pill.is-active { border-width: 2px; }
.action-stat-pill.is-active.is-total { border-color: #3b82f6; }
.action-stat-pill.is-active.is-pending { border-color: #64748b; }
.action-stat-pill.is-active.is-queued { border-color: #3b82f6; }
.action-stat-pill.is-active.is-running { border-color: #7c3aed; }
.action-stat-pill.is-active.is-done { border-color: #10b981; }
.action-stat-pill.is-active.is-failed { border-color: #ef4444; }
.action-stat-pill.is-active.is-cancelled { border-color: #6b7280; }
.action-stat-pill.is-active.is-on-hold { border-color: #ef4444; }
.action-stat-pill.is-active.is-open { border-color: #10b981; }
.action-stat-pill.is-active.is-unassigned { border-color: #6b7280; }
.action-stat-pill.is-active.is-my-tickets { border-color: #7c3aed; }

[data-theme="dark"] .action-stat-pill.is-active.is-total { border-color: #60a5fa; }
[data-theme="dark"] .action-stat-pill.is-active.is-pending { border-color: #94a3b8; }
[data-theme="dark"] .action-stat-pill.is-active.is-queued { border-color: #60a5fa; }
[data-theme="dark"] .action-stat-pill.is-active.is-running { border-color: #c4b5fd; }
[data-theme="dark"] .action-stat-pill.is-active.is-done { border-color: #34d399; }
[data-theme="dark"] .action-stat-pill.is-active.is-failed { border-color: #f87171; }
[data-theme="dark"] .action-stat-pill.is-active.is-cancelled { border-color: #9ca3af; }
[data-theme="dark"] .action-stat-pill.is-active.is-on-hold { border-color: #f87171; }
[data-theme="dark"] .action-stat-pill.is-active.is-open { border-color: #34d399; }
[data-theme="dark"] .action-stat-pill.is-active.is-unassigned { border-color: #9ca3af; }
[data-theme="dark"] .action-stat-pill.is-active.is-my-tickets { border-color: #c4b5fd; }

/* Table card wrapper */
.action-table-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

[data-theme="dark"] .action-table-card {
  background: #1f2937;
  border-color: #374151;
}

.action-table-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}

[data-theme="dark"] .action-table-card-header {
  border-color: #374151;
}

.action-table-card-body {
  padding: 0 1.25rem 1.25rem;
}

.action-table-card-body .table-container {
  margin-top: 1rem;
}

.action-table-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
}

[data-theme="dark"] .action-table-card-footer {
  border-color: #374151;
  background: #1a1f2e;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .action-hero {
    flex-direction: column;
    text-align: center;
  }

  .action-hero-content {
    flex-direction: column;
  }

  .action-hero-actions {
    width: 100%;
    justify-content: center;
  }

  .action-detail-grid {
    grid-template-columns: 1fr;
  }

  .action-stats-row {
    gap: 0.375rem;
  }

  .action-detail-card-footer {
    flex-direction: column;
    gap: 0.5rem;
  }
}
