/* ============================================================
   WORKFLOW ORCHESTRATION STYLES
   ============================================================ */

/* ---- Thread Panel ---- */
.thread-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: rgba(15, 15, 25, 0.96);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
}

.thread-panel--open {
  transform: translateX(0);
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  gap: 8px;
}

.thread-header-left {
  flex: 1;
  min-width: 0;
}

.thread-header-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.thread-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.thread-new-btn {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.thread-new-btn:hover {
  background: rgba(59, 130, 246, 0.28);
}

.thread-empty-launch-btn {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.thread-empty-launch-btn:hover {
  background: rgba(59, 130, 246, 0.28);
}

.thread-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.thread-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thread-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  padding: 40px 20px;
}

/* ---- Workflow Item ---- */
.workflow-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workflow-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workflow-item-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-item-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

/* ---- State Badge ---- */
.workflow-state-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.workflow-state-badge--pulse {
  animation: pulse-badge 1.8s ease-in-out infinite;
}

/* ---- Chain Pills ---- */
.workflow-chain-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-chain-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 3px 8px 3px 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.workflow-chain-pill-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

@keyframes review-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}

.review-btn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s, transform 0.15s;
  animation: review-pulse 2s ease-in-out infinite;
  letter-spacing: 0.01em;
}

.review-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  animation: none;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
}

/* ---- Log Toggle & Entries ---- */
.workflow-log-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  padding: 2px 0;
  transition: color 0.2s;
}

.workflow-log-toggle:hover {
  color: rgba(255, 255, 255, 0.7);
}

.workflow-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.log-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.log-entry-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}

.log-entry-content {
  flex: 1;
  min-width: 0;
}

.log-entry-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.log-entry-name {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.log-entry-action {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.log-entry-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
}

.log-entry-summary {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.log-entry-summary--expanded {
  display: block;
  overflow: visible;
  white-space: pre-wrap;
  -webkit-line-clamp: unset;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
  line-height: 1.5;
}

.log-entry-expand-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 0 0;
  display: block;
  transition: color 0.15s;
}

.log-entry-expand-btn:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* ============================================================
   LAUNCH MODAL
   ============================================================ */
.launch-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}

.launch-modal {
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(18, 18, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.launch-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.launch-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
}

.launch-close-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 7px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
}

.launch-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.launch-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.launch-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.launch-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launch-field-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.launch-field-label--small {
  font-size: 11px;
}

.launch-field-input,
.launch-field-textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.launch-field-input:focus,
.launch-field-textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(255, 255, 255, 0.07);
}

.launch-field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ---- Launch Chain List ---- */
.launch-chain-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.launch-chain-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: background 0.2s;
}

.launch-chain-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.launch-chain-checkbox {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.launch-chain-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}

.launch-chain-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.launch-chain-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.launch-chain-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-left: 4px;
}

.launch-chain-handle {
  color: rgba(255, 255, 255, 0.2);
  font-size: 14px;
  cursor: grab;
  margin-left: auto;
}

.launch-subtasks-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.launch-subtask-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.launch-subtask-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.launch-subtask-input {
  font-size: 12px;
}

.launch-timeout-info {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
}

.launch-timeout-icon {
  font-size: 14px;
}

.launch-submit-btn {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.launch-submit-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.launch-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   HUMAN REVIEW MODAL
   ============================================================ */
.review-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 20px;
}

.review-modal {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  background: rgba(14, 14, 22, 0.99);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.review-modal-header {
  position: sticky;
  top: 0;
  background: rgba(14, 14, 22, 0.99);
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  z-index: 1;
  flex-shrink: 0;
}

.review-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.review-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
}

.review-modal-reason {
  font-size: 12px;
  color: rgba(249, 115, 22, 0.85);
  font-weight: 500;
}

.review-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.review-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.review-section-title {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
}

/* ---- Summary Bar ---- */
.review-summary-bar {
  display: flex;
  gap: 1px;
  padding: 0;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.review-summary-item {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.review-summary-item:last-child {
  border-right: none;
}

.review-summary-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.review-summary-value {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.review-summary-agents {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.review-summary-avatars {
  display: flex;
  gap: 3px;
}

.review-summary-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}

/* ---- Final Output Section ---- */
.review-final-output {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.review-final-output-text {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
}

.review-final-output-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.review-final-output-content {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}

/* ---- Final Action Card ---- */
.review-final-action-card {
  margin: 0 24px 4px;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-final-action--email {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.review-final-action--trade {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.review-final-action--linkedin {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.review-final-action--image {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.review-final-action--message {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.review-final-action--generic {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.review-fa-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-fa-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.review-fa-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-fa-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.review-fa-action-name {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.review-fa-executor {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-fa-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.review-fa-exec-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.review-fa-task {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 10px;
}

.review-fa-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.review-fa-detail-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-fa-detail-key {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-fa-detail-value {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono);
}

/* ---- Step Chain ---- */
.review-chain-section {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.review-chain-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-step {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s;
}

.review-step--approved {
  border-color: rgba(34, 197, 94, 0.25);
}

.review-step--escalated,
.review-step--revision_requested {
  border-color: rgba(249, 115, 22, 0.25);
}

.review-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  transition: background 0.15s;
}

.review-step-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.review-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

.review-step-num--approved {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.review-step-num--in_progress {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.review-step-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.review-step-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.review-step-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.review-step-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

.review-step-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.review-step-status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.review-step-status--approved {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.review-step-status--pending {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.review-step-status--in_progress {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.review-step-status--revision_requested {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.review-step-status--escalated {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.review-step-rev-badge {
  font-size: 10px;
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

.review-step-chevron {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.2s;
}

.review-step-chevron--open {
  transform: rotate(180deg);
}

.review-step-subtask {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 14px 10px;
  line-height: 1.4;
}

.review-step-result {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 14px;
}

.review-step-image {
  display: block;
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.15s;
}
.review-step-image:hover { opacity: 0.88; }

.review-step-image-caption {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  line-height: 1.4;
}

.review-step-image-expired {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.2);
  font-size: 12px;
  color: rgba(255, 200, 100, 0.85);
}
.review-step-image-expired a {
  color: rgba(160, 163, 255, 0.9);
  text-decoration: underline;
}

.review-step-connector {
  text-align: center;
  padding: 2px 0;
  position: relative;
}

.review-step-connector::before {
  content: '';
  display: block;
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto;
}

/* ---- Escalation Notice ---- */
.review-escalation-notice {
  margin: 0 28px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

/* ---- Audit Log (in review modal) ---- */
.review-audit-section {
  padding: 16px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.review-audit-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.review-audit-toggle:hover {
  color: rgba(255, 255, 255, 0.6);
}

.review-audit-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-audit-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.review-audit-name {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.review-audit-action {
  color: rgba(255, 255, 255, 0.35);
}

.review-audit-time {
  color: rgba(255, 255, 255, 0.25);
  font-size: 10px;
}

.review-audit-summary {
  width: 100%;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
  padding-left: 4px;
}

/* ---- Action Bar ---- */
.review-action-bar {
  position: sticky;
  bottom: 0;
  background: rgba(14, 14, 22, 0.99);
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
  flex-shrink: 0;
}

.review-notes-wrap {
  width: 100%;
}

.review-notes-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.review-notes-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.review-btn-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.review-btn-approve {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.review-btn-approve:hover { opacity: 0.9; }

.review-btn-changes {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.review-btn-changes:hover {
  background: rgba(245, 158, 11, 0.25);
}

.review-btn-reject {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.review-btn-reject:hover {
  background: rgba(239, 68, 68, 0.22);
}

.review-changes-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-bottom: 8px;
  width: 100%;
}

.review-changes-textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
}

.review-changes-textarea:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.5);
}

.review-changes-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
  margin-top: 8px;
}

.review-btn-changes-submit {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.review-btn-changes-submit:hover { opacity: 0.9; }

/* ============================================================
   AUDIT DASHBOARD
   ============================================================ */
.audit-dashboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 20px;
}

.audit-dashboard {
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(12, 12, 20, 0.99);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.audit-header {
  position: sticky;
  top: 0;
  background: rgba(12, 12, 20, 0.99);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 1;
}

.audit-title {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.audit-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.2s;
}

.audit-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---- Stats Row ---- */
.audit-stats-row {
  display: flex;
  gap: 1px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.audit-stat-card {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.audit-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
}

.audit-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Filter Tabs ---- */
.audit-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 28px 10px;
}

.audit-tab {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.2s;
}

.audit-tab:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.audit-tab--active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

/* ---- Audit Table ---- */
.audit-table-container {
  padding: 8px 28px 24px;
  overflow-x: auto;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.audit-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.audit-table-row {
  transition: background 0.15s;
}

.audit-table-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.audit-table-row td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  vertical-align: middle;
}

.audit-td-title {
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-td-chain {
  white-space: nowrap;
}

.audit-chain-pills {
  display: flex;
  gap: 3px;
}

.audit-chain-pill {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}

.audit-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  padding: 40px;
  font-size: 13px;
}

.audit-td-actions {
  white-space: nowrap;
}

.audit-rerun-btn {
  background: rgba(99, 102, 241, 0.15);
  color: rgba(160, 163, 255, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.audit-rerun-btn:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(99, 102, 241, 0.6);
}
.audit-rerun-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.audit-review-btn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.15s;
  animation: review-pulse 2s ease-in-out infinite;
}

.audit-review-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  animation: none;
  box-shadow: 0 3px 12px rgba(249, 115, 22, 0.4);
}

/* ---- Expanded Row ---- */
.audit-expanded-row {
  background: rgba(255, 255, 255, 0.02);
}

.audit-expanded-cell {
  padding: 12px 24px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.audit-log-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.audit-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}

.audit-log-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.audit-log-text {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.audit-log-entry-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-log-summary {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.audit-log-summary--expanded {
  display: block;
  overflow: visible;
  white-space: pre-wrap;
  -webkit-line-clamp: unset;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
  line-height: 1.55;
}

.audit-log-expand-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 10px;
  cursor: pointer;
  padding: 1px 0 0;
  text-align: left;
  transition: color 0.15s;
}

.audit-log-expand-btn:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* ---- Image Preview (shared) ---- */
.review-preview-image-wrap {
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.review-preview-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
}

.review-preview-image:hover {
  opacity: 0.9;
}

/* ---- Final Action fields (in WorkflowLauncher) ---- */
.launch-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 0 12px;
}

.launch-final-action-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.launch-final-action-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.launch-final-action-badge {
  font-size: 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 20px;
  padding: 1px 7px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.launch-final-action-fields {
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
}

.launch-final-action-select {
  appearance: none;
  cursor: pointer;
}

/* ---- Audit expanded execution result ---- */
.audit-exec-result {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.audit-exec-result-body {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  white-space: pre-wrap;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 6px;
}

/* ---- Workspace Header Buttons ---- */
/* Base styles now in hub.css (.workspace-action-btn) */

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.workflow-review-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #f97316;
  border-radius: 50%;
  animation: dot-pulse 1.5s ease-in-out infinite;
  border: 1.5px solid rgba(0,0,0,0.3);
}

/* ============================================================
   STEP BUILDER (WorkflowLauncher)
   ============================================================ */

/* Steps section header: label + hint on same row */
.launch-steps-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.launch-steps-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
}

/* ── Config section: title, brief, terminal state ── */
.launch-config-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Steps section ── */
.launch-steps-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Container for all step cards + connectors */
.launch-steps-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Step card: header bar + full-width textarea */
.launch-step-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.launch-step-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Card header: left(num+avatar+select) + controls on right */
.launch-step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Left cluster: number badge + avatar + mini dropdown */
.launch-step-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Step number badge */
.launch-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}

/* Mini avatar (filled with agent color when selected) */
.launch-step-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

/* Mini dropdown */
.launch-step-mini-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  max-width: 150px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.3)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.launch-step-mini-select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
}

.launch-step-mini-select option {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.85);
}

/* Task description textarea (full width inside card) */
.launch-step-task-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  min-height: 72px;
  transition: background 0.2s;
}

.launch-step-task-textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.02);
}

.launch-step-task-textarea::placeholder {
  color: rgba(255, 255, 255, 0.18);
  line-height: 1.5;
}

/* Up / Down / Remove controls */
.launch-step-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.launch-step-ctrl-btn {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.4);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}

.launch-step-ctrl-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.18);
}

.launch-step-ctrl-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Remove (×) button — slightly red-tinted */
.launch-step-remove-btn {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
  color: rgba(239, 68, 68, 0.5);
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  margin-left: 3px;
}

.launch-step-remove-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.launch-step-remove-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Arrow connector between steps */
.launch-step-connector {
  text-align: center;
  color: rgba(255, 255, 255, 0.15);
  font-size: 14px;
  padding: 3px 0;
  line-height: 1;
}

/* + Add Step button */
.launch-add-step-btn {
  align-self: flex-start;
  margin-top: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.launch-add-step-btn:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.5);
}

/* ============================================================
   SAVED WORKFLOW PICKER (WorkflowLauncher)
   ============================================================ */
.launch-saved-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launch-saved-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.launch-saved-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.launch-saved-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.launch-saved-chip--preset {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.launch-saved-chip--preset:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.5);
}

.launch-saved-chip-del {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}

.launch-saved-chip-del:hover {
  color: #ef4444;
}

/* ============================================================
   SCHEDULE SECTION (WorkflowLauncher — collapsible in modal body)
   ============================================================ */
.sched-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: border-color 0.2s;
  position: relative;
  z-index: 1;
}

.sched-section:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ── Toggle header ── */
.sched-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  position: relative;
  z-index: 2;
}

.sched-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sched-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sched-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.sched-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.sched-toggle-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 1px;
}

.sched-toggle-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Schedule pill (shows current config when collapsed) ── */
.sched-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 7px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: #22c55e;
}

.sched-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  animation: sched-pulse 2s infinite;
}

@keyframes sched-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.sched-pill-text {
  white-space: nowrap;
}

/* ── Chevron ── */
.sched-chevron {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  transition: transform 0.2s;
}

.sched-chevron--open {
  transform: rotate(180deg);
}

/* ── Collapsible body ── */
.sched-body {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sched-body--open {
  display: flex;
}

/* ── Frequency tabs (4-col grid) ── */
.sched-freq-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 3px;
  margin-top: 14px;
}

.sched-freq-tab {
  padding: 7px 4px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.sched-freq-tab:hover:not(.sched-freq-tab--active) {
  color: rgba(255, 255, 255, 0.7);
}

.sched-freq-tab--active {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Tab views ── */
.sched-view {
  display: none;
}

.sched-view--active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sched-view-info {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  line-height: 1.5;
}

.sched-view-info strong {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Section labels ("When", "Repeat", "On execution") ── */
.sched-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.sched-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Time grid ── */
.sched-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sched-time-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── Mini field (date, time, frequency, etc.) ── */
.sched-mini-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sched-mini-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.sched-mini-input,
.sched-mini-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
  color-scheme: dark;
}

.sched-mini-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.3)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.sched-mini-input:focus,
.sched-mini-select:focus {
  border-color: rgba(59, 130, 246, 0.5);
}

.sched-mini-select option {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.85);
}

/* ── Preview box ── */
.sched-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 6px;
  font-size: 12px;
  min-height: 20px;
}

.sched-preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  flex-shrink: 0;
  margin-top: 4px;
}

.sched-preview-text {
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.sched-preview-text strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.sched-preview-next {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Approval section ── */
.sched-approval-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sched-approval-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.sched-approval-opt {
  flex: 1;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sched-approval-opt:last-child {
  border-right: none;
}

.sched-approval-opt:hover:not(.sched-approval-opt--active) {
  background: rgba(255, 255, 255, 0.03);
}

.sched-approval-opt--active {
  background: rgba(59, 130, 246, 0.08);
}

.sched-approval-opt-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sched-approval-opt--active .sched-approval-opt-label {
  color: #60a5fa;
}

.sched-approval-opt-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 3px;
  line-height: 1.4;
}

.sched-opt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
  position: relative;
}

.sched-approval-opt--active .sched-opt-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #60a5fa;
}

/* ── Repeat section (Recurring/Interval) ── */
.sched-repeat-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sched-repeat-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.sched-repeat-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.sched-repeat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sched-repeat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sched-repeat-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.sched-repeat-input {
  width: 64px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}

.sched-repeat-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
}

.sched-repeat-input:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.sched-repeat-forever {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.15s;
}

.sched-repeat-forever--active {
  color: #60a5fa;
}

.sched-repeat-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.sched-repeat-checkbox:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.sched-repeat-checkbox:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

/* ── Green "Schedule Workflow" button variant ── */
.launch-submit-btn--scheduled {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.launch-submit-btn--scheduled:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d988, #22c55e);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

/* ── Save checkbox label ── */
.launch-option-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

/* ============================================================
   SCHEDULE CARDS IN CompanyThread
   ============================================================ */
.thread-schedules-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.thread-schedules-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thread-schedules-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thread-schedule-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s;
}

.thread-schedule-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.thread-schedule-card--disabled {
  opacity: 0.45;
}

.thread-schedule-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thread-schedule-type {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.thread-schedule-type.recurring {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.thread-schedule-type.one-time {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.thread-schedule-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-schedule-next {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.thread-schedule-timing {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}

.thread-schedule-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.thread-schedule-btn {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.15s;
}

.thread-schedule-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.thread-schedule-btn.primary {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.thread-schedule-btn.primary:hover {
  background: rgba(99, 102, 241, 0.3);
}

.thread-schedule-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.thread-schedule-toggle {
  position: relative;
  width: 28px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.thread-schedule-toggle.active {
  background: rgba(34, 197, 94, 0.5);
}

.thread-schedule-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.thread-schedule-toggle.active::after {
  transform: translateX(12px);
}

/* Missed runs banner */
.thread-missed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #FCD34D;
}

.thread-missed-dismiss {
  background: none;
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #FCD34D;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.thread-missed-dismiss:hover {
  background: rgba(251, 191, 36, 0.15);
}
