/* ===== Custom Properties ===== */
:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --sidebar-width: 240px;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--slate-50);
  color: var(--slate-800);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes flowDash {
  to { stroke-dashoffset: -20; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes progressFill {
  from { width: 0; }
}
@keyframes bounceIn {
  0% { opacity:0; transform: scale(0.3); }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { opacity:1; transform: scale(1); }
}

.animate-fade { animation: fadeIn 0.4s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }
.animate-slide-right { animation: slideRight 0.4s ease-out; }
.animate-scale { animation: scaleIn 0.3s ease-out; }
.animate-bounce-in { animation: bounceIn 0.5s ease-out; }

.section-enter > * {
  animation: slideUp 0.45s ease-out both;
}
.section-enter > *:nth-child(2) { animation-delay: 0.06s; }
.section-enter > *:nth-child(3) { animation-delay: 0.12s; }
.section-enter > *:nth-child(4) { animation-delay: 0.18s; }
.section-enter > *:nth-child(5) { animation-delay: 0.24s; }

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--slate-100);
}
.sidebar-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-brand p {
  font-size: 11px;
  color: var(--slate-400);
  margin: 4px 0 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}
.sidebar-logo {
  width: 100%;
  max-width: 160px;
  height: auto;
  margin-bottom: 10px;
  display: block;
  opacity: 0.92;
  transition: opacity 0.3s ease;
}
.sidebar-logo:hover {
  opacity: 1;
}

/* Dashboard Analytics Divider */
.dashboard-analytics-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
  margin: 8px 0 18px;
  padding: 10px 0;
  border-top: 1px solid var(--slate-200);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dashboard-analytics-divider svg {
  color: var(--primary);
  opacity: 0.7;
}
.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--slate-100);
  color: var(--slate-700);
}
.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--slate-100);
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}
.main-header {
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
.main-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--slate-800);
}
.main-body {
  padding: 24px 32px;
}

/* ===== Cards ===== */
.card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--slate-700);
}
.card-body { padding: 20px; }

/* ===== Stat Cards ===== */
.stat-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}
.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 0;
  color: var(--slate-800);
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: #4338ca; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}
.btn-secondary:hover { background: var(--slate-200); }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

.btn-loading {
  pointer-events: none;
  opacity: 0.8;
}
.btn-loading .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ===== Input ===== */
.input, .textarea, select.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--slate-800);
  transition: all 0.2s ease;
  outline: none;
}
.input:focus, .textarea:focus, select.input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.textarea {
  min-height: 200px;
  resize: vertical;
  line-height: 1.6;
}
label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate-600);
  margin-bottom: 6px;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}
.badge-indigo { background: #eef2ff; color: #4f46e5; }
.badge-sky { background: #f0f9ff; color: #0284c7; }
.badge-green { background: #ecfdf5; color: #059669; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-amber { background: #fffbeb; color: #d97706; }
.badge-slate { background: var(--slate-100); color: var(--slate-600); }

/* ===== Results Panel ===== */
.result-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.result-item:last-child { border-bottom: none; }
.result-label { font-size: 12.5px; color: var(--slate-500); font-weight: 500; }
.result-value { font-size: 13.5px; font-weight: 600; color: var(--slate-800); }

/* ===== Confidence Ring ===== */
.confidence-ring {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto;
}
.confidence-ring svg { transform: rotate(-90deg); }
.confidence-ring .value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

/* ===== Workflow ===== */
.workflow-container {
  position: relative;
  overflow-x: auto;
  padding: 20px 0;
}
.workflow-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.workflow-node {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  border: 2px solid;
  transition: all 0.3s ease;
  position: relative;
  min-width: 140px;
  cursor: default;
}
.workflow-node:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.workflow-node.trigger { background: #f0fdf4; border-color: #86efac; color: #166534; }
.workflow-node.process { background: #faf5ff; border-color: #c4b5fd; color: #5b21b6; }
.workflow-node.category { background: #ecfdf5; border-color: #86efac; color: #166534; }
.workflow-node.decision { background: #fefce8; border-color: #fde047; color: #854d0e; transform: rotate(0deg); }
.workflow-node.action { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.workflow-node.active-flow {
  box-shadow: 0 0 0 3px rgba(79,70,229,0.3);
}
.workflow-connector {
  stroke: var(--slate-300);
  stroke-width: 2;
  fill: none;
  marker-end: url(#arrowhead);
}
.workflow-connector.active {
  stroke: var(--primary);
  stroke-dasharray: 8 4;
  animation: flowDash 0.6s linear infinite;
}

/* ===== Agent Cards ===== */
.agent-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.agent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.agent-card:hover::before { transform: scaleX(1); }
.agent-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: var(--slate-300);
}
.agent-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.agent-status.active { background: var(--success); }
.agent-status.inactive { background: var(--slate-300); }

/* ===== Toggle Switch ===== */
.toggle {
  width: 38px;
  height: 20px;
  background: var(--slate-300);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
  padding: 0;
}
.toggle.active { background: var(--primary); }
.toggle::after {
  content: '';
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.active::after { transform: translateX(18px); }

/* ===== Threshold Slider ===== */
.slider-container {
  position: relative;
  padding: 8px 0;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--slate-200);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79,70,229,0.3);
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: scaleIn 0.25s ease-out;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--slate-100);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--slate-400);
  border-radius: 6px;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--slate-100); color: var(--slate-600); }

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--slate-100);
}
.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--slate-50);
  color: var(--slate-600);
}
.data-table tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--slate-50); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 60;
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.toast-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.toast-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== Category Distribution Bars ===== */
.dist-bar-track {
  height: 8px;
  background: var(--slate-100);
  border-radius: 4px;
  overflow: hidden;
}
.dist-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-out;
  animation: progressFill 0.8s ease-out;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--slate-400);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: 0.4; }

/* ===== Loading Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .main-body { padding: 16px; }
  .main-header { padding: 12px 16px; }
}

/* ===== Tag ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--slate-100);
  border-radius: 6px;
  font-size: 12px;
  color: var(--slate-600);
}

/* ===== Agent Processing Pipeline Animation ===== */
@keyframes agentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
}
@keyframes agentGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(79, 70, 229, 0.2), inset 0 0 8px rgba(79, 70, 229, 0.05); }
  50% { box-shadow: 0 0 20px rgba(79, 70, 229, 0.4), inset 0 0 12px rgba(79, 70, 229, 0.1); }
}
@keyframes connectorFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blinkCaret {
  0%, 100% { border-right-color: var(--primary); }
  50% { border-right-color: transparent; }
}
@keyframes scanLine {
  0% { top: 0; }
  100% { top: 100%; }
}
@keyframes dataStream {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}
@keyframes progressGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(79, 70, 229, 0.3); }
  50% { box-shadow: 0 0 12px rgba(79, 70, 229, 0.6); }
}
@keyframes checkmarkDraw {
  0% { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.processing-overlay {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  animation: scaleIn 0.3s ease-out;
}

.processing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
  background: linear-gradient(135deg, #f8faff 0%, #fff 100%);
}
.processing-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.processing-header .proc-status {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.processing-header .proc-status .proc-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Overall progress bar */
.proc-progress-bar {
  height: 3px;
  background: var(--slate-100);
  position: relative;
  overflow: hidden;
}
.proc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8, var(--primary));
  background-size: 200% 100%;
  border-radius: 0 2px 2px 0;
  transition: width 0.4s ease;
  animation: progressGlow 1.5s ease-in-out infinite;
}

/* Pipeline body */
.proc-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Agent step */
.proc-agent-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s ease;
  position: relative;
}
.proc-agent-step.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Timeline line */
.proc-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 32px;
}
.proc-timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--slate-100);
  border: 2px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.4s ease;
  flex-shrink: 0;
}
.proc-agent-step.active .proc-timeline-dot {
  background: var(--primary-bg);
  border-color: var(--primary);
  animation: agentPulse 1.5s ease infinite;
}
.proc-agent-step.active .proc-timeline-dot span {
  color: var(--primary);
}
.proc-agent-step.completed .proc-timeline-dot {
  background: #ecfdf5;
  border-color: var(--success);
  animation: none;
}
.proc-agent-step.completed .proc-timeline-dot span {
  color: var(--success);
}
.proc-agent-step.error .proc-timeline-dot {
  background: #fef2f2;
  border-color: var(--danger);
}
.proc-agent-step.error .proc-timeline-dot span {
  color: var(--danger);
}
.proc-timeline-line {
  width: 2px;
  height: 24px;
  background: var(--slate-200);
  transition: background 0.4s ease;
  flex-shrink: 0;
}
.proc-agent-step.completed + .proc-agent-step .proc-timeline-line,
.proc-agent-step.completed .proc-timeline-line {
  background: var(--success);
}

/* Agent content */
.proc-agent-content {
  flex: 1;
  padding-bottom: 20px;
  min-width: 0;
}
.proc-agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.proc-agent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
}
.proc-agent-model {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--slate-400);
  background: var(--slate-50);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--slate-100);
}
.proc-agent-desc {
  font-size: 12px;
  color: var(--slate-400);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Terminal log area */
.proc-terminal {
  background: #0f172a;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.7;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
  margin: 0;
}
.proc-agent-step.active .proc-terminal,
.proc-agent-step.completed .proc-terminal {
  max-height: 200px;
  padding: 10px 12px;
  margin-top: 4px;
}
.proc-log-line {
  animation: fadeSlideIn 0.3s ease-out both;
  display: flex;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.proc-log-line .log-prefix {
  color: #818cf8;
  flex-shrink: 0;
}
.proc-log-line .log-label {
  color: #94a3b8;
  flex-shrink: 0;
}
.proc-log-line .log-value {
  color: #e2e8f0;
}
.proc-log-line .log-success {
  color: #34d399;
}
.proc-log-line .log-warn {
  color: #fbbf24;
}
.proc-log-line .log-info {
  color: #60a5fa;
}
.proc-log-line .log-dim {
  color: #475569;
}

/* Agent step status badges */
.proc-step-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.proc-step-badge.waiting {
  background: var(--slate-100);
  color: var(--slate-400);
}
.proc-step-badge.running {
  background: #eef2ff;
  color: var(--primary);
  animation: statusBlink 1.2s ease infinite;
}
.proc-step-badge.done {
  background: #ecfdf5;
  color: #059669;
}

/* Elapsed timer */
.proc-elapsed {
  font-size: 11px;
  color: var(--slate-400);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Orchestrator status bar */
.proc-orchestrator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
  border-radius: 0 0 12px 12px;
  font-size: 11.5px;
  color: var(--slate-500);
}
.proc-orchestrator-label {
  font-weight: 600;
  color: var(--slate-600);
  display: flex;
  align-items: center;
  gap: 6px;
}
.proc-orchestrator-step {
  flex: 1;
  text-align: right;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 11px;
  color: var(--slate-400);
}

/* Completed summary */
.proc-complete-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  margin-top: 8px;
  animation: fadeSlideIn 0.4s ease-out;
}
.proc-complete-banner .check-icon {
  width: 28px;
  height: 28px;
  background: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.proc-complete-banner .check-icon svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
}
.proc-complete-text {
  font-size: 13px;
  font-weight: 600;
  color: #065f46;
}
.proc-complete-sub {
  font-size: 11.5px;
  color: #047857;
  margin-top: 1px;
}

/* ===== Category Modal Sections ===== */
.cat-modal-section {
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 10px;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
}
.cat-modal-section:last-child {
  margin-bottom: 0;
}
.cat-modal-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate-500);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.cat-modal-section-title svg {
  flex-shrink: 0;
  color: var(--primary);
}
/* Color-code sections in modal */
.cat-modal-section:nth-child(1) { border-left: 3px solid var(--primary); }
.cat-modal-section:nth-child(2) { border-left: 3px solid #f59e0b; }
.cat-modal-section:nth-child(3) { border-left: 3px solid var(--success); }
.cat-modal-section:nth-child(4) { border-left: 3px solid #8b5cf6; }
.cat-modal-section:nth-child(2) .cat-modal-section-title svg { color: #f59e0b; }
.cat-modal-section:nth-child(3) .cat-modal-section-title svg { color: var(--success); }
.cat-modal-section:nth-child(4) .cat-modal-section-title svg { color: #8b5cf6; }

/* ===== Category Toggle Buttons (shared base) ===== */
.cat-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid var(--slate-200);
  background: #fff;
  color: var(--slate-600);
  transition: all 0.25s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.cat-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.cat-action-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08), 0 4px 12px rgba(79, 70, 229, 0.1);
}
.cat-action-btn.active::after {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 9px;
  font-weight: 800;
  color: var(--primary);
}
.cat-action-btn svg {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Gate buttons get amber styling when active */
.cat-action-btn.gate-btn:hover {
  border-color: #fcd34d;
  color: #b45309;
}
.cat-action-btn.gate-btn.active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08), 0 4px 12px rgba(245, 158, 11, 0.1);
}
.cat-action-btn.gate-btn.active::after {
  color: #b45309;
}

/* ===== Category Cards (list view) ===== */
.cat-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}
.cat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--cat-color, #94a3b8);
  border-radius: 12px 0 0 12px;
}
.cat-card:hover {
  border-color: var(--slate-300);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px 24px;
}
.cat-card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.cat-card-color {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  opacity: 0.18;
  position: relative;
}
.cat-card-color::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: inherit;
  opacity: 1;
}
.cat-card-info { flex: 1; min-width: 0; }
.cat-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
}
.cat-card-desc {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-card-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Config badges row */
.cat-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 10px 24px;
}
.cat-config-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.cat-config-badge.hitl-yes {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.cat-config-badge.hitl-no {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.cat-config-badge.threshold-badge {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

/* Gate & Action rows */
.cat-card-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 20px 8px 24px;
  border-top: 1px solid var(--slate-50);
}
.cat-card-row:last-child {
  padding-bottom: 14px;
}
.cat-card-row-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding-top: 3px;
  min-width: 64px;
}
.cat-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

/* ===== Category Action Tags (in cards) ===== */
.cat-action-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(79, 70, 229, 0.12);
}
.cat-action-tag svg {
  flex-shrink: 0;
}

/* ===== Category Gate Tags (in cards) ===== */
.cat-gate-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fffbeb;
  color: #b45309;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(245, 158, 11, 0.12);
}
.cat-gate-tag svg {
  flex-shrink: 0;
}

