/* QA Copilot — Modern Professional UI */
:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --error: #ef4444;
  --error-light: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.1);
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 56px;
  --transition-fast: 0.15s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

body::before {
  display: none;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Smooth transitions for interactive elements */
a, button, input, select, textarea {
  transition: all var(--transition-fast);
}

/* Better focus states */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background: var(--accent-light);
  color: var(--accent);
}

/* ─── Top header bar ────────────────────────────────────────────────────── */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* When sidebar is collapsed: header logo stays in same place (no shift right) */
.top-header.sidebar-collapsed .header-left {
  padding-left: 0;
}

.header-left .logo-icon {
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

.btn-collapse {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: fixed;
  left: calc(var(--sidebar-width) - 14px);
  top: 50px;
  z-index: 200;
  box-shadow: var(--shadow);
}

.btn-collapse.collapsed {
  left: calc(var(--sidebar-collapsed-width) - 14px);
}

.btn-collapse:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}

.header-center .theme-toggle-dash {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  background: var(--surface-hover);
  cursor: pointer;
  font-size: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar-header {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6a1b9a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}

.user-display-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  transition: all var(--transition);
  overflow: hidden;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  padding: 0.75rem 0;
  min-width: var(--sidebar-collapsed-width);
  border-right: 2px solid var(--accent);
}

.sidebar.collapsed .sidebar-nav {
  padding: 0 0.5rem;
  align-items: center;
}

.sidebar.collapsed .sidebar-link,
.sidebar.collapsed .sidebar-logout {
  justify-content: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-arrow {
  display: none;
}

.sidebar.collapsed .nav-icon {
  margin: 0;
}

.sidebar.collapsed .sidebar-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar.collapsed .sidebar-footer {
  border-top-color: rgba(226, 232, 240, 0.5);
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.5rem;
}

.sidebar-nav-main {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow-y: auto;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.4rem 0 0;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  margin: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  display: none;
}

.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-link .nav-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.sidebar-link .nav-text {
  font-size: 0.9rem;
}

.sidebar-link .nav-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-link.active .nav-sub {
  color: var(--accent);
}

.nav-arrow {
  font-size: 1rem;
  opacity: 0.7;
}

.nav-icon {
  flex-shrink: 0;
}

.sidebar-logout {
  margin: 0;
}

.sidebar-logout:hover {
  color: var(--error);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ─── Dashboard grid & cards (widget style) ───────────────────────────────── */
#view-dashboard {
  background: transparent;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.dash-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.dash-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.dash-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1.25rem 1.35rem;
  color: #fff;
}

.dash-card-header .dash-card-icon {
  font-size: 1.25rem;
  opacity: 0.95;
}

.dash-card-header > div {
  flex: 1;
  min-width: 0;
}

.dash-card-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.dash-card-sub {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.9;
}

.dash-card-arrow {
  font-size: 1.2rem;
  opacity: 0.9;
}

.dash-card-body {
  padding: 1.25rem 1.35rem;
  font-size: 0.9rem;
}

.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--surface-hover);
}

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

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

.dash-row strong {
  color: var(--text);
}

.dash-card-purple .dash-card-header { background: #6a1b9a; }
.dash-card-blue .dash-card-header { background: #1565c0; }
.dash-card-orange .dash-card-header { background: #e65100; }
.dash-card-green .dash-card-header { background: var(--accent); }
.dash-card-red .dash-card-header { background: #c62828; }
.dash-card-grey .dash-card-header { background: #546e7a; }

.dash-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Dashboard Graphs ─────────────────────────────────────────────────── */
.dashboard-graphs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.graph-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.graph-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.graph-card-large {
  grid-column: span 1;
}

@media (min-width: 768px) {
  .graph-card-large {
    grid-column: span 1;
  }
}

.graph-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-bottom: none;
  color: #fff;
}

.graph-card-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
}

.graph-header-icon {
  font-size: 1.1rem;
}

.graph-header-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Colored Headers */
.graph-header-green {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
}

.graph-header-blue {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
}

.graph-header-purple {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

.graph-header-orange {
  background: linear-gradient(135deg, #e65100 0%, #f57c00 100%);
}

.graph-header-red {
  background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
}

.graph-card-count {
  font-size: 0.8rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
}

.status-pill.passed {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.status-pill.failed {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.status-pill.pending {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.graph-card-body {
  padding: 1rem;
}

/* Donut Chart - Large */
.graph-card-donut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.donut-large {
  flex-shrink: 0;
}

.donut-large-value {
  font-size: 1.5rem;
  font-weight: 700;
  fill: var(--text);
}

.donut-large-label {
  font-size: 0.75rem;
  fill: var(--text-muted);
}

.donut-legend-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 60px;
}

.legend-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.legend-row-total {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

/* Progress Bar */
.bar-chart-horizontal {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-bar-container {
  width: 100%;
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.progress-bar-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.progress-bar-value {
  font-size: 1rem;
  font-weight: 700;
}

.progress-bar-track {
  height: 20px;
  background: #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 35px;
}

.progress-bar-inner-value {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Mini Donut */
.graph-card-stats {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
}

.donut-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.donut-mini-value {
  font-size: 1.25rem;
  font-weight: 700;
  fill: var(--text);
}

.donut-mini-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Stat Card Mini */
.graph-card-stats-list .graph-card-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.stat-card-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  transition: background var(--transition);
}

.stat-card-mini:hover {
  background: var(--surface-hover);
}

.stat-card-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
}

.stat-card-content {
  display: flex;
  flex-direction: column;
}

.stat-card-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-card-title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-card-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* Action Buttons */
.graph-card-actions .graph-card-body {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
  justify-content: center;
  min-width: 140px;
}

.action-btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.action-btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.action-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.action-btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.action-btn-icon {
  font-size: 1rem;
}

.action-btn-text {
  white-space: nowrap;
}

/* ─── Main content ─────────────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 2.25rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
}

.main-view {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-view.hidden {
  display: none;
}

/* ─── Settings view (widget style) ────────────────────────────────────────── */
#view-settings {
  background: transparent;
}

#view-settings .card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
}

#view-settings .card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* ─── Projects view (widget style) ───────────────────────────────────────── */
#view-projects {
  background: transparent;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 0;
}

.page-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  position: relative;
  padding-left: 1rem;
}

.page-title::before {
  display: none;
}

.page-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-input {
  padding: 0.6rem 0.9rem 0.6rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  min-width: 220px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.project-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.project-tabs {
  display: flex;
  gap: 0.25rem;
}

.project-tab {
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.project-tab:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

.project-tab.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.project-view-toggle {
  display: flex;
  gap: 0.25rem;
  margin-bottom: -1px;
}

.view-toggle-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
}

.view-toggle-btn:hover,
.view-toggle-btn.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.projects-content.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
}

.projects-content {
  flex: 1;
  min-height: 280px;
}

.projects-list {
  padding: 0.5rem 0;
}

/* View toggle: table / list / grid */
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}
.view-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.view-toggle button:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.view-toggle button.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}
.view-toggle button.active:hover {
  background: var(--accent-hover);
  color: #fff;
}

.projects-cards {
  display: grid;
  gap: 1rem;
}
.projects-cards--list {
  grid-template-columns: 1fr;
}
.projects-cards--list .project-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.projects-cards--list .project-card-actions {
  margin-top: 0;
}
.projects-cards--grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 1.35rem 1.6rem;
  background: rgba(255, 255, 255, 0.9);
  min-height: 0;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.project-card-body {
  min-width: 0;
}

.project-card-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project-card-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-top: auto;
}

.project-card-actions .btn-icon {
  padding: 0.5rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-card-actions .card-action-icon {
  flex-shrink: 0;
}

.project-card-specs {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.project-spec-list {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.project-spec-more {
  list-style: none;
  margin-left: -1rem;
}

.run-project-context {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.run-project-label {
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 3.5rem 2.5rem;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

.empty-state p {
  margin: 0 0 0.5rem;
}

.empty-hint {
  font-size: 0.95rem;
  max-width: 420px;
  margin: 0 auto !important;
  line-height: 1.5;
}

/* ─── Test Runner view ──────────────────────────────────────────────────── */
.runner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: var(--shadow-sm);
}

.runner-header .page-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Existing project info (read-only display) ───────────────────────────── */
.existing-project-info {
  margin-bottom: 1rem;
}
.existing-project-info .info-row {
  display: block;
  margin-bottom: 0.75rem;
}
.existing-project-info .info-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.existing-project-info .info-value {
  display: block;
  font-size: 1rem;
  color: var(--text);
  word-break: break-all;
}

.existing-project-info .info-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.existing-project-info .info-row-actions label {
  flex: 0 0 auto;
}
.existing-project-info .info-value-editable {
  flex: 1 1 280px;
  min-width: 0;
}
.existing-project-info .agent-input-inline {
  width: 100%;
  max-width: 420px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}
.plan-doc-actions-inline {
  flex: 0 0 auto;
  margin-left: auto;
}
.plan-doc-btn.plan-doc-regenerate {
  background: var(--surface);
  border-color: var(--border);
}
.plan-doc-btn.plan-doc-settings {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.planner-settings-block {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.existing-project-info .specs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.existing-project-info .specs-list .view-spec-link {
  font-size: 0.8rem;
}

.generated-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.generated-plan-preview {
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.generated-plan-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}

/* ─── Wizard steps (horizontal step indicator) ────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: var(--shadow-sm);
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 110px;
  cursor: pointer;
  transition: transform var(--transition), color var(--transition);
}

.wizard-step:hover {
  transform: translateY(-2px);
}

.wizard-step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wizard-step-check {
  font-size: 1.15rem;
  color: #fff;
  line-height: 1;
}

.wizard-step.completed .wizard-step-circle {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.wizard-step.current .wizard-step-circle {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45); }
  50% { box-shadow: 0 4px 24px rgba(99, 102, 241, 0.25); }
  100% { box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45); }
}

.wizard-step.current .wizard-step-label,
.wizard-step.current .wizard-step-name {
  color: var(--accent);
  font-weight: 600;
}

.wizard-step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wizard-step-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  transition: color var(--transition);
}

.wizard-step:hover .wizard-step-name {
  color: var(--text);
}

.wizard-step-connector {
  width: 44px;
  height: 4px;
  margin-top: 22px;
  background: var(--border);
  flex-shrink: 0;
  border-radius: 4px;
  transition: background var(--transition);
}

.wizard-step-connector.completed {
  background: linear-gradient(90deg, var(--accent) 0%, #34d399 100%);
}

.wizard-connector-healer {
  display: none;
}

.wizard-steps.has-healer .wizard-connector-healer {
  display: block;
}

.wizard-steps.has-healer .wizard-step-healer {
  display: flex !important;
}

/* Wizard panes: show only active step */
.wizard-content {
  position: relative;
  min-height: 200px;
  margin-bottom: 1rem;
}

.wizard-pane {
  display: none;
}

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

.wizard-pane-healer {
  display: none !important;
}

.wizard-content.has-healer .wizard-pane-healer.active {
  display: block !important;
}

/* Wizard footer */
.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--border);
}

.wizard-counter {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.wizard-nav {
  display: flex;
  gap: 0.75rem;
}

/* Test Runner page: light grey background so widgets read as cards */
#view-test-runner {
  background: transparent;
  min-height: 100vh;
}

.runner-widgets {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Widget-style cards: white, rounded, elegant shadow */
.runner-widget.card {
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.runner-widget.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.18);
}

.runner-widget.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px 0 0 3px;
}

#widget-run.card,
#section-planner.card,
#section-generator.card,
#section-healer.card,
#widget-output.card {
  border-left: none;
}

.runner-widget.card .section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.runner-widget.card .agent-icon {
  font-size: 1.25rem;
  opacity: 1;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius);
}

.banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid;
}

.banner::before {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.banner-warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: #92400e;
}

.banner-warning::before {
  content: '⚠️';
}

.banner-success {
  background: var(--success-light);
  border-color: var(--success);
  color: #065f46;
}

.banner-success::before {
  content: '✓';
}

.banner-error {
  background: var(--error-light);
  border-color: var(--error);
  color: #991b1b;
}

.banner-error::before {
  content: '✕';
}

.banner-info {
  background: var(--info-light);
  border-color: var(--info);
  color: #1e40af;
}

.banner-info::before {
  content: 'ℹ';
}

.banner code {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.runner-widget .widget-status {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.runner-widget .widget-status strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* Output log inside widget: recessed area */
.runner-widget .output-log {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: var(--radius);
  min-height: 150px;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 1.25rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.env-display {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9rem;
}

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

.env-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

.base-url {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.nav-tab {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-sans);
}

.nav-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-tab.active {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--border);
}

.view.hidden {
  display: none;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.card h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field select,
.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.field select:hover,
.field input:hover {
  border-color: var(--text-light);
}

.field select:focus,
.field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

.field-check {
  display: flex;
  align-items: flex-end;
}

.field-check label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0;
}

.field-check input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.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;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
  color: #fff;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.running .btn-text {
  visibility: hidden;
}

.btn-primary .btn-spinner {
  display: none;
  position: absolute;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary.running .btn-spinner {
  display: block;
}

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

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error) 0%, #f87171 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  color: #fff;
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Authentication Section */
.auth-section {
  width: 100%;
}

.auth-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.auth-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.auth-fields {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.auth-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.auth-row:last-child {
  margin-bottom: 0;
}

.auth-field {
  flex: 1;
}

.auth-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* Test planner auth: same design as login page (input-wrap, input-icon, pill shape) */
.auth-fields--planner .auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.auth-fields--planner .input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-fields--planner .input-wrap .input-icon {
  position: absolute;
  left: 0.85rem;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-fields--planner .input-wrap .input-icon svg {
  width: 18px;
  height: 18px;
}

.auth-fields--planner .input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-fields--planner .input-wrap input::placeholder {
  color: var(--text-muted);
}

.auth-fields--planner .input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-fields--planner .input-password .input-action {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

.auth-fields--planner .input-password .input-action:hover {
  color: var(--text);
}

.auth-fields--planner .input-password .input-action svg {
  display: block;
}

.auth-fields--planner .input-password input {
  padding-right: 2.75rem;
}

.auth-row-actions {
  align-items: center;
  gap: 0.75rem;
}

.auth-save-status {
  font-size: 0.85rem;
}

.auth-save-status--ok {
  color: var(--accent, #2e7d32);
}

.auth-save-status--err {
  color: var(--error, #c62828);
}

.auth-field input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.password-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.password-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.password-input-wrap input:focus {
  box-shadow: none;
}

.password-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.password-toggle-icon {
  font-size: 0.8rem;
  padding: 0 0.5rem;
}

.password-toggle-icon--eye svg {
  display: block;
}

.auth-advanced {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.auth-advanced summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.auth-advanced summary:hover {
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.btn-ghost:hover {
  color: var(--text);
}

.last-run {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}

.last-run.passed .status-dot { 
  background: var(--success); 
  box-shadow: 0 0 0 3px var(--success-light);
  animation: pulse-success 2s infinite;
}

.last-run.failed .status-dot { 
  background: var(--error); 
  box-shadow: 0 0 0 3px var(--error-light);
}

@keyframes pulse-success {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-light); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1); }
}

.last-run.passed {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.last-run.failed {
  background: var(--error-light);
  border-color: var(--error);
  color: var(--error);
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.output-header h2 {
  margin: 0;
}

.output-log {
  margin: 0;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow: auto;
  max-height: 400px;
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-muted);
}

.output-log:empty::before {
  content: 'Output will appear here when you run tests.';
  color: var(--text-muted);
  opacity: 0.7;
}

/* Agents */
.agents-intro p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.playwright-badge {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.playwright-badge code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
}

.agent-workflow {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.agent-workflow summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.agent-body {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
}

.agent-section {
  margin-bottom: 1.25rem;
}

.agent-section-compact .agent-workflow {
  margin-bottom: 0;
}

/* Output Widget Styling */
.output-widget {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.output-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.output-widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.output-icon {
  font-size: 1rem;
}

.output-widget-body {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 0;
}

.output-widget .output-log {
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  max-height: 350px;
  overflow-y: auto;
}

.output-widget .output-log:not(.has-content) {
  color: #64748b;
  font-style: italic;
}

.healer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.section-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.planner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.planner-headed-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.planner-headed-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.planner-headed-hint {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.flow-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.flow-steps-single {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  transition: border-color var(--transition), background var(--transition);
}

.flow-step:hover {
  border-color: var(--border);
  background: var(--surface-hover);
}

.flow-step .step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.flow-step .step-content {
  flex: 1;
  min-width: 0;
}

.flow-step .step-content label:not(.auth-toggle) {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.flow-step .step-content label.auth-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

.agent-input,
.agent-file {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.agent-input:focus,
.agent-file:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.generated-plan-inline {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.generated-plan-content {
  margin: 0.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.generated-plan-full {
  max-height: 400px;
  overflow-y: auto;
}

/* Plan doc card — clean header + edit */
.plan-doc-card {
  margin-top: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.plan-doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}

.plan-doc-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.plan-doc-icon {
  font-size: 1.1rem;
}

.plan-doc-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-doc-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.plan-doc-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border);
}

.plan-doc-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.plan-doc-save {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.plan-doc-save:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.plan-doc-body {
  padding: 0;
}

.plan-doc-card .generated-plan-content {
  margin: 0;
  border: none;
  border-radius: 0;
  max-height: 70vh;
}

.plan-doc-textarea {
  width: 100%;
  min-height: 400px;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  box-sizing: border-box;
}

.plan-doc-textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* Rendered markdown view (README-style) */
.plan-doc-markdown {
  padding: 1rem 1.25rem;
  max-height: 70vh;
  overflow: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

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

.plan-doc-markdown h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.plan-doc-markdown h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.plan-doc-markdown h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
  color: var(--text);
}

.plan-doc-markdown h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.75rem 0 0.35rem;
  color: var(--text);
}

.plan-doc-markdown p {
  margin: 0.5rem 0;
}

.plan-doc-markdown ul,
.plan-doc-markdown ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.plan-doc-markdown li {
  margin: 0.25rem 0;
}

.plan-doc-markdown code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text);
}

.plan-doc-markdown pre {
  margin: 0.75rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre;
}

.plan-doc-markdown pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: 1em;
}

.plan-doc-markdown a {
  color: var(--accent);
  text-decoration: none;
}

.plan-doc-markdown a:hover {
  text-decoration: underline;
}

.plan-doc-markdown strong {
  font-weight: 600;
}

.plan-doc-markdown hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1rem 0;
}

.hidden-select {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.view-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.view-spec-link {
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

a.btn-icon {
  text-decoration: none;
}

.file-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Requirements upload: clean drag-and-drop zone */
.upload-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 100px;
  padding: 1.25rem 1rem;
  margin-top: 0.5rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--text);
}

.upload-zone--active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.upload-zone--has-files {
  border-style: solid;
  border-color: var(--border);
  background: var(--bg);
  color: var(--text);
}

.upload-zone--has-files:hover {
  border-color: var(--accent);
}

.upload-zone-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.upload-zone-text {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.upload-zone-hint {
  font-size: 0.75rem;
  opacity: 0.85;
}

.agents-docs {
  margin-top: 0.5rem;
}

.agents-docs code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-hover);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: var(--accent);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

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

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Spec modal: same size in view and edit mode */
.modal-content.modal-content-spec {
  width: 85vw;
  min-width: 600px;
  height: 80vh;
  min-height: 400px;
  max-width: 1200px;
  max-height: 85vh;
}

.modal-content.modal-content-spec .modal-body-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Spec modal: same typography in view and edit mode */
.modal-content.modal-content-spec .plan-content,
.modal-content.modal-content-spec .modal-spec-textarea {
  flex: 1;
  min-height: 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-family: var(--font-mono);
  color: var(--text);
}

/* View mode (without edit): border so content area is clearly defined */
.modal-content.modal-content-spec .plan-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--surface);
}

.modal-spec-textarea {
  padding: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: none;
}

.modal-spec-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Modal form (Create project) */
.modal-content.modal-form {
  min-width: 360px;
}

.modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-body {
  padding: 0.5rem 0 1rem;
}

.modal-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.modal-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-sizing: border-box;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.modal-error {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(198, 40, 40, 0.12);
  color: var(--error);
  border-radius: 6px;
  font-size: 0.9rem;
}

.plan-content {
  overflow: auto;
  padding: 1rem;
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* When not inside spec modal, keep original max-height for plan content */
.modal-content:not(.modal-content-spec) .plan-content {
  flex: 1;
  max-height: 60vh;
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.generated-plan-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.agent-icon {
  font-size: 1.1rem;
}

/* ─── Modern Status Badges ──────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}

.status-badge.error {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid var(--error);
}

.status-badge.warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.status-badge.info {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid var(--info);
}

/* ─── Loading States ────────────────────────────────────────────────────── */
.loading-shimmer {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ─── Progress Bar ──────────────────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-bar-indeterminate .progress-bar-fill {
  width: 30% !important;
  animation: indeterminate 1.5s infinite;
}

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

/* ─── Tooltips ──────────────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ─── Card Variants ─────────────────────────────────────────────────────── */
.card-success {
  border-left-color: var(--success) !important;
}

.card-success::before {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%) !important;
}

.card-error {
  border-left-color: var(--error) !important;
}

.card-error::before {
  background: linear-gradient(135deg, var(--error) 0%, #f87171 100%) !important;
}

.card-warning {
  border-left-color: var(--warning) !important;
}

.card-warning::before {
  background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%) !important;
}

/* ─── Notification Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  min-width: 300px;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

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

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* ─── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2.5rem;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

.empty-state-icon {
  font-size: 3.25rem;
  margin-bottom: 1.25rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state-description {
  font-size: 0.95rem;
  max-width: 320px;
  line-height: 1.5;
}

/* ─── Responsive Tweaks ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wizard-steps {
    padding: 1rem;
    gap: 0.5rem;
  }
  
  .wizard-step {
    min-width: 80px;
  }
  
  .wizard-step-circle {
    width: 36px;
    height: 36px;
  }
  
  .wizard-step-connector {
    width: 30px;
  }
  
  .runner-widget.card {
    padding: 1.25rem;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Scrollbar Styling ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

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

/* Dark scrollbar for output logs */
.output-log::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.output-log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.output-log::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ─── Projects Table View ───────────────────────────────────────────────── */
.projects-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--bg);
}

.projects-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.projects-table thead {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}

.projects-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.projects-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.projects-table tbody tr:hover {
  background: var(--surface);
}

.projects-table tbody tr:last-child {
  border-bottom: none;
}

.projects-table td {
  padding: 1.25rem;
  vertical-align: middle;
}

.project-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.project-name-text {
  font-weight: 600;
  color: var(--text);
}

.project-specs-cell {
  color: var(--text-muted);
  font-weight: 500;
}

.project-time-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.time-icon {
  font-size: 0.9rem;
  opacity: 0.7;
}

.project-stages-cell {
  display: flex;
  gap: 0.75rem;
}

.stage-link {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: #3b82f6;
  background: transparent;
  transition: all var(--transition);
}

.stage-link:hover {
  text-decoration: underline;
}

.stage-link-hifi {
  color: #8b5cf6;
}

.project-actions-cell {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-action-edit {
  background: #f97316;
  color: #fff;
}

.btn-action-edit:hover {
  background: #ea580c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.btn-action-delete {
  background: transparent;
  color: #f97316;
  border: 1px solid #f97316;
}

.btn-action-delete:hover {
  background: rgba(249, 115, 22, 0.1);
}

.status-badge-table {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge-table.completed {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid #059669;
}

.status-badge-table.pending,
.status-badge-table.in-progress {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
  border: 1px solid #f97316;
}

/* Updated project cards for grid/list view */
.project-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}

.project-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.project-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.project-card-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-specs {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.project-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.action-icon:hover {
  transform: scale(1.08);
  background: var(--surface-hover);
}

.action-icon.action-run:hover {
  background: var(--accent);
  color: #fff;
}

.action-icon.action-report:hover {
  background: var(--info);
  color: #fff;
}

.action-icon.action-delete:hover {
  background: var(--error);
  color: #fff;
}

.projects-cards--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.projects-cards--list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projects-cards--list .project-card {
  border-radius: var(--radius-sm);
}

/* Table view */
.projects-table-wrapper {
  overflow-x: auto;
}

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

.projects-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}

.projects-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.projects-table tbody tr:hover {
  background: var(--surface);
}

.projects-table tbody tr:last-child td {
  border-bottom: none;
}

.project-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-name-text {
  font-weight: 600;
  color: var(--text);
}

.status-badge-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge-sm.success {
  background: var(--success-light);
  color: var(--success);
}

.status-badge-sm.pending {
  background: var(--surface);
  color: var(--text-muted);
}

/* Empty state refinements */
.projects-content .empty-state {
  padding: 4rem 2.5rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.projects-content .empty-state .btn {
  margin-top: 1.5rem;
}
