/* Phonos Design System v5 - Unified Dark
   Source of truth: variables.css
   This file provides v3 bridge aliases for backward compatibility */

@import url('variables.css');

/* ========================================
   V3 BRIDGE ALIASES → V5 DESIGN TOKENS
   All --color-* names map to v5 variables
   ======================================== */

:root {
  /* Background Bridges */
  --color-bg-base: var(--bg-body, #293742);
  --color-bg-primary: var(--bg-surface, #30404D);
  --color-bg-secondary: var(--bg-card, #30404D);
  --color-bg-tertiary: var(--bg-card-hover, #394B59);
  --color-bg-elevated: var(--bg-elevated, #394B59);
  --color-bg-hover: var(--bg-hover, #3D4F5D);
  --color-bg-active: var(--bg-active, #465968);
  --color-surface: var(--bg-card, #30404D);
  /* Primary Color Bridge */
  --color-primary: var(--accent-success, #0F9960);
  /* Border Bridges */
  --color-border: var(--border-color, rgba(255, 255, 255, 0.15));
  --color-border-light: var(--border-color-light, rgba(255, 255, 255, 0.25));
  --color-border-focus: var(--border-color-focus, rgba(16, 185, 129, 0.7));
  /* Text Bridges */
  --color-text-primary: var(--text-primary, #F5F8FA);
  --color-text-secondary: var(--text-secondary, #C7D0DB);
  --color-text-muted: var(--text-muted, #A3B3C5);
  --color-text-disabled: var(--text-muted, #A3B3C5);
  /* Accent Bridges → Emerald Green */
  --color-accent: var(--accent-success, #0F9960);
  --color-accent-light: var(--accent-success-light, #34d399);
  --color-accent-dark: var(--accent-success-dark, #0A6B43);
  --color-accent-muted: var(--accent-success-muted, rgba(16, 185, 129, 0.15));
  --color-accent-glow: var(--accent-success-glow, rgba(16, 185, 129, 0.4));
  /* Status Color Bridges */
  --color-success: var(--accent-success);
  --color-success-light: var(--accent-success-light);
  --color-success-muted: var(--accent-success-muted);
  --color-success-glow: var(--accent-success-glow);
  --color-warning: var(--accent-warning);
  --color-warning-light: var(--accent-warning-light);
  --color-warning-muted: var(--accent-warning-muted);
  --color-warning-glow: var(--accent-warning-glow);
  --color-error: var(--accent-danger);
  --color-error-light: var(--accent-danger-light);
  --color-error-muted: var(--accent-danger-muted);
  --color-error-glow: var(--accent-danger-glow);
  --color-info: var(--accent-info);
  --color-info-light: var(--accent-info-light);
  --color-info-muted: var(--accent-info-muted);
  --color-info-glow: var(--accent-info-glow);
  /* Shadow Bridge (error → danger naming) */
  --shadow-glow-error: var(--shadow-glow-danger);
}

/* Compact Mode */

.compact-mode {
  --space-1: 0.125rem;
  --space-2: 0.25rem;
  --space-3: 0.5rem;
  --space-4: 0.75rem;
  --space-5: 1rem;
  --space-6: 1.25rem;
  --text-xs: 0.625rem;
  --text-sm: 0.75rem;
  --text-base: 0.875rem;
  --header-height: 44px;
}

/* Reduce Motion */

.reduce-motion,
.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* Light Theme - Override v5 base tokens directly */

[data-theme="light"] {
  --bg-body: #fafafa;
  --bg-surface: #ffffff;
  --bg-card: #f5f5f5;
  --bg-card-hover: #ebebeb;
  --bg-elevated: #ffffff;
  --bg-hover: #f0f0f0;
  --bg-active: #e5e5e5;
  --border-color: rgba(0, 0, 0, 0.06);
  --border-color-light: rgba(0, 0, 0, 0.04);
  --border-color-focus: rgba(16, 185, 129, 0.35);
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #5f6a76;
  --text-muted: #6b7280;
  --accent-primary: #059669;
  --accent-primary-light: #10b981;
  --accent-primary-dark: #047857;
  --accent-primary-muted: rgba(5, 150, 105, 0.08);
  --accent-primary-glow: rgba(5, 150, 105, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* System preference detection */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-body: #fafafa;
    --bg-surface: #ffffff;
    --bg-card: #f5f5f5;
    --bg-card-hover: #ebebeb;
    --bg-elevated: #ffffff;
    --bg-hover: #f0f0f0;
    --bg-active: #e5e5e5;
    --border-color: rgba(0, 0, 0, 0.06);
    --border-color-light: rgba(0, 0, 0, 0.04);
    --border-color-focus: rgba(16, 185, 129, 0.35);
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #5f6a76;
    --text-muted: #6b7280;
    --accent-primary: #059669;
    --accent-primary-light: #10b981;
    --accent-primary-dark: #047857;
    --accent-primary-muted: rgba(5, 150, 105, 0.08);
    --accent-primary-glow: rgba(5, 150, 105, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.1);
  }
}

/* ========================================
   RESET & BASE
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  background: var(--color-bg-base);
  color: var(--color-text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--color-accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

/* Typography */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

/* ========================================
   LAYOUT - SEAMLESS DESIGN
   ======================================== */

.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg-base);
}

/* ========================================
   SIDEBAR - INTEGRATED PANEL
   ======================================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-bg-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sidebar-logo > svg {
  width: 26px;
  height: 26px;
  color: var(--color-accent);
}

.sidebar-branding {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.sidebar-version {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-muted);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  width: -moz-fit-content;
  width: fit-content;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-2);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: var(--space-3);
}

.nav-section-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-disabled);
  margin-bottom: var(--space-1);
  padding: 0 var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 150ms cubic-bezier(0.16, 1, 0.3, 1),
    color 150ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 2px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

/* Icon transition */

.nav-item .nav-item-icon {
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

/* Hover effect with icon scale */

.nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  transform: translateX(2px);
}

.nav-item:hover .nav-item-icon {
  transform: scale(1.1);
}

/* Press effect */

.nav-item:active {
  transform: translateX(2px) scale(0.98);
  transition-duration: 50ms;
}

.nav-item.active {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 1px 4px var(--color-accent-glow);
  transform: none;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px currentColor;
}

.nav-item.active:hover {
  transform: none;
}

/* Nav active indicator - uses --nav-color set per-view */

.nav-item[data-view].active::before {
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  opacity: 0.6;
}

/* Nav Item Icons - Fixed sizing */

.nav-item-icon,
.nav-item svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

/* Colorful nav icons via design system variables */

.nav-item[data-view="dashboard"] .nav-item-icon {
  color: var(--nav-dashboard);
}

.nav-item[data-view="projects"] .nav-item-icon {
  color: var(--nav-projects);
}

.nav-item[data-view="files"] .nav-item-icon {
  color: var(--nav-files);
}

.nav-item[data-view="jobs"] .nav-item-icon {
  color: var(--nav-jobs);
}

.nav-item[data-view="usage"] .nav-item-icon {
  color: var(--nav-usage);
}

.nav-item[data-view="submit-job"] .nav-item-icon {
  color: var(--nav-submit);
}

.nav-item[data-view="viewer"] .nav-item-icon {
  color: var(--nav-viewer);
}

.nav-item[data-view="teams"] .nav-item-icon {
  color: var(--nav-teams);
}

.nav-item[data-view="settings"] .nav-item-icon {
  color: var(--nav-settings);
}

.nav-item[data-view="admin"] .nav-item-icon {
  color: var(--nav-admin);
}

.nav-item[data-view="preview"] .nav-item-icon {
  color: var(--nav-preview);
}

.nav-item[data-view="visualizer"] .nav-item-icon {
  color: var(--nav-visualizer);
}

.nav-item[data-view="search"] .nav-item-icon {
  color: var(--nav-search);
}

.nav-item[data-view="databases"] .nav-item-icon {
  color: var(--nav-databases);
}

.nav-item[data-view="iot"] .nav-item-icon {
  color: var(--nav-iot);
}

.nav-item#logout-btn .nav-item-icon {
  color: var(--nav-logout);
}

/* Hover - subtle icon enhancement */

.nav-item:hover .nav-item-icon {
  filter: brightness(1.15);
  transform: scale(1.05);
}

/* Active state - white icons */

.nav-item.active .nav-item-icon {
  color: white !important;
  filter: none;
  transform: none;
}

/* Nav hover backgrounds - use icon color at 8% opacity */

.nav-item:hover:not(.active) {
  background: var(--bg-hover);
}

/* Active states - gradient from nav-active variables */

.nav-item[data-view="dashboard"].active {
  background: linear-gradient(135deg, var(--nav-active-dashboard), color-mix(in srgb, var(--nav-active-dashboard) 85%, black));
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.nav-item[data-view="projects"].active {
  background: linear-gradient(135deg, var(--nav-active-projects), color-mix(in srgb, var(--nav-active-projects) 85%, black));
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.nav-item[data-view="files"].active {
  background: linear-gradient(135deg, var(--nav-active-files), color-mix(in srgb, var(--nav-active-files) 85%, black));
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.nav-item[data-view="jobs"].active {
  background: linear-gradient(135deg, var(--nav-active-jobs), color-mix(in srgb, var(--nav-active-jobs) 85%, black));
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.nav-item[data-view="usage"].active {
  background: linear-gradient(135deg, var(--nav-active-usage), color-mix(in srgb, var(--nav-active-usage) 85%, black));
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.nav-item[data-view="submit-job"].active {
  background: linear-gradient(135deg, var(--nav-active-submit), color-mix(in srgb, var(--nav-active-submit) 85%, black));
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.nav-item[data-view="viewer"].active {
  background: linear-gradient(135deg, var(--nav-active-viewer), color-mix(in srgb, var(--nav-active-viewer) 85%, black));
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.2);
}

.nav-item[data-view="teams"].active {
  background: linear-gradient(135deg, var(--nav-active-teams), color-mix(in srgb, var(--nav-active-teams) 85%, black));
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.2);
}

.nav-item[data-view="settings"].active {
  background: linear-gradient(135deg, var(--nav-active-settings), color-mix(in srgb, var(--nav-active-settings) 85%, black));
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.nav-item[data-view="admin"].active {
  background: linear-gradient(135deg, var(--nav-active-admin), color-mix(in srgb, var(--nav-active-admin) 85%, black));
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.nav-item[data-view="preview"].active {
  background: linear-gradient(135deg, var(--nav-active-preview), color-mix(in srgb, var(--nav-active-preview) 85%, black));
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.nav-item[data-view="visualizer"].active {
  background: linear-gradient(135deg, var(--nav-active-visualizer), color-mix(in srgb, var(--nav-active-visualizer) 85%, black));
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.nav-item[data-view="search"].active {
  background: linear-gradient(135deg, var(--nav-active-search), color-mix(in srgb, var(--nav-active-search) 85%, black));
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.nav-item[data-view="databases"].active {
  background: linear-gradient(135deg, var(--nav-active-databases), color-mix(in srgb, var(--nav-active-databases) 85%, black));
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.nav-item[data-view="iot"].active {
  background: linear-gradient(135deg, var(--nav-active-iot), color-mix(in srgb, var(--nav-active-iot) 85%, black));
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--color-border);
}

/* ========================================
   MAIN CONTENT - SEAMLESS WITH SIDEBAR
   ======================================== */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg-base);
}

.header {
  height: var(--header-height);
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  position: sticky;
  top: 0;
  z-index: 50;
}

[data-theme="light"] .header {
  background: var(--color-bg-primary);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.header-title {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Global Search in Header */

.header-search {
  display: flex;
  align-items: center;
  max-width: 320px;
  flex: 1;
  margin-left: var(--space-4);
}

.header-search-wrapper {
  position: relative;
  flex: 1;
}

.header-search-input {
  width: 100%;
  height: 34px;
  padding: 0 var(--space-8) 0 36px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  transition:
    border-color 150ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 150ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 150ms cubic-bezier(0.16, 1, 0.3, 1),
    width 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.header-search-input::-moz-placeholder {
  color: var(--color-text-muted);
  -moz-transition: color 150ms ease;
  transition: color 150ms ease;
}

.header-search-input::placeholder {
  color: var(--color-text-muted);
  transition: color 150ms ease;
}

.header-search-input:hover {
  border-color: var(--color-border-light);
  background: var(--color-bg-tertiary);
}

.header-search-input:focus {
  border-color: var(--color-accent);
  background: var(--color-bg-tertiary);
  box-shadow: 0 0 0 3px rgba(13, 150, 105, 0.15);
  outline: none;
}

.header-search-input:focus::-moz-placeholder {
  color: var(--color-text-secondary);
}

.header-search-input:focus::placeholder {
  color: var(--color-text-secondary);
}

.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transition: color 150ms ease, opacity 150ms ease;
}

.header-search-wrapper:focus-within .header-search-icon {
  color: var(--color-accent);
  opacity: 1;
}

.header-search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity 150ms ease;
}

.header-search-wrapper:focus-within .header-search-kbd {
  opacity: 0;
}

/* Search Results Dropdown */

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
}

.search-results-dropdown .search-loading,
.search-results-dropdown .search-no-results,
.search-results-dropdown .search-error {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.search-results-dropdown .search-error {
  color: var(--color-error);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background-color 150ms ease;
  border-bottom: 1px solid var(--color-border);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--color-bg-tertiary);
}

.search-result-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Header Center - Connection Status */

.header-center {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.connection-status.connected {
  color: var(--color-text-muted);
}

.connection-status.disconnected {
  color: var(--color-error);
}

.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.connection-status.connected .connection-dot {
  background: var(--color-success);
}

.connection-status.disconnected .connection-dot {
  background: var(--color-error);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Header action buttons */

.header-actions .btn-icon {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.header-actions .btn-icon:hover {
  color: var(--color-text-primary);
}

#bug-report-btn.bug-report-highlight {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
  box-shadow: 0 0 0 2px var(--color-accent-muted), 0 0 16px var(--color-accent-glow);
  animation: bug-report-highlight-pulse 1.4s ease-in-out infinite;
}

@keyframes bug-report-highlight-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px var(--color-accent-muted), 0 0 12px var(--color-accent-glow);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--color-accent), 0 0 20px var(--color-accent-glow);
  }
}

.notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--color-error);
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* User Menu */

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: none;
  border-radius: 4px;
  transition: background 0.15s ease;
  cursor: pointer;
}

.user-menu-btn:hover {
  background: var(--color-bg-hover);
}

#user-menu-btn #username-display {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 26px;
  height: 26px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

/* Theme Toggle */

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--color-text-primary);
}

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

/* Dropdown Menu */

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 100;
  overflow: hidden;
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.dropdown-header-name {
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--color-text-primary);
}

.dropdown-header-email {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease;
}

.dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.dropdown-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.dropdown-item:hover svg {
  opacity: 0.8;
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-1) 0;
}

.dropdown-item.danger {
  color: var(--color-error);
}

.dropdown-item.danger:hover {
  background: var(--color-error-muted);
}

/* Mobile Header */

@media (max-width: 768px) {
  .header {
    padding: 0 var(--space-3);
  }

  .header-search {
    display: none;
  }

  .header-center {
    display: none;
  }

  #user-menu-btn #username-display {
    display: none;
  }
}

.content-area {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
  background: var(--color-bg-base);
}

/* ========================================
   BREADCRUMB NAVIGATION
   ======================================== */

.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.breadcrumb-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.breadcrumb-back:hover:not(:disabled) {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.breadcrumb-back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  min-width: 0;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  border: none;
  background: transparent;
  border-radius: 3px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
}

.breadcrumb-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.breadcrumb-link {
  cursor: pointer;
}

.breadcrumb-link:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.breadcrumb-link:hover svg {
  opacity: 1;
}

.breadcrumb-current {
  color: var(--color-text-primary);
  font-weight: 500;
  background: var(--color-bg-tertiary);
}

.breadcrumb-current svg {
  opacity: 1;
  color: var(--color-accent);
}

.breadcrumb-separator {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* Mobile breadcrumb adjustments */

@media (max-width: 768px) {
  .breadcrumb-container {
    padding: var(--space-2) var(--space-3);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .breadcrumb-trail {
    flex-wrap: nowrap;
  }

  .breadcrumb-item {
    padding: 4px 8px;
    max-width: 150px;
  }
}

/* ========================================
   CARDS - Clean and subtle
   ======================================== */

.card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

/* Hover effect for interactive cards - subtle */

.card-hover:hover,
.card.clickable:hover {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-hover:active,
.card.clickable:active {
  transform: translateY(0);
}

.card-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: var(--text-sm);
  font-weight: 600;
}

.card-body {
  padding: var(--space-4);
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
}

/* Stat cards - subtle interactivity */

.stat-card {
  transition: all 0.15s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.stat-card:hover {
  border-color: var(--color-border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover::before {
  opacity: 0.6;
}

/* Stat card variants with color accents */

.stat-card.stat-success::before {
  background: var(--color-success);
}

.stat-card.stat-warning::before {
  background: var(--color-warning);
}

.stat-card.stat-info::before {
  background: var(--color-info);
}

.stat-card.stat-success:hover {
  border-color: rgba(16, 185, 129, 0.15);
}

.stat-card.stat-warning:hover {
  border-color: rgba(245, 158, 11, 0.15);
}

.stat-card.stat-info:hover {
  border-color: rgba(6, 182, 212, 0.15);
}

/* ========================================
   BUTTONS - Clean and subtle
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1;
  position: relative;
}

/* Removed shimmer effect for subtlety */

.btn::before {
  display: none;
}

.btn:hover::before {
  display: none;
}

/* Button press effect */

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-light);
  box-shadow: 0 2px 6px rgba(13, 150, 105, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98) translateY(0);
  box-shadow: 0 1px 3px rgba(13, 150, 105, 0.2);
}

.btn-secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-light);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.btn-danger {
  background: #c73838;
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-danger:hover:not(:disabled) {
  background: #d64545;
  box-shadow: 0 2px 6px rgba(199, 56, 56, 0.25);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-success:hover:not(:disabled) {
  background: var(--color-accent-light);
  box-shadow: 0 2px 6px rgba(13, 150, 105, 0.25);
  transform: translateY(-1px);
}

.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
}

.btn-icon {
  padding: var(--space-2);
  width: 32px;
  height: 32px;
}

.btn-icon:hover:not(:disabled) {
  background: var(--color-bg-hover);
  transform: scale(1.1);
}

.btn-icon:active:not(:disabled) {
  transform: scale(0.95);
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-primary);
  transition: all 0.15s ease;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-muted);
  background: var(--color-bg-secondary);
}

.form-input::-moz-placeholder, .form-textarea::-moz-placeholder {
  color: var(--color-text-muted);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}

/* Bug report dialog */
.bug-report-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bug-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.bug-report-grid .form-group {
  margin-bottom: 0;
}

.bug-report-field-full {
  grid-column: 1 / -1;
}

.bug-report-note {
  margin: 0 0 var(--space-3);
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

.bug-report-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
  .bug-report-grid {
    grid-template-columns: 1fr;
  }
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--color-accent);
}

/* ========================================
   TABLES
   ======================================== */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table-condensed th,
.table-condensed td {
  padding: 4px 8px;
  font-size: 12px;
}

.table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
}

.table tbody tr {
  transition: all var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--color-bg-hover);
}

.table tbody tr:hover td {
  background: transparent;
}

/* Clickable table rows */

.table tbody tr.clickable {
  cursor: pointer;
  transition: background var(--transition-fast);
}

/* Status indicator via first cell border */

.table tbody tr.clickable td:first-child {
  position: relative;
  border-left: 3px solid transparent;
}

.table tbody tr.status-running td:first-child,
.table tbody tr.status-processing td:first-child {
  border-left-color: var(--color-info);
}

.table tbody tr.status-completed td:first-child {
  border-left-color: var(--color-success);
}

.table tbody tr.status-failed td:first-child {
  border-left-color: var(--color-error);
}

.table tbody tr.status-partial td:first-child {
  border-left-color: var(--color-warning);
}

.table tbody tr.status-pending td:first-child,
.table tbody tr.status-queued td:first-child {
  border-left-color: var(--color-warning);
}

.table tbody tr.clickable:hover {
  background: var(--color-bg-hover);
}

.table tbody tr.status-running:hover,
.table tbody tr.status-processing:hover {
  background: rgba(6, 182, 212, 0.06);
}

.table tbody tr.status-completed:hover {
  background: rgba(16, 185, 129, 0.06);
}

.table tbody tr.status-failed:hover {
  background: rgba(239, 68, 68, 0.06);
}

.table tbody tr.status-partial:hover {
  background: rgba(217, 130, 43, 0.08);
}

.table tbody tr.clickable:active {
  background: rgba(99, 102, 241, 0.1);
}

/* ========================================
   BADGES - INTERACTIVE
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: 9999px;
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.badge-primary {
  background: var(--color-accent-muted);
  color: var(--color-accent-light);
}

.badge-success {
  background: var(--color-success-muted);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-muted);
  color: var(--color-error);
}

.badge-info {
  background: var(--color-info-muted);
  color: var(--color-info);
}

/* Pulsing badge for active/running status */

.badge-pulse {
  animation: badge-pulse 2s ease-in-out infinite;
}

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

  50% {
    opacity: 0.6;
  }
}

/* Badge with dot indicator */

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: var(--space-1);
  background: currentColor;
}

.badge-dot.badge-success::before {
  animation: dot-pulse-green 1.5s ease-in-out infinite;
}

.badge-dot.badge-warning::before {
  animation: dot-pulse-yellow 1.5s ease-in-out infinite;
}

@keyframes dot-pulse-green {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

@keyframes dot-pulse-yellow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
  }
}

/* ========================================
   MODALS
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow: hidden;
  transform: scale(0.96) translateY(10px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: 3px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.modal-body {
  padding: var(--space-4);
  overflow-y: auto;
  max-height: calc(85vh - 130px);
}

.modal-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  animation: toastIn 0.3s var(--ease-out);
}

.toast-success {
  border-left: 3px solid var(--color-success);
}

.toast-error {
  border-left: 3px solid var(--color-error);
}

.toast-warning {
  border-left: 3px solid var(--color-warning);
}

.toast-info {
  border-left: 3px solid var(--color-info);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========================================
   PROGRESS - ENHANCED
   ======================================== */

.progress {
  height: 6px;
  background: var(--color-bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-dark), var(--color-accent), var(--color-accent-light));
  background-size: 200% 100%;
  border-radius: 9999px;
  transition: width var(--transition-base);
  animation: progress-flow 2s linear infinite;
  position: relative;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes progress-flow {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes progress-shine {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

/* Progress variants */

.progress-bar.progress-success {
  background: linear-gradient(90deg, #059669, var(--color-success), #34d399);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.progress-bar.progress-warning {
  background: linear-gradient(90deg, #d97706, var(--color-warning), #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.progress-bar.progress-error {
  background: linear-gradient(90deg, #dc2626, var(--color-error), #f87171);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Indeterminate progress */

.progress.indeterminate .progress-bar {
  width: 40%;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(350%);
  }
}

/* ========================================
   TABS - Refined and subtle
   ======================================== */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
  gap: var(--space-1);
  position: relative;
}

.tab {
  position: relative;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px 2px 0 0;
  transition: width 0.2s ease, left 0.2s ease;
}

.tab:hover {
  color: var(--color-text-secondary);
}

.tab:hover::after {
  width: 40%;
  left: 30%;
}

.tab:active {
  transform: scale(0.99);
}

.tab.active {
  color: var(--color-text-primary);
}

.tab.active::after {
  width: 100%;
  left: 0;
}

.tab-pane {
  display: none;
  animation: tabFadeIn 0.2s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
  text-align: center;
  padding: var(--space-12);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  color: var(--color-text-disabled);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state-description {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* ========================================
   DROPDOWN
   ======================================== */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-1);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.dropdown-item:active {
  background: var(--color-bg-active);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.dropdown-item:hover svg {
  opacity: 0.8;
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-1) 0;
}

/* ========================================
   AVATAR
   ======================================== */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: var(--text-xs);
}

.avatar-lg {
  width: 40px;
  height: 40px;
  font-size: var(--text-base);
}

.avatar-xl {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
}

/* ========================================
   GRID & FLEX UTILITIES
   ======================================== */

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

/* Spacing */

.m-0 {
  margin: 0;
}

.mt-4 {
  margin-top: var(--space-4);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.p-4 {
  padding: var(--space-4);
}

/* ========================================
   LOADING
   ======================================== */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 9999px;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-hover);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-disabled);
}

/* ========================================
   AUTH PAGES
   ======================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--color-bg-base);
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-logo {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  color: var(--color-text-muted);
}

/* ========================================
   PROJECT CARDS
   ======================================== */

.project-card,
.project-card-v2 {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.project-card:hover,
.project-card-v2:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Glow effects for owned projects (orange) */

.project-card-v2.project-owned:hover,
.project-list-item.project-owned:hover,
.file-item.project-owned:hover,
.project-card-v2[style*="border-left: 4px solid #f97316"]:hover,
.project-list-item[style*="border-left: 4px solid #f97316"]:hover,
.file-item[style*="border-left: 4px solid #f97316"]:hover {
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3), 0 0 40px rgba(249, 115, 22, 0.15);
  border-color: #f97316;
}

/* Glow effects for shared projects (green) */

.project-card-v2.project-shared:hover,
.project-list-item.project-shared:hover,
.file-item.project-shared:hover,
.project-card-v2[style*="border-left: 4px solid #10b981"]:hover,
.project-list-item[style*="border-left: 4px solid #10b981"]:hover,
.file-item[style*="border-left: 4px solid #10b981"]:hover {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3), 0 0 40px rgba(16, 185, 129, 0.15);
  border-color: #10b981;
}

.project-card-header,
.project-card-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.project-card-title,
.project-card-v2-title {
  font-weight: 600;
  font-size: var(--text-base);
}

.project-card-description,
.project-card-v2-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta,
.project-card-v2-footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.project-card-v2-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--color-accent-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.project-card-v2-stats {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

.project-card-v2-stat {
  flex: 1;
  text-align: center;
}

.project-card-v2-stat-value {
  font-size: var(--text-lg);
  font-weight: 600;
}

.project-card-v2-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.project-card-v2-actions {
  display: flex;
  gap: var(--space-2);
}

.project-card-v2-actions .btn {
  flex: 1;
}

/* ========================================
   JOB STATUS - ENHANCED WITH ANIMATIONS
   ======================================== */

.job-status {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.job-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  transition: all var(--transition-base);
}

.job-status-dot.pending {
  background: var(--color-warning);
  animation: pulse-soft 3s ease-in-out infinite;
}

.job-status-dot.queued {
  background: var(--color-text-muted);
  animation: pulse-soft 3s ease-in-out infinite;
}

.job-status-dot.running {
  background: var(--color-info);
  animation: pulse-glow 2s infinite;
  box-shadow: 0 0 8px var(--color-info);
}

.job-status-dot.processing {
  background: var(--color-accent);
  animation: pulse-glow 2s infinite;
  box-shadow: 0 0 8px var(--color-accent);
}

.job-status-dot.completed {
  background: var(--color-success);
  animation: success-ping 0.6s ease-out;
}

.job-status-dot.failed {
  background: var(--color-error);
  animation: shake 0.5s ease-in-out;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px var(--space-3);
  border-radius: 9999px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.status-pill.pending {
  background: var(--color-warning-muted);
  color: var(--color-warning);
  border-color: rgba(245, 158, 11, 0.2);
}

.status-pill.queued {
  background: rgba(161, 161, 170, 0.1);
  color: var(--color-text-muted);
  border-color: rgba(161, 161, 170, 0.2);
}

.status-pill.running {
  background: var(--color-info-muted);
  color: var(--color-info);
  border-color: rgba(6, 182, 212, 0.2);
  animation: glow-pulse 2s ease-in-out infinite;
}

.status-pill.processing {
  background: var(--color-accent-muted);
  color: var(--color-accent);
  border-color: rgba(99, 102, 241, 0.2);
  animation: glow-pulse 2s ease-in-out infinite;
}

.status-pill.completed {
  background: var(--color-success-muted);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.2);
}

.status-pill.failed {
  background: var(--color-error-muted);
  color: var(--color-error);
  border-color: rgba(239, 68, 68, 0.2);
}

/* API Job Styling - Blue theme */

.api-job-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.api-job-badge svg {
  width: 14px;
  height: 14px;
}

/* API Job row in table */

tr.api-job {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
}

tr.api-job:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.03) 50%);
}

/* API Job card styling */

.job-card.api-job {
  border-left: 3px solid #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, var(--color-bg-secondary) 50%);
}

.job-card.api-job:hover {
  border-color: #818cf8;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

/* API source indicator */

.api-source-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a78bfa;
  font-size: 13px;
  font-weight: 500;
}

.api-source-indicator svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* Project API Tab Styling */

.project-api-section {
  animation: fadeIn 0.3s ease-out;
}

.api-docs-card {
  border-left: 4px solid #6366f1;
}

.api-docs-card .card-title {
  color: #6366f1;
}

.api-endpoint-list .endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.api-endpoint-list .endpoint:hover {
  background: var(--color-bg-tertiary);
  transform: translateX(4px);
}

.method-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.method-badge.get {
  background: #3b82f6;
  color: white;
}

.method-badge.post {
  background: #10b981;
  color: white;
}

.method-badge.put {
  background: #f59e0b;
  color: white;
}

.method-badge.delete {
  background: #ef4444;
  color: white;
}

/* Code Snippet Tabs */

.snippet-tabs {
  display: flex;
  gap: 8px;
}

.snippet-tab {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.snippet-tab:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.snippet-tab.active {
  background: #6366f1;
  border-color: #6366f1;
  color: white;
}

/* Code Block Styling */

.code-block {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.code-snippet-container {
  position: relative;
}

.code-snippet-container .btn {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #cdd6f4;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.code-snippet-container:hover .btn {
  opacity: 1;
}

/* API View Tabs */

.api-tabs .tab-v2.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.api-tabs .tab-v2:hover:not(.active) {
  color: #818cf8;
}

/* Status pill with pulsing dot */

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transition: all var(--transition-base);
}

.status-pill.running::before,
.status-pill.processing::before {
  animation: dot-pulse 2s ease-in-out infinite;
}

/* Animations */

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

  50% {
    opacity: 0.4;
  }
}

@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px currentColor;
  }

  50% {
    opacity: 0.8;
    transform: scale(1.2);
    box-shadow: 0 0 16px currentColor;
  }
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 currentColor;
  }

  50% {
    box-shadow: 0 0 12px -2px currentColor;
  }
}

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

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

@keyframes success-ping {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-3px);
  }

  75% {
    transform: translateX(3px);
  }
}

/* Progress bar for running jobs */

.job-progress-bar {
  height: 3px;
  background: var(--color-bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: var(--space-2);
  position: relative;
}

.job-progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--color-info), transparent);
  animation: progress-shimmer 2s ease-in-out infinite;
}

.job-progress-bar.processing::before {
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.job-progress-bar.completed::before {
  background: var(--color-success);
  animation: none;
  width: 100%;
}

@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

/* ========================================
   STATS OVERVIEW
   ======================================== */

.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.stats-overview-item {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  text-align: center;
}

.stats-overview-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stats-overview-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   FILE LIST
   ======================================== */

.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-item:hover {
  background: var(--color-bg-hover);
  transform: translateY(-1px);
}

.file-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-elevated);
  border-radius: 3px;
  color: var(--color-accent);
}

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

.file-name {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ========================================
   VIEW TOGGLE
   ======================================== */

.view-toggle {
  display: inline-flex;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  padding: 2px;
}

.view-toggle-btn {
  padding: var(--space-1) var(--space-2);
  border-radius: 3px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle-btn.active {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Responsive tabs */

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs-v2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .tabs-v2::-webkit-scrollbar {
    display: none;
  }

  .tab-v2 {
    padding: 8px 12px;
    font-size: 13px;
  }

  .tab-v2-count {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
}

/* Sidebar overlay for mobile */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
}

@media (max-width: 768px) {
  .sidebar-overlay.active {
    display: block;
  }
}

/* Skip to content */

.skip-to-content {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-accent);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: 4px;
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: var(--space-4);
}

/* ========================================
   INLINE JOB SUBMISSION
   ======================================== */

.inline-job-submission {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* Submit button animation */

@keyframes fillGreenFromTop {
  0% {
    -webkit-clip-path: inset(100% 0 0 0);
            clip-path: inset(100% 0 0 0);
    fill: #10b981;
  }

  100% {
    -webkit-clip-path: inset(0 0 0 0);
            clip-path: inset(0 0 0 0);
    fill: #10b981;
  }
}

.btn-submitting svg polygon,
.btn-submitting svg path,
.btn-submitting svg circle {
  animation: fillGreenFromTop 0.8s ease-out forwards;
}

.btn-submitting {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border-color: #059669;
  transition: all 0.3s ease;
}

.btn-submitting:hover {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.inline-job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.inline-job-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inline-job-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: 3px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-job-close:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

/* Job Form Wizard Steps - Enhanced */

.inline-job-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin: var(--space-6) var(--space-6) var(--space-4) var(--space-6);
  padding: var(--space-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.inline-job-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  flex: 1;
  text-align: center;
}

.inline-job-step:hover {
  background: var(--color-bg-elevated);
  transform: translateY(-1px);
}

.inline-job-step .step-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--color-border);
  transition: all 0.25s ease;
}

.inline-job-step .step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.inline-job-step.active {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.inline-job-step.active .step-number {
  background: linear-gradient(135deg, var(--color-accent), #8b5cf6);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
  transform: scale(1.1);
}

.inline-job-step.active .step-label {
  color: var(--color-accent);
  font-weight: 600;
  color: var(--color-text-primary);
}

.inline-job-step.completed .step-number {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.inline-job-step.completed .step-label {
  color: var(--color-success);
}

.inline-job-step-connector {
  width: 32px;
  height: 2px;
  background: var(--color-border);
  border-radius: 1px;
  transition: background 0.3s ease;
}

.inline-job-step.completed + .inline-job-step-connector,
.inline-job-step.active + .inline-job-step-connector {
  background: linear-gradient(90deg, var(--color-accent), var(--color-border));
}

.inline-job-step-content {
  display: none;
  animation: stepFadeIn 0.3s ease;
}

.inline-job-step-content.active {
  display: block;
}

/* Batch step content - same as inline-job-step-content */

.batch-step-content {
  display: none;
  padding: var(--space-6);
  min-height: 400px;
  animation: stepFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.batch-step-content.active {
  display: block;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Form Layout in Batch Steps */

.batch-step-content .card-body {
  max-width: 100%;
  margin: 0 auto;
}

.batch-step-content .form-group {
  margin-bottom: var(--space-4);
}

.batch-step-content .form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.batch-step-content .form-input,
.batch-step-content .form-textarea,
.batch-step-content .form-select {
  border: 2px solid var(--color-border);
  border-radius: 4px;
  padding: var(--space-3);
  font-size: 14px;
  transition: all var(--transition-normal);
  background: var(--color-bg-tertiary);
}

.batch-step-content .form-input:focus,
.batch-step-content .form-textarea:focus,
.batch-step-content .form-select:focus {
  border-color: var(--color-accent);
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.inline-job-form {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
}

.inline-job-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.inline-job-actions .btn {
  flex-shrink: 0;
  min-width: -moz-fit-content;
  min-width: fit-content;
}

/* Model selection */

.model-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-3);
  padding: var(--space-2);
}

/* Responsive Design */

@media (max-width: 768px) {
  .model-selection-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .model-selection-card {
    padding: var(--space-3);
  }

  .batch-step-content {
    padding: var(--space-4);
    min-height: auto;
  }

  .inline-job-steps {
    flex-direction: column;
    gap: var(--space-2);
  }

  .inline-job-step {
    flex-direction: row;
    justify-content: flex-start;
    padding: var(--space-2);
  }

  .batch-submission-progress,
  .batch-submission-success {
    min-width: 90%;
    margin: 0 5%;
  }
}

.model-selection-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  z-index: 1;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.model-selection-card:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent-light);
  background: var(--color-bg-secondary);
  pointer-events: auto;
}

.model-selection-card.selected {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-accent);
  background: var(--color-bg-elevated);
  pointer-events: auto;
}

/* Ensure selection works for both inline forms and batch form */

.model-selection-card[style*="cursor: pointer"].selected,
.model-selection-card.selected {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Fix for disabled model cards */

.model-selection-card.disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Ensure proper z-index for model selection */

.model-selection-grid {
  position: relative;
  z-index: 1;
}

.model-selection-card.selected {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-accent);
  background: var(--color-bg-elevated);
}

.model-selection-card.selected::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  padding: 4px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  z-index: -1;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.8;
  }
}

/* Model Card Content Styling */

.model-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.model-card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--color-text-secondary);
}

.model-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.model-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.model-card-description {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 0;
}

.model-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.model-card-cost {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent);
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 8px;
  border-radius: 9999px;
}

/* Fix for regular job form model selection that uses inline styles */

.model-selection-card[style*="cursor: pointer"].selected {
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.3), 0 12px 24px -4px rgba(0, 0, 0, 0.2) !important;
  transform: translateY(-6px) scale(1.05) !important;
  outline: 3px solid var(--color-accent) !important;
  outline-offset: 2px !important;
  border: 2px solid var(--color-accent) !important;
}

/* Ensure model selection cards are clickable */

.model-selection-card:not(.disabled) {
  cursor: pointer !important;
}

.model-selection-card:not(.disabled):hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 12px 24px -4px rgba(0,0,0,0.2), 0 8px 16px -4px rgba(0,0,0,0.1) !important;
}

.model-card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary);
  border-radius: 3px;
  color: var(--color-text-muted);
}

.model-selection-card.selected .model-card-icon {
  background: var(--color-accent);
  color: white;
}

.model-card-content {
  flex: 1;
  min-width: 0;
}

.model-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.model-card-description {
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.model-card-cost {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-muted);
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  margin-top: var(--space-1);
  display: inline-block;
}

/* Job review */

.job-review-summary {
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  padding: var(--space-3);
}

.review-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
}

.review-item:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.review-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.review-value {
  font-size: var(--text-sm);
  font-weight: 500;
}

.job-cost-estimate {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  margin-top: var(--space-3);
}

.cost-estimate-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-muted);
  border-radius: 3px;
  color: var(--color-accent);
}

.cost-estimate-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.cost-estimate-value {
  font-weight: 600;
  color: var(--color-accent);
}

/* Form range */

.form-range {
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: var(--color-bg-tertiary);
  -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid var(--color-bg-secondary);
  -webkit-transition: all 0.2s ease;
  transition: all 0.2s ease;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
}

.form-range:hover::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.form-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid var(--color-bg-secondary);
  -moz-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.form-range:hover::-moz-range-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

/* Form validation */

.form-validation {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: 3px;
}

.form-validation.error {
  background: var(--color-error-muted);
  color: var(--color-error);
}

.form-validation.warning {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

.form-validation.good {
  background: var(--color-success-muted);
  color: var(--color-success);
}

/* Text warning */

.text-warning {
  color: var(--color-warning);
}

/* Skeleton */

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-bg-elevated) 50%, var(--color-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Quick action FAB */

.quick-action-fab {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 100;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

/* Hide FAB when modal is active or inline form is present to prevent overlay */

.modal-overlay.active ~ .quick-action-fab,
body:has(.modal-overlay.active) .quick-action-fab,
body:has(.inline-job-form) .quick-action-fab {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.quick-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: var(--color-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-fast);
}

.quick-action-btn:hover {
  background: var(--color-accent-dark);
  transform: scale(1.08);
}

.quick-action-menu {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  min-width: 160px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
}

.quick-action-fab.open .quick-action-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.quick-action-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 4px;
}

.quick-action-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

/* Job cards - Enhanced with status colors */

.job-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

/* Status-based left border accent */

.job-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-border);
  transition: all var(--transition-base);
}

.job-card.status-queued::before,
.job-card.status-pending::before {
  background: linear-gradient(180deg, var(--color-warning), transparent);
}

.job-card.status-running::before {
  background: linear-gradient(180deg, var(--color-info), transparent);
  animation: border-glow 2s ease-in-out infinite;
}

.job-card.status-processing::before {
  background: linear-gradient(180deg, var(--color-accent), transparent);
  animation: border-glow 2s ease-in-out infinite;
}

.job-card.status-completed::before {
  background: linear-gradient(180deg, var(--color-success), transparent);
}

.job-card.status-failed::before {
  background: linear-gradient(180deg, var(--color-error), transparent);
}

@keyframes border-glow {
  0%, 100% {
    opacity: 1;
    filter: brightness(1);
  }

  50% {
    opacity: 0.7;
    filter: brightness(1.3);
  }
}

.job-card:hover {
  border-color: var(--color-border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Status-based glow effects for jobs */

.job-card.status-queued:hover,
.job-card.status-pending:hover {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3), 0 0 40px rgba(245, 158, 11, 0.15);
}

.job-card.status-running:hover,
.job-card.status-processing:hover {
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35), 0 0 40px rgba(6, 182, 212, 0.2);
}

.job-card.status-completed:hover {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3), 0 0 40px rgba(16, 185, 129, 0.15);
}

.job-card.status-failed:hover {
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3), 0 0 40px rgba(239, 68, 68, 0.15);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.job-card-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  transition: color var(--transition-fast);
}

.job-card:hover .job-card-title {
  color: var(--color-accent-light);
}

.job-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.job-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.job-card-actions {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

/* Job card with status indicator badge */

.job-card-status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
}

.job-card-status-indicator svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
}

.job-card.status-running .job-card-status-indicator,
.job-card.status-processing .job-card-status-indicator {
  background: var(--color-info-muted);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.job-card.status-running .job-card-status-indicator svg,
.job-card.status-processing .job-card-status-indicator svg {
  color: var(--color-info);
  animation: spin 2s linear infinite;
}

/* Activity feed */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.activity-item {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: 4px;
}

.activity-item:hover {
  background: var(--color-bg-tertiary);
}

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-icon.upload {
  background: var(--color-accent-muted);
  color: var(--color-accent);
}

.activity-icon.job {
  background: var(--color-success-muted);
  color: var(--color-success);
}

.activity-icon.member {
  background: var(--color-info-muted);
  color: var(--color-info);
}

.activity-text {
  font-size: var(--text-sm);
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Tabs v2 - Refined Pill Style */

.tabs-v2 {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.tab-v2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: calc(var(--radius-lg) - 2px);
  background: transparent;
  border: none;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.tab-v2:hover {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.tab-v2:active {
  transform: scale(0.99);
}

.tab-v2.active {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.tab-v2-icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.tab-v2:hover .tab-v2-icon {
  opacity: 0.7;
}

.tab-v2.active .tab-v2-icon {
  opacity: 0.9;
  color: var(--color-accent);
}

.tab-v2-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.tab-v2.active .tab-v2-count {
  background: rgba(13, 150, 105, 0.12);
  color: var(--color-accent-light);
}

/* Tabs v2 - Status Filter Variant */

.tabs-v2#status-filter .tab-v2[data-status="running"].active {
  background: rgba(59, 130, 246, 0.15);
}

.tabs-v2#status-filter .tab-v2[data-status="running"].active .tab-v2-count {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.tabs-v2#status-filter .tab-v2[data-status="completed"].active {
  background: rgba(16, 185, 129, 0.15);
}

.tabs-v2#status-filter .tab-v2[data-status="completed"].active .tab-v2-count {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.tabs-v2#status-filter .tab-v2[data-status="failed"].active {
  background: rgba(239, 68, 68, 0.15);
}

.tabs-v2#status-filter .tab-v2[data-status="failed"].active .tab-v2-count {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Modal sizes */

.modal-large {
  max-width: 640px;
}

.modal-small {
  max-width: 360px;
}

/* Job details */

.job-details-modal {
  padding: var(--space-2);
}

.job-details-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.job-details-section {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.job-details-section:first-of-type {
  margin-top: 0;
}

.job-details-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.job-details-section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--color-accent);
  border-radius: 2px;
}

.job-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.job-details-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

.job-details-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.job-details-value {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: 500;
  word-break: break-word;
}

.job-details-value.job-id-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.job-details-sequence {
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  padding: var(--space-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
}

.job-details-sequence code {
  color: var(--color-text-secondary);
}

.job-details-sequence .sequence-length {
  display: block;
  margin-top: var(--space-2);
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: inherit;
}

.job-details-params {
  display: grid;
  gap: var(--space-2);
}

.job-details-param {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

.job-details-param .param-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-transform: capitalize;
}

.job-details-param .param-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.job-details-artifacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.job-details-artifact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.job-details-artifact:hover {
  border-color: var(--color-border);
  background: var(--color-bg-hover);
}

.job-details-artifact .artifact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.job-details-artifact .artifact-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-details-artifact .artifact-size {
  font-size: 11px;
  color: var(--color-text-muted);
}

.job-details-artifact .artifact-download-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.job-details-artifact .artifact-download-btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
}

.job-details-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.job-details-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

.job-details-metric .metric-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.job-details-metric .metric-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.job-details-message {
  padding: var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.job-details-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.job-details-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* Workspace */

.workspace-container {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-4);
}

.workspace-sidebar {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.workspace-sidebar-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: var(--text-sm);
}

.workspace-sidebar-content {
  padding: var(--space-2);
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .workspace-container {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    display: none;
  }
}

/* Project list view */

.project-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.project-list-item:hover {
  border-color: var(--color-border-light);
  transform: translateY(-2px);
}

.project-list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--color-accent-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.project-list-item-content {
  flex: 1;
  min-width: 0;
}

.project-list-item-title {
  font-weight: 600;
  font-size: var(--text-sm);
}

.project-list-item-description {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Input type selector */

.input-type-selector {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  margin-bottom: var(--space-3);
}

.input-type-btn {
  flex: 1;
  padding: var(--space-2);
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.input-type-btn:hover:not(.active) {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.input-type-btn.active {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* ========================================
   ANIMATIONS & UTILITIES
   ======================================== */

/* Spin animation */

.spin {
  animation: spin 1s linear infinite;
}

/* Loading skeleton */

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-bg-hover) 50%, var(--color-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 3px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Fade in animation */

.fade-in {
  animation: fade-in 0.3s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left */

.slide-in-left {
  animation: slide-in-left 0.3s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in animation */

.scale-in {
  animation: scale-in 0.2s ease-out;
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Bounce animation */

.bounce {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Glow effect on focus/active */

.glow-accent {
  box-shadow: 0 0 20px var(--color-accent-glow);
}

/* Interactive ripple effect base */

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s, opacity 0.4s;
  opacity: 0;
}

.ripple:active::after {
  width: 200px;
  height: 200px;
  opacity: 0;
}

/* ========================================
   JOB DETAIL SIDEBAR
   ======================================== */

.job-sidebar {
  position: fixed;
  top: 0;
  right: -560px;
  width: 560px;
  height: 100vh;
  background: var(--color-bg-primary);
  border-left: 1px solid var(--color-border);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.job-sidebar.open {
  right: 0;
}

.job-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.job-sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.job-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

.job-sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 50px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-sidebar-title svg {
  flex-shrink: 0;
  color: var(--color-accent);
}

.job-sidebar-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.job-sidebar-close:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
  transform: scale(1.05);
}

.job-sidebar-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}

.job-sidebar-section {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.job-sidebar-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.job-sidebar-info-grid {
  display: grid;
  gap: var(--space-3);
}

.job-sidebar-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-sidebar-info-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.job-sidebar-info-value {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: 500;
}

.job-sidebar-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  position: sticky;
  bottom: 0;
}

@media (max-width: 768px) {
  .job-sidebar {
    width: 100%;
    right: -100%;
  }
}

/* Animated Background for Auth Pages */

.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 500px;
  height: 500px;
  top: -200px;
  left: -200px;
  background: var(--color-primary);
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 400px;
  height: 400px;
  top: 50%;
  right: -150px;
  background: var(--color-accent);
  animation-delay: 5s;
}

.bg-orb-3 {
  width: 350px;
  height: 350px;
  bottom: -150px;
  left: 20%;
  background: var(--color-primary);
  animation-delay: 10s;
}

.bg-orb-4 {
  width: 450px;
  height: 450px;
  top: 20%;
  right: 30%;
  background: var(--color-accent);
  animation-delay: 15s;
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.1;
  animation: grid-flow 30s linear infinite;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

@keyframes grid-flow {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(50px, 50px);
  }
}

/* Ensure auth container is above background */

.auth-container {
  position: relative;
  z-index: 1;
}

/* ========================================
   QUALITY OF LIFE ENHANCEMENTS
   ======================================== */

/* Loading States for Buttons */

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.btn-loading .btn-text {
  opacity: 0;
}

/* Form Validation States */

.form-group {
  position: relative;
  margin-bottom: var(--space-4);
}

.form-input.is-invalid,
.form-textarea.is-invalid,
.form-select.is-invalid {
  border-color: var(--color-error);
  background-color: var(--color-error-muted);
}

.form-input.is-invalid:focus,
.form-textarea.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.is-valid,
.form-textarea.is-valid,
.form-select.is-valid {
  border-color: var(--color-success);
}

.form-input.is-valid:focus,
.form-textarea.is-valid:focus,
.form-select.is-valid:focus {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-error {
  display: none;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-error);
  line-height: 1.4;
}

.form-error.is-visible {
  display: block;
}

.form-help {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Field-level validation icons */

.form-group.has-validation {
  position: relative;
}

.form-group.has-validation .form-input,
.form-group.has-validation .form-textarea {
  padding-right: 2.5rem;
}

.form-validation-icon {
  position: absolute;
  right: var(--space-3);
  top: 2.25rem;
  width: 18px;
  height: 18px;
  display: none;
}

.form-group.is-valid .form-validation-icon.icon-valid,
.form-group.is-invalid .form-validation-icon.icon-invalid {
  display: block;
}

.icon-valid {
  color: var(--color-success);
}

.icon-invalid {
  color: var(--color-error);
}

/* Empty States */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  min-height: 320px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
  color: var(--color-text-muted);
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  max-width: 420px;
  line-height: 1.6;
}

.empty-state-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* Error Recovery Messages */

.error-message {
  padding: var(--space-4);
  background: var(--color-error-muted);
  border: 1px solid var(--color-error);
  border-radius: 4px;
  margin-bottom: var(--space-4);
}

.error-message-title {
  font-weight: 600;
  color: var(--color-error);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.error-message-description {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.error-message-suggestion {
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-elevated);
  border-radius: 3px;
  border-left: 2px solid var(--color-error);
}

.error-message-actions {
  margin-top: var(--space-3);
  display: flex;
  gap: var(--space-2);
}

/* Retry Button */

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-retry:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
}

.btn-retry:active {
  transform: translateY(1px);
}

/* Inline Spinner for Loading States */

.spinner-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

/* Progress Indicators */

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}

.progress-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.progress-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  transition: all var(--transition-base);
}

.progress-step.is-active .progress-step-circle {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  box-shadow: 0 0 0 4px var(--color-accent-muted);
}

.progress-step.is-completed .progress-step-circle {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.progress-step-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

.progress-step.is-active .progress-step-label {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Tooltip for Inline Help */

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  font-size: 11px;
  cursor: help;
  margin-left: var(--space-1);
}

.tooltip:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--color-border);
}

/* Loading Overlay for Forms */

.form-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.7);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

.form-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

/* Toast Animations */

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Inline Editing */

.inline-edit {
  position: relative;
  display: inline-block;
}

.inline-edit-trigger {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background var(--transition-fast);
}

.inline-edit-trigger:hover {
  background: var(--color-bg-hover);
}

.inline-edit-input {
  padding: 4px 8px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-accent);
  border-radius: 3px;
  color: var(--color-text-primary);
  font-size: inherit;
  font-family: inherit;
  min-width: 200px;
}

.inline-edit-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
}

/* Copy Button */

.copy-btn {
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.copy-btn-container:hover .copy-btn {
  opacity: 1;
}

/* Quick Filter Chips */

.filter-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.filter-chip:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
}

.filter-chip.active {
  background: var(--color-accent-muted);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-bg-hover);
  margin-left: var(--space-1);
  transition: background var(--transition-fast);
}

.filter-chip-remove:hover {
  background: var(--color-error);
  color: white;
}

/* Kbd styling for keyboard shortcuts */

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* Pulse animation for status indicators */

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

  50% {
    opacity: 0.5;
  }
}

/* Drag and Drop Overlay */

.drag-drop-active {
  background: var(--color-accent-muted);
  border: 2px dashed var(--color-accent);
}

/* Confirmation Dialog Styles */

.confirm-dialog-danger .modal-footer .btn-primary {
  background: var(--color-error);
  border-color: var(--color-error);
}

.confirm-dialog-danger .modal-footer .btn-primary:hover {
  background: #dc2626;
}

/* ========================================
   DYNAMIC ANIMATIONS & MICRO-INTERACTIONS
   ======================================== */

/* Page Transitions */

.view-transition-enter {
  animation: fadeInUp 0.4s ease-out;
}

.view-transition-exit {
  animation: fadeOut 0.2s ease-in;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Skeleton Loading */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-tertiary) 0%,
    var(--color-bg-hover) 50%,
    var(--color-bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 3px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: 4px;
}

/* Enhanced Hover Effects */

.card,
.btn,
.nav-item,
.table tr,
.project-card {
  transition: all var(--transition-base);
}

.card.clickable:hover, a.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-glow:hover {
  box-shadow: 0 0 20px var(--color-accent-glow);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Ripple Effect */

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
  transition: width 0s, height 0s;
}

/* Scroll Reveal Animations */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger Animation */

.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerIn 0.5s ease forwards;
}

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-item:nth-child(1) {
  animation-delay: 0.05s;
}

.stagger-item:nth-child(2) {
  animation-delay: 0.1s;
}

.stagger-item:nth-child(3) {
  animation-delay: 0.15s;
}

.stagger-item:nth-child(4) {
  animation-delay: 0.2s;
}

.stagger-item:nth-child(5) {
  animation-delay: 0.25s;
}

.stagger-item:nth-child(6) {
  animation-delay: 0.3s;
}

.stagger-item:nth-child(7) {
  animation-delay: 0.35s;
}

.stagger-item:nth-child(8) {
  animation-delay: 0.4s;
}

.stagger-item:nth-child(9) {
  animation-delay: 0.45s;
}

.stagger-item:nth-child(10) {
  animation-delay: 0.5s;
}

/* Animated Counter */

.counter {
  font-variant-numeric: tabular-nums;
  transition: all 0.3s ease;
}

.counter.counting {
  transform: scale(1.1);
  color: var(--color-accent);
}

/* Progress Bar Animations */

.progress-bar {
  position: relative;
  height: 4px;
  background: var(--color-bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 9999px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Live Status Indicators */

.status-live {
  position: relative;
}

.status-live::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Bounce Animation */

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.bounce {
  animation: bounce 2s ease-in-out infinite;
}

/* Shake Animation */

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }

  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }

  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Glow Pulse */

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px var(--color-accent-glow);
  }

  50% {
    box-shadow: 0 0 20px var(--color-accent-glow);
  }
}

.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

/* Flip Animation */

@keyframes flip {
  0% {
    transform: perspective(400px) rotateY(0);
  }

  100% {
    transform: perspective(400px) rotateY(360deg);
  }
}

.flip {
  animation: flip 0.6s ease;
}

/* Slide In Animations */

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Card Tilt Effect */

.card-tilt {
  transition: transform 0.1s ease;
}

.card-tilt:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
}

/* Glassmorphism */

.glass {
  background: rgba(18, 18, 21, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text */

.gradient-text {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Interactive Button Effects */

.btn-interactive {
  position: relative;
  overflow: hidden;
}

.btn-interactive::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.btn-interactive:hover::before {
  width: 300%;
  height: 300%;
}

/* Notification Badge Pulse */

.badge-pulse {
  animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Smooth Transitions */

* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Dots */

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: loadingDots 1.4s infinite;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loadingDots {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hover Border Animation */

.hover-border {
  position: relative;
}

.hover-border::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.hover-border:hover::after {
  width: 100%;
}

/* Scale on Interaction */

.scale-interaction {
  transition: transform 0.2s ease;
}

.scale-interaction:active {
  transform: scale(0.95);
}

/* Floating Animation */

@keyframes floating {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.floating {
  animation: floating 3s ease-in-out infinite;
}

/* Rotate on Hover */

.rotate-hover {
  transition: transform 0.3s ease;
}

.rotate-hover:hover {
  transform: rotate(5deg);
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */

/* Language Switcher - Default (Header) - Subtle Design */

.language-switcher {
  display: flex;
  gap: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 2px;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.language-switcher:hover {
  opacity: 1;
  border-color: var(--color-border);
}

.language-switcher .lang-toggle {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: calc(4px - 2px);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.language-switcher .lang-toggle:hover {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.language-switcher .lang-toggle.active {
  color: var(--color-text-primary);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: none;
}

.language-switcher .lang-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Language Switcher - Auth Pages */

.language-switcher-auth {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  opacity: 0.5;
}

.language-switcher-auth:hover {
  opacity: 1;
}

/* Language Switcher - Sidebar */

.language-switcher-sidebar {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.language-switcher-sidebar .lang-toggle {
  padding: 8px 16px;
  font-size: var(--text-sm);
}

/* Mobile Responsive */

@media (max-width: 768px) {
  .language-switcher {
    padding: 2px;
  }

  .language-switcher .lang-toggle {
    padding: 5px 10px;
    font-size: 11px;
  }

  .language-switcher-auth {
    top: 15px;
    right: 15px;
  }
}

/* Language Switcher Animation */

.language-switcher .lang-toggle {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Activity Timeline */

.activity-timeline {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.2s ease;
}

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

.activity-item:hover {
  background: var(--color-bg-secondary);
}

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

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

.activity-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.activity-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* File Chip */

.file-chip {
  transition: all 0.2s ease;
}

.file-chip:hover {
  background: var(--color-bg-tertiary) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-icon-sm {
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.btn-icon-sm:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Job Output Group */

.job-output-group {
  transition: background 0.2s ease;
}

.job-output-group:hover {
  background: var(--color-bg-secondary);
}

.job-output-group:last-child {
  border-bottom: none !important;
}

/* Stats Grid */

.stats-grid > div {
  transition: all 0.2s ease;
}

.stats-grid > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ========================================
   ENHANCED DASHBOARD UI v2
   ======================================== */

/* Dashboard Stat Cards - Enhanced */

.dashboard-stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dashboard-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent, var(--color-accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dashboard-stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.dashboard-stat-card:hover::before {
  opacity: 1;
}

.dashboard-stat-card.stat-primary {
  --stat-accent: var(--color-accent);
}

.dashboard-stat-card.stat-success {
  --stat-accent: var(--color-success);
}

.dashboard-stat-card.stat-warning {
  --stat-accent: var(--color-warning);
}

.dashboard-stat-card.stat-info {
  --stat-accent: var(--color-info);
}

.dashboard-stat-card.stat-purple {
  --stat-accent: #a855f7;
}

.dashboard-stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.dashboard-stat-card:hover .stat-icon {
  transform: scale(1.1);
}

.dashboard-stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.dashboard-stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.dashboard-stat-card .stat-trend {
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-top: 8px;
}

.dashboard-stat-card .stat-trend.up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.dashboard-stat-card .stat-trend.down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

/* Quick Action Cards - Enhanced */

.quick-action-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.quick-action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--action-color, var(--color-accent)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quick-action-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 32px -8px var(--action-shadow, rgba(99, 102, 241, 0.25));
}

.quick-action-card:hover::before {
  opacity: 0.08;
}

.quick-action-card:active {
  transform: translateY(-2px) scale(1);
}

.quick-action-card .action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.quick-action-card:hover .action-icon {
  transform: scale(1.1) rotate(-3deg);
}

.quick-action-card .action-content {
  position: relative;
  z-index: 1;
}

.quick-action-card .action-title {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.quick-action-card .action-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Quick action color variants */

.quick-action-card.action-blue {
  --action-color: #3b82f6;
  --action-shadow: rgba(59, 130, 246, 0.35);
}

.quick-action-card.action-green {
  --action-color: #10b981;
  --action-shadow: rgba(16, 185, 129, 0.35);
}

.quick-action-card.action-cyan {
  --action-color: #06b6d4;
  --action-shadow: rgba(6, 182, 212, 0.35);
}

.quick-action-card.action-orange {
  --action-color: #f59e0b;
  --action-shadow: rgba(245, 158, 11, 0.35);
}

/* Usage Analytics Cards */

.usage-stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all 0.3s ease;
  position: relative;
}

.usage-stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-4);
  right: var(--space-4);
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--usage-accent, var(--color-accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.usage-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.usage-stat-card:hover::after {
  opacity: 1;
}

.usage-stat-card.usage-events {
  --usage-accent: var(--color-accent);
}

.usage-stat-card.usage-credits {
  --usage-accent: var(--color-success);
}

.usage-stat-card.usage-compute {
  --usage-accent: #a855f7;
}

.usage-stat-card.usage-daily {
  --usage-accent: var(--color-warning);
}

.usage-stat-card .usage-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.usage-stat-card .usage-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.usage-stat-card .usage-value {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.usage-stat-card .usage-subtext {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* Usage Chart Cards */

.usage-chart-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.usage-chart-card .chart-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.usage-chart-card .chart-title {
  font-size: var(--text-base);
  font-weight: 600;
}

.usage-chart-card .chart-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.usage-chart-card .chart-body {
  padding: var(--space-4);
}

/* Model Table Enhanced */

.model-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.model-table th {
  background: var(--color-bg-tertiary);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.model-table th:first-child {
  border-radius: 4px 0 0 0;
}

.model-table th:last-child {
  border-radius: 0 4px 0 0;
}

.model-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.2s ease;
}

.model-table tbody tr:hover td {
  background: var(--color-bg-tertiary);
}

.model-table tbody tr:last-child td {
  border-bottom: none;
}

.model-table .model-name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.model-table .model-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.model-table .model-bar {
  height: 8px;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  flex: 1;
}

.model-table .model-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.model-table .model-percent {
  font-size: var(--text-sm);
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

/* Time Range Selector */

.time-range-selector {
  display: flex;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  padding: 3px;
  gap: 3px;
}

.time-range-selector .range-btn {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-range-selector .range-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.time-range-selector .range-btn.active {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Model Uptime Status Board */

.model-uptime-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.model-uptime-card .model-uptime-header {
  align-items: flex-start;
}

.model-uptime-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-uptime-overview {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.model-uptime-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(19, 124, 189, 0.16);
  border: 1px solid rgba(19, 124, 189, 0.34);
  color: #7fc8ff;
  font-size: var(--text-xs);
  font-weight: 600;
}

.model-uptime-window {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.model-uptime-list {
  padding: 0 var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.model-uptime-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.model-uptime-toggle:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-light);
  background: var(--color-bg-hover);
}

.model-uptime-toggle-icon {
  transition: transform 0.2s ease;
}

.model-uptime-card.collapsed .model-uptime-list {
  display: none;
}

.model-uptime-card.collapsed .model-uptime-toggle-icon {
  transform: rotate(-90deg);
}

.model-uptime-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
}

.model-uptime-row.is-operational {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
}

.model-uptime-row.is-inoperable {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
}

.model-uptime-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.model-uptime-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.model-uptime-row.is-operational .model-uptime-dot {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
}

.model-uptime-row.is-inoperable .model-uptime-dot {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.model-uptime-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.model-uptime-state {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.model-uptime-right {
  text-align: right;
  flex-shrink: 0;
}

.model-uptime-percent {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.1;
}

.model-uptime-label {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-top: 2px;
}

@media (max-width: 768px) {
  .model-uptime-card .model-uptime-header {
    flex-direction: column;
    gap: 8px;
  }

  .model-uptime-overview {
    align-items: flex-start;
  }

  .model-uptime-controls {
    width: 100%;
    justify-content: space-between;
  }

  .model-uptime-row {
    padding: 10px 12px;
  }

  .model-uptime-percent {
    font-size: var(--text-sm);
  }
}

/* Worker Status Card Enhanced */

.worker-status-card {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all 0.3s ease;
}

.worker-status-card.status-online {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.worker-status-card.status-busy {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.worker-status-card .status-indicator {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 2s ease-in-out infinite;
}

.worker-status-card.status-online .status-indicator {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.worker-status-card.status-busy .status-indicator {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 currentColor;
  }

  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

.worker-status-card .status-text h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 2px;
}

.worker-status-card .status-text p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Dashboard V2 - Clean Layout */

.dashboard-v2 {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.dash-greeting {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.dash-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

.dash-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--color-bg-tertiary);
}

.dash-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.dash-status.online .status-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.dash-status.busy .status-dot {
  background: var(--color-warning);
}

.dash-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-width: 100px;
  flex: 1;
}

.dash-stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.dash-stat-value.accent {
  color: var(--color-success);
}

.dash-stat.running {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.dash-stat.running .dash-stat-value {
  color: var(--color-warning);
}

.dash-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.dash-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dash-action:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-hover);
}

.dash-action svg {
  color: var(--color-text-muted);
}

.dash-invitations {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
}

.invite-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.invite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
}

.invite-project {
  font-weight: 500;
  color: var(--color-text-primary);
}

.invite-from {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex: 1;
}

.invite-actions {
  display: flex;
  gap: 6px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

@media (max-width: 1024px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.dash-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .dash-charts {
    grid-template-columns: 1fr;
  }
}

.dash-chart-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
}

.chart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.chart-title span {
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 6px;
}

.chart-container {
  height: 180px;
  position: relative;
}

.dash-section {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.section-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.section-content {
  padding: 0;
}

.dash-usage-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  padding: 16px;
}

.usage-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.usage-item {
  display: flex;
  flex-direction: column;
}

.usage-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.usage-lbl {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Recent Items List Enhanced */

.recent-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.recent-item:hover {
  background: var(--color-bg-tertiary);
  transform: translateX(4px);
}

.recent-item .item-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recent-item .item-info {
  flex: 1;
  min-width: 0;
}

.recent-item .item-name {
  font-weight: 500;
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item .item-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.recent-item .item-status {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Dashboard Section Headers */

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.dashboard-section-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
}

.dashboard-section-header .section-actions {
  display: flex;
  gap: var(--space-2);
}

/* Empty State Enhanced */

.empty-state-card {
  padding: var(--space-8);
  text-align: center;
  background: var(--color-bg-secondary);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-state-card .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.empty-state-card h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state-card p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* Skeleton Loading Animation */

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-bg-hover) 50%, var(--color-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 3px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-chart {
  height: 200px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

/* ========================================
   DASHBOARD V3 - MODERN REDESIGN
   ======================================== */

.dashboard-v3 {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 4px;
}

/* Hero Header Section - Premium Glass Design with Image Morph */

.dash-hero {
  background: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
}

/* Hero background image on right with gradient fade */

.dash-hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dash-hero-bg img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 70%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: center;
     object-position: center;
}

/* Gradient overlay - green on left fading to transparent on right */

.dash-hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right,
    #059669 0%,
    #059669 30%,
    rgba(5, 150, 105, 0.8) 40%,
    rgba(5, 150, 105, 0.4) 50%,
    transparent 60%);
  z-index: 1;
}

.dash-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(16, 185, 129, 0.4) 20%,
    rgba(52, 211, 153, 0.5) 50%,
    rgba(16, 185, 129, 0.4) 80%,
    transparent 100%);
  z-index: 2;
}

.dash-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.dash-hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 5;
  gap: 24px;
}

.dash-hero-text {
  flex: 1;
  max-width: 60%;
}

.dash-hero-greeting {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 0%, #34D399 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-hero-subtitle {
  font-size: 0.925rem;
  color: var(--color-text-secondary);
  margin: 8px 0 0;
  letter-spacing: 0.01em;
}

.dash-hero-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-system-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dash-system-status:hover {
  background: rgba(0, 0, 0, 0.35);
}

.dash-system-status .status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  position: relative;
}

.dash-system-status.online .status-pulse {
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
  animation: pulse-glow 2s infinite;
}

.dash-system-status.online .status-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: pulse-ring 2s infinite;
}

.dash-system-status.busy .status-pulse {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  animation: pulse-glow 1.2s infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.15);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.dash-plan-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 24px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #c4b5fd;
  transition: all 0.2s ease;
}

.dash-plan-badge:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.15));
  border-color: rgba(139, 92, 246, 0.35);
}

/* Stats Grid - Enhanced Cards */

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1024px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .dash-stats-grid {
    grid-template-columns: 1fr;
  }
}

.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(145deg, var(--color-bg-secondary) 0%, rgba(30, 30, 36, 0.8) 100%);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--stat-accent-bg, rgba(139, 92, 246, 0.03)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dash-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--stat-accent, rgba(139, 92, 246, 0.4)), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dash-stat-card:hover {
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 30px var(--stat-glow, rgba(139, 92, 246, 0.08));
}

.dash-stat-card:hover::before {
  opacity: 1;
}

.dash-stat-card:hover::after {
  opacity: 1;
}

.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.dash-stat-card:hover .stat-card-icon {
  transform: scale(1.08) rotate(-2deg);
}

/* Stat card color variants */

.stat-card-icon.violet {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.08));
  color: #a78bfa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card-icon.violet ~ * {
  --stat-accent: rgba(139, 92, 246, 0.5);
  --stat-accent-bg: rgba(139, 92, 246, 0.06);
  --stat-glow: rgba(139, 92, 246, 0.12);
}

.stat-card-icon.teal {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.08));
  color: #2dd4bf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card-icon.teal ~ * {
  --stat-accent: rgba(20, 184, 166, 0.5);
  --stat-accent-bg: rgba(20, 184, 166, 0.06);
  --stat-glow: rgba(20, 184, 166, 0.12);
}

.stat-card-icon.amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
  color: #fbbf24;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card-icon.amber ~ * {
  --stat-accent: rgba(245, 158, 11, 0.5);
  --stat-accent-bg: rgba(245, 158, 11, 0.06);
  --stat-glow: rgba(245, 158, 11, 0.12);
}

.stat-card-icon.sky {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.08));
  color: #38bdf8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card-icon.sky ~ * {
  --stat-accent: rgba(14, 165, 233, 0.5);
  --stat-accent-bg: rgba(14, 165, 233, 0.06);
  --stat-glow: rgba(14, 165, 233, 0.12);
}

/* Legacy color classes for compatibility */

.stat-card-icon.purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.08));
  color: #a855f7;
}

.stat-card-icon.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
  color: #3b82f6;
}

.stat-card-icon.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
  color: #10b981;
}

.stat-card-icon.cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.08));
  color: #06b6d4;
}

.stat-card-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.stat-card-value {
  display: block;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.stat-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 1;
}

.stat-card-badge.running {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.2);
  animation: badge-pulse 2s ease-in-out infinite;
}

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

  50% {
    opacity: 0.7;
  }
}

.stat-card-arrow {
  color: var(--color-text-muted);
  opacity: 0;
  transition: all 0.25s ease;
  transform: translateX(-6px);
  position: relative;
  z-index: 1;
}

.dash-stat-card:hover .stat-card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--color-text-secondary);
}

.stat-card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 22px 14px;
  z-index: 1;
}

.progress-bar-mini {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-mini .progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--progress-glow, rgba(14, 165, 233, 0.4));
}

/* Quick Actions - Refined Design */

.dash-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .dash-quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .dash-quick-actions {
    grid-template-columns: 1fr;
  }
}

.dash-quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.dash-quick-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dash-quick-action:hover {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.dash-quick-action:hover::before {
  opacity: 1;
}

.dash-quick-action:active {
  transform: translateY(-1px);
}

.dash-quick-action.primary {
  background: transparent;
  border: 2px solid rgba(16, 185, 129, 0.4);
}

.dash-quick-action.primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dash-quick-action.primary:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15), 0 0 20px rgba(16, 185, 129, 0.08);
}

.dash-quick-action.primary:hover::after {
  opacity: 1;
}

.dash-quick-action.primary .action-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
  color: #a78bfa;
}

.dash-quick-action.primary .action-title {
  color: var(--color-text-primary);
}

.dash-quick-action.primary .action-desc {
  color: var(--color-text-secondary);
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.dash-quick-action:hover .action-icon {
  transform: scale(1.08);
}

.action-icon.violet {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.08));
  color: #a78bfa;
}

.action-icon.teal {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.08));
  color: #2dd4bf;
}

.action-icon.sky {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.08));
  color: #38bdf8;
}

.action-icon.rose {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(244, 63, 94, 0.08));
  color: #fb7185;
}

.action-icon.purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.08));
  color: #a855f7;
}

.action-icon.cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.08));
  color: #22d3ee;
}

.action-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}

.action-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.action-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Invitations Alert */

.dash-invitations-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
}

.invite-alert-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
}

.invite-alert-content {
  flex: 1;
}

.invite-alert-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-primary);
}

.invite-alert-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.invite-alert-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invite-project-name {
  font-weight: 500;
  color: var(--color-accent-light);
  margin-right: 8px;
}

/* Main Grid Layout - Enhanced */

.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

@media (max-width: 1100px) {
  .dash-main-grid {
    grid-template-columns: 1fr;
  }
}

.dash-col-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-col-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Charts Row - Refined */

.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 800px) {
  .dash-charts-row {
    grid-template-columns: 1fr;
  }
}

.dash-chart-panel {
  background: linear-gradient(145deg, var(--color-bg-secondary) 0%, rgba(30, 30, 36, 0.8) 100%);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.25s ease;
}

.dash-chart-panel:hover {
  border-color: rgba(139, 92, 246, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.chart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.1);
}

.chart-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.chart-panel-title svg {
  color: #a78bfa;
}

.chart-panel-period {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.12);
  padding: 5px 12px;
  border-radius: 14px;
  font-weight: 500;
}

.chart-panel-body {
  padding: 18px;
  height: 200px;
}

/* Panel Component - Enhanced */

.dash-panel {
  background: linear-gradient(145deg, var(--color-bg-secondary) 0%, rgba(30, 30, 36, 0.8) 100%);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.25s ease;
}

.dash-panel:hover {
  border-color: rgba(139, 92, 246, 0.12);
}

.dash-panel.compact {
  background: linear-gradient(145deg, var(--color-bg-secondary) 0%, rgba(30, 30, 36, 0.8) 100%);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.1);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.panel-title svg {
  color: #a78bfa;
}

.panel-content {
  padding: 0;
}

/* Platform Ecosystem List */

.ecosystem-list {
  display: flex;
  flex-direction: column;
}

.ecosystem-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 0;
}

.ecosystem-item:hover {
  background: var(--color-bg-tertiary, rgba(255,255,255,0.04));
}

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

.ecosystem-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #e2e8f0);
}

.ecosystem-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
}

.ecosystem-status.active {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.ecosystem-chevron {
  color: var(--color-text-muted, #6b7280);
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.ecosystem-item:hover .ecosystem-chevron {
  opacity: 1;
}

/* Platform Status List */

.platform-status-list {
  display: flex;
  flex-direction: column;
}

.ps-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
  transition: background 0.15s ease;
}

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

.ps-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ps-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ps-indicator.ps-online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.ps-indicator.ps-offline {
  background: #4b5563;
}

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

.ps-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #e2e8f0);
}

.ps-desc {
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
}

.ps-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.ps-badge.ps-online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.ps-badge.ps-offline {
  background: rgba(75, 85, 99, 0.2);
  color: #6b7280;
}

/* Multi-Sequence Rows */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.multi-seq-row {
  animation: fadeIn 0.2s ease;
}

/* Multi-Job Group Styles */

.multijob-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.multijob-parent-row {
  background: var(--color-bg-secondary, rgba(255,255,255,0.02));
}

.multijob-parent-row:hover {
  background: var(--color-bg-tertiary, rgba(255,255,255,0.04));
}

.multijob-parent-row td:first-child .status-pill {
  min-width: 90px;
}

.multijob-child-row {
  background: var(--color-bg-primary, #0f0f1a);
  border-left: 2px solid rgba(167, 139, 250, 0.3);
  animation: fadeIn 0.15s ease;
}

.multijob-child-row:hover {
  background: var(--color-bg-tertiary, rgba(255,255,255,0.03));
}

.multijob-child-row td:first-child {
  padding-left: 32px;
}

.multijob-card {
  border: 1px solid rgba(167, 139, 250, 0.2);
  position: relative;
}

.multijob-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #a78bfa, #6366f1);
  border-radius: 12px 12px 0 0;
}

.multijob-child-card {
  animation: fadeIn 0.15s ease;
}

.multijob-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* Status pill for partial (mixed results) */

.status-pill.partial {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.status-pill.partial .status-pill-dot {
  background: #f97316;
  box-shadow: 0 0 4px rgba(249, 115, 22, 0.5);
}

/* Usage Summary Card - Premium Glass Effect */

.dash-usage-summary {
  background: linear-gradient(135deg,
    rgba(139, 92, 246, 0.1) 0%,
    rgba(168, 85, 247, 0.06) 50%,
    rgba(99, 102, 241, 0.04) 100%);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.dash-usage-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
}

.usage-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.usage-summary-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.usage-summary-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.usage-stat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.usage-stat-item:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateX(4px);
}

.usage-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.usage-stat-item:hover .usage-stat-icon {
  transform: scale(1.05);
}

.usage-stat-icon.teal {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(20, 184, 166, 0.08));
  color: #2dd4bf;
}

.usage-stat-icon.violet {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.08));
  color: #a78bfa;
}

.usage-stat-icon.amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
  color: #fbbf24;
}

.usage-stat-icon.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.08));
  color: #34d399;
}

.usage-stat-icon.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.08));
  color: #60a5fa;
}

.usage-stat-icon.purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.08));
  color: #c084fc;
}

.usage-stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.usage-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.usage-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Tips Card */

.dash-tips-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px 18px;
}

.tips-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 14px;
}

.tips-header svg {
  color: var(--color-accent);
}

.tips-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-item {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tip-item kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-light);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsiveness for Hero */

@media (max-width: 700px) {
  .dash-hero {
    padding: 20px;
  }

  .dash-hero-bg {
    width: 100%;
    opacity: 0.3;
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 100%);
  }

  .dash-hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .dash-hero-text {
    max-width: 100%;
  }

  .dash-hero-greeting {
    font-size: 1.4rem;
  }

  .dash-hero-status {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ========================================
   CUSTOM MODELS TAB STYLES
   ======================================== */

.model-card-enhanced {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.model-card-enhanced::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: all 0.3s ease;
}

.model-card-enhanced:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.model-card-enhanced:hover::before {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.model-card-enhanced .model-icon {
  transition: all 0.3s ease;
}

.model-card-enhanced:hover .model-icon {
  transform: scale(1.05);
}

.filter-btn {
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px);
}

/* ========================================
   SEARCH TAB ENHANCED STYLES
   ======================================== */

.search-main-layout {
  gap: var(--space-4);
}

.search-sidebar {
  transition: width 0.3s ease, opacity 0.3s ease;
}

.search-sidebar.hidden {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  overflow: hidden;
  padding: 0 !important;
  border: none !important;
}

.suggestion-chip {
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.suggestion-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.suggestion-chip:hover {
  color: white;
  border-color: #8b5cf6;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
}

.suggestion-chip:hover::before {
  opacity: 1;
}

.suggestion-chip svg,
.suggestion-chip span {
  position: relative;
  z-index: 1;
}

.db-quick-btn {
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.db-quick-btn:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.db-quick-btn[data-db="pdb"]:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.db-quick-btn[data-db="pubchem"]:hover {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.db-quick-btn[data-db="uniprot"]:hover {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.db-quick-btn[data-db="chembl"]:hover {
  background: #ec4899;
  border-color: #ec4899;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

/* Conversation item styles */

.conversation-item {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  margin-bottom: 6px;
}

.conversation-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.conversation-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-color: rgba(139, 92, 246, 0.3);
}

/* 3D Viewer panel styles */

.viewer-3d-panel {
  transition: all 0.3s ease;
}

.viewer-3d-panel.collapsed {
  width: 60px !important;
  min-width: 60px !important;
}

.viewer-btn {
  transition: all 0.2s ease;
}

.viewer-btn:hover {
  background: var(--color-accent) !important;
  color: white !important;
  border-color: var(--color-accent) !important;
  transform: translateY(-1px);
}

.viewer-btn-active {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
  color: white !important;
  border-color: #8b5cf6 !important;
}

/* AI Search input enhanced */

#ai-search-input {
  transition: all 0.25s ease;
}

#ai-search-input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

/* Search message animations */

.search-message {
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typing indicator */

.typing-indicator {
  display: flex;
  gap: 6px;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  width: -moz-fit-content;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b5cf6;
  animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* ========================================
   SEARCH TAB MOBILE STYLES
   ======================================== */

/* Mobile toggle buttons for sidebars */

.mobile-search-sidebar-toggle,
.mobile-viewer-toggle {
  display: none;
  position: fixed;
  z-index: 200;
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  align-items: center;
  justify-content: center;
}

.mobile-search-sidebar-toggle {
  bottom: 20px;
  left: 20px;
}

.mobile-viewer-toggle {
  bottom: 20px;
  right: 20px;
  background: #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.mobile-search-sidebar-toggle:hover,
.mobile-viewer-toggle:hover {
  transform: scale(1.05);
}

.mobile-search-sidebar-toggle svg,
.mobile-viewer-toggle svg {
  width: 20px;
  height: 20px;
}

/* Tablet - 1024px */

@media (max-width: 1024px) {
  .search-main-layout {
    flex-direction: column;
  }

  .search-sidebar,
  .viewer-3d-panel {
    position: fixed;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
  }

  .search-sidebar {
    left: 0;
    top: 0;
    bottom: 0;
    width: 300px !important;
    min-width: 300px !important;
    max-width: 85vw;
    transform: translateX(-100%);
    border-radius: 0;
  }

  .search-sidebar.mobile-open {
    transform: translateX(0);
  }

  .viewer-3d-panel {
    right: 0;
    top: 0;
    bottom: 0;
    width: 350px !important;
    min-width: 350px !important;
    max-width: 85vw;
    transform: translateX(100%);
    border-radius: 0;
  }

  .viewer-3d-panel.mobile-open {
    transform: translateX(0);
  }

  /* Main search container takes full width */

  .search-container,
  #search-main {
    width: 100%;
    border-radius: 0;
  }
}

/* Mobile - 768px */

@media (max-width: 768px) {
  /* Show mobile toggle buttons */

  .mobile-search-sidebar-toggle,
  .mobile-viewer-toggle {
    display: flex;
  }

  .search-sidebar,
  .viewer-3d-panel {
    width: 85vw !important;
    min-width: 85vw !important;
    max-width: 320px;
  }

  /* Search input adjustments */

  #ai-search-input {
    font-size: 16px !important;
    /* Prevents iOS zoom */
    min-height: 48px;
    padding: 14px 16px;
  }

  /* Welcome message adjustments */

  .welcome-message h2 {
    font-size: 1.5rem;
  }

  .welcome-message p {
    font-size: 0.875rem;
  }

  /* Suggestion chips scroll horizontally */

  .suggestion-chips-container,
  .suggestions-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    flex-wrap: nowrap !important;
  }

  .suggestion-chip {
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Database quick buttons */

  .db-quick-buttons {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .db-quick-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  /* Search messages */

  .search-message {
    padding: 12px;
    margin: 8px 0;
  }

  /* Conversation sidebar */

  .conversation-item {
    padding: 10px 12px;
  }

  /* View header mobile */

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .view-header .btn-group {
    width: 100%;
    display: flex;
    gap: var(--space-2);
  }

  .view-header .btn {
    flex: 1;
    justify-content: center;
  }
}

/* Small mobile - 480px */

@media (max-width: 480px) {
  .db-quick-buttons {
    grid-template-columns: 1fr !important;
  }

  .search-sidebar,
  .viewer-3d-panel {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw;
  }

  .mobile-search-sidebar-toggle,
  .mobile-viewer-toggle {
    width: 44px;
    height: 44px;
    bottom: 16px;
  }

  .mobile-search-sidebar-toggle {
    left: 16px;
  }

  .mobile-viewer-toggle {
    right: 16px;
  }

  .suggestion-chip {
    padding: 6px 12px;
    font-size: 11px;
  }
}

/* Safe area for notch devices */

@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-search-sidebar-toggle {
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: calc(20px + env(safe-area-inset-left));
  }

  .mobile-viewer-toggle {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
  }

  @media (max-width: 480px) {
    .mobile-search-sidebar-toggle {
      bottom: calc(16px + env(safe-area-inset-bottom));
      left: calc(16px + env(safe-area-inset-left));
    }

    .mobile-viewer-toggle {
      bottom: calc(16px + env(safe-area-inset-bottom));
      right: calc(16px + env(safe-area-inset-right));
    }
  }
}

/* ========================================
   ENHANCED VISIBILITY & ANIMATIONS
   ======================================== */

/* Global text visibility improvements */

.text-muted, .text-secondary {
  color: #a8a8b3 !important;
}

p, span, div {
  color: inherit;
}

/* Ensure white text on dark backgrounds */

.card, .stat-card, .model-card-enhanced {
  color: var(--color-text-primary);
}

.card-title, h1, h2, h3, h4, h5, h6 {
  color: #ffffff !important;
}

/* Enhanced card visibility */

.card {
  background: linear-gradient(145deg, #161619 0%, #121215 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glow effect on interactive elements */

.glow-on-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-on-hover:hover {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3), 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Pulse animation for important elements */

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
  }

  50% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), 0 0 30px rgba(16, 185, 129, 0.2);
  }
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Shimmer effect for loading states */

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(90deg,
    var(--color-bg-secondary) 25%,
    var(--color-bg-tertiary) 50%,
    var(--color-bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Gradient text effect */

.gradient-text {
  background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hover lift effect */

.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* Border glow animation */

@keyframes border-glow {
  0%, 100% {
    border-color: rgba(16, 185, 129, 0.3);
  }

  50% {
    border-color: rgba(16, 185, 129, 0.6);
  }
}

.border-glow {
  animation: border-glow 2s ease-in-out infinite;
}

/* Smooth fade in animation */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* Scale in animation */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

/* Focus ring for accessibility */

*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Enhanced badge visibility */

.badge {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-primary {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa !important;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Enhanced table visibility */

table {
  color: var(--color-text-primary);
}

th {
  color: #ffffff !important;
  font-weight: 600;
  background: var(--color-bg-tertiary);
}

td {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

tr:hover td {
  background: var(--color-bg-hover);
  color: #ffffff;
}

/* Nav item enhanced visibility */

.nav-item-label {
  color: #d4d4dc !important;
  font-weight: 500;
}

.nav-item:hover .nav-item-label {
  color: #ffffff !important;
}

.nav-item.active .nav-item-label {
  color: #ffffff !important;
  font-weight: 600;
}

/* Enhanced stats display */

.stat-value {
  color: #ffffff !important;
  font-weight: 700;
}

.stat-label {
  color: #a8a8b3 !important;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Better scrollbar visibility */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Modal overlay improvements */

.modal-overlay {
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

/* Tooltip styling */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: #1a1a1f;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Interactive highlight ring */

.highlight-ring {
  position: relative;
}

.highlight-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid transparent;
  background: linear-gradient(135deg, #10b981, #8b5cf6) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.highlight-ring:hover::after {
  opacity: 1;
}

/* Page transitions */

.view-container {
  animation: fadeInUp 0.4s ease-out;
}

/* Enhanced dropdown menus */

.dropdown-menu {
  background: linear-gradient(145deg, #1a1a1f 0%, #141418 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--color-bg-hover);
  color: #ffffff;
}

/* Loading spinner enhancement */

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Ripple effect for buttons */

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.5s;
}

.ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* ========================================
   ENHANCED UI/UX - MICRO-INTERACTIONS
   Visual feedback, animations, and polish
   ======================================== */

/* --- Enhanced Micro-Interaction Variables --- */

:root {
  /* Timing functions for natural motion */
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-snappy: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  /* Micro-animation durations */
  --duration-instant: 100ms;
  --duration-quick: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-enter: 200ms;
  --duration-exit: 150ms;
  /* Feedback colors with glow */
  --glow-success: 0 0 20px rgba(16, 185, 129, 0.4);
  --glow-error: 0 0 20px rgba(239, 68, 68, 0.4);
  --glow-warning: 0 0 20px rgba(245, 158, 11, 0.4);
  --glow-info: 0 0 20px rgba(59, 130, 246, 0.4);
  --glow-primary: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* --- Enhanced Button Loading States --- */

.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

.btn-loading.btn-primary::after,
.btn-loading.btn-success::after,
.btn-loading.btn-danger::after {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

.btn-loading.btn-secondary::after,
.btn-loading.btn-ghost::after {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-accent);
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Button with loading text */

.btn-loading-text {
  position: relative;
  pointer-events: none;
}

.btn-loading-text::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

.btn-loading-text > span:first-child {
  opacity: 0;
}

.btn-loading-text > .loading-label {
  position: absolute;
  left: 32px;
  right: 12px;
  text-align: left;
}

/* Button success/error flash feedback */

.btn-success-flash {
  animation: success-flash 0.6s var(--ease-smooth);
}

.btn-error-flash {
  animation: error-flash 0.6s var(--ease-smooth);
}

@keyframes success-flash {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  }

  50% {
    box-shadow: var(--glow-success), 0 4px 16px rgba(16, 185, 129, 0.5);
  }
}

@keyframes error-flash {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  }

  50% {
    box-shadow: var(--glow-error), 0 4px 16px rgba(239, 68, 68, 0.5);
  }
}

/* --- Enhanced Skeleton Loading --- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg,
    var(--color-bg-tertiary) 0%,
    var(--color-bg-elevated) 50%,
    var(--color-bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s ease-in-out infinite;
  border-radius: 3px;
}

@keyframes skeleton-wave {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Skeleton variants */

.skeleton-text {
  height: 1em;
  border-radius: 4px;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  border-radius: 4px;
  margin-bottom: 1em;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.skeleton-button {
  height: 36px;
  width: 100px;
  border-radius: 4px;
}

.skeleton-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
}

.skeleton-card .skeleton-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.skeleton-card .skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-chart {
  height: 200px;
  border-radius: 4px;
}

.skeleton-table-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.skeleton-table-row .skeleton {
  height: 1em;
}

/* Skeleton pulse variant */

.skeleton-pulse {
  animation: skeleton-pulse 2s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

/* --- Enhanced Hover Effects --- */

.hover-lift {
  transition: transform var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-glow {
  transition: box-shadow var(--duration-normal) var(--ease-smooth);
}

.hover-glow:hover {
  box-shadow: var(--glow-primary);
}

.hover-scale {
  transition: transform var(--duration-quick) var(--ease-bounce);
}

.hover-scale:hover {
  transform: scale(1.02);
}

.hover-scale:active {
  transform: scale(0.98);
}

/* Card hover enhancement */

.card-interactive {
  transition: transform var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth),
              border-color var(--duration-normal) var(--ease-smooth);
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--color-border-light);
}

.card-interactive:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

/* --- Enhanced Form Validation --- */

.form-group.is-validating .form-input,
.form-group.is-validating .form-textarea,
.form-group.is-validating .form-select {
  border-color: var(--color-info);
  background-image: none;
}

.form-group.is-validating::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-top-color: var(--color-info);
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

/* Success state with icon */

.form-group.is-valid .form-input,
.form-group.is-valid .form-textarea,
.form-group.is-valid .form-select {
  border-color: var(--color-success);
  padding-right: 40px;
}

.form-group.is-valid::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: 4px;
  color: var(--color-success);
  font-size: 14px;
  font-weight: bold;
}

/* Error state with animation */

.form-group.is-invalid .form-input,
.form-group.is-invalid .form-textarea,
.form-group.is-invalid .form-select {
  border-color: var(--color-error);
  animation: shake 0.4s var(--ease-smooth);
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }

  20%, 60% {
    transform: translateX(-6px);
  }

  40%, 80% {
    transform: translateX(6px);
  }
}

.form-error-message {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--color-error-muted);
  border-radius: 3px;
  color: var(--color-error);
  font-size: var(--text-sm);
  animation: slideDown 0.2s var(--ease-smooth);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-success-message {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--color-success-muted);
  border-radius: 3px;
  color: var(--color-success);
  font-size: var(--text-sm);
  animation: slideDown 0.2s var(--ease-smooth);
}

/* Input focus enhancement */

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-muted), var(--shadow-sm);
}

/* --- Page Transitions --- */

.page-enter {
  animation: pageEnter 0.3s var(--ease-smooth);
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-exit {
  animation: pageExit 0.2s var(--ease-smooth);
}

@keyframes pageExit {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

/* Content fade transitions */

.fade-in {
  animation: fadeIn 0.25s var(--ease-smooth);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.3s var(--ease-smooth);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-up {
  animation: slideInUp 0.3s var(--ease-smooth);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Tooltip Enhancement --- */

.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-size: var(--text-xs);
  border-radius: 3px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-quick) var(--ease-smooth),
              transform var(--duration-quick) var(--ease-smooth),
              visibility var(--duration-quick);
  z-index: 1000;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-border);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-quick) var(--ease-smooth),
              visibility var(--duration-quick);
}

.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* --- Progress Indicators --- */

.progress-bar {
  height: 4px;
  background: var(--color-bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 2px;
  transition: width 0.4s var(--ease-smooth);
}

.progress-bar-animated .progress-bar-fill {
  background: linear-gradient(90deg,
    var(--color-accent) 0%,
    var(--color-accent-light) 50%,
    var(--color-accent) 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Circular progress */

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  fill: transparent;
  stroke: var(--color-bg-tertiary);
  stroke-width: 3;
}

.progress-ring-progress {
  fill: transparent;
  stroke: var(--color-accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s var(--ease-smooth);
}

/* --- Status Indicators --- */

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

.status-dot-success {
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot-error {
  background: var(--color-error);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-dot-warning {
  background: var(--color-warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-dot-info {
  background: var(--color-info);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.status-dot-pulse {
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Live status with ring */

.status-live {
  position: relative;
}

.status-live::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: statusRing 1.5s ease-out infinite;
}

@keyframes statusRing {
  0% {
    transform: scale(0.8);
    opacity: 0.4;
  }

  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* --- Notification Badge --- */

.badge-notification {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--color-error);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: badgeEnter 0.3s var(--ease-bounce);
}

@keyframes badgeEnter {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Enhanced Modal Transitions --- */

.modal {
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.modal.active {
  opacity: 1;
}

.modal .modal-content {
  transform: scale(0.95) translateY(20px);
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

/* --- Flow Builder Enhanced Styles --- */

.flows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.flow-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.flow-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: var(--color-border-light);
}

.flow-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.flow-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.5rem;
}

.flow-card-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.flow-card-stats {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--color-bg-base);
  border-radius: 4px;
  margin: 1rem 0;
}

.flow-card-stat {
  flex: 1;
  text-align: center;
}

.flow-card-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

.flow-card-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.flow-card-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
}

/* Node palette item hover */

.node-palette-item {
  transition: all var(--duration-quick) var(--ease-smooth);
}

.node-palette-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
  transform: translateX(4px);
}

.node-palette-item:active {
  transform: translateX(2px) scale(0.98);
}

/* Flow canvas overlay */

.flow-canvas-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--color-text-muted);
  pointer-events: none;
  opacity: 0.5;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.flow-canvas-overlay.hidden {
  opacity: 0;
}

/* --- Empty States --- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 400px;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* --- Action Feedback --- */

.action-success {
  animation: actionSuccess 0.5s var(--ease-smooth);
}

@keyframes actionSuccess {
  0% {
    background-color: transparent;
  }

  50% {
    background-color: var(--color-success-muted);
  }

  100% {
    background-color: transparent;
  }
}

.action-error {
  animation: actionError 0.5s var(--ease-smooth);
}

@keyframes actionError {
  0% {
    background-color: transparent;
  }

  50% {
    background-color: var(--color-error-muted);
  }

  100% {
    background-color: transparent;
  }
}

/* --- Interactive List Items --- */

.list-item-interactive {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  transition: all var(--duration-quick) var(--ease-smooth);
  cursor: pointer;
}

.list-item-interactive:hover {
  background: var(--color-bg-hover);
}

.list-item-interactive:active {
  background: var(--color-bg-active);
  transform: scale(0.99);
}

.list-item-interactive.selected {
  background: var(--color-accent-muted);
  border-left: 3px solid var(--color-accent);
}

/* --- Tab Indicator --- */

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
}

.tab {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-quick) var(--ease-smooth);
}

.tab:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.tab.active {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-sm);
}

/* --- Keyboard Shortcut Hint --- */

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 6px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  box-shadow: 0 2px 0 var(--color-border);
}

/* --- Loading Overlay --- */

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 12, 0.8);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 100;
  animation: fadeIn 0.2s var(--ease-smooth);
}

.loading-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--color-text-primary);
}

.loading-spinner-large {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-bg-tertiary);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- Focus Visible Styles --- */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Dark Mode Text Selection --- */

::-moz-selection {
  background: var(--color-accent);
  color: white;
}

::selection {
  background: var(--color-accent);
  color: white;
}

/* --- Scrollbar Styling --- */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-hover);
  border-radius: 4px;
  -webkit-transition: background 0.2s;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light);
}

/* Firefox scrollbar */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-bg-hover) var(--color-bg-secondary);
}

/* ========================================
   PROJECT VISUALIZER LAYOUT
   ======================================== */

.project-visualizer-container {
  display: flex;
  align-items: stretch;
  height: clamp(460px, calc(100vh - 280px), 760px);
  min-height: 460px;
  width: 100%;
  background: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.project-vis-viewport {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  background: var(--color-bg-base);
}

.project-vis-canvas {
  width: 100%;
  height: 100%;
}

.project-vis-sidebar-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(18, 18, 21, 0.92);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.project-vis-sidebar-toggle:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-light);
}

.project-vis-sidebar-backdrop {
  position: absolute;
  inset: 0;
  display: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 39;
  cursor: pointer;
}

.project-vis-sidebar {
  width: 340px;
  flex: 0 0 340px;
  min-width: 280px;
  max-width: 460px;
  background: var(--color-bg-secondary);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-vis-sidebar-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
}

.project-vis-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.project-vis-sidebar-close {
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.project-vis-sidebar-close:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-light);
}

.project-vis-header {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
}

.project-vis-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.project-vis-tab {
  flex: 1;
  padding: 11px 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.project-vis-tab:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.project-vis-tab.active {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-accent);
  background: rgba(19, 124, 189, 0.1);
}

.project-vis-tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

@media (max-width: 1200px) {
  .project-visualizer-container {
    height: clamp(420px, calc(100vh - 220px), 700px);
    min-height: 420px;
  }

  .project-vis-sidebar {
    width: 320px;
    flex-basis: 320px;
  }
}

@media (max-width: 768px) {
  .project-visualizer-container {
    height: calc(100vh - 180px);
    min-height: 520px;
    border-radius: var(--radius-md);
  }

  .project-vis-sidebar-toggle {
    display: inline-flex;
  }

  .project-vis-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(90vw, 360px);
    max-width: 90vw;
    min-width: 0;
    flex: 0 0 auto;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    z-index: 40;
    box-shadow: var(--shadow-lg);
  }

  .project-vis-sidebar-topbar {
    display: flex;
  }

  .project-vis-sidebar-close {
    display: inline-flex;
  }

  .project-vis-header {
    padding: 12px;
  }

  .project-vis-tab-content {
    padding: 12px;
  }

  .project-visualizer-container.project-vis-sidebar-open .project-vis-sidebar {
    transform: translateX(0);
  }

  .project-visualizer-container.project-vis-sidebar-open .project-vis-sidebar-toggle {
    display: none;
  }

  .project-visualizer-container.project-vis-sidebar-open .project-vis-sidebar-backdrop {
    display: block;
  }
}

/* ========================================
   MOLECULAR VISUALIZER - SEQUENCE VIEWER
   ======================================== */

/* Sequence residue spans */

.mol-vis-res-span,
.proj-vis-res-span {
  display: inline-block;
  width: 1.4ch;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 2px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.mol-vis-res-span:hover,
.proj-vis-res-span:hover {
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
  z-index: 10;
  position: relative;
  border-radius: 3px;
}

.mol-vis-res-span.selected,
.proj-vis-res-span.selected {
  color: #facc15 !important;
  background: rgba(250, 204, 21, 0.25) !important;
  border-radius: 2px;
}

.mol-vis-res-span.highlighted,
.proj-vis-res-span.highlighted {
  background: rgba(99, 102, 241, 0.35) !important;
  animation: pulse-highlight 1s ease infinite;
}

@keyframes pulse-highlight {
  0%, 100% {
    background: rgba(99, 102, 241, 0.35);
  }

  50% {
    background: rgba(99, 102, 241, 0.55);
  }
}

/* Chain toggle buttons */

.chain-toggle-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
}

.chain-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.chain-toggle-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Sequence motif buttons */

.seq-motif-btn {
  transition: all 0.2s ease;
}

.seq-motif-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Quick stats cards */

#seq-quick-stats > div {
  transition: all 0.2s ease;
}

#seq-quick-stats > div:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Resize handles */

#mol-vis-resize-handle,
#mol-vis-bottom-resize-handle {
  transition: all 0.2s ease;
}

#mol-vis-resize-handle:hover,
#mol-vis-bottom-resize-handle:hover {
  background: var(--color-border) !important;
}

#mol-vis-resize-handle:active,
#mol-vis-bottom-resize-handle:active {
  background: var(--color-accent) !important;
}

/* Sequence section containers */

#sequence-list > div {
  transition: all 0.2s ease;
}

/* Residue info panel animation */

#residue-info-panel {
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   SEQUENCE ANALYTICS STYLES
   ======================================== */

.sequence-analytics-view {
  padding: var(--space-6);
  max-width: 1600px;
  margin: 0 auto;
  animation: seqFadeIn 0.4s ease-out;
}

@keyframes seqFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Banner Pattern */

.seq-hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.03) 40px, rgba(255,255,255,0.03) 80px);
  opacity: 0.8;
  pointer-events: none;
}

.seq-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-5);
}

@media (max-width: 1200px) {
  .seq-main-grid {
    grid-template-columns: 1fr;
  }
}

.seq-col-left,
.seq-col-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Enhanced Cards for Sequence Analytics */

.sequence-analytics-view .card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.sequence-analytics-view .card.clickable:hover, .sequence-analytics-view a.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
}

.sequence-analytics-view .card-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
  border-bottom: 1px solid var(--color-border);
}

.sequence-analytics-view .card-body {
  position: relative;
}

/* Sequence Input */

.seq-input-textarea {
  width: 100%;
  min-height: 160px;
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.7;
  background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, rgba(34, 197, 94, 0.02) 100%);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text-primary);
  resize: vertical;
  transition: all 0.25s ease;
}

.seq-input-textarea:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12), 0 4px 16px rgba(34, 197, 94, 0.08);
  background: var(--color-bg-tertiary);
}

.seq-input-textarea::-moz-placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.seq-input-textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* Sequence Type Badge */

.seq-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.seq-type-badge.dna {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  animation: seqBadgePulse 2s infinite;
}

.seq-type-badge.rna {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
  animation: seqBadgePulse 2s infinite;
}

.seq-type-badge.protein {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
  animation: seqBadgePulse 2s infinite;
}

.seq-type-badge.unknown {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

@keyframes seqBadgePulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  50% {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  }
}

.seq-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Central Dogma Flow */

.central-dogma-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 20px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.03) 0%, rgba(6, 182, 212, 0.03) 50%, rgba(139, 92, 246, 0.03) 100%);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.central-dogma-flow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.3), rgba(6, 182, 212, 0.3), rgba(139, 92, 246, 0.3), transparent);
}

.dogma-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease;
}

.dogma-step:hover {
  transform: scale(1.05);
}

.dogma-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
}

.dogma-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.dogma-icon.dna {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.dogma-icon.rna {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
}

.dogma-icon.protein {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
}

.dogma-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.dogma-arrow {
  color: var(--color-text-muted);
  opacity: 0.6;
  animation: dogmaArrowPulse 1.5s ease-in-out infinite;
}

@keyframes dogmaArrowPulse {
  0%, 100% {
    opacity: 0.4;
    transform: translateX(0);
  }

  50% {
    opacity: 0.8;
    transform: translateX(3px);
  }
}

/* Reading Frame Selector */

.reading-frame-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--color-bg-secondary);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 13px;
  font-weight: 500;
}

.reading-frame-option:hover {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.05);
}

.reading-frame-option:has(input:checked) {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%);
  border-color: #22c55e;
  color: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.reading-frame-option input {
  display: none;
}

/* Sequence Output Display */

.seq-output-display {
  background: var(--color-bg-tertiary);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  animation: seqOutputFadeIn 0.3s ease-out;
}

@keyframes seqOutputFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.seq-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--color-bg-secondary) 0%, rgba(34, 197, 94, 0.02) 100%);
  border-bottom: 1px solid var(--color-border);
}

.seq-output-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 6px;
}

.seq-output-type.dna {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.seq-output-type.rna {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.seq-output-type.protein {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.seq-output-length {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.seq-output-sequence {
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
  letter-spacing: 0.02em;
}

.seq-output-sequence::-webkit-scrollbar {
  width: 4px;
}

.seq-output-sequence::-webkit-scrollbar-track {
  background: var(--color-bg-tertiary);
}

.seq-output-sequence::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

/* Nucleotide Colors */

.nt-A {
  color: #22c55e;
  font-weight: 500;
}

.nt-T {
  color: #ef4444;
  font-weight: 500;
}

.nt-U {
  color: #ef4444;
  font-weight: 500;
}

.nt-C {
  color: #3b82f6;
  font-weight: 500;
}

.nt-G {
  color: #f59e0b;
  font-weight: 500;
}

.nt-N {
  color: #9ca3af;
  font-weight: 500;
}

/* Operation Buttons */

.seq-op-btn {
  border-radius: 10px !important;
  padding: 12px 16px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: all 0.25s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

.seq-op-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.seq-op-btn:active {
  transform: translateY(0) !important;
}

/* Loading State */

.seq-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 12px;
  color: var(--color-text-secondary);
}

.seq-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: seqSpin 0.8s linear infinite;
}

@keyframes seqSpin {
  to {
    transform: rotate(360deg);
  }
}

/* File Item Styling */

.seq-file-item:hover {
  background: var(--color-bg-secondary) !important;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Stats Placeholder */

.seq-stats-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  color: var(--color-text-muted);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
  border-radius: 12px;
  border: 1px dashed var(--color-border);
}

.seq-stats-placeholder svg {
  opacity: 0.4;
  margin-bottom: 8px;
}

.seq-stats-placeholder p {
  margin: 8px 0 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Stats Grid */

.seq-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.seq-stat-item {
  padding: 16px 14px;
  background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, rgba(99, 102, 241, 0.02) 100%);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-align: center;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.seq-stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22c55e, #06b6d4, #8b5cf6);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.seq-stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.seq-stat-item:hover::before {
  opacity: 1;
}

.seq-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
  background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.seq-stat-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Composition Bars */

.seq-composition-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--color-bg-tertiary);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.seq-comp-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease;
}

.seq-comp-bar-row:hover {
  transform: translateX(4px);
}

.seq-comp-label {
  width: 24px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--color-bg-secondary);
}

.seq-comp-label.A {
  color: #22c55e;
}

.seq-comp-label.T, .seq-comp-label.U {
  color: #ef4444;
}

.seq-comp-label.C {
  color: #3b82f6;
}

.seq-comp-label.G {
  color: #f59e0b;
}

.seq-comp-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--color-bg-secondary);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.seq-comp-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.seq-comp-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
  border-radius: 5px 5px 0 0;
}

.seq-comp-bar.A {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.seq-comp-bar.T, .seq-comp-bar.U {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.seq-comp-bar.C {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.seq-comp-bar.G {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.seq-comp-pct {
  width: 48px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: 'JetBrains Mono', monospace;
}

/* Codon Usage Grid */

.seq-codon-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.seq-codon-grid::-webkit-scrollbar {
  width: 4px;
}

.seq-codon-grid::-webkit-scrollbar-track {
  background: var(--color-bg-tertiary);
  border-radius: 2px;
}

.seq-codon-grid::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.seq-codon-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.seq-codon-item:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
  transform: translateX(4px);
}

.seq-codon-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text-primary);
  width: 40px;
  padding: 3px 6px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 4px;
  text-align: center;
}

.seq-codon-aa {
  width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  padding: 3px 6px;
  border-radius: 4px;
}

.seq-codon-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.seq-codon-bar {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #06b6d4);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.seq-codon-count {
  width: 36px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 12px;
}

/* Protein Properties */

.seq-protein-props-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--color-bg-tertiary);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.seq-prop-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease;
}

.seq-prop-bar-row:hover {
  transform: translateX(4px);
}

.seq-prop-label {
  width: 100px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.seq-prop-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--color-bg-secondary);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.seq-prop-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.seq-prop-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
  border-radius: 5px 5px 0 0;
}

.seq-prop-bar.hydrophobic {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.seq-prop-bar.hydrophilic {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.seq-prop-bar.charged {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.seq-prop-bar.aromatic {
  background: linear-gradient(90deg, #ec4899, #db2777);
}

.seq-prop-pct {
  width: 48px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: 'JetBrains Mono', monospace;
}

/* ORF Track Visualization */

.orf-track-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--color-bg-tertiary);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.orf-track-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.orf-frame-label {
  width: 28px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  background: var(--color-bg-secondary);
  padding: 4px 6px;
  border-radius: 4px;
}

.orf-track {
  flex: 1;
  height: 20px;
  background: linear-gradient(90deg, var(--color-bg-secondary), rgba(34, 197, 94, 0.05));
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.orf-track.reverse {
  background: linear-gradient(90deg, var(--color-bg-secondary), rgba(239, 68, 68, 0.08));
}

.orf-region {
  position: absolute;
  top: 3px;
  height: 14px;
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 6px;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.orf-region::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
  border-radius: 4px 4px 0 0;
}

.orf-region:hover {
  transform: scaleY(1.3);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  z-index: 10;
}

.orf-track.reverse .orf-region {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.orf-track.reverse .orf-region:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ORF Table */

.orf-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.orf-table th,
.orf-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.orf-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.orf-frame-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}

.orf-frame-badge.forward {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.orf-frame-badge.reverse {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Sequence Operation Buttons */

.seq-op-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  padding: 10px 14px;
  transition: all 0.2s;
}

.seq-op-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Spinner for loading state */

.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form Range for Evo2 sliders */

.form-range {
  width: 100%;
  height: 6px;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  -webkit-transition: transform 0.2s;
  transition: transform 0.2s;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.form-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness for Sequence Analytics */

@media (max-width: 768px) {
  .sequence-analytics-view {
    padding: var(--space-4);
  }

  .seq-main-grid {
    gap: var(--space-4);
  }

  .central-dogma-flow {
    padding: 16px;
    gap: 8px;
  }

  .dogma-icon {
    width: 48px;
    height: 48px;
    font-size: 11px;
  }

  .seq-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .seq-stat-value {
    font-size: 18px;
  }
}

/* ========================================
   SEQUENCE ANALYTICS DASHBOARD REDESIGN
   ======================================== */

/* Dashboard Grid Layout */

.seq-dashboard {
  padding: var(--space-5);
  max-width: 1800px;
  margin: 0 auto;
  animation: seqFadeIn 0.4s ease-out;
}

.seq-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-4);
}

@media (max-width: 1400px) {
  .seq-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Toolbar Styles */

.seq-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.seq-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.seq-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seq-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.seq-toolbar-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.seq-toolbar-btn.active {
  background: rgba(34, 197, 94, 0.1);
  border-color: #22c55e;
  color: #22c55e;
}

.seq-view-toggle {
  display: flex;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.seq-view-toggle button {
  padding: 8px 14px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.seq-view-toggle button:hover {
  background: var(--color-bg-secondary);
}

.seq-view-toggle button.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
  color: #22c55e;
}

/* Top Input Section */

.seq-input-section {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

@media (max-width: 1200px) {
  .seq-input-section {
    grid-template-columns: 1fr;
  }
}

.seq-quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.seq-quick-stat {
  padding: 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  text-align: center;
  transition: all 0.2s;
}

.seq-quick-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.seq-quick-stat-value {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.seq-quick-stat-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Collapsible Modules */

.seq-modules-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.seq-module {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.seq-module:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.seq-module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.seq-module-header:hover {
  background: var(--color-bg-tertiary);
}

.seq-module-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.seq-module-icon svg {
  width: 18px;
  height: 18px;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

.seq-module-title-group {
  flex: 1;
  min-width: 0;
}

.seq-module-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.seq-module-subtitle {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.seq-module-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.seq-module-badge.new {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.seq-module-chevron {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.seq-module.expanded .seq-module-chevron {
  transform: rotate(180deg);
}

.seq-module-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding: 0 18px;
}

.seq-module.expanded .seq-module-content {
  max-height: 2000px;
  padding: 0 18px 18px 18px;
}

.seq-module-divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: 16px;
}

/* Module-specific gradients */

.seq-module-icon.central-dogma {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.seq-module-icon.statistics {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.seq-module-icon.codon {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.seq-module-icon.orf {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.seq-module-icon.protein {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
}

.seq-module-icon.evo2 {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
}

.seq-module-icon.primers {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.seq-module-icon.motifs {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.seq-module-icon.comparison {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.seq-module-icon.visualization {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.seq-module-icon.files {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Sidebar */

.seq-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.seq-sidebar-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
}

.seq-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.seq-sidebar-body {
  padding: 16px;
}

/* Primer Design Module Styles */

.primer-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.primer-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.primer-form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.primer-result-card {
  padding: 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 10px;
}

.primer-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.primer-result-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.primer-result-type.forward {
  color: #22c55e;
}

.primer-result-type.reverse {
  color: #06b6d4;
}

.primer-result-sequence {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  word-break: break-all;
  background: var(--color-bg-secondary);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.primer-metrics {
  display: flex;
  gap: 12px;
  font-size: 11px;
}

.primer-metric {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primer-metric-label {
  color: var(--color-text-muted);
}

.primer-metric-value {
  font-weight: 600;
  color: var(--color-text-primary);
}

.primer-metric-value.good {
  color: #22c55e;
}

.primer-metric-value.warn {
  color: #f59e0b;
}

.primer-metric-value.bad {
  color: #ef4444;
}

/* Motif Search Module Styles */

.motif-enzyme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.motif-enzyme-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: monospace;
}

.motif-enzyme-chip:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}

.motif-enzyme-chip.selected {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #f59e0b;
}

.motif-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-bg-tertiary);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.motif-result-item:hover {
  background: var(--color-bg-secondary);
  transform: translateX(4px);
}

.motif-result-name {
  font-weight: 600;
  font-size: 12px;
  min-width: 60px;
  color: #f59e0b;
}

.motif-result-pattern {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--color-text-secondary);
  flex: 1;
}

.motif-result-position {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Sequence Comparison Module Styles */

.comparison-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.comparison-seq-input {
  min-height: 100px;
}

.comparison-result {
  padding: 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.comparison-alignment {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
  padding: 12px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
}

.comparison-alignment .match {
  color: #22c55e;
}

.comparison-alignment .mismatch {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.comparison-alignment .gap {
  color: #9ca3af;
}

.comparison-stats {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

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

.comparison-stat-value {
  font-size: 20px;
  font-weight: 700;
}

.comparison-stat-value.high {
  color: #22c55e;
}

.comparison-stat-value.medium {
  color: #f59e0b;
}

.comparison-stat-value.low {
  color: #ef4444;
}

.comparison-stat-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Visualization Panel Styles */

.seq-visualization-panel {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: var(--space-4);
}

.seq-visualization-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.seq-visualization-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.seq-visualization-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seq-viewer-container {
  padding: 16px;
  background: var(--color-bg-tertiary);
  min-height: 200px;
  position: relative;
}

.seq-viewer-ruler {
  display: flex;
  align-items: flex-end;
  height: 24px;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.seq-viewer-ruler-mark {
  position: absolute;
  text-align: center;
}

.seq-viewer-sequence {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 2;
  letter-spacing: 1px;
  word-break: break-all;
  padding: 8px 0;
}

.seq-annotation-tracks {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

.seq-annotation-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.seq-annotation-track-label {
  font-size: 11px;
  font-weight: 600;
  width: 80px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.seq-annotation-track-label.orfs {
  color: #22c55e;
}

.seq-annotation-track-label.restriction {
  color: #f59e0b;
}

.seq-annotation-track-label.primers {
  color: #06b6d4;
}

.seq-annotation-track-label.motifs {
  color: #8b5cf6;
}

.seq-annotation-track-bar {
  flex: 1;
  height: 16px;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.seq-annotation-marker {
  position: absolute;
  height: 100%;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.seq-annotation-marker:hover {
  transform: scaleY(1.2);
  z-index: 10;
}

.seq-annotation-marker.orfs {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.seq-annotation-marker.restriction {
  background: #f59e0b;
}

.seq-annotation-marker.primers {
  background: linear-gradient(135deg, #06b6d4, #22c55e);
}

.seq-annotation-marker.motifs {
  background: #8b5cf6;
}

.seq-track-empty {
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 2px 8px;
  font-style: italic;
}

/* Minimap Styles */

.seq-viewer-minimap {
  position: relative;
  height: 40px;
  background: var(--color-bg-secondary);
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.seq-viewer-minimap canvas {
  display: block;
  width: 100%;
  height: 40px;
}

.seq-minimap-viewport {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(59, 130, 246, 0.2);
  border: 2px solid rgba(59, 130, 246, 0.6);
  border-radius: 4px;
  pointer-events: none;
  transition: left 0.1s ease-out;
}

/* Sequence Viewer Canvas Wrapper */

.seq-viewer-sequence-wrapper {
  overflow-x: auto;
  position: relative;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-text-muted) var(--color-bg-tertiary);
}

.seq-viewer-sequence-wrapper::-webkit-scrollbar {
  height: 8px;
}

.seq-viewer-sequence-wrapper::-webkit-scrollbar-track {
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

.seq-viewer-sequence-wrapper::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: 4px;
}

.seq-viewer-sequence-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* Primer Results Styles */

.primer-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.primer-pair {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s;
}

.primer-pair:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.primer-pair-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.primer-pair-num {
  font-weight: 600;
  font-size: 13px;
}

.primer-quality-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.primer-quality-badge.excellent {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
  color: white;
}

.primer-quality-badge.good {
  background: #22c55e20;
  color: #22c55e;
}

.primer-quality-badge.acceptable {
  background: #f59e0b20;
  color: #f59e0b;
}

.primer-quality-badge.poor {
  background: #ef444420;
  color: #ef4444;
}

.primer-product-size {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.primer-details {
  padding: 12px 14px;
}

.primer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.primer-row + .primer-row {
  border-top: 1px solid var(--color-border);
}

.primer-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 6px;
  border-radius: 4px;
  min-width: 60px;
  text-align: center;
}

.primer-label.fwd {
  background: #22c55e20;
  color: #22c55e;
}

.primer-label.rev {
  background: #06b6d420;
  color: #06b6d4;
}

.primer-seq {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--color-bg-tertiary);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
}

.primer-stats {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.primer-meta {
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  background: var(--color-bg-tertiary);
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Export Menu */

.seq-export-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 160px;
  overflow: hidden;
  animation: seqFadeIn 0.2s ease-out;
}

.seq-export-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background 0.2s;
}

.seq-export-item:hover {
  background: var(--color-bg-tertiary);
}

.seq-export-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

/* Multi-sequence tabs */

.seq-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  background: var(--color-bg-tertiary);
  border-radius: 10px;
  padding: 4px;
}

.seq-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.seq-tab:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

.seq-tab.active {
  background: var(--color-bg-secondary);
  color: #22c55e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.seq-tab-close {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.seq-tab:hover .seq-tab-close {
  opacity: 1;
}

.seq-tab-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.seq-tab-add {
  width: 36px;
  padding: 10px;
  color: var(--color-text-muted);
}

.seq-tab-add:hover {
  color: #22c55e;
}

/* Position ruler */

.seq-position-ruler {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.seq-position-ruler-label {
  color: var(--color-text-secondary);
}

.seq-position-ruler-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Motif & Restriction Site Search Results */

.motif-results-container,
.restriction-results-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.motif-results-header,
.restriction-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  border-radius: 8px;
  margin-bottom: 8px;
}

.motif-results-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.motif-results-count span {
  color: #f59e0b;
}

.motif-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.motif-result-item:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.motif-position {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  background: var(--color-bg-tertiary);
  border-radius: 6px;
  color: var(--color-text-secondary);
  min-width: 70px;
  text-align: center;
}

.motif-sequence {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--color-text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.motif-strand {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.motif-strand.plus {
  background: #22c55e20;
  color: #22c55e;
}

.motif-strand.minus {
  background: #ef444420;
  color: #ef4444;
}

/* Restriction Enzyme Results */

.restriction-enzyme-group {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.restriction-enzyme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.2s;
}

.restriction-enzyme-header:hover {
  background: var(--color-bg-tertiary);
}

.restriction-enzyme-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-primary);
}

.restriction-enzyme-pattern {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--color-text-secondary);
  padding: 2px 8px;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  margin-left: 8px;
}

.restriction-enzyme-count {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  background: #8b5cf620;
  color: #8b5cf6;
}

.restriction-sites-list {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.restriction-site-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--color-bg-tertiary);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.restriction-site-item:hover {
  background: #8b5cf620;
  color: #8b5cf6;
}

.restriction-site-pos {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.restriction-site-overhang {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.restriction-site-overhang.five-prime {
  background: #22c55e20;
  color: #22c55e;
}

.restriction-site-overhang.three-prime {
  background: #f59e0b20;
  color: #f59e0b;
}

.restriction-site-overhang.blunt {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}

/* Enzyme Selection Grid */

.motif-enzyme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.enzyme-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.enzyme-chip:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.enzyme-chip.selected {
  background: #8b5cf620;
  border-color: #8b5cf6;
  color: #8b5cf6;
}

/* Regulatory Elements Results */

.regulatory-elements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.regulatory-element-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.regulatory-element-item:hover {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.05);
}

.regulatory-element-type {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-width: 80px;
  text-align: center;
}

.regulatory-element-type.promoter {
  background: #f59e0b20;
  color: #f59e0b;
}

.regulatory-element-type.rbs {
  background: #22c55e20;
  color: #22c55e;
}

.regulatory-element-type.terminator {
  background: #ef444420;
  color: #ef4444;
}

.regulatory-element-type.operator {
  background: #8b5cf620;
  color: #8b5cf6;
}

.regulatory-element-position {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.regulatory-element-sequence {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--color-text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Motif Search Form */

.motif-search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.motif-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.motif-pattern-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--color-text-primary);
  transition: border-color 0.2s;
}

.motif-pattern-input:focus {
  outline: none;
  border-color: #f59e0b;
}

.motif-pattern-input::-moz-placeholder {
  color: var(--color-text-muted);
}

.motif-pattern-input::placeholder {
  color: var(--color-text-muted);
}

.motif-options {
  display: flex;
  gap: 16px;
  align-items: center;
}

.motif-option-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.motif-option-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
}

/* No Results State */

.motif-no-results,
.restriction-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.motif-no-results svg,
.restriction-no-results svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  opacity: 0.5;
}

.motif-no-results-title,
.restriction-no-results-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.motif-no-results-desc,
.restriction-no-results-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Mobile responsiveness for new dashboard */

@media (max-width: 768px) {
  .seq-dashboard {
    padding: var(--space-3);
  }

  .seq-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .seq-toolbar-left,
  .seq-toolbar-right {
    justify-content: center;
  }

  .seq-input-section {
    grid-template-columns: 1fr;
  }

  .seq-modules-grid {
    gap: var(--space-2);
  }

  .seq-module-header {
    padding: 12px 14px;
  }

  .primer-form-grid,
  .comparison-input-grid {
    grid-template-columns: 1fr;
  }

  .motif-enzyme-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===========================================
   Flows Module Styles
   =========================================== */

/* Mobile notice */

.flows-mobile-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 2rem;
}

/* Flow cards grid */

.flows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Flow card */

.flow-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.flow-card:hover {
  border-color: var(--color-border-hover, var(--color-primary));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.flow-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.flow-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.25rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-card-description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Flow card stats */

.flow-card-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.flow-card-stat {
  text-align: center;
}

.flow-card-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.flow-card-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Flow card actions */

.flow-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Flow builder styles */

.flow-builder-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  background: var(--color-bg-primary);
}

.flow-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
}

.flow-builder-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-primary);
  background-image: 
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 20px 20px;
}

.flow-builder-sidebar {
  width: 280px;
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-border);
  padding: 1rem;
  overflow-y: auto;
}

/* Flow node styles */

.flow-node {
  position: absolute;
  min-width: 180px;
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: move;
  transition: box-shadow 0.2s ease;
}

.flow-node:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.flow-node.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.flow-node-header {
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  border-radius: 6px 6px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.flow-node-body {
  padding: 0.75rem;
}

.flow-node-port {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  border: 2px solid var(--color-bg-elevated);
  position: absolute;
  cursor: crosshair;
}

.flow-node-port.input {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.flow-node-port.output {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.flow-node-port:hover {
  background: var(--color-primary);
}

/* Mobile responsiveness for flows */

@media (max-width: 768px) {
  .flows-grid {
    grid-template-columns: 1fr;
  }

  .flow-card-stats {
    gap: 1rem;
  }
}

/* ==========================================================================
   FLOWS COMPLETE UI STYLES
   ========================================================================== */

/* --- Flows Tabs - Refined --- */

.flows-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.375rem;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}

.flows-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.flows-tab:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.flows-tab.active {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.flows-tab svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.flows-tab.active svg {
  opacity: 1;
  color: var(--color-accent);
}

/* --- Flows Stats Grid --- */

.flows-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.flows-stat-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: all 0.15s ease;
}

.flows-stat-card:hover {
  border-color: var(--color-border-light);
  transform: translateY(-1px);
}

.flows-stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.flows-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

.flows-stat-card.stat-primary .flows-stat-value {
  color: var(--color-accent);
}

.flows-stat-card.stat-info .flows-stat-value {
  color: var(--color-info);
}

.flows-stat-card.stat-success .flows-stat-value {
  color: var(--color-success);
}

/* --- Flow Card Preview --- */

.flow-card-preview {
  height: 120px;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
}

.flow-card-preview canvas {
  width: 100%;
  height: 100%;
}

.flow-card-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --- Flow Card Meta --- */

.flow-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

.flow-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.flow-card-meta-item svg {
  width: 12px;
  height: 12px;
}

/* --- Flow Status Badges --- */

.flow-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: var(--text-xs);
  font-weight: 500;
}

.flow-status-badge.draft {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.flow-status-badge.active {
  background: var(--color-success-muted);
  color: var(--color-success);
}

.flow-status-badge.archived {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

.flow-status-badge.running {
  background: var(--color-info-muted);
  color: var(--color-info);
}

/* --- Node Config Panel --- */

.node-config-panel {
  width: 300px;
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.node-config-header {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.node-config-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.node-config-type {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: 0.25rem 0.5rem;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
}

.node-config-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.node-config-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.node-config-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.node-config-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.node-config-field {
  margin-bottom: 0.75rem;
}

.node-config-field:last-child {
  margin-bottom: 0;
}

.node-config-field label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.node-config-field input,
.node-config-field select,
.node-config-field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  transition: border-color var(--duration-quick) var(--ease-smooth);
}

.node-config-field input:focus,
.node-config-field select:focus,
.node-config-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.node-config-field .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.node-config-field .checkbox-label input[type="checkbox"] {
  width: auto;
}

.node-config-data-flow {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.node-config-port {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-bg-secondary);
  border-radius: 3px;
  font-size: var(--text-xs);
}

.node-config-port-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.node-config-port-indicator.input {
  background: var(--color-info);
}

.node-config-port-indicator.output {
  background: var(--color-success);
}

.node-config-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.5rem;
}

.node-config-footer button {
  flex: 1;
}

/* --- Execution Monitor --- */

.execution-monitor {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

.execution-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.execution-monitor-header:hover {
  background: var(--color-bg-hover);
}

.execution-monitor-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.execution-monitor-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.execution-monitor-toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  transition: transform var(--duration-quick) var(--ease-smooth);
}

.execution-monitor.collapsed .execution-monitor-toggle {
  transform: rotate(180deg);
}

.execution-monitor-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.execution-monitor.collapsed .execution-monitor-body {
  display: none;
}

/* Execution Progress */

.execution-progress {
  margin-bottom: 1rem;
}

.execution-progress-bar {
  height: 4px;
  background: var(--color-bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.execution-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-success));
  border-radius: 9999px;
  transition: width var(--duration-normal) var(--ease-smooth);
}

.execution-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Execution Steps */

.execution-steps {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.execution-step {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.execution-step-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.execution-step.completed .execution-step-indicator {
  background: var(--color-success);
}

.execution-step.running .execution-step-indicator {
  background: var(--color-info);
  animation: pulse 1.5s infinite;
}

.execution-step.failed .execution-step-indicator {
  background: var(--color-error);
}

.execution-step.pending .execution-step-indicator {
  background: var(--color-text-muted);
  opacity: 0.5;
}

/* Execution Logs */

.execution-logs {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.75rem;
  max-height: 150px;
  overflow-y: auto;
}

.execution-log-entry {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.execution-log-entry:last-child {
  border-bottom: none;
}

.execution-log-time {
  color: var(--color-text-muted);
  min-width: 60px;
}

.execution-log-message {
  color: var(--color-text-secondary);
}

.execution-log-entry.info .execution-log-message {
  color: var(--color-info);
}

.execution-log-entry.success .execution-log-message {
  color: var(--color-success);
}

.execution-log-entry.warning .execution-log-message {
  color: var(--color-warning);
}

.execution-log-entry.error .execution-log-message {
  color: var(--color-error);
}

/* --- Template Browser --- */

.template-browser {
  padding: 1.5rem;
}

.template-categories {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.template-category-btn {
  padding: 0.5rem 1rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-quick) var(--ease-smooth);
}

.template-category-btn:hover {
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
}

.template-category-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.template-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-quick) var(--ease-smooth);
}

.template-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.template-card-content {
  flex: 1;
  min-width: 0;
}

.template-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.template-card-description {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.template-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --- Share Modal --- */

.share-modal-content {
  padding: 1.5rem;
}

.share-section {
  margin-bottom: 1.5rem;
}

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

.share-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
}

.share-link-row {
  display: flex;
  gap: 0.5rem;
}

.share-link-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.share-copy-btn {
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-quick) var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-copy-btn:hover {
  background: var(--color-accent-hover);
}

.share-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg-secondary);
  border-radius: 4px;
}

.share-option label {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.share-team-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-team-member {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg-secondary);
  border-radius: 4px;
}

.share-team-avatar {
  width: 32px;
  height: 32px;
  background: var(--color-accent-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
}

.share-team-info {
  flex: 1;
}

.share-team-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}

.share-team-email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.share-team-permission {
  padding: 0.375rem 0.75rem;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

/* --- History Tab --- */

.execution-history-table {
  width: 100%;
  border-collapse: collapse;
}

.execution-history-table th,
.execution-history-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.execution-history-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-bg-secondary);
}

.execution-history-table td {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.execution-history-table tr:hover td {
  background: var(--color-bg-hover);
}

.execution-history-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: var(--text-xs);
  font-weight: 500;
}

.execution-history-status.completed {
  background: var(--color-success-muted);
  color: var(--color-success);
}

.execution-history-status.running {
  background: var(--color-info-muted);
  color: var(--color-info);
}

.execution-history-status.failed {
  background: var(--color-error-muted);
  color: var(--color-error);
}

/* --- Pulse Animation --- */

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

  50% {
    opacity: 0.5;
  }
}

/* --- Flows Mobile Responsiveness --- */

@media (max-width: 1024px) {
  .flows-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .node-config-panel {
    width: 260px;
  }

  .template-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .flows-tabs {
    flex-direction: column;
  }

  .flows-stats-grid {
    grid-template-columns: 1fr;
  }

  .node-config-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    width: 100%;
    max-width: 300px;
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-smooth);
  }

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

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

  .share-link-row {
    flex-direction: column;
  }

  .execution-steps {
    flex-direction: column;
  }
}

/* ========================================
   BATCH JOBS INTERFACE
   ======================================== */

/* Enhanced Batch Container Layout */

#batch-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-2);
}

#batch-container .inline-job-submission {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Batch Cards */

#batch-container .card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#batch-container .card.clickable:hover, #batch-container a.card:hover {
  border-color: var(--color-border-focus);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Enhanced Card Headers */

#batch-container .card-header {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

#batch-container .card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#batch-container .card.clickable:hover .card-header::before, #batch-container a.card:hover .card-header::before {
  opacity: 1;
}

#batch-container .card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
}

/* Enhanced Form Groups */

#batch-container .form-group {
  margin-bottom: var(--space-5);
  position: relative;
}

#batch-container .form-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

#batch-container .form-label::before {
  content: '';
  width: 4px;
  height: 4px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-radius: 50%;
  margin-right: var(--space-2);
}

/* Enhanced Form Controls */

#batch-container .form-select,
#batch-container .form-input,
#batch-container textarea.form-input {
  width: 100%;
  max-width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#batch-container .form-select:focus,
#batch-container .form-input:focus,
#batch-container textarea.form-input:focus {
  outline: none;
  border-color: #8b5cf6;
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

#batch-container .form-select:hover,
#batch-container .form-input:hover,
#batch-container textarea.form-input:hover {
  border-color: var(--color-border-focus);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Enhanced Form Hints */

#batch-container .form-hint {
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-secondary);
  border-left: 3px solid #8b5cf6;
  border-radius: 4px;
}

/* Enhanced Checkboxes */

#batch-container .checkbox-label {
  display: flex;
  align-items: flex-start;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#batch-container .checkbox-label::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

#batch-container .checkbox-label:hover::before {
  left: 100%;
}

#batch-container .checkbox-label:hover {
  border-color: #8b5cf6;
  background: var(--color-bg-tertiary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#batch-container .checkbox-label input[type="checkbox"] {
  margin-right: var(--space-3);
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

/* Range Input Styling */

#batch-container input[type="range"] {
  width: 100%;
  height: 8px;
  background: var(--color-bg-secondary);
  border-radius: 9999px;
  outline: none;
  border: 2px solid var(--color-border);
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  cursor: pointer;
}

.range-value {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: var(--space-2);
  min-width: 40px;
  text-align: center;
}

#batch-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

#batch-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}

#batch-container input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  -moz-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

/* Parameter Container */

#batch-params-container {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

/* Parameter Groups */

.param-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  position: relative;
  overflow: hidden;
}

.param-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #8b5cf6, #6366f1);
}

/* Enhanced Batch Items */

.batch-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.batch-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #6366f1, #3b82f6);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.batch-item:hover::before {
  transform: scaleX(1);
}

.batch-item:hover {
  border-color: var(--color-accent-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  background: var(--color-bg-secondary);
}

.batch-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.batch-item-content .form-input,
.batch-item-content .form-textarea {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  transition: all var(--transition-normal);
  font-size: 14px;
  padding: var(--space-2) var(--space-3);
}

.batch-item-content .form-input:focus,
.batch-item-content .form-textarea:focus {
  border-color: var(--color-accent);
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Enhanced Batch Items Controls */

.batch-items-controls {
  background: var(--color-bg-elevated);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}

.batch-items-controls h3 {
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 16px;
}

/* Form Validation Styling */

.form-validation {
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--color-error);
  min-height: 16px;
}

.form-hint {
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* Form Validation States */

.form-validation.error {
  color: var(--color-error);
  font-weight: 500;
}

.form-validation.success {
  color: var(--color-success);
  font-weight: 500;
}

.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success,
.form-textarea.success,
.form-select.success {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-label-required {
  color: var(--color-error);
  font-weight: 700;
}

/* Animation for fade out */

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

.batch-item-remove {
  align-self: flex-start;
  margin-top: var(--space-1);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all 0.3s ease;
}

.batch-item-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.05);
}

/* Enhanced Batch Preview */

#batch-preview {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 50%, rgba(59, 130, 246, 0.05) 100%);
  border: 2px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

#batch-preview::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

#batch-preview-content {
  position: relative;
  z-index: 1;
}

#batch-preview-content > div {
  background: var(--color-bg-elevated);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

#batch-preview-content > div:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
  transform: translateY(-1px);
}

/* Enhanced Textareas */

.batch-item textarea {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  resize: vertical;
  min-height: 80px;
}

.batch-item textarea:focus {
  border-color: #8b5cf6;
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Enhanced Submit Button */

#submit-batch-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  border: none;
  border-radius: 9999px;
  padding: var(--space-4) var(--space-8);
  font-weight: 600;
  font-size: 1rem;
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

#submit-batch-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

#submit-batch-btn:hover::before {
  left: 100%;
}

#submit-batch-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#submit-batch-btn:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

#submit-batch-btn:not(:disabled):active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Batch Items Container Animation */

#batch-items-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: var(--space-2);
}

#batch-items-list::-webkit-scrollbar {
  width: 8px;
}

#batch-items-list::-webkit-scrollbar-track {
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

#batch-items-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8b5cf6, #6366f1);
  border-radius: 4px;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

#batch-items-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7c3aed, #5b21b6);
}

/* Batch Project Grid */

.batches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-4);
}

.batch-card {
  background: var(--color-bg-elevated, var(--bg-card, #1a1a25));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.batch-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa, #8b5cf6);
  opacity: 0;
  transition: opacity 0.25s;
}

.batch-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1), 0 0 0 1px rgba(139, 92, 246, 0.05);
  transform: translateY(-1px);
}

.batch-card:hover::before {
  opacity: 1;
}

.batch-card-header {
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-primary);
  margin: 0;
}

.batch-status {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.batch-status-pending {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.batch-status-running {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.batch-status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.batch-status-failed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.batch-status-cancelled {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.batch-status-mixed {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.batch-card-body {
  padding: var(--space-4);
}

.batch-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
}

.batch-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.batch-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.batch-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.batch-description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.batch-card-footer {
  padding: var(--space-4);
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

/* Responsive Design */

@media (max-width: 768px) {
  #batch-container .card-header {
    padding: var(--space-3) var(--space-4);
  }

  #batch-container .form-group {
    margin-bottom: var(--space-4);
  }

  .batch-item {
    flex-direction: column;
    gap: var(--space-2);
  }

  .batch-stats {
    flex-direction: column;
    gap: var(--space-2);
  }

  #batch-preview-content > div {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .batches-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #batch-preview-content > div {
    grid-template-columns: 1fr;
  }

  #submit-batch-btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
  }
}

#batch-preview {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  border: 1px solid var(--color-border-light);
}

#batch-preview-content > div {
  background: var(--color-bg-elevated);
  padding: var(--space-2);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.batch-item textarea {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.batch-item textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(124, 134, 243, 0.1);
}

#submit-batch-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#submit-batch-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 134, 243, 0.3);
}

#submit-batch-btn:not(:disabled):active {
  transform: translateY(0);
}

/* Batch items container animation */

#batch-items-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: var(--space-2);
}

#batch-items-list::-webkit-scrollbar {
  width: 6px;
}

#batch-items-list::-webkit-scrollbar-track {
  background: var(--color-bg-tertiary);
  border-radius: 3px;
}

#batch-items-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

#batch-items-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light);
}

/* Batch summary grid responsive */

@media (max-width: 768px) {
  #batch-preview-content > div {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
}

@media (max-width: 480px) {
  #batch-preview-content > div {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   BATCH JOBS DISPLAY - Expansion & Progress
   ======================================== */

/* Batch card expansion panel (card view) */

.batch-card-expansion {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  border-top: 1px solid transparent;
}

.batch-card-expansion.expanded {
  max-height: 2000px;
  border-top-color: var(--border-color, rgba(255, 255, 255, 0.08));
}

/* Batch progress bar */

.batch-progress-bar {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-bg-tertiary, var(--bg-hover, #2a2a3a));
  position: relative;
}

.batch-progress-bar .segment-completed {
  background: linear-gradient(90deg, var(--color-success), var(--color-success-light));
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.batch-progress-bar .segment-running {
  background: linear-gradient(90deg, var(--color-info), var(--color-info-light));
  animation: batchSegmentPulse 2s ease-in-out infinite;
}

.batch-progress-bar .segment-failed {
  background: linear-gradient(90deg, var(--color-error), var(--color-error-light));
}

.batch-progress-bar .segment-pending {
  background: var(--color-text-muted, var(--text-muted, #a3b3c5));
  opacity: 0.35;
}

@keyframes batchSegmentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Batch rows in jobs tables */

.batch-row {
  cursor: pointer;
}

.batch-row td {
  vertical-align: middle;
}

.batch-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.batch-row-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md, 4px);
  background: var(--color-accent-muted, rgba(16, 185, 129, 0.15));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.15));
  color: var(--color-accent, #0F9960);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.batch-row-copy {
  flex: 1;
  min-width: 0;
}

.batch-row-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-row-title {
  font-weight: 600;
  color: var(--color-text-primary, #F5F8FA);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.batch-row-progress {
  flex: 1;
  max-width: 110px;
  height: 4px;
}

.batch-row-percent {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent, #0F9960);
}

.batch-row.status-completed .batch-row-percent {
  color: var(--color-success);
}

.batch-row.status-running .batch-row-percent {
  color: var(--color-info);
}

.batch-row.status-failed .batch-row-percent {
  color: var(--color-error);
}

.batch-row.status-partial .batch-row-percent {
  color: var(--color-warning);
}

.batch-row-breakdown {
  font-size: 10px;
  color: var(--color-text-muted, #A3B3C5);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.batch-row-breakdown-count.completed {
  color: var(--color-success-light, #34d399);
}

.batch-row-breakdown-count.running {
  color: var(--color-info-light, #22d3ee);
}

.batch-row-breakdown-count.failed {
  color: var(--color-error-light, #f87171);
}

.batch-row-breakdown-count.pending {
  color: var(--color-text-muted, #A3B3C5);
}

.batch-row-divider {
  opacity: 0.4;
  margin: 0 2px;
}

.batch-row-empty {
  color: var(--color-text-muted, #A3B3C5);
}

.batch-row-project-link {
  color: var(--color-accent, #0F9960);
  font-size: 13px;
}

.batch-row-project-link:hover {
  color: var(--color-accent-light, #34d399);
}

.batch-row-model-cell {
  font-size: 13px;
}

.batch-row-created {
  font-size: 12px;
  color: var(--color-text-secondary, #C7D0DB);
}

.batch-row-open-btn {
  color: var(--color-accent, #0F9960);
  opacity: 0.72;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.batch-row-open-btn:hover {
  opacity: 1;
  color: var(--color-accent-light, #34d399);
}

/* ========================================
   BATCH SIDEBAR - Sub-Sequence Panel
   ======================================== */

.batch-sidebar-summary {
  background: linear-gradient(180deg, var(--color-bg-secondary, #30404D) 0%, var(--color-bg-primary, #293742) 100%);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.15));
  border-radius: var(--radius-lg, 6px);
  padding: 14px 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.batch-sidebar-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--batch-accent-color, var(--color-accent)), transparent);
  opacity: 0.6;
}

.batch-sidebar-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.batch-sidebar-progress .batch-progress-bar {
  height: 8px;
  border-radius: 4px;
  flex: 1;
}

.batch-sidebar-progress-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--batch-accent-color, var(--color-accent));
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

.batch-sidebar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.batch-sidebar-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.15s;
}

.batch-sidebar-stat-chip:hover {
  transform: scale(1.04);
}

.batch-sidebar-stat-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.batch-sidebar-stat-chip.completed { color: var(--color-success-light, #34d399); background: var(--color-success-muted, rgba(16, 185, 129, 0.15)); border-color: rgba(16, 185, 129, 0.25); }
.batch-sidebar-stat-chip.completed::before { background: var(--color-success, #10b981); }
.batch-sidebar-stat-chip.running { color: var(--color-info-light, #22d3ee); background: var(--color-info-muted, rgba(6, 182, 212, 0.15)); border-color: rgba(6, 182, 212, 0.25); }
.batch-sidebar-stat-chip.running::before { background: var(--color-info, #06b6d4); animation: batchSegmentPulse 2s infinite; }
.batch-sidebar-stat-chip.failed { color: var(--color-error-light, #f87171); background: var(--color-error-muted, rgba(239, 68, 68, 0.15)); border-color: rgba(239, 68, 68, 0.25); }
.batch-sidebar-stat-chip.failed::before { background: var(--color-error, #ef4444); }
.batch-sidebar-stat-chip.pending { color: var(--color-text-muted, #a1a1aa); background: rgba(161, 161, 170, 0.08); border-color: rgba(161, 161, 170, 0.2); }
.batch-sidebar-stat-chip.pending::before { background: var(--color-text-muted, #71717a); }

.batch-sidebar-context {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.batch-sidebar-context-row {
  font-size: 12px;
  color: var(--color-text-muted, #A3B3C5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-sidebar-context-row svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.batch-sidebar-jobs-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted, var(--text-secondary, #c7d0db));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-sidebar-jobs-label::before {
  content: '';
  flex: 0 0 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--batch-accent-color, var(--color-accent));
}

.batch-sidebar-jobs-count {
  color: var(--color-text-muted, #A3B3C5);
  font-weight: 400;
}

.batch-sidebar-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.batch-sidebar-job {
  background: var(--color-bg-secondary, var(--bg-card, #1a1a25));
  border: 1px solid var(--color-border, var(--border-color, rgba(255, 255, 255, 0.06)));
  border-radius: var(--radius-md, 10px);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.batch-sidebar-job:hover {
  border-color: var(--batch-accent-color, var(--color-accent));
  background: var(--color-bg-hover, rgba(16, 185, 129, 0.08));
  transform: translateX(2px);
}

.batch-sidebar-job:hover .batch-sidebar-job-actions {
  opacity: 1;
}

.batch-sidebar-job-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-sidebar-job-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--color-accent-muted, rgba(16, 185, 129, 0.15));
  color: var(--color-accent, #0F9960);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.batch-sidebar-job-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, var(--text-primary, #e4e4e7));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-sidebar-job-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-muted, var(--text-tertiary, #afbdcc));
  margin-top: 6px;
  padding-left: 32px;
}

.batch-sidebar-job-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.batch-sidebar-job-meta span + span::before {
  content: '\00b7';
  color: var(--text-tertiary, #afbdcc);
  opacity: 0.4;
  margin-right: 4px;
}

.batch-sidebar-job-status {
  font-size: 10px;
  padding: 2px 8px;
}

.batch-sidebar-job-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
  padding-left: 32px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.batch-sidebar-job-btn {
  padding: 3px 8px;
  font-size: 11px;
}

.batch-sidebar-job-btn-view {
  color: var(--color-success-light, #34d399);
}

.batch-sidebar-job-btn-retry {
  color: var(--color-warning-light, #fbbf24);
}

.job-sidebar-header-batch {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.16) 0%,
    rgba(16, 185, 129, 0.02) 100%
  );
  border-bottom-color: var(--color-border, rgba(255, 255, 255, 0.15));
}

.batch-sidebar-title-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md, 4px);
  background: var(--color-accent-muted, rgba(16, 185, 129, 0.15));
  color: var(--batch-accent-color, var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.batch-sidebar-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-sidebar-content {
  padding: 16px 20px;
}

.batch-sidebar-actions {
  gap: 8px;
}

.batch-sidebar-details-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-md, 4px);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  border: 1px solid var(--batch-accent-color, var(--color-accent)) !important;
  background: linear-gradient(
    135deg,
    var(--batch-accent-color, var(--color-accent)) 0%,
    var(--color-bg-tertiary, #394B59) 180%
  ) !important;
  color: var(--color-text-primary, #F5F8FA) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.batch-sidebar-details-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.95;
}

.batch-sidebar-details-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

.batch-sidebar-details-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.batch-sidebar-details-btn:focus-visible {
  outline: 2px solid var(--color-border-focus, rgba(16, 185, 129, 0.7));
  outline-offset: 2px;
}

/* Temporarily disabled settings blocks */

.settings-card-disabled {
  opacity: 0.58;
}

.settings-disabled-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted, #A3B3C5);
  background: rgba(161, 161, 170, 0.12);
  border: 1px solid rgba(161, 161, 170, 0.24);
}

.settings-disabled-note {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md, 4px);
  background: rgba(161, 161, 170, 0.08);
  border: 1px dashed rgba(161, 161, 170, 0.3);
  color: var(--color-text-muted, #A3B3C5);
  font-size: var(--text-xs, 0.75rem);
}

/* Individual job item inside batch expansion */

.batch-card-job-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  transition: background 0.15s;
}

.batch-card-job-item:last-child {
  border-bottom: none;
}

.batch-card-job-item:hover {
  background: var(--bg-hover, #2a2a3a);
}

.batch-card-job-item .job-name {
  flex: 1;
  min-width: 0;
}

.batch-card-job-item .job-name-text {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-card-job-item .job-id-text {
  font-size: 11px;
  color: var(--text-muted, #a3b3c5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-card-job-item .job-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ========================================
   BATCH TREE DISPLAY - Hierarchical View
   ======================================== */

.batch-tree-parent {
  background: linear-gradient(90deg, var(--color-accent-muted, rgba(16, 185, 129, 0.12)) 0%, transparent 100%);
  transition: all 0.2s;
  position: relative;
}

.batch-tree-parent:hover {
  background: linear-gradient(90deg, var(--color-accent-muted, rgba(16, 185, 129, 0.16)) 0%, var(--color-bg-hover, #3D4F5D) 100%);
}

.batch-tree-count {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--color-accent-muted, rgba(16, 185, 129, 0.15));
  color: var(--color-accent, #0F9960);
  border-radius: 6px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.batch-tree-children {
  background: var(--bg-surface, #0e0e18);
}

.batch-tree-list {
  padding: 4px 0 6px 0;
  background: var(--bg-surface, #0e0e18);
}

.batch-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 28px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.batch-tree-item:last-child {
  border-bottom: none;
}

.batch-tree-item:hover {
  background: rgba(139, 92, 246, 0.05);
  padding-left: 30px;
}

.batch-tree-connector {
  color: var(--accent-secondary, #8b5cf6);
  font-family: monospace;
  font-size: 14px;
  line-height: 1;
  opacity: 0.4;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  user-select: none;
}

.batch-tree-job-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.batch-tree-job-title {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-primary, #ffffff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-tree-job-id {
  font-family: monospace;
  font-size: 10px;
  color: var(--text-muted, #a3b3c5);
}

.batch-tree-job-model {
  font-size: 11px;
  color: var(--text-secondary, #c7d0db);
  flex-shrink: 0;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-tree-job-date {
  font-size: 11px;
  color: var(--text-tertiary, #afbdcc);
  flex-shrink: 0;
  white-space: nowrap;
}

.batch-tree-job-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.batch-tree-item:hover .batch-tree-job-actions {
  opacity: 1;
}

/* Responsive: hide less important tree columns on small screens */
@media (max-width: 768px) {
  .batch-tree-job-model,
  .batch-tree-job-date {
    display: none;
  }
  .batch-tree-item {
    padding-left: 16px;
  }
}

/* Dashboard V4 Redesign */

.dash-v4 {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Command Bar (replaces hero) */
.dash-v4-command-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem 1.5rem;
    height: 60px;
}

.dash-v4-greeting {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-v4-greeting h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.dash-v4-greeting-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dash-v4-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.dash-v4-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-success);
}

.dash-v4-actions {
    display: flex;
    gap: 0.75rem;
}

.dash-v4-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.dash-v4-btn-primary {
    background: var(--accent-primary);
    color: white;
    border: 1px solid transparent;
}

.dash-v4-btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.2);
}

/* Stats Row */
.dash-v4-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.dash-v4-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.dash-v4-stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dash-v4-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dash-v4-stat-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.dash-v4-stat-icon {
    color: var(--accent-primary);
    opacity: 0.8;
}

.dash-v4-stat-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-v4-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.dash-v4-stat-trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.dash-v4-trend-up {
    color: var(--accent-success);
}

.dash-v4-trend-down {
    color: var(--accent-danger);
}

.dash-v4-trend-neutral {
    color: var(--text-muted);
}

.dash-v4-stat-sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 36px;
    opacity: 0.3;
}

/* Body Grid */
.dash-v4-body-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    align-items: start;
}

/* Main Column Panels */
.dash-v4-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dash-v4-panel:last-child {
    margin-bottom: 0;
}

.dash-v4-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.dash-v4-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Charts Row */
.dash-v4-charts-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dash-v4-chart-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.25rem;
    height: 320px;
    display: flex;
    flex-direction: column;
}

.dash-v4-chart-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dash-v4-chart-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.dash-v4-chart-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-primary);
}

.dash-v4-chart-canvas-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
}

/* Activity Feed */
.dash-v4-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dash-v4-feed-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dash-v4-feed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-v4-feed-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.dash-v4-feed-icon.success {
    color: var(--accent-success);
    background: rgba(var(--accent-success-rgb), 0.1);
}

.dash-v4-feed-icon.error {
    color: var(--accent-danger);
    background: rgba(var(--accent-danger-rgb), 0.1);
}

.dash-v4-feed-icon.running {
    color: var(--accent-warning);
    background: rgba(var(--accent-warning-rgb), 0.1);
}

.dash-v4-feed-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dash-v4-feed-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.dash-v4-feed-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dash-v4-feed-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Recent Results */
.dash-v4-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dash-v4-result-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.dash-v4-result-card.clickable:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
}

.dash-v4-result-preview {
    height: 120px;
    background: var(--bg-surface);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dash-v4-result-preview svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.dash-v4-result-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-v4-result-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-v4-result-model {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Sidebar Panels */
.dash-v4-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Quick Insights */
.dash-v4-insights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dash-v4-insight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: 4px;
}

.dash-v4-insight-icon {
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
    width: 36px;
    height: 36px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-v4-insight-data {
    display: flex;
    flex-direction: column;
}

.dash-v4-insight-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dash-v4-insight-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Model Availability */
.dash-v4-model-status {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-v4-model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.dash-v4-model-item:last-child {
    border-bottom: none;
}

.dash-v4-model-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.dash-v4-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-v4-badge.online {
    background: rgba(var(--accent-success-rgb), 0.15);
    color: var(--accent-success);
}

.dash-v4-badge.offline {
    background: rgba(var(--accent-danger-rgb), 0.15);
    color: var(--accent-danger);
}

.dash-v4-badge.beta {
    background: rgba(var(--accent-warning-rgb), 0.15);
    color: var(--accent-warning);
}

/* Projects Compact */
.dash-v4-project-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-v4-project-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-v4-project-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.dash-v4-project-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-v4-project-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.dash-v4-project-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .dash-v4-stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .dash-v4-body-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-v4-stats-row {
        grid-template-columns: 1fr 1fr;
    }
    .dash-v4-charts-row {
        grid-template-columns: 1fr;
    }
    .dash-v4-results-grid {
        grid-template-columns: 1fr;
    }
    .dash-v4-command-bar {
        flex-direction: column;
        height: auto;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* ========================================
   CUSTOM MODEL CARDS v3
   ======================================== */

.model-card-v3 {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.model-card-v3:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    transform: translateY(-2px);
}

.mc3-api-btn {
    flex: 1;
    padding: 9px 6px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.28);
    border-radius: 9px;
    color: #fb923c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.15s;
}
.mc3-api-btn:hover { background: rgba(249, 115, 22, 0.2); }

.mc3-edit-btn {
    flex: 1;
    padding: 9px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: border-color 0.15s, color 0.15s;
}
.mc3-edit-btn:hover {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.mc3-del-btn {
    padding: 9px 11px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 9px;
    color: var(--accent-danger, #ef4444);
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.mc3-del-btn:hover { background: rgba(239, 68, 68, 0.18); }

/* =====================================================
   File Manager (fm-*) Styles
   ===================================================== */
.fm-breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fm-breadcrumb-item { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.fm-breadcrumb-item:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.fm-breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }
.fm-breadcrumb-separator { color: var(--text-tertiary); font-size: 13px; user-select: none; }
.fm-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fm-search { flex: 1; min-width: 160px; max-width: 260px; }
.fm-filter-chip { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border-color); background: transparent; color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all 0.15s; }
.fm-filter-chip:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.fm-filter-chip.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; font-weight: 600; }
.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 4px; }
.fm-list { display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.fm-item { position: relative; border-radius: var(--radius-md, 10px); border: 1px solid var(--border-color); background: var(--bg-card); padding: 12px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.fm-item:hover { border-color: var(--accent-primary); box-shadow: 0 0 0 1px var(--accent-primary); background: var(--bg-secondary); }
.fm-item:hover .fm-item-actions { opacity: 1; }
.fm-item-file .fm-icon-large { display: block; }
.fm-item-file .fm-icon-small { display: none; }
.fm-list .fm-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.fm-list .fm-icon-large { display: none !important; }
.fm-list .fm-icon-small { display: block !important; }
.fm-list .fm-item-info { flex: 1; min-width: 0; }
.fm-list .fm-item-actions { opacity: 1; }
.fm-item-icon { color: var(--accent-primary); flex-shrink: 0; }
.fm-item-icon.folder { color: var(--accent-warning, #f59e0b); }
.fm-item-icon.molecular { color: var(--accent-info, #06b6d4); }
.fm-item-info { margin-top: 8px; }
.fm-list .fm-item-info { margin-top: 0; }
.fm-item-name { font-size: 13px; font-weight: 500; color: var(--text-primary); word-break: break-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-item-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.fm-item-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity 0.15s; }
.fm-list .fm-item-actions { margin-top: 0; margin-left: auto; flex-shrink: 0; }
.fm-action-btn { padding: 4px 6px; border-radius: 6px; border: 1px solid transparent; background: var(--bg-tertiary); color: var(--text-secondary); cursor: pointer; transition: all 0.15s; }
.fm-action-btn:hover { border-color: var(--border-color); color: var(--text-primary); background: var(--bg-secondary); }
.fm-action-danger:hover { color: var(--accent-danger, #ef4444); border-color: var(--accent-danger, #ef4444); }
.fm-empty { text-align: center; padding: 32px; color: var(--text-tertiary); }

/* =====================================================
   Developer Views
   ===================================================== */
/* Dashboard-aligned developer surfaces (custom models / API tokens / model builder) */
.dev-shell {
  --dev-accent: var(--accent-primary, #0f9960);
  --dev-accent-strong: var(--accent-primary-light, #34d399);
  --dev-accent-soft: rgba(15, 153, 96, 0.12);
  --dev-accent-border: rgba(15, 153, 96, 0.28);
  --dev-accent-glow: rgba(15, 153, 96, 0.22);
  --dev-surface: var(--bg-card, var(--color-bg-secondary));
  --dev-surface-hover: var(--bg-card-hover, var(--color-bg-tertiary));
  --dev-border: var(--border-color, var(--color-border));
  --dev-radius: var(--radius-xl, 8px);
  --dev-radius-sm: var(--radius-md, 4px);
  --dev-transition: 180ms ease;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  animation: devFadeIn 220ms ease-out;
}

@keyframes devFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dev-shell--models {
  --dev-accent: #2d9d78;
  --dev-accent-strong: #4fc99d;
  --dev-accent-soft: rgba(45, 157, 120, 0.12);
  --dev-accent-border: rgba(45, 157, 120, 0.28);
  --dev-accent-glow: rgba(45, 157, 120, 0.2);
}

.dev-shell--api {
  --dev-accent: #2f6f99;
  --dev-accent-strong: #48aff0;
  --dev-accent-soft: rgba(72, 175, 240, 0.12);
  --dev-accent-border: rgba(72, 175, 240, 0.3);
  --dev-accent-glow: rgba(72, 175, 240, 0.24);
}

.dev-shell--builder {
  --dev-accent: #d9822b;
  --dev-accent-strong: #fbbf24;
  --dev-accent-soft: rgba(217, 130, 43, 0.12);
  --dev-accent-border: rgba(217, 130, 43, 0.28);
  --dev-accent-glow: rgba(217, 130, 43, 0.2);
}

.dev-header,
.dev-panel,
.dev-builder-guide,
.dev-resource-card,
.dev-model-card,
.dev-empty {
  background: var(--dev-surface);
  border: 1px solid var(--dev-border);
  border-radius: var(--dev-radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

.dev-header {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dev-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--dev-accent), var(--dev-accent-strong));
  opacity: 0.85;
}

.dev-header__lead,
.dev-header__copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dev-header__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--dev-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border: 1px solid var(--dev-accent-border);
  flex-shrink: 0;
}

.dev-header__icon svg,
.dev-stat-card__icon svg,
.dev-empty__icon svg {
  width: 18px;
  height: 18px;
}

.dev-header__eyebrow,
.dev-panel__eyebrow,
.dev-kv__label,
.dev-inline-meta__label {
  margin: 0 0 2px;
  color: var(--text-tertiary, var(--color-text-muted));
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dev-header__title,
.dev-panel__title {
  margin: 0;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.dev-header__description,
.dev-panel__description {
  margin: 4px 0 0;
  max-width: 620px;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 13px;
  line-height: 1.55;
}

.dev-header__meta,
.dev-chip-row,
.dev-inline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dev-header__meta {
  margin-top: 8px;
}

.dev-header__meta-item,
.dev-code-inline {
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.14);
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 11px;
  font-weight: 600;
}

.dev-code-inline {
  font-family: var(--font-mono);
  color: var(--text-primary, var(--color-text-primary));
}

.dev-header__actions,
.dev-panel__tools,
.dev-resource-card__actions,
.dev-empty__actions,
.dev-model-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}

.dev-stat-card {
  background: var(--dev-surface);
  border: 1px solid var(--dev-border);
  border-radius: var(--dev-radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  transition: border-color var(--dev-transition), box-shadow var(--dev-transition);
}

.dev-stat-card:hover {
  border-color: var(--dev-accent-border);
  box-shadow: 0 0 0 1px rgba(72, 175, 240, 0.08);
}

.dev-stat-card__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--dev-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border: 1px solid var(--dev-accent-border);
}

.dev-stat-card__value {
  display: block;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dev-stat-card__label {
  display: block;
  margin-top: 2px;
  color: var(--text-muted, var(--color-text-muted));
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dev-stat-card__note {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 11px;
}

.dev-panel {
  overflow: hidden;
}

.dev-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--dev-border);
  background: rgba(0, 0, 0, 0.08);
}

.dev-panel__body {
  padding: 16px 18px;
}

.dev-card-grid,
.dev-resource-list,
.dev-section-stack {
  display: grid;
  gap: 10px;
}

.dev-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.dev-empty {
  padding: 38px 24px;
  text-align: center;
  border-style: dashed;
  border-color: var(--dev-accent-border);
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.06) 0%,
    rgba(0, 0, 0, 0.02) 100%
  );
}

.dev-empty__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border: 1px solid var(--dev-accent-border);
}

.dev-empty__title {
  margin: 0;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 16px;
  font-weight: 700;
}

.dev-empty__description {
  max-width: 420px;
  margin: 7px auto 0;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 13px;
  line-height: 1.6;
}

.dev-empty__actions {
  justify-content: center;
  margin-top: 18px;
}

.dev-badge,
.dev-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary, var(--color-text-secondary));
}

.dev-badge--accent,
.dev-chip--accent {
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border-color: var(--dev-accent-border);
}

.dev-badge--info,
.dev-chip--info {
  color: #7dc6ff;
  background: rgba(72, 175, 240, 0.11);
  border-color: rgba(72, 175, 240, 0.28);
}

.dev-badge--success,
.dev-chip--success {
  color: #57d9a3;
  background: rgba(15, 153, 96, 0.11);
  border-color: rgba(15, 153, 96, 0.26);
}

.dev-badge--warning,
.dev-chip--warning {
  color: #fbbf24;
  background: rgba(217, 130, 43, 0.12);
  border-color: rgba(217, 130, 43, 0.28);
}

.dev-badge--danger,
.dev-chip--danger {
  color: #f78b8b;
  background: rgba(219, 55, 55, 0.11);
  border-color: rgba(219, 55, 55, 0.28);
}

.dev-badge--muted,
.dev-chip--muted {
  color: var(--text-muted, var(--color-text-muted));
}

.btn.dev-btn-primary {
  background: var(--dev-accent);
  border-color: var(--dev-accent);
  color: #fff;
  font-weight: 600;
  transition: background var(--dev-transition), border-color var(--dev-transition), box-shadow var(--dev-transition);
}

.btn.dev-btn-primary:hover {
  background: var(--dev-accent-strong);
  border-color: var(--dev-accent-strong);
  box-shadow: 0 0 0 3px var(--dev-accent-soft);
}

.btn.dev-btn-warning {
  background: var(--accent-warning, #d9822b);
  border-color: var(--accent-warning, #d9822b);
  color: #fff;
  font-weight: 600;
}

.btn.dev-btn-warning:hover {
  background: #bf7327;
  border-color: #bf7327;
}

.btn.dev-btn-accent-outline {
  background: var(--dev-accent-soft);
  border: 1px solid var(--dev-accent-border);
  color: var(--dev-accent-strong);
  font-weight: 600;
}

.btn.dev-btn-accent-outline:hover {
  background: rgba(72, 175, 240, 0.18);
  border-color: rgba(72, 175, 240, 0.38);
  color: #d5edff;
}

.btn.dev-btn-danger-outline {
  background: rgba(219, 55, 55, 0.08);
  border: 1px solid rgba(219, 55, 55, 0.25);
  color: #f78b8b;
  font-weight: 600;
}

.btn.dev-btn-danger-outline:hover {
  background: rgba(219, 55, 55, 0.16);
  border-color: rgba(219, 55, 55, 0.36);
}

.dev-badge__dot,
.dev-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.dev-resource-card,
.dev-model-card {
  overflow: hidden;
  border-radius: var(--dev-radius-sm);
  transition: border-color var(--dev-transition), transform var(--dev-transition);
}

.dev-resource-card:hover,
.dev-model-card:hover {
  border-color: var(--dev-accent-border);
  transform: translateY(-1px);
}

.dev-resource-card.is-inactive {
  opacity: 0.66;
  filter: saturate(0.7);
}

.dev-resource-card__body,
.dev-model-card__body {
  padding: 14px;
}

.dev-resource-card__top,
.dev-model-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.dev-resource-card__heading,
.dev-model-card__heading {
  min-width: 0;
}

.dev-resource-card__title,
.dev-model-card__title {
  margin: 0;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.dev-resource-card__description,
.dev-model-card__description {
  margin: 5px 0 0;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dev-model-card {
  position: relative;
}

.dev-model-card::before {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--model-accent, var(--dev-accent)) 0%,
    transparent 75%
  );
}

.dev-model-card__badges {
  margin-bottom: 8px;
}

.dev-model-card__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dev-model-card__meta-item {
  min-width: 0;
  padding: 8px;
  background: var(--dev-surface);
  text-align: center;
}

.dev-model-card__meta-value {
  display: block;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dev-model-card__meta-label {
  display: block;
  margin-top: 2px;
  color: var(--text-muted, var(--color-text-muted));
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.dev-model-card__actions {
  margin-top: 12px;
}

.dev-model-card__actions .btn,
.dev-resource-card__actions .btn {
  flex-shrink: 0;
}

.dev-model-card__actions-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
}

.dev-secret {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 9px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.16);
}

.dev-secret code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary, var(--color-text-primary));
  font-family: var(--font-mono);
  font-size: 12px;
}

.dev-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  margin-top: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dev-kv {
  padding: 8px 10px;
  background: var(--dev-surface);
}

.dev-kv__value {
  margin: 0;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 13px;
  font-weight: 600;
}

.dev-tabbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-md, 4px);
  border: 1px solid var(--dev-border);
  background: rgba(0, 0, 0, 0.12);
}

.dev-tabbar__button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dev-transition);
}

.dev-tabbar__button:hover {
  color: var(--text-primary, var(--color-text-primary));
  background: rgba(255, 255, 255, 0.04);
}

.dev-tabbar__button.active {
  color: #fff;
  background: var(--dev-accent);
  border-color: var(--dev-accent);
}

.dev-tabbar__button .dev-chip {
  padding: 1px 5px;
  font-size: 9px;
}

.dev-queue-grid,
.dev-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dev-note {
  padding: 10px 12px;
  border-radius: var(--radius-sm, 3px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--dev-accent-border);
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 12px;
  line-height: 1.6;
}

.dev-note--accent {
  border-color: var(--dev-accent-border);
  background: var(--dev-accent-soft);
}

.dev-note--info {
  border-color: rgba(72, 175, 240, 0.3);
  border-left-color: rgba(72, 175, 240, 0.48);
  background: rgba(72, 175, 240, 0.08);
}

.dev-note--success {
  border-color: rgba(15, 153, 96, 0.32);
  border-left-color: rgba(15, 153, 96, 0.5);
  background: rgba(15, 153, 96, 0.09);
}

.dev-note--warning {
  border-color: rgba(217, 130, 43, 0.32);
  border-left-color: rgba(217, 130, 43, 0.5);
  background: rgba(217, 130, 43, 0.09);
}

.dev-code-block {
  border-radius: var(--radius-md, 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e2933;
  overflow: hidden;
  position: relative;
}

.dev-code-block pre,
.dev-code-block code {
  margin: 0;
  display: block;
  padding: 12px;
  color: #d6e6f2;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow: auto;
}

.dev-model-breakdown {
  display: grid;
  gap: 8px;
}

.dev-model-breakdown__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--dev-border);
  border-radius: var(--dev-radius-sm);
  background: var(--dev-surface);
  transition: border-color var(--dev-transition);
}

.dev-model-breakdown__row:hover {
  border-color: var(--dev-accent-border);
}

.dev-model-breakdown__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dev-model-breakdown__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--dev-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dev-model-breakdown__title {
  margin: 0;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}

.dev-model-breakdown__subtitle {
  margin: 2px 0 0;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 11px;
}

.dev-model-breakdown__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.dev-builder-guide {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.dev-builder-guide__hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 0;
}

.dev-builder-guide__hero-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--dev-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border: 1px solid var(--dev-accent-border);
  flex-shrink: 0;
}

.dev-builder-guide__hero-title {
  margin: 0;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 16px;
  font-weight: 700;
}

.dev-builder-guide__hero-copy {
  margin: 4px 0 0;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 12px;
  line-height: 1.55;
}

.dev-builder-guide__tabs {
  display: flex;
  gap: 4px;
  margin: 14px 16px 0;
  padding: 4px;
  border-radius: var(--radius-md, 4px);
  border: 1px solid var(--dev-border);
  background: rgba(0, 0, 0, 0.14);
}

.dev-builder-guide__tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dev-transition);
}

.dev-builder-guide__tab:hover {
  color: var(--text-primary, var(--color-text-primary));
  background: rgba(255, 255, 255, 0.04);
}

.dev-builder-guide__tab.active {
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border-color: var(--dev-accent-border);
}

.dev-builder-guide__body {
  padding: 16px;
}

.dev-builder-guide__list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.dev-builder-guide__item {
  padding: 10px 11px;
  border-radius: var(--dev-radius-sm);
  border: 1px solid var(--dev-border);
  background: rgba(255, 255, 255, 0.015);
}

.dev-builder-guide__item-title {
  margin: 0 0 4px;
  color: var(--text-primary, var(--color-text-primary));
  font-size: 13px;
  font-weight: 700;
}

.dev-builder-guide__item-copy {
  margin: 0;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 11px;
  line-height: 1.55;
}

.dev-builder-guide__formats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.dev-builder-guide__format {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid var(--dev-border);
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary, var(--color-text-secondary));
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dev-transition);
}

.dev-builder-guide__format:hover {
  border-color: var(--dev-accent-border);
  color: var(--text-primary, var(--color-text-primary));
}

.dev-builder-guide__format.active {
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border-color: var(--dev-accent-border);
}

.dev-builder-guide__callout {
  margin-top: 12px;
}

.dev-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: devFadeIn 160ms ease-out;
}

.dev-modal {
  background: var(--dev-surface);
  border: 1px solid var(--dev-border);
  border-radius: var(--dev-radius);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.dev-modal__header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--dev-border);
  position: relative;
}

.dev-modal__header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--dev-accent),
    var(--dev-accent-strong),
    transparent 75%
  );
}

.dev-modal__header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dev-modal__header-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--dev-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dev-accent-strong);
  background: var(--dev-accent-soft);
  border: 1px solid var(--dev-accent-border);
  flex-shrink: 0;
}

.dev-modal__header-icon svg {
  width: 16px;
  height: 16px;
}

.dev-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, var(--color-text-primary));
}

.dev-modal__subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary, var(--color-text-secondary));
}

.dev-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dev-modal__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.dev-modal__body {
  padding: 16px 18px;
}

.dev-modal__footer {
  padding: 12px 18px;
  border-top: 1px solid var(--dev-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.dev-progress {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dev-progress__bar {
  height: 100%;
  border-radius: 2px;
  background: var(--dev-accent);
  transition: width 280ms ease;
}

.dev-rate-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-rate-bar__track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(219, 55, 55, 0.2);
  overflow: hidden;
}

.dev-rate-bar__fill {
  height: 100%;
  border-radius: 2px;
  background: #57d9a3;
  transition: width 280ms ease;
}

.dev-rate-bar__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

/* Format guide example cards */
.format-example-card {
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid var(--dev-border);
  border-radius: var(--radius-md, 4px);
  overflow: hidden;
}

.format-example-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--dev-border);
}

.format-example-info {
  min-width: 0;
}

.format-example-icon {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.format-example-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.format-example-desc {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.format-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.format-example-section {
  padding: 10px 12px;
  border-bottom: 1px solid var(--dev-border);
}

.format-example-section:last-child {
  border-bottom: none;
}

.format-example-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.format-example-code {
  background: #1f2a35;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm, 3px);
  padding: 10px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #d6e6f2;
  line-height: 1.6;
  white-space: pre;
  overflow: auto;
  max-height: 220px;
}

.format-example-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 5px;
}

.format-example-list li {
  font-size: 12px;
  color: var(--text-secondary);
}

.format-example-tip {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 3px);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
}

.format-example-tip__title {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.format-example-tip__copy {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-secondary);
}

@media (max-width: 1100px) {
  .dev-split-grid,
  .dev-queue-grid {
    grid-template-columns: 1fr;
  }

  .dev-model-card__meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dev-header,
  .dev-panel__header,
  .dev-model-breakdown__row {
    padding: 14px;
  }

  .dev-panel__body,
  .dev-model-card__body,
  .dev-resource-card__body {
    padding: 14px;
  }

  .dev-model-card__actions-row {
    grid-template-columns: 1fr;
  }

  .dev-tabbar {
    width: 100%;
  }

  .dev-tabbar__button {
    flex: 1 1 auto;
    justify-content: center;
    padding: 7px 10px;
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .dev-shell {
    gap: 10px;
  }

  .dev-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dev-header__icon {
    width: 36px;
    height: 36px;
  }

  .dev-header__title,
  .dev-panel__title {
    font-size: 18px;
  }

  .dev-stat-grid,
  .dev-card-grid,
  .dev-kv-grid,
  .dev-builder-guide__formats {
    grid-template-columns: 1fr;
  }

  .dev-header__actions,
  .dev-panel__tools {
    width: 100%;
  }

  .dev-header__actions .btn,
  .dev-panel__tools .btn,
  .dev-empty__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .dev-builder-guide__tabs {
    flex-direction: column;
  }

  .format-example-header {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}
