/* ============================================================
   AgentDesk — Design System + All Styles
   Dark mode only. AgentMail-inspired aesthetic.
   ============================================================ */

/* --- Palette ------------------------------------------------ */
:root {
  --bg:              #09090b;
  --surface:         #18181b;
  --surface-hover:   #27272a;
  --surface-alt:     #1e1e22;
  --text:            #fafafa;
  --text-muted:      #a1a1aa;
  --text-dim:        #71717a;
  --border:          rgba(255, 255, 255, 0.1);
  --border-strong:   rgba(255, 255, 255, 0.15);
  --accent:          #e4e4e7;
  --accent-text:     #09090b;
  --danger:          #ef4444;
  --success:         #22c55e;
  --warning:         #f59e0b;
  --info:            #3b82f6;
  --purple:          #a78bfa;
}

/* --- Typography --------------------------------------------- */
:root {
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'Geist Mono', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.25rem;
  --text-xl:    1.5rem;
  --text-2xl:   2rem;
}

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

/* --- Border Radius ------------------------------------------ */
:root {
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 9999px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

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

button {
  font-family: var(--font-mono);
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  outline: none;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--border-strong);
}

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

/* --- Utility Classes ---------------------------------------- */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.hidden { display: none !important; }

/* --- Dashed Grid Accent ------------------------------------- */
.dashed-border-top {
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.dashed-border-bottom {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

/* --- Bracket Section Label ---------------------------------- */
.section-label {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}
.section-label::before { content: '[ '; }
.section-label::after  { content: ' ]'; }

/* --- Buttons ------------------------------------------------ */
.btn {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all 0.15s ease;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover {
  background: #d4d4d8;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid transparent;
}
.btn-danger:hover {
  border-color: var(--danger);
}

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

/* --- Cards -------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.card:hover {
  border-color: var(--border-strong);
}

/* --- Status Badges ------------------------------------------ */
.badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
  font-weight: 500;
}

.badge-open        { background: rgba(250, 250, 250, 0.1);  color: var(--text-muted); }
.badge-assigned    { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.badge-in_progress { background: rgba(59, 130, 246, 0.15);  color: var(--info); }
.badge-blocked     { background: rgba(245, 158, 11, 0.15);  color: var(--warning); }
.badge-review      { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.badge-completed   { background: rgba(34, 197, 94, 0.15);   color: var(--success); }
.badge-cancelled   { background: rgba(239, 68, 68, 0.15);   color: var(--danger); }
.badge-active      { background: rgba(34, 197, 94, 0.15);   color: var(--success); }
.badge-achieved    { background: rgba(59, 130, 246, 0.15);  color: var(--info); }
.badge-abandoned   { background: rgba(239, 68, 68, 0.15);   color: var(--danger); }

/* Priority badges */
.badge-critical { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-high     { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-medium   { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-low      { background: rgba(113, 113, 122, 0.15); color: var(--text-dim); }

/* Type badges */
.badge-type-bug         { background: rgba(239, 68, 68, 0.15);  color: var(--danger); }
.badge-type-feature     { background: rgba(34, 197, 94, 0.15);  color: var(--success); }
.badge-type-improvement { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-type-task        { background: rgba(113, 113, 122, 0.15); color: var(--text-dim); }

/* --- Agent Type Dots ---------------------------------------- */
.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.agent-dot-claude-code { background: var(--purple); }
.agent-dot-codex       { background: var(--success); }
.agent-dot-cursor      { background: var(--info); }
.agent-dot-custom      { background: var(--text-dim); }

/* Status dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-active  { background: var(--success); }
.status-dot-idle    { background: var(--text-dim); }
.status-dot-offline { background: var(--danger); }

/* --- Priority Left Border ----------------------------------- */
.priority-critical { border-left: 3px solid var(--danger); }
.priority-high     { border-left: 3px solid var(--warning); }
.priority-medium   { border-left: 3px solid var(--info); }
.priority-low      { border-left: 3px solid var(--text-dim); }

/* --- Landing Page ------------------------------------------- */
#landing-page {
  background: var(--bg);
  min-height: 100vh;
}

.landing-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.landing-hero {
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  border-bottom: 1px solid var(--border);
}

.landing-hero .wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-bottom: var(--space-6);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-headline {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.landing-subhead {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto var(--space-8);
}

.landing-section {
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--border);
}

.landing-section:last-child {
  border-bottom: none;
}

.landing-section > .landing-container > .section-label {
  margin-bottom: var(--space-6);
}

.landing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}

.landing-card:last-child {
  margin-bottom: 0;
}

.landing-card-title {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--text);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.landing-card-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.landing-code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.landing-code-block:last-child {
  margin-bottom: 0;
}

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

.landing-code-lang {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-code-block pre {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
}

.landing-code-block code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre;
}

/* How It Works steps */
.landing-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.landing-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.landing-step-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.landing-step-content h4 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.landing-step-content p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.landing-why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.landing-why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.landing-why-card h4 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.landing-why-card p {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.landing-cta {
  padding: var(--space-12) 0 var(--space-16);
}

.landing-cta-text {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.google-btn {
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  transition: background 0.15s ease;
}

.google-btn:hover { background: #d4d4d8; }

.google-btn svg {
  width: 18px;
  height: 18px;
}

/* --- Header / Nav ------------------------------------------- */
#app-header {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  gap: var(--space-1);
  margin-left: var(--space-8);
  flex: 1;
}

.header-nav a {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.header-nav a:hover {
  color: var(--text);
}

.header-nav a.active {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.project-selector {
  position: relative;
}

.project-selector-btn {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: transparent;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 200px;
}

.project-selector-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.project-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 220px;
  z-index: 200;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.project-dropdown.open {
  display: block;
}

.project-dropdown-item {
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
}

.project-dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.project-dropdown-item.new-project {
  color: var(--accent);
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.sign-out-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
}

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

/* --- Main Content ------------------------------------------- */
#app-shell {
  display: none;
}

#main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
}

/* --- Modal -------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 480px;
}

.modal h2 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

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

.modal label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.modal .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

/* --- Banner ------------------------------------------------- */
.banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

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

.banner-error {
  border-left: 3px solid var(--danger);
}

.banner .api-key-display {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  user-select: all;
}

.banner-dismiss {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: var(--text-lg);
  padding: 0 var(--space-1);
}

/* --- Empty States ------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state p {
  color: var(--text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

.empty-state .code-block {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: inline-block;
  color: var(--text-muted);
  margin-top: var(--space-2);
  user-select: all;
}

/* --- Dashboard Layout --------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
}

.dashboard-main { min-width: 0; }
.dashboard-sidebar { min-width: 0; }

/* --- Summary Bar -------------------------------------------- */
.summary-bar {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.summary-item:hover {
  border-color: var(--border);
  color: var(--text);
}

.summary-item .count {
  font-weight: 600;
  color: var(--text);
}

/* --- Activity Feed ------------------------------------------ */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: var(--text-sm);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  line-height: 1.6;
}

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

.activity-timestamp {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: var(--text-xs);
  flex-shrink: 0;
  min-width: 55px;
}

.activity-agent {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

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

.activity-task {
  color: var(--text);
  cursor: pointer;
}

.activity-task:hover {
  text-decoration: underline;
}

/* --- Fleet Panel -------------------------------------------- */
.fleet-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fleet-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.fleet-item:hover {
  background: var(--surface-hover);
}

.fleet-agent-name {
  font-family: var(--font-mono);
  color: var(--text);
  flex: 1;
}

.fleet-task {
  font-size: var(--text-xs);
  color: var(--text-dim);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-lastseen {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

/* --- Task Views --------------------------------------------- */
.view-toggle {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.view-toggle button {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: transparent;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.view-toggle button.active {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

/* Kanban */
.kanban-board {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-4);
}

.kanban-column {
  min-width: 240px;
  max-width: 280px;
  flex: 1;
}

.kanban-column-header {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-2) var(--space-2);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  background: var(--surface);
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
}

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

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.task-card:hover {
  border-color: var(--border-strong);
}

.task-card-title {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.task-card-agent {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.task-card-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  margin-left: auto;
}

.task-card-pr {
  color: var(--text-dim);
  font-size: var(--text-xs);
}

/* Task list view */
.task-list-table {
  width: 100%;
  border-collapse: collapse;
}

.task-list-table th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.task-list-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: var(--text-sm);
}

.task-list-table tr {
  cursor: pointer;
}

.task-list-table tr:hover td {
  background: var(--surface);
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select {
  width: auto;
  min-width: 120px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  background: var(--surface);
}

/* --- Task Detail (Slide-over) ------------------------------- */
.slide-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 250;
}

.slide-over {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 260;
  overflow-y: auto;
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.slide-over.open {
  transform: translateX(0);
}

.slide-over-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
}

.slide-over-title {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
  margin-right: var(--space-4);
}

.slide-over-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: var(--text-xl);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

.detail-badges {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.detail-section {
  margin-bottom: var(--space-6);
}

.detail-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.detail-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 100px;
}

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

.detail-value a {
  color: var(--info);
}

.detail-value a:hover {
  text-decoration: underline;
}

/* Payload viewer */
.payload-viewer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Transition timeline */
.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

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

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

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-6) + 6px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
}

.timeline-dot-open        { border-color: var(--text-muted); }
.timeline-dot-assigned    { border-color: var(--purple); }
.timeline-dot-in_progress { border-color: var(--info); }
.timeline-dot-blocked     { border-color: var(--warning); }
.timeline-dot-review      { border-color: var(--purple); }
.timeline-dot-completed   { border-color: var(--success); background: var(--success); }
.timeline-dot-cancelled   { border-color: var(--danger); background: var(--danger); }

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

.timeline-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.timeline-agent {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.timeline-status-change {
  font-size: var(--text-sm);
  color: var(--text);
}

.timeline-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-style: italic;
}

.timeline-payload {
  margin-top: var(--space-1);
}

.timeline-payload summary {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  cursor: pointer;
}

/* --- Outcomes View ------------------------------------------ */
.outcome-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.outcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.outcome-card:hover {
  border-color: var(--border-strong);
}

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

.outcome-title {
  font-size: var(--text-base);
  font-weight: 500;
}

.outcome-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.progress-bar {
  width: 120px;
  height: 4px;
  background: var(--surface-hover);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* --- Agents View -------------------------------------------- */
.agents-table {
  width: 100%;
  border-collapse: collapse;
}

.agents-table th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.agents-table td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: var(--text-sm);
}

.agents-table tr:hover td {
  background: var(--surface);
}

.agent-name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
}

/* --- Settings View ------------------------------------------ */
.settings-section {
  margin-bottom: var(--space-8);
}

.settings-section h3 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

.api-key-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.api-key-masked {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: var(--bg);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.setup-command {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--text-muted);
  user-select: all;
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* --- Skeleton Loading --------------------------------------- */
.skeleton {
  background: var(--surface);
  border-radius: var(--radius-md);
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
  height: 14px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
}

.skeleton-card {
  height: 80px;
  margin-bottom: var(--space-3);
}

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

/* --- Copy button -------------------------------------------- */
.copy-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  cursor: pointer;
  flex-shrink: 0;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* --- Responsive (1024px+) ----------------------------------- */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .kanban-column {
    min-width: 200px;
  }
  .slide-over {
    width: 100vw;
  }
}
