.outbox-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.outbox-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.18), transparent 36%),
    linear-gradient(135deg, var(--card), color-mix(in srgb, var(--card) 82%, var(--accent)));
}

.outbox-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.outbox-title {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.05;
  color: var(--foreground);
}

.outbox-description {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.outbox-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.outbox-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.outbox-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.outbox-stat {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card) 94%, white 6%), var(--card)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 38%);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
}

.outbox-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  opacity: 0.95;
}

.outbox-stat--total::before {
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.outbox-stat--pending::before {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.outbox-stat--sent::before {
  background: linear-gradient(90deg, #22c55e, #14b8a6);
}

.outbox-stat--error::before {
  background: linear-gradient(90deg, #fb7185, #ef4444);
}

.outbox-stat--cancelled::before {
  background: linear-gradient(90deg, #94a3b8, #64748b);
}

.outbox-stat--no-event::before {
  background: linear-gradient(90deg, #a78bfa, #6366f1);
}

.outbox-stat-label {
  display: block;
  color: var(--muted-foreground);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.outbox-stat strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: var(--foreground);
  line-height: 1;
}

.outbox-stat-meta {
  display: block;
  margin-top: 10px;
  color: color-mix(in srgb, var(--muted-foreground) 88%, white 12%);
  font-size: 0.82rem;
  line-height: 1.35;
}

.outbox-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 18px;
}

.outbox-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  font-weight: 700;
}

.outbox-table-card {
  padding: 0;
}

.outbox-table-wrap {
  overflow-x: auto;
}

.outbox-table {
  min-width: 1120px;
}

.outbox-table th,
.outbox-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

.outbox-table th {
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.outbox-id {
  font-weight: 800;
  color: var(--muted-foreground);
}

.outbox-email,
.outbox-subject,
.outbox-error {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outbox-pill,
.outbox-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.outbox-pill {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.outbox-status--pending {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.outbox-status--sent {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.outbox-status--error {
  background: rgba(239, 68, 68, 0.16);
  color: #dc2626;
}

.outbox-status--cancelled {
  background: rgba(100, 116, 139, 0.16);
  color: #475569;
}

.dark .outbox-status--pending {
  color: #fcd34d;
}

.dark .outbox-status--sent {
  color: #86efac;
}

.dark .outbox-status--error {
  color: #fca5a5;
}

.dark .outbox-status--cancelled {
  color: #cbd5e1;
}

@media (max-width: 900px) {
  .outbox-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .outbox-actions {
    justify-content: flex-start;
  }

  .outbox-stats,
  .outbox-filters {
    grid-template-columns: 1fr;
  }
}
