:root {
  --bg: #0f172a;
  --card: #111827;
  --accent: #10b981;
  --accent-2: #14b8a6;
  --violet: #7c3aed;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

.shadow-glow {
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.glass-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.85), rgba(17, 24, 39, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(18px);
  position: relative;
}

.workflow-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon svg {
  width: 22px;
  height: 22px;
}

.step-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5f5;
}

.upload-zone {
  display: block;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 18px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.5);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-zone.hover {
  border-color: rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.input-dark {
  width: 100%;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.8);
  padding: 10px 12px;
  color: #e2e8f0;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #14b8a6);
  color: #042f2e;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

.btn-ghost {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  color: #cbd5f5;
  transition: border-color 0.2s ease;
}

.btn-ghost:hover {
  border-color: rgba(148, 163, 184, 0.6);
}

.stat-chip {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 10px;
  border-radius: 10px;
}

.ai-activity {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 14px;
  background: rgba(15, 23, 42, 0.7);
  display: grid;
  gap: 10px;
}

.wave-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  height: 50px;
  gap: 6px;
}

.wave-bar {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.9), rgba(124, 58, 237, 0.8));
  animation: wave 1.6s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.wave-bar:nth-child(2) { animation-delay: -0.2s; }
.wave-bar:nth-child(3) { animation-delay: -0.4s; }
.wave-bar:nth-child(4) { animation-delay: -0.6s; }
.wave-bar:nth-child(5) { animation-delay: -0.8s; }
.wave-bar:nth-child(6) { animation-delay: -1.0s; }
.wave-bar:nth-child(7) { animation-delay: -1.2s; }
.wave-bar:nth-child(8) { animation-delay: -1.4s; }
.wave-bar:nth-child(9) { animation-delay: -1.6s; }
.wave-bar:nth-child(10) { animation-delay: -1.8s; }
.wave-bar:nth-child(11) { animation-delay: -2.0s; }
.wave-bar:nth-child(12) { animation-delay: -2.2s; }
.wave-bar:nth-child(13) { animation-delay: -2.4s; }
.wave-bar:nth-child(14) { animation-delay: -2.6s; }
.wave-bar:nth-child(15) { animation-delay: -2.8s; }
.wave-bar:nth-child(16) { animation-delay: -3.0s; }

@keyframes wave {
  0%, 100% { height: 8px; opacity: 0.5; }
  50% { height: 48px; opacity: 1; }
}

.log-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: #cbd5f5;
  max-height: 220px;
  overflow: auto;
  white-space: pre-line;
  line-height: 1.5;
}

.log-scroll-btn {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5f5;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.log-scroll-btn.show {
  opacity: 1;
  pointer-events: auto;
}

.log-scroll-btn:hover {
  border-color: rgba(148, 163, 184, 0.6);
}

.transcript-card {
  position: relative;
  overflow: hidden;
}

.transcript-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.12), transparent 55%);
  pointer-events: none;
}

.live-pill {
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
}

.order-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  padding-bottom: 6px;
}

.order-tab {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.7);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #cbd5f5;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.order-tab.active {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.15);
  color: #d1fae5;
}

.transcript-stream {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 12px;
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.transcript-line {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.5);
}

.transcript-line.master {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.transcript-line.client {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

.transcript-meta {
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}

.transcript-text {
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
}

.transcript-empty {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  padding: 20px 8px;
}

.transcript-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.7);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #cbd5f5;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.filter-chip.active {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.15);
  color: #d1fae5;
}

.pill.done {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.pill.running {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.pill.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.stat-block {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 14px;
}

.stat-title {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  color: #94a3b8;
}

.stat-value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.5);
}

.toast.show {
  display: block;
  animation: toast-in 0.3s ease;
}

@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(148,163,184,0.15), rgba(148,163,184,0.25), rgba(148,163,184,0.15));
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@media (max-width: 1024px) {
  .workflow-step {
    flex-direction: column;
  }
  .step-icon {
    width: 40px;
    height: 40px;
  }
  .order-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
