/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* ==========================================================================
   CUSTOM THEME COLORS
   Brand colors from Motion/Cascades design system
   ========================================================================== */
:root {
  --color-blue: #1814F3;
  --color-blue-05: #F2F4FF;
  --color-blue-30: #B3BFFF;
  --color-blue-70: #4D69FF;
  --color-blue-90: #1A3EFF;
  --color-catalina-blue: #343C6A;
  --color-glaucous: #718EBF;
  --color-green-ish: #16DBCC;
  --color-emerald: #16DBCC;
  --color-radical-red: #FE5C73;
  --color-link-water: #DFEAF2;
  --color-yellow-orange: #FFBB38;
  --color-token-green: #00DF81;
  --color-token-yellow: #FFBB38;
  --color-token-orange: #FE8742;
  --color-token-red: #FA3A55;
  --color-token-purple: #9233FE;
  --color-mirage: #0D122D;
  --color-mirage-05: #F3F3F5;
  --color-mirage-80: #3D4157;
  --color-mirage-60: #6E7181;
  --color-mirage-70: #56596C;
  --color-mirage-30: #B6B8C0;
  --color-mirage-20: #CFD0D5;
  --color-portage: #8094FF;
  --color-gray-05: #FAFAFA;
  --color-gray-chateau: #9EA0AB;
  --color-secondary-token-green-light: #D9FAEC;
  --color-secondary-token-yellow-light: #FFF5D9;
  --color-secondary-token-orange-light: #FFEFE5;
  --color-secondary-token-red-light: #FFE0EB;
  --color-secondary-token-purple-light: #F4E9FF;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   PAGE LAYOUT - Main app structure with topnav and content container
   ========================================================================== */
.page-layout {
  min-height: 100vh;
  background-color: #f5f7fa;
  display: flex;
  flex-direction: column;
}

.page-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 24px 24px 24px;
}

.page-content {
  flex: 1;
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px 12px 0 0;
  min-height: 0;
  overflow: hidden;
}

.page-content-inner {
  height: 100%;
  overflow-y: auto;
  padding: 24px;
}

/* ==========================================================================
   TOP NAVIGATION - Cascades design system
   ========================================================================== */
.cascades-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 24px;
  background-color: #f5f7fa;
}

/* Logo */
.topnav-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.topnav-logo-full {
  height: 25px;
  width: auto;
}

/* Navigation Items */
.topnav-navigation {
  display: flex;
  align-items: stretch;
  gap: 45px;
  height: 100%;
}

.topnav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  text-decoration: none;
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: #56596c;
  transition: color 0.2s ease;
}

.topnav-item:hover {
  color: #0D122D;
}

.topnav-item.active {
  color: #0D122D;
}

.topnav-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #0029ff;
  border-radius: 3px 3px 0 0;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s ease;
}

.topnav-item:hover .topnav-indicator {
  transform: scaleY(1);
}

.topnav-item.active .topnav-indicator {
  transform: scaleY(1);
}

/* Right Side Actions */
.topnav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav-explore-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-family: Inter, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #0029ff;
  transition: background-color 0.2s ease;
}

.topnav-explore-btn:hover {
  background-color: #f2f4ff;
}

.topnav-explore-icon {
  width: 24px;
  height: 24px;
  color: #0029ff;
}

.topnav-divider {
  width: 1px;
  height: 26px;
  background-color: #dfeaf2;
  margin: 0 8px;
}

.topnav-user {
  position: relative;
}

.topnav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Lato', Inter, sans-serif;
  font-size: 15px;
  color: #0d122d;
}

.topnav-user-btn:hover {
  opacity: 0.8;
}

.topnav-user-email {
  white-space: nowrap;
}

.topnav-chevron {
  width: 24px;
  height: 24px;
  color: #0d122d;
  transition: transform 0.2s ease;
}

.topnav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 150px;
  background: white;
  border: 1px solid #dfeaf2;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px;
  z-index: 100;
}

.topnav-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: #56596c;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.topnav-dropdown-item:hover {
  background-color: #f5f7fa;
  color: #0d122d;
}

/* ==========================================================================
   MODAL STYLES - Explore Products and generic modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  position: relative;
  background-color: white;
  border: 1px solid #dfeaf2;
  border-radius: 12px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

/* Explore Products Modal */
.explore-modal {
  display: flex;
  width: 1200px;
  max-width: calc(100vw - 48px);
  height: 600px;
  padding: 15px;
  overflow: hidden;
}

/* Left Sidebar */
.explore-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.explore-sidebar-title {
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 24px;
  color: var(--color-mirage);
  margin: 0;
  padding: 4px 0 12px;
}

.explore-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--color-link-water);
  background: white;
  color: var(--color-mirage-70);
  cursor: pointer;
  z-index: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.explore-close-btn:hover {
  background-color: var(--color-app-bg);
  color: var(--color-mirage);
}

.explore-section-header {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-mirage);
  padding: 8px 0;
}

.explore-section-spacer {
  height: 12px;
}

.explore-nav-item {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.explore-nav-indicator {
  width: 3px;
  height: 38px;
  display: flex;
  align-items: center;
}

.explore-nav-indicator::after {
  content: '';
  width: 3px;
  height: 18px;
  background-color: transparent;
  border-radius: 0 10px 10px 0;
  transition: background-color 0.2s ease;
}

.explore-nav-item.active .explore-nav-indicator::after,
.explore-nav-item:hover .explore-nav-indicator::after {
  background-color: var(--color-blue);
}

.explore-nav-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px;
  height: 38px;
  border-radius: 9px;
  transition: background-color 0.2s ease;
}

.explore-nav-item:hover .explore-nav-content {
  background-color: var(--color-blue-05);
}

.explore-nav-item.active .explore-nav-content {
  background-color: var(--color-primary-light);
}

.explore-nav-icon {
  width: 24px;
  height: 24px;
  color: var(--color-mirage-70);
  flex-shrink: 0;
}

.explore-nav-item.active .explore-nav-icon {
  color: var(--color-blue);
}

.explore-nav-category-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.explore-nav-category-svg {
  width: 16px;
  height: 16px;
  color: var(--color-mirage-70);
}

.explore-nav-vendor-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  color: var(--color-mirage-80);
}

.explore-nav-label {
  flex: 1;
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage-70);
  transition: color 0.2s ease, font-weight 0.15s ease;
}

.explore-nav-item.active .explore-nav-label {
  color: var(--color-blue);
  font-weight: 600;
}

.explore-nav-badge {
  min-width: 32px;
  padding: 6px 9px;
  background-color: var(--color-app-bg);
  border-radius: 12px;
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  color: var(--color-mirage-70);
  text-align: center;
}

.explore-nav-item.active .explore-nav-badge {
  background-color: white;
}

/* Right Content */
.explore-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.explore-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.explore-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 333px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  background-color: white;
  transition: border-color 0.15s ease;
}

.explore-search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.explore-search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-mirage-50);
}

.explore-search-input,
.explore-search-input:focus {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 20px;
  color: var(--color-mirage);
  background: transparent !important;
  padding: 0 !important;
  margin: 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.explore-search-input::placeholder {
  color: var(--color-mirage-50);
}

.explore-result-count {
  font-size: 12px;
  color: var(--color-mirage-60);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Products List */
.explore-products-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.explore-products-list::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

/* Empty search state */
.explore-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
}

.explore-empty.hidden {
  display: none;
}

.explore-empty-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-30);
}

.explore-empty-text {
  font-size: 14px;
  color: var(--color-mirage-60);
  margin: 0;
}

.explore-product-item {
  display: flex;
  flex-direction: column;
  background-color: white;
  border: 1px solid var(--color-link-water);
  border-radius: 12px;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.explore-product-item:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.explore-product-item.expanded {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.explore-product-item.hidden {
  display: none;
}

/* Product Header Button (collapsed state trigger) */
.explore-product-header-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.explore-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.explore-product-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.explore-product-vendor-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 42px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  color: var(--color-mirage-80);
}

.explore-product-name {
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage);
}

.explore-product-description {
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-mirage-60);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Product meta — price + inquiry pill */
.explore-product-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.explore-product-price {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage);
  white-space: nowrap;
}

.explore-product-price-unit {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-mirage-60);
}

.explore-inquiry-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.explore-inquiry-pill--soft {
  background-color: var(--color-secondary-token-green-light);
  color: var(--color-token-green);
}

.explore-inquiry-pill--hard {
  background-color: var(--color-secondary-token-yellow-light);
  color: var(--color-mirage-80);
}

.explore-product-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--color-mirage-30);
  transition: transform 0.2s ease;
}

.explore-product-item.expanded .explore-product-chevron {
  transform: rotate(90deg);
}

/* Expanded Content */
.explore-product-expanded {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 0 18px 18px 18px;
}

.explore-product-item.expanded .explore-product-expanded {
  display: flex;
}

.explore-product-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.explore-detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--color-app-bg);
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  padding: 12px 16px;
}

.explore-detail-section--workflows .explore-detail-icon {
  color: var(--color-token-green);
}

.explore-detail-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.explore-detail-icon {
  width: 18px;
  height: 18px;
  color: var(--color-blue);
}

.explore-detail-title {
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  color: var(--color-mirage);
}

.explore-detail-text {
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 18px;
  color: var(--color-mirage-60);
  margin: 0;
  text-align: justify;
}

.explore-use-cases {
  margin: 0;
  padding-left: 16px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-mirage-60);
}

.explore-use-cases li {
  margin-bottom: 2px;
}

.explore-detail-section--workflows .explore-use-cases li {
  text-align: justify;
}

.explore-detail-section--limitations {
  grid-column: 1 / -1;
  background-color: var(--color-secondary-token-yellow-light);
  border: 1px solid var(--color-token-yellow);
  border-radius: 8px;
  padding: 12px 16px;
}

.explore-detail-section--limitations .explore-detail-icon {
  color: var(--color-token-yellow);
}

.explore-product-cta {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   MOTION BRAND FONT CLASSES
   ========================================================================== */
.motion-heading-font {
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-mirage);
  font-size: 28px;
}

.motion-semi-bold-font {
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--color-mirage);
  font-size: 15px;
  line-height: 150%;
}

.motion-regular-font {
  color: var(--color-mirage-80);
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 150%;
}

/* ==========================================================================
   BUTTON STYLES
   Primary, Secondary, and Tertiary button variants
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #0029ff;
  border: 1px solid #0029ff;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #001fcf;
  border-color: #001fcf;
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.3);
}

.btn-primary svg {
  color: #ffffff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #ffffff;
  border: 1px solid #0029ff;
  border-radius: 9px;
  color: #0029ff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #f2f4ff;
}

.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.3);
}

.btn-secondary svg {
  color: #0029ff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #f2f4ff;
  border: 1px solid #f2f4ff;
  border-radius: 9px;
  color: #0029ff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tertiary:hover {
  background-color: #e5eaff;
  border-color: #e5eaff;
}

.btn-tertiary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.15);
}

.btn-tertiary svg {
  color: #0029ff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-0.5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appear-then-fade {
  0%, 100% {
    opacity: 0;
  }
  5%, 60% {
    opacity: 1;
  }
}

/* ==========================================================================
   FLASH MESSAGES
   ========================================================================== */
.flash {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
  width: max-content;
  padding: 0 1rem;
  z-index: 9999;
}

.flash__message {
  font-size: 1rem;
  color: white;
  padding: 0.5rem 1rem;
  background-color: black;
  animation: appear-then-fade 4s both;
  border-radius: 999px;
}

.flash__notice {
  background-color: #4CAF50;
}

.flash__alert {
  background-color: #FFC107;
}

.flash__error {
  background-color: #F44336;
}

/* ==========================================================================
   TOOLTIP STYLES
   ========================================================================== */
.tooltip {
  position: fixed;
  display: none;
  background-color: #1F2937;
  color: white;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  z-index: 9999;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.group:hover .tooltip {
  display: block;
}

/* ==========================================================================
   DROPDOWN STYLES
   ========================================================================== */
.dropdown-menu {
  display: none;
  min-width: 150px;
  z-index: 50;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 5px;
}

.dropdown-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #1d4ed8;
  background-color: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  text-decoration: none;
  margin-bottom: 0.25rem;
  width: 100%;
}

.dropdown-item:hover {
  background-color: #e5e7eb;
}

.dropdown-menu.show {
  display: block;
}

/* ==========================================================================
   DOCKET TABLE STYLES
   Flex-based table layout matching Motion brand design
   ========================================================================== */
.docket-table-header {
  display: flex;
  background-color: var(--color-mirage-05, #F3F3F5);
  padding: 12px 15px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-80, #3D4157);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docket-table-header a {
  color: inherit;
  text-decoration: none;
}

.docket-table-header a:hover {
  color: inherit;
}

.docket-table-row {
  display: flex;
  flex-wrap: wrap;
  padding: 12px 15px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
}

.docket-table-row:last-child {
  border-bottom: none;
}

/* ==========================================================================
   FILTER DROPDOWN STYLES
   Search and filter UI components
   ========================================================================== */
.filter-dropdown {
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 9px;
  padding: 16px;
  min-width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.filter-inline {
  background: var(--color-white, #FFFFFF);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 39px;
  padding: 0 12px;
  border-radius: 9px;
}

.filter-inline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-inline-select {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  padding: 0;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-blue-90, #1A3EFF);
  box-shadow: 0 0 0 3px rgba(26, 62, 255, 0.15);
}

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.filter-divider {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* Hidden utility class for Stimulus controllers */
.hidden {
  display: none !important;
}

/* ==========================================================================
   WORKFLOWS UI CUSTOM CLASSES
   Custom width, height, gap, and styling for workflows table
   ========================================================================== */

/* Table column widths */
.col-w-60 { width: 60px; flex-shrink: 0; }
.col-w-80 { width: 80px; flex-shrink: 0; }
.col-w-100 { width: 100px; flex-shrink: 0; }
.col-w-120 { width: 120px; flex-shrink: 0; }
.col-w-150 { width: 150px; flex-shrink: 0; }
.col-code-sm { width: 120px; flex-shrink: 0; }
.col-created { width: 170px; flex-shrink: 0; }

/* Flex columns for name/code - share remaining space */
.col-name {
  flex: 1.1;
  min-width: 0;
}

.col-code {
  flex: 0.9;
  min-width: 0;
}

/* Search bar */
.search-bar {
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  gap: 8px;
  height: 39px;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  width: 333px;
  transition: border-color 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--color-primary, #0029FF);
}

.search-bar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-mirage-30, #B6B8C0);
}

.search-bar:focus-within .search-bar-icon {
  color: var(--color-primary, #0029FF);
}

.search-input {
  width: 100%;
  font-weight: 400;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  line-height: 20px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.search-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.search-clear-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--color-mirage-30, #B6B8C0);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.search-clear-btn:hover {
  color: var(--color-mirage-80, #3D4157);
  background-color: var(--color-mirage-05, #F3F3F5);
}

/* Search loading state */
.search-loading .search-bar-icon {
  animation: search-spin 0.8s linear infinite;
  color: var(--color-primary, #0029FF);
}

@keyframes search-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Filter button */
.filter-btn {
  background: white;
  border: 1px solid #dfeaf2;
  display: flex;
  gap: 12px;
  height: 39px;
  align-items: center;
  padding: 0 9px;
  border-radius: 9px;
  cursor: pointer;
}

.filter-btn:hover {
  background: #f9fafb;
}

.filter-icon-box {
  background: #f7f9fb;
  border: 1px solid #f2f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Icon sizes */
.icon-15 { width: 15px; height: 15px; }
.icon-18 { width: 18px; height: 18px; }
.icon-19 { width: 19px; height: 19px; }

/* Gap utilities */
.gap-15 { gap: 15px; }

/* Colors */
.text-mirage { color: #0D122D; }
.text-mirage-80 { color: #3D4157; }
.text-mirage-70 { color: #56596C; }
.text-mirage-60 { color: #6E7181; }
.text-mirage-30 { color: #B6B8C0; }
.text-muted { color: #868896; }
.text-brand-blue { color: #1a3eff; }
.bg-zebra { background-color: #FAFAFA; }

/* Status badge with dot */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 28px;
  box-sizing: border-box;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge-active {
  border: 1px solid #bbf7d0;
}

.status-badge-draft {
  border: 1px solid #e5e7eb;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-active {
  background-color: #16a34a;
}

.status-dot-draft {
  background-color: #9ca3af;
}

.status-badge-failed {
  border: 1px solid #fecaca;
}

.status-dot-failed {
  background-color: #dc2626;
}

/* Row actions dropdown */
.actions-dropdown {
  position: absolute;
  right: 0;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 100;
  min-width: 220px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.action-item {
  display: flex;
  align-items: center;
  padding: 8px;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  border-radius: 6px;
  font-size: 14px;
  color: #3D4157;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.action-item:hover {
  background-color: var(--color-primary-light, #E6EAFF);
}

.action-item-danger {
  color: #dc2626;
}

.action-item-danger:hover {
  background-color: #fef2f2;
}

.action-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
}

.action-divider {
  height: 1px;
  background-color: var(--color-link-water, #DFEAF2);
  margin: 4px 0;
}

.action-toggle {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.action-toggle:hover,
.action-toggle-active {
  background: #f5f7ff;
  border-color: var(--color-blue-30, #B3BFFF);
  color: var(--color-blue, #1814F3);
}

.action-toggle:focus-visible {
  outline: none;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15);
}

/* Pagination */
.pagy-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 14px;
  color: var(--color-mirage-70, #56596C);
}

.pagy-nav .page a,
.pagy-nav .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-mirage-70, #56596C);
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pagy-nav .page a:hover {
  background: var(--color-primary-light, #E6EAFF);
  color: var(--color-blue, #1814F3);
}

.pagy-nav .page.active {
  background: var(--color-blue, #0029FF);
  color: #ffffff;
  font-weight: 600;
  border-radius: 8px;
}

.pagy-nav .page.disabled {
  color: var(--color-disabled, #C4C6C8);
  pointer-events: none;
}

.pagy-nav .page.gap {
  background: transparent;
  min-width: auto;
  padding: 0 4px;
  letter-spacing: 2px;
}

.pagy-nav .page.prev,
.pagy-nav .page.next {
  margin: 0 4px;
}

.pagy-nav .page.prev a,
.pagy-nav .page.next a {
  font-weight: 500;
  color: var(--color-mirage-80, #3D4157);
}

/* ==========================================================================
   DISABLED STATES
   ========================================================================== */
a:disabled,
button:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled {
  background-color: #d1d5db;
  color: #6b7280;
}

input:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
}

a.disabled {
  background-color: #d1d5db;
  color: #6b7280;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tailwind-like utility classes */
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-white { background-color: #ffffff; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-600 { background-color: #16a34a; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-gray-400 { background-color: #9ca3af; }

.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-blue-900 { color: #1e3a8a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.text-red-900 { color: #7f1d1d; }
.text-yellow-800 { color: #92400e; }
.text-purple-800 { color: #6b21a8; }
.text-white { color: #ffffff; }

.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-500 { border-color: #3b82f6; }
.border-green-400 { border-color: #4ade80; }
.border-green-200 { border-color: #bbf7d0; }
.border-amber-400 { border-color: #fbbf24; }
.border-red-200 { border-color: #fecaca; }
.border-transparent { border-color: transparent; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   DRAWFLOW OVERRIDES
   Custom styling for workflow canvas and nodes
   ========================================================================== */
#drawflow {
  width: 100%;
  height: 100%;
  background: #ffffff;
  background-size: 14px 14px;
  background-image: radial-gradient(#DFEAF2 1px, transparent 1px);
}

/* Original drawflow styles - keep for other visualizations */
.drawflow .drawflow-node {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #0D122D !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-family: 'Inter', sans-serif !important;
  width: 300px !important;
  min-width: 240px;
}

.drawflow .drawflow-node.selected .custom-node,
.drawflow .drawflow-node.selected .base-node {
  border: 1px solid var(--color-blue-90, #1A3EFF) !important;
}


.node-warning-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  box-sizing: border-box;
}

.node-warning-badge svg {
  width: 18px;
  height: 18px;
}

.node-warning-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0D122D;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.node-warning-badge:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.node-warning-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(245, 158, 11, 0.5);
}

/* Node context menu trigger button */
#drawflow .node-menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  z-index: 5;
  padding: 0;
  outline: none;
  box-shadow: none;
}

#drawflow .node-menu-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage-80, #3D4157);
}

/* Shared floating context menu for nodes */
.node-context-menu {
  position: fixed;
  z-index: 10000;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  min-width: 160px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.node-context-menu.hidden {
  display: none;
}

.drawflow .drawflow-node .inputs,
.drawflow .drawflow-node .outputs {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.drawflow .drawflow-node .input,
.drawflow .drawflow-node .output {
  border: 0 !important;
  background: transparent !important;
  cursor: crosshair !important;
}

.drawflow .connection .main-path {
  fill: none !important;
  stroke-width: 5px !important;
  stroke: #DFEAF2 !important;
  pointer-events: all !important;
  cursor: pointer !important;
}

.drawflow .connection .main-path:hover {
  stroke: var(--color-blue-90, #1A3EFF) !important;
  stroke-width: 6px !important;
}

.drawflow .drawflow-delete {
  background: #ef4444;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   CUSTOM OUTPUT PORTS
   Circle-style output ports with labels
   ========================================================================== */
.custom-outputs {
  position: absolute;
  right: 0;
  top: 46%;
  transform: translate(50%, -50%);
}

.drawflow-node-output {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 20px;
  height: 20px;
  justify-content: center;
  margin-bottom: 5px;
}

.drawflow-node-output::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  width: 14px;
  height: 14px;
  background: #DFEAF2;
  border-radius: 50%;
  border: 1.5px solid #DFEAF2;
}

.custom-port-label {
  max-width: 40px;
  margin-left: -40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* ==========================================================================
   CUSTOM INPUT PORT (Arrow style)
   ========================================================================== */
.custom-port-arrow {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-81%, -67%);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   VERTICAL LAYOUT MODE
   Adjustments for vertical workflow orientation
   ========================================================================== */
#drawflow-visualization.vertical .drawflow-node {
  display: block;
}

#drawflow-visualization.vertical .drawflow-node .inputs,
#drawflow-visualization.vertical .drawflow-node .outputs {
  display: flex;
  width: auto;
  justify-content: center;
  align-items: center;
}

#drawflow-visualization.vertical .drawflow .drawflow-node .input {
  top: 10px !important;
  left: 0px !important;
  transform: unset !important;
}

#drawflow-visualization.vertical .drawflow .drawflow-node .output {
  top: -5px !important;
  right: 0px !important;
  margin-bottom: 0 !important;
  margin-right: 5px !important;
  transform: unset !important;
}

#drawflow-visualization.vertical .drawflow-node .custom-outputs {
  bottom: 0;
  top: unset;
  right: 50%;
  transform: translate(50%, 50%);
  display: flex;
}

#drawflow-visualization.vertical .drawflow-node .drawflow-node-output {
  margin-bottom: 0px;
  margin-right: 5px;
  display: block;
}

#drawflow-visualization.vertical .drawflow-node .custom-port-label {
  margin-top: -25px;
  margin-left: 0;
  margin-right: 5px;
  height: 25px;
}

#drawflow-visualization.vertical .drawflow-node .custom-port-arrow {
  left: unset;
  top: -5px;
  right: 50%;
  transform: translate(50%,-50%) rotate(90deg);
}

/* Node drag items */
.node-drag-item {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.node-drag-item:hover {
  transform: translateY(-1px);
}

.node-drag-item:active {
  transform: scale(0.98);
  opacity: 0.8;
}

/* Sidebar transitions */
[data-visualization-ui-target="leftSidebar"],
[data-visualization-ui-target="rightSidebar"] {
  transition: width 0.2s ease, opacity 0.2s ease;
}

[data-visualization-ui-target="leftSidebar"].collapsed,
[data-visualization-ui-target="rightSidebar"].collapsed {
  opacity: 0;
}

/* Form inputs */
input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
select:not(.btn-demo-select),
textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #111827;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:not(.btn-demo-select):focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Form input - Motion styled */
.form-input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-mirage, #0D122D);
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

/* Form card */
.form-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-link-water, #DFEAF2);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  background: linear-gradient(135deg, #f3f6ff 0%, #f7fbf5 55%, #fff7f0 100%);
  position: relative;
  overflow: hidden;
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  color: #0b1227;
}

.auth-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 48px;
  align-items: center;
  max-width: 1100px;
  width: 100%;
}

.auth-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(0);
  opacity: 0.6;
  animation: auth-float 16s ease-in-out infinite;
}

.auth-orb-1 {
  width: 260px;
  height: 260px;
  top: -40px;
  left: -60px;
  background: radial-gradient(circle at 30% 30%, #b9d3ff, transparent 70%);
}

.auth-orb-2 {
  width: 220px;
  height: 220px;
  bottom: -60px;
  right: 15%;
  background: radial-gradient(circle at 50% 50%, #c5f2d8, transparent 70%);
  animation-delay: -4s;
}

.auth-orb-3 {
  width: 180px;
  height: 180px;
  top: 30%;
  right: -40px;
  background: radial-gradient(circle at 40% 40%, #ffd7b0, transparent 70%);
  animation-delay: -8s;
}

@keyframes auth-float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
  100% {
    transform: translateY(0);
  }
}

.auth-side {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.auth-brand {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1a3eff;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-subtitle {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 32px;
}

.auth-metrics {
  display: flex;
  gap: 24px;
}

.auth-metric {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(24, 20, 243, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 140px;
  box-shadow: 0 6px 16px rgba(12, 20, 36, 0.06);
}

.auth-metric-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #0b1227;
}

.auth-metric-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(24, 20, 243, 0.08);
  box-shadow: 0 18px 40px rgba(12, 20, 36, 0.12);
  padding: 28px;
  animation: auth-rise 0.5s ease-out;
}

@keyframes auth-rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-card-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.auth-card-header p {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  display: block;
  margin-bottom: 8px;
}

.auth-field .form-input {
  background: #f5f7ff;
  border-color: #d9e1f7;
}

.auth-field .form-input:focus {
  background: #ffffff;
}

.auth-submit {
  margin-top: 8px;
  height: 44px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .auth-shell {
    padding: 40px 20px;
  }

  .auth-content {
    grid-template-columns: 1fr;
  }

  .auth-side {
    text-align: center;
    margin: 0 auto;
  }

  .auth-metrics {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Workflow badge */
.workflow-badge {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border: 1px solid rgba(24, 20, 243, 0.1);
  border-radius: 24px;
  font-size: 13px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 32px;
}

.workflow-badge strong {
  color: var(--color-blue, #1814F3);
  font-weight: 600;
}

/* Signed-in user chip */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: #f0f4ff;
  border: 1px solid #dfeaf2;
  color: #1a3eff;
  font-size: 12px;
  font-weight: 500;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #1814F3;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-email {
  color: #1a3eff;
}

@media (max-width: 640px) {
  .user-email {
    display: none;
  }
}

/* Goal cards */
.goal-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.goal-cards-container form,
.goal-cards-container button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.goal-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: none !important;
  outline: none !important;
  padding: 20px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.goal-card:hover {
  box-shadow: 0 8px 24px rgba(24, 20, 243, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.goal-card-custom {
  background-color: #fafafa;
}

/* Goal template text */
.goal-template-text {
  text-decoration: none !important;
}

.goal-icon-container {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   WORKFLOW BUILDER STYLES
   ========================================================================== */

/* Top toolbar */
.builder-toolbar {
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: var(--color-link-water, #DFEAF2);
}

.builder-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--color-mirage-60, #6E7181);
  transition: all 0.2s ease;
  text-decoration: none;
}

.builder-back-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

.builder-workflow-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-workflow-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0;
}

.builder-workflow-code {
  display: none;
}

.builder-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--color-mirage-05, #F3F3F5);
  border-radius: 8px;
  padding: 4px;
}

.builder-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-zoom-btn:hover {
  background-color: #ffffff;
  color: var(--color-mirage, #0D122D);
}

.builder-zoom-label {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  background: none;
  border: none;
}

.builder-zoom-label:hover {
  color: var(--color-mirage, #0D122D);
}

.builder-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-icon-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

/* Left sidebar */
.builder-sidebar {
  width: 340px;
  background-color: #ffffff;
  border-right: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
}

.builder-sidebar.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}

/* Sidebar edge toggle - positioned relative to main content area */
.sidebar-edge-toggle {
  position: absolute;
  top: 50%;
  left: 328px;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: left 0.2s ease, background 0.2s ease;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar-edge-toggle:hover {
  background: #f3f4f6;
}

.sidebar-toggle-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

/* Collapsed state */
.builder-sidebar.collapsed + .sidebar-edge-toggle {
  left: 0;
}

.builder-sidebar.collapsed + .sidebar-edge-toggle .sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* Right Sidebar - Node Configuration */
.builder-right-sidebar {
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  flex-shrink: 0;
  background-color: #ffffff;
  border-left: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  flex-direction: column;
  opacity: 1;
  overflow: hidden;
  transition: min-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease,
              border-color 0.3s ease;
}

.builder-right-sidebar.collapsed {
  min-width: 0;
  max-width: 0;
  opacity: 0;
  border-color: transparent;
  pointer-events: none;
}

/* Header - matches left sidebar tabs area */
.builder-right-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 14px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  background-color: #ffffff;
  flex-shrink: 0;
}

.builder-right-sidebar-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.builder-right-sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-right-sidebar-close:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

/* Node info card - matches left sidebar node items */
.builder-right-sidebar-node-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 12px 16px 0 16px;
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.builder-right-sidebar-node-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--node-vendor-color, var(--color-blue, #1814F3));
  border-radius: 10px 0 0 10px;
}

.builder-right-sidebar-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background-color: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #1814F3);
}

.builder-right-sidebar-node-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-node-initials {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.builder-right-sidebar-node-info {
  flex: 1;
  min-width: 0;
}

.builder-right-sidebar-node-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-right-sidebar-node-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.builder-right-sidebar-node-type-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
  padding: 2px 6px;
  border-radius: 4px;
}

.builder-right-sidebar-node-desc {
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
}

.builder-right-sidebar-node-code {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-blue, #1814F3);
  background: var(--color-blue-05, #F2F4FF);
  padding: 1px 5px;
  border-radius: 4px;
}

.builder-right-sidebar-node-price {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-token-green, #00DF81);
  background: var(--color-secondary-token-green-light, #D9FAEC);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Form content area */
.builder-right-sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  box-sizing: border-box;
  max-width: 100%;
}

.builder-right-sidebar-content * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Empty state */
.builder-right-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 13px;
  text-align: center;
}

/* Form section styling - matches left sidebar groups */
.builder-form-section {
  margin-bottom: 16px;
}

.builder-form-section:last-child {
  margin-bottom: 0;
}

.builder-form-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-30, #B6B8C0);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Form inputs - matches left sidebar search input */
.builder-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-80, #3D4157);
  margin-bottom: 4px;
}

.builder-form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.builder-form-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-form-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236E7181'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.builder-form-select:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
}

.builder-form-textarea::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-form-textarea:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-help {
  font-size: 11px;
  color: var(--color-mirage-60, #6E7181);
  margin-top: 3px;
  line-height: 1.4;
}

/* Info boxes in forms */
.builder-form-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: var(--color-blue-05, #F2F4FF);
  border: 1px solid var(--color-blue-30, #B3BFFF);
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-info svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-blue, #1814F3);
}

.builder-form-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-warning svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #D97706;
}

.builder-form-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: #ECFDF5;
  border: 1px solid #6EE7B7;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-success svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #059669;
}

/* Form container */
.builder-form-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tabs */
.builder-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-tab {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-tab:hover {
  color: var(--color-mirage, #0D122D);
}

.builder-tab-active {
  color: var(--color-blue, #1814F3);
  border-bottom-color: var(--color-blue, #1814F3);
}

/* Search */
.builder-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.builder-search-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-search-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

/* Node list */
.builder-node-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.builder-node-empty {
  color: var(--color-mirage-60, #6E7181);
  font-size: 13px;
  padding: 12px 8px;
  text-align: center;
}

.builder-tab-description {
  font-size: 12px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 16px;
}

/* Node groups */
.builder-node-group {
  margin-bottom: 20px;
}

.builder-node-group:last-child {
  margin-bottom: 0;
}

.builder-node-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.builder-node-group-title:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.builder-group-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-group-title-text {
  flex: 1;
  text-align: left;
}

/* Collapsed state */
.builder-node-group[data-collapsed="true"] .builder-group-chevron {
  transform: rotate(-90deg);
}

.builder-node-group[data-collapsed="true"] .builder-node-items {
  display: none;
}

.builder-vendor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.builder-node-count {
  font-weight: 400;
  color: var(--color-mirage-30, #B6B8C0);
  margin-left: auto;
}

/* Node items */
.builder-node-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-node-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  cursor: grab;
  transition: all 0.2s ease;
  min-height: 44px;
  touch-action: none;
  position: relative;
  overflow: hidden;
}

.builder-node-item[data-tooltip] {
  overflow: visible;
}

.builder-node-vendor-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 10px 0 0 10px;
}

.builder-node-item:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  box-shadow: 0 2px 8px rgba(24, 20, 243, 0.08);
}

.builder-node-item:active {
  cursor: grabbing;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 4px 12px rgba(24, 20, 243, 0.15);
}

.builder-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.builder-node-icon svg {
  width: 18px;
  height: 18px;
}

.builder-node-initials {
  font-size: 10px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* Vendor initials on canvas nodes */
.canvas-node-initials {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* Drag preview - minimal node representation */
.builder-drag-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.builder-drag-preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.builder-drag-preview-icon svg {
  width: 16px;
  height: 16px;
  color: #374151;
}

.builder-drag-preview-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage, #0D122D);
  white-space: nowrap;
}

.builder-node-content {
  flex: 1;
  min-width: 0;
}

.builder-node-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage, #0D122D);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-node-desc {
  font-size: 11px;
  color: var(--color-mirage-60, #6E7181);
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-node-configurable-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.builder-node-api-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #005934;
  background-color: #D9FAEC;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  margin-left: 4px;
}

.builder-node-mock-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92640D;
  background-color: #FFF3D6;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  margin-left: 4px;
}

.builder-node-drag-handle {
  color: var(--color-mirage-30, #B6B8C0);
  flex-shrink: 0;
}

/* Node tooltip on hover */
.builder-node-item {
  position: relative;
}

.builder-node-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 12px;
  top: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0D122D;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.1s ease-out, transform 0.1s ease-out, visibility 0.1s ease-out;
  z-index: 20;
  pointer-events: none;
}

.builder-node-item[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 100%;
  margin-top: 0;
  border: 6px solid transparent;
  border-bottom-color: #0D122D;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease-out, visibility 0.1s ease-out;
  z-index: 20;
  pointer-events: none;
}

.builder-node-item[data-tooltip]:hover::after,
.builder-node-item[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hide hover effects during drag operations */
.builder-sidebar-dragging .builder-node-item:hover {
  border-color: var(--color-link-water, #DFEAF2);
  box-shadow: none;
}

.builder-sidebar-dragging .builder-node-item[data-tooltip]::after,
.builder-sidebar-dragging .builder-node-item[data-tooltip]::before {
  opacity: 0;
  visibility: hidden;
}

.builder-node-drag-handle svg {
  width: 16px;
  height: 16px;
}

/* Canvas wrapper — positions the empty-state overlay relative to the canvas */
.builder-canvas-wrapper {
  flex: 1 1 0%;
  min-height: 0;
  position: relative;
}

/* Canvas area */
.builder-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: grab;
  background-color: var(--color-mirage-05, #F3F3F5);
  background-image: radial-gradient(var(--color-mirage-20, #CFD0D5) 1px, transparent 1px);
  background-size: 20px 20px;
}

.builder-canvas:active {
  cursor: grabbing;
}

/* Empty canvas state — centered in visible canvas area */
.builder-canvas-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}

.builder-canvas-empty.hidden {
  display: none;
}

.builder-canvas-empty-icon {
  width: 48px;
  height: 48px;
  color: var(--color-mirage-30);
  margin-bottom: 16px;
}

.builder-canvas-empty-heading {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-mirage-70);
  margin: 0 0 8px 0;
}

.builder-canvas-empty-subtext {
  font-size: 14px;
  color: var(--color-mirage-30);
  margin: 0;
}

/* Start node prompt — shown when canvas has nodes but no ApplicantSource */
.builder-start-prompt {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-blue-05);
  border: 1px solid var(--color-blue-30);
  border-radius: 8px;
  color: var(--color-mirage-80);
  font-size: 13px;
  font-weight: 500;
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.builder-start-prompt svg {
  color: var(--color-blue-70);
  flex-shrink: 0;
}

.builder-start-prompt.hidden {
  display: none;
}

/* START badge on ApplicantSource nodes */
.node-start-badge {
  position: absolute;
  top: -8px;
  left: 12px;
  padding: 0 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 16px;
  color: var(--color-blue-90, #1A3EFF);
  background: var(--color-blue-05, #F2F4FF);
  border: 1px solid var(--color-blue-30, #B3BFFF);
  border-radius: 10px;
  z-index: 2;
}

/* ==========================================================================
   CRITICAL: Drawflow container hierarchy must ALL fill the canvas

   After Drawflow.start(), the structure becomes:
   #drawflow.builder-canvas.parent-drawflow
     └── .drawflow (created by Drawflow - handles pan events)
           └── .precanvas (holds nodes, gets transformed)
   ========================================================================== */

/* The element we initialize Drawflow on - becomes .parent-drawflow */
#drawflow.parent-drawflow,
.builder-canvas.parent-drawflow {
  width: 100% !important;
  height: 100% !important;
  min-height: 400px;
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
}

/* The main drawflow container - THIS handles pan/drag events */
#drawflow.parent-drawflow > .drawflow,
.parent-drawflow > .drawflow {
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  cursor: grab !important;
  background: transparent !important;
  overflow: visible !important;
  transform-origin: 0 0 !important;
}

#drawflow.parent-drawflow > .drawflow:active,
.parent-drawflow > .drawflow:active {
  cursor: grabbing !important;
}

/* Drawflow v0.x uses `.drawflow` as the transform layer */

/* Nodes should have move cursor */
.drawflow .drawflow-node {
  cursor: move !important;
}

/* ==========================================================================
   WORKFLOW BUILDER - Drawflow node customizations
   ========================================================================== */

#drawflow .drawflow .drawflow-node {
  background: #ffffff !important;
  border: 1px solid var(--color-link-water, #DFEAF2) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  padding: 0 !important;
  min-width: 220px !important;
  width: auto !important;
  overflow: visible !important;
}

#drawflow .drawflow .drawflow-node:hover {
  border-color: var(--color-blue-30, #B3BFFF) !important;
  box-shadow: 0 4px 12px rgba(24, 20, 243, 0.08) !important;
}

#drawflow .drawflow .drawflow-node.selected {
  border-color: var(--color-blue, #1814F3) !important;
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15) !important;
}

/* Multi-select: same visual ring as Drawflow's .selected */
#drawflow .drawflow .drawflow-node.multi-selected {
  border-color: var(--color-blue, #1814F3) !important;
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15) !important;
}

.drawflow .drawflow-node.multi-selected .custom-node,
.drawflow .drawflow-node.multi-selected .base-node {
  border: 1px solid var(--color-blue-90, #1A3EFF) !important;
}

/* Lasso selection rectangle */
.lasso-selection-rect {
  position: fixed;
  border: 1.5px dashed var(--color-blue-70, #4D69FF);
  background: rgba(24, 20, 243, 0.06);
  pointer-events: none;
  z-index: 9999;
}

/* Position connection port containers to align with visible node edges */
#drawflow .drawflow .drawflow-node .inputs {
  position: absolute !important;
  left: 10px !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 10 !important;
}

#drawflow .drawflow .drawflow-node .outputs {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translate(50%, -50%) !important;
  z-index: 10 !important;
}

/* Invisible clickable connection points */
#drawflow .drawflow .drawflow-node .input,
#drawflow .drawflow .drawflow-node .output {
  width: 20px !important;
  height: 30px !important;
  background: transparent !important;
  border: none !important;
  cursor: crosshair !important;
}

/* If/Else node output port labels - subtle pill design */
#drawflow .drawflow .drawflow-node.IfElse .output_1::after,
#drawflow .drawflow .drawflow-node.IfElse .output_2::after {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#drawflow .drawflow .drawflow-node.IfElse .output_1::after {
  content: 'True';
  color: #16a34a;
}

#drawflow .drawflow .drawflow-node.IfElse .output_2::after {
  content: 'False';
  color: #dc2626;
}

/* Connection lines - thicker for easier manipulation */
#drawflow .drawflow .connection .main-path {
  stroke: var(--color-mirage-30, #B6B8C0) !important;
  stroke-width: 3px !important;
  cursor: pointer !important;
  marker-end: url(#drawflow-arrow) !important;
}

#drawflow .drawflow .connection .main-path:hover {
  stroke: var(--color-blue, #1814F3) !important;
  stroke-width: 4px !important;
}

/* Arrow head color on hover */
#drawflow .drawflow .connection:hover .main-path {
  marker-end: url(#drawflow-arrow-hover) !important;
}

/* Base node styling on canvas */
#drawflow .drawflow .base-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: none !important;
  width: 100%;
  box-sizing: border-box;
}

#drawflow .drawflow .base-node.border-amber-400 {
  background: #fffbeb;
}

#drawflow .drawflow .node-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

#drawflow .drawflow .node-icon-container svg {
  width: 20px;
  height: 20px;
}

/* Buttons */
.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* Layout utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-2 { height: 0.5rem; }
.w-2 { width: 0.5rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-72 { width: 18rem; }
.w-80 { width: 20rem; }
.w-0 { width: 0; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-6 { padding-top: 1.5rem; }
.pl-2 { padding-left: 0.5rem; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-10 { margin-left: 2.5rem; }
.mr-3 { margin-right: 0.75rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }

.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-visible { overflow: visible; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-table { max-width: 1100px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.shrink-0 { flex-shrink: 0; }

.whitespace-nowrap { white-space: nowrap; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.tracking-wider { letter-spacing: 0.05em; }

.inline-flex { display: inline-flex; }
.divide-y > * + * { border-top-width: 1px; }
.divide-gray-200 > * + * { border-color: #e5e7eb; }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* Hover states */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-white:hover { background-color: #ffffff; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-blue-800:hover { color: #1e40af; }
.hover\:text-blue-900:hover { color: #1e3a8a; }
.hover\:text-red-900:hover { color: #7f1d1d; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }
.hover\:shadow-sm:hover { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.no-underline { text-decoration: none; }
.hover\:underline:hover { text-decoration: underline; }

/* Ring utilities */
.ring-2 { box-shadow: 0 0 0 2px var(--tw-ring-color, currentColor); }
.ring-green-100 { --tw-ring-color: rgba(220, 252, 231, 1); }
.ring-amber-100 { --tw-ring-color: rgba(254, 243, 199, 1); }
.ring-blue-200 { --tw-ring-color: rgba(191, 219, 254, 1); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); }
.focus\:border-blue-500:focus { border-color: #3b82f6; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
}

@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Table styles */
table { border-collapse: collapse; }
th, td { padding: 0.75rem 1.5rem; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-enter 0.3s ease-out;
  max-width: 380px;
}

.toast-success {
  background-color: #10B981;
  color: white;
}

.toast-error {
  background-color: #EF4444;
  color: white;
}

.toast-warning {
  background-color: #F59E0B;
  color: white;
}

.toast-info {
  background-color: var(--color-blue, #1814F3);
  color: white;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.toast-dismiss:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.toast-exit {
  animation: toast-exit 0.3s ease-in forwards;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ==========================================================================
   DEMO EXECUTION STYLES
   n8n-style workflow execution visualization
   ========================================================================== */

/* Demo button in toolbar */
.btn-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  height: 38px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-demo svg {
  width: 16px;
  height: 16px;
}

.btn-demo-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  height: 38px;
  background: var(--color-mirage-05, #F3F3F5);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 13px;
  font-weight: 500;
  cursor: default;
}

.btn-demo-disabled svg {
  width: 16px;
  height: 16px;
}

.btn-demo-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 38px;
  margin-left: 8px;
}

.btn-demo-dropdown-toggle:hover {
  background: #e5e7eb;
}

.btn-demo-dropdown-toggle svg {
  width: 14px;
  height: 14px;
  color: #6b7280;
}

/* Info icon with tooltip */
.scenario-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #9ca3af;
  cursor: help;
  position: relative;
}

.scenario-info-icon:hover {
  color: #6b7280;
}

.scenario-info-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 8px 12px;
  background: #1f2937;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  pointer-events: none;
  width: 200px;
  text-align: left;
}

.scenario-info-icon[data-tooltip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  right: 4px;
  border: 6px solid transparent;
  border-bottom-color: #1f2937;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
}

.scenario-info-icon[data-tooltip]:hover::after,
.scenario-info-icon[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

.scenario-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 100;
  min-width: 120px;
}

.scenario-dropdown.hidden {
  display: none;
}

.scenario-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.scenario-option:hover {
  background: #f3f4f6;
}

.scenario-option:first-child {
  border-bottom: 1px solid #e5e7eb;
}

.btn-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-stop:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-stop svg {
  width: 16px;
  height: 16px;
}

/* Demo Modal */
.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-modal.hidden {
  display: none;
}

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.demo-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  margin: 20px;
  animation: modal-enter 0.3s ease-out;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.demo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.demo-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.demo-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-modal-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.demo-modal-body {
  padding: 24px;
}

.demo-modal-description {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px 0;
}

.demo-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  border-radius: 0 0 16px 16px;
}

/* Scenario options */
.demo-scenario-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.demo-scenario-option {
  cursor: pointer;
}

.demo-scenario-option input[type="radio"] {
  display: none;
}

.demo-scenario-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.demo-scenario-option input[type="radio"]:checked + .demo-scenario-card {
  border-color: var(--color-blue, #1814F3);
  background-color: #f8faff;
}

.demo-scenario-card:hover {
  border-color: #d1d5db;
}

.demo-scenario-icon {
  flex-shrink: 0;
}

.demo-scenario-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.demo-scenario-info p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.demo-scenario-result {
  font-weight: 600;
}

/* Speed control */
.demo-speed-control {
  display: flex;
  align-items: center;
  gap: 16px;
}

.demo-speed-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.demo-speed-options {
  display: flex;
  gap: 8px;
}

.demo-speed-option {
  cursor: pointer;
}

.demo-speed-option input[type="radio"] {
  display: none;
}

.demo-speed-option span {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.demo-speed-option input[type="radio"]:checked + span {
  background: var(--color-blue, #1814F3);
  color: #ffffff;
}

.demo-speed-option span:hover {
  background: #e5e7eb;
}

.demo-speed-option input[type="radio"]:checked + span:hover {
  background: var(--color-blue-90, #1A3EFF);
}

/* Progress Panel */
.demo-progress-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 340px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.demo-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
}

.demo-progress-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-progress-title h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.demo-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.demo-progress-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-progress-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-progress-list {
  padding: 16px 20px;
  max-height: 300px;
  overflow-y: auto;
}

.demo-progress-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.demo-progress-item:last-child {
  border-bottom: none;
}

.demo-progress-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-progress-dot {
  width: 8px;
  height: 8px;
  background: #d1d5db;
  border-radius: 50%;
}

.demo-progress-icon-pending .demo-progress-dot {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.demo-progress-icon-running svg {
  animation: spin 1s linear infinite;
}

.demo-progress-info {
  flex: 1;
  min-width: 0;
}

.demo-progress-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}

.demo-progress-status {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.demo-progress-status-success {
  color: #059669;
}

.demo-progress-status-running {
  color: #2563eb;
}

.demo-progress-status-skipped {
  color: #9ca3af;
}

.demo-progress-footer {
  padding: 12px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.demo-progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

/* Node states - targets the inner .base-node element */
/* RUNNING STATE - Blue glow with pulsing animation */
.demo-node-running .base-node {
  border: 2px solid #3b82f6 !important;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 4px 20px rgba(59, 130, 246, 0.3) !important;
  animation: node-running-glow 1.5s ease-in-out infinite;
}

/* SUCCESS STATE - Green with solid background */
.demo-node-success .base-node {
  border: 2px solid #10b981 !important;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 4px 12px rgba(16, 185, 129, 0.15) !important;
}

/* FAILED STATE - Red with strong visual feedback */
.demo-node-failed .base-node {
  border: 2px solid #ef4444 !important;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 4px 12px rgba(239, 68, 68, 0.15) !important;
}

/* PENDING STATE - Yellow/amber waiting indicator with clear "queued" appearance */
.demo-node-pending .base-node {
  border: 2px dashed #f59e0b !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15) !important;
  animation: node-pending-pulse 1.5s ease-in-out infinite;
  opacity: 0.85;
}

/* WAITING STATE - Orange with pulsing animation (for Wait nodes) */
.demo-node-waiting .base-node {
  border: 2px solid #f97316 !important;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 20px rgba(249, 115, 22, 0.3) !important;
  animation: node-waiting-glow 1.5s ease-in-out infinite;
}

/* SKIPPED STATE - Grayed out */
.demo-node-skipped .base-node {
  opacity: 0.5;
  border: 1px dashed #9ca3af !important;
  background: #f9fafb !important;
}

/* Running state glow animation */
@keyframes node-running-glow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 4px 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.15), 0 4px 30px rgba(59, 130, 246, 0.4);
  }
}

/* Pending state pulse - more noticeable "waiting in queue" effect */
@keyframes node-pending-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
    opacity: 0.85;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.08);
    opacity: 0.7;
  }
}

/* Waiting state glow animation */
@keyframes node-waiting-glow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 20px rgba(249, 115, 22, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.15), 0 4px 30px rgba(249, 115, 22, 0.4);
  }
}

/* Waiting countdown overlay on node */
.demo-waiting-countdown {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
  z-index: 15;
  white-space: nowrap;
  animation: countdown-pop-in 0.3s ease-out;
}

@keyframes countdown-pop-in {
  0% {
    transform: translateX(-50%) scale(0);
    opacity: 0;
  }
  60% {
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

/* Status indicator on nodes - badge that appears at top-right */
.demo-status-indicator {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  border: 2px solid #ffffff;
  animation: badge-pop-in 0.3s ease-out;
}

@keyframes badge-pop-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.demo-status-indicator svg {
  width: 18px;
  height: 18px;
}

/* Running indicator - blue background with spinning icon */
.demo-status-running {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #3b82f6;
}

.demo-status-running svg {
  color: #ffffff !important;
  animation: status-spin 1s linear infinite;
}

/* Waiting indicator - orange background with spinning icon */
.demo-status-waiting {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: #f97316;
}

.demo-status-waiting svg {
  color: #ffffff !important;
  animation: status-spin 1s linear infinite;
}

@keyframes status-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Success indicator - green background with check */
.demo-status-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
}

.demo-status-success svg {
  color: #ffffff !important;
}

/* Failed indicator - red background */
.demo-status-failed {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #ef4444;
}

.demo-status-failed svg {
  color: #ffffff !important;
}

/* Pending indicator - amber background with subtle pulse */
.demo-status-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #f59e0b;
  animation: status-pending-pulse 1.2s ease-in-out infinite;
}

.demo-status-pending svg {
  color: #ffffff !important;
}

@keyframes status-pending-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.9);
    opacity: 0.7;
  }
}

/* Skipped indicator - gray */
.demo-status-skipped {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.demo-status-skipped svg {
  color: #6b7280 !important;
}

/* Connection animation */
.demo-connection-active .main-path {
  stroke: #10b981 !important;
  stroke-width: 3px !important;
  animation: connection-flow 0.5s ease-out;
}

@keyframes connection-flow {
  0% {
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 20;
  }
  100% {
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 0;
  }
}

/* Spin animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Completion Toast - replaces modal for better UX */
.demo-completion-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  max-width: 450px;
  animation: toast-slide-in 0.4s ease-out;
  pointer-events: auto;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.demo-toast-exit {
  animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.demo-toast-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
}

.demo-toast-failed {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #ffffff;
}

.demo-toast-notice {
  background: linear-gradient(135deg, var(--color-mirage) 0%, #1a2040 100%);
  color: #ffffff;
}
.demo-notice-links {
  margin-top: 8px;
}
.demo-notice-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.demo-notice-link-label {
  font-size: 12px;
  opacity: 0.85;
  flex: 1;
}
.demo-notice-btn {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  transition: background-color 0.15s;
}
.demo-notice-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.demo-toast-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-toast-icon svg {
  width: 24px;
  height: 24px;
}

.demo-toast-content {
  flex: 1;
  min-width: 0;
}

.demo-toast-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.demo-toast-subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.demo-toast-action {
  flex-shrink: 0;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-toast-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

.demo-toast-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.demo-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Legacy completion modal - kept for backwards compatibility */
.demo-completion-content {
  text-align: center;
  padding: 40px 24px;
}

.demo-completion-icon {
  margin-bottom: 20px;
}

.demo-completion-icon svg {
  width: 64px;
  height: 64px;
}

.demo-completion-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
}

.demo-completion-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.demo-stat {
  text-align: center;
}

.demo-stat-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.demo-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

/* Inspector panel */
.demo-inspector-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  max-height: 400px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  animation: slide-in-right 0.3s ease-out;
}

.demo-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1f2937;
  color: #ffffff;
}

.demo-inspector-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.demo-inspector-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-inspector-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-inspector-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}

.demo-inspector-tab {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-inspector-tab:hover {
  color: #374151;
}

.demo-inspector-tab.active {
  color: var(--color-blue, #1814F3);
  border-bottom-color: var(--color-blue, #1814F3);
}

.demo-inspector-content {
  padding: 16px;
  max-height: 280px;
  overflow-y: auto;
  background: #1f2937;
}

.demo-inspector-content pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.demo-inspector-content code {
  color: #a5f3fc;
  font-family: 'Monaco', 'Menlo', monospace;
}

/* ==========================================================================
   WORKFLOW MODAL - Based on Figma design (node 58:3706)
   Two-step modal for creating workflows
   ========================================================================== */
.workflow-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: workflow-modal-fade-in 0.2s ease-out;
}

.workflow-modal-overlay.hidden {
  display: none;
}

@keyframes workflow-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.workflow-modal {
  background-color: white;
  border: 1px solid #dfeaf2;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  animation: workflow-modal-slide-in 0.25s ease-out;
}

@keyframes workflow-modal-slide-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal Header */
.workflow-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #dfeaf2;
}

.workflow-modal-title-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.workflow-modal-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f7f9fb;
  border: 1px solid #f2f4ff;
  border-radius: 9px;
}

.workflow-modal-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-blue, #1814F3);
}

.workflow-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #0d122d;
  margin: 0;
  line-height: 22px;
}

.workflow-modal-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #6e7181;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.workflow-modal-close:hover {
  color: #0d122d;
  background-color: #f5f7fa;
}

/* Modal Body */
.workflow-modal-body {
  padding: 24px;
}

.workflow-modal-description {
  font-size: 16px;
  line-height: 24px;
  color: #252a42;
  margin: 0 0 15px 0;
}

.workflow-modal-hint {
  font-size: 14px;
  line-height: 20px;
  color: #868896;
  margin: 0;
}

/* Modal Footer */
.workflow-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  padding: 18px 24px;
  border-top: 1px solid #dfeaf2;
}

/* Step indicator */
.workflow-modal-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.workflow-modal-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #dfeaf2;
  transition: background-color 0.2s ease;
}

.workflow-modal-step.active {
  background-color: var(--color-blue, #1814F3);
}

/* Goal cards for step 2 */
.workflow-modal-goals {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
}

.workflow-modal-goal {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  background-color: white;
  border: 1px solid #dfeaf2;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.workflow-modal-goal:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  background-color: #fafbfc;
}

.workflow-modal-goal.selected {
  border-color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
}

.workflow-modal-goal-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.workflow-modal-goal-content {
  flex: 1;
  min-width: 0;
}

.workflow-modal-goal-name {
  font-size: 15px;
  font-weight: 600;
  color: #0d122d;
  margin: 0 0 4px 0;
}

.workflow-modal-goal-description {
  font-size: 13px;
  color: #6e7181;
  margin: 0;
  line-height: 18px;
}

.workflow-modal-goal-arrow {
  width: 20px;
  height: 20px;
  color: #b6b8c0;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.workflow-modal-goal:hover .workflow-modal-goal-arrow {
  color: var(--color-blue, #1814F3);
}

/* Form inside modal */
.workflow-modal-form .form-input {
  width: 100%;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - FORM FIELDS
   Standardized form field components with focus-within label color change
   ========================================================================== */
.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #56596C;
  transition: color 0.2s ease;
}

.form-field-group:focus-within .form-field-label {
  color: #0029FF;
}

.form-field-required {
  color: #FA3A55;
  margin-left: 2px;
}

.form-field-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 20px;
  color: #3D4157;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-field-input::placeholder {
  color: #868896;
}

.form-field-input:focus {
  outline: none;
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.form-field-input-error {
  border-color: #FA3A55;
}

.form-field-input-error:focus {
  border-color: #FA3A55;
  box-shadow: 0 0 0 3px rgba(250, 58, 85, 0.1);
}

.form-field-select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 20px;
  color: #3D4157;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-field-select:focus {
  outline: none;
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.form-field-helper {
  font-size: 12px;
  color: #868896;
  margin-top: 4px;
}

.form-field-error-msg {
  font-size: 12px;
  color: #FA3A55;
  margin-top: 4px;
}

.form-field-input--error {
  border-color: var(--color-token-red);
}

.form-field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-field-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0029FF;
  cursor: pointer;
}

.form-field-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-field-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #0029FF;
  cursor: pointer;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #0D122D;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #DFEAF2;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #DFEAF2;
}

.form-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  background-color: #0029FF;
  border: 1px solid #0029FF;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-submit-btn:hover {
  background-color: #001fcf;
  border-color: #001fcf;
}

.form-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 9px;
  color: #56596C;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.form-cancel-btn:hover {
  background-color: #F7F9FB;
  border-color: #B6B8C0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - STATUS PILLS
   Status indicator badges with colored dots
   ========================================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pill-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill-green {
  background-color: #D9FAEC;
  color: #005934;
}

.status-pill-green .status-pill-dot {
  background-color: #00DF81;
}

.status-pill-red {
  background-color: #FFE0EB;
  color: #641722;
}

.status-pill-red .status-pill-dot {
  background-color: #FA3A55;
}

.status-pill-yellow {
  background-color: #FFF5D9;
  color: #664B16;
}

.status-pill-yellow .status-pill-dot {
  background-color: #FFBB38;
}

.status-pill-info {
  background-color: var(--color-primary-light, #E6EAFF);
  color: var(--color-primary, #0029FF);
}

.status-pill-info .status-pill-dot {
  background-color: var(--color-primary, #0029FF);
}

.status-pill-gray {
  background-color: #F3F3F5;
  color: #56596C;
}

.status-pill-gray .status-pill-dot {
  background-color: #9EA0AB;
}

.status-pill-blue {
  background-color: #E5F9FF;
  color: #004D66;
}

.status-pill-blue .status-pill-dot {
  background-color: #00C1FF;
}

.status-pill-purple {
  background-color: #F4E9FF;
  color: #3A1466;
}

.status-pill-purple .status-pill-dot {
  background-color: #9233FE;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - DANGER BUTTONS
   Destructive action buttons
   ========================================================================== */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #FA3A55;
  border: 1px solid #FA3A55;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-danger:hover {
  background-color: #C82E44;
  border-color: #C82E44;
}

.btn-danger:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 58, 85, 0.3);
}

.btn-danger svg {
  color: #ffffff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #ffffff;
  border: 1px solid #FA3A55;
  border-radius: 9px;
  color: #FA3A55;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-danger-outline:hover {
  background-color: #FFF5F6;
}

.btn-danger-outline:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 58, 85, 0.3);
}

.btn-danger-outline svg {
  color: #FA3A55;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - ALERT BANNERS
   Contextual alert/notification banners
   ========================================================================== */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 9px;
  border: 1px solid;
}

.alert-banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-banner-content {
  flex: 1;
  min-width: 0;
}

.alert-banner-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert-banner-message {
  font-size: 14px;
  line-height: 1.5;
}

.alert-info {
  background-color: #E5F9FF;
  border-color: #00C1FF;
  color: #004D66;
}

.alert-info .alert-banner-icon {
  color: #00C1FF;
}

.alert-success {
  background-color: #D9FAEC;
  border-color: #00DF81;
  color: #005934;
}

.alert-success .alert-banner-icon {
  color: #00DF81;
}

.alert-warning {
  background-color: #FFF5D9;
  border-color: #FFBB38;
  color: #664B16;
}

.alert-warning .alert-banner-icon {
  color: #FFBB38;
}

.alert-error {
  background-color: #FFE0EB;
  border-color: #FA3A55;
  color: #641722;
}

.alert-error .alert-banner-icon {
  color: #FA3A55;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - LINKS
   Styled link variants
   ========================================================================== */
.link-default {
  color: #0029FF;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-default:hover {
  color: #001899;
  text-decoration: underline;
}

.link-muted {
  color: #56596C;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-muted:hover {
  color: #3D4157;
  text-decoration: underline;
}

.link-danger {
  color: #FA3A55;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-danger:hover {
  color: #C82E44;
  text-decoration: underline;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - AVATARS
   User avatar components
   ========================================================================== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #F2F4FF;
  color: #0029FF;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.avatar-status-online {
  background-color: #00DF81;
}

.avatar-status-offline {
  background-color: #9EA0AB;
}

.avatar-status-busy {
  background-color: #FA3A55;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - DIVIDERS
   Horizontal divider lines
   ========================================================================== */
.divider {
  border: none;
  border-top: 1px solid #DFEAF2;
  margin: 16px 0;
}

.divider-sm {
  margin: 8px 0;
}

.divider-lg {
  margin: 24px 0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - ACTION DROPDOWNS
   Dropdown menus for table row actions
   ========================================================================== */
.action-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  padding: 6px;
  z-index: 40;
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #3D4157;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.action-dropdown-item:hover {
  background-color: #F7F9FB;
}

.action-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: #56596C;
}

.action-dropdown-item-danger {
  color: #FA3A55;
}

.action-dropdown-item-danger:hover {
  background-color: #FFF5F6;
}

.action-dropdown-item-danger svg {
  color: #FA3A55;
}

.action-dropdown-divider {
  border-top: 1px solid #DFEAF2;
  margin: 6px 0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - INPUT GROUPS
   Input with prefix/suffix elements
   ========================================================================== */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group-prefix,
.input-group-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background-color: #F7F9FB;
  border: 1px solid #DFEAF2;
  color: #56596C;
  font-size: 14px;
}

.input-group-prefix {
  border-right: none;
  border-radius: 6px 0 0 6px;
}

.input-group-suffix {
  border-left: none;
  border-radius: 0 6px 6px 0;
}

.input-group .form-field-input {
  border-radius: 0;
}

.input-group .form-field-input:first-child {
  border-radius: 6px 0 0 6px;
}

.input-group .form-field-input:last-child {
  border-radius: 0 6px 6px 0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - CARDS
   Card container styling
   ========================================================================== */
.ds-card {
  background: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 9px;
  padding: 24px;
}

.ds-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #DFEAF2;
}

.ds-card-title {
  font-size: 18px;
  font-weight: 600;
  color: #0D122D;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - EMPTY STATES
   Empty state containers for pages with no content
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 200px);
}

.empty-state-filtered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-filtered-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-30);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  background-color: #F2F4FF;
}

.empty-state-icon svg {
  width: 40px;
  height: 40px;
  color: #0029FF;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  color: #0D122D;
  margin-bottom: 8px;
}

.empty-state-description {
  font-size: 14px;
  color: #868896;
  max-width: 24rem;
  margin-bottom: 32px;
}

/* Table container minimum height */
.table-container {
  min-height: 400px;
}

/* Stat badges/pills */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px;
  border-radius: 9999px;
  font-size: 14px;
}

.stat-pill-green {
  background-color: #D9FAEC;
  color: #00DF81;
}

.stat-pill-red {
  background-color: #FFE0EB;
  color: #FA3A55;
}

.stat-pill-gray {
  background-color: #F3F3F5;
  color: #56596C;
}

/* ==========================================================================
   SINGLE-APPLICANT PAGE
   Layout-only styles for the single-applicant screening form and results.
   Colors use DS variables; components reuse DS classes (ds-card, form-field-*,
   alert-banner, status-pill, divider, btn-*).
   ========================================================================== */

.sa-page {
  min-height: calc(100vh - 64px);
}

.sa-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.sa-header { margin-bottom: 24px; }

.sa-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sa-mode-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 4px;
}

.sa-mode-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sa-mode-hint {
  font-size: 11px;
  color: var(--color-mirage-30, #B6B8C0);
  margin: 0;
}

.sa-mode-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

.sa-mode-badge-test {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage-60, #6E7181);
}

.sa-mode-badge-live {
  background-color: rgba(0, 223, 129, 0.12);
  color: #00a85e;
}

.sa-mode-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-30, #B6B8C0);
  transition: color 0.2s ease;
  user-select: none;
}

.sa-mode-label-active {
  color: var(--color-mirage-80, #3D4157);
}

.sa-mode-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background-color: var(--color-mirage-10, #E8E8EC);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 0;
}

.sa-mode-switch.sa-mode-live {
  background-color: var(--color-token-green, #00DF81);
}

.sa-mode-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.sa-mode-switch.sa-mode-live .sa-mode-switch-thumb {
  transform: translateX(18px);
}

/* Reusable toggle switch */
.toggle-switch,
.toggle-switch button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.toggle-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  background-color: var(--color-mirage-10, #E8E8EC);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.toggle-switch-track.active {
  background-color: var(--color-token-green, #00DF81);
}

.toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.toggle-switch-track.active .toggle-switch-thumb {
  transform: translateX(18px);
}

.sa-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-mirage);
}

.sa-subtitle {
  font-size: 14px;
  color: var(--color-mirage-60);
  margin-top: 4px;
}

.sa-card { margin-bottom: 20px; }

.sa-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.sa-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--color-blue-05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sa-card-icon-svg {
  width: 20px;
  height: 20px;
  color: var(--color-blue);
}

.sa-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-mirage);
}

.sa-card-desc {
  font-size: 13px;
  color: var(--color-mirage-60);
  margin-top: 2px;
}

.sa-section-divider {
  border-top: 1px solid var(--color-link-water);
  margin: 24px 0;
}

.sa-node-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage);
}

/* Form grid — 2 columns */
.sa-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sa-col-span-2 { grid-column: span 2; }

@media (max-width: 640px) {
  .sa-form-grid { grid-template-columns: 1fr; }
  .sa-col-span-2 { grid-column: span 1; }
}

/* Workflow search + count bar */
.sa-workflow-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sa-workflow-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--color-link-water);
  border-radius: 9px;
  padding: 0 12px;
  height: 36px;
  flex: 1;
  max-width: 280px;
  transition: border-color 0.15s ease;
}

.sa-workflow-search:focus-within {
  border-color: var(--color-blue);
}

.sa-workflow-search-icon {
  width: 16px;
  height: 16px;
  color: var(--color-mirage-60);
  flex-shrink: 0;
}

.sa-workflow-search-input {
  width: 100%;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-mirage-80);
  line-height: 20px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent;
}

.sa-workflow-search-input::placeholder {
  color: var(--color-mirage-60);
}

.sa-workflow-count {
  font-size: 13px;
  color: var(--color-mirage-60);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Scrollable workflow container */
.sa-workflow-scroll {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--color-link-water);
  border-radius: 9px;
  padding: 12px;
  background: var(--color-app-bg);
}

/* Workflow selector grid */
.sa-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* Empty search state */
.sa-workflow-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
}

.sa-workflow-empty-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-30);
}

/* Workflow selector cards — only custom styles that utilities can't cover */
.sa-workflow-card {
  border: 2px solid var(--color-link-water);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sa-workflow-card:hover {
  border-color: var(--color-blue-30);
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.06);
}

.sa-workflow-card--selected {
  border-color: var(--color-blue);
  background: var(--color-blue-05);
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.12);
}

/* Check icon — hidden by default, shown when selected */
.sa-workflow-check {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sa-workflow-card--selected .sa-workflow-check {
  opacity: 1;
}

/* Dim unselected cards when a selection has been made */
.sa-workflow-scroll--has-selection .sa-workflow-card:not(.sa-workflow-card--selected) {
  opacity: 0.45;
  filter: grayscale(0.2);
}

.sa-workflow-scroll--has-selection .sa-workflow-card:not(.sa-workflow-card--selected):hover {
  opacity: 0.8;
  filter: none;
}

.sa-product-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sa-workflow-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water);
}

/* Submit area */
.sa-actions { display: flex; justify-content: flex-end; }

.sa-submit-btn { min-width: 260px; justify-content: center; }

/* ── Results view ─────────────────────────────────────────────────── */

.sa-results-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sa-results-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sa-elapsed {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-60);
  font-variant-numeric: tabular-nums;
}

/* Node result cards */
.sa-node-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sa-node-card {
  background: var(--color-gray-05);
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.sa-node-card--pending  { opacity: 0.55; }
.sa-node-card--running  { border-color: var(--color-blue-30); box-shadow: 0 0 0 2px rgba(0, 41, 255, 0.08); opacity: 1; }
.sa-node-card--waiting  { border-color: var(--color-token-orange); opacity: 1; }
.sa-node-card--success  { border-color: var(--color-token-green); opacity: 1; }
.sa-node-card--failed   { border-color: var(--color-token-red); opacity: 1; }
.sa-node-card--skipped  { opacity: 0.45; }

/* Collapsed skipped summary row */
.sa-skipped-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--color-mirage-60);
  background: var(--color-gray-05);
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  opacity: 0.55;
}

.sa-skipped-summary svg { flex-shrink: 0; color: var(--color-mirage-30); }

.sa-node-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.sa-node-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sa-node-card-status-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sa-node-card--pending .sa-node-card-status-icon { color: var(--color-mirage-30); }
.sa-node-card--running .sa-node-card-status-icon { color: var(--color-blue); }
.sa-node-card--waiting .sa-node-card-status-icon { color: var(--color-token-orange); }
.sa-node-card--success .sa-node-card-status-icon { color: var(--color-token-green); }
.sa-node-card--failed  .sa-node-card-status-icon { color: var(--color-token-red); }
.sa-node-card--skipped .sa-node-card-status-icon { color: var(--color-mirage-30); }

/* Expand/collapse toggle on cards with output */
.sa-node-card[data-expandable] .sa-node-card-header { cursor: pointer; }

.sa-node-card-toggle {
  display: flex;
  align-items: center;
  color: var(--color-mirage-30);
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.sa-node-card--collapsed .sa-node-card-toggle { transform: rotate(-90deg); }

.sa-node-card-status-text { font-size: 13px; font-weight: 500; color: var(--color-mirage-60); }
.sa-status-running { color: var(--color-blue); }
.sa-status-success { color: var(--color-token-green); }
.sa-status-failed  { color: var(--color-token-red); }
.sa-status-skipped { color: var(--color-mirage-30); }

/* Node type badges — uses DS status colors */
.sa-node-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.sa-type-product   { background: var(--color-blue-05);                        color: var(--color-blue); }
.sa-type-condition  { background: var(--color-secondary-token-yellow-light);   color: var(--color-catalina-blue); }
.sa-type-action     { background: var(--color-secondary-token-purple-light);   color: var(--color-token-purple); }
.sa-type-wait       { background: var(--color-secondary-token-orange-light);   color: var(--color-token-orange); }
.sa-type-goto       { background: var(--color-secondary-token-purple-light);   color: var(--color-token-purple); }
.sa-type-trigger    { background: var(--color-secondary-token-green-light);    color: var(--color-token-green); }
.sa-type-default    { background: var(--color-mirage-05);                      color: var(--color-mirage-60); }

/* Node output area */
.sa-node-card-output {
  border-top: 1px solid var(--color-link-water);
  padding: 14px 16px;
}

.sa-output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

@media (max-width: 640px) {
  .sa-output-grid { grid-template-columns: 1fr; }
}

.sa-output-item { display: flex; flex-direction: column; gap: 2px; }

.sa-output-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-mirage-60);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sa-output-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mirage);
  word-break: break-word;
}

.sa-output-toggle {
  display: block;
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-blue);
}

.sa-score-factors {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water);
}
.sa-score-factors-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-70);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.sa-score-factors-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sa-score-factors-list li {
  font-size: 13px;
  color: var(--color-mirage-80);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}
.sa-score-factors-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-mirage-30, #C4C6C8);
}
.sa-score-factor-code {
  font-weight: 600;
  color: var(--color-mirage);
}

.sa-notice-links {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water);
}
.sa-notice-links-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-70);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.sa-notice-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.sa-notice-link-label {
  font-size: 13px;
  color: var(--color-mirage-80);
}
.sa-notice-link-actions {
  display: flex;
  gap: 8px;
}
.sa-notice-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-blue);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.15s;
}
.sa-notice-btn:hover {
  background-color: var(--color-primary-light);
}

.sa-node-error { font-size: 13px; color: var(--color-token-red); }

/* Utilities */
.sa-icon-sm { width: 20px; height: 20px; }

@keyframes sa-spin { to { transform: rotate(360deg); } }
.sa-spin { animation: sa-spin 1s linear infinite; }

/* Confirm delete dialog */
.confirm-delete-dialog { max-width: 420px; width: 100%; }

.confirm-delete-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background-color: var(--color-secondary-token-red-light, #FFE0EB);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-token-red, #FA3A55);
}

.confirm-delete-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* CSV Upload Modal */
.csv-upload-modal {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  width: 520px;
  max-width: calc(100vw - 48px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: workflow-modal-slide-in 0.25s ease-out;
}

.csv-upload-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  flex-shrink: 0;
}

.csv-upload-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-mirage-70, #56596C);
  border-radius: 6px;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.csv-upload-modal-close:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.csv-upload-modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* ==========================================================================
   PRODUCT INFO DIALOG (sidebar "i" button)
   ========================================================================== */

/* Info button on sidebar node items — top-right corner */
.builder-node-info-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.builder-node-item:hover .builder-node-info-btn {
  opacity: 1;
}

.builder-node-info-btn:hover {
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
}

/* Product info dialog */
.product-info-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 640px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.product-info-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  z-index: 1;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.product-info-close-btn:hover {
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
}

.product-info-body {
  padding: 44px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-mirage-20, #CFD0D5) transparent;
}

.product-info-body::-webkit-scrollbar {
  width: 6px;
}

.product-info-body::-webkit-scrollbar-track {
  background: transparent;
}

.product-info-body::-webkit-scrollbar-thumb {
  background-color: var(--color-mirage-20, #CFD0D5);
  border-radius: 3px;
}

.product-info-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-mirage-30, #B6B8C0);
}

.product-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 28px;
}

.product-info-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.product-info-name {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  color: var(--color-mirage, #0D122D);
  margin: 0;
}

.product-info-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.product-info-price {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage, #0D122D);
  white-space: nowrap;
}

.product-info-price-unit {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-mirage-60, #6E7181);
}

.product-info-description {
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 20px;
  color: var(--color-mirage-60, #6E7181);
  margin: 0;
}

.product-info-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Limitations spans full width */
.product-info-sections .explore-detail-section--limitations {
  grid-column: 1 / -1;
}

/* Sections align to top so shorter columns don't stretch */
.product-info-sections .explore-detail-section {
  align-self: start;
}

/* Override justified text in dialog — left-align reads better at this width */
.product-info-sections .explore-detail-text,
.product-info-sections .explore-use-cases li {
  text-align: left;
}

.product-info-cta {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.product-info-loading {
  text-align: center;
  padding: 32px 16px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: var(--color-mirage-60, #6E7181);
}

/* ==========================================================================
   BILLING PRODUCT FORM - Tab navigation
   ========================================================================== */
.bp-tab-nav {
  display: flex;
  border-bottom: 2px solid var(--color-link-water, #DFEAF2);
  margin-bottom: 16px;
  position: sticky;
  top: -16px;
  margin-top: -16px;
  padding-top: 16px;
  background: white;
  z-index: 2;
}

.bp-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bp-tab:hover {
  color: var(--color-mirage, #0D122D);
}

.bp-tab.bp-tab-active {
  color: var(--color-primary, #0029FF);
  border-bottom-color: var(--color-primary, #0029FF);
}

.bp-tab-panel {
  display: none;
}

.bp-tab-panel.bp-tab-panel-active {
  display: block;
}

/* ---------- Output tab field list ---------- */
.bp-output-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-output-group-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-70, #56596C);
  margin-bottom: 4px;
}

.bp-output-group-body {
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 8px;
  padding: 2px 0;
}

.bp-output-field-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px 12px;
}

.bp-output-field-row + .bp-output-field-row {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

.bp-output-field-label {
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.bp-output-enum-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.bp-output-enum-pill {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  padding: 0 5px;
  border-radius: 3px;
  line-height: 18px;
}

/* ---------- If/Else multi-condition ---------- */
.ifelse-logic-toggle {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-link-water, #DFEAF2);
  margin-bottom: 10px;
}

.ifelse-logic-toggle.hidden {
  display: none;
}

.ifelse-logic-btn {
  flex: 1;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: var(--color-mirage-05, #F3F3F5);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ifelse-logic-btn:hover {
  color: var(--color-mirage, #0D122D);
}

.ifelse-logic-btn-active {
  background: var(--color-primary, #0029FF);
  color: white;
}

.ifelse-logic-btn-active:hover {
  color: white;
}

.ifelse-condition-row {
  position: relative;
  padding: 12px;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ifelse-condition-row .builder-form-label {
  font-size: 14px;
  font-weight: 500;
  color: #56596C;
  margin-bottom: 4px;
}

.ifelse-condition-row .builder-form-input,
.ifelse-condition-row .builder-form-select {
  padding: 10px 12px;
  font-size: 14px;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
}

.ifelse-condition-row .builder-form-input:focus,
.ifelse-condition-row .builder-form-select:focus {
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.ifelse-condition-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #868896;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ifelse-condition-remove:hover {
  color: #FA3A55;
  background: rgba(250, 58, 85, 0.08);
}

.ifelse-condition-remove:hover {
  color: var(--color-token-red, #FA3A55);
  background: rgba(250, 58, 85, 0.08);
}

.ifelse-add-condition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary, #0029FF);
  background: none;
  border: 1px dashed var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ifelse-add-condition:hover {
  border-color: var(--color-primary, #0029FF);
  background: var(--color-primary-light, #E6EAFF);
}

.ifelse-add-condition-icon {
  width: 14px;
  height: 14px;
}

/* Searchable field picker (combobox) */
.ifelse-field-picker {
  position: relative;
}

.ifelse-field-picker-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 0;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ifelse-field-picker-input-wrap:hover {
  border-color: #0029FF;
}

.ifelse-field-picker-open {
  border-color: #0029FF;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

input.ifelse-field-picker-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
  color: #3D4157;
  min-width: 0;
  box-shadow: none;
  border-radius: 0;
}

input.ifelse-field-picker-input:focus {
  border: none;
  box-shadow: none;
}

.ifelse-field-picker-open .ifelse-field-picker-input {
  cursor: text;
}

.ifelse-field-picker-input::placeholder {
  color: var(--color-muted, #868896);
}

.ifelse-field-picker-chevron {
  width: 16px;
  height: 16px;
  color: var(--color-mirage-60, #6E7181);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.ifelse-field-picker-open .ifelse-field-picker-chevron {
  transform: rotate(180deg);
}

.ifelse-field-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border: 1px solid #0029FF;
  border-top: none;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.ifelse-field-picker-dropdown.hidden {
  display: none;
}

.ifelse-field-picker-options {
  max-height: 240px;
  overflow-y: auto;
}

.ifelse-field-picker-group-label {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-70, #56596C);
  background: var(--color-mirage-05, #F3F3F5);
  position: sticky;
  top: 0;
}

.ifelse-field-picker-option {
  padding: 7px 10px 7px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-mirage-80, #3D4157);
}

.ifelse-field-picker-option:hover {
  background: var(--color-primary-light, #E6EAFF);
}

.ifelse-field-picker-option-selected {
  color: var(--color-primary, #0029FF);
  font-weight: 500;
}

.ifelse-field-picker-empty {
  padding: 16px 10px;
  font-size: 12px;
  color: var(--color-muted, #868896);
  text-align: center;
}

.ifelse-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 8px;
  border: 1px dashed var(--color-link-water, #DFEAF2);
}

.ifelse-empty-state-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 12px;
}

.ifelse-empty-state-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0 0 4px;
}

.ifelse-empty-state-desc {
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   TEST STEP - Mode toggle and result panel
   ========================================================================== */
.test-mode-btn {
  background: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage-70, #56596C);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.test-mode-btn:hover:not(.test-mode-active) {
  background: var(--color-link-water, #DFEAF2);
}

.test-mode-btn.test-mode-active {
  background: var(--color-mirage, #0D122D);
  color: white;
}

#test-step-btn:hover:not(:disabled) {
  opacity: 0.9;
}

#test-step-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#test-step-btn .animate-spin {
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   VARIABLE AUTOCOMPLETE - Dropdown, browse button, preview tags
   ========================================================================== */

/* Dropdown container */
.variable-autocomplete-dropdown {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: autocomplete-fade-in 0.15s ease-out;
  max-height: 320px;
  overflow: hidden;
  position: relative;
}

.variable-autocomplete-options {
  max-height: 300px;
  overflow-y: auto;
}

/* Scroll indicator gradient at bottom */
.variable-autocomplete-dropdown::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, white);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s;
}

.variable-autocomplete-dropdown.scrolled-to-bottom::after {
  opacity: 0;
}

@keyframes autocomplete-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Group headers */
.autocomplete-group {
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.autocomplete-group-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-mirage-30, #B6B8C0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.autocomplete-group-line {
  flex: 1;
  height: 1px;
  background: var(--color-link-water, #DFEAF2);
}

/* Options */
.autocomplete-option {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background-color 0.1s ease;
}

.autocomplete-option:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.autocomplete-option.highlighted {
  background-color: var(--color-blue-05, #F2F4FF);
}

.autocomplete-option.hidden,
.autocomplete-group.hidden {
  display: none;
}

.autocomplete-option-label {
  font-size: 13px;
  color: var(--color-mirage-80, #3D4157);
  white-space: nowrap;
}

.autocomplete-option .var-code {
  font-size: 10px;
  color: var(--color-mirage-30, #B6B8C0);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.autocomplete-option:hover .var-code,
.autocomplete-option.highlighted .var-code {
  opacity: 1;
}

.autocomplete-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--color-mirage-30, #B6B8C0);
  text-align: center;
}

/* Input wrapper with browse button */
.variable-input-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
}

.variable-input-wrapper .builder-form-input,
.variable-input-wrapper .builder-form-textarea {
  flex: 1;
  padding-right: 36px;
}

.variable-browse-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.variable-browse-btn:hover {
  background: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #1814F3);
}

/* For textareas, position the browse button at top-right */
.variable-input-wrapper .builder-form-textarea ~ .variable-browse-btn {
  top: 10px;
  transform: none;
}

/* Variable input left-border indicator */
.builder-form-input.has-variables,
.builder-form-textarea.has-variables {
  border-left: 3px solid var(--color-blue-05, #F2F4FF);
}

/* Preview row with variable tags */
.variable-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 0 0;
}

.variable-preview.hidden {
  display: none;
}

.variable-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.variable-tag-context {
  background: var(--color-secondary-token-green-light, #D9FAEC);
  color: #0a8a54;
}

.variable-tag-upstream {
  background: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #1814F3);
}

/* Pill overlay for variable inputs (Zapier-style) */
.variable-pill-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 36px;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  z-index: 1;
  cursor: text;
}

/* Align pill to top in textareas */
.variable-input-wrapper:has(.builder-form-textarea) .variable-pill-overlay {
  align-items: flex-start;
  padding-top: 8px;
}

/* Mixed content overlay: text + inline pill tags */
.variable-pill-overlay-mixed {
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: var(--color-mirage-05, #F3F3F5);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-mirage, #0D122D);
  padding: 10px 12px;
  padding-right: 36px;
  border-radius: 8px;
  overflow-y: auto;
  right: 0;
}

.variable-pill-inline {
  display: inline-flex;
  vertical-align: middle;
  margin: 1px 2px;
}

.variable-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 6px;
  background: var(--color-blue-05, #F2F4FF);
  border: 1px solid rgba(24, 20, 243, 0.12);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.variable-pill-tag:hover {
  border-color: rgba(24, 20, 243, 0.3);
  box-shadow: 0 1px 3px rgba(24, 20, 243, 0.08);
}

.variable-pill-source {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-mirage-30, #B6B8C0);
}

.variable-pill-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-blue, #1814F3);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.variable-pill-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.variable-pill-clear:hover,
.variable-pill-remove:hover {
  color: var(--color-token-red, #FA3A55);
}

/* Variable pill remove button (inside contenteditable pills) */
.variable-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

/* Rich editor for reason field (contenteditable) */
.reason-rich-editor {
  flex: 1;
  min-height: 80px;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  resize: none;
  overflow-y: auto;
  line-height: 1.6;
}

.reason-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--color-mirage-30, #B6B8C0);
  pointer-events: none;
}

.reason-rich-editor .variable-pill-tag {
  display: inline-flex;
  vertical-align: baseline;
  margin: 2px 2px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* Position browse button at top-right for the reason editor */
.variable-input-wrapper .reason-rich-editor ~ .variable-browse-btn {
  top: 10px;
  transform: none;
}

/* Rich variable editor (shared contenteditable with inline pills) */
.rich-variable-editor {
  flex: 1;
  min-height: 80px;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  resize: none;
  overflow-y: auto;
  line-height: 1.6;
}

.rich-variable-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--color-mirage-30, #B6B8C0);
  pointer-events: none;
}

.rich-variable-editor .variable-pill-tag {
  display: inline-flex;
  vertical-align: baseline;
  margin: 2px 2px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.rich-variable-editor--single-line {
  min-height: unset;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Position browse button at top-right for rich editors */
.variable-input-wrapper .rich-variable-editor ~ .variable-browse-btn {
  top: 50%;
  transform: translateY(-50%);
}

.variable-input-wrapper .rich-variable-editor:not(.rich-variable-editor--single-line) ~ .variable-browse-btn {
  top: 10px;
  transform: none;
}

/* SMS character counter */
#sms-char-count {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   EXECUTIONS PAGE — Batch expand, error preview, timeline
   ========================================================================== */

/* Fixed-width column for workflow name */
.col-w-200 { width: 200px; flex-shrink: 0; }

/* Batch children container */
.batch-children-indent {
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  border-left: 3px solid var(--color-primary, #0029FF);
  margin-left: 16px;
  background: var(--color-mirage-05, #F3F3F5);
}

/* Indent only the name column in child rows to preserve column alignment */
.batch-children-indent .col-name {
  padding-left: 12px;
  position: relative;
}

.batch-children-indent .docket-table-row {
  background: var(--color-mirage-05, #F3F3F5);
}

.batch-children-indent .docket-table-row:hover {
  background: var(--color-primary-light, #E6EAFF);
}

.batch-children-indent .docket-table-row + .docket-table-row {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* Batch child inline status (dot + plain text, no pill) */
.batch-child-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-child-status .status-pill-dot {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--color-mirage-30, #B6B8C0);
}

.batch-child-status .dot-green { background-color: var(--color-token-green, #00DF81) !important; }
.batch-child-status .dot-red { background-color: var(--color-token-red, #FA3A55) !important; }
.batch-child-status .dot-blue { background-color: var(--color-primary, #0029FF) !important; }
.batch-child-status .dot-yellow { background-color: var(--color-token-yellow, #FFBB38) !important; }
.batch-child-status .dot-gray { background-color: var(--color-mirage-30, #B6B8C0) !important; }

/* Batch "View all" link */
.batch-view-all {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
  padding: 10px 16px;
}

.batch-view-all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary, #0029FF);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.batch-view-all-link:hover {
  color: var(--color-blue-90, #1A3EFF);
  text-decoration: underline;
}

/* Chevron rotation for batch expand */
.rotate-90 {
  transform: rotate(90deg);
}

.transition-transform {
  transition: transform 0.2s ease;
}

/* Truncated error preview */
.execution-error-preview {
  font-size: 12px;
  color: var(--color-token-red, #FA3A55);
  margin-top: 2px;
  line-height: 1.4;
  max-width: 600px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Batch row summary text */
.batch-summary-text {
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
}

/* Clickable execution row */
.execution-row-link {
  display: flex;
  width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.execution-row-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Execution detail page timeline */
.exec-timeline {
  position: relative;
  padding-left: 28px;
}

.exec-timeline-line {
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-link-water, #DFEAF2);
}

.exec-timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.exec-timeline-item:last-child {
  padding-bottom: 0;
}

.exec-timeline-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-link-water, #DFEAF2);
  background: white;
}

.exec-timeline-dot-completed {
  border-color: var(--color-token-green, #00DF81);
  background: var(--color-secondary-token-green-light, #D9FAEC);
}

.exec-timeline-dot-failed {
  border-color: var(--color-token-red, #FA3A55);
  background: var(--color-secondary-token-red-light, #FFE0EB);
}

.exec-timeline-dot-pending {
  border-color: var(--color-mirage-30, #B6B8C0);
  background: var(--color-mirage-05, #F3F3F5);
}

.exec-timeline-dot-running {
  border-color: var(--color-blue-70, #4D69FF);
  background: var(--color-blue-05, #F2F4FF);
}

.exec-timeline-dot-waiting {
  border-color: var(--color-token-yellow, #FFBB38);
  background: var(--color-secondary-token-yellow-light, #FFF5D9);
}

.exec-timeline-dot-skipped {
  border-color: var(--color-mirage-20, #CFD0D5);
  background: var(--color-mirage-05, #F3F3F5);
  border-style: dashed;
}

.exec-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.exec-detail-header > :first-child {
  flex: 1;
  min-width: 0;
}

/* ========================================
   Dashboard Recent Cascades Section
   ======================================== */

.dashboard-recent {
  background-color: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  padding: 24px;
  max-width: 1200px;
  margin: 24px auto 0;
}

.dashboard-recent-list {
  display: flex;
  flex-direction: column;
}

.dashboard-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.dashboard-recent-item:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.dashboard-recent-item + .dashboard-recent-item {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* CSV drag-and-drop active state */
.csv-drop-active {
  background-color: var(--color-primary-light, #E6EAFF) !important;
  outline: 2px dashed var(--color-primary, #0029FF);
  outline-offset: -2px;
}

.docket-table-row.csv-drop-active {
  background-color: var(--color-primary-light, #E6EAFF) !important;
}

.dashboard-recent-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: var(--color-primary-light, #E6EAFF);
  color: var(--color-primary, #0029FF);
  flex-shrink: 0;
}

.dashboard-recent-info {
  flex: 1;
  min-width: 0;
}

.exec-detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
}

.exec-detail-meta dt {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 2px;
}

.exec-detail-meta dd {
  margin: 0;
}

/* Collapsible output JSON */
.exec-output-toggle {
  font-size: 12px;
  color: var(--color-blue-90, #1A3EFF);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin-top: 4px;
}

.exec-output-toggle:hover {
  text-decoration: underline;
}

.exec-output-json {
  font-size: 12px;
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  color: var(--color-mirage-80, #3D4157);
}

/* Error preview in timeline (allow wrapping) */
.execution-error-wrap {
  white-space: normal;
  max-width: none;
}

/* Execution row inline detail (error/wait messages) */
.execution-row-detail {
  padding-left: 15px;
  padding-bottom: 6px;
  width: 100%;
}

/* Flex min-width reset for truncation in flex containers */
.flex-truncate {
  min-width: 0;
}

.dashboard-recent-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0;
  line-height: 20px;
}

.dashboard-recent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 13px;
}

.dashboard-recent-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

/* ========================================
   Dashboard Templates Section
   ======================================== */

.dashboard-templates {
  background-color: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  padding: 24px;
  max-width: 1200px;
  margin: 24px auto;
}

.dashboard-templates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Dashboard Tabs */
.dashboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.dashboard-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: transparent;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dashboard-tab:hover {
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
}

.dashboard-tab-active {
  color: var(--color-white, #FFFFFF);
  background-color: var(--color-mirage, #0D122D);
  border-color: var(--color-mirage, #0D122D);
}

.dashboard-tab-active:hover {
  color: var(--color-white, #FFFFFF);
  background-color: var(--color-mirage, #0D122D);
}

/* Template Cards Scroll Container */
.dashboard-template-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.dashboard-template-scroll::-webkit-scrollbar {
  height: 6px;
}

.dashboard-template-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-template-scroll::-webkit-scrollbar-thumb {
  background-color: var(--color-link-water, #DFEAF2);
  border-radius: 3px;
}

/* Template Card */
.dashboard-template-card {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background-color: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  scroll-snap-align: start;
}

.dashboard-template-card:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Template Icon */
.dashboard-template-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.dashboard-template-icons {
  display: flex;
  gap: 6px;
}

/* Template Card Text */
.dashboard-template-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0;
  line-height: 20px;
}

.dashboard-template-description {
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
  margin: 0;
  line-height: 18px;
  flex: 1;
}

/* ========================================
   Templates Browse Page
   ======================================== */

.templates-page {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

.templates-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.templates-grid .dashboard-template-card {
  flex: unset;
}

@media (max-width: 768px) {
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .templates-grid {
    grid-template-columns: 1fr;
  }
}
