/* ============================================
   ORCHESTRATOR — Design System
   ============================================ */

:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2035;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-input: rgba(255, 255, 255, 0.05);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #3b82f6;

  --accent-blue: #3b82f6;
  --accent-violet: #8b5cf6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;

  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-danger: linear-gradient(135deg, #ef4444, #ec4899);
  --gradient-warning: linear-gradient(135deg, #f59e0b, #ef4444);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sizes */
  --sidebar-width: 260px;
  --header-height: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-glow-violet: 0 0 20px rgba(139, 92, 246, 0.15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================
   Loading Screen
   ============================================ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 20px;
}
.loading-ring {
  animation: spin 2s linear infinite;
  transform-origin: center;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* ============================================
   Login Page
   ============================================ */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.login-container::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.1), transparent 70%);
  top: -200px;
  right: -200px;
}
.login-container::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.08), transparent 70%);
  bottom: -150px;
  left: -150px;
}
.login-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.login-logo svg { width: 36px; height: 36px; }
.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 13px;
}
.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2394a3b8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  color-scheme: dark;
}
.form-select option,
.codex-config-item select option {
  background: #1a2035;
  color: #f1f5f9;
}
.codex-config-item select {
  color-scheme: dark;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group { flex: 1; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4); }

.btn-success {
  background: var(--gradient-success);
  color: white;
}
.btn-danger {
  background: var(--gradient-danger);
  color: white;
}
.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}
.btn-block { width: 100%; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   Layout — Shell
   ============================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-header svg { width: 28px; height: 28px; flex-shrink: 0; }
.sidebar-header h1 {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-section {
  padding: 16px 12px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
  user-select: none;
  position: relative;
}
.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}
.sidebar-item .badge {
  margin-left: auto;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 500; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.content-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.content-header h2 {
  font-size: 20px;
  font-weight: 600;
}
.content-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ============================================
   Badges & Pills
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-blue { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-violet { background: rgba(139,92,246,0.15); color: var(--accent-violet); }
.badge-green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-amber { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.badge-pink { background: rgba(236,72,153,0.15); color: var(--accent-pink); }
.badge-cyan { background: rgba(6,182,212,0.15); color: var(--accent-cyan); }
.badge-gray { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-dot.amber { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); }
.status-dot.red { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }
.status-dot.gray { background: var(--text-muted); }
.status-dot.blue { background: var(--accent-blue); box-shadow: 0 0 6px var(--accent-blue); }

/* Pulsing animation for active indicators */
.status-dot.pulse {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-normal);
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
}

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.project-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.project-card:hover::before { opacity: 1; }
.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.project-card-name {
  font-size: 16px;
  font-weight: 600;
}
.project-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.project-card-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.project-card-stat span { color: var(--text-primary); font-weight: 500; }
.project-card-codex {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
}
.project-card-proposed {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  flex-shrink: 0;
}
.tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}
.tab.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tab.disabled:hover {
  color: var(--text-muted);
}

/* ============================================
   Kanban Board
   ============================================ */
.kanban {
  display: flex;
  gap: 16px;
  height: 100%;
  overflow-x: auto;
  padding-bottom: 16px;
}
.kanban-column {
  flex: 0 0 280px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
.kanban-column-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.kanban-column-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-column-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 1px 7px;
  border-radius: 100px;
}
.kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.kanban-card:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.4;
}
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kanban-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.kanban-card-actions .btn { padding: 4px 10px; font-size: 11px; }
/* Proposed column styling */
.kanban-column.proposed {
  border-color: rgba(245, 158, 11, 0.2);
}
.kanban-column.proposed .kanban-column-header {
  background: rgba(245, 158, 11, 0.05);
}

/* ============================================
   Terminal / Codex Output
   ============================================ */
.terminal {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  padding: 16px;
  overflow-y: auto;
  max-height: 400px;
  color: #c9d1d9;
}
.terminal-line { display: block; }
.terminal-line.error { color: var(--accent-red); }
.terminal-line.success { color: var(--accent-green); }
.terminal-line.info { color: var(--accent-cyan); }
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent-green);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================
   Codex Panel
   ============================================ */
.codex-panel { display: flex; flex-direction: column; gap: 20px; }
.codex-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.codex-status-info {
  display: flex;
  align-items: center;
  gap: 16px;
}
.codex-status-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.codex-config-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.codex-config-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.codex-config-item select {
  padding: 4px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
}
.codex-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.codex-section-header {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.codex-section-body { padding: 16px; }

/* Toggle switch */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  transition: background var(--transition-fast);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}
.toggle input:checked + .toggle-slider {
  background: var(--accent-blue);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ============================================
   Activity Timeline
   ============================================ */
.timeline {
  display: flex;
  flex-direction: column;
}
.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 5px;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-action {
  font-size: 13px;
  line-height: 1.4;
}
.timeline-action strong { font-weight: 500; }
.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 200ms ease;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 300ms var(--ease-out);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 300ms var(--ease-out);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================
   Idea Editor
   ============================================ */
.idea-editor { display: flex; gap: 20px; height: 100%; }
.idea-editor-main { flex: 1; display: flex; flex-direction: column; }
.idea-editor-sidebar {
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
}
.idea-version-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}
.idea-version-item:hover { background: var(--bg-hover); }
.idea-version-item.active { border-color: var(--accent-blue); background: rgba(59,130,246,0.08); }
.idea-version-label { font-size: 13px; font-weight: 500; }
.idea-version-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.idea-run-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.idea-run-status.idle {
  background: rgba(100,116,139,0.15);
  color: var(--text-muted);
}
.idea-run-status.running {
  background: rgba(16,185,129,0.15);
  color: var(--accent-green);
}
.idea-mode-toggle {
  display: inline-flex;
  gap: 8px;
}
.idea-markdown-preview {
  flex: 1;
  overflow-y: auto;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  line-height: 1.7;
  color: var(--text-primary);
}
.idea-markdown-preview h1,
.idea-markdown-preview h2,
.idea-markdown-preview h3 {
  margin: 0 0 12px;
}
.idea-markdown-preview p,
.idea-markdown-preview ul,
.idea-markdown-preview pre {
  margin: 0 0 12px;
}
.idea-markdown-preview ul {
  padding-left: 20px;
}
.idea-markdown-preview code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 6px;
}
.idea-markdown-preview pre {
  background: rgba(0,0,0,0.25);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
}
.idea-chat-log {
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.idea-chat-entry,
.idea-chat-system {
  width: fit-content;
  max-width: 92%;
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 14px;
  word-break: break-word;
  line-height: 1.5;
  white-space: pre-wrap;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}
.idea-chat-entry strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.idea-chat-entry.assistant {
  align-self: flex-start;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: #e2e8f0;
}
.idea-chat-entry.assistant strong {
  color: #c4b5fd;
}
.idea-chat-entry.user {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #eff6ff;
}
.idea-chat-entry.user strong {
  color: #93c5fd;
}
.idea-chat-entry.error,
.idea-chat-system {
  align-self: center;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-secondary);
  font-size: 12px;
}
.idea-chat-entry.error {
  align-self: flex-start;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

/* ============================================
   Settings
   ============================================ */
.settings-section {
  margin-bottom: 32px;
}
.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* ============================================
   Webhooks Table
   ============================================ */
.table-wrapper {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
td { color: var(--text-secondary); }
tr:hover td { background: var(--bg-hover); }

/* ============================================
   Scan History
   ============================================ */
.scan-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
}
.scan-item:last-child { border-bottom: none; }

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 13px; margin-bottom: 20px; }

/* ============================================
   Utility Classes
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
