/* ─────────────────────────────────────────────────────────
   Rover Web Dashboard — Design System
   ─────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ──────────────────────────────────────────── */
:root {
  /* Colors */
  --teal:        #107e7a;
  --teal-light:  #14a89e;
  --teal-dim:    #0d6460;
  --teal-glow:   rgba(16, 126, 122, 0.25);

  --bg-900:  #080c0c;
  --bg-800:  #0e1515;
  --bg-700:  #131d1d;
  --bg-600:  #192525;
  --bg-500:  #1e2e2e;

  --surface-1: rgba(19, 29, 29, 0.85);
  --surface-2: rgba(25, 37, 37, 0.8);
  --surface-3: rgba(30, 46, 46, 0.75);

  --border:     rgba(16, 126, 122, 0.18);
  --border-mid: rgba(16, 126, 122, 0.3);
  --border-hi:  rgba(16, 126, 122, 0.55);

  --text-1: #e2efef;
  --text-2: #9bbdbd;
  --text-3: #6a9090;

  /* Status colors */
  --status-new:         #4a9fd4;
  --status-in-progress: #107e7a;
  --status-iterating:   #7c6cdc;
  --status-completed:   #3dba7e;
  --status-failed:      #d95555;
  --status-merged:      #3dba7e;
  --status-pushed:      #3dba7e;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-teal: 0 0 20px rgba(16, 126, 122, 0.18);
  --shadow-modal: 0 12px 60px rgba(0,0,0,0.7);

  /* Animation */
  --ease-smooth: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-mid: 260ms;
  --dur-slow: 400ms;
}

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

html { height: 100%; font-size: 14px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-900);
  color: var(--text-1);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-light); text-decoration: none; }
a:hover { color: var(--teal-light); text-decoration: underline; }

/* ── Background Grid ─────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 126, 122, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 126, 122, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -30%;
  left: -10%;
  width: 55%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(16, 126, 122, 0.065) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── App Layout ──────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: var(--space-6) 0;
  gap: 0;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.sidebar-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.sidebar-logo-text span {
  color: var(--teal-light);
}

.sidebar-section {
  padding: 0 var(--space-3) var(--space-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: var(--space-4);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  border-radius: 0;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--teal-glow), transparent);
  color: var(--teal-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--teal-light);
  border-radius: 0 3px 3px 0;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--teal);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-3);
}

.sidebar-footer .version { color: var(--text-3); }

/* ── Main Content ────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  gap: var(--space-4);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--dur-fast);
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  height: 34px;
}

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dim));
  color: #fff;
  border-color: var(--teal-dim);
  box-shadow: 0 2px 8px rgba(16, 126, 122, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--teal-light), var(--teal));
  box-shadow: 0 4px 16px rgba(16, 126, 122, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-mid);
}

.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text-1);
  border-color: var(--border-hi);
}

.btn-danger {
  background: rgba(217, 85, 85, 0.12);
  color: #e87878;
  border-color: rgba(217, 85, 85, 0.3);
}

.btn-danger:hover {
  background: rgba(217, 85, 85, 0.22);
  border-color: rgba(217, 85, 85, 0.55);
}

.btn-sm {
  height: 28px;
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Content Area ────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  scroll-behavior: smooth;
}

.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 10px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

/* ── Page sections ───────────────────────────────────── */
.page { display: none; animation: fadeIn var(--dur-mid) var(--ease-out); }
.page.active { display: block; }

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-1);
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: var(--space-1);
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

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

/* ── Stat Cards ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--teal)), transparent);
}

.stat-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-teal);
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--teal-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  color: var(--teal-light);
}

.stat-icon svg { width: 16px; height: 16px; }

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-1);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: var(--space-1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Task Table ──────────────────────────────────────── */
.task-table-wrap {
  overflow-x: auto;
}

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

.task-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.task-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(16, 126, 122, 0.07);
  font-size: 0.82rem;
  vertical-align: middle;
}

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

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

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

.task-id {
  font-family: 'JetBrains Mono', monospace;
  color: var(--teal-light);
  font-size: 0.78rem;
  font-weight: 500;
}

.task-title {
  font-weight: 500;
  color: var(--text-1);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-agent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--text-3);
  background: var(--bg-700);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Status Badge ────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-NEW       { color: var(--status-new); background: rgba(74,159,212,0.1); }
.status-IN_PROGRESS { color: var(--status-in-progress); background: rgba(16,126,122,0.15); animation: pulse-teal 2s ease-in-out infinite; }
.status-ITERATING   { color: var(--status-iterating); background: rgba(124,108,220,0.12); animation: pulse-purple 2s ease-in-out infinite; }
.status-COMPLETED   { color: var(--status-completed); background: rgba(61,186,126,0.12); }
.status-FAILED      { color: var(--status-failed); background: rgba(217,85,85,0.12); }
.status-MERGED      { color: var(--status-merged); background: rgba(61,186,126,0.12); }
.status-PUSHED      { color: var(--status-pushed); background: rgba(61,186,126,0.12); }

@keyframes pulse-teal {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}
@keyframes pulse-purple {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

.status-badge.status-IN_PROGRESS::before,
.status-badge.status-ITERATING::before {
  animation: dot-pulse 1.4s ease-in-out infinite;
}

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

/* ── Progress Bar ────────────────────────────────────── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 100px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-700);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  transition: width 0.5s var(--ease-out);
}

.progress-fill.done { background: linear-gradient(90deg, #3dba7e, #5dd6a0); }
.progress-fill.failed { background: linear-gradient(90deg, #d95555, #e87878); }
.progress-fill.purple { background: linear-gradient(90deg, #7c6cdc, #9f90e8); }

.progress-pct {
  font-size: 0.7rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  min-width: 28px;
  text-align: right;
}

/* ── Empty & Loading States ──────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-6);
  text-align: center;
  gap: var(--space-4);
  color: var(--text-3);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  color: var(--teal-light);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
}

.empty-state-desc {
  font-size: 0.8rem;
  max-width: 300px;
}

/* Loading spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--teal-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10);
  color: var(--text-3);
  font-size: 0.85rem;
}

/* ── Task Detail View ────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
}

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

.meta-item { }

.meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 0.82rem;
  color: var(--text-1);
  font-weight: 500;
}

.meta-value.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

/* ── Log Viewer ──────────────────────────────────────── */
.log-viewer {
  background: #050c0c;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: #9bbdbd;
  max-height: 480px;
  border: 1px solid var(--border);
}

.log-viewer::-webkit-scrollbar { width: 5px; }
.log-viewer::-webkit-scrollbar-track { background: transparent; }
.log-viewer::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 10px; }

.log-line { white-space: pre-wrap; word-break: break-all; }
.log-line.error { color: #e87878; }
.log-line.success { color: #5dd6a0; }
.log-line.info { color: var(--teal-light); }
.log-line.warn { color: #e8b878; }

/* ── Diff Viewer ─────────────────────────────────────── */
.diff-viewer {
  background: #050c0c;
  border-radius: var(--radius-md);
  overflow-x: auto;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  max-height: 500px;
  border: 1px solid var(--border);
}

.diff-viewer::-webkit-scrollbar { width: 5px; height: 5px; }
.diff-viewer::-webkit-scrollbar-track { background: transparent; }
.diff-viewer::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 10px; }

.diff-line {
  display: flex;
  padding: 1px var(--space-4);
  white-space: pre;
}

.diff-line:hover { background: rgba(255,255,255,0.03); }

.diff-line.added   { background: rgba(61,186,126,0.08); color: #7ee3ac; }
.diff-line.removed { background: rgba(217,85,85,0.08);  color: #e89090; }
.diff-line.hunk    { background: rgba(16,126,122,0.1);  color: var(--teal-light); }
.diff-line.header  { color: var(--text-3); }

.diff-gutter {
  min-width: 36px;
  color: var(--text-3);
  opacity: 0.4;
  user-select: none;
  padding-right: var(--space-3);
  flex-shrink: 0;
  text-align: right;
}

.diff-content { flex: 1; }

/* ── File List ───────────────────────────────────────── */
.file-list { display: flex; flex-direction: column; gap: 2px; }

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur-fast);
}

.file-item:hover { background: var(--surface-3); color: var(--text-1); }

.file-stat {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  font-size: 0.7rem;
}

.file-add  { color: var(--status-completed); }
.file-del  { color: var(--status-failed); }

/* ── Iteration Timeline ──────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: var(--space-3);
  position: relative;
  padding-bottom: var(--space-4);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-line {
  position: absolute;
  left: 9px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item:last-child .timeline-line { display: none; }

.timeline-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  background: var(--bg-800);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.timeline-dot.completed { border-color: var(--status-completed); background: rgba(61,186,126,0.15); }
.timeline-dot.failed    { border-color: var(--status-failed);    background: rgba(217,85,85,0.15); }
.timeline-dot.running   { border-color: var(--teal-light); background: var(--teal-glow); animation: pulse-teal 2s ease-in-out infinite; }

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

.timeline-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-1);
}

.timeline-time {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-mid);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-700);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-8);
  transform: scale(0.95) translateY(16px);
  transition: transform var(--dur-mid) var(--ease-out);
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.modal-title svg { color: var(--teal-light); width: 20px; height: 20px; }

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

/* ── Form Elements ───────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }

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

.form-label span { color: var(--status-failed); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-800);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-1);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
  -webkit-appearance: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(16, 126, 122, 0.18);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a9090' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option { background: var(--bg-700); }

.form-textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

.form-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: var(--space-1);
}

/* ── Toast Notifications ─────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: var(--bg-700);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.82rem;
  box-shadow: var(--shadow-card);
  animation: slideInRight var(--dur-mid) var(--ease-smooth);
  pointer-events: all;
  min-width: 280px;
  max-width: 400px;
}

.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--status-completed); }
.toast-error   { border-left: 3px solid var(--status-failed); }
.toast-info    { border-left: 3px solid var(--teal-light); }

.toast.removing {
  animation: slideOutRight var(--dur-mid) var(--ease-out) forwards;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* ── Info Page ───────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: var(--space-3); }

.project-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.project-card:hover {
  background: var(--surface-3);
  border-color: var(--border-mid);
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--teal-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-light);
  flex-shrink: 0;
}

.project-icon svg { width: 20px; height: 20px; }

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

.project-path {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}

.project-tasks-count {
  margin-left: auto;
  background: var(--teal-glow);
  color: var(--teal-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-mid);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Tabs ────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-800);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border);
  width: fit-content;
}

.tab-btn {
  padding: var(--space-2) var(--space-4);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all var(--dur-fast);
  font-family: inherit;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-2); background: var(--surface-3); }

.tab-btn.active {
  color: var(--text-1);
  background: var(--surface-3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Action Bar ──────────────────────────────────────── */
.action-bar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ── Inline Confirm ──────────────────────────────────── */
.confirm-popover {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-700);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 0.78rem;
  color: var(--text-2);
}

/* ── Auto-refresh indicator ──────────────────────────── */
.refresh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-light);
  animation: pulse-teal 2s ease-in-out infinite;
  display: inline-block;
}

/* ── Responsive tweaks ───────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar-logo-text,
  .nav-item span,
  .sidebar-section,
  .nav-badge,
  .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: var(--space-3); }
  .sidebar-logo { justify-content: center; padding: 0 0 var(--space-5); }
}

@media (max-width: 600px) {
  .content { padding: var(--space-4); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-meta-grid { grid-template-columns: 1fr; }
}

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: var(--space-5);
}

.breadcrumb-link {
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--dur-fast);
}

.breadcrumb-link:hover { color: var(--teal-light); }

.breadcrumb-sep { opacity: 0.4; }

.breadcrumb-current { color: var(--text-2); }

/* ── Utility ─────────────────────────────────────────── */
.text-teal  { color: var(--teal-light); }
.text-dim   { color: var(--text-3); }
.text-mono  { font-family: 'JetBrains Mono', monospace; }
.flex       { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2      { gap: var(--space-2); }
.gap-3      { gap: var(--space-3); }
.gap-4      { gap: var(--space-4); }
.mt-4       { margin-top: var(--space-4); }
.mt-5       { margin-top: var(--space-5); }
.mt-6       { margin-top: var(--space-6); }
.mb-4       { margin-bottom: var(--space-4); }
.mb-5       { margin-bottom: var(--space-5); }
.w-full     { width: 100%; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden     { display: none !important; }
